From a019d0e02a03feb6922130771f89330c9c30a992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Wed, 29 Oct 2025 14:38:56 +0100 Subject: [PATCH 1/6] chore: use Pydantic to generate OpenAPI schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes the need for the strong_typing and pyopenapi packages and purely use Pydantic for schema generation. Signed-off-by: Sébastien Han --- .pre-commit-config.yaml | 5 +- client-sdks/stainless/openapi.yml | 20208 ++++++++++------ docs/openapi_generator/README.md | 1 - docs/openapi_generator/generate.py | 134 - docs/openapi_generator/pyopenapi/README.md | 1 - docs/openapi_generator/pyopenapi/__init__.py | 5 - docs/openapi_generator/pyopenapi/generator.py | 1175 - .../openapi_generator/pyopenapi/operations.py | 463 - docs/openapi_generator/pyopenapi/options.py | 78 - .../pyopenapi/specification.py | 269 - .../openapi_generator/pyopenapi/template.html | 41 - docs/openapi_generator/pyopenapi/utility.py | 288 - .../run_openapi_generator.sh | 34 - docs/static/deprecated-llama-stack-spec.yaml | 28 +- .../static/experimental-llama-stack-spec.yaml | 5539 ++--- docs/static/llama-stack-spec.html | 13724 ----------- docs/static/llama-stack-spec.yaml | 8941 ++++--- docs/static/stainless-llama-stack-spec.yaml | 20194 +++++++++------ pyproject.toml | 12 +- scripts/fastapi_generator.py | 1002 + src/llama_stack/apis/vector_io/vector_io.py | 3 +- src/llama_stack/core/library_client.py | 13 +- src/llama_stack/core/utils/type_inspection.py | 45 + src/llama_stack/schema_utils.py | 43 +- src/llama_stack/strong_typing/__init__.py | 19 - src/llama_stack/strong_typing/auxiliary.py | 229 - src/llama_stack/strong_typing/classdef.py | 440 - src/llama_stack/strong_typing/core.py | 46 - src/llama_stack/strong_typing/deserializer.py | 872 - src/llama_stack/strong_typing/docstring.py | 410 - src/llama_stack/strong_typing/exception.py | 23 - src/llama_stack/strong_typing/inspection.py | 1104 - src/llama_stack/strong_typing/mapping.py | 39 - src/llama_stack/strong_typing/name.py | 188 - src/llama_stack/strong_typing/py.typed | 0 src/llama_stack/strong_typing/schema.py | 791 - .../strong_typing/serialization.py | 97 - src/llama_stack/strong_typing/serializer.py | 494 - src/llama_stack/strong_typing/slots.py | 27 - src/llama_stack/strong_typing/topological.py | 90 - uv.lock | 58 +- 41 files changed, 35048 insertions(+), 42125 deletions(-) delete mode 100644 docs/openapi_generator/README.md delete mode 100644 docs/openapi_generator/generate.py delete mode 100644 docs/openapi_generator/pyopenapi/README.md delete mode 100644 docs/openapi_generator/pyopenapi/__init__.py delete mode 100644 docs/openapi_generator/pyopenapi/generator.py delete mode 100644 docs/openapi_generator/pyopenapi/operations.py delete mode 100644 docs/openapi_generator/pyopenapi/options.py delete mode 100644 docs/openapi_generator/pyopenapi/specification.py delete mode 100644 docs/openapi_generator/pyopenapi/template.html delete mode 100644 docs/openapi_generator/pyopenapi/utility.py delete mode 100755 docs/openapi_generator/run_openapi_generator.sh delete mode 100644 docs/static/llama-stack-spec.html create mode 100755 scripts/fastapi_generator.py create mode 100644 src/llama_stack/core/utils/type_inspection.py delete mode 100644 src/llama_stack/strong_typing/__init__.py delete mode 100644 src/llama_stack/strong_typing/auxiliary.py delete mode 100644 src/llama_stack/strong_typing/classdef.py delete mode 100644 src/llama_stack/strong_typing/core.py delete mode 100644 src/llama_stack/strong_typing/deserializer.py delete mode 100644 src/llama_stack/strong_typing/docstring.py delete mode 100644 src/llama_stack/strong_typing/exception.py delete mode 100644 src/llama_stack/strong_typing/inspection.py delete mode 100644 src/llama_stack/strong_typing/mapping.py delete mode 100644 src/llama_stack/strong_typing/name.py delete mode 100644 src/llama_stack/strong_typing/py.typed delete mode 100644 src/llama_stack/strong_typing/schema.py delete mode 100644 src/llama_stack/strong_typing/serialization.py delete mode 100644 src/llama_stack/strong_typing/serializer.py delete mode 100644 src/llama_stack/strong_typing/slots.py delete mode 100644 src/llama_stack/strong_typing/topological.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ce0d79b21a..279c5791e6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,6 @@ repos: hooks: - id: ruff args: [ --fix ] - exclude: ^src/llama_stack/strong_typing/.*$ - id: ruff-format - repo: https://github.com/adamchainz/blacken-docs @@ -111,11 +110,11 @@ repos: name: API Spec Codegen additional_dependencies: - uv==0.7.8 - entry: sh -c './scripts/uv-run-with-index.sh run ./docs/openapi_generator/run_openapi_generator.sh > /dev/null' + entry: sh -c './scripts/uv-run-with-index.sh run scripts/fastapi_generator.py docs/static' language: python pass_filenames: false require_serial: true - files: ^src/llama_stack/apis/|^docs/openapi_generator/ + files: ^src/llama_stack/apis/ - id: check-workflows-use-hashes name: Check GitHub Actions use SHA-pinned actions entry: ./scripts/check-workflows-use-hashes.sh diff --git a/client-sdks/stainless/openapi.yml b/client-sdks/stainless/openapi.yml index f6699aef24..120c20b6ad 100644 --- a/client-sdks/stainless/openapi.yml +++ b/client-sdks/stainless/openapi.yml @@ -172,36 +172,44 @@ paths: tags: - Inference summary: List chat completions. - description: List chat completions. + description: >- + List chat completions. + + :param after: The ID of the last chat completion to return. + :param limit: The maximum number of chat completions to return. + :param model: The model to filter by. + :param order: The order to sort the chat completions by: "asc" or + "desc". Defaults to "desc". + :returns: A ListOpenAIChatCompletionResponse. parameters: - name: after - in: query description: >- The ID of the last chat completion to return. required: false schema: type: string - - name: limit in: query + - name: limit description: >- The maximum number of chat completions to return. required: false schema: type: integer - - name: model in: query + - name: model description: The model to filter by. required: false schema: type: string - - name: order in: query + - name: order description: >- The order to sort the chat completions by: "asc" or "desc". Defaults to "desc". required: false schema: $ref: '#/components/schemas/Order' + in: query deprecated: false post: responses: @@ -210,9 +218,8 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletion' - - $ref: '#/components/schemas/OpenAIChatCompletionChunk' + $ref: '#/components/schemas/llama_stack.apis.inference.inference.OpenAIChatCompletion + | collections.abc.AsyncIterator[llama_stack.apis.inference.inference.OpenAIChatCompletionChunk]' '400': $ref: '#/components/responses/BadRequest400' '429': @@ -231,12 +238,13 @@ paths: Generate an OpenAI-compatible chat completion for the given messages using the specified model. + :returns: An OpenAIChatCompletion. parameters: [] requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenAIChatCompletionRequestWithExtraBody' + id: Annotated required: true deprecated: false /v1/chat/completions/{completion_id}: @@ -265,13 +273,16 @@ paths: Get chat completion. Describe a chat completion by its ID. + + :param completion_id: ID of the chat completion. + :returns: A OpenAICompletionWithInputMessages. parameters: - name: completion_id - in: path description: ID of the chat completion. required: true schema: type: string + in: path deprecated: false /v1/completions: post: @@ -300,12 +311,13 @@ paths: Generate an OpenAI-compatible completion for the given prompt using the specified model. + :returns: An OpenAICompletion. parameters: [] requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenAICompletionRequestWithExtraBody' + id: Annotated required: true deprecated: false /v1/conversations: @@ -334,6 +346,11 @@ paths: Create a conversation. Create a conversation. + + :param items: Initial items to include in the conversation context. + :param metadata: Set of key-value pairs that can be attached to an + object. + :returns: The created conversation object. parameters: [] requestBody: content: @@ -368,13 +385,16 @@ paths: Retrieve a conversation. Get a conversation with the given ID. + + :param conversation_id: The conversation identifier. + :returns: The conversation object. parameters: - name: conversation_id - in: path description: The conversation identifier. required: true schema: type: string + in: path deprecated: false post: responses: @@ -401,13 +421,18 @@ paths: Update a conversation. Update a conversation's metadata with the given ID. + + :param conversation_id: The conversation identifier. + :param metadata: Set of key-value pairs that can be attached to an + object. + :returns: The updated conversation object. parameters: - name: conversation_id - in: path description: The conversation identifier. required: true schema: type: string + in: path requestBody: content: application/json: @@ -440,13 +465,16 @@ paths: Delete a conversation. Delete a conversation with the given ID. + + :param conversation_id: The conversation identifier. + :returns: The deleted conversation resource. parameters: - name: conversation_id - in: path description: The conversation identifier. required: true schema: type: string + in: path deprecated: false /v1/conversations/{conversation_id}/items: get: @@ -474,57 +502,49 @@ paths: List items. List items in the conversation. + + :param conversation_id: The conversation identifier. + :param after: An item ID to list items after, used in pagination. + :param include: Specify additional output data to include in the response. + :param limit: A limit on the number of objects to be returned (1-100, + default 20). + :param order: The order to return items in (asc or desc, default desc). + :returns: List of conversation items. parameters: - name: conversation_id - in: path description: The conversation identifier. required: true schema: type: string + in: path - name: after - in: query description: >- An item ID to list items after, used in pagination. required: false schema: type: string - - name: include in: query + - name: include description: >- Specify additional output data to include in the response. required: false schema: - type: array - items: - type: string - enum: - - web_search_call.action.sources - - code_interpreter_call.outputs - - computer_call_output.output.image_url - - file_search_call.results - - message.input_image.image_url - - message.output_text.logprobs - - reasoning.encrypted_content - title: ConversationItemInclude - description: >- - Specify additional output data to include in the model response. - - name: limit + $ref: '#/components/schemas/list' in: query + - name: limit description: >- A limit on the number of objects to be returned (1-100, default 20). required: false schema: type: integer - - name: order in: query + - name: order description: >- The order to return items in (asc or desc, default desc). required: false schema: - type: string - enum: - - asc - - desc + $ref: '#/components/schemas/Literal' + in: query deprecated: false post: responses: @@ -551,13 +571,17 @@ paths: Create items. Create items in the conversation. + + :param conversation_id: The conversation identifier. + :param items: Items to include in the conversation context. + :returns: List of created items. parameters: - name: conversation_id - in: path description: The conversation identifier. required: true schema: type: string + in: path requestBody: content: application/json: @@ -573,7 +597,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ConversationItem' + id: Annotated '400': $ref: '#/components/responses/BadRequest400' '429': @@ -591,19 +615,23 @@ paths: Retrieve an item. Retrieve a conversation item. + + :param conversation_id: The conversation identifier. + :param item_id: The item identifier. + :returns: The conversation item. parameters: - name: conversation_id - in: path description: The conversation identifier. required: true schema: type: string - - name: item_id in: path + - name: item_id description: The item identifier. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -630,19 +658,23 @@ paths: Delete an item. Delete a conversation item. + + :param conversation_id: The conversation identifier. + :param item_id: The item identifier. + :returns: The deleted item resource. parameters: - name: conversation_id - in: path description: The conversation identifier. required: true schema: type: string - - name: item_id in: path + - name: item_id description: The item identifier. required: true schema: type: string + in: path deprecated: false /v1/embeddings: post: @@ -672,12 +704,13 @@ paths: Generate OpenAI-compatible embeddings for the given input using the specified model. + :returns: An OpenAIEmbeddingsResponse containing the embeddings. parameters: [] requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody' + id: Annotated required: true deprecated: false /v1/files: @@ -707,9 +740,19 @@ paths: List files. Returns a list of files that belong to the user's organization. + + :param after: A cursor for use in pagination. `after` is an object + ID that defines your place in the list. For instance, if you make a list request + and receive 100 objects, ending with obj_foo, your subsequent call can include + after=obj_foo in order to fetch the next page of the list. + :param limit: A limit on the number of objects to be returned. Limit + can range between 1 and 10,000, and the default is 10,000. + :param order: Sort order by the `created_at` timestamp of the objects. + `asc` for ascending order and `desc` for descending order. + :param purpose: Only return files with the given purpose. + :returns: An ListOpenAIFileResponse containing the list of files. parameters: - name: after - in: query description: >- A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive @@ -718,29 +761,30 @@ paths: required: false schema: type: string - - name: limit in: query + - name: limit description: >- A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000. required: false schema: type: integer - - name: order in: query + - name: order description: >- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. required: false schema: $ref: '#/components/schemas/Order' - - name: purpose in: query + - name: purpose description: >- Only return files with the given purpose. required: false schema: $ref: '#/components/schemas/OpenAIFilePurpose' + in: query deprecated: false post: responses: @@ -769,14 +813,19 @@ paths: Upload a file that can be used across various endpoints. + The file upload should be a multipart form request with: + - file: The File object (not file name) to be uploaded. + - purpose: The intended purpose of the uploaded file. + - expires_after: Optional form values describing expiration for the + file. - The file upload should be a multipart form request with: - - - file: The File object (not file name) to be uploaded. - - - purpose: The intended purpose of the uploaded file. - - - expires_after: Optional form values describing expiration for the file. + :param file: The uploaded file object containing content and metadata + (filename, content_type, etc.). + :param purpose: The intended purpose of the uploaded file (e.g., "assistants", + "fine-tune"). + :param expires_after: Optional form values describing expiration for + the file. + :returns: An OpenAIFileObject representing the uploaded file. parameters: [] requestBody: content: @@ -823,14 +872,17 @@ paths: Retrieve file. Returns information about a specific file. + + :param file_id: The ID of the file to use for this request. + :returns: An OpenAIFileObject containing file information. parameters: - name: file_id - in: path description: >- The ID of the file to use for this request. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -854,15 +906,19 @@ paths: tags: - Files summary: Delete file. - description: Delete file. + description: >- + Delete file. + + :param file_id: The ID of the file to use for this request. + :returns: An OpenAIFileDeleteResponse indicating successful deletion. parameters: - name: file_id - in: path description: >- The ID of the file to use for this request. required: true schema: type: string + in: path deprecated: false /v1/files/{file_id}/content: get: @@ -891,14 +947,17 @@ paths: Retrieve file content. Returns the contents of the specified file. + + :param file_id: The ID of the file to use for this request. + :returns: The raw file content as a binary response. parameters: - name: file_id - in: path description: >- The ID of the file to use for this request. required: true schema: type: string + in: path deprecated: false /v1/health: get: @@ -927,6 +986,8 @@ paths: Get health status. Get the current health status of the service. + + :returns: Health information indicating if the service is operational. parameters: [] deprecated: false /v1/inspect/routes: @@ -1023,6 +1084,13 @@ paths: Register model. Register a model. + + :param model_id: The identifier of the model to register. + :param provider_model_id: The identifier of the model in the provider. + :param provider_id: The identifier of the provider. + :param metadata: Any additional metadata for this model. + :param model_type: The type of model to register. + :returns: A Model. parameters: [] requestBody: content: @@ -1057,13 +1125,16 @@ paths: Get model. Get a model by its identifier. + + :param model_id: The identifier of the model to get. + :returns: A Model. parameters: - name: model_id - in: path description: The identifier of the model to get. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -1086,14 +1157,16 @@ paths: Unregister model. Unregister a model. + + :param model_id: The identifier of the model to unregister. parameters: - name: model_id - in: path description: >- The identifier of the model to unregister. required: true schema: type: string + in: path deprecated: false /v1/moderations: post: @@ -1121,6 +1194,12 @@ paths: Create moderation. Classifies if text and/or image inputs are potentially harmful. + :param input: Input (or inputs) to classify. + Can be a single string, an array of strings, or an array of multi-modal + input objects similar to other models. + :param model: (Optional) The content moderation model you would like + to use. + :returns: A moderation object. parameters: [] requestBody: content: @@ -1152,7 +1231,10 @@ paths: tags: - Prompts summary: List all prompts. - description: List all prompts. + description: >- + List all prompts. + + :returns: A ListPromptsResponse containing all prompts. parameters: [] deprecated: false post: @@ -1180,6 +1262,11 @@ paths: Create prompt. Create a new prompt. + + :param prompt: The prompt text content with variable placeholders. + :param variables: List of variable names that can be used in the prompt + template. + :returns: The created Prompt resource. parameters: [] requestBody: content: @@ -1214,20 +1301,24 @@ paths: Get prompt. Get a prompt by its identifier and optional version. + + :param prompt_id: The identifier of the prompt to get. + :param version: The version of the prompt to get (defaults to latest). + :returns: A Prompt resource. parameters: - name: prompt_id - in: path description: The identifier of the prompt to get. required: true schema: type: string + in: path - name: version - in: query description: >- The version of the prompt to get (defaults to latest). required: false schema: type: integer + in: query deprecated: false post: responses: @@ -1255,13 +1346,21 @@ paths: Update prompt. Update an existing prompt (increments version). + + :param prompt_id: The identifier of the prompt to update. + :param prompt: The updated prompt text content. + :param version: The current version of the prompt being updated. + :param variables: Updated list of variable names that can be used + in the prompt template. + :param set_as_default: Set the new version as the default (default=True). + :returns: The updated Prompt resource with incremented version. parameters: - name: prompt_id - in: path description: The identifier of the prompt to update. required: true schema: type: string + in: path requestBody: content: application/json: @@ -1290,13 +1389,15 @@ paths: Delete prompt. Delete a prompt. + + :param prompt_id: The identifier of the prompt to delete. parameters: - name: prompt_id - in: path description: The identifier of the prompt to delete. required: true schema: type: string + in: path deprecated: false /v1/prompts/{prompt_id}/set-default-version: post: @@ -1325,13 +1426,17 @@ paths: Set prompt version. Set which version of a prompt should be the default in get_prompt (latest). + + :param prompt_id: The identifier of the prompt. + :param version: The version to set as default. + :returns: The prompt with the specified version now set as default. parameters: - name: prompt_id - in: path description: The identifier of the prompt. required: true schema: type: string + in: path requestBody: content: application/json: @@ -1366,14 +1471,17 @@ paths: List prompt versions. List all versions of a specific prompt. + + :param prompt_id: The identifier of the prompt to list versions for. + :returns: A ListPromptsResponse containing all versions of the prompt. parameters: - name: prompt_id - in: path description: >- The identifier of the prompt to list versions for. required: true schema: type: string + in: path deprecated: false /v1/providers: get: @@ -1402,6 +1510,9 @@ paths: List providers. List all available providers. + + :returns: A ListProvidersResponse containing information about all + providers. parameters: [] deprecated: false /v1/providers/{provider_id}: @@ -1431,13 +1542,16 @@ paths: Get provider. Get detailed information about a specific provider. + + :param provider_id: The ID of the provider to inspect. + :returns: A ProviderInfo object containing the provider's details. parameters: - name: provider_id - in: path description: The ID of the provider to inspect. required: true schema: type: string + in: path deprecated: false /v1/responses: get: @@ -1461,33 +1575,41 @@ paths: tags: - Agents summary: List all responses. - description: List all responses. + description: >- + List all responses. + + :param after: The ID of the last response to return. + :param limit: The number of responses to return. + :param model: The model to filter responses by. + :param order: The order to sort responses by when sorted by created_at + ('asc' or 'desc'). + :returns: A ListOpenAIResponseObject. parameters: - name: after - in: query description: The ID of the last response to return. required: false schema: type: string - - name: limit in: query + - name: limit description: The number of responses to return. required: false schema: type: integer - - name: model in: query + - name: model description: The model to filter responses by. required: false schema: type: string - - name: order in: query + - name: order description: >- The order to sort responses by when sorted by created_at ('asc' or 'desc'). required: false schema: $ref: '#/components/schemas/Order' + in: query deprecated: false post: responses: @@ -1499,7 +1621,7 @@ paths: $ref: '#/components/schemas/OpenAIResponseObject' text/event-stream: schema: - $ref: '#/components/schemas/OpenAIResponseObjectStream' + $ref: '#/components/schemas/AsyncIterator' '400': $ref: '#/components/responses/BadRequest400' '429': @@ -1513,7 +1635,21 @@ paths: tags: - Agents summary: Create a model response. - description: Create a model response. + description: >- + Create a model response. + + :param input: Input message(s) to create the response. + :param model: The underlying LLM used for completions. + :param previous_response_id: (Optional) if specified, the new response + will be a continuation of the previous response. This can be used to easily + fork-off new responses from existing responses. + :param conversation: (Optional) The ID of a conversation to add the + response to. Must begin with 'conv_'. Input and output messages will be automatically + added to the conversation. + :param include: (Optional) Additional fields to include in the response. + :param guardrails: (Optional) List of guardrails to apply during response + generation. Can be guardrail IDs (strings) or guardrail specifications. + :returns: An OpenAIResponseObject. parameters: [] requestBody: content: @@ -1525,15 +1661,11 @@ paths: x-llama-stack-extra-body-params: - name: guardrails schema: - type: array - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ResponseGuardrailSpec' + id: Annotated description: >- List of guardrails to apply during response generation. Guardrails provide safety and content moderation. - required: false + required: true /v1/responses/{response_id}: get: responses: @@ -1556,15 +1688,19 @@ paths: tags: - Agents summary: Get a model response. - description: Get a model response. + description: >- + Get a model response. + + :param response_id: The ID of the OpenAI response to retrieve. + :returns: An OpenAIResponseObject. parameters: - name: response_id - in: path description: >- The ID of the OpenAI response to retrieve. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -1587,14 +1723,18 @@ paths: tags: - Agents summary: Delete a response. - description: Delete a response. + description: >- + Delete a response. + + :param response_id: The ID of the OpenAI response to delete. + :returns: An OpenAIDeleteResponseObject parameters: - name: response_id - in: path description: The ID of the OpenAI response to delete. required: true schema: type: string + in: path deprecated: false /v1/responses/{response_id}/input_items: get: @@ -1618,53 +1758,61 @@ paths: tags: - Agents summary: List input items. - description: List input items. + description: >- + List input items. + + :param response_id: The ID of the response to retrieve input items for. + :param after: An item ID to list items after, used for pagination. + :param before: An item ID to list items before, used for pagination. + :param include: Additional fields to include in the response. + :param limit: A limit on the number of objects to be returned. Limit + can range between 1 and 100, and the default is 20. + :param order: The order to return the input items in. Default is desc. + :returns: An ListOpenAIResponseInputItem. parameters: - name: response_id - in: path description: >- The ID of the response to retrieve input items for. required: true schema: type: string + in: path - name: after - in: query description: >- An item ID to list items after, used for pagination. required: false schema: type: string - - name: before in: query + - name: before description: >- An item ID to list items before, used for pagination. required: false schema: type: string - - name: include in: query + - name: include description: >- Additional fields to include in the response. required: false schema: - type: array - items: - type: string - - name: limit + $ref: '#/components/schemas/list' in: query + - name: limit description: >- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. required: false schema: type: integer - - name: order in: query + - name: order description: >- The order to return the input items in. Default is desc. required: false schema: $ref: '#/components/schemas/Order' + in: query deprecated: false /v1/safety/run-shield: post: @@ -1692,6 +1840,11 @@ paths: Run shield. Run a shield. + + :param shield_id: The identifier of the shield to run. + :param messages: The messages to run the shield on. + :param params: The parameters of the shield. + :returns: A RunShieldResponse. parameters: [] requestBody: content: @@ -1722,7 +1875,10 @@ paths: tags: - ScoringFunctions summary: List all scoring functions. - description: List all scoring functions. + description: >- + List all scoring functions. + + :returns: A ListScoringFunctionsResponse. parameters: [] deprecated: false post: @@ -1742,7 +1898,18 @@ paths: tags: - ScoringFunctions summary: Register a scoring function. - description: Register a scoring function. + description: >- + Register a scoring function. + + :param scoring_fn_id: The ID of the scoring function to register. + :param description: The description of the scoring function. + :param return_type: The return type of the scoring function. + :param provider_scoring_fn_id: The ID of the provider scoring function + to use for the scoring function. + :param provider_id: The ID of the provider to use for the scoring + function. + :param params: The parameters for the scoring function for benchmark + eval, these can be overridden for app eval. parameters: [] requestBody: content: @@ -1773,14 +1940,18 @@ paths: tags: - ScoringFunctions summary: Get a scoring function by its ID. - description: Get a scoring function by its ID. + description: >- + Get a scoring function by its ID. + + :param scoring_fn_id: The ID of the scoring function to get. + :returns: A ScoringFn. parameters: - name: scoring_fn_id - in: path description: The ID of the scoring function to get. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -1799,15 +1970,18 @@ paths: tags: - ScoringFunctions summary: Unregister a scoring function. - description: Unregister a scoring function. + description: >- + Unregister a scoring function. + + :param scoring_fn_id: The ID of the scoring function to unregister. parameters: - name: scoring_fn_id - in: path description: >- The ID of the scoring function to unregister. required: true schema: type: string + in: path deprecated: false /v1/scoring/score: post: @@ -1832,7 +2006,12 @@ paths: tags: - Scoring summary: Score a list of rows. - description: Score a list of rows. + description: >- + Score a list of rows. + + :param input_rows: The rows to score. + :param scoring_functions: The scoring functions to use for the scoring. + :returns: A ScoreResponse object containing rows and aggregated results. parameters: [] requestBody: content: @@ -1863,7 +2042,13 @@ paths: tags: - Scoring summary: Score a batch of rows. - description: Score a batch of rows. + description: >- + Score a batch of rows. + + :param dataset_id: The ID of the dataset to score. + :param scoring_functions: The scoring functions to use for the scoring. + :param save_results_dataset: Whether to save the results to a dataset. + :returns: A ScoreBatchResponse. parameters: [] requestBody: content: @@ -1894,7 +2079,10 @@ paths: tags: - Shields summary: List all shields. - description: List all shields. + description: >- + List all shields. + + :returns: A ListShieldsResponse. parameters: [] deprecated: false post: @@ -1918,7 +2106,14 @@ paths: tags: - Shields summary: Register a shield. - description: Register a shield. + description: >- + Register a shield. + + :param shield_id: The identifier of the shield to register. + :param provider_shield_id: The identifier of the shield in the provider. + :param provider_id: The identifier of the provider. + :param params: The parameters of the shield. + :returns: A Shield. parameters: [] requestBody: content: @@ -1949,14 +2144,18 @@ paths: tags: - Shields summary: Get a shield by its identifier. - description: Get a shield by its identifier. + description: >- + Get a shield by its identifier. + + :param identifier: The identifier of the shield to get. + :returns: A Shield. parameters: - name: identifier - in: path description: The identifier of the shield to get. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -1975,15 +2174,18 @@ paths: tags: - Shields summary: Unregister a shield. - description: Unregister a shield. + description: >- + Unregister a shield. + + :param identifier: The identifier of the shield to unregister. parameters: - name: identifier - in: path description: >- The identifier of the shield to unregister. required: true schema: type: string + in: path deprecated: false /v1/tool-runtime/invoke: post: @@ -2007,7 +2209,12 @@ paths: tags: - ToolRuntime summary: Run a tool with the given arguments. - description: Run a tool with the given arguments. + description: >- + Run a tool with the given arguments. + + :param tool_name: The name of the tool to invoke. + :param kwargs: A dictionary of arguments to pass to the tool. + :returns: A ToolInvocationResult. parameters: [] requestBody: content: @@ -2038,22 +2245,27 @@ paths: tags: - ToolRuntime summary: List all tools in the runtime. - description: List all tools in the runtime. + description: >- + List all tools in the runtime. + + :param tool_group_id: The ID of the tool group to list tools for. + :param mcp_endpoint: The MCP endpoint to use for the tool group. + :returns: A ListToolDefsResponse. parameters: - name: tool_group_id - in: query description: >- The ID of the tool group to list tools for. required: false schema: type: string - - name: mcp_endpoint in: query + - name: mcp_endpoint description: >- The MCP endpoint to use for the tool group. required: false schema: $ref: '#/components/schemas/URL' + in: query deprecated: false /v1/tool-runtime/rag-tool/insert: post: @@ -2076,6 +2288,12 @@ paths: Index documents so they can be used by the RAG system. description: >- Index documents so they can be used by the RAG system. + + :param documents: List of documents to index in the RAG system + :param vector_store_id: ID of the vector database to store the document + embeddings + :param chunk_size_in_tokens: (Optional) Size in tokens for document + chunking during indexing parameters: [] requestBody: content: @@ -2110,6 +2328,12 @@ paths: Query the RAG system for context; typically invoked by the agent. description: >- Query the RAG system for context; typically invoked by the agent. + + :param content: The query content to search for in the indexed documents + :param vector_store_ids: List of vector database IDs to search within + :param query_config: (Optional) Configuration parameters for the query + operation + :returns: RAGQueryResult containing the retrieved content and metadata parameters: [] requestBody: content: @@ -2140,7 +2364,10 @@ paths: tags: - ToolGroups summary: List tool groups with optional provider. - description: List tool groups with optional provider. + description: >- + List tool groups with optional provider. + + :returns: A ListToolGroupsResponse. parameters: [] deprecated: false post: @@ -2160,7 +2387,13 @@ paths: tags: - ToolGroups summary: Register a tool group. - description: Register a tool group. + description: >- + Register a tool group. + + :param toolgroup_id: The ID of the tool group to register. + :param provider_id: The ID of the provider to use for the tool group. + :param mcp_endpoint: The MCP endpoint to use for the tool group. + :param args: A dictionary of arguments to pass to the tool group. parameters: [] requestBody: content: @@ -2191,14 +2424,18 @@ paths: tags: - ToolGroups summary: Get a tool group by its ID. - description: Get a tool group by its ID. + description: >- + Get a tool group by its ID. + + :param toolgroup_id: The ID of the tool group to get. + :returns: A ToolGroup. parameters: - name: toolgroup_id - in: path description: The ID of the tool group to get. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -2217,14 +2454,17 @@ paths: tags: - ToolGroups summary: Unregister a tool group. - description: Unregister a tool group. + description: >- + Unregister a tool group. + + :param toolgroup_id: The ID of the tool group to unregister. parameters: - name: toolgroup_id - in: path description: The ID of the tool group to unregister. required: true schema: type: string + in: path deprecated: false /v1/tools: get: @@ -2248,15 +2488,19 @@ paths: tags: - ToolGroups summary: List tools with optional tool group. - description: List tools with optional tool group. + description: >- + List tools with optional tool group. + + :param toolgroup_id: The ID of the tool group to list tools for. + :returns: A ListToolDefsResponse. parameters: - name: toolgroup_id - in: query description: >- The ID of the tool group to list tools for. required: false schema: type: string + in: query deprecated: false /v1/tools/{tool_name}: get: @@ -2280,14 +2524,18 @@ paths: tags: - ToolGroups summary: Get a tool by its name. - description: Get a tool by its name. + description: >- + Get a tool by its name. + + :param tool_name: The name of the tool to get. + :returns: A ToolDef. parameters: - name: tool_name - in: path description: The name of the tool to get. required: true schema: type: string + in: path deprecated: false /v1/vector-io/insert: post: @@ -2307,7 +2555,19 @@ paths: tags: - VectorIO summary: Insert chunks into a vector database. - description: Insert chunks into a vector database. + description: >- + Insert chunks into a vector database. + + :param vector_store_id: The identifier of the vector database to insert the + chunks into. + :param chunks: The chunks to insert. Each `Chunk` should contain content + which can be interleaved text, images, or other types. + `metadata`: `dict[str, Any]` and `embedding`: `List[float]` are + optional. + If `metadata` is provided, you configure how Llama Stack formats + the chunk during generation. + If `embedding` is not provided, it will be computed later. + :param ttl_seconds: The time to live of the chunks. parameters: [] requestBody: content: @@ -2338,7 +2598,13 @@ paths: tags: - VectorIO summary: Query chunks from a vector database. - description: Query chunks from a vector database. + description: >- + Query chunks from a vector database. + + :param vector_store_id: The identifier of the vector database to query. + :param query: The query to search for. + :param params: The parameters of the query. + :returns: A QueryChunksResponse. parameters: [] requestBody: content: @@ -2370,40 +2636,52 @@ paths: tags: - VectorIO summary: Returns a list of vector stores. - description: Returns a list of vector stores. + description: >- + Returns a list of vector stores. + + :param limit: A limit on the number of objects to be returned. Limit can range + between 1 and 100, and the default is 20. + :param order: Sort order by the `created_at` timestamp of the objects. + `asc` for ascending order and `desc` for descending order. + :param after: A cursor for use in pagination. `after` is an object + ID that defines your place in the list. + :param before: A cursor for use in pagination. `before` is an object + ID that defines your place in the list. + :returns: A VectorStoreListResponse containing the list of vector + stores. parameters: - name: limit - in: query description: >- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. required: false schema: type: integer - - name: order in: query + - name: order description: >- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. required: false schema: type: string - - name: after in: query + - name: after description: >- A cursor for use in pagination. `after` is an object ID that defines your place in the list. required: false schema: type: string - - name: before in: query + - name: before description: >- A cursor for use in pagination. `before` is an object ID that defines your place in the list. required: false schema: type: string + in: query deprecated: false post: responses: @@ -2431,12 +2709,13 @@ paths: Creates a vector store. Generate an OpenAI-compatible vector store with the given parameters. + :returns: A VectorStoreObject representing the created vector store. parameters: [] requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody' + id: Annotated required: true deprecated: false /v1/vector_stores/{vector_store_id}: @@ -2462,14 +2741,18 @@ paths: tags: - VectorIO summary: Retrieves a vector store. - description: Retrieves a vector store. + description: >- + Retrieves a vector store. + + :param vector_store_id: The ID of the vector store to retrieve. + :returns: A VectorStoreObject representing the vector store. parameters: - name: vector_store_id - in: path description: The ID of the vector store to retrieve. required: true schema: type: string + in: path deprecated: false post: responses: @@ -2493,14 +2776,22 @@ paths: tags: - VectorIO summary: Updates a vector store. - description: Updates a vector store. + description: >- + Updates a vector store. + + :param vector_store_id: The ID of the vector store to update. + :param name: The name of the vector store. + :param expires_after: The expiration policy for a vector store. + :param metadata: Set of 16 key-value pairs that can be attached to + an object. + :returns: A VectorStoreObject representing the updated vector store. parameters: - name: vector_store_id - in: path description: The ID of the vector store to update. required: true schema: type: string + in: path requestBody: content: application/json: @@ -2530,14 +2821,18 @@ paths: tags: - VectorIO summary: Delete a vector store. - description: Delete a vector store. + description: >- + Delete a vector store. + + :param vector_store_id: The ID of the vector store to delete. + :returns: A VectorStoreDeleteResponse indicating the deletion status. parameters: - name: vector_store_id - in: path description: The ID of the vector store to delete. required: true schema: type: string + in: path deprecated: false /v1/vector_stores/{vector_store_id}/file_batches: post: @@ -2567,19 +2862,23 @@ paths: Generate an OpenAI-compatible vector store file batch for the given vector store. + :param vector_store_id: The ID of the vector store to create the file + batch for. + :returns: A VectorStoreFileBatchObject representing the created file + batch. parameters: - name: vector_store_id - in: path description: >- The ID of the vector store to create the file batch for. required: true schema: type: string + in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody' + id: Annotated required: true deprecated: false /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: @@ -2605,21 +2904,27 @@ paths: tags: - VectorIO summary: Retrieve a vector store file batch. - description: Retrieve a vector store file batch. + description: >- + Retrieve a vector store file batch. + + :param batch_id: The ID of the file batch to retrieve. + :param vector_store_id: The ID of the vector store containing the + file batch. + :returns: A VectorStoreFileBatchObject representing the file batch. parameters: - name: batch_id - in: path description: The ID of the file batch to retrieve. required: true schema: type: string - - name: vector_store_id in: path + - name: vector_store_id description: >- The ID of the vector store containing the file batch. required: true schema: type: string + in: path deprecated: false /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: post: @@ -2644,21 +2949,28 @@ paths: tags: - VectorIO summary: Cancels a vector store file batch. - description: Cancels a vector store file batch. + description: >- + Cancels a vector store file batch. + + :param batch_id: The ID of the file batch to cancel. + :param vector_store_id: The ID of the vector store containing the + file batch. + :returns: A VectorStoreFileBatchObject representing the cancelled + file batch. parameters: - name: batch_id - in: path description: The ID of the file batch to cancel. required: true schema: type: string - - name: vector_store_id in: path + - name: vector_store_id description: >- The ID of the vector store containing the file batch. required: true schema: type: string + in: path deprecated: false /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: get: @@ -2687,60 +2999,76 @@ paths: Returns a list of vector store files in a batch. description: >- Returns a list of vector store files in a batch. + + :param batch_id: The ID of the file batch to list files from. + :param vector_store_id: The ID of the vector store containing the + file batch. + :param after: A cursor for use in pagination. `after` is an object + ID that defines your place in the list. + :param before: A cursor for use in pagination. `before` is an object + ID that defines your place in the list. + :param filter: Filter by file status. One of in_progress, completed, + failed, cancelled. + :param limit: A limit on the number of objects to be returned. Limit + can range between 1 and 100, and the default is 20. + :param order: Sort order by the `created_at` timestamp of the objects. + `asc` for ascending order and `desc` for descending order. + :returns: A VectorStoreFilesListInBatchResponse containing the list + of files in the batch. parameters: - name: batch_id - in: path description: >- The ID of the file batch to list files from. required: true schema: type: string - - name: vector_store_id in: path + - name: vector_store_id description: >- The ID of the vector store containing the file batch. required: true schema: type: string + in: path - name: after - in: query description: >- A cursor for use in pagination. `after` is an object ID that defines your place in the list. required: false schema: type: string - - name: before in: query + - name: before description: >- A cursor for use in pagination. `before` is an object ID that defines your place in the list. required: false schema: type: string - - name: filter in: query + - name: filter description: >- Filter by file status. One of in_progress, completed, failed, cancelled. required: false schema: type: string - - name: limit in: query + - name: limit description: >- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. required: false schema: type: integer - - name: order in: query + - name: order description: >- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. required: false schema: type: string + in: query deprecated: false /v1/vector_stores/{vector_store_id}/files: get: @@ -2765,55 +3093,69 @@ paths: tags: - VectorIO summary: List files in a vector store. - description: List files in a vector store. + description: >- + List files in a vector store. + + :param vector_store_id: The ID of the vector store to list files from. + :param limit: (Optional) A limit on the number of objects to be returned. + Limit can range between 1 and 100, and the default is 20. + :param order: (Optional) Sort order by the `created_at` timestamp + of the objects. `asc` for ascending order and `desc` for descending order. + :param after: (Optional) A cursor for use in pagination. `after` is + an object ID that defines your place in the list. + :param before: (Optional) A cursor for use in pagination. `before` + is an object ID that defines your place in the list. + :param filter: (Optional) Filter by file status to only return files + with the specified status. + :returns: A VectorStoreListFilesResponse containing the list of files. parameters: - name: vector_store_id - in: path description: >- The ID of the vector store to list files from. required: true schema: type: string + in: path - name: limit - in: query description: >- (Optional) A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. required: false schema: type: integer - - name: order in: query + - name: order description: >- (Optional) Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. required: false schema: type: string - - name: after in: query + - name: after description: >- (Optional) A cursor for use in pagination. `after` is an object ID that defines your place in the list. required: false schema: type: string - - name: before in: query + - name: before description: >- (Optional) A cursor for use in pagination. `before` is an object ID that defines your place in the list. required: false schema: type: string - - name: filter in: query + - name: filter description: >- (Optional) Filter by file status to only return files with the specified status. required: false schema: - $ref: '#/components/schemas/VectorStoreFileStatus' + id: Union + in: query deprecated: false post: responses: @@ -2837,15 +3179,23 @@ paths: tags: - VectorIO summary: Attach a file to a vector store. - description: Attach a file to a vector store. + description: >- + Attach a file to a vector store. + + :param vector_store_id: The ID of the vector store to attach the file to. + :param file_id: The ID of the file to attach to the vector store. + :param attributes: The key-value attributes stored with the file, + which can be used for filtering. + :param chunking_strategy: The chunking strategy to use for the file. + :returns: A VectorStoreFileObject representing the attached file. parameters: - name: vector_store_id - in: path description: >- The ID of the vector store to attach the file to. required: true schema: type: string + in: path requestBody: content: application/json: @@ -2876,21 +3226,27 @@ paths: tags: - VectorIO summary: Retrieves a vector store file. - description: Retrieves a vector store file. + description: >- + Retrieves a vector store file. + + :param vector_store_id: The ID of the vector store containing the file to + retrieve. + :param file_id: The ID of the file to retrieve. + :returns: A VectorStoreFileObject representing the file. parameters: - name: vector_store_id - in: path description: >- The ID of the vector store containing the file to retrieve. required: true schema: type: string - - name: file_id in: path + - name: file_id description: The ID of the file to retrieve. required: true schema: type: string + in: path deprecated: false post: responses: @@ -2914,21 +3270,29 @@ paths: tags: - VectorIO summary: Updates a vector store file. - description: Updates a vector store file. + description: >- + Updates a vector store file. + + :param vector_store_id: The ID of the vector store containing the file to + update. + :param file_id: The ID of the file to update. + :param attributes: The updated key-value attributes to store with + the file. + :returns: A VectorStoreFileObject representing the updated file. parameters: - name: vector_store_id - in: path description: >- The ID of the vector store containing the file to update. required: true schema: type: string - - name: file_id in: path + - name: file_id description: The ID of the file to update. required: true schema: type: string + in: path requestBody: content: application/json: @@ -2958,21 +3322,28 @@ paths: tags: - VectorIO summary: Delete a vector store file. - description: Delete a vector store file. + description: >- + Delete a vector store file. + + :param vector_store_id: The ID of the vector store containing the file to + delete. + :param file_id: The ID of the file to delete. + :returns: A VectorStoreFileDeleteResponse indicating the deletion + status. parameters: - name: vector_store_id - in: path description: >- The ID of the vector store containing the file to delete. required: true schema: type: string - - name: file_id in: path + - name: file_id description: The ID of the file to delete. required: true schema: type: string + in: path deprecated: false /v1/vector_stores/{vector_store_id}/files/{file_id}/content: get: @@ -3000,20 +3371,25 @@ paths: Retrieves the contents of a vector store file. description: >- Retrieves the contents of a vector store file. + + :param vector_store_id: The ID of the vector store containing the file to + retrieve. + :param file_id: The ID of the file to retrieve. + :returns: A list of InterleavedContent representing the file contents. parameters: - name: vector_store_id - in: path description: >- The ID of the vector store containing the file to retrieve. required: true schema: type: string - - name: file_id in: path + - name: file_id description: The ID of the file to retrieve. required: true schema: type: string + in: path deprecated: false /v1/vector_stores/{vector_store_id}/search: post: @@ -3043,13 +3419,27 @@ paths: Searches a vector store for relevant chunks based on a query and optional file attribute filters. + + :param vector_store_id: The ID of the vector store to search. + :param query: The query string or array for performing the search. + :param filters: Filters based on file attributes to narrow the search + results. + :param max_num_results: Maximum number of results to return (1 to + 50 inclusive, default 10). + :param ranking_options: Ranking options for fine-tuning the search + results. + :param rewrite_query: Whether to rewrite the natural language query + for vector search (default false) + :param search_mode: The search mode to use - "keyword", "vector", + or "hybrid" (default "vector") + :returns: A VectorStoreSearchResponse containing the search results. parameters: - name: vector_store_id - in: path description: The ID of the vector store to search. required: true schema: type: string + in: path requestBody: content: application/json: @@ -3084,6 +3474,8 @@ paths: Get version. Get the version of the service. + + :returns: Version information containing the service version number. parameters: [] deprecated: false /v1beta/datasetio/append-rows/{dataset_id}: @@ -3104,15 +3496,19 @@ paths: tags: - DatasetIO summary: Append rows to a dataset. - description: Append rows to a dataset. + description: >- + Append rows to a dataset. + + :param dataset_id: The ID of the dataset to append the rows to. + :param rows: The rows to append to the dataset. parameters: - name: dataset_id - in: path description: >- The ID of the dataset to append the rows to. required: true schema: type: string + in: path requestBody: content: application/json: @@ -3147,38 +3543,40 @@ paths: Get a paginated list of rows from a dataset. Uses offset-based pagination where: + - start_index: The starting index (0-based). If None, starts from + beginning. + - limit: Number of items to return. If None or -1, returns all items. - - start_index: The starting index (0-based). If None, starts from beginning. - - - limit: Number of items to return. If None or -1, returns all items. + The response includes: + - data: List of items for the current page. + - has_more: Whether there are more items available after this set. - - The response includes: - - - data: List of items for the current page. - - - has_more: Whether there are more items available after this set. + :param dataset_id: The ID of the dataset to get the rows from. + :param start_index: Index into dataset for the first row to get. Get + all rows if None. + :param limit: The number of rows to get. + :returns: A PaginatedResponse. parameters: - name: dataset_id - in: path description: >- The ID of the dataset to get the rows from. required: true schema: type: string + in: path - name: start_index - in: query description: >- Index into dataset for the first row to get. Get all rows if None. required: false schema: type: integer - - name: limit in: query + - name: limit description: The number of rows to get. required: false schema: type: integer + in: query deprecated: false /v1beta/datasets: get: @@ -3202,7 +3600,10 @@ paths: tags: - Datasets summary: List all datasets. - description: List all datasets. + description: >- + List all datasets. + + :returns: A ListDatasetsResponse. parameters: [] deprecated: false post: @@ -3226,7 +3627,71 @@ paths: tags: - Datasets summary: Register a new dataset. - description: Register a new dataset. + description: >- + Register a new dataset. + + :param purpose: The purpose of the dataset. + One of: + - "post-training/messages": The dataset contains a messages column + with list of messages for post-training. + { + "messages": [ + {"role": "user", "content": "Hello, world!"}, + {"role": "assistant", "content": "Hello, world!"}, + ] + } + - "eval/question-answer": The dataset contains a question column + and an answer column for evaluation. + { + "question": "What is the capital of France?", + "answer": "Paris" + } + - "eval/messages-answer": The dataset contains a messages column + with list of messages and an answer column for evaluation. + { + "messages": [ + {"role": "user", "content": "Hello, my name is John + Doe."}, + {"role": "assistant", "content": "Hello, John Doe. + How can I help you today?"}, + {"role": "user", "content": "What's my name?"}, + ], + "answer": "John Doe" + } + :param source: The data source of the dataset. Ensure that the data + source schema is compatible with the purpose of the dataset. Examples: + - { + "type": "uri", + "uri": "https://mywebsite.com/mydata.jsonl" + } + - { + "type": "uri", + "uri": "lsfs://mydata.jsonl" + } + - { + "type": "uri", + "uri": "data:csv;base64,{base64_content}" + } + - { + "type": "uri", + "uri": "huggingface://llamastack/simpleqa?split=train" + } + - { + "type": "rows", + "rows": [ + { + "messages": [ + {"role": "user", "content": "Hello, world!"}, + {"role": "assistant", "content": "Hello, world!"}, + ] + } + ] + } + :param metadata: The metadata for the dataset. + - E.g. {"description": "My dataset"}. + :param dataset_id: The ID of the dataset. If not provided, an ID will + be generated. + :returns: A Dataset. parameters: [] requestBody: content: @@ -3257,14 +3722,18 @@ paths: tags: - Datasets summary: Get a dataset by its ID. - description: Get a dataset by its ID. + description: >- + Get a dataset by its ID. + + :param dataset_id: The ID of the dataset to get. + :returns: A Dataset. parameters: - name: dataset_id - in: path description: The ID of the dataset to get. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -3283,14 +3752,17 @@ paths: tags: - Datasets summary: Unregister a dataset by its ID. - description: Unregister a dataset by its ID. + description: >- + Unregister a dataset by its ID. + + :param dataset_id: The ID of the dataset to unregister. parameters: - name: dataset_id - in: path description: The ID of the dataset to unregister. required: true schema: type: string + in: path deprecated: false /v1alpha/agents: get: @@ -3314,20 +3786,25 @@ paths: tags: - Agents summary: List all agents. - description: List all agents. + description: >- + List all agents. + + :param start_index: The index to start the pagination from. + :param limit: The number of agents to return. + :returns: A PaginatedResponse. parameters: - name: start_index - in: query description: The index to start the pagination from. required: false schema: type: integer - - name: limit in: query + - name: limit description: The number of agents to return. required: false schema: type: integer + in: query deprecated: false post: responses: @@ -3354,6 +3831,9 @@ paths: Create an agent with the given configuration. description: >- Create an agent with the given configuration. + + :param agent_config: The configuration for the agent. + :returns: An AgentCreateResponse with the agent ID. parameters: [] requestBody: content: @@ -3384,14 +3864,18 @@ paths: tags: - Agents summary: Describe an agent by its ID. - description: Describe an agent by its ID. + description: >- + Describe an agent by its ID. + + :param agent_id: ID of the agent. + :returns: An Agent of the agent. parameters: - name: agent_id - in: path description: ID of the agent. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -3413,13 +3897,15 @@ paths: Delete an agent by its ID and its associated sessions and turns. description: >- Delete an agent by its ID and its associated sessions and turns. + + :param agent_id: The ID of the agent to delete. parameters: - name: agent_id - in: path description: The ID of the agent to delete. required: true schema: type: string + in: path deprecated: false /v1alpha/agents/{agent_id}/session: post: @@ -3443,15 +3929,20 @@ paths: tags: - Agents summary: Create a new session for an agent. - description: Create a new session for an agent. + description: >- + Create a new session for an agent. + + :param agent_id: The ID of the agent to create the session for. + :param session_name: The name of the session to create. + :returns: An AgentSessionCreateResponse. parameters: - name: agent_id - in: path description: >- The ID of the agent to create the session for. required: true schema: type: string + in: path requestBody: content: application/json: @@ -3481,30 +3972,35 @@ paths: tags: - Agents summary: Retrieve an agent session by its ID. - description: Retrieve an agent session by its ID. + description: >- + Retrieve an agent session by its ID. + + :param session_id: The ID of the session to get. + :param agent_id: The ID of the agent to get the session for. + :param turn_ids: (Optional) List of turn IDs to filter the session + by. + :returns: A Session. parameters: - name: session_id - in: path description: The ID of the session to get. required: true schema: type: string - - name: agent_id in: path + - name: agent_id description: >- The ID of the agent to get the session for. required: true schema: type: string + in: path - name: turn_ids - in: query description: >- (Optional) List of turn IDs to filter the session by. required: false schema: - type: array - items: - type: string + $ref: '#/components/schemas/list' + in: query deprecated: false delete: responses: @@ -3526,35 +4022,36 @@ paths: Delete an agent session by its ID and its associated turns. description: >- Delete an agent session by its ID and its associated turns. + + :param session_id: The ID of the session to delete. + :param agent_id: The ID of the agent to delete the session for. parameters: - name: session_id - in: path description: The ID of the session to delete. required: true schema: type: string - - name: agent_id in: path + - name: agent_id description: >- The ID of the agent to delete the session for. required: true schema: type: string + in: path deprecated: false /v1alpha/agents/{agent_id}/session/{session_id}/turn: post: responses: '200': - description: >- - If stream=False, returns a Turn object. If stream=True, returns an SSE - event stream of AgentTurnResponseStreamChunk. + description: If stream=False, returns a Turn object. content: application/json: schema: $ref: '#/components/schemas/Turn' text/event-stream: schema: - $ref: '#/components/schemas/AgentTurnResponseStreamChunk' + $ref: '#/components/schemas/AsyncIterator' '400': $ref: '#/components/responses/BadRequest400' '429': @@ -3568,22 +4065,37 @@ paths: tags: - Agents summary: Create a new turn for an agent. - description: Create a new turn for an agent. + description: >- + Create a new turn for an agent. + + :param agent_id: The ID of the agent to create the turn for. + :param session_id: The ID of the session to create the turn for. + :param messages: List of messages to start the turn with. + :param stream: (Optional) If True, generate an SSE event stream of + the response. Defaults to False. + :param documents: (Optional) List of documents to create the turn + with. + :param toolgroups: (Optional) List of toolgroups to create the turn + with, will be used in addition to the agent's config toolgroups for the request. + :param tool_config: (Optional) The tool configuration to create the + turn with, will be used to override the agent's tool_config. + :returns: If stream=False, returns a Turn object. + If stream=True, returns an SSE event stream of AgentTurnResponseStreamChunk. parameters: - name: agent_id - in: path description: >- The ID of the agent to create the turn for. required: true schema: type: string - - name: session_id in: path + - name: session_id description: >- The ID of the session to create the turn for. required: true schema: type: string + in: path requestBody: content: application/json: @@ -3613,27 +4125,33 @@ paths: tags: - Agents summary: Retrieve an agent turn by its ID. - description: Retrieve an agent turn by its ID. + description: >- + Retrieve an agent turn by its ID. + + :param agent_id: The ID of the agent to get the turn for. + :param session_id: The ID of the session to get the turn for. + :param turn_id: The ID of the turn to get. + :returns: A Turn. parameters: - name: agent_id - in: path description: The ID of the agent to get the turn for. required: true schema: type: string - - name: session_id in: path + - name: session_id description: >- The ID of the session to get the turn for. required: true schema: type: string - - name: turn_id in: path + - name: turn_id description: The ID of the turn to get. required: true schema: type: string + in: path deprecated: false /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume: post: @@ -3648,7 +4166,7 @@ paths: $ref: '#/components/schemas/Turn' text/event-stream: schema: - $ref: '#/components/schemas/AgentTurnResponseStreamChunk' + $ref: '#/components/schemas/AsyncIterator' '400': $ref: '#/components/responses/BadRequest400' '429': @@ -3669,25 +4187,34 @@ paths: When a Turn has the status `awaiting_input` due to pending input from client side tool calls, this endpoint can be used to submit the outputs from the tool calls once they are ready. + + :param agent_id: The ID of the agent to resume. + :param session_id: The ID of the session to resume. + :param turn_id: The ID of the turn to resume. + :param tool_responses: The tool call responses to resume the turn + with. + :param stream: Whether to stream the response. + :returns: A Turn object if stream is False, otherwise an AsyncIterator + of AgentTurnResponseStreamChunk objects. parameters: - name: agent_id - in: path description: The ID of the agent to resume. required: true schema: type: string - - name: session_id in: path + - name: session_id description: The ID of the session to resume. required: true schema: type: string - - name: turn_id in: path + - name: turn_id description: The ID of the turn to resume. required: true schema: type: string + in: path requestBody: content: application/json: @@ -3717,33 +4244,40 @@ paths: tags: - Agents summary: Retrieve an agent step by its ID. - description: Retrieve an agent step by its ID. + description: >- + Retrieve an agent step by its ID. + + :param agent_id: The ID of the agent to get the step for. + :param session_id: The ID of the session to get the step for. + :param turn_id: The ID of the turn to get the step for. + :param step_id: The ID of the step to get. + :returns: An AgentStepResponse. parameters: - name: agent_id - in: path description: The ID of the agent to get the step for. required: true schema: type: string - - name: session_id in: path + - name: session_id description: >- The ID of the session to get the step for. required: true schema: type: string - - name: turn_id in: path + - name: turn_id description: The ID of the turn to get the step for. required: true schema: type: string - - name: step_id in: path + - name: step_id description: The ID of the step to get. required: true schema: type: string + in: path deprecated: false /v1alpha/agents/{agent_id}/sessions: get: @@ -3767,27 +4301,33 @@ paths: tags: - Agents summary: List all session(s) of a given agent. - description: List all session(s) of a given agent. + description: >- + List all session(s) of a given agent. + + :param agent_id: The ID of the agent to list sessions for. + :param start_index: The index to start the pagination from. + :param limit: The number of sessions to return. + :returns: A PaginatedResponse. parameters: - name: agent_id - in: path description: >- The ID of the agent to list sessions for. required: true schema: type: string + in: path - name: start_index - in: query description: The index to start the pagination from. required: false schema: type: integer - - name: limit in: query + - name: limit description: The number of sessions to return. required: false schema: type: integer + in: query deprecated: false /v1alpha/eval/benchmarks: get: @@ -3811,7 +4351,10 @@ paths: tags: - Benchmarks summary: List all benchmarks. - description: List all benchmarks. + description: >- + List all benchmarks. + + :returns: A ListBenchmarksResponse. parameters: [] deprecated: false post: @@ -3831,7 +4374,16 @@ paths: tags: - Benchmarks summary: Register a benchmark. - description: Register a benchmark. + description: >- + Register a benchmark. + + :param benchmark_id: The ID of the benchmark to register. + :param dataset_id: The ID of the dataset to use for the benchmark. + :param scoring_functions: The scoring functions to use for the benchmark. + :param provider_benchmark_id: The ID of the provider benchmark to + use for the benchmark. + :param provider_id: The ID of the provider to use for the benchmark. + :param metadata: The metadata to use for the benchmark. parameters: [] requestBody: content: @@ -3862,14 +4414,18 @@ paths: tags: - Benchmarks summary: Get a benchmark by its ID. - description: Get a benchmark by its ID. + description: >- + Get a benchmark by its ID. + + :param benchmark_id: The ID of the benchmark to get. + :returns: A Benchmark. parameters: - name: benchmark_id - in: path description: The ID of the benchmark to get. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -3888,14 +4444,17 @@ paths: tags: - Benchmarks summary: Unregister a benchmark. - description: Unregister a benchmark. + description: >- + Unregister a benchmark. + + :param benchmark_id: The ID of the benchmark to unregister. parameters: - name: benchmark_id - in: path description: The ID of the benchmark to unregister. required: true schema: type: string + in: path deprecated: false /v1alpha/eval/benchmarks/{benchmark_id}/evaluations: post: @@ -3920,15 +4479,22 @@ paths: tags: - Eval summary: Evaluate a list of rows on a benchmark. - description: Evaluate a list of rows on a benchmark. + description: >- + Evaluate a list of rows on a benchmark. + + :param benchmark_id: The ID of the benchmark to run the evaluation on. + :param input_rows: The rows to evaluate. + :param scoring_functions: The scoring functions to use for the evaluation. + :param benchmark_config: The configuration for the benchmark. + :returns: EvaluateResponse object containing generations and scores. parameters: - name: benchmark_id - in: path description: >- The ID of the benchmark to run the evaluation on. required: true schema: type: string + in: path requestBody: content: application/json: @@ -3959,15 +4525,20 @@ paths: tags: - Eval summary: Run an evaluation on a benchmark. - description: Run an evaluation on a benchmark. + description: >- + Run an evaluation on a benchmark. + + :param benchmark_id: The ID of the benchmark to run the evaluation on. + :param benchmark_config: The configuration for the benchmark. + :returns: The job that was created to run the evaluation. parameters: - name: benchmark_id - in: path description: >- The ID of the benchmark to run the evaluation on. required: true schema: type: string + in: path requestBody: content: application/json: @@ -3997,21 +4568,26 @@ paths: tags: - Eval summary: Get the status of a job. - description: Get the status of a job. + description: >- + Get the status of a job. + + :param benchmark_id: The ID of the benchmark to run the evaluation on. + :param job_id: The ID of the job to get the status of. + :returns: The status of the evaluation job. parameters: - name: benchmark_id - in: path description: >- The ID of the benchmark to run the evaluation on. required: true schema: type: string - - name: job_id in: path + - name: job_id description: The ID of the job to get the status of. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -4030,21 +4606,25 @@ paths: tags: - Eval summary: Cancel a job. - description: Cancel a job. + description: >- + Cancel a job. + + :param benchmark_id: The ID of the benchmark to run the evaluation on. + :param job_id: The ID of the job to cancel. parameters: - name: benchmark_id - in: path description: >- The ID of the benchmark to run the evaluation on. required: true schema: type: string - - name: job_id in: path + - name: job_id description: The ID of the job to cancel. required: true schema: type: string + in: path deprecated: false /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result: get: @@ -4068,21 +4648,26 @@ paths: tags: - Eval summary: Get the result of a job. - description: Get the result of a job. + description: >- + Get the result of a job. + + :param benchmark_id: The ID of the benchmark to run the evaluation on. + :param job_id: The ID of the job to get the result of. + :returns: The result of the job. parameters: - name: benchmark_id - in: path description: >- The ID of the benchmark to run the evaluation on. required: true schema: type: string - - name: job_id in: path + - name: job_id description: The ID of the job to get the result of. required: true schema: type: string + in: path deprecated: false /v1alpha/inference/rerank: post: @@ -4110,6 +4695,17 @@ paths: Rerank a list of documents based on their relevance to a query. description: >- Rerank a list of documents based on their relevance to a query. + + :param model: The identifier of the reranking model to use. + :param query: The search query to rank items against. Can be a string, + text content part, or image content part. The input must not exceed the model's + max input token length. + :param items: List of items to rerank. Each item can be a string, + text content part, or image content part. Each input must not exceed the model's + max input token length. + :param max_num_results: (Optional) Maximum number of results to return. + Default: returns all. + :returns: RerankResponse with indices sorted by relevance score (descending). parameters: [] requestBody: content: @@ -4140,15 +4736,19 @@ paths: tags: - PostTraining (Coming Soon) summary: Get the artifacts of a training job. - description: Get the artifacts of a training job. + description: >- + Get the artifacts of a training job. + + :param job_uuid: The UUID of the job to get the artifacts of. + :returns: A PostTrainingJobArtifactsResponse. parameters: - name: job_uuid - in: query description: >- The UUID of the job to get the artifacts of. required: true schema: type: string + in: query deprecated: false /v1alpha/post-training/job/cancel: post: @@ -4168,7 +4768,10 @@ paths: tags: - PostTraining (Coming Soon) summary: Cancel a training job. - description: Cancel a training job. + description: >- + Cancel a training job. + + :param job_uuid: The UUID of the job to cancel. parameters: [] requestBody: content: @@ -4199,15 +4802,19 @@ paths: tags: - PostTraining (Coming Soon) summary: Get the status of a training job. - description: Get the status of a training job. + description: >- + Get the status of a training job. + + :param job_uuid: The UUID of the job to get the status of. + :returns: A PostTrainingJobStatusResponse. parameters: - name: job_uuid - in: query description: >- The UUID of the job to get the status of. required: true schema: type: string + in: query deprecated: false /v1alpha/post-training/jobs: get: @@ -4231,7 +4838,10 @@ paths: tags: - PostTraining (Coming Soon) summary: Get all training jobs. - description: Get all training jobs. + description: >- + Get all training jobs. + + :returns: A ListPostTrainingJobsResponse. parameters: [] deprecated: false /v1alpha/post-training/preference-optimize: @@ -4256,7 +4866,16 @@ paths: tags: - PostTraining (Coming Soon) summary: Run preference optimization of a model. - description: Run preference optimization of a model. + description: >- + Run preference optimization of a model. + + :param job_uuid: The UUID of the job to create. + :param finetuned_model: The model to fine-tune. + :param algorithm_config: The algorithm configuration. + :param training_config: The training configuration. + :param hyperparam_search_config: The hyperparam search configuration. + :param logger_config: The logger configuration. + :returns: A PostTrainingJob. parameters: [] requestBody: content: @@ -4287,7 +4906,17 @@ paths: tags: - PostTraining (Coming Soon) summary: Run supervised fine-tuning of a model. - description: Run supervised fine-tuning of a model. + description: >- + Run supervised fine-tuning of a model. + + :param job_uuid: The UUID of the job to create. + :param training_config: The training configuration. + :param hyperparam_search_config: The hyperparam search configuration. + :param logger_config: The logger configuration. + :param model: The model to fine-tune. + :param checkpoint_dir: The directory to save checkpoint(s) to. + :param algorithm_config: The algorithm configuration. + :returns: A PostTrainingJob. parameters: [] requestBody: content: @@ -4301,26 +4930,34 @@ jsonSchemaDialect: >- components: schemas: Error: - type: object + description: >- + Error response from the API. Roughly follows RFC 7807. + + + :param status: HTTP status code + + :param title: Error title, a short summary of the error which is invariant + for an error type + + :param detail: Error detail, a longer human-readable description of the error + + :param instance: (Optional) A URL which can be used to retrieve more information + about the specific occurrence of the error properties: status: + title: Status type: integer - description: HTTP status code title: + title: Title type: string - description: >- - Error title, a short summary of the error which is invariant for an error - type detail: + title: Detail type: string - description: >- - Error detail, a longer human-readable description of the error instance: - type: string - description: >- - (Optional) A URL which can be used to retrieve more information about - the specific occurrence of the error - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: Instance required: - status - title @@ -4662,1108 +5299,1499 @@ components: description: Sort order for paginated responses. ListOpenAIChatCompletionResponse: type: object - properties: - data: - type: array - items: - type: object - properties: - id: - type: string - description: The ID of the chat completion - choices: - type: array - items: - $ref: '#/components/schemas/OpenAIChoice' - description: List of choices - object: - type: string - const: chat.completion - default: chat.completion - description: >- - The object type, which will be "chat.completion" - created: - type: integer - description: >- - The Unix timestamp in seconds when the chat completion was created - model: - type: string - description: >- - The model that was used to generate the chat completion - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - description: >- - Token usage information for the completion - input_messages: - type: array - items: - $ref: '#/components/schemas/OpenAIMessageParam' - additionalProperties: false - required: - - id - - choices - - object - - created - - model - - input_messages - title: OpenAICompletionWithInputMessages - description: >- - List of chat completion objects with their input messages - has_more: - type: boolean - description: >- - Whether there are more completions available beyond this list - first_id: - type: string - description: ID of the first completion in this list - last_id: - type: string - description: ID of the last completion in this list - object: - type: string - const: list - default: list + Order: + type: object + ListOpenAIChatCompletionResponse: + $defs: + OpenAIAssistantMessageParam: description: >- - Must be "list" to identify this as a list response - additionalProperties: false - required: - - data - - has_more - - first_id - - last_id - - object - title: ListOpenAIChatCompletionResponse - description: >- - Response from listing OpenAI-compatible chat completions. - OpenAIAssistantMessageParam: - type: object - properties: - role: - type: string - const: assistant - default: assistant - description: >- - Must be "assistant" to identify this as the model's response - content: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - description: The content of the model's response - name: - type: string - description: >- - (Optional) The name of the assistant message participant. - tool_calls: - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' - description: >- - List of tool calls. Each tool call is an OpenAIChatCompletionToolCall + A message containing the model's (assistant) response in an OpenAI-compatible + chat completion request. + + + :param role: Must be "assistant" to identify this as the model's response + + :param content: The content of the model's response + + :param name: (Optional) The name of the assistant message participant. + + :param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object. - additionalProperties: false - required: - - role - title: OpenAIAssistantMessageParam - description: >- - A message containing the model's (assistant) response in an OpenAI-compatible - chat completion request. - "OpenAIChatCompletionContentPartImageParam": - type: object - properties: - type: - type: string - const: image_url - default: image_url - description: >- - Must be "image_url" to identify this as image content - image_url: - $ref: '#/components/schemas/OpenAIImageURL' - description: >- - Image URL specification and processing details - additionalProperties: false - required: - - type - - image_url - title: >- - OpenAIChatCompletionContentPartImageParam - description: >- - Image content part for OpenAI-compatible chat completion messages. - OpenAIChatCompletionContentPartParam: - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - - $ref: '#/components/schemas/OpenAIFile' - discriminator: - propertyName: type - mapping: - text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - file: '#/components/schemas/OpenAIFile' - OpenAIChatCompletionContentPartTextParam: - type: object - properties: - type: - type: string - const: text - default: text - description: >- - Must be "text" to identify this as text content - text: - type: string - description: The text content of the message - additionalProperties: false - required: - - type - - text - title: OpenAIChatCompletionContentPartTextParam - description: >- - Text content part for OpenAI-compatible chat completion messages. - OpenAIChatCompletionToolCall: - type: object - properties: - index: - type: integer + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + type: array + - type: 'null' + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/$defs/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + title: Tool Calls + title: OpenAIAssistantMessageParam + type: object + "OpenAIChatCompletionContentPartImageParam": description: >- - (Optional) Index of the tool call in the list - id: - type: string + Image content part for OpenAI-compatible chat completion messages. + + + :param type: Must be "image_url" to identify this as image content + + :param image_url: Image URL specification and processing details + properties: + type: + const: image_url + default: image_url + title: Type + type: string + image_url: + $ref: '#/$defs/OpenAIImageURL' + required: + - image_url + title: >- + OpenAIChatCompletionContentPartImageParam + type: object + OpenAIChatCompletionContentPartTextParam: description: >- - (Optional) Unique identifier for the tool call - type: - type: string - const: function - default: function + Text content part for OpenAI-compatible chat completion messages. + + + :param type: Must be "text" to identify this as text content + + :param text: The text content of the message + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: OpenAIChatCompletionContentPartTextParam + type: object + OpenAIChatCompletionToolCall: description: >- - Must be "function" to identify this as a function call - function: - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' - description: (Optional) Function call details - additionalProperties: false - required: - - type - title: OpenAIChatCompletionToolCall - description: >- - Tool call specification for OpenAI-compatible chat completion responses. - OpenAIChatCompletionToolCallFunction: - type: object - properties: - name: - type: string - description: (Optional) Name of the function to call - arguments: - type: string + Tool call specification for OpenAI-compatible chat completion responses. + + + :param index: (Optional) Index of the tool call in the list + + :param id: (Optional) Unique identifier for the tool call + + :param type: Must be "function" to identify this as a function call + + :param function: (Optional) Function call details + properties: + index: + anyOf: + - type: integer + - type: 'null' + title: Index + id: + anyOf: + - type: string + - type: 'null' + title: Id + type: + const: function + default: function + title: Type + type: string + function: + anyOf: + - $ref: >- + #/$defs/OpenAIChatCompletionToolCallFunction + - type: 'null' + title: OpenAIChatCompletionToolCall + type: object + OpenAIChatCompletionToolCallFunction: description: >- - (Optional) Arguments to pass to the function as a JSON string - additionalProperties: false - title: OpenAIChatCompletionToolCallFunction - description: >- - Function call details for OpenAI-compatible tool calls. - OpenAIChatCompletionUsage: - type: object - properties: - prompt_tokens: - type: integer - description: Number of tokens in the prompt - completion_tokens: - type: integer - description: Number of tokens in the completion - total_tokens: - type: integer - description: Total tokens used (prompt + completion) - prompt_tokens_details: + Function call details for OpenAI-compatible tool calls. + + + :param name: (Optional) Name of the function to call + + :param arguments: (Optional) Arguments to pass to the function as a JSON + string + properties: + name: + anyOf: + - type: string + - type: 'null' + title: Name + arguments: + anyOf: + - type: string + - type: 'null' + title: Arguments + title: OpenAIChatCompletionToolCallFunction type: object + OpenAIChatCompletionUsage: + description: >- + Usage information for OpenAI chat completion. + + + :param prompt_tokens: Number of tokens in the prompt + + :param completion_tokens: Number of tokens in the completion + + :param total_tokens: Total tokens used (prompt + completion) + + :param input_tokens_details: Detailed breakdown of input token usage + + :param output_tokens_details: Detailed breakdown of output token usage properties: - cached_tokens: + prompt_tokens: + title: Prompt Tokens type: integer - description: Number of tokens retrieved from cache - additionalProperties: false - title: >- - OpenAIChatCompletionUsagePromptTokensDetails - description: >- - Token details for prompt tokens in OpenAI chat completion usage. - completion_tokens_details: + completion_tokens: + title: Completion Tokens + type: integer + total_tokens: + title: Total Tokens + type: integer + prompt_tokens_details: + anyOf: + - $ref: >- + #/$defs/OpenAIChatCompletionUsagePromptTokensDetails + - type: 'null' + completion_tokens_details: + anyOf: + - $ref: >- + #/$defs/OpenAIChatCompletionUsageCompletionTokensDetails + - type: 'null' + required: + - prompt_tokens + - completion_tokens + - total_tokens + title: OpenAIChatCompletionUsage type: object + "OpenAIChatCompletionUsageCompletionTokensDetails": + description: >- + Token details for output tokens in OpenAI chat completion usage. + + + :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) properties: reasoning_tokens: - type: integer - description: >- - Number of tokens used for reasoning (o1/o3 models) - additionalProperties: false + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens title: >- OpenAIChatCompletionUsageCompletionTokensDetails + type: object + "OpenAIChatCompletionUsagePromptTokensDetails": description: >- - Token details for output tokens in OpenAI chat completion usage. - additionalProperties: false - required: - - prompt_tokens - - completion_tokens - - total_tokens - title: OpenAIChatCompletionUsage - description: >- - Usage information for OpenAI chat completion. - OpenAIChoice: - type: object - properties: - message: - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - discriminator: - propertyName: role - mapping: - user: '#/components/schemas/OpenAIUserMessageParam' - system: '#/components/schemas/OpenAISystemMessageParam' - assistant: '#/components/schemas/OpenAIAssistantMessageParam' - tool: '#/components/schemas/OpenAIToolMessageParam' - developer: '#/components/schemas/OpenAIDeveloperMessageParam' - description: The message from the model - finish_reason: - type: string - description: The reason the model stopped generating - index: - type: integer - description: The index of the choice - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - description: >- - (Optional) The log probabilities for the tokens in the message - additionalProperties: false - required: - - message - - finish_reason - - index - title: OpenAIChoice - description: >- - A choice from an OpenAI-compatible chat completion response. - OpenAIChoiceLogprobs: - type: object - properties: - content: - type: array - items: - $ref: '#/components/schemas/OpenAITokenLogProb' - description: >- - (Optional) The log probabilities for the tokens in the message - refusal: - type: array - items: - $ref: '#/components/schemas/OpenAITokenLogProb' + Token details for prompt tokens in OpenAI chat completion usage. + + + :param cached_tokens: Number of tokens retrieved from cache + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens + title: >- + OpenAIChatCompletionUsagePromptTokensDetails + type: object + OpenAIChoice: description: >- - (Optional) The log probabilities for the tokens in the message - additionalProperties: false - title: OpenAIChoiceLogprobs - description: >- - The log probabilities for the tokens in the message from an OpenAI-compatible - chat completion response. - OpenAIDeveloperMessageParam: - type: object - properties: - role: - type: string - const: developer - default: developer + A choice from an OpenAI-compatible chat completion response. + + + :param message: The message from the model + + :param finish_reason: The reason the model stopped generating + + :param index: The index of the choice + + :param logprobs: (Optional) The log probabilities for the tokens in the + message + properties: + message: + discriminator: + mapping: + assistant: '#/$defs/OpenAIAssistantMessageParam' + developer: '#/$defs/OpenAIDeveloperMessageParam' + system: '#/$defs/OpenAISystemMessageParam' + tool: '#/$defs/OpenAIToolMessageParam' + user: '#/$defs/OpenAIUserMessageParam' + propertyName: role + oneOf: + - $ref: '#/$defs/OpenAIUserMessageParam' + - $ref: '#/$defs/OpenAISystemMessageParam' + - $ref: '#/$defs/OpenAIAssistantMessageParam' + - $ref: '#/$defs/OpenAIToolMessageParam' + - $ref: '#/$defs/OpenAIDeveloperMessageParam' + title: Message + finish_reason: + title: Finish Reason + type: string + index: + title: Index + type: integer + logprobs: + anyOf: + - $ref: '#/$defs/OpenAIChoiceLogprobs' + - type: 'null' + required: + - message + - finish_reason + - index + title: OpenAIChoice + type: object + OpenAIChoiceLogprobs: description: >- - Must be "developer" to identify this as a developer message - content: - oneOf: - - type: string - - type: array + The log probabilities for the tokens in the message from an OpenAI-compatible + chat completion response. + + + :param content: (Optional) The log probabilities for the tokens in the + message + + :param refusal: (Optional) The log probabilities for the tokens in the + message + properties: + content: + anyOf: + - items: + $ref: '#/$defs/OpenAITokenLogProb' + type: array + - type: 'null' + title: Content + refusal: + anyOf: + - items: + $ref: '#/$defs/OpenAITokenLogProb' + type: array + - type: 'null' + title: Refusal + title: OpenAIChoiceLogprobs + type: object + OpenAICompletionWithInputMessages: + properties: + id: + title: Id + type: string + choices: items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - description: The content of the developer message - name: - type: string + $ref: '#/$defs/OpenAIChoice' + title: Choices + type: array + object: + const: chat.completion + default: chat.completion + title: Object + type: string + created: + title: Created + type: integer + model: + title: Model + type: string + usage: + anyOf: + - $ref: '#/$defs/OpenAIChatCompletionUsage' + - type: 'null' + input_messages: + items: + discriminator: + mapping: + assistant: '#/$defs/OpenAIAssistantMessageParam' + developer: '#/$defs/OpenAIDeveloperMessageParam' + system: '#/$defs/OpenAISystemMessageParam' + tool: '#/$defs/OpenAIToolMessageParam' + user: '#/$defs/OpenAIUserMessageParam' + propertyName: role + oneOf: + - $ref: '#/$defs/OpenAIUserMessageParam' + - $ref: '#/$defs/OpenAISystemMessageParam' + - $ref: '#/$defs/OpenAIAssistantMessageParam' + - $ref: '#/$defs/OpenAIToolMessageParam' + - $ref: '#/$defs/OpenAIDeveloperMessageParam' + title: Input Messages + type: array + required: + - id + - choices + - created + - model + - input_messages + title: OpenAICompletionWithInputMessages + type: object + OpenAIDeveloperMessageParam: description: >- - (Optional) The name of the developer message participant. - additionalProperties: false - required: - - role - - content - title: OpenAIDeveloperMessageParam - description: >- - A message from the developer in an OpenAI-compatible chat completion request. - OpenAIFile: - type: object - properties: - type: - type: string - const: file - default: file - file: - $ref: '#/components/schemas/OpenAIFileFile' - additionalProperties: false - required: - - type - - file - title: OpenAIFile - OpenAIFileFile: - type: object - properties: - file_data: - type: string - file_id: - type: string - filename: - type: string - additionalProperties: false - title: OpenAIFileFile - OpenAIImageURL: - type: object - properties: - url: - type: string + A message from the developer in an OpenAI-compatible chat completion request. + + + :param role: Must be "developer" to identify this as a developer message + + :param content: The content of the developer message + + :param name: (Optional) The name of the developer message participant. + properties: + role: + const: developer + default: developer + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + required: + - content + title: OpenAIDeveloperMessageParam + type: object + OpenAIFile: + properties: + type: + const: file + default: file + title: Type + type: string + file: + $ref: '#/$defs/OpenAIFileFile' + required: + - file + title: OpenAIFile + type: object + OpenAIFileFile: + properties: + file_data: + anyOf: + - type: string + - type: 'null' + title: File Data + file_id: + anyOf: + - type: string + - type: 'null' + title: File Id + filename: + anyOf: + - type: string + - type: 'null' + title: Filename + title: OpenAIFileFile + type: object + OpenAIImageURL: description: >- - URL of the image to include in the message - detail: - type: string + Image URL specification for OpenAI-compatible chat completion messages. + + + :param url: URL of the image to include in the message + + :param detail: (Optional) Level of detail for image processing. Can be + "low", "high", or "auto" + properties: + url: + title: Url + type: string + detail: + anyOf: + - type: string + - type: 'null' + title: Detail + required: + - url + title: OpenAIImageURL + type: object + OpenAISystemMessageParam: description: >- - (Optional) Level of detail for image processing. Can be "low", "high", - or "auto" - additionalProperties: false - required: - - url - title: OpenAIImageURL - description: >- - Image URL specification for OpenAI-compatible chat completion messages. - OpenAIMessageParam: - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - discriminator: - propertyName: role - mapping: - user: '#/components/schemas/OpenAIUserMessageParam' - system: '#/components/schemas/OpenAISystemMessageParam' - assistant: '#/components/schemas/OpenAIAssistantMessageParam' - tool: '#/components/schemas/OpenAIToolMessageParam' - developer: '#/components/schemas/OpenAIDeveloperMessageParam' - OpenAISystemMessageParam: - type: object - properties: - role: - type: string - const: system - default: system + A system message providing instructions or context to the model. + + + :param role: Must be "system" to identify this as a system message + + :param content: The content of the "system prompt". If multiple system + messages are provided, they are concatenated. The underlying Llama Stack + code may also add other system messages (for example, for formatting tool + definitions). + + :param name: (Optional) The name of the system message participant. + properties: + role: + const: system + default: system + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + required: + - content + title: OpenAISystemMessageParam + type: object + OpenAITokenLogProb: description: >- - Must be "system" to identify this as a system message - content: - oneOf: - - type: string - - type: array + The log probability for a token from an OpenAI-compatible chat completion + response. + + + :token: The token + + :bytes: (Optional) The bytes for the token + + :logprob: The log probability of the token + + :top_logprobs: The top log probabilities for the token + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + title: Logprob + type: number + top_logprobs: items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + $ref: '#/$defs/OpenAITopLogProb' + title: Top Logprobs + type: array + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + type: object + OpenAIToolMessageParam: description: >- - The content of the "system prompt". If multiple system messages are provided, - they are concatenated. The underlying Llama Stack code may also add other - system messages (for example, for formatting tool definitions). - name: - type: string + A message representing the result of a tool invocation in an OpenAI-compatible + chat completion request. + + + :param role: Must be "tool" to identify this as a tool response + + :param tool_call_id: Unique identifier for the tool call this response + is for + + :param content: The response content from the tool + properties: + role: + const: tool + default: tool + title: Role + type: string + tool_call_id: + title: Tool Call Id + type: string + content: + anyOf: + - type: string + - items: + $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + type: array + title: Content + required: + - tool_call_id + - content + title: OpenAIToolMessageParam + type: object + OpenAITopLogProb: description: >- - (Optional) The name of the system message participant. - additionalProperties: false - required: - - role - - content - title: OpenAISystemMessageParam + The top log probability for a token from an OpenAI-compatible chat completion + response. + + + :token: The token + + :bytes: (Optional) The bytes for the token + + :logprob: The log probability of the token + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + title: Logprob + type: number + required: + - token + - logprob + title: OpenAITopLogProb + type: object + OpenAIUserMessageParam: + description: >- + A message from the user in an OpenAI-compatible chat completion request. + + + :param role: Must be "user" to identify this as a user message + + :param content: The content of the message, which can include text and + other media + + :param name: (Optional) The name of the user message participant. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + file: '#/$defs/OpenAIFile' + image_url: >- + #/$defs/OpenAIChatCompletionContentPartImageParam + text: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + - $ref: >- + #/$defs/OpenAIChatCompletionContentPartImageParam + - $ref: '#/$defs/OpenAIFile' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + required: + - content + title: OpenAIUserMessageParam + type: object description: >- - A system message providing instructions or context to the model. - OpenAITokenLogProb: - type: object + Response from listing OpenAI-compatible chat completions. + + + :param data: List of chat completion objects with their input messages + + :param has_more: Whether there are more completions available beyond this + list + + :param first_id: ID of the first completion in this list + + :param last_id: ID of the last completion in this list + + :param object: Must be "list" to identify this as a list response properties: - token: - type: string - bytes: - type: array + data: items: - type: integer - logprob: - type: number - top_logprobs: + $ref: >- + #/$defs/OpenAICompletionWithInputMessages + title: Data type: array - items: - $ref: '#/components/schemas/OpenAITopLogProb' - additionalProperties: false - required: - - token - - logprob - - top_logprobs - title: OpenAITokenLogProb - description: >- - The log probability for a token from an OpenAI-compatible chat completion - response. - OpenAIToolMessageParam: - type: object - properties: - role: + has_more: + title: Has More + type: boolean + first_id: + title: First Id type: string - const: tool - default: tool - description: >- - Must be "tool" to identify this as a tool response - tool_call_id: + last_id: + title: Last Id type: string - description: >- - Unique identifier for the tool call this response is for - content: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - description: The response content from the tool - additionalProperties: false - required: - - role - - tool_call_id - - content - title: OpenAIToolMessageParam - description: >- - A message representing the result of a tool invocation in an OpenAI-compatible - chat completion request. - OpenAITopLogProb: - type: object - properties: - token: + object: + const: list + default: list + title: Object type: string - bytes: - type: array - items: - type: integer - logprob: - type: number - additionalProperties: false required: - - token - - logprob - title: OpenAITopLogProb - description: >- - The top log probability for a token from an OpenAI-compatible chat completion - response. - OpenAIUserMessageParam: + - data + - has_more + - first_id + - last_id + title: ListOpenAIChatCompletionResponse type: object - properties: - role: - type: string - const: user - default: user - description: >- - Must be "user" to identify this as a user message - content: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartParam' - description: >- - The content of the message, which can include text and other media - name: - type: string - description: >- - (Optional) The name of the user message participant. - additionalProperties: false - required: - - role - - content - title: OpenAIUserMessageParam - description: >- - A message from the user in an OpenAI-compatible chat completion request. - OpenAIJSONSchema: + Annotated: type: object - properties: - name: - type: string - description: Name of the schema - description: - type: string - description: (Optional) Description of the schema - strict: - type: boolean + ? >- + llama_stack.apis.inference.inference.OpenAIChatCompletion | collections.abc.AsyncIterator[llama_stack.apis.inference.inference.OpenAIChatCompletionChunk] + : type: object + OpenAICompletionWithInputMessages: + $defs: + OpenAIAssistantMessageParam: description: >- - (Optional) Whether to enforce strict adherence to the schema - schema: + A message containing the model's (assistant) response in an OpenAI-compatible + chat completion request. + + + :param role: Must be "assistant" to identify this as the model's response + + :param content: The content of the model's response + + :param name: (Optional) The name of the assistant message participant. + + :param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall + object. + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + type: array + - type: 'null' + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/$defs/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + title: Tool Calls + title: OpenAIAssistantMessageParam type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The JSON schema definition - additionalProperties: false - required: - - name - title: OpenAIJSONSchema - description: >- - JSON schema specification for OpenAI-compatible structured response format. - OpenAIResponseFormatJSONObject: - type: object - properties: - type: - type: string - const: json_object - default: json_object - description: >- - Must be "json_object" to indicate generic JSON object response format - additionalProperties: false - required: - - type - title: OpenAIResponseFormatJSONObject - description: >- - JSON object response format for OpenAI-compatible chat completion requests. - OpenAIResponseFormatJSONSchema: - type: object - properties: - type: - type: string - const: json_schema - default: json_schema - description: >- - Must be "json_schema" to indicate structured JSON response format - json_schema: - $ref: '#/components/schemas/OpenAIJSONSchema' + "OpenAIChatCompletionContentPartImageParam": description: >- - The JSON schema specification for the response - additionalProperties: false - required: - - type - - json_schema - title: OpenAIResponseFormatJSONSchema - description: >- - JSON schema response format for OpenAI-compatible chat completion requests. - OpenAIResponseFormatParam: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseFormatText' - - $ref: '#/components/schemas/OpenAIResponseFormatJSONSchema' - - $ref: '#/components/schemas/OpenAIResponseFormatJSONObject' - discriminator: - propertyName: type - mapping: - text: '#/components/schemas/OpenAIResponseFormatText' - json_schema: '#/components/schemas/OpenAIResponseFormatJSONSchema' - json_object: '#/components/schemas/OpenAIResponseFormatJSONObject' - OpenAIResponseFormatText: - type: object - properties: - type: - type: string - const: text - default: text + Image content part for OpenAI-compatible chat completion messages. + + + :param type: Must be "image_url" to identify this as image content + + :param image_url: Image URL specification and processing details + properties: + type: + const: image_url + default: image_url + title: Type + type: string + image_url: + $ref: '#/$defs/OpenAIImageURL' + required: + - image_url + title: >- + OpenAIChatCompletionContentPartImageParam + type: object + OpenAIChatCompletionContentPartTextParam: description: >- - Must be "text" to indicate plain text response format - additionalProperties: false - required: - - type - title: OpenAIResponseFormatText - description: >- - Text response format for OpenAI-compatible chat completion requests. - OpenAIChatCompletionRequestWithExtraBody: - type: object - properties: - model: - type: string + Text content part for OpenAI-compatible chat completion messages. + + + :param type: Must be "text" to identify this as text content + + :param text: The text content of the message + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: OpenAIChatCompletionContentPartTextParam + type: object + OpenAIChatCompletionToolCall: description: >- - The identifier of the model to use. The model must be registered with - Llama Stack and available via the /models endpoint. - messages: - type: array - items: - $ref: '#/components/schemas/OpenAIMessageParam' - description: List of messages in the conversation. - frequency_penalty: - type: number + Tool call specification for OpenAI-compatible chat completion responses. + + + :param index: (Optional) Index of the tool call in the list + + :param id: (Optional) Unique identifier for the tool call + + :param type: Must be "function" to identify this as a function call + + :param function: (Optional) Function call details + properties: + index: + anyOf: + - type: integer + - type: 'null' + title: Index + id: + anyOf: + - type: string + - type: 'null' + title: Id + type: + const: function + default: function + title: Type + type: string + function: + anyOf: + - $ref: >- + #/$defs/OpenAIChatCompletionToolCallFunction + - type: 'null' + title: OpenAIChatCompletionToolCall + type: object + OpenAIChatCompletionToolCallFunction: description: >- - (Optional) The penalty for repeated tokens. - function_call: - oneOf: - - type: string - - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The function call to use. - functions: - type: array - items: - type: object - additionalProperties: - oneOf: + Function call details for OpenAI-compatible tool calls. + + + :param name: (Optional) Name of the function to call + + :param arguments: (Optional) Arguments to pass to the function as a JSON + string + properties: + name: + anyOf: + - type: string - type: 'null' - - type: boolean - - type: number + title: Name + arguments: + anyOf: - type: string - - type: array - - type: object - description: (Optional) List of functions to use. - logit_bias: + - type: 'null' + title: Arguments + title: OpenAIChatCompletionToolCallFunction type: object - additionalProperties: - type: number - description: (Optional) The logit bias to use. - logprobs: - type: boolean - description: (Optional) The log probabilities to use. - max_completion_tokens: - type: integer + OpenAIChatCompletionUsage: description: >- - (Optional) The maximum number of tokens to generate. - max_tokens: - type: integer + Usage information for OpenAI chat completion. + + + :param prompt_tokens: Number of tokens in the prompt + + :param completion_tokens: Number of tokens in the completion + + :param total_tokens: Total tokens used (prompt + completion) + + :param input_tokens_details: Detailed breakdown of input token usage + + :param output_tokens_details: Detailed breakdown of output token usage + properties: + prompt_tokens: + title: Prompt Tokens + type: integer + completion_tokens: + title: Completion Tokens + type: integer + total_tokens: + title: Total Tokens + type: integer + prompt_tokens_details: + anyOf: + - $ref: >- + #/$defs/OpenAIChatCompletionUsagePromptTokensDetails + - type: 'null' + completion_tokens_details: + anyOf: + - $ref: >- + #/$defs/OpenAIChatCompletionUsageCompletionTokensDetails + - type: 'null' + required: + - prompt_tokens + - completion_tokens + - total_tokens + title: OpenAIChatCompletionUsage + type: object + "OpenAIChatCompletionUsageCompletionTokensDetails": description: >- - (Optional) The maximum number of tokens to generate. - n: - type: integer + Token details for output tokens in OpenAI chat completion usage. + + + :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens + title: >- + OpenAIChatCompletionUsageCompletionTokensDetails + type: object + "OpenAIChatCompletionUsagePromptTokensDetails": description: >- - (Optional) The number of completions to generate. - parallel_tool_calls: - type: boolean + Token details for prompt tokens in OpenAI chat completion usage. + + + :param cached_tokens: Number of tokens retrieved from cache + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens + title: >- + OpenAIChatCompletionUsagePromptTokensDetails + type: object + OpenAIChoice: description: >- - (Optional) Whether to parallelize tool calls. - presence_penalty: - type: number + A choice from an OpenAI-compatible chat completion response. + + + :param message: The message from the model + + :param finish_reason: The reason the model stopped generating + + :param index: The index of the choice + + :param logprobs: (Optional) The log probabilities for the tokens in the + message + properties: + message: + discriminator: + mapping: + assistant: '#/$defs/OpenAIAssistantMessageParam' + developer: '#/$defs/OpenAIDeveloperMessageParam' + system: '#/$defs/OpenAISystemMessageParam' + tool: '#/$defs/OpenAIToolMessageParam' + user: '#/$defs/OpenAIUserMessageParam' + propertyName: role + oneOf: + - $ref: '#/$defs/OpenAIUserMessageParam' + - $ref: '#/$defs/OpenAISystemMessageParam' + - $ref: '#/$defs/OpenAIAssistantMessageParam' + - $ref: '#/$defs/OpenAIToolMessageParam' + - $ref: '#/$defs/OpenAIDeveloperMessageParam' + title: Message + finish_reason: + title: Finish Reason + type: string + index: + title: Index + type: integer + logprobs: + anyOf: + - $ref: '#/$defs/OpenAIChoiceLogprobs' + - type: 'null' + required: + - message + - finish_reason + - index + title: OpenAIChoice + type: object + OpenAIChoiceLogprobs: description: >- - (Optional) The penalty for repeated tokens. - response_format: - $ref: '#/components/schemas/OpenAIResponseFormatParam' - description: (Optional) The response format to use. - seed: - type: integer - description: (Optional) The seed to use. - stop: - oneOf: - - type: string - - type: array - items: - type: string - description: (Optional) The stop tokens to use. - stream: - type: boolean + The log probabilities for the tokens in the message from an OpenAI-compatible + chat completion response. + + + :param content: (Optional) The log probabilities for the tokens in the + message + + :param refusal: (Optional) The log probabilities for the tokens in the + message + properties: + content: + anyOf: + - items: + $ref: '#/$defs/OpenAITokenLogProb' + type: array + - type: 'null' + title: Content + refusal: + anyOf: + - items: + $ref: '#/$defs/OpenAITokenLogProb' + type: array + - type: 'null' + title: Refusal + title: OpenAIChoiceLogprobs + type: object + OpenAIDeveloperMessageParam: description: >- - (Optional) Whether to stream the response. - stream_options: + A message from the developer in an OpenAI-compatible chat completion request. + + + :param role: Must be "developer" to identify this as a developer message + + :param content: The content of the developer message + + :param name: (Optional) The name of the developer message participant. + properties: + role: + const: developer + default: developer + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + required: + - content + title: OpenAIDeveloperMessageParam type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The stream options to use. - temperature: - type: number - description: (Optional) The temperature to use. - tool_choice: - oneOf: - - type: string - - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The tool choice to use. - tools: - type: array - items: - type: object - additionalProperties: - oneOf: + OpenAIFile: + properties: + type: + const: file + default: file + title: Type + type: string + file: + $ref: '#/$defs/OpenAIFileFile' + required: + - file + title: OpenAIFile + type: object + OpenAIFileFile: + properties: + file_data: + anyOf: + - type: string - type: 'null' - - type: boolean - - type: number + title: File Data + file_id: + anyOf: - type: string - - type: array - - type: object - description: (Optional) The tools to use. - top_logprobs: - type: integer + - type: 'null' + title: File Id + filename: + anyOf: + - type: string + - type: 'null' + title: Filename + title: OpenAIFileFile + type: object + OpenAIImageURL: description: >- - (Optional) The top log probabilities to use. - top_p: - type: number - description: (Optional) The top p to use. - user: - type: string - description: (Optional) The user to use. - additionalProperties: false - required: - - model - - messages - title: OpenAIChatCompletionRequestWithExtraBody - description: >- - Request parameters for OpenAI-compatible chat completion endpoint. - OpenAIChatCompletion: - type: object + Image URL specification for OpenAI-compatible chat completion messages. + + + :param url: URL of the image to include in the message + + :param detail: (Optional) Level of detail for image processing. Can be + "low", "high", or "auto" + properties: + url: + title: Url + type: string + detail: + anyOf: + - type: string + - type: 'null' + title: Detail + required: + - url + title: OpenAIImageURL + type: object + OpenAISystemMessageParam: + description: >- + A system message providing instructions or context to the model. + + + :param role: Must be "system" to identify this as a system message + + :param content: The content of the "system prompt". If multiple system + messages are provided, they are concatenated. The underlying Llama Stack + code may also add other system messages (for example, for formatting tool + definitions). + + :param name: (Optional) The name of the system message participant. + properties: + role: + const: system + default: system + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + required: + - content + title: OpenAISystemMessageParam + type: object + OpenAITokenLogProb: + description: >- + The log probability for a token from an OpenAI-compatible chat completion + response. + + + :token: The token + + :bytes: (Optional) The bytes for the token + + :logprob: The log probability of the token + + :top_logprobs: The top log probabilities for the token + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + title: Logprob + type: number + top_logprobs: + items: + $ref: '#/$defs/OpenAITopLogProb' + title: Top Logprobs + type: array + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + type: object + OpenAIToolMessageParam: + description: >- + A message representing the result of a tool invocation in an OpenAI-compatible + chat completion request. + + + :param role: Must be "tool" to identify this as a tool response + + :param tool_call_id: Unique identifier for the tool call this response + is for + + :param content: The response content from the tool + properties: + role: + const: tool + default: tool + title: Role + type: string + tool_call_id: + title: Tool Call Id + type: string + content: + anyOf: + - type: string + - items: + $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + type: array + title: Content + required: + - tool_call_id + - content + title: OpenAIToolMessageParam + type: object + OpenAITopLogProb: + description: >- + The top log probability for a token from an OpenAI-compatible chat completion + response. + + + :token: The token + + :bytes: (Optional) The bytes for the token + + :logprob: The log probability of the token + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + title: Logprob + type: number + required: + - token + - logprob + title: OpenAITopLogProb + type: object + OpenAIUserMessageParam: + description: >- + A message from the user in an OpenAI-compatible chat completion request. + + + :param role: Must be "user" to identify this as a user message + + :param content: The content of the message, which can include text and + other media + + :param name: (Optional) The name of the user message participant. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + file: '#/$defs/OpenAIFile' + image_url: >- + #/$defs/OpenAIChatCompletionContentPartImageParam + text: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + - $ref: >- + #/$defs/OpenAIChatCompletionContentPartImageParam + - $ref: '#/$defs/OpenAIFile' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + required: + - content + title: OpenAIUserMessageParam + type: object properties: id: + title: Id type: string - description: The ID of the chat completion choices: - type: array items: - $ref: '#/components/schemas/OpenAIChoice' - description: List of choices + $ref: '#/$defs/OpenAIChoice' + title: Choices + type: array object: - type: string const: chat.completion default: chat.completion - description: >- - The object type, which will be "chat.completion" + title: Object + type: string created: + title: Created type: integer - description: >- - The Unix timestamp in seconds when the chat completion was created model: + title: Model type: string - description: >- - The model that was used to generate the chat completion usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - description: >- - Token usage information for the completion - additionalProperties: false + anyOf: + - $ref: '#/$defs/OpenAIChatCompletionUsage' + - type: 'null' + input_messages: + items: + discriminator: + mapping: + assistant: '#/$defs/OpenAIAssistantMessageParam' + developer: '#/$defs/OpenAIDeveloperMessageParam' + system: '#/$defs/OpenAISystemMessageParam' + tool: '#/$defs/OpenAIToolMessageParam' + user: '#/$defs/OpenAIUserMessageParam' + propertyName: role + oneOf: + - $ref: '#/$defs/OpenAIUserMessageParam' + - $ref: '#/$defs/OpenAISystemMessageParam' + - $ref: '#/$defs/OpenAIAssistantMessageParam' + - $ref: '#/$defs/OpenAIToolMessageParam' + - $ref: '#/$defs/OpenAIDeveloperMessageParam' + title: Input Messages + type: array required: - id - choices - - object - created - model - title: OpenAIChatCompletion - description: >- - Response from an OpenAI-compatible chat completion request. - OpenAIChatCompletionChunk: + - input_messages + title: OpenAICompletionWithInputMessages type: object + OpenAICompletion: + $defs: + OpenAIChoiceLogprobs: + description: >- + The log probabilities for the tokens in the message from an OpenAI-compatible + chat completion response. + + + :param content: (Optional) The log probabilities for the tokens in the + message + + :param refusal: (Optional) The log probabilities for the tokens in the + message + properties: + content: + anyOf: + - items: + $ref: '#/$defs/OpenAITokenLogProb' + type: array + - type: 'null' + title: Content + refusal: + anyOf: + - items: + $ref: '#/$defs/OpenAITokenLogProb' + type: array + - type: 'null' + title: Refusal + title: OpenAIChoiceLogprobs + type: object + OpenAICompletionChoice: + description: >- + A choice from an OpenAI-compatible completion response. + + + :finish_reason: The reason the model stopped generating + + :text: The text of the choice + + :index: The index of the choice + + :logprobs: (Optional) The log probabilities for the tokens in the choice + properties: + finish_reason: + title: Finish Reason + type: string + text: + title: Text + type: string + index: + title: Index + type: integer + logprobs: + anyOf: + - $ref: '#/$defs/OpenAIChoiceLogprobs' + - type: 'null' + required: + - finish_reason + - text + - index + title: OpenAICompletionChoice + type: object + OpenAITokenLogProb: + description: >- + The log probability for a token from an OpenAI-compatible chat completion + response. + + + :token: The token + + :bytes: (Optional) The bytes for the token + + :logprob: The log probability of the token + + :top_logprobs: The top log probabilities for the token + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + title: Logprob + type: number + top_logprobs: + items: + $ref: '#/$defs/OpenAITopLogProb' + title: Top Logprobs + type: array + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + type: object + OpenAITopLogProb: + description: >- + The top log probability for a token from an OpenAI-compatible chat completion + response. + + + :token: The token + + :bytes: (Optional) The bytes for the token + + :logprob: The log probability of the token + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + title: Logprob + type: number + required: + - token + - logprob + title: OpenAITopLogProb + type: object + description: >- + Response from an OpenAI-compatible completion request. + + + :id: The ID of the completion + + :choices: List of choices + + :created: The Unix timestamp in seconds when the completion was created + + :model: The model that was used to generate the completion + + :object: The object type, which will be "text_completion" properties: id: + title: Id type: string - description: The ID of the chat completion choices: - type: array items: - $ref: '#/components/schemas/OpenAIChunkChoice' - description: List of choices - object: - type: string - const: chat.completion.chunk - default: chat.completion.chunk - description: >- - The object type, which will be "chat.completion.chunk" + $ref: '#/$defs/OpenAICompletionChoice' + title: Choices + type: array created: + title: Created type: integer - description: >- - The Unix timestamp in seconds when the chat completion was created model: + title: Model + type: string + object: + const: text_completion + default: text_completion + title: Object type: string - description: >- - The model that was used to generate the chat completion - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - description: >- - Token usage information (typically included in final chunk with stream_options) - additionalProperties: false required: - id - choices - - object - created - model - title: OpenAIChatCompletionChunk - description: >- - Chunk from a streaming response to an OpenAI-compatible chat completion request. - OpenAIChoiceDelta: - type: object - properties: - content: - type: string - description: (Optional) The content of the delta - refusal: - type: string - description: (Optional) The refusal of the delta - role: - type: string - description: (Optional) The role of the delta - tool_calls: - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' - description: (Optional) The tool calls of the delta - reasoning_content: - type: string - description: >- - (Optional) The reasoning content from the model (non-standard, for o1/o3 - models) - additionalProperties: false - title: OpenAIChoiceDelta - description: >- - A delta from an OpenAI-compatible chat completion streaming response. - OpenAIChunkChoice: + title: OpenAICompletion type: object properties: - delta: - $ref: '#/components/schemas/OpenAIChoiceDelta' - description: The delta from the chunk finish_reason: type: string - description: The reason the model stopped generating + text: + type: string index: type: integer - description: The index of the choice logprobs: $ref: '#/components/schemas/OpenAIChoiceLogprobs' - description: >- - (Optional) The log probabilities for the tokens in the message additionalProperties: false required: - - delta - finish_reason + - text - index - title: OpenAIChunkChoice + title: OpenAICompletionChoice description: >- - A chunk choice from an OpenAI-compatible chat completion streaming response. - OpenAICompletionWithInputMessages: + A choice from an OpenAI-compatible completion response. + ConversationItem: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + discriminator: + propertyName: type + mapping: + message: '#/components/schemas/OpenAIResponseMessage' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + OpenAIResponseAnnotationCitation: type: object properties: - id: - type: string - description: The ID of the chat completion - choices: - type: array - items: - $ref: '#/components/schemas/OpenAIChoice' - description: List of choices - object: + type: type: string - const: chat.completion - default: chat.completion + const: url_citation + default: url_citation description: >- - The object type, which will be "chat.completion" - created: + Annotation type identifier, always "url_citation" + end_index: type: integer description: >- - The Unix timestamp in seconds when the chat completion was created - model: - type: string - description: >- - The model that was used to generate the chat completion - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - description: >- - Token usage information for the completion - input_messages: - type: array - items: - $ref: '#/components/schemas/OpenAIMessageParam' - additionalProperties: false - required: - - id - - choices - - object - - created - - model - - input_messages - title: OpenAICompletionWithInputMessages - OpenAICompletionRequestWithExtraBody: - type: object - properties: - model: - type: string - description: >- - The identifier of the model to use. The model must be registered with - Llama Stack and available via the /models endpoint. - prompt: - oneOf: - - type: string - - type: array - items: - type: string - - type: array - items: - type: integer - - type: array - items: - type: array - items: - type: integer - description: The prompt to generate a completion for. - best_of: - type: integer - description: >- - (Optional) The number of completions to generate. - echo: - type: boolean - description: (Optional) Whether to echo the prompt. - frequency_penalty: - type: number - description: >- - (Optional) The penalty for repeated tokens. - logit_bias: - type: object - additionalProperties: - type: number - description: (Optional) The logit bias to use. - logprobs: - type: boolean - description: (Optional) The log probabilities to use. - max_tokens: - type: integer - description: >- - (Optional) The maximum number of tokens to generate. - n: - type: integer - description: >- - (Optional) The number of completions to generate. - presence_penalty: - type: number - description: >- - (Optional) The penalty for repeated tokens. - seed: - type: integer - description: (Optional) The seed to use. - stop: - oneOf: - - type: string - - type: array - items: - type: string - description: (Optional) The stop tokens to use. - stream: - type: boolean - description: >- - (Optional) Whether to stream the response. - stream_options: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The stream options to use. - temperature: - type: number - description: (Optional) The temperature to use. - top_p: - type: number - description: (Optional) The top p to use. - user: - type: string - description: (Optional) The user to use. - suffix: - type: string - description: >- - (Optional) The suffix that should be appended to the completion. - additionalProperties: false - required: - - model - - prompt - title: OpenAICompletionRequestWithExtraBody - description: >- - Request parameters for OpenAI-compatible completion endpoint. - OpenAICompletion: - type: object - properties: - id: - type: string - choices: - type: array - items: - $ref: '#/components/schemas/OpenAICompletionChoice' - created: - type: integer - model: - type: string - object: - type: string - const: text_completion - default: text_completion - additionalProperties: false - required: - - id - - choices - - created - - model - - object - title: OpenAICompletion - description: >- - Response from an OpenAI-compatible completion request. - OpenAICompletionChoice: - type: object - properties: - finish_reason: - type: string - text: - type: string - index: - type: integer - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - additionalProperties: false - required: - - finish_reason - - text - - index - title: OpenAICompletionChoice - description: >- - A choice from an OpenAI-compatible completion response. - ConversationItem: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - OpenAIResponseAnnotationCitation: - type: object - properties: - type: - type: string - const: url_citation - default: url_citation - description: >- - Annotation type identifier, always "url_citation" - end_index: - type: integer - description: >- - End position of the citation span in the content - start_index: - type: integer + End position of the citation span in the content + start_index: + type: integer description: >- Start position of the citation span in the content title: @@ -6361,1326 +7389,1281 @@ components: Web search tool call output message for OpenAI responses. CreateConversationRequest: type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/ConversationItem' - description: >- - Initial items to include in the conversation context. - metadata: - type: object - additionalProperties: - type: string - description: >- - Set of key-value pairs that can be attached to an object. - additionalProperties: false - title: CreateConversationRequest Conversation: - type: object + description: OpenAI-compatible conversation object. properties: id: + description: The unique ID of the conversation. + title: Id type: string object: - type: string const: conversation default: conversation + description: >- + The object type, which is always conversation. + title: Object + type: string created_at: + description: >- + The time at which the conversation was created, measured in seconds since + the Unix epoch. + title: Created At type: integer metadata: - type: object - additionalProperties: - type: string + anyOf: + - additionalProperties: + type: string + type: object + - type: 'null' + description: >- + Set of 16 key-value pairs that can be attached to an object. This can + be useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + title: Metadata items: - type: array - items: - type: object - title: dict - description: >- - dict() -> new empty dictionary dict(mapping) -> new dictionary initialized - from a mapping object's (key, value) pairs dict(iterable) -> new - dictionary initialized as if via: d = {} for k, v in iterable: d[k] - = v dict(**kwargs) -> new dictionary initialized with the name=value - pairs in the keyword argument list. For example: dict(one=1, two=2) - additionalProperties: false + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + description: >- + Initial items to include in the conversation context. You may add up to + 20 items at a time. + title: Items required: - id - - object - created_at title: Conversation - description: OpenAI-compatible conversation object. + type: object UpdateConversationRequest: type: object - properties: - metadata: - type: object - additionalProperties: - type: string - description: >- - Set of key-value pairs that can be attached to an object. - additionalProperties: false - required: - - metadata - title: UpdateConversationRequest ConversationDeletedResource: - type: object + description: Response for deleted conversation. properties: id: + description: The deleted conversation identifier + title: Id type: string object: - type: string default: conversation.deleted + description: Object type + title: Object + type: string deleted: - type: boolean default: true - additionalProperties: false + description: Whether the object was deleted + title: Deleted + type: boolean required: - id - - object - - deleted title: ConversationDeletedResource - description: Response for deleted conversation. - ConversationItemList: - type: object - properties: - object: - type: string - default: list - data: - type: array - items: - $ref: '#/components/schemas/ConversationItem' - first_id: - type: string - last_id: - type: string - has_more: - type: boolean - default: false - additionalProperties: false - required: - - object - - data - - has_more - title: ConversationItemList - description: >- - List of conversation items with pagination. - AddItemsRequest: type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/ConversationItem' - description: >- - Items to include in the conversation context. - additionalProperties: false - required: - - items - title: AddItemsRequest - ConversationItemDeletedResource: + list: type: object - properties: - id: - type: string - object: - type: string - default: conversation.item.deleted - deleted: - type: boolean - default: true - additionalProperties: false - required: - - id - - object - - deleted - title: ConversationItemDeletedResource - description: Response for deleted conversation item. - OpenAIEmbeddingsRequestWithExtraBody: + Literal: type: object - properties: - model: - type: string - description: >- - The identifier of the model to use. The model must be an embedding model - registered with Llama Stack and available via the /models endpoint. - input: - oneOf: - - type: string - - type: array - items: - type: string - description: >- - Input text to embed, encoded as a string or array of strings. To embed - multiple inputs in a single request, pass an array of strings. - encoding_format: - type: string - default: float - description: >- - (Optional) The format to return the embeddings in. Can be either "float" - or "base64". Defaults to "float". - dimensions: - type: integer - description: >- - (Optional) The number of dimensions the resulting output embeddings should - have. Only supported in text-embedding-3 and later models. - user: - type: string - description: >- - (Optional) A unique identifier representing your end-user, which can help - OpenAI to monitor and detect abuse. - additionalProperties: false - required: - - model - - input - title: OpenAIEmbeddingsRequestWithExtraBody - description: >- - Request parameters for OpenAI-compatible embeddings endpoint. - OpenAIEmbeddingData: - type: object - properties: - object: - type: string - const: embedding - default: embedding - description: >- - The object type, which will be "embedding" - embedding: - oneOf: - - type: array - items: - type: number - - type: string - description: >- - The embedding vector as a list of floats (when encoding_format="float") - or as a base64-encoded string (when encoding_format="base64") - index: - type: integer - description: >- - The index of the embedding in the input list - additionalProperties: false - required: - - object - - embedding - - index - title: OpenAIEmbeddingData - description: >- - A single embedding data object from an OpenAI-compatible embeddings response. - OpenAIEmbeddingUsage: - type: object - properties: - prompt_tokens: - type: integer - description: The number of tokens in the input - total_tokens: - type: integer - description: The total number of tokens used - additionalProperties: false - required: - - prompt_tokens - - total_tokens - title: OpenAIEmbeddingUsage - description: >- - Usage information for an OpenAI-compatible embeddings response. - OpenAIEmbeddingsResponse: - type: object - properties: - object: - type: string - const: list - default: list - description: The object type, which will be "list" - data: - type: array - items: - $ref: '#/components/schemas/OpenAIEmbeddingData' - description: List of embedding data objects - model: - type: string - description: >- - The model that was used to generate the embeddings - usage: - $ref: '#/components/schemas/OpenAIEmbeddingUsage' - description: Usage information - additionalProperties: false - required: - - object - - data - - model - - usage - title: OpenAIEmbeddingsResponse - description: >- - Response from an OpenAI-compatible embeddings request. - OpenAIFilePurpose: - type: string - enum: - - assistants - - batch - title: OpenAIFilePurpose - description: >- - Valid purpose values for OpenAI Files API. - ListOpenAIFileResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAIFileObject' - description: List of file objects - has_more: - type: boolean - description: >- - Whether there are more files available beyond this page - first_id: - type: string - description: >- - ID of the first file in the list for pagination - last_id: - type: string - description: >- - ID of the last file in the list for pagination - object: - type: string - const: list - default: list - description: The object type, which is always "list" - additionalProperties: false - required: - - data - - has_more - - first_id - - last_id - - object - title: ListOpenAIFileResponse - description: >- - Response for listing files in OpenAI Files API. - OpenAIFileObject: - type: object - properties: - object: - type: string - const: file - default: file - description: The object type, which is always "file" - id: - type: string - description: >- - The file identifier, which can be referenced in the API endpoints - bytes: - type: integer - description: The size of the file, in bytes - created_at: - type: integer - description: >- - The Unix timestamp (in seconds) for when the file was created - expires_at: - type: integer + ConversationItemList: + $defs: + MCPListToolsTool: description: >- - The Unix timestamp (in seconds) for when the file expires - filename: - type: string - description: The name of the file - purpose: - type: string - enum: - - assistants - - batch - description: The intended purpose of the file - additionalProperties: false - required: - - object - - id - - bytes - - created_at - - expires_at - - filename - - purpose - title: OpenAIFileObject - description: >- - OpenAI File object as defined in the OpenAI Files API. - ExpiresAfter: - type: object - properties: - anchor: - type: string - const: created_at - seconds: - type: integer - additionalProperties: false - required: - - anchor - - seconds - title: ExpiresAfter - description: >- - Control expiration of uploaded files. + Tool definition returned by MCP list tools operation. - Params: - - anchor, must be "created_at" - - seconds, must be int between 3600 and 2592000 (1 hour to 30 days) - OpenAIFileDeleteResponse: - type: object - properties: - id: - type: string - description: The file identifier that was deleted - object: - type: string - const: file - default: file - description: The object type, which is always "file" - deleted: - type: boolean - description: >- - Whether the file was successfully deleted - additionalProperties: false - required: - - id - - object - - deleted - title: OpenAIFileDeleteResponse - description: >- - Response for deleting a file in OpenAI Files API. - Response: - type: object - title: Response - HealthInfo: - type: object - properties: - status: - type: string - enum: - - OK - - Error - - Not Implemented - description: Current health status of the service - additionalProperties: false - required: - - status - title: HealthInfo - description: >- - Health status information for the service. - RouteInfo: - type: object - properties: - route: - type: string - description: The API endpoint path - method: - type: string - description: HTTP method for the route - provider_types: - type: array - items: - type: string + + :param input_schema: JSON schema defining the tool's input parameters + + :param name: Name of the tool + + :param description: (Optional) Description of what the tool does + properties: + input_schema: + additionalProperties: true + title: Input Schema + type: object + name: + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + required: + - input_schema + - name + title: MCPListToolsTool + type: object + OpenAIResponseAnnotationCitation: description: >- - List of provider types that implement this route - additionalProperties: false - required: - - route - - method - - provider_types - title: RouteInfo - description: >- - Information about an API route including its path, method, and implementing - providers. - ListRoutesResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/RouteInfo' + URL citation annotation for referencing external web resources. + + + :param type: Annotation type identifier, always "url_citation" + + :param end_index: End position of the citation span in the content + + :param start_index: Start position of the citation span in the content + + :param title: Title of the referenced web resource + + :param url: URL of the referenced web resource + properties: + type: + const: url_citation + default: url_citation + title: Type + type: string + end_index: + title: End Index + type: integer + start_index: + title: Start Index + type: integer + title: + title: Title + type: string + url: + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + "OpenAIResponseAnnotationContainerFileCitation": + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: >- + OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: description: >- - List of available route information objects - additionalProperties: false - required: - - data - title: ListRoutesResponse - description: >- - Response containing a list of all available API routes. - OpenAIModel: - type: object - properties: - id: - type: string - object: - type: string - const: model - default: model - created: - type: integer - owned_by: - type: string - custom_metadata: + File citation annotation for referencing specific files in response content. + + + :param type: Annotation type identifier, always "file_citation" + + :param file_id: Unique identifier of the referenced file + + :param filename: Name of the referenced file + + :param index: Position index of the citation within the content + properties: + type: + const: file_citation + default: file_citation + title: Type + type: string + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + index: + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - additionalProperties: false - required: - - id - - object - - created - - owned_by - title: OpenAIModel - description: A model from OpenAI. - OpenAIListModelsResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAIModel' - additionalProperties: false - required: - - data - title: OpenAIListModelsResponse - ModelType: - type: string - enum: - - llm - - embedding - - rerank - title: ModelType - description: >- - Enumeration of supported model types in Llama Stack. - RegisterModelRequest: - type: object - properties: - model_id: - type: string - description: The identifier of the model to register. - provider_model_id: - type: string + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: + description: >- + Refusal content within a streamed response part. + + + :param type: Content part type identifier, always "refusal" + + :param refusal: Refusal text supplied by the model + properties: + type: + const: refusal + default: refusal + title: Type + type: string + refusal: + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + "OpenAIResponseInputFunctionToolCallOutput": description: >- - The identifier of the model in the provider. - provider_id: - type: string - description: The identifier of the provider. - metadata: + This represents the output of a function call that gets passed back to + the model. + properties: + call_id: + title: Call Id + type: string + output: + title: Output + type: string + type: + const: function_call_output + default: function_call_output + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - call_id + - output + title: >- + OpenAIResponseInputFunctionToolCallOutput type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Any additional metadata for this model. - model_type: - $ref: '#/components/schemas/ModelType' - description: The type of model to register. - additionalProperties: false - required: - - model_id - title: RegisterModelRequest - Model: - type: object - properties: - identifier: - type: string + OpenAIResponseInputMessageContentImage: description: >- - Unique identifier for this resource in llama stack - provider_resource_id: - type: string + Image content for input messages in OpenAI response format. + + + :param detail: Level of detail for image processing, can be "low", "high", + or "auto" + + :param type: Content type identifier, always "input_image" + + :param image_url: (Optional) URL of the image content + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + title: Detail + type: + const: input_image + default: input_image + title: Type + type: string + image_url: + anyOf: + - type: string + - type: 'null' + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: description: >- - Unique identifier for this resource in the provider - provider_id: - type: string + Text content for input messages in OpenAI response format. + + + :param text: The text content of the input message + + :param type: Content type identifier, always "input_text" + properties: + text: + title: Text + type: string + type: + const: input_text + default: input_text + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseMCPApprovalRequest: description: >- - ID of the provider that owns this resource - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: model - default: model + A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments + type: string + id: + title: Id + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMCPApprovalResponse: + description: A response to an MCP approval request. + properties: + approval_request_id: + title: Approval Request Id + type: string + approve: + title: Approve + type: boolean + type: + const: mcp_approval_response + default: mcp_approval_response + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + reason: + anyOf: + - type: string + - type: 'null' + title: Reason + required: + - approval_request_id + - approve + title: OpenAIResponseMCPApprovalResponse + type: object + OpenAIResponseMessage: description: >- - The resource type, always 'model' for model resources - metadata: + Corresponds to the various Message types in the Responses API. + + They are all under one type because the Responses API gives them all + + the same "type" value, and there is no way to tell them apart in certain + + scenarios. + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_image: >- + #/$defs/OpenAIResponseInputMessageContentImage + input_text: >- + #/$defs/OpenAIResponseInputMessageContentText + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentText + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentImage + type: array + - items: + discriminator: + mapping: + output_text: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + - $ref: '#/$defs/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - content + - role + title: OpenAIResponseMessage type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Any additional metadata for this model - model_type: - $ref: '#/components/schemas/ModelType' - default: llm + "OpenAIResponseOutputMessageContentOutputText": + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + file_citation: >- + #/$defs/OpenAIResponseAnnotationFileCitation + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseAnnotationFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationCitation' + - $ref: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: >- + OpenAIResponseOutputMessageContentOutputText + type: object + "OpenAIResponseOutputMessageFileSearchToolCall": description: >- - The type of model (LLM or embedding model) - additionalProperties: false - required: - - identifier - - provider_id - - type - - metadata - - model_type - title: Model - description: >- - A model resource representing an AI model registered in Llama Stack. - RunModerationRequest: - type: object - properties: - input: - oneOf: - - type: string - - type: array + File search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param queries: List of search queries executed + + :param status: Current status of the file search operation + + :param type: Tool call type identifier, always "file_search_call" + + :param results: (Optional) Search results returned by the file search + operation + properties: + id: + title: Id + type: string + queries: items: type: string + title: Queries + type: array + status: + title: Status + type: string + type: + const: file_search_call + default: file_search_call + title: Type + type: string + results: + anyOf: + - items: + $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults + type: array + - type: 'null' + title: Results + required: + - id + - queries + - status + title: >- + OpenAIResponseOutputMessageFileSearchToolCall + type: object + "OpenAIResponseOutputMessageFileSearchToolCallResults": description: >- - Input (or inputs) to classify. Can be a single string, an array of strings, - or an array of multi-modal input objects similar to other models. - model: - type: string - description: >- - (Optional) The content moderation model you would like to use. - additionalProperties: false - required: - - input - title: RunModerationRequest - ModerationObject: - type: object - properties: - id: - type: string - description: >- - The unique identifier for the moderation request. - model: - type: string + Search results returned by the file search operation. + + + :param attributes: (Optional) Key-value attributes associated with the + file + + :param file_id: Unique identifier of the file containing the result + + :param filename: Name of the file containing the result + + :param score: Relevance score for this search result (between 0 and 1) + + :param text: Text content of the search result + properties: + attributes: + additionalProperties: true + title: Attributes + type: object + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + score: + title: Score + type: number + text: + title: Text + type: string + required: + - attributes + - file_id + - filename + - score + - text + title: >- + OpenAIResponseOutputMessageFileSearchToolCallResults + type: object + "OpenAIResponseOutputMessageFunctionToolCall": description: >- - The model used to generate the moderation results. - results: - type: array - items: - $ref: '#/components/schemas/ModerationObjectResults' - description: A list of moderation objects - additionalProperties: false - required: - - id - - model - - results - title: ModerationObject - description: A moderation object. - ModerationObjectResults: - type: object - properties: - flagged: - type: boolean + Function tool call output message for OpenAI responses. + + + :param call_id: Unique identifier for the function call + + :param name: Name of the function being called + + :param arguments: JSON string containing the function arguments + + :param type: Tool call type identifier, always "function_call" + + :param id: (Optional) Additional identifier for the tool call + + :param status: (Optional) Current status of the function call execution + properties: + call_id: + title: Call Id + type: string + name: + title: Name + type: string + arguments: + title: Arguments + type: string + type: + const: function_call + default: function_call + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - call_id + - name + - arguments + title: >- + OpenAIResponseOutputMessageFunctionToolCall + type: object + OpenAIResponseOutputMessageMCPCall: description: >- - Whether any of the below categories are flagged. - categories: + Model Context Protocol (MCP) call output message for OpenAI responses. + + + :param id: Unique identifier for this MCP call + + :param type: Tool call type identifier, always "mcp_call" + + :param arguments: JSON string containing the MCP call arguments + + :param name: Name of the MCP method being called + + :param server_label: Label identifying the MCP server handling the call + + :param error: (Optional) Error message if the MCP call failed + + :param output: (Optional) Output result from the successful MCP call + properties: + id: + title: Id + type: string + type: + const: mcp_call + default: mcp_call + title: Type + type: string + arguments: + title: Arguments + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + error: + anyOf: + - type: string + - type: 'null' + title: Error + output: + anyOf: + - type: string + - type: 'null' + title: Output + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall type: object - additionalProperties: - type: boolean + OpenAIResponseOutputMessageMCPListTools: description: >- - A list of the categories, and whether they are flagged or not. - category_applied_input_types: - type: object - additionalProperties: - type: array - items: + MCP list tools output message containing available tools from an MCP server. + + + :param id: Unique identifier for this MCP list tools operation + + :param type: Tool call type identifier, always "mcp_list_tools" + + :param server_label: Label identifying the MCP server providing the tools + + :param tools: List of available tools provided by the MCP server + properties: + id: + title: Id type: string - description: >- - A list of the categories along with the input type(s) that the score applies - to. - category_scores: + type: + const: mcp_list_tools + default: mcp_list_tools + title: Type + type: string + server_label: + title: Server Label + type: string + tools: + items: + $ref: '#/$defs/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools type: object - additionalProperties: - type: number + "OpenAIResponseOutputMessageWebSearchToolCall": description: >- - A list of the categories along with their scores as predicted by model. - user_message: - type: string - metadata: + Web search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param status: Current status of the web search operation + + :param type: Tool call type identifier, always "web_search_call" + properties: + id: + title: Id + type: string + status: + title: Status + type: string + type: + const: web_search_call + default: web_search_call + title: Type + type: string + required: + - id + - status + title: >- + OpenAIResponseOutputMessageWebSearchToolCall type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - additionalProperties: false - required: - - flagged - - metadata - title: ModerationObjectResults - description: A moderation object. - Prompt: - type: object - properties: - prompt: - type: string - description: >- - The system prompt text with variable placeholders. Variables are only - supported when using the Responses API. - version: - type: integer - description: >- - Version (integer starting at 1, incremented on save) - prompt_id: - type: string - description: >- - Unique identifier formatted as 'pmpt_<48-digit-hash>' - variables: - type: array - items: - type: string - description: >- - List of prompt variable names that can be used in the prompt template - is_default: - type: boolean - default: false - description: >- - Boolean indicating whether this version is the default version for this - prompt - additionalProperties: false - required: - - version - - prompt_id - - variables - - is_default - title: Prompt description: >- - A prompt resource representing a stored OpenAI Compatible prompt template - in Llama Stack. - ListPromptsResponse: - type: object + List of conversation items with pagination. properties: + object: + default: list + description: Object type + title: Object + type: string data: - type: array + description: List of conversation items items: - $ref: '#/components/schemas/Prompt' - additionalProperties: false + discriminator: + mapping: + file_search_call: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + function_call: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + function_call_output: >- + #/$defs/OpenAIResponseInputFunctionToolCallOutput + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: >- + #/$defs/OpenAIResponseMCPApprovalResponse + mcp_call: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + mcp_list_tools: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + message: '#/$defs/OpenAIResponseMessage' + web_search_call: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseMessage' + - $ref: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + - $ref: >- + #/$defs/OpenAIResponseInputFunctionToolCallOutput + - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' + - $ref: >- + #/$defs/OpenAIResponseMCPApprovalResponse + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + title: Data + type: array + first_id: + anyOf: + - type: string + - type: 'null' + description: The ID of the first item in the list + title: First Id + last_id: + anyOf: + - type: string + - type: 'null' + description: The ID of the last item in the list + title: Last Id + has_more: + default: false + description: Whether there are more items available + title: Has More + type: boolean required: - data - title: ListPromptsResponse - description: Response model to list prompts. - CreatePromptRequest: + title: ConversationItemList type: object - properties: - prompt: - type: string - description: >- - The prompt text content with variable placeholders. - variables: - type: array - items: - type: string - description: >- - List of variable names that can be used in the prompt template. - additionalProperties: false - required: - - prompt - title: CreatePromptRequest - UpdatePromptRequest: + AddItemsRequest: type: object + ConversationItemDeletedResource: + description: Response for deleted conversation item. properties: - prompt: + id: + description: The deleted item identifier + title: Id type: string - description: The updated prompt text content. - version: - type: integer - description: >- - The current version of the prompt being updated. - variables: - type: array - items: - type: string - description: >- - Updated list of variable names that can be used in the prompt template. - set_as_default: + object: + default: conversation.item.deleted + description: Object type + title: Object + type: string + deleted: + default: true + description: Whether the object was deleted + title: Deleted type: boolean - description: >- - Set the new version as the default (default=True). - additionalProperties: false - required: - - prompt - - version - - set_as_default - title: UpdatePromptRequest - SetDefaultVersionRequest: - type: object - properties: - version: - type: integer - description: The version to set as default. - additionalProperties: false required: - - version - title: SetDefaultVersionRequest - ProviderInfo: + - id + title: ConversationItemDeletedResource type: object - properties: - api: - type: string - description: The API name this provider implements - provider_id: - type: string - description: Unique identifier for the provider - provider_type: - type: string - description: The type of provider implementation - config: + OpenAIEmbeddingsResponse: + $defs: + OpenAIEmbeddingData: + description: >- + A single embedding data object from an OpenAI-compatible embeddings response. + + + :param object: The object type, which will be "embedding" + + :param embedding: The embedding vector as a list of floats (when encoding_format="float") + or as a base64-encoded string (when encoding_format="base64") + + :param index: The index of the embedding in the input list + properties: + object: + const: embedding + default: embedding + title: Object + type: string + embedding: + anyOf: + - items: + type: number + type: array + - type: string + title: Embedding + index: + title: Index + type: integer + required: + - embedding + - index + title: OpenAIEmbeddingData type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + OpenAIEmbeddingUsage: description: >- - Configuration parameters for the provider - health: + Usage information for an OpenAI-compatible embeddings response. + + + :param prompt_tokens: The number of tokens in the input + + :param total_tokens: The total number of tokens used + properties: + prompt_tokens: + title: Prompt Tokens + type: integer + total_tokens: + title: Total Tokens + type: integer + required: + - prompt_tokens + - total_tokens + title: OpenAIEmbeddingUsage type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Current health status of the provider - additionalProperties: false - required: - - api - - provider_id - - provider_type - - config - - health - title: ProviderInfo description: >- - Information about a registered provider including its configuration and health - status. - ListProvidersResponse: - type: object + Response from an OpenAI-compatible embeddings request. + + + :param object: The object type, which will be "list" + + :param data: List of embedding data objects + + :param model: The model that was used to generate the embeddings + + :param usage: Usage information properties: + object: + const: list + default: list + title: Object + type: string data: - type: array items: - $ref: '#/components/schemas/ProviderInfo' - description: List of provider information objects - additionalProperties: false + $ref: '#/$defs/OpenAIEmbeddingData' + title: Data + type: array + model: + title: Model + type: string + usage: + $ref: '#/$defs/OpenAIEmbeddingUsage' required: - data - title: ListProvidersResponse + - model + - usage + title: OpenAIEmbeddingsResponse + type: object + OpenAIFilePurpose: + type: object + ListOpenAIFileResponse: + $defs: + OpenAIFileObject: + description: >- + OpenAI File object as defined in the OpenAI Files API. + + + :param object: The object type, which is always "file" + + :param id: The file identifier, which can be referenced in the API endpoints + + :param bytes: The size of the file, in bytes + + :param created_at: The Unix timestamp (in seconds) for when the file was + created + + :param expires_at: The Unix timestamp (in seconds) for when the file expires + + :param filename: The name of the file + + :param purpose: The intended purpose of the file + properties: + object: + const: file + default: file + title: Object + type: string + id: + title: Id + type: string + bytes: + title: Bytes + type: integer + created_at: + title: Created At + type: integer + expires_at: + title: Expires At + type: integer + filename: + title: Filename + type: string + purpose: + $ref: '#/$defs/OpenAIFilePurpose' + required: + - id + - bytes + - created_at + - expires_at + - filename + - purpose + title: OpenAIFileObject + type: object + OpenAIFilePurpose: + description: >- + Valid purpose values for OpenAI Files API. + enum: + - assistants + - batch + title: OpenAIFilePurpose + type: string description: >- - Response containing a list of all available providers. - ListOpenAIResponseObject: - type: object + Response for listing files in OpenAI Files API. + + + :param data: List of file objects + + :param has_more: Whether there are more files available beyond this page + + :param first_id: ID of the first file in the list for pagination + + :param last_id: ID of the last file in the list for pagination + + :param object: The object type, which is always "list" properties: data: - type: array items: - $ref: '#/components/schemas/OpenAIResponseObjectWithInput' - description: >- - List of response objects with their input context + $ref: '#/$defs/OpenAIFileObject' + title: Data + type: array has_more: + title: Has More type: boolean - description: >- - Whether there are more results available beyond this page first_id: + title: First Id type: string - description: >- - Identifier of the first item in this page last_id: + title: Last Id type: string - description: Identifier of the last item in this page object: - type: string const: list default: list - description: Object type identifier, always "list" - additionalProperties: false + title: Object + type: string required: - data - has_more - first_id - last_id - - object - title: ListOpenAIResponseObject - description: >- - Paginated list of OpenAI response objects with navigation metadata. - OpenAIResponseError: + title: ListOpenAIFileResponse type: object - properties: - code: - type: string - description: >- - Error code identifying the type of failure - message: - type: string - description: >- - Human-readable error message describing the failure - additionalProperties: false - required: - - code - - message - title: OpenAIResponseError + ExpiresAfter: description: >- - Error details for failed OpenAI response requests. - OpenAIResponseInput: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutput' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseMessage' - OpenAIResponseInputToolFileSearch: - type: object + Control expiration of uploaded files. + + + Params: + - anchor, must be "created_at" + - seconds, must be int between 3600 and 2592000 (1 hour to 30 days) properties: - type: + anchor: + const: created_at + title: Anchor type: string - const: file_search - default: file_search - description: >- - Tool type identifier, always "file_search" - vector_store_ids: - type: array - items: - type: string - description: >- - List of vector store identifiers to search within - filters: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional filters to apply to the search - max_num_results: + seconds: + maximum: 2592000 + minimum: 3600 + title: Seconds type: integer - default: 10 - description: >- - (Optional) Maximum number of search results to return (1-50) - ranking_options: - type: object - properties: - ranker: - type: string - description: >- - (Optional) Name of the ranking algorithm to use - score_threshold: - type: number - default: 0.0 - description: >- - (Optional) Minimum relevance score threshold for results - additionalProperties: false - description: >- - (Optional) Options for ranking and scoring search results - additionalProperties: false required: - - type - - vector_store_ids - title: OpenAIResponseInputToolFileSearch - description: >- - File search tool configuration for OpenAI response inputs. - OpenAIResponseInputToolFunction: + - anchor + - seconds + title: ExpiresAfter type: object - properties: - type: - type: string - const: function - default: function - description: Tool type identifier, always "function" - name: - type: string - description: Name of the function that can be called - description: - type: string - description: >- - (Optional) Description of what the function does - parameters: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON schema defining the function's parameters - strict: - type: boolean + OpenAIFileObject: + $defs: + OpenAIFilePurpose: description: >- - (Optional) Whether to enforce strict parameter validation - additionalProperties: false - required: - - type - - name - title: OpenAIResponseInputToolFunction - description: >- - Function tool configuration for OpenAI response inputs. - OpenAIResponseInputToolWebSearch: - type: object - properties: - type: - oneOf: - - type: string - const: web_search - - type: string - const: web_search_preview - - type: string - const: web_search_preview_2025_03_11 - default: web_search - description: Web search tool type variant to use - search_context_size: + Valid purpose values for OpenAI Files API. + enum: + - assistants + - batch + title: OpenAIFilePurpose type: string - default: medium - description: >- - (Optional) Size of search context, must be "low", "medium", or "high" - additionalProperties: false - required: - - type - title: OpenAIResponseInputToolWebSearch description: >- - Web search tool configuration for OpenAI response inputs. - OpenAIResponseObjectWithInput: - type: object + OpenAI File object as defined in the OpenAI Files API. + + + :param object: The object type, which is always "file" + + :param id: The file identifier, which can be referenced in the API endpoints + + :param bytes: The size of the file, in bytes + + :param created_at: The Unix timestamp (in seconds) for when the file was created + + :param expires_at: The Unix timestamp (in seconds) for when the file expires + + :param filename: The name of the file + + :param purpose: The intended purpose of the file properties: - created_at: - type: integer - description: >- - Unix timestamp when the response was created - error: - $ref: '#/components/schemas/OpenAIResponseError' - description: >- - (Optional) Error details if the response generation failed - id: - type: string - description: Unique identifier for this response - model: - type: string - description: Model identifier used for generation - object: - type: string - const: response - default: response - description: >- - Object type identifier, always "response" - output: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseOutput' - description: >- - List of generated output items (messages, tool calls, etc.) - parallel_tool_calls: - type: boolean - default: false - description: >- - Whether tool calls can be executed in parallel - previous_response_id: - type: string - description: >- - (Optional) ID of the previous response in a conversation - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - description: >- - (Optional) Reference to a prompt template and its variables. - status: - type: string - description: >- - Current status of the response generation - temperature: - type: number - description: >- - (Optional) Sampling temperature used for generation - text: - $ref: '#/components/schemas/OpenAIResponseText' - description: >- - Text formatting configuration for the response - top_p: - type: number - description: >- - (Optional) Nucleus sampling parameter used for generation - tools: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseTool' - description: >- - (Optional) An array of tools the model may call while generating a response. - truncation: - type: string - description: >- - (Optional) Truncation strategy applied to the response - usage: - $ref: '#/components/schemas/OpenAIResponseUsage' - description: >- - (Optional) Token usage information for the response - instructions: + object: + const: file + default: file + title: Object type: string - description: >- - (Optional) System message inserted into the model's context - input: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInput' - description: >- - List of input items that led to this response - additionalProperties: false + id: + title: Id + type: string + bytes: + title: Bytes + type: integer + created_at: + title: Created At + type: integer + expires_at: + title: Expires At + type: integer + filename: + title: Filename + type: string + purpose: + $ref: '#/$defs/OpenAIFilePurpose' required: - - created_at - id - - model - - object - - output - - parallel_tool_calls - - status - - text - - input - title: OpenAIResponseObjectWithInput - description: >- - OpenAI response object extended with input context information. - OpenAIResponseOutput: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - OpenAIResponsePrompt: + - bytes + - created_at + - expires_at + - filename + - purpose + title: OpenAIFileObject type: object + OpenAIFileDeleteResponse: + description: >- + Response for deleting a file in OpenAI Files API. + + + :param id: The file identifier that was deleted + + :param object: The object type, which is always "file" + + :param deleted: Whether the file was successfully deleted properties: id: + title: Id type: string - description: Unique identifier of the prompt template - variables: - type: object - additionalProperties: - $ref: '#/components/schemas/OpenAIResponseInputMessageContent' - description: >- - Dictionary of variable names to OpenAIResponseInputMessageContent structure - for template substitution. The substitution values can either be strings, - or other Response input types like images or files. - version: + object: + const: file + default: file + title: Object type: string - description: >- - Version number of the prompt to use (defaults to latest if not specified) - additionalProperties: false + deleted: + title: Deleted + type: boolean required: - id - title: OpenAIResponsePrompt - description: >- - OpenAI compatible Prompt object that is used in OpenAI responses. - OpenAIResponseText: + - deleted + title: OpenAIFileDeleteResponse + type: object + Response: type: object + HealthInfo: + $defs: + HealthStatus: + enum: + - OK + - Error + - Not Implemented + title: HealthStatus + type: string + description: >- + Health status information for the service. + + + :param status: Current health status of the service properties: - format: - type: object + status: + $ref: '#/$defs/HealthStatus' + required: + - status + title: HealthInfo + type: object + ListRoutesResponse: + $defs: + RouteInfo: + description: >- + Information about an API route including its path, method, and implementing + providers. + + + :param route: The API endpoint path + + :param method: HTTP method for the route + + :param provider_types: List of provider types that implement this route properties: - type: - oneOf: - - type: string - const: text - - type: string - const: json_schema - - type: string - const: json_object - description: >- - Must be "text", "json_schema", or "json_object" to identify the format - type - name: + route: + title: Route type: string - description: >- - The name of the response format. Only used for json_schema. - schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The JSON schema the response should conform to. In a Python SDK, this - is often a `pydantic` model. Only used for json_schema. - description: + method: + title: Method type: string - description: >- - (Optional) A description of the response format. Only used for json_schema. - strict: - type: boolean - description: >- - (Optional) Whether to strictly enforce the JSON schema. If true, the - response must match the schema exactly. Only used for json_schema. - additionalProperties: false + provider_types: + items: + type: string + title: Provider Types + type: array required: - - type - description: >- - (Optional) Text format configuration specifying output format requirements - additionalProperties: false - title: OpenAIResponseText + - route + - method + - provider_types + title: RouteInfo + type: object description: >- - Text response configuration for OpenAI responses. - OpenAIResponseTool: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseToolMCP' - discriminator: - propertyName: type - mapping: - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseToolMCP' - OpenAIResponseToolMCP: - type: object + Response containing a list of all available API routes. + + + :param data: List of available route information objects properties: - type: - type: string - const: mcp - default: mcp - description: Tool type identifier, always "mcp" - server_label: - type: string - description: Label to identify this MCP server - allowed_tools: - oneOf: - - type: array - items: - type: string - - type: object - properties: - tool_names: - type: array - items: - type: string - description: >- - (Optional) List of specific tool names that are allowed - additionalProperties: false - title: AllowedToolsFilter - description: >- - Filter configuration for restricting which MCP tools can be used. - description: >- - (Optional) Restriction on which tools can be used from this server - additionalProperties: false + data: + items: + $ref: '#/$defs/RouteInfo' + title: Data + type: array required: - - type - - server_label - title: OpenAIResponseToolMCP + - data + title: ListRoutesResponse description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response object. - OpenAIResponseUsage: + Response containing a list of all available API routes. + OpenAIModel: type: object properties: - input_tokens: - type: integer - description: Number of tokens in the input - output_tokens: - type: integer - description: Number of tokens in the output - total_tokens: + id: + type: string + object: + type: string + const: model + default: model + created: type: integer - description: Total tokens used (input + output) - input_tokens_details: - type: object - properties: - cached_tokens: - type: integer - description: Number of tokens retrieved from cache - additionalProperties: false - description: Detailed breakdown of input token usage - output_tokens_details: + owned_by: + type: string + custom_metadata: type: object - properties: - reasoning_tokens: - type: integer - description: >- - Number of tokens used for reasoning (o1/o3 models) - additionalProperties: false - description: Detailed breakdown of output token usage + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object additionalProperties: false required: - - input_tokens - - output_tokens - - total_tokens - title: OpenAIResponseUsage - description: Usage information for OpenAI response. - ResponseGuardrailSpec: + - id + - object + - created + - owned_by + title: OpenAIModel + description: A model from OpenAI. + OpenAIListModelsResponse: type: object properties: - type: - type: string - description: The type/identifier of the guardrail. + data: + type: array + items: + $ref: '#/components/schemas/OpenAIModel' additionalProperties: false required: - - type - title: ResponseGuardrailSpec + - data + title: OpenAIListModelsResponse + ModelType: + type: string + enum: + - llm + - embedding + - rerank + title: ModelType description: >- - Specification for a guardrail to apply during response generation. - OpenAIResponseInputTool: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' - discriminator: - propertyName: type - mapping: - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseInputToolMCP' - OpenAIResponseInputToolMCP: + Enumeration of supported model types in Llama Stack. + RegisterModelRequest: type: object properties: - type: + model_id: type: string - const: mcp - default: mcp - description: Tool type identifier, always "mcp" - server_label: + description: The identifier of the model to register. + provider_model_id: type: string - description: Label to identify this MCP server - server_url: + description: >- + The identifier of the model in the provider. + provider_id: type: string - description: URL endpoint of the MCP server - headers: + description: The identifier of the provider. + metadata: type: object additionalProperties: oneOf: @@ -7690,2237 +8673,4999 @@ components: - type: string - type: array - type: object + description: Any additional metadata for this model. + model_type: + $ref: '#/components/schemas/ModelType' + description: The type of model to register. + additionalProperties: false + required: + - model_id + title: RegisterModelRequest + Model: + type: object + properties: + identifier: + type: string description: >- - (Optional) HTTP headers to include when connecting to the server - require_approval: - oneOf: - - type: string - const: always - - type: string - const: never - - type: object - properties: - always: - type: array - items: - type: string - description: >- - (Optional) List of tool names that always require approval - never: - type: array - items: - type: string - description: >- - (Optional) List of tool names that never require approval - additionalProperties: false - title: ApprovalFilter - description: >- - Filter configuration for MCP tool approval requirements. - default: never + Unique identifier for this resource in llama stack + provider_resource_id: + type: string description: >- - Approval requirement for tool calls ("always", "never", or filter) - allowed_tools: - oneOf: - - type: array - items: - type: string - - type: object - properties: - tool_names: - type: array - items: - type: string - description: >- - (Optional) List of specific tool names that are allowed - additionalProperties: false - title: AllowedToolsFilter - description: >- - Filter configuration for restricting which MCP tools can be used. + Unique identifier for this resource in the provider + provider_id: + type: string description: >- - (Optional) Restriction on which tools can be used from this server + ID of the provider that owns this resource + type: + type: string + enum: + - model + - shield + - vector_store + - dataset + - scoring_function + - benchmark + - tool + - tool_group + - prompt + const: model + default: model + description: >- + The resource type, always 'model' for model resources + metadata: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: Any additional metadata for this model + model_type: + $ref: '#/components/schemas/ModelType' + default: llm + description: >- + The type of model (LLM or embedding model) additionalProperties: false required: + - identifier + - provider_id - type - - server_label - - server_url - - require_approval - title: OpenAIResponseInputToolMCP + - metadata + - model_type + title: Model description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response inputs. - CreateOpenaiResponseRequest: + A model resource representing an AI model registered in Llama Stack. + RunModerationRequest: + type: object + ModerationObject: + $defs: + ModerationObjectResults: + description: >- + A moderation object. + + :param flagged: Whether any of the below categories are flagged. + + :param categories: A list of the categories, and whether they are flagged + or not. + + :param category_applied_input_types: A list of the categories along with + the input type(s) that the score applies to. + + :param category_scores: A list of the categories along with their scores + as predicted by model. + properties: + flagged: + title: Flagged + type: boolean + categories: + anyOf: + - additionalProperties: + type: boolean + type: object + - type: 'null' + title: Categories + category_applied_input_types: + anyOf: + - additionalProperties: + items: + type: string + type: array + type: object + - type: 'null' + title: Category Applied Input Types + category_scores: + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Category Scores + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + metadata: + additionalProperties: true + title: Metadata + type: object + required: + - flagged + title: ModerationObjectResults + type: object + description: >- + A moderation object. + + :param id: The unique identifier for the moderation request. + + :param model: The model used to generate the moderation results. + + :param results: A list of moderation objects + properties: + id: + title: Id + type: string + model: + title: Model + type: string + results: + items: + $ref: '#/$defs/ModerationObjectResults' + title: Results + type: array + required: + - id + - model + - results + title: ModerationObject + type: object + ListPromptsResponse: + $defs: + Prompt: + description: >- + A prompt resource representing a stored OpenAI Compatible prompt template + in Llama Stack. + + + :param prompt: The system prompt text with variable placeholders. Variables + are only supported when using the Responses API. + + :param version: Version (integer starting at 1, incremented on save) + + :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' + + :param variables: List of prompt variable names that can be used in the + prompt template + + :param is_default: Boolean indicating whether this version is the default + version for this prompt + properties: + prompt: + anyOf: + - type: string + - type: 'null' + description: >- + The system prompt with variable placeholders + title: Prompt + version: + description: >- + Version (integer starting at 1, incremented on save) + minimum: 1 + title: Version + type: integer + prompt_id: + description: >- + Unique identifier in format 'pmpt_<48-digit-hash>' + title: Prompt Id + type: string + variables: + description: >- + List of variable names that can be used in the prompt template + items: + type: string + title: Variables + type: array + is_default: + default: false + description: >- + Boolean indicating whether this version is the default version + title: Is Default + type: boolean + required: + - version + - prompt_id + title: Prompt + type: object + description: Response model to list prompts. + properties: + data: + items: + $ref: '#/$defs/Prompt' + title: Data + type: array + required: + - data + title: ListPromptsResponse + type: object + CreatePromptRequest: type: object + Prompt: + description: >- + A prompt resource representing a stored OpenAI Compatible prompt template + in Llama Stack. + + + :param prompt: The system prompt text with variable placeholders. Variables + are only supported when using the Responses API. + + :param version: Version (integer starting at 1, incremented on save) + + :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' + + :param variables: List of prompt variable names that can be used in the prompt + template + + :param is_default: Boolean indicating whether this version is the default + version for this prompt properties: - input: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInput' - description: Input message(s) to create the response. - model: - type: string - description: The underlying LLM used for completions. prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' + anyOf: + - type: string + - type: 'null' description: >- - (Optional) Prompt object with ID, version, and variables. - instructions: - type: string - previous_response_id: - type: string + The system prompt with variable placeholders + title: Prompt + version: description: >- - (Optional) if specified, the new response will be a continuation of the - previous response. This can be used to easily fork-off new responses from - existing responses. - conversation: + Version (integer starting at 1, incremented on save) + minimum: 1 + title: Version + type: integer + prompt_id: + description: >- + Unique identifier in format 'pmpt_<48-digit-hash>' + title: Prompt Id type: string + variables: description: >- - (Optional) The ID of a conversation to add the response to. Must begin - with 'conv_'. Input and output messages will be automatically added to - the conversation. - store: - type: boolean - stream: - type: boolean - temperature: - type: number - text: - $ref: '#/components/schemas/OpenAIResponseText' - tools: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInputTool' - include: - type: array + List of variable names that can be used in the prompt template items: type: string + title: Variables + type: array + is_default: + default: false description: >- - (Optional) Additional fields to include in the response. - max_infer_iters: - type: integer - additionalProperties: false + Boolean indicating whether this version is the default version + title: Is Default + type: boolean required: - - input - - model - title: CreateOpenaiResponseRequest - OpenAIResponseObject: + - version + - prompt_id + title: Prompt type: object - properties: - created_at: - type: integer - description: >- - Unix timestamp when the response was created - error: - $ref: '#/components/schemas/OpenAIResponseError' + UpdatePromptRequest: + type: object + SetDefaultVersionRequest: + type: object + ListProvidersResponse: + $defs: + ProviderInfo: description: >- - (Optional) Error details if the response generation failed - id: + Information about a registered provider including its configuration and + health status. + + + :param api: The API name this provider implements + + :param provider_id: Unique identifier for the provider + + :param provider_type: The type of provider implementation + + :param config: Configuration parameters for the provider + + :param health: Current health status of the provider + properties: + api: + title: Api + type: string + provider_id: + title: Provider Id + type: string + provider_type: + title: Provider Type + type: string + config: + additionalProperties: true + title: Config + type: object + health: + additionalProperties: true + title: Health + type: object + required: + - api + - provider_id + - provider_type + - config + - health + title: ProviderInfo + type: object + description: >- + Response containing a list of all available providers. + + + :param data: List of provider information objects + properties: + data: + items: + $ref: '#/$defs/ProviderInfo' + title: Data + type: array + required: + - data + title: ListProvidersResponse + type: object + ProviderInfo: + description: >- + Information about a registered provider including its configuration and health + status. + + + :param api: The API name this provider implements + + :param provider_id: Unique identifier for the provider + + :param provider_type: The type of provider implementation + + :param config: Configuration parameters for the provider + + :param health: Current health status of the provider + properties: + api: + title: Api type: string - description: Unique identifier for this response - model: + provider_id: + title: Provider Id type: string - description: Model identifier used for generation - object: + provider_type: + title: Provider Type type: string - const: response - default: response + config: + additionalProperties: true + title: Config + type: object + health: + additionalProperties: true + title: Health + type: object + required: + - api + - provider_id + - provider_type + - config + - health + title: ProviderInfo + type: object + ListOpenAIResponseObject: + $defs: + AllowedToolsFilter: description: >- - Object type identifier, always "response" - output: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseOutput' + Filter configuration for restricting which MCP tools can be used. + + + :param tool_names: (Optional) List of specific tool names that are allowed + properties: + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Tool Names + title: AllowedToolsFilter + type: object + MCPListToolsTool: description: >- - List of generated output items (messages, tool calls, etc.) - parallel_tool_calls: - type: boolean - default: false + Tool definition returned by MCP list tools operation. + + + :param input_schema: JSON schema defining the tool's input parameters + + :param name: Name of the tool + + :param description: (Optional) Description of what the tool does + properties: + input_schema: + additionalProperties: true + title: Input Schema + type: object + name: + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + required: + - input_schema + - name + title: MCPListToolsTool + type: object + OpenAIResponseAnnotationCitation: description: >- - Whether tool calls can be executed in parallel - previous_response_id: - type: string + URL citation annotation for referencing external web resources. + + + :param type: Annotation type identifier, always "url_citation" + + :param end_index: End position of the citation span in the content + + :param start_index: Start position of the citation span in the content + + :param title: Title of the referenced web resource + + :param url: URL of the referenced web resource + properties: + type: + const: url_citation + default: url_citation + title: Type + type: string + end_index: + title: End Index + type: integer + start_index: + title: Start Index + type: integer + title: + title: Title + type: string + url: + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + "OpenAIResponseAnnotationContainerFileCitation": + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: >- + OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: description: >- - (Optional) ID of the previous response in a conversation - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' + File citation annotation for referencing specific files in response content. + + + :param type: Annotation type identifier, always "file_citation" + + :param file_id: Unique identifier of the referenced file + + :param filename: Name of the referenced file + + :param index: Position index of the citation within the content + properties: + type: + const: file_citation + default: file_citation + title: Type + type: string + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + index: + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: + description: >- + Refusal content within a streamed response part. + + + :param type: Content part type identifier, always "refusal" + + :param refusal: Refusal text supplied by the model + properties: + type: + const: refusal + default: refusal + title: Type + type: string + refusal: + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + OpenAIResponseError: + description: >- + Error details for failed OpenAI response requests. + + + :param code: Error code identifying the type of failure + + :param message: Human-readable error message describing the failure + properties: + code: + title: Code + type: string + message: + title: Message + type: string + required: + - code + - message + title: OpenAIResponseError + type: object + "OpenAIResponseInputFunctionToolCallOutput": + description: >- + This represents the output of a function call that gets passed back to + the model. + properties: + call_id: + title: Call Id + type: string + output: + title: Output + type: string + type: + const: function_call_output + default: function_call_output + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - call_id + - output + title: >- + OpenAIResponseInputFunctionToolCallOutput + type: object + OpenAIResponseInputMessageContentImage: + description: >- + Image content for input messages in OpenAI response format. + + + :param detail: Level of detail for image processing, can be "low", "high", + or "auto" + + :param type: Content type identifier, always "input_image" + + :param image_url: (Optional) URL of the image content + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + title: Detail + type: + const: input_image + default: input_image + title: Type + type: string + image_url: + anyOf: + - type: string + - type: 'null' + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: description: >- - (Optional) Reference to a prompt template and its variables. - status: - type: string + Text content for input messages in OpenAI response format. + + + :param text: The text content of the input message + + :param type: Content type identifier, always "input_text" + properties: + text: + title: Text + type: string + type: + const: input_text + default: input_text + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseInputToolFileSearch: description: >- - Current status of the response generation - temperature: - type: number + File search tool configuration for OpenAI response inputs. + + + :param type: Tool type identifier, always "file_search" + + :param vector_store_ids: List of vector store identifiers to search within + + :param filters: (Optional) Additional filters to apply to the search + + :param max_num_results: (Optional) Maximum number of search results to + return (1-50) + + :param ranking_options: (Optional) Options for ranking and scoring search + results + properties: + type: + const: file_search + default: file_search + title: Type + type: string + vector_store_ids: + items: + type: string + title: Vector Store Ids + type: array + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Filters + max_num_results: + anyOf: + - maximum: 50 + minimum: 1 + type: integer + - type: 'null' + default: 10 + title: Max Num Results + ranking_options: + anyOf: + - $ref: '#/$defs/SearchRankingOptions' + - type: 'null' + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + type: object + OpenAIResponseInputToolFunction: description: >- - (Optional) Sampling temperature used for generation - text: - $ref: '#/components/schemas/OpenAIResponseText' + Function tool configuration for OpenAI response inputs. + + + :param type: Tool type identifier, always "function" + + :param name: Name of the function that can be called + + :param description: (Optional) Description of what the function does + + :param parameters: (Optional) JSON schema defining the function's parameters + + :param strict: (Optional) Whether to enforce strict parameter validation + properties: + type: + const: function + default: function + title: Type + type: string + name: + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Parameters + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + required: + - name + - parameters + title: OpenAIResponseInputToolFunction + type: object + OpenAIResponseInputToolWebSearch: description: >- - Text formatting configuration for the response - top_p: - type: number + Web search tool configuration for OpenAI response inputs. + + + :param type: Web search tool type variant to use + + :param search_context_size: (Optional) Size of search context, must be + "low", "medium", or "high" + properties: + type: + anyOf: + - const: web_search + type: string + - const: web_search_preview + type: string + - const: web_search_preview_2025_03_11 + type: string + default: web_search + title: Type + search_context_size: + anyOf: + - pattern: ^low|medium|high$ + type: string + - type: 'null' + default: medium + title: Search Context Size + title: OpenAIResponseInputToolWebSearch + type: object + OpenAIResponseMCPApprovalRequest: description: >- - (Optional) Nucleus sampling parameter used for generation - tools: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseTool' + A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments + type: string + id: + title: Id + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMCPApprovalResponse: + description: A response to an MCP approval request. + properties: + approval_request_id: + title: Approval Request Id + type: string + approve: + title: Approve + type: boolean + type: + const: mcp_approval_response + default: mcp_approval_response + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + reason: + anyOf: + - type: string + - type: 'null' + title: Reason + required: + - approval_request_id + - approve + title: OpenAIResponseMCPApprovalResponse + type: object + OpenAIResponseMessage: description: >- - (Optional) An array of tools the model may call while generating a response. - truncation: - type: string + Corresponds to the various Message types in the Responses API. + + They are all under one type because the Responses API gives them all + + the same "type" value, and there is no way to tell them apart in certain + + scenarios. + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_image: >- + #/$defs/OpenAIResponseInputMessageContentImage + input_text: >- + #/$defs/OpenAIResponseInputMessageContentText + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentText + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentImage + type: array + - items: + discriminator: + mapping: + output_text: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + - $ref: '#/$defs/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + OpenAIResponseObjectWithInput: description: >- - (Optional) Truncation strategy applied to the response - usage: - $ref: '#/components/schemas/OpenAIResponseUsage' + OpenAI response object extended with input context information. + + + :param input: List of input items that led to this response + properties: + created_at: + title: Created At + type: integer + error: + anyOf: + - $ref: '#/$defs/OpenAIResponseError' + - type: 'null' + id: + title: Id + type: string + model: + title: Model + type: string + object: + const: response + default: response + title: Object + type: string + output: + items: + discriminator: + mapping: + file_search_call: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + function_call: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + mcp_list_tools: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + message: '#/$defs/OpenAIResponseMessage' + web_search_call: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseMessage' + - $ref: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' + title: Output + type: array + parallel_tool_calls: + default: false + title: Parallel Tool Calls + type: boolean + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + status: + title: Status + type: string + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + text: + $ref: '#/$defs/OpenAIResponseText' + default: + format: + type: text + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + tools: + anyOf: + - items: + discriminator: + mapping: + file_search: >- + #/$defs/OpenAIResponseInputToolFileSearch + function: '#/$defs/OpenAIResponseInputToolFunction' + mcp: '#/$defs/OpenAIResponseToolMCP' + web_search: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseInputToolWebSearch' + - $ref: >- + #/$defs/OpenAIResponseInputToolFileSearch + - $ref: '#/$defs/OpenAIResponseInputToolFunction' + - $ref: '#/$defs/OpenAIResponseToolMCP' + type: array + - type: 'null' + title: Tools + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + usage: + anyOf: + - $ref: '#/$defs/OpenAIResponseUsage' + - type: 'null' + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + input: + items: + anyOf: + - discriminator: + mapping: + file_search_call: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + function_call: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + mcp_list_tools: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + message: '#/$defs/OpenAIResponseMessage' + web_search_call: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseMessage' + - $ref: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' + - $ref: >- + #/$defs/OpenAIResponseInputFunctionToolCallOutput + - $ref: >- + #/$defs/OpenAIResponseMCPApprovalResponse + - $ref: '#/$defs/OpenAIResponseMessage' + title: Input + type: array + required: + - created_at + - id + - model + - output + - status + - input + title: OpenAIResponseObjectWithInput + type: object + "OpenAIResponseOutputMessageContentOutputText": + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + file_citation: >- + #/$defs/OpenAIResponseAnnotationFileCitation + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseAnnotationFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationCitation' + - $ref: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: >- + OpenAIResponseOutputMessageContentOutputText + type: object + "OpenAIResponseOutputMessageFileSearchToolCall": description: >- - (Optional) Token usage information for the response - instructions: - type: string + File search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param queries: List of search queries executed + + :param status: Current status of the file search operation + + :param type: Tool call type identifier, always "file_search_call" + + :param results: (Optional) Search results returned by the file search + operation + properties: + id: + title: Id + type: string + queries: + items: + type: string + title: Queries + type: array + status: + title: Status + type: string + type: + const: file_search_call + default: file_search_call + title: Type + type: string + results: + anyOf: + - items: + $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults + type: array + - type: 'null' + title: Results + required: + - id + - queries + - status + title: >- + OpenAIResponseOutputMessageFileSearchToolCall + type: object + "OpenAIResponseOutputMessageFileSearchToolCallResults": description: >- - (Optional) System message inserted into the model's context - additionalProperties: false - required: - - created_at - - id - - model - - object - - output - - parallel_tool_calls - - status - - text - title: OpenAIResponseObject - description: >- - Complete OpenAI response object containing generation results and metadata. - OpenAIResponseContentPartOutputText: - type: object - properties: - type: - type: string - const: output_text - default: output_text + Search results returned by the file search operation. + + + :param attributes: (Optional) Key-value attributes associated with the + file + + :param file_id: Unique identifier of the file containing the result + + :param filename: Name of the file containing the result + + :param score: Relevance score for this search result (between 0 and 1) + + :param text: Text content of the search result + properties: + attributes: + additionalProperties: true + title: Attributes + type: object + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + score: + title: Score + type: number + text: + title: Text + type: string + required: + - attributes + - file_id + - filename + - score + - text + title: >- + OpenAIResponseOutputMessageFileSearchToolCallResults + type: object + "OpenAIResponseOutputMessageFunctionToolCall": description: >- - Content part type identifier, always "output_text" - text: - type: string - description: Text emitted for this content part - annotations: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseAnnotations' + Function tool call output message for OpenAI responses. + + + :param call_id: Unique identifier for the function call + + :param name: Name of the function being called + + :param arguments: JSON string containing the function arguments + + :param type: Tool call type identifier, always "function_call" + + :param id: (Optional) Additional identifier for the tool call + + :param status: (Optional) Current status of the function call execution + properties: + call_id: + title: Call Id + type: string + name: + title: Name + type: string + arguments: + title: Arguments + type: string + type: + const: function_call + default: function_call + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - call_id + - name + - arguments + title: >- + OpenAIResponseOutputMessageFunctionToolCall + type: object + OpenAIResponseOutputMessageMCPCall: description: >- - Structured annotations associated with the text - logprobs: - type: array - items: - type: object - additionalProperties: - oneOf: + Model Context Protocol (MCP) call output message for OpenAI responses. + + + :param id: Unique identifier for this MCP call + + :param type: Tool call type identifier, always "mcp_call" + + :param arguments: JSON string containing the MCP call arguments + + :param name: Name of the MCP method being called + + :param server_label: Label identifying the MCP server handling the call + + :param error: (Optional) Error message if the MCP call failed + + :param output: (Optional) Output result from the successful MCP call + properties: + id: + title: Id + type: string + type: + const: mcp_call + default: mcp_call + title: Type + type: string + arguments: + title: Arguments + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + error: + anyOf: + - type: string - type: 'null' - - type: boolean - - type: number + title: Error + output: + anyOf: - type: string - - type: array - - type: object - description: (Optional) Token log probability details - additionalProperties: false - required: - - type - - text - - annotations - title: OpenAIResponseContentPartOutputText - description: >- - Text content within a streamed response part. - "OpenAIResponseContentPartReasoningSummary": - type: object - properties: - type: - type: string - const: summary_text - default: summary_text + - type: 'null' + title: Output + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + type: object + OpenAIResponseOutputMessageMCPListTools: description: >- - Content part type identifier, always "summary_text" - text: - type: string - description: Summary text - additionalProperties: false - required: - - type - - text - title: >- - OpenAIResponseContentPartReasoningSummary - description: >- - Reasoning summary part in a streamed response. - OpenAIResponseContentPartReasoningText: - type: object - properties: - type: - type: string - const: reasoning_text - default: reasoning_text + MCP list tools output message containing available tools from an MCP server. + + + :param id: Unique identifier for this MCP list tools operation + + :param type: Tool call type identifier, always "mcp_list_tools" + + :param server_label: Label identifying the MCP server providing the tools + + :param tools: List of available tools provided by the MCP server + properties: + id: + title: Id + type: string + type: + const: mcp_list_tools + default: mcp_list_tools + title: Type + type: string + server_label: + title: Server Label + type: string + tools: + items: + $ref: '#/$defs/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + type: object + "OpenAIResponseOutputMessageWebSearchToolCall": description: >- - Content part type identifier, always "reasoning_text" - text: - type: string - description: Reasoning text supplied by the model - additionalProperties: false - required: - - type - - text - title: OpenAIResponseContentPartReasoningText - description: >- - Reasoning text emitted as part of a streamed response. - OpenAIResponseObjectStream: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseCreated' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseInProgress' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputItemAdded' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputItemDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallInProgress' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallSearching' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallCompleted' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsInProgress' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsFailed' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsCompleted' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallArgumentsDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallInProgress' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallFailed' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted' - discriminator: - propertyName: type - mapping: - response.created: '#/components/schemas/OpenAIResponseObjectStreamResponseCreated' - response.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseInProgress' - response.output_item.added: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputItemAdded' - response.output_item.done: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputItemDone' - response.output_text.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextDelta' - response.output_text.done: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextDone' - response.function_call_arguments.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta' - response.function_call_arguments.done: '#/components/schemas/OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone' - response.web_search_call.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallInProgress' - response.web_search_call.searching: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallSearching' - response.web_search_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallCompleted' - response.mcp_list_tools.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsInProgress' - response.mcp_list_tools.failed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsFailed' - response.mcp_list_tools.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsCompleted' - response.mcp_call.arguments.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta' - response.mcp_call.arguments.done: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallArgumentsDone' - response.mcp_call.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallInProgress' - response.mcp_call.failed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallFailed' - response.mcp_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted' - response.content_part.added: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded' - response.content_part.done: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone' - response.reasoning_text.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta' - response.reasoning_text.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone' - response.reasoning_summary_part.added: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded' - response.reasoning_summary_part.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone' - response.reasoning_summary_text.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta' - response.reasoning_summary_text.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone' - response.refusal.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta' - response.refusal.done: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone' - response.output_text.annotation.added: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded' - response.file_search_call.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress' - response.file_search_call.searching: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching' - response.file_search_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted' - response.incomplete: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete' - response.failed: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed' - response.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted' - "OpenAIResponseObjectStreamResponseCompleted": - type: object - properties: - response: - $ref: '#/components/schemas/OpenAIResponseObject' - description: Completed response object - type: - type: string - const: response.completed - default: response.completed + Web search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param status: Current status of the web search operation + + :param type: Tool call type identifier, always "web_search_call" + properties: + id: + title: Id + type: string + status: + title: Status + type: string + type: + const: web_search_call + default: web_search_call + title: Type + type: string + required: + - id + - status + title: >- + OpenAIResponseOutputMessageWebSearchToolCall + type: object + OpenAIResponseText: description: >- - Event type identifier, always "response.completed" - additionalProperties: false - required: - - response - - type - title: >- - OpenAIResponseObjectStreamResponseCompleted - description: >- - Streaming event indicating a response has been completed. - "OpenAIResponseObjectStreamResponseContentPartAdded": - type: object - properties: - content_index: - type: integer + Text response configuration for OpenAI responses. + + + :param format: (Optional) Text format configuration specifying output + format requirements + properties: + format: + anyOf: + - $ref: '#/$defs/OpenAIResponseTextFormat' + - type: 'null' + title: OpenAIResponseText + type: object + OpenAIResponseTextFormat: description: >- - Index position of the part within the content array - response_id: - type: string + Configuration for Responses API text format. + + + :param type: Must be "text", "json_schema", or "json_object" to identify + the format type + + :param name: The name of the response format. Only used for json_schema. + + :param schema: The JSON schema the response should conform to. In a Python + SDK, this is often a `pydantic` model. Only used for json_schema. + + :param description: (Optional) A description of the response format. Only + used for json_schema. + + :param strict: (Optional) Whether to strictly enforce the JSON schema. + If true, the response must match the schema exactly. Only used for json_schema. + properties: + type: + anyOf: + - const: text + type: string + - const: json_schema + type: string + - const: json_object + type: string + title: Type + name: + anyOf: + - type: string + - type: 'null' + title: Name + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + title: OpenAIResponseTextFormat + type: object + OpenAIResponseToolMCP: description: >- - Unique identifier of the response containing this content - item_id: - type: string + Model Context Protocol (MCP) tool configuration for OpenAI response object. + + + :param type: Tool type identifier, always "mcp" + + :param server_label: Label to identify this MCP server + + :param allowed_tools: (Optional) Restriction on which tools can be used + from this server + properties: + type: + const: mcp + default: mcp + title: Type + type: string + server_label: + title: Server Label + type: string + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/$defs/AllowedToolsFilter' + - type: 'null' + title: Allowed Tools + required: + - server_label + title: OpenAIResponseToolMCP + type: object + OpenAIResponseUsage: description: >- - Unique identifier of the output item containing this content part - output_index: - type: integer + Usage information for OpenAI response. + + + :param input_tokens: Number of tokens in the input + + :param output_tokens: Number of tokens in the output + + :param total_tokens: Total tokens used (input + output) + + :param input_tokens_details: Detailed breakdown of input token usage + + :param output_tokens_details: Detailed breakdown of output token usage + properties: + input_tokens: + title: Input Tokens + type: integer + output_tokens: + title: Output Tokens + type: integer + total_tokens: + title: Total Tokens + type: integer + input_tokens_details: + anyOf: + - $ref: >- + #/$defs/OpenAIResponseUsageInputTokensDetails + - type: 'null' + output_tokens_details: + anyOf: + - $ref: >- + #/$defs/OpenAIResponseUsageOutputTokensDetails + - type: 'null' + required: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + type: object + OpenAIResponseUsageInputTokensDetails: description: >- - Index position of the output item in the response - part: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseContentPartOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' - - $ref: '#/components/schemas/OpenAIResponseContentPartReasoningText' - discriminator: - propertyName: type - mapping: - output_text: '#/components/schemas/OpenAIResponseContentPartOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' - reasoning_text: '#/components/schemas/OpenAIResponseContentPartReasoningText' - description: The content part that was added - sequence_number: - type: integer + Token details for input tokens in OpenAI response usage. + + + :param cached_tokens: Number of tokens retrieved from cache + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens + title: OpenAIResponseUsageInputTokensDetails + type: object + OpenAIResponseUsageOutputTokensDetails: description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.content_part.added - default: response.content_part.added + Token details for output tokens in OpenAI response usage. + + + :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens + title: OpenAIResponseUsageOutputTokensDetails + type: object + SearchRankingOptions: description: >- - Event type identifier, always "response.content_part.added" - additionalProperties: false - required: - - content_index - - response_id - - item_id - - output_index - - part - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseContentPartAdded + Options for ranking and filtering search results. + + + :param ranker: (Optional) Name of the ranking algorithm to use + + :param score_threshold: (Optional) Minimum relevance score threshold for + results + properties: + ranker: + anyOf: + - type: string + - type: 'null' + title: Ranker + score_threshold: + anyOf: + - type: number + - type: 'null' + default: 0.0 + title: Score Threshold + title: SearchRankingOptions + type: object description: >- - Streaming event for when a new content part is added to a response item. - "OpenAIResponseObjectStreamResponseContentPartDone": - type: object + Paginated list of OpenAI response objects with navigation metadata. + + + :param data: List of response objects with their input context + + :param has_more: Whether there are more results available beyond this page + + :param first_id: Identifier of the first item in this page + + :param last_id: Identifier of the last item in this page + + :param object: Object type identifier, always "list" properties: - content_index: - type: integer - description: >- - Index position of the part within the content array - response_id: + data: + items: + $ref: '#/$defs/OpenAIResponseObjectWithInput' + title: Data + type: array + has_more: + title: Has More + type: boolean + first_id: + title: First Id type: string - description: >- - Unique identifier of the response containing this content - item_id: + last_id: + title: Last Id type: string - description: >- - Unique identifier of the output item containing this content part - output_index: - type: integer - description: >- - Index position of the output item in the response - part: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseContentPartOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' - - $ref: '#/components/schemas/OpenAIResponseContentPartReasoningText' - discriminator: - propertyName: type - mapping: - output_text: '#/components/schemas/OpenAIResponseContentPartOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' - reasoning_text: '#/components/schemas/OpenAIResponseContentPartReasoningText' - description: The completed content part - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: + object: + const: list + default: list + title: Object type: string - const: response.content_part.done - default: response.content_part.done - description: >- - Event type identifier, always "response.content_part.done" - additionalProperties: false required: - - content_index - - response_id - - item_id - - output_index - - part - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseContentPartDone - description: >- - Streaming event for when a content part is completed. - "OpenAIResponseObjectStreamResponseCreated": + - data + - has_more + - first_id + - last_id + title: ListOpenAIResponseObject type: object properties: - response: - $ref: '#/components/schemas/OpenAIResponseObject' - description: The response object that was created - type: + code: type: string - const: response.created - default: response.created - description: >- - Event type identifier, always "response.created" - additionalProperties: false - required: - - response - - type - title: >- - OpenAIResponseObjectStreamResponseCreated - description: >- - Streaming event indicating a new response has been created. - OpenAIResponseObjectStreamResponseFailed: - type: object - properties: - response: - $ref: '#/components/schemas/OpenAIResponseObject' - description: Response object describing the failure - sequence_number: - type: integer description: >- - Sequential number for ordering streaming events - type: + Error code identifying the type of failure + message: type: string - const: response.failed - default: response.failed description: >- - Event type identifier, always "response.failed" + Human-readable error message describing the failure additionalProperties: false required: - - response - - sequence_number - - type - title: OpenAIResponseObjectStreamResponseFailed + - code + - message + title: OpenAIResponseError description: >- - Streaming event emitted when a response fails. - "OpenAIResponseObjectStreamResponseFileSearchCallCompleted": + Error details for failed OpenAI response requests. + OpenAIResponseInput: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutput' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage' + OpenAIResponseInputToolFileSearch: type: object properties: - item_id: + type: type: string + const: file_search + default: file_search description: >- - Unique identifier of the completed file search call - output_index: - type: integer + Tool type identifier, always "file_search" + vector_store_ids: + type: array + items: + type: string + description: >- + List of vector store identifiers to search within + filters: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object description: >- - Index position of the item in the output list - sequence_number: + (Optional) Additional filters to apply to the search + max_num_results: type: integer + default: 10 description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.file_search_call.completed - default: response.file_search_call.completed + (Optional) Maximum number of search results to return (1-50) + ranking_options: + type: object + properties: + ranker: + type: string + description: >- + (Optional) Name of the ranking algorithm to use + score_threshold: + type: number + default: 0.0 + description: >- + (Optional) Minimum relevance score threshold for results + additionalProperties: false description: >- - Event type identifier, always "response.file_search_call.completed" + (Optional) Options for ranking and scoring search results additionalProperties: false required: - - item_id - - output_index - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseFileSearchCallCompleted + - vector_store_ids + title: OpenAIResponseInputToolFileSearch description: >- - Streaming event for completed file search calls. - "OpenAIResponseObjectStreamResponseFileSearchCallInProgress": + File search tool configuration for OpenAI response inputs. + OpenAIResponseInputToolFunction: type: object properties: - item_id: + type: + type: string + const: function + default: function + description: Tool type identifier, always "function" + name: + type: string + description: Name of the function that can be called + description: type: string description: >- - Unique identifier of the file search call - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer + (Optional) Description of what the function does + parameters: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.file_search_call.in_progress - default: response.file_search_call.in_progress + (Optional) JSON schema defining the function's parameters + strict: + type: boolean description: >- - Event type identifier, always "response.file_search_call.in_progress" + (Optional) Whether to enforce strict parameter validation additionalProperties: false required: - - item_id - - output_index - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseFileSearchCallInProgress + - name + title: OpenAIResponseInputToolFunction description: >- - Streaming event for file search calls in progress. - "OpenAIResponseObjectStreamResponseFileSearchCallSearching": + Function tool configuration for OpenAI response inputs. + OpenAIResponseInputToolWebSearch: type: object properties: - item_id: - type: string - description: >- - Unique identifier of the file search call - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events type: + oneOf: + - type: string + const: web_search + - type: string + const: web_search_preview + - type: string + const: web_search_preview_2025_03_11 + default: web_search + description: Web search tool type variant to use + search_context_size: type: string - const: response.file_search_call.searching - default: response.file_search_call.searching + default: medium description: >- - Event type identifier, always "response.file_search_call.searching" + (Optional) Size of search context, must be "low", "medium", or "high" additionalProperties: false required: - - item_id - - output_index - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseFileSearchCallSearching + title: OpenAIResponseInputToolWebSearch description: >- - Streaming event for file search currently searching. - "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": + Web search tool configuration for OpenAI response inputs. + OpenAIResponseObjectWithInput: type: object properties: - delta: - type: string + created_at: + type: integer + description: >- + Unix timestamp when the response was created + error: + $ref: '#/components/schemas/OpenAIResponseError' description: >- - Incremental function call arguments being added - item_id: + (Optional) Error details if the response generation failed + id: + type: string + description: Unique identifier for this response + model: + type: string + description: Model identifier used for generation + object: type: string + const: response + default: response description: >- - Unique identifier of the function call being updated - output_index: - type: integer + Object type identifier, always "response" + output: + type: array + items: + $ref: '#/components/schemas/OpenAIResponseOutput' description: >- - Index position of the item in the output list - sequence_number: - type: integer + List of generated output items (messages, tool calls, etc.) + parallel_tool_calls: + type: boolean + default: false description: >- - Sequential number for ordering streaming events - type: + Whether tool calls can be executed in parallel + previous_response_id: type: string - const: response.function_call_arguments.delta - default: response.function_call_arguments.delta description: >- - Event type identifier, always "response.function_call_arguments.delta" - additionalProperties: false - required: - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta - description: >- - Streaming event for incremental function call argument updates. - "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone": - type: object - properties: - arguments: - type: string + (Optional) ID of the previous response in a conversation + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' description: >- - Final complete arguments JSON string for the function call - item_id: + (Optional) Reference to a prompt template and its variables. + status: type: string description: >- - Unique identifier of the completed function call - output_index: - type: integer + Current status of the response generation + temperature: + type: number description: >- - Index position of the item in the output list - sequence_number: - type: integer + (Optional) Sampling temperature used for generation + text: + $ref: '#/components/schemas/OpenAIResponseText' description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.function_call_arguments.done - default: response.function_call_arguments.done + Text formatting configuration for the response + top_p: + type: number description: >- - Event type identifier, always "response.function_call_arguments.done" - additionalProperties: false - required: - - arguments - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone - description: >- - Streaming event for when function call arguments are completed. - "OpenAIResponseObjectStreamResponseInProgress": - type: object - properties: - response: - $ref: '#/components/schemas/OpenAIResponseObject' - description: Current response state while in progress - sequence_number: - type: integer + (Optional) Nucleus sampling parameter used for generation + tools: + type: array + items: + $ref: '#/components/schemas/OpenAIResponseTool' description: >- - Sequential number for ordering streaming events - type: + (Optional) An array of tools the model may call while generating a response. + truncation: type: string - const: response.in_progress - default: response.in_progress - description: >- - Event type identifier, always "response.in_progress" - additionalProperties: false - required: - - response - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseInProgress - description: >- - Streaming event indicating the response remains in progress. - "OpenAIResponseObjectStreamResponseIncomplete": - type: object - properties: - response: - $ref: '#/components/schemas/OpenAIResponseObject' description: >- - Response object describing the incomplete state - sequence_number: - type: integer + (Optional) Truncation strategy applied to the response + usage: + $ref: '#/components/schemas/OpenAIResponseUsage' description: >- - Sequential number for ordering streaming events - type: + (Optional) Token usage information for the response + instructions: type: string - const: response.incomplete - default: response.incomplete description: >- - Event type identifier, always "response.incomplete" + (Optional) System message inserted into the model's context + input: + type: array + items: + $ref: '#/components/schemas/OpenAIResponseInput' + description: >- + List of input items that led to this response additionalProperties: false required: - - response - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseIncomplete + - created_at + - id + - model + - object + - output + - parallel_tool_calls + - status + - text + - input + title: OpenAIResponseObjectWithInput description: >- - Streaming event emitted when a response ends in an incomplete state. - "OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta": - type: object - properties: - delta: - type: string - item_id: - type: string - output_index: - type: integer - sequence_number: - type: integer - type: - type: string - const: response.mcp_call.arguments.delta - default: response.mcp_call.arguments.delta - additionalProperties: false - required: - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta - "OpenAIResponseObjectStreamResponseMcpCallArgumentsDone": + OpenAI response object extended with input context information. + OpenAIResponseOutput: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + message: '#/components/schemas/OpenAIResponseMessage' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + OpenAIResponsePrompt: type: object properties: - arguments: - type: string - item_id: - type: string - output_index: - type: integer - sequence_number: - type: integer - type: + id: type: string - const: response.mcp_call.arguments.done - default: response.mcp_call.arguments.done - additionalProperties: false - required: - - arguments - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallArgumentsDone - "OpenAIResponseObjectStreamResponseMcpCallCompleted": - type: object - properties: - sequence_number: - type: integer + description: Unique identifier of the prompt template + variables: + type: object + additionalProperties: + $ref: '#/components/schemas/OpenAIResponseInputMessageContent' description: >- - Sequential number for ordering streaming events - type: + Dictionary of variable names to OpenAIResponseInputMessageContent structure + for template substitution. The substitution values can either be strings, + or other Response input types like images or files. + version: type: string - const: response.mcp_call.completed - default: response.mcp_call.completed description: >- - Event type identifier, always "response.mcp_call.completed" + Version number of the prompt to use (defaults to latest if not specified) additionalProperties: false required: - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallCompleted - description: Streaming event for completed MCP calls. - "OpenAIResponseObjectStreamResponseMcpCallFailed": + - id + title: OpenAIResponsePrompt + description: >- + OpenAI compatible Prompt object that is used in OpenAI responses. + OpenAIResponseText: type: object properties: - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.mcp_call.failed - default: response.mcp_call.failed + format: + type: object + properties: + type: + oneOf: + - type: string + const: text + - type: string + const: json_schema + - type: string + const: json_object + description: >- + Must be "text", "json_schema", or "json_object" to identify the format + type + name: + type: string + description: >- + The name of the response format. Only used for json_schema. + schema: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + The JSON schema the response should conform to. In a Python SDK, this + is often a `pydantic` model. Only used for json_schema. + description: + type: string + description: >- + (Optional) A description of the response format. Only used for json_schema. + strict: + type: boolean + description: >- + (Optional) Whether to strictly enforce the JSON schema. If true, the + response must match the schema exactly. Only used for json_schema. + additionalProperties: false + required: + - type description: >- - Event type identifier, always "response.mcp_call.failed" + (Optional) Text format configuration specifying output format requirements additionalProperties: false - required: - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallFailed - description: Streaming event for failed MCP calls. - "OpenAIResponseObjectStreamResponseMcpCallInProgress": + title: OpenAIResponseText + description: >- + Text response configuration for OpenAI responses. + OpenAIResponseTool: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + discriminator: + propertyName: type + mapping: + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseToolMCP' + OpenAIResponseToolMCP: type: object properties: - item_id: - type: string - description: Unique identifier of the MCP call - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events type: type: string - const: response.mcp_call.in_progress - default: response.mcp_call.in_progress + const: mcp + default: mcp + description: Tool type identifier, always "mcp" + server_label: + type: string + description: Label to identify this MCP server + allowed_tools: + oneOf: + - type: array + items: + type: string + - type: object + properties: + tool_names: + type: array + items: + type: string + description: >- + (Optional) List of specific tool names that are allowed + additionalProperties: false + title: AllowedToolsFilter + description: >- + Filter configuration for restricting which MCP tools can be used. description: >- - Event type identifier, always "response.mcp_call.in_progress" + (Optional) Restriction on which tools can be used from this server additionalProperties: false required: - - item_id - - output_index - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallInProgress + - server_label + title: OpenAIResponseToolMCP description: >- - Streaming event for MCP calls in progress. - "OpenAIResponseObjectStreamResponseMcpListToolsCompleted": + Model Context Protocol (MCP) tool configuration for OpenAI response object. + OpenAIResponseUsage: type: object properties: - sequence_number: + input_tokens: type: integer - type: - type: string - const: response.mcp_list_tools.completed - default: response.mcp_list_tools.completed + description: Number of tokens in the input + output_tokens: + type: integer + description: Number of tokens in the output + total_tokens: + type: integer + description: Total tokens used (input + output) + input_tokens_details: + type: object + properties: + cached_tokens: + type: integer + description: Number of tokens retrieved from cache + additionalProperties: false + description: Detailed breakdown of input token usage + output_tokens_details: + type: object + properties: + reasoning_tokens: + type: integer + description: >- + Number of tokens used for reasoning (o1/o3 models) + additionalProperties: false + description: Detailed breakdown of output token usage additionalProperties: false required: - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpListToolsCompleted - "OpenAIResponseObjectStreamResponseMcpListToolsFailed": + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + description: Usage information for OpenAI response. + ResponseGuardrailSpec: type: object properties: - sequence_number: - type: integer type: type: string - const: response.mcp_list_tools.failed - default: response.mcp_list_tools.failed + description: The type/identifier of the guardrail. additionalProperties: false required: - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseMcpListToolsFailed - "OpenAIResponseObjectStreamResponseMcpListToolsInProgress": + title: ResponseGuardrailSpec + description: >- + Specification for a guardrail to apply during response generation. + OpenAIResponseInputTool: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' + discriminator: + propertyName: type + mapping: + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseInputToolMCP' + OpenAIResponseInputToolMCP: type: object properties: - sequence_number: - type: integer type: type: string - const: response.mcp_list_tools.in_progress - default: response.mcp_list_tools.in_progress + const: mcp + default: mcp + description: Tool type identifier, always "mcp" + server_label: + type: string + description: Label to identify this MCP server + server_url: + type: string + description: URL endpoint of the MCP server + headers: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + (Optional) HTTP headers to include when connecting to the server + require_approval: + oneOf: + - type: string + const: always + - type: string + const: never + - type: object + properties: + always: + type: array + items: + type: string + description: >- + (Optional) List of tool names that always require approval + never: + type: array + items: + type: string + description: >- + (Optional) List of tool names that never require approval + additionalProperties: false + title: ApprovalFilter + description: >- + Filter configuration for MCP tool approval requirements. + default: never + description: >- + Approval requirement for tool calls ("always", "never", or filter) + allowed_tools: + oneOf: + - type: array + items: + type: string + - type: object + properties: + tool_names: + type: array + items: + type: string + description: >- + (Optional) List of specific tool names that are allowed + additionalProperties: false + title: AllowedToolsFilter + description: >- + Filter configuration for restricting which MCP tools can be used. + description: >- + (Optional) Restriction on which tools can be used from this server additionalProperties: false required: - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseMcpListToolsInProgress - "OpenAIResponseObjectStreamResponseOutputItemAdded": + - server_label + - server_url + - require_approval + title: OpenAIResponseInputToolMCP + description: >- + Model Context Protocol (MCP) tool configuration for OpenAI response inputs. + CreateOpenaiResponseRequest: type: object properties: - response_id: - type: string - description: >- - Unique identifier of the response containing this output - item: + input: oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - description: >- - The output item that was added (message, tool call, etc.) - output_index: - type: integer + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAIResponseInput' + description: Input message(s) to create the response. + model: + type: string + description: The underlying LLM used for completions. + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' description: >- - Index position of this item in the output list - sequence_number: - type: integer + (Optional) Prompt object with ID, version, and variables. + instructions: + type: string + previous_response_id: + type: string description: >- - Sequential number for ordering streaming events - type: + (Optional) if specified, the new response will be a continuation of the + previous response. This can be used to easily fork-off new responses from + existing responses. + conversation: type: string - const: response.output_item.added - default: response.output_item.added description: >- - Event type identifier, always "response.output_item.added" + (Optional) The ID of a conversation to add the response to. Must begin + with 'conv_'. Input and output messages will be automatically added to + the conversation. + store: + type: boolean + stream: + type: boolean + temperature: + type: number + text: + $ref: '#/components/schemas/OpenAIResponseText' + tools: + type: array + items: + $ref: '#/components/schemas/OpenAIResponseInputTool' + include: + type: array + items: + type: string + description: >- + (Optional) Additional fields to include in the response. + max_infer_iters: + type: integer additionalProperties: false required: - - response_id - - item - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseOutputItemAdded - description: >- - Streaming event for when a new output item is added to the response. - "OpenAIResponseObjectStreamResponseOutputItemDone": - type: object - properties: - response_id: - type: string + - input + - model + title: CreateOpenaiResponseRequest + OpenAIResponseObject: + $defs: + AllowedToolsFilter: description: >- - Unique identifier of the response containing this output - item: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - description: >- - The completed output item (message, tool call, etc.) - output_index: - type: integer + Filter configuration for restricting which MCP tools can be used. + + + :param tool_names: (Optional) List of specific tool names that are allowed + properties: + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Tool Names + title: AllowedToolsFilter + type: object + MCPListToolsTool: description: >- - Index position of this item in the output list - sequence_number: - type: integer + Tool definition returned by MCP list tools operation. + + + :param input_schema: JSON schema defining the tool's input parameters + + :param name: Name of the tool + + :param description: (Optional) Description of what the tool does + properties: + input_schema: + additionalProperties: true + title: Input Schema + type: object + name: + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + required: + - input_schema + - name + title: MCPListToolsTool + type: object + OpenAIResponseAnnotationCitation: description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.output_item.done - default: response.output_item.done + URL citation annotation for referencing external web resources. + + + :param type: Annotation type identifier, always "url_citation" + + :param end_index: End position of the citation span in the content + + :param start_index: Start position of the citation span in the content + + :param title: Title of the referenced web resource + + :param url: URL of the referenced web resource + properties: + type: + const: url_citation + default: url_citation + title: Type + type: string + end_index: + title: End Index + type: integer + start_index: + title: Start Index + type: integer + title: + title: Title + type: string + url: + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + "OpenAIResponseAnnotationContainerFileCitation": + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: >- + OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: description: >- - Event type identifier, always "response.output_item.done" - additionalProperties: false - required: - - response_id - - item - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseOutputItemDone - description: >- - Streaming event for when an output item is completed. - "OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded": - type: object - properties: - item_id: - type: string + File citation annotation for referencing specific files in response content. + + + :param type: Annotation type identifier, always "file_citation" + + :param file_id: Unique identifier of the referenced file + + :param filename: Name of the referenced file + + :param index: Position index of the citation within the content + properties: + type: + const: file_citation + default: file_citation + title: Type + type: string + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + index: + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: description: >- - Unique identifier of the item to which the annotation is being added - output_index: - type: integer + Refusal content within a streamed response part. + + + :param type: Content part type identifier, always "refusal" + + :param refusal: Refusal text supplied by the model + properties: + type: + const: refusal + default: refusal + title: Type + type: string + refusal: + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + OpenAIResponseError: description: >- - Index position of the output item in the response's output array - content_index: - type: integer + Error details for failed OpenAI response requests. + + + :param code: Error code identifying the type of failure + + :param message: Human-readable error message describing the failure + properties: + code: + title: Code + type: string + message: + title: Message + type: string + required: + - code + - message + title: OpenAIResponseError + type: object + OpenAIResponseInputMessageContentImage: description: >- - Index position of the content part within the output item - annotation_index: - type: integer + Image content for input messages in OpenAI response format. + + + :param detail: Level of detail for image processing, can be "low", "high", + or "auto" + + :param type: Content type identifier, always "input_image" + + :param image_url: (Optional) URL of the image content + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + title: Detail + type: + const: input_image + default: input_image + title: Type + type: string + image_url: + anyOf: + - type: string + - type: 'null' + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: description: >- - Index of the annotation within the content part - annotation: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' - discriminator: - propertyName: type - mapping: - file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' - container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' - description: The annotation object being added - sequence_number: - type: integer + Text content for input messages in OpenAI response format. + + + :param text: The text content of the input message + + :param type: Content type identifier, always "input_text" + properties: + text: + title: Text + type: string + type: + const: input_text + default: input_text + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseInputToolFileSearch: description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.output_text.annotation.added - default: response.output_text.annotation.added + File search tool configuration for OpenAI response inputs. + + + :param type: Tool type identifier, always "file_search" + + :param vector_store_ids: List of vector store identifiers to search within + + :param filters: (Optional) Additional filters to apply to the search + + :param max_num_results: (Optional) Maximum number of search results to + return (1-50) + + :param ranking_options: (Optional) Options for ranking and scoring search + results + properties: + type: + const: file_search + default: file_search + title: Type + type: string + vector_store_ids: + items: + type: string + title: Vector Store Ids + type: array + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Filters + max_num_results: + anyOf: + - maximum: 50 + minimum: 1 + type: integer + - type: 'null' + default: 10 + title: Max Num Results + ranking_options: + anyOf: + - $ref: '#/$defs/SearchRankingOptions' + - type: 'null' + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + type: object + OpenAIResponseInputToolFunction: description: >- - Event type identifier, always "response.output_text.annotation.added" - additionalProperties: false - required: - - item_id - - output_index - - content_index - - annotation_index - - annotation - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded - description: >- - Streaming event for when an annotation is added to output text. - "OpenAIResponseObjectStreamResponseOutputTextDelta": - type: object - properties: - content_index: - type: integer - description: Index position within the text content - delta: - type: string - description: Incremental text content being added - item_id: - type: string + Function tool configuration for OpenAI response inputs. + + + :param type: Tool type identifier, always "function" + + :param name: Name of the function that can be called + + :param description: (Optional) Description of what the function does + + :param parameters: (Optional) JSON schema defining the function's parameters + + :param strict: (Optional) Whether to enforce strict parameter validation + properties: + type: + const: function + default: function + title: Type + type: string + name: + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Parameters + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + required: + - name + - parameters + title: OpenAIResponseInputToolFunction + type: object + OpenAIResponseInputToolWebSearch: description: >- - Unique identifier of the output item being updated - output_index: - type: integer + Web search tool configuration for OpenAI response inputs. + + + :param type: Web search tool type variant to use + + :param search_context_size: (Optional) Size of search context, must be + "low", "medium", or "high" + properties: + type: + anyOf: + - const: web_search + type: string + - const: web_search_preview + type: string + - const: web_search_preview_2025_03_11 + type: string + default: web_search + title: Type + search_context_size: + anyOf: + - pattern: ^low|medium|high$ + type: string + - type: 'null' + default: medium + title: Search Context Size + title: OpenAIResponseInputToolWebSearch + type: object + OpenAIResponseMCPApprovalRequest: description: >- - Index position of the item in the output list - sequence_number: - type: integer + A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments + type: string + id: + title: Id + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMessage: description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.output_text.delta - default: response.output_text.delta + Corresponds to the various Message types in the Responses API. + + They are all under one type because the Responses API gives them all + + the same "type" value, and there is no way to tell them apart in certain + + scenarios. + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_image: >- + #/$defs/OpenAIResponseInputMessageContentImage + input_text: >- + #/$defs/OpenAIResponseInputMessageContentText + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentText + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentImage + type: array + - items: + discriminator: + mapping: + output_text: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + - $ref: '#/$defs/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + "OpenAIResponseOutputMessageContentOutputText": + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + file_citation: >- + #/$defs/OpenAIResponseAnnotationFileCitation + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseAnnotationFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationCitation' + - $ref: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: >- + OpenAIResponseOutputMessageContentOutputText + type: object + "OpenAIResponseOutputMessageFileSearchToolCall": description: >- - Event type identifier, always "response.output_text.delta" - additionalProperties: false - required: - - content_index - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseOutputTextDelta - description: >- - Streaming event for incremental text content updates. - "OpenAIResponseObjectStreamResponseOutputTextDone": - type: object - properties: - content_index: - type: integer - description: Index position within the text content - text: - type: string + File search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param queries: List of search queries executed + + :param status: Current status of the file search operation + + :param type: Tool call type identifier, always "file_search_call" + + :param results: (Optional) Search results returned by the file search + operation + properties: + id: + title: Id + type: string + queries: + items: + type: string + title: Queries + type: array + status: + title: Status + type: string + type: + const: file_search_call + default: file_search_call + title: Type + type: string + results: + anyOf: + - items: + $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults + type: array + - type: 'null' + title: Results + required: + - id + - queries + - status + title: >- + OpenAIResponseOutputMessageFileSearchToolCall + type: object + "OpenAIResponseOutputMessageFileSearchToolCallResults": description: >- - Final complete text content of the output item - item_id: - type: string + Search results returned by the file search operation. + + + :param attributes: (Optional) Key-value attributes associated with the + file + + :param file_id: Unique identifier of the file containing the result + + :param filename: Name of the file containing the result + + :param score: Relevance score for this search result (between 0 and 1) + + :param text: Text content of the search result + properties: + attributes: + additionalProperties: true + title: Attributes + type: object + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + score: + title: Score + type: number + text: + title: Text + type: string + required: + - attributes + - file_id + - filename + - score + - text + title: >- + OpenAIResponseOutputMessageFileSearchToolCallResults + type: object + "OpenAIResponseOutputMessageFunctionToolCall": description: >- - Unique identifier of the completed output item - output_index: - type: integer + Function tool call output message for OpenAI responses. + + + :param call_id: Unique identifier for the function call + + :param name: Name of the function being called + + :param arguments: JSON string containing the function arguments + + :param type: Tool call type identifier, always "function_call" + + :param id: (Optional) Additional identifier for the tool call + + :param status: (Optional) Current status of the function call execution + properties: + call_id: + title: Call Id + type: string + name: + title: Name + type: string + arguments: + title: Arguments + type: string + type: + const: function_call + default: function_call + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - call_id + - name + - arguments + title: >- + OpenAIResponseOutputMessageFunctionToolCall + type: object + OpenAIResponseOutputMessageMCPCall: description: >- - Index position of the item in the output list - sequence_number: - type: integer + Model Context Protocol (MCP) call output message for OpenAI responses. + + + :param id: Unique identifier for this MCP call + + :param type: Tool call type identifier, always "mcp_call" + + :param arguments: JSON string containing the MCP call arguments + + :param name: Name of the MCP method being called + + :param server_label: Label identifying the MCP server handling the call + + :param error: (Optional) Error message if the MCP call failed + + :param output: (Optional) Output result from the successful MCP call + properties: + id: + title: Id + type: string + type: + const: mcp_call + default: mcp_call + title: Type + type: string + arguments: + title: Arguments + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + error: + anyOf: + - type: string + - type: 'null' + title: Error + output: + anyOf: + - type: string + - type: 'null' + title: Output + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + type: object + OpenAIResponseOutputMessageMCPListTools: description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.output_text.done - default: response.output_text.done + MCP list tools output message containing available tools from an MCP server. + + + :param id: Unique identifier for this MCP list tools operation + + :param type: Tool call type identifier, always "mcp_list_tools" + + :param server_label: Label identifying the MCP server providing the tools + + :param tools: List of available tools provided by the MCP server + properties: + id: + title: Id + type: string + type: + const: mcp_list_tools + default: mcp_list_tools + title: Type + type: string + server_label: + title: Server Label + type: string + tools: + items: + $ref: '#/$defs/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + type: object + "OpenAIResponseOutputMessageWebSearchToolCall": description: >- - Event type identifier, always "response.output_text.done" - additionalProperties: false - required: - - content_index - - text - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseOutputTextDone - description: >- - Streaming event for when text output is completed. - "OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded": - type: object - properties: - item_id: - type: string - description: Unique identifier of the output item - output_index: - type: integer - description: Index position of the output item - part: - $ref: '#/components/schemas/OpenAIResponseContentPartReasoningSummary' - description: The summary part that was added - sequence_number: - type: integer + Web search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param status: Current status of the web search operation + + :param type: Tool call type identifier, always "web_search_call" + properties: + id: + title: Id + type: string + status: + title: Status + type: string + type: + const: web_search_call + default: web_search_call + title: Type + type: string + required: + - id + - status + title: >- + OpenAIResponseOutputMessageWebSearchToolCall + type: object + OpenAIResponseText: description: >- - Sequential number for ordering streaming events - summary_index: - type: integer + Text response configuration for OpenAI responses. + + + :param format: (Optional) Text format configuration specifying output + format requirements + properties: + format: + anyOf: + - $ref: '#/$defs/OpenAIResponseTextFormat' + - type: 'null' + title: OpenAIResponseText + type: object + OpenAIResponseTextFormat: description: >- - Index of the summary part within the reasoning summary - type: - type: string - const: response.reasoning_summary_part.added - default: response.reasoning_summary_part.added + Configuration for Responses API text format. + + + :param type: Must be "text", "json_schema", or "json_object" to identify + the format type + + :param name: The name of the response format. Only used for json_schema. + + :param schema: The JSON schema the response should conform to. In a Python + SDK, this is often a `pydantic` model. Only used for json_schema. + + :param description: (Optional) A description of the response format. Only + used for json_schema. + + :param strict: (Optional) Whether to strictly enforce the JSON schema. + If true, the response must match the schema exactly. Only used for json_schema. + properties: + type: + anyOf: + - const: text + type: string + - const: json_schema + type: string + - const: json_object + type: string + title: Type + name: + anyOf: + - type: string + - type: 'null' + title: Name + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + title: OpenAIResponseTextFormat + type: object + OpenAIResponseToolMCP: description: >- - Event type identifier, always "response.reasoning_summary_part.added" - additionalProperties: false - required: - - item_id - - output_index - - part - - sequence_number - - summary_index - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded - description: >- - Streaming event for when a new reasoning summary part is added. - "OpenAIResponseObjectStreamResponseReasoningSummaryPartDone": - type: object - properties: - item_id: - type: string - description: Unique identifier of the output item - output_index: - type: integer - description: Index position of the output item - part: - $ref: '#/components/schemas/OpenAIResponseContentPartReasoningSummary' - description: The completed summary part - sequence_number: - type: integer + Model Context Protocol (MCP) tool configuration for OpenAI response object. + + + :param type: Tool type identifier, always "mcp" + + :param server_label: Label to identify this MCP server + + :param allowed_tools: (Optional) Restriction on which tools can be used + from this server + properties: + type: + const: mcp + default: mcp + title: Type + type: string + server_label: + title: Server Label + type: string + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/$defs/AllowedToolsFilter' + - type: 'null' + title: Allowed Tools + required: + - server_label + title: OpenAIResponseToolMCP + type: object + OpenAIResponseUsage: + description: >- + Usage information for OpenAI response. + + + :param input_tokens: Number of tokens in the input + + :param output_tokens: Number of tokens in the output + + :param total_tokens: Total tokens used (input + output) + + :param input_tokens_details: Detailed breakdown of input token usage + + :param output_tokens_details: Detailed breakdown of output token usage + properties: + input_tokens: + title: Input Tokens + type: integer + output_tokens: + title: Output Tokens + type: integer + total_tokens: + title: Total Tokens + type: integer + input_tokens_details: + anyOf: + - $ref: >- + #/$defs/OpenAIResponseUsageInputTokensDetails + - type: 'null' + output_tokens_details: + anyOf: + - $ref: >- + #/$defs/OpenAIResponseUsageOutputTokensDetails + - type: 'null' + required: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + type: object + OpenAIResponseUsageInputTokensDetails: description: >- - Sequential number for ordering streaming events - summary_index: - type: integer + Token details for input tokens in OpenAI response usage. + + + :param cached_tokens: Number of tokens retrieved from cache + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens + title: OpenAIResponseUsageInputTokensDetails + type: object + OpenAIResponseUsageOutputTokensDetails: description: >- - Index of the summary part within the reasoning summary - type: - type: string - const: response.reasoning_summary_part.done - default: response.reasoning_summary_part.done + Token details for output tokens in OpenAI response usage. + + + :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens + title: OpenAIResponseUsageOutputTokensDetails + type: object + SearchRankingOptions: description: >- - Event type identifier, always "response.reasoning_summary_part.done" - additionalProperties: false - required: - - item_id - - output_index - - part - - sequence_number - - summary_index - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningSummaryPartDone + Options for ranking and filtering search results. + + + :param ranker: (Optional) Name of the ranking algorithm to use + + :param score_threshold: (Optional) Minimum relevance score threshold for + results + properties: + ranker: + anyOf: + - type: string + - type: 'null' + title: Ranker + score_threshold: + anyOf: + - type: number + - type: 'null' + default: 0.0 + title: Score Threshold + title: SearchRankingOptions + type: object description: >- - Streaming event for when a reasoning summary part is completed. - "OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta": - type: object + Complete OpenAI response object containing generation results and metadata. + + + :param created_at: Unix timestamp when the response was created + + :param error: (Optional) Error details if the response generation failed + + :param id: Unique identifier for this response + + :param model: Model identifier used for generation + + :param object: Object type identifier, always "response" + + :param output: List of generated output items (messages, tool calls, etc.) + + :param parallel_tool_calls: Whether tool calls can be executed in parallel + + :param previous_response_id: (Optional) ID of the previous response in a conversation + + :param status: Current status of the response generation + + :param temperature: (Optional) Sampling temperature used for generation + + :param text: Text formatting configuration for the response + + :param top_p: (Optional) Nucleus sampling parameter used for generation + + :param tools: (Optional) An array of tools the model may call while generating + a response. + + :param truncation: (Optional) Truncation strategy applied to the response + + :param usage: (Optional) Token usage information for the response + + :param instructions: (Optional) System message inserted into the model's context properties: - delta: - type: string - description: Incremental summary text being added - item_id: - type: string - description: Unique identifier of the output item - output_index: - type: integer - description: Index position of the output item - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - summary_index: + created_at: + title: Created At type: integer - description: >- - Index of the summary part within the reasoning summary - type: - type: string - const: response.reasoning_summary_text.delta - default: response.reasoning_summary_text.delta - description: >- - Event type identifier, always "response.reasoning_summary_text.delta" - additionalProperties: false - required: - - delta - - item_id - - output_index - - sequence_number - - summary_index - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta - description: >- - Streaming event for incremental reasoning summary text updates. - "OpenAIResponseObjectStreamResponseReasoningSummaryTextDone": - type: object - properties: - text: - type: string - description: Final complete summary text - item_id: + error: + anyOf: + - $ref: '#/$defs/OpenAIResponseError' + - type: 'null' + id: + title: Id type: string - description: Unique identifier of the output item - output_index: - type: integer - description: Index position of the output item - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - summary_index: - type: integer - description: >- - Index of the summary part within the reasoning summary - type: + model: + title: Model type: string - const: response.reasoning_summary_text.done - default: response.reasoning_summary_text.done - description: >- - Event type identifier, always "response.reasoning_summary_text.done" - additionalProperties: false - required: - - text - - item_id - - output_index - - sequence_number - - summary_index - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningSummaryTextDone - description: >- - Streaming event for when reasoning summary text is completed. - "OpenAIResponseObjectStreamResponseReasoningTextDelta": - type: object - properties: - content_index: - type: integer - description: >- - Index position of the reasoning content part - delta: + object: + const: response + default: response + title: Object type: string - description: Incremental reasoning text being added - item_id: + output: + items: + discriminator: + mapping: + file_search_call: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + function_call: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + mcp_list_tools: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + message: '#/$defs/OpenAIResponseMessage' + web_search_call: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseMessage' + - $ref: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' + title: Output + type: array + parallel_tool_calls: + default: false + title: Parallel Tool Calls + type: boolean + previous_response_id: type: string description: >- - Unique identifier of the output item being updated - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer + (Optional) ID of the previous response in a conversation + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' description: >- - Sequential number for ordering streaming events - type: + (Optional) Reference to a prompt template and its variables. + status: + title: Status type: string - const: response.reasoning_text.delta - default: response.reasoning_text.delta - description: >- - Event type identifier, always "response.reasoning_text.delta" - additionalProperties: false + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + text: + $ref: '#/$defs/OpenAIResponseText' + default: + format: + type: text + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + tools: + anyOf: + - items: + discriminator: + mapping: + file_search: >- + #/$defs/OpenAIResponseInputToolFileSearch + function: '#/$defs/OpenAIResponseInputToolFunction' + mcp: '#/$defs/OpenAIResponseToolMCP' + web_search: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseInputToolWebSearch' + - $ref: >- + #/$defs/OpenAIResponseInputToolFileSearch + - $ref: '#/$defs/OpenAIResponseInputToolFunction' + - $ref: '#/$defs/OpenAIResponseToolMCP' + type: array + - type: 'null' + title: Tools + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + usage: + anyOf: + - $ref: '#/$defs/OpenAIResponseUsage' + - type: 'null' + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions required: - - content_index - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningTextDelta - description: >- - Streaming event for incremental reasoning text updates. - "OpenAIResponseObjectStreamResponseReasoningTextDone": + - created_at + - id + - model + - output + - status + title: OpenAIResponseObject type: object + AsyncIterator: + type: object + OpenAIDeleteResponseObject: + description: >- + Response object confirming deletion of an OpenAI response. + + + :param id: Unique identifier of the deleted response + + :param object: Object type identifier, always "response" + + :param deleted: Deletion confirmation flag, always True properties: - content_index: - type: integer - description: >- - Index position of the reasoning content part - text: - type: string - description: Final complete reasoning text - item_id: + id: + title: Id type: string - description: >- - Unique identifier of the completed output item - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: + object: + const: response + default: response + title: Object type: string - const: response.reasoning_text.done - default: response.reasoning_text.done - description: >- - Event type identifier, always "response.reasoning_text.done" - additionalProperties: false + deleted: + default: true + title: Deleted + type: boolean required: - - content_index - - text - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningTextDone - description: >- - Streaming event for when reasoning text is completed. - "OpenAIResponseObjectStreamResponseRefusalDelta": + - id + title: OpenAIDeleteResponseObject type: object - properties: - content_index: - type: integer - description: Index position of the content part - delta: - type: string - description: Incremental refusal text being added - item_id: - type: string - description: Unique identifier of the output item - output_index: - type: integer + ListOpenAIResponseInputItem: + $defs: + MCPListToolsTool: description: >- - Index position of the item in the output list - sequence_number: - type: integer + Tool definition returned by MCP list tools operation. + + + :param input_schema: JSON schema defining the tool's input parameters + + :param name: Name of the tool + + :param description: (Optional) Description of what the tool does + properties: + input_schema: + additionalProperties: true + title: Input Schema + type: object + name: + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + required: + - input_schema + - name + title: MCPListToolsTool + type: object + OpenAIResponseAnnotationCitation: description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.refusal.delta - default: response.refusal.delta + URL citation annotation for referencing external web resources. + + + :param type: Annotation type identifier, always "url_citation" + + :param end_index: End position of the citation span in the content + + :param start_index: Start position of the citation span in the content + + :param title: Title of the referenced web resource + + :param url: URL of the referenced web resource + properties: + type: + const: url_citation + default: url_citation + title: Type + type: string + end_index: + title: End Index + type: integer + start_index: + title: Start Index + type: integer + title: + title: Title + type: string + url: + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + "OpenAIResponseAnnotationContainerFileCitation": + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: >- + OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: description: >- - Event type identifier, always "response.refusal.delta" - additionalProperties: false - required: - - content_index - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseRefusalDelta - description: >- - Streaming event for incremental refusal text updates. - "OpenAIResponseObjectStreamResponseRefusalDone": - type: object - properties: - content_index: - type: integer - description: Index position of the content part - refusal: - type: string - description: Final complete refusal text - item_id: - type: string - description: Unique identifier of the output item - output_index: - type: integer + File citation annotation for referencing specific files in response content. + + + :param type: Annotation type identifier, always "file_citation" + + :param file_id: Unique identifier of the referenced file + + :param filename: Name of the referenced file + + :param index: Position index of the citation within the content + properties: + type: + const: file_citation + default: file_citation + title: Type + type: string + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + index: + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: description: >- - Index position of the item in the output list - sequence_number: - type: integer + Refusal content within a streamed response part. + + + :param type: Content part type identifier, always "refusal" + + :param refusal: Refusal text supplied by the model + properties: + type: + const: refusal + default: refusal + title: Type + type: string + refusal: + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + "OpenAIResponseInputFunctionToolCallOutput": description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.refusal.done - default: response.refusal.done + This represents the output of a function call that gets passed back to + the model. + properties: + call_id: + title: Call Id + type: string + output: + title: Output + type: string + type: + const: function_call_output + default: function_call_output + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - call_id + - output + title: >- + OpenAIResponseInputFunctionToolCallOutput + type: object + OpenAIResponseInputMessageContentImage: description: >- - Event type identifier, always "response.refusal.done" - additionalProperties: false - required: - - content_index - - refusal - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseRefusalDone - description: >- - Streaming event for when refusal text is completed. - "OpenAIResponseObjectStreamResponseWebSearchCallCompleted": - type: object - properties: - item_id: - type: string + Image content for input messages in OpenAI response format. + + + :param detail: Level of detail for image processing, can be "low", "high", + or "auto" + + :param type: Content type identifier, always "input_image" + + :param image_url: (Optional) URL of the image content + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + title: Detail + type: + const: input_image + default: input_image + title: Type + type: string + image_url: + anyOf: + - type: string + - type: 'null' + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: description: >- - Unique identifier of the completed web search call - output_index: - type: integer + Text content for input messages in OpenAI response format. + + + :param text: The text content of the input message + + :param type: Content type identifier, always "input_text" + properties: + text: + title: Text + type: string + type: + const: input_text + default: input_text + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseMCPApprovalRequest: description: >- - Index position of the item in the output list - sequence_number: - type: integer + A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments + type: string + id: + title: Id + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMCPApprovalResponse: + description: A response to an MCP approval request. + properties: + approval_request_id: + title: Approval Request Id + type: string + approve: + title: Approve + type: boolean + type: + const: mcp_approval_response + default: mcp_approval_response + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + reason: + anyOf: + - type: string + - type: 'null' + title: Reason + required: + - approval_request_id + - approve + title: OpenAIResponseMCPApprovalResponse + type: object + OpenAIResponseMessage: description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.web_search_call.completed - default: response.web_search_call.completed + Corresponds to the various Message types in the Responses API. + + They are all under one type because the Responses API gives them all + + the same "type" value, and there is no way to tell them apart in certain + + scenarios. + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_image: >- + #/$defs/OpenAIResponseInputMessageContentImage + input_text: >- + #/$defs/OpenAIResponseInputMessageContentText + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentText + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentImage + type: array + - items: + discriminator: + mapping: + output_text: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + - $ref: '#/$defs/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + "OpenAIResponseOutputMessageContentOutputText": + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + file_citation: >- + #/$defs/OpenAIResponseAnnotationFileCitation + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseAnnotationFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationCitation' + - $ref: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: >- + OpenAIResponseOutputMessageContentOutputText + type: object + "OpenAIResponseOutputMessageFileSearchToolCall": description: >- - Event type identifier, always "response.web_search_call.completed" - additionalProperties: false - required: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseWebSearchCallCompleted - description: >- - Streaming event for completed web search calls. - "OpenAIResponseObjectStreamResponseWebSearchCallInProgress": - type: object - properties: - item_id: - type: string - description: Unique identifier of the web search call - output_index: - type: integer + File search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param queries: List of search queries executed + + :param status: Current status of the file search operation + + :param type: Tool call type identifier, always "file_search_call" + + :param results: (Optional) Search results returned by the file search + operation + properties: + id: + title: Id + type: string + queries: + items: + type: string + title: Queries + type: array + status: + title: Status + type: string + type: + const: file_search_call + default: file_search_call + title: Type + type: string + results: + anyOf: + - items: + $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults + type: array + - type: 'null' + title: Results + required: + - id + - queries + - status + title: >- + OpenAIResponseOutputMessageFileSearchToolCall + type: object + "OpenAIResponseOutputMessageFileSearchToolCallResults": description: >- - Index position of the item in the output list - sequence_number: - type: integer + Search results returned by the file search operation. + + + :param attributes: (Optional) Key-value attributes associated with the + file + + :param file_id: Unique identifier of the file containing the result + + :param filename: Name of the file containing the result + + :param score: Relevance score for this search result (between 0 and 1) + + :param text: Text content of the search result + properties: + attributes: + additionalProperties: true + title: Attributes + type: object + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + score: + title: Score + type: number + text: + title: Text + type: string + required: + - attributes + - file_id + - filename + - score + - text + title: >- + OpenAIResponseOutputMessageFileSearchToolCallResults + type: object + "OpenAIResponseOutputMessageFunctionToolCall": description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.web_search_call.in_progress - default: response.web_search_call.in_progress + Function tool call output message for OpenAI responses. + + + :param call_id: Unique identifier for the function call + + :param name: Name of the function being called + + :param arguments: JSON string containing the function arguments + + :param type: Tool call type identifier, always "function_call" + + :param id: (Optional) Additional identifier for the tool call + + :param status: (Optional) Current status of the function call execution + properties: + call_id: + title: Call Id + type: string + name: + title: Name + type: string + arguments: + title: Arguments + type: string + type: + const: function_call + default: function_call + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - call_id + - name + - arguments + title: >- + OpenAIResponseOutputMessageFunctionToolCall + type: object + OpenAIResponseOutputMessageMCPCall: description: >- - Event type identifier, always "response.web_search_call.in_progress" - additionalProperties: false - required: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseWebSearchCallInProgress - description: >- - Streaming event for web search calls in progress. - "OpenAIResponseObjectStreamResponseWebSearchCallSearching": - type: object - properties: - item_id: - type: string - output_index: - type: integer - sequence_number: - type: integer - type: - type: string - const: response.web_search_call.searching - default: response.web_search_call.searching - additionalProperties: false - required: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseWebSearchCallSearching - OpenAIDeleteResponseObject: - type: object - properties: - id: - type: string + Model Context Protocol (MCP) call output message for OpenAI responses. + + + :param id: Unique identifier for this MCP call + + :param type: Tool call type identifier, always "mcp_call" + + :param arguments: JSON string containing the MCP call arguments + + :param name: Name of the MCP method being called + + :param server_label: Label identifying the MCP server handling the call + + :param error: (Optional) Error message if the MCP call failed + + :param output: (Optional) Output result from the successful MCP call + properties: + id: + title: Id + type: string + type: + const: mcp_call + default: mcp_call + title: Type + type: string + arguments: + title: Arguments + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + error: + anyOf: + - type: string + - type: 'null' + title: Error + output: + anyOf: + - type: string + - type: 'null' + title: Output + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + type: object + OpenAIResponseOutputMessageMCPListTools: description: >- - Unique identifier of the deleted response - object: - type: string - const: response - default: response + MCP list tools output message containing available tools from an MCP server. + + + :param id: Unique identifier for this MCP list tools operation + + :param type: Tool call type identifier, always "mcp_list_tools" + + :param server_label: Label identifying the MCP server providing the tools + + :param tools: List of available tools provided by the MCP server + properties: + id: + title: Id + type: string + type: + const: mcp_list_tools + default: mcp_list_tools + title: Type + type: string + server_label: + title: Server Label + type: string + tools: + items: + $ref: '#/$defs/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + type: object + "OpenAIResponseOutputMessageWebSearchToolCall": description: >- - Object type identifier, always "response" - deleted: - type: boolean - default: true - description: Deletion confirmation flag, always True - additionalProperties: false - required: - - id - - object - - deleted - title: OpenAIDeleteResponseObject + Web search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param status: Current status of the web search operation + + :param type: Tool call type identifier, always "web_search_call" + properties: + id: + title: Id + type: string + status: + title: Status + type: string + type: + const: web_search_call + default: web_search_call + title: Type + type: string + required: + - id + - status + title: >- + OpenAIResponseOutputMessageWebSearchToolCall + type: object description: >- - Response object confirming deletion of an OpenAI response. - ListOpenAIResponseInputItem: - type: object + List container for OpenAI response input items. + + + :param data: List of input items + + :param object: Object type identifier, always "list" properties: data: - type: array items: - $ref: '#/components/schemas/OpenAIResponseInput' - description: List of input items + anyOf: + - discriminator: + mapping: + file_search_call: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + function_call: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + mcp_list_tools: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + message: '#/$defs/OpenAIResponseMessage' + web_search_call: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseMessage' + - $ref: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' + - $ref: >- + #/$defs/OpenAIResponseInputFunctionToolCallOutput + - $ref: >- + #/$defs/OpenAIResponseMCPApprovalResponse + - $ref: '#/$defs/OpenAIResponseMessage' + title: Data + type: array object: - type: string const: list default: list - description: Object type identifier, always "list" - additionalProperties: false + title: Object + type: string required: - data - - object title: ListOpenAIResponseInputItem - description: >- - List container for OpenAI response input items. + type: object RunShieldRequest: type: object - properties: - shield_id: - type: string - description: The identifier of the shield to run. - messages: - type: array - items: - $ref: '#/components/schemas/OpenAIMessageParam' - description: The messages to run the shield on. - params: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The parameters of the shield. - additionalProperties: false - required: - - shield_id - - messages - - params - title: RunShieldRequest RunShieldResponse: - type: object + $defs: + SafetyViolation: + description: >- + Details of a safety violation detected by content moderation. + + + :param violation_level: Severity level of the violation + + :param user_message: (Optional) Message to convey to the user about the + violation + + :param metadata: Additional metadata including specific violation codes + for debugging and telemetry + properties: + violation_level: + $ref: '#/$defs/ViolationLevel' + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + metadata: + additionalProperties: true + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + type: object + ViolationLevel: + description: >- + Severity level of a safety violation. + + + :cvar INFO: Informational level violation that does not require action + + :cvar WARN: Warning level violation that suggests caution but allows continuation + + :cvar ERROR: Error level violation that requires blocking or intervention + enum: + - info + - warn + - error + title: ViolationLevel + type: string + description: >- + Response from running a safety shield. + + + :param violation: (Optional) Safety violation detected by the shield, if any properties: violation: - $ref: '#/components/schemas/SafetyViolation' - description: >- - (Optional) Safety violation detected by the shield, if any - additionalProperties: false + anyOf: + - $ref: '#/$defs/SafetyViolation' + - type: 'null' title: RunShieldResponse - description: Response from running a safety shield. - SafetyViolation: type: object - properties: - violation_level: - $ref: '#/components/schemas/ViolationLevel' - description: Severity level of the violation - user_message: - type: string + ListScoringFunctionsResponse: + $defs: + AgentTurnInputType: description: >- - (Optional) Message to convey to the user about the violation - metadata: + Parameter type for agent turn input. + + + :param type: Discriminator type. Always "agent_turn_input" + properties: + type: + const: agent_turn_input + default: agent_turn_input + title: Type + type: string + title: AgentTurnInputType type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + AggregationFunctionType: description: >- - Additional metadata including specific violation codes for debugging and - telemetry - additionalProperties: false - required: - - violation_level - - metadata - title: SafetyViolation - description: >- - Details of a safety violation detected by content moderation. - ViolationLevel: - type: string - enum: - - info - - warn - - error - title: ViolationLevel - description: Severity level of a safety violation. - AgentTurnInputType: - type: object - properties: - type: + Types of aggregation functions for scoring results. + + :cvar average: Calculate the arithmetic mean of scores + + :cvar weighted_average: Calculate a weighted average of scores + + :cvar median: Calculate the median value of scores + + :cvar categorical_count: Count occurrences of categorical values + + :cvar accuracy: Calculate accuracy as the proportion of correct answers + enum: + - average + - weighted_average + - median + - categorical_count + - accuracy + title: AggregationFunctionType type: string - const: agent_turn_input - default: agent_turn_input + ArrayType: description: >- - Discriminator type. Always "agent_turn_input" - additionalProperties: false - required: - - type - title: AgentTurnInputType - description: Parameter type for agent turn input. - AggregationFunctionType: - type: string - enum: - - average - - weighted_average - - median - - categorical_count - - accuracy - title: AggregationFunctionType - description: >- - Types of aggregation functions for scoring results. - ArrayType: - type: object - properties: - type: - type: string - const: array - default: array - description: Discriminator type. Always "array" - additionalProperties: false - required: - - type - title: ArrayType - description: Parameter type for array values. - BasicScoringFnParams: - type: object - properties: - type: - $ref: '#/components/schemas/ScoringFnParamsType' - const: basic - default: basic + Parameter type for array values. + + + :param type: Discriminator type. Always "array" + properties: + type: + const: array + default: array + title: Type + type: string + title: ArrayType + type: object + BasicScoringFnParams: description: >- - The type of scoring function parameters, always basic - aggregation_functions: - type: array - items: - $ref: '#/components/schemas/AggregationFunctionType' + Parameters for basic scoring function configuration. + + :param type: The type of scoring function parameters, always basic + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row + properties: + type: + const: basic + default: basic + title: Type + type: string + aggregation_functions: + description: >- + Aggregation functions to apply to the scores of each row + items: + $ref: '#/$defs/AggregationFunctionType' + title: Aggregation Functions + type: array + title: BasicScoringFnParams + type: object + BooleanType: description: >- - Aggregation functions to apply to the scores of each row - additionalProperties: false - required: - - type - - aggregation_functions - title: BasicScoringFnParams - description: >- - Parameters for basic scoring function configuration. - BooleanType: - type: object - properties: - type: - type: string - const: boolean - default: boolean - description: Discriminator type. Always "boolean" - additionalProperties: false - required: - - type - title: BooleanType - description: Parameter type for boolean values. - ChatCompletionInputType: - type: object - properties: - type: - type: string - const: chat_completion_input - default: chat_completion_input + Parameter type for boolean values. + + + :param type: Discriminator type. Always "boolean" + properties: + type: + const: boolean + default: boolean + title: Type + type: string + title: BooleanType + type: object + ChatCompletionInputType: + description: >- + Parameter type for chat completion input. + + + :param type: Discriminator type. Always "chat_completion_input" + properties: + type: + const: chat_completion_input + default: chat_completion_input + title: Type + type: string + title: ChatCompletionInputType + type: object + CompletionInputType: + description: >- + Parameter type for completion input. + + + :param type: Discriminator type. Always "completion_input" + properties: + type: + const: completion_input + default: completion_input + title: Type + type: string + title: CompletionInputType + type: object + JsonType: + description: >- + Parameter type for JSON values. + + + :param type: Discriminator type. Always "json" + properties: + type: + const: json + default: json + title: Type + type: string + title: JsonType + type: object + LLMAsJudgeScoringFnParams: + description: >- + Parameters for LLM-as-judge scoring function configuration. + + :param type: The type of scoring function parameters, always llm_as_judge + + :param judge_model: Identifier of the LLM model to use as a judge for + scoring + + :param prompt_template: (Optional) Custom prompt template for the judge + model + + :param judge_score_regexes: Regexes to extract the answer from generated + response + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row + properties: + type: + const: llm_as_judge + default: llm_as_judge + title: Type + type: string + judge_model: + title: Judge Model + type: string + prompt_template: + anyOf: + - type: string + - type: 'null' + title: Prompt Template + judge_score_regexes: + description: >- + Regexes to extract the answer from generated response + items: + type: string + title: Judge Score Regexes + type: array + aggregation_functions: + description: >- + Aggregation functions to apply to the scores of each row + items: + $ref: '#/$defs/AggregationFunctionType' + title: Aggregation Functions + type: array + required: + - judge_model + title: LLMAsJudgeScoringFnParams + type: object + NumberType: + description: >- + Parameter type for numeric values. + + + :param type: Discriminator type. Always "number" + properties: + type: + const: number + default: number + title: Type + type: string + title: NumberType + type: object + ObjectType: + description: >- + Parameter type for object values. + + + :param type: Discriminator type. Always "object" + properties: + type: + const: object + default: object + title: Type + type: string + title: ObjectType + type: object + RegexParserScoringFnParams: + description: >- + Parameters for regex parser scoring function configuration. + + :param type: The type of scoring function parameters, always regex_parser + + :param parsing_regexes: Regex to extract the answer from generated response + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row + properties: + type: + const: regex_parser + default: regex_parser + title: Type + type: string + parsing_regexes: + description: >- + Regex to extract the answer from generated response + items: + type: string + title: Parsing Regexes + type: array + aggregation_functions: + description: >- + Aggregation functions to apply to the scores of each row + items: + $ref: '#/$defs/AggregationFunctionType' + title: Aggregation Functions + type: array + title: RegexParserScoringFnParams + type: object + ScoringFn: + description: >- + A scoring function resource for evaluating model outputs. + + :param type: The resource type, always scoring_function + properties: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: scoring_function + default: scoring_function + title: Type + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + metadata: + additionalProperties: true + description: >- + Any additional metadata for this definition + title: Metadata + type: object + return_type: + description: >- + The return type of the deterministic function + discriminator: + mapping: + agent_turn_input: '#/$defs/AgentTurnInputType' + array: '#/$defs/ArrayType' + boolean: '#/$defs/BooleanType' + chat_completion_input: '#/$defs/ChatCompletionInputType' + completion_input: '#/$defs/CompletionInputType' + json: '#/$defs/JsonType' + number: '#/$defs/NumberType' + object: '#/$defs/ObjectType' + string: '#/$defs/StringType' + union: '#/$defs/UnionType' + propertyName: type + oneOf: + - $ref: '#/$defs/StringType' + - $ref: '#/$defs/NumberType' + - $ref: '#/$defs/BooleanType' + - $ref: '#/$defs/ArrayType' + - $ref: '#/$defs/ObjectType' + - $ref: '#/$defs/JsonType' + - $ref: '#/$defs/UnionType' + - $ref: '#/$defs/ChatCompletionInputType' + - $ref: '#/$defs/CompletionInputType' + - $ref: '#/$defs/AgentTurnInputType' + title: Return Type + params: + anyOf: + - discriminator: + mapping: + basic: '#/$defs/BasicScoringFnParams' + llm_as_judge: '#/$defs/LLMAsJudgeScoringFnParams' + regex_parser: '#/$defs/RegexParserScoringFnParams' + propertyName: type + oneOf: + - $ref: '#/$defs/LLMAsJudgeScoringFnParams' + - $ref: '#/$defs/RegexParserScoringFnParams' + - $ref: '#/$defs/BasicScoringFnParams' + - type: 'null' + description: >- + The parameters for the scoring function for benchmark eval, these + can be overridden for app eval + title: Params + required: + - identifier + - provider_id + - return_type + title: ScoringFn + type: object + StringType: + description: >- + Parameter type for string values. + + + :param type: Discriminator type. Always "string" + properties: + type: + const: string + default: string + title: Type + type: string + title: StringType + type: object + UnionType: description: >- - Discriminator type. Always "chat_completion_input" - additionalProperties: false - required: - - type - title: ChatCompletionInputType - description: >- - Parameter type for chat completion input. - CompletionInputType: - type: object + Parameter type for union values. + + + :param type: Discriminator type. Always "union" + properties: + type: + const: union + default: union + title: Type + type: string + title: UnionType + type: object properties: - type: - type: string - const: completion_input - default: completion_input - description: >- - Discriminator type. Always "completion_input" - additionalProperties: false + data: + items: + $ref: '#/$defs/ScoringFn' + title: Data + type: array required: - - type - title: CompletionInputType - description: Parameter type for completion input. - JsonType: + - data + title: ListScoringFunctionsResponse type: object - properties: - type: - type: string - const: json - default: json - description: Discriminator type. Always "json" - additionalProperties: false - required: - - type - title: JsonType - description: Parameter type for JSON values. - LLMAsJudgeScoringFnParams: + RegisterScoringFunctionRequest: type: object - properties: - type: - $ref: '#/components/schemas/ScoringFnParamsType' - const: llm_as_judge - default: llm_as_judge + ScoringFn: + $defs: + AgentTurnInputType: description: >- - The type of scoring function parameters, always llm_as_judge - judge_model: - type: string + Parameter type for agent turn input. + + + :param type: Discriminator type. Always "agent_turn_input" + properties: + type: + const: agent_turn_input + default: agent_turn_input + title: Type + type: string + title: AgentTurnInputType + type: object + AggregationFunctionType: description: >- - Identifier of the LLM model to use as a judge for scoring - prompt_template: + Types of aggregation functions for scoring results. + + :cvar average: Calculate the arithmetic mean of scores + + :cvar weighted_average: Calculate a weighted average of scores + + :cvar median: Calculate the median value of scores + + :cvar categorical_count: Count occurrences of categorical values + + :cvar accuracy: Calculate accuracy as the proportion of correct answers + enum: + - average + - weighted_average + - median + - categorical_count + - accuracy + title: AggregationFunctionType type: string + ArrayType: description: >- - (Optional) Custom prompt template for the judge model - judge_score_regexes: - type: array - items: - type: string + Parameter type for array values. + + + :param type: Discriminator type. Always "array" + properties: + type: + const: array + default: array + title: Type + type: string + title: ArrayType + type: object + BasicScoringFnParams: description: >- - Regexes to extract the answer from generated response - aggregation_functions: - type: array - items: - $ref: '#/components/schemas/AggregationFunctionType' + Parameters for basic scoring function configuration. + + :param type: The type of scoring function parameters, always basic + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row + properties: + type: + const: basic + default: basic + title: Type + type: string + aggregation_functions: + description: >- + Aggregation functions to apply to the scores of each row + items: + $ref: '#/$defs/AggregationFunctionType' + title: Aggregation Functions + type: array + title: BasicScoringFnParams + type: object + BooleanType: description: >- - Aggregation functions to apply to the scores of each row - additionalProperties: false - required: - - type - - judge_model - - judge_score_regexes - - aggregation_functions - title: LLMAsJudgeScoringFnParams - description: >- - Parameters for LLM-as-judge scoring function configuration. - NumberType: - type: object - properties: - type: - type: string - const: number - default: number - description: Discriminator type. Always "number" - additionalProperties: false - required: - - type - title: NumberType - description: Parameter type for numeric values. - ObjectType: - type: object - properties: - type: - type: string - const: object - default: object - description: Discriminator type. Always "object" - additionalProperties: false - required: - - type - title: ObjectType - description: Parameter type for object values. - RegexParserScoringFnParams: - type: object - properties: - type: - $ref: '#/components/schemas/ScoringFnParamsType' - const: regex_parser - default: regex_parser + Parameter type for boolean values. + + + :param type: Discriminator type. Always "boolean" + properties: + type: + const: boolean + default: boolean + title: Type + type: string + title: BooleanType + type: object + ChatCompletionInputType: description: >- - The type of scoring function parameters, always regex_parser - parsing_regexes: - type: array - items: - type: string + Parameter type for chat completion input. + + + :param type: Discriminator type. Always "chat_completion_input" + properties: + type: + const: chat_completion_input + default: chat_completion_input + title: Type + type: string + title: ChatCompletionInputType + type: object + CompletionInputType: description: >- - Regex to extract the answer from generated response - aggregation_functions: - type: array - items: - $ref: '#/components/schemas/AggregationFunctionType' + Parameter type for completion input. + + + :param type: Discriminator type. Always "completion_input" + properties: + type: + const: completion_input + default: completion_input + title: Type + type: string + title: CompletionInputType + type: object + JsonType: description: >- - Aggregation functions to apply to the scores of each row - additionalProperties: false - required: - - type - - parsing_regexes - - aggregation_functions - title: RegexParserScoringFnParams - description: >- - Parameters for regex parser scoring function configuration. - ScoringFn: - type: object - properties: - identifier: - type: string - provider_resource_id: - type: string - provider_id: - type: string - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: scoring_function - default: scoring_function + Parameter type for JSON values. + + + :param type: Discriminator type. Always "json" + properties: + type: + const: json + default: json + title: Type + type: string + title: JsonType + type: object + LLMAsJudgeScoringFnParams: description: >- - The resource type, always scoring_function - description: - type: string - metadata: + Parameters for LLM-as-judge scoring function configuration. + + :param type: The type of scoring function parameters, always llm_as_judge + + :param judge_model: Identifier of the LLM model to use as a judge for + scoring + + :param prompt_template: (Optional) Custom prompt template for the judge + model + + :param judge_score_regexes: Regexes to extract the answer from generated + response + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row + properties: + type: + const: llm_as_judge + default: llm_as_judge + title: Type + type: string + judge_model: + title: Judge Model + type: string + prompt_template: + anyOf: + - type: string + - type: 'null' + title: Prompt Template + judge_score_regexes: + description: >- + Regexes to extract the answer from generated response + items: + type: string + title: Judge Score Regexes + type: array + aggregation_functions: + description: >- + Aggregation functions to apply to the scores of each row + items: + $ref: '#/$defs/AggregationFunctionType' + title: Aggregation Functions + type: array + required: + - judge_model + title: LLMAsJudgeScoringFnParams type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - return_type: - oneOf: - - $ref: '#/components/schemas/StringType' - - $ref: '#/components/schemas/NumberType' - - $ref: '#/components/schemas/BooleanType' - - $ref: '#/components/schemas/ArrayType' - - $ref: '#/components/schemas/ObjectType' - - $ref: '#/components/schemas/JsonType' - - $ref: '#/components/schemas/UnionType' - - $ref: '#/components/schemas/ChatCompletionInputType' - - $ref: '#/components/schemas/CompletionInputType' - - $ref: '#/components/schemas/AgentTurnInputType' - discriminator: - propertyName: type - mapping: - string: '#/components/schemas/StringType' - number: '#/components/schemas/NumberType' - boolean: '#/components/schemas/BooleanType' - array: '#/components/schemas/ArrayType' - object: '#/components/schemas/ObjectType' - json: '#/components/schemas/JsonType' - union: '#/components/schemas/UnionType' - chat_completion_input: '#/components/schemas/ChatCompletionInputType' - completion_input: '#/components/schemas/CompletionInputType' - agent_turn_input: '#/components/schemas/AgentTurnInputType' - params: - $ref: '#/components/schemas/ScoringFnParams' - additionalProperties: false - required: - - identifier - - provider_id - - type - - metadata - - return_type - title: ScoringFn - description: >- - A scoring function resource for evaluating model outputs. - ScoringFnParams: - oneOf: - - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - - $ref: '#/components/schemas/RegexParserScoringFnParams' - - $ref: '#/components/schemas/BasicScoringFnParams' - discriminator: - propertyName: type - mapping: - llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' - regex_parser: '#/components/schemas/RegexParserScoringFnParams' - basic: '#/components/schemas/BasicScoringFnParams' - ScoringFnParamsType: - type: string - enum: - - llm_as_judge - - regex_parser - - basic - title: ScoringFnParamsType - description: >- - Types of scoring function parameter configurations. - StringType: - type: object - properties: - type: - type: string - const: string - default: string - description: Discriminator type. Always "string" - additionalProperties: false - required: - - type - title: StringType - description: Parameter type for string values. - UnionType: - type: object - properties: - type: - type: string - const: union - default: union - description: Discriminator type. Always "union" - additionalProperties: false - required: - - type - title: UnionType - description: Parameter type for union values. - ListScoringFunctionsResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/ScoringFn' - additionalProperties: false - required: - - data - title: ListScoringFunctionsResponse - ParamType: - oneOf: - - $ref: '#/components/schemas/StringType' - - $ref: '#/components/schemas/NumberType' - - $ref: '#/components/schemas/BooleanType' - - $ref: '#/components/schemas/ArrayType' - - $ref: '#/components/schemas/ObjectType' - - $ref: '#/components/schemas/JsonType' - - $ref: '#/components/schemas/UnionType' - - $ref: '#/components/schemas/ChatCompletionInputType' - - $ref: '#/components/schemas/CompletionInputType' - - $ref: '#/components/schemas/AgentTurnInputType' - discriminator: - propertyName: type - mapping: - string: '#/components/schemas/StringType' - number: '#/components/schemas/NumberType' - boolean: '#/components/schemas/BooleanType' - array: '#/components/schemas/ArrayType' - object: '#/components/schemas/ObjectType' - json: '#/components/schemas/JsonType' - union: '#/components/schemas/UnionType' - chat_completion_input: '#/components/schemas/ChatCompletionInputType' - completion_input: '#/components/schemas/CompletionInputType' - agent_turn_input: '#/components/schemas/AgentTurnInputType' - RegisterScoringFunctionRequest: - type: object + NumberType: + description: >- + Parameter type for numeric values. + + + :param type: Discriminator type. Always "number" + properties: + type: + const: number + default: number + title: Type + type: string + title: NumberType + type: object + ObjectType: + description: >- + Parameter type for object values. + + + :param type: Discriminator type. Always "object" + properties: + type: + const: object + default: object + title: Type + type: string + title: ObjectType + type: object + RegexParserScoringFnParams: + description: >- + Parameters for regex parser scoring function configuration. + + :param type: The type of scoring function parameters, always regex_parser + + :param parsing_regexes: Regex to extract the answer from generated response + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row + properties: + type: + const: regex_parser + default: regex_parser + title: Type + type: string + parsing_regexes: + description: >- + Regex to extract the answer from generated response + items: + type: string + title: Parsing Regexes + type: array + aggregation_functions: + description: >- + Aggregation functions to apply to the scores of each row + items: + $ref: '#/$defs/AggregationFunctionType' + title: Aggregation Functions + type: array + title: RegexParserScoringFnParams + type: object + StringType: + description: >- + Parameter type for string values. + + + :param type: Discriminator type. Always "string" + properties: + type: + const: string + default: string + title: Type + type: string + title: StringType + type: object + UnionType: + description: >- + Parameter type for union values. + + + :param type: Discriminator type. Always "union" + properties: + type: + const: union + default: union + title: Type + type: string + title: UnionType + type: object + description: >- + A scoring function resource for evaluating model outputs. + + :param type: The resource type, always scoring_function properties: - scoring_fn_id: - type: string + identifier: description: >- - The ID of the scoring function to register. - description: - type: string - description: The description of the scoring function. - return_type: - $ref: '#/components/schemas/ParamType' - description: The return type of the scoring function. - provider_scoring_fn_id: + Unique identifier for this resource in llama stack + title: Identifier type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' description: >- - The ID of the provider scoring function to use for the scoring function. + Unique identifier for this resource in the provider + title: Provider Resource Id provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: scoring_function + default: scoring_function + title: Type type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + metadata: + additionalProperties: true + description: >- + Any additional metadata for this definition + title: Metadata + type: object + return_type: description: >- - The ID of the provider to use for the scoring function. + The return type of the deterministic function + discriminator: + mapping: + agent_turn_input: '#/$defs/AgentTurnInputType' + array: '#/$defs/ArrayType' + boolean: '#/$defs/BooleanType' + chat_completion_input: '#/$defs/ChatCompletionInputType' + completion_input: '#/$defs/CompletionInputType' + json: '#/$defs/JsonType' + number: '#/$defs/NumberType' + object: '#/$defs/ObjectType' + string: '#/$defs/StringType' + union: '#/$defs/UnionType' + propertyName: type + oneOf: + - $ref: '#/$defs/StringType' + - $ref: '#/$defs/NumberType' + - $ref: '#/$defs/BooleanType' + - $ref: '#/$defs/ArrayType' + - $ref: '#/$defs/ObjectType' + - $ref: '#/$defs/JsonType' + - $ref: '#/$defs/UnionType' + - $ref: '#/$defs/ChatCompletionInputType' + - $ref: '#/$defs/CompletionInputType' + - $ref: '#/$defs/AgentTurnInputType' + title: Return Type params: - $ref: '#/components/schemas/ScoringFnParams' + anyOf: + - discriminator: + mapping: + basic: '#/$defs/BasicScoringFnParams' + llm_as_judge: '#/$defs/LLMAsJudgeScoringFnParams' + regex_parser: '#/$defs/RegexParserScoringFnParams' + propertyName: type + oneOf: + - $ref: '#/$defs/LLMAsJudgeScoringFnParams' + - $ref: '#/$defs/RegexParserScoringFnParams' + - $ref: '#/$defs/BasicScoringFnParams' + - type: 'null' description: >- The parameters for the scoring function for benchmark eval, these can - be overridden for app eval. - additionalProperties: false + be overridden for app eval + title: Params required: - - scoring_fn_id - - description + - identifier + - provider_id - return_type - title: RegisterScoringFunctionRequest + title: ScoringFn + type: object ScoreRequest: type: object - properties: - input_rows: - type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The rows to score. - scoring_functions: - type: object - additionalProperties: - oneOf: - - $ref: '#/components/schemas/ScoringFnParams' - - type: 'null' - description: >- - The scoring functions to use for the scoring. - additionalProperties: false - required: - - input_rows - - scoring_functions - title: ScoreRequest ScoreResponse: - type: object + $defs: + ScoringResult: + description: >- + A scoring result for a single row. + + + :param score_rows: The scoring result for each row. Each row is a map + of column name to value. + + :param aggregated_results: Map of metric name to aggregated value + properties: + score_rows: + items: + additionalProperties: true + type: object + title: Score Rows + type: array + aggregated_results: + additionalProperties: true + title: Aggregated Results + type: object + required: + - score_rows + - aggregated_results + title: ScoringResult + type: object + description: >- + The response from scoring. + + + :param results: A map of scoring function name to ScoringResult. properties: results: - type: object additionalProperties: - $ref: '#/components/schemas/ScoringResult' - description: >- - A map of scoring function name to ScoringResult. - additionalProperties: false + $ref: '#/$defs/ScoringResult' + title: Results + type: object required: - results title: ScoreResponse - description: The response from scoring. - ScoringResult: type: object - properties: - score_rows: - type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The scoring result for each row. Each row is a map of column name to value. - aggregated_results: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Map of metric name to aggregated value - additionalProperties: false - required: - - score_rows - - aggregated_results - title: ScoringResult - description: A scoring result for a single row. ScoreBatchRequest: type: object - properties: - dataset_id: - type: string - description: The ID of the dataset to score. - scoring_functions: - type: object - additionalProperties: - oneOf: - - $ref: '#/components/schemas/ScoringFnParams' - - type: 'null' - description: >- - The scoring functions to use for the scoring. - save_results_dataset: - type: boolean - description: >- - Whether to save the results to a dataset. - additionalProperties: false - required: - - dataset_id - - scoring_functions - - save_results_dataset - title: ScoreBatchRequest ScoreBatchResponse: - type: object + $defs: + ScoringResult: + description: >- + A scoring result for a single row. + + + :param score_rows: The scoring result for each row. Each row is a map + of column name to value. + + :param aggregated_results: Map of metric name to aggregated value + properties: + score_rows: + items: + additionalProperties: true + type: object + title: Score Rows + type: array + aggregated_results: + additionalProperties: true + title: Aggregated Results + type: object + required: + - score_rows + - aggregated_results + title: ScoringResult + type: object + description: >- + Response from batch scoring operations on datasets. + + + :param dataset_id: (Optional) The identifier of the dataset that was scored + + :param results: A map of scoring function name to ScoringResult properties: dataset_id: - type: string - description: >- - (Optional) The identifier of the dataset that was scored + anyOf: + - type: string + - type: 'null' + title: Dataset Id results: - type: object additionalProperties: - $ref: '#/components/schemas/ScoringResult' - description: >- - A map of scoring function name to ScoringResult - additionalProperties: false + $ref: '#/$defs/ScoringResult' + title: Results + type: object required: - results title: ScoreBatchResponse - description: >- - Response from batch scoring operations on datasets. - Shield: type: object - properties: - identifier: - type: string - provider_resource_id: - type: string - provider_id: - type: string - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: shield - default: shield - description: The resource type, always shield - params: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Configuration parameters for the shield - additionalProperties: false - required: - - identifier - - provider_id - - type - title: Shield - description: >- - A safety shield resource that can be used to check content. ListShieldsResponse: - type: object + $defs: + Shield: + description: >- + A safety shield resource that can be used to check content. + + + :param params: (Optional) Configuration parameters for the shield + + :param type: The resource type, always shield + properties: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: shield + default: shield + title: Type + type: string + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + required: + - identifier + - provider_id + title: Shield + type: object properties: data: - type: array items: - $ref: '#/components/schemas/Shield' - additionalProperties: false + $ref: '#/$defs/Shield' + title: Data + type: array required: - data title: ListShieldsResponse + type: object RegisterShieldRequest: type: object properties: @@ -10279,209 +14024,584 @@ components: default: > Result {index} - Content: {chunk.content} - Metadata: {metadata} - description: >- - Template for formatting each retrieved chunk in the context. Available - placeholders: {index} (1-based chunk ordinal), {chunk.content} (chunk - content string), {metadata} (chunk metadata dict). Default: "Result {index}\nContent: - {chunk.content}\nMetadata: {metadata}\n" - mode: - $ref: '#/components/schemas/RAGSearchMode' - default: vector + :param params: (Optional) Configuration parameters for the shield + + :param type: The resource type, always shield + properties: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: shield + default: shield + title: Type + type: string + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + required: + - identifier + - provider_id + title: Shield + type: object + SyntheticDataGenerateRequest: + type: object + SyntheticDataGenerationResponse: + description: >- + Response from the synthetic data generation. Batch of (prompt, response, score) + tuples that pass the threshold. + + + :param synthetic_data: List of generated synthetic data samples that passed + the filtering criteria + + :param statistics: (Optional) Statistical information about the generation + process and filtering results + properties: + synthetic_data: + items: + additionalProperties: true + type: object + title: Synthetic Data + type: array + statistics: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Statistics + required: + - synthetic_data + title: SyntheticDataGenerationResponse + type: object + InvokeToolRequest: + type: object + ToolInvocationResult: + $defs: + ImageContentItem: + description: >- + A image content item + + + :param type: Discriminator type of the content item. Always "image" + + :param image: Image as a base64 encoded string or an URL + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/$defs/_URLOrData' + required: + - image + title: ImageContentItem + type: object + TextContentItem: + description: >- + A text content item + + + :param type: Discriminator type of the content item. Always "text" + + :param text: Text content + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + URL: description: >- - Search mode for retrieval—either "vector", "keyword", or "hybrid". Default - "vector". - ranker: - $ref: '#/components/schemas/Ranker' + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + _URLOrData: description: >- - Configuration for the ranker to use in hybrid search. Defaults to RRF - ranker. - additionalProperties: false - required: - - query_generator_config - - max_tokens_in_context - - max_chunks - - chunk_template - title: RAGQueryConfig - description: >- - Configuration for the RAG query generation. - RAGSearchMode: - type: string - enum: - - vector - - keyword - - hybrid - title: RAGSearchMode + A URL or a base64 encoded string + + + :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. + Note that URL could have length limits. + + :param data: base64 encoded image data as string + properties: + url: + anyOf: + - $ref: '#/$defs/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data + title: _URLOrData + type: object description: >- - Search modes for RAG query retrieval: - VECTOR: Uses vector similarity search - for semantic matching - KEYWORD: Uses keyword-based search for exact matching - - HYBRID: Combines both vector and keyword search for better results - RRFRanker: + Result of a tool invocation. + + + :param content: (Optional) The output content from the tool execution + + :param error_message: (Optional) Error message if the tool execution failed + + :param error_code: (Optional) Numeric error code if the tool execution failed + + :param metadata: (Optional) Additional metadata about the tool execution + properties: + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + - type: 'null' + title: Content + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + error_code: + anyOf: + - type: integer + - type: 'null' + title: Error Code + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + title: ToolInvocationResult type: object + URL: + description: >- + A URL reference to external content. + + + :param uri: The URL string pointing to the resource properties: - type: + uri: + title: Uri type: string - const: rrf - default: rrf - description: The type of ranker, always "rrf" - impact_factor: - type: number - default: 60.0 - description: >- - The impact factor for RRF scoring. Higher values give more weight to higher-ranked - results. Must be greater than 0 - additionalProperties: false required: - - type - - impact_factor - title: RRFRanker - description: >- - Reciprocal Rank Fusion (RRF) ranker configuration. - Ranker: - oneOf: - - $ref: '#/components/schemas/RRFRanker' - - $ref: '#/components/schemas/WeightedRanker' - discriminator: - propertyName: type - mapping: - rrf: '#/components/schemas/RRFRanker' - weighted: '#/components/schemas/WeightedRanker' - WeightedRanker: + - uri + title: URL type: object - properties: - type: - type: string - const: weighted - default: weighted - description: The type of ranker, always "weighted" - alpha: - type: number - default: 0.5 + ListToolDefsResponse: + $defs: + ToolDef: description: >- - Weight factor between 0 and 1. 0 means only use keyword scores, 1 means - only use vector scores, values in between blend both scores. - additionalProperties: false - required: - - type - - alpha - title: WeightedRanker + Tool definition used in runtime contexts. + + + :param name: Name of the tool + + :param description: (Optional) Human-readable description of what the + tool does + + :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) + + :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) + + :param metadata: (Optional) Additional metadata about the tool + + :param toolgroup_id: (Optional) ID of the tool group this tool belongs + to + properties: + toolgroup_id: + anyOf: + - type: string + - type: 'null' + title: Toolgroup Id + name: + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + input_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Input Schema + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Output Schema + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + required: + - name + title: ToolDef + type: object description: >- - Weighted ranker configuration that combines vector and keyword scores. + Response containing a list of tool definitions. + + + :param data: List of tool definitions + properties: + data: + items: + $ref: '#/$defs/ToolDef' + title: Data + type: array + required: + - data + title: ListToolDefsResponse + type: object + InsertRequest: + type: object QueryRequest: type: object - properties: - content: - $ref: '#/components/schemas/InterleavedContent' + RAGQueryResult: + $defs: + ImageContentItem: description: >- - The query content to search for in the indexed documents - vector_store_ids: - type: array - items: - type: string + A image content item + + + :param type: Discriminator type of the content item. Always "image" + + :param image: Image as a base64 encoded string or an URL + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/$defs/_URLOrData' + required: + - image + title: ImageContentItem + type: object + TextContentItem: + description: >- + A text content item + + + :param type: Discriminator type of the content item. Always "text" + + :param text: Text content + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + URL: description: >- - List of vector database IDs to search within - query_config: - $ref: '#/components/schemas/RAGQueryConfig' + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + _URLOrData: description: >- - (Optional) Configuration parameters for the query operation - additionalProperties: false - required: - - content - - vector_store_ids - title: QueryRequest - RAGQueryResult: - type: object + A URL or a base64 encoded string + + + :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. + Note that URL could have length limits. + + :param data: base64 encoded image data as string + properties: + url: + anyOf: + - $ref: '#/$defs/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data + title: _URLOrData + type: object + description: >- + Result of a RAG query containing retrieved content and metadata. + + + :param content: (Optional) The retrieved content from the query + + :param metadata: Additional metadata about the query result properties: content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - (Optional) The retrieved content from the query + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + - type: 'null' + title: Content metadata: + additionalProperties: true + title: Metadata type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Additional metadata about the query result - additionalProperties: false - required: - - metadata title: RAGQueryResult + type: object + ListToolGroupsResponse: + $defs: + ToolGroup: + description: >- + A group of related tools managed together. + + + :param type: Type of resource, always 'tool_group' + + :param mcp_endpoint: (Optional) Model Context Protocol endpoint for remote + tools + + :param args: (Optional) Additional arguments for the tool group + properties: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: tool_group + default: tool_group + title: Type + type: string + mcp_endpoint: + anyOf: + - $ref: '#/$defs/URL' + - type: 'null' + args: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Args + required: + - identifier + - provider_id + title: ToolGroup + type: object + URL: + description: >- + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object description: >- - Result of a RAG query containing retrieved content and metadata. - ToolGroup: + Response containing a list of tool groups. + + + :param data: List of tool groups + properties: + data: + items: + $ref: '#/$defs/ToolGroup' + title: Data + type: array + required: + - data + title: ListToolGroupsResponse + type: object + RegisterToolGroupRequest: type: object + ToolGroup: + $defs: + URL: + description: >- + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + description: >- + A group of related tools managed together. + + + :param type: Type of resource, always 'tool_group' + + :param mcp_endpoint: (Optional) Model Context Protocol endpoint for remote + tools + + :param args: (Optional) Additional arguments for the tool group properties: identifier: - type: string - provider_resource_id: - type: string - provider_id: - type: string - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt + description: >- + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: const: tool_group default: tool_group - description: Type of resource, always 'tool_group' + title: Type + type: string mcp_endpoint: - $ref: '#/components/schemas/URL' - description: >- - (Optional) Model Context Protocol endpoint for remote tools + anyOf: + - $ref: '#/$defs/URL' + - type: 'null' args: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional arguments for the tool group - additionalProperties: false + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Args required: - identifier - provider_id - - type title: ToolGroup - description: >- - A group of related tools managed together. - ListToolGroupsResponse: type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/ToolGroup' - description: List of tool groups - additionalProperties: false - required: - - data - title: ListToolGroupsResponse + ToolDef: description: >- - Response containing a list of tool groups. - RegisterToolGroupRequest: - type: object + Tool definition used in runtime contexts. + + + :param name: Name of the tool + + :param description: (Optional) Human-readable description of what the tool + does + + :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) + + :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) + + :param metadata: (Optional) Additional metadata about the tool + + :param toolgroup_id: (Optional) ID of the tool group this tool belongs to properties: toolgroup_id: + anyOf: + - type: string + - type: 'null' + title: Toolgroup Id + name: + title: Name type: string description: The ID of the tool group to register. provider_id: @@ -10556,1714 +14676,3061 @@ components: A chunk of content that can be inserted into a vector database. ChunkMetadata: type: object - properties: - chunk_id: - type: string - description: >- - The ID of the chunk. If not set, it will be generated based on the document - ID and content. - document_id: - type: string - description: >- - The ID of the document this chunk belongs to. - source: - type: string - description: >- - The source of the content, such as a URL, file path, or other identifier. - created_timestamp: - type: integer - description: >- - An optional timestamp indicating when the chunk was created. - updated_timestamp: - type: integer - description: >- - An optional timestamp indicating when the chunk was last updated. - chunk_window: - type: string - description: >- - The window of the chunk, which can be used to group related chunks together. - chunk_tokenizer: - type: string - description: >- - The tokenizer used to create the chunk. Default is Tiktoken. - chunk_embedding_model: - type: string - description: >- - The embedding model used to create the chunk's embedding. - chunk_embedding_dimension: - type: integer - description: >- - The dimension of the embedding vector for the chunk. - content_token_count: - type: integer - description: >- - The number of tokens in the content of the chunk. - metadata_token_count: - type: integer - description: >- - The number of tokens in the metadata of the chunk. - additionalProperties: false - title: ChunkMetadata - description: >- - `ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional - information about the chunk that will not be used in the context during - inference, but is required for backend functionality. The `ChunkMetadata` is - set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not - expected to change after. Use `Chunk.metadata` for metadata that will - be used in the context during inference. InsertChunksRequest: type: object - properties: - vector_store_id: - type: string - description: >- - The identifier of the vector database to insert the chunks into. - chunks: - type: array - items: - $ref: '#/components/schemas/Chunk' - description: >- - The chunks to insert. Each `Chunk` should contain content which can be - interleaved text, images, or other types. `metadata`: `dict[str, Any]` - and `embedding`: `List[float]` are optional. If `metadata` is provided, - you configure how Llama Stack formats the chunk during generation. If - `embedding` is not provided, it will be computed later. - ttl_seconds: - type: integer - description: The time to live of the chunks. - additionalProperties: false - required: - - vector_store_id - - chunks - title: InsertChunksRequest QueryChunksRequest: type: object - properties: - vector_store_id: - type: string + QueryChunksResponse: + $defs: + Chunk: description: >- - The identifier of the vector database to query. - query: - $ref: '#/components/schemas/InterleavedContent' - description: The query to search for. - params: + A chunk of content that can be inserted into a vector database. + + :param content: The content of the chunk, which can be interleaved text, + images, or other types. + + :param embedding: Optional embedding for the chunk. If not provided, it + will be computed later. + + :param metadata: Metadata associated with the chunk that will be used + in the model context during inference. + + :param stored_chunk_id: The chunk ID that is stored in the vector database. + Used for backend functionality. + + :param chunk_metadata: Metadata for the chunk that will NOT be used in + the context during inference. + The `chunk_metadata` is required backend functionality. + properties: + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + metadata: + additionalProperties: true + title: Metadata + type: object + embedding: + anyOf: + - items: + type: number + type: array + - type: 'null' + title: Embedding + chunk_id: + anyOf: + - type: string + - type: 'null' + title: Chunk Id + chunk_metadata: + anyOf: + - $ref: '#/$defs/ChunkMetadata' + - type: 'null' + required: + - content + title: Chunk type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The parameters of the query. - additionalProperties: false - required: - - vector_store_id - - query - title: QueryChunksRequest - QueryChunksResponse: - type: object + ChunkMetadata: + description: >- + `ChunkMetadata` is backend metadata for a `Chunk` that is used to store + additional information about the chunk that + will not be used in the context during inference, but is required + for backend functionality. The `ChunkMetadata` + is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and + is not expected to change after. + Use `Chunk.metadata` for metadata that will be used in the context + during inference. + :param chunk_id: The ID of the chunk. If not set, it will be generated + based on the document ID and content. + + :param document_id: The ID of the document this chunk belongs to. + + :param source: The source of the content, such as a URL, file path, or + other identifier. + + :param created_timestamp: An optional timestamp indicating when the chunk + was created. + + :param updated_timestamp: An optional timestamp indicating when the chunk + was last updated. + + :param chunk_window: The window of the chunk, which can be used to group + related chunks together. + + :param chunk_tokenizer: The tokenizer used to create the chunk. Default + is Tiktoken. + + :param chunk_embedding_model: The embedding model used to create the chunk's + embedding. + + :param chunk_embedding_dimension: The dimension of the embedding vector + for the chunk. + + :param content_token_count: The number of tokens in the content of the + chunk. + + :param metadata_token_count: The number of tokens in the metadata of the + chunk. + properties: + chunk_id: + anyOf: + - type: string + - type: 'null' + title: Chunk Id + document_id: + anyOf: + - type: string + - type: 'null' + title: Document Id + source: + anyOf: + - type: string + - type: 'null' + title: Source + created_timestamp: + anyOf: + - type: integer + - type: 'null' + title: Created Timestamp + updated_timestamp: + anyOf: + - type: integer + - type: 'null' + title: Updated Timestamp + chunk_window: + anyOf: + - type: string + - type: 'null' + title: Chunk Window + chunk_tokenizer: + anyOf: + - type: string + - type: 'null' + title: Chunk Tokenizer + chunk_embedding_model: + anyOf: + - type: string + - type: 'null' + title: Chunk Embedding Model + chunk_embedding_dimension: + anyOf: + - type: integer + - type: 'null' + title: Chunk Embedding Dimension + content_token_count: + anyOf: + - type: integer + - type: 'null' + title: Content Token Count + metadata_token_count: + anyOf: + - type: integer + - type: 'null' + title: Metadata Token Count + title: ChunkMetadata + type: object + ImageContentItem: + description: >- + A image content item + + + :param type: Discriminator type of the content item. Always "image" + + :param image: Image as a base64 encoded string or an URL + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/$defs/_URLOrData' + required: + - image + title: ImageContentItem + type: object + TextContentItem: + description: >- + A text content item + + + :param type: Discriminator type of the content item. Always "text" + + :param text: Text content + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + URL: + description: >- + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + _URLOrData: + description: >- + A URL or a base64 encoded string + + + :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. + Note that URL could have length limits. + + :param data: base64 encoded image data as string + properties: + url: + anyOf: + - $ref: '#/$defs/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data + title: _URLOrData + type: object + description: >- + Response from querying chunks in a vector database. + + + :param chunks: List of content chunks returned from the query + + :param scores: Relevance scores corresponding to each returned chunk properties: chunks: - type: array items: - $ref: '#/components/schemas/Chunk' - description: >- - List of content chunks returned from the query - scores: + $ref: '#/$defs/Chunk' + title: Chunks type: array + scores: items: type: number - description: >- - Relevance scores corresponding to each returned chunk - additionalProperties: false + title: Scores + type: array required: - chunks - scores title: QueryChunksResponse - description: >- - Response from querying chunks in a vector database. - VectorStoreFileCounts: type: object - properties: - completed: - type: integer - description: >- - Number of files that have been successfully processed - cancelled: - type: integer - description: >- - Number of files that had their processing cancelled - failed: - type: integer - description: Number of files that failed to process - in_progress: - type: integer + VectorStoreListResponse: + $defs: + VectorStoreFileCounts: description: >- - Number of files currently being processed - total: - type: integer + File processing status counts for a vector store. + + + :param completed: Number of files that have been successfully processed + + :param cancelled: Number of files that had their processing cancelled + + :param failed: Number of files that failed to process + + :param in_progress: Number of files currently being processed + + :param total: Total number of files in the vector store + properties: + completed: + title: Completed + type: integer + cancelled: + title: Cancelled + type: integer + failed: + title: Failed + type: integer + in_progress: + title: In Progress + type: integer + total: + title: Total + type: integer + required: + - completed + - cancelled + - failed + - in_progress + - total + title: VectorStoreFileCounts + type: object + VectorStoreObject: description: >- - Total number of files in the vector store - additionalProperties: false - required: - - completed - - cancelled - - failed - - in_progress - - total - title: VectorStoreFileCounts - description: >- - File processing status counts for a vector store. - VectorStoreListResponse: - type: object + OpenAI Vector Store object. + + + :param id: Unique identifier for the vector store + + :param object: Object type identifier, always "vector_store" + + :param created_at: Timestamp when the vector store was created + + :param name: (Optional) Name of the vector store + + :param usage_bytes: Storage space used by the vector store in bytes + + :param file_counts: File processing status counts for the vector store + + :param status: Current status of the vector store + + :param expires_after: (Optional) Expiration policy for the vector store + + :param expires_at: (Optional) Timestamp when the vector store will expire + + :param last_active_at: (Optional) Timestamp of last activity on the vector + store + + :param metadata: Set of key-value pairs that can be attached to the vector + store + properties: + id: + title: Id + type: string + object: + default: vector_store + title: Object + type: string + created_at: + title: Created At + type: integer + name: + anyOf: + - type: string + - type: 'null' + title: Name + usage_bytes: + default: 0 + title: Usage Bytes + type: integer + file_counts: + $ref: '#/$defs/VectorStoreFileCounts' + status: + default: completed + title: Status + type: string + expires_after: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After + expires_at: + anyOf: + - type: integer + - type: 'null' + title: Expires At + last_active_at: + anyOf: + - type: integer + - type: 'null' + title: Last Active At + metadata: + additionalProperties: true + title: Metadata + type: object + required: + - id + - created_at + - file_counts + title: VectorStoreObject + type: object + description: >- + Response from listing vector stores. + + + :param object: Object type identifier, always "list" + + :param data: List of vector store objects + + :param first_id: (Optional) ID of the first vector store in the list for pagination + + :param last_id: (Optional) ID of the last vector store in the list for pagination + + :param has_more: Whether there are more vector stores available beyond this + page properties: object: - type: string default: list - description: Object type identifier, always "list" + title: Object + type: string data: - type: array items: - $ref: '#/components/schemas/VectorStoreObject' - description: List of vector store objects + $ref: '#/$defs/VectorStoreObject' + title: Data + type: array first_id: - type: string - description: >- - (Optional) ID of the first vector store in the list for pagination + anyOf: + - type: string + - type: 'null' + title: First Id last_id: - type: string - description: >- - (Optional) ID of the last vector store in the list for pagination + anyOf: + - type: string + - type: 'null' + title: Last Id has_more: - type: boolean default: false - description: >- - Whether there are more vector stores available beyond this page - additionalProperties: false + title: Has More + type: boolean required: - - object - data - - has_more title: VectorStoreListResponse - description: Response from listing vector stores. - VectorStoreObject: type: object + VectorStoreObject: + $defs: + VectorStoreFileCounts: + description: >- + File processing status counts for a vector store. + + + :param completed: Number of files that have been successfully processed + + :param cancelled: Number of files that had their processing cancelled + + :param failed: Number of files that failed to process + + :param in_progress: Number of files currently being processed + + :param total: Total number of files in the vector store + properties: + completed: + title: Completed + type: integer + cancelled: + title: Cancelled + type: integer + failed: + title: Failed + type: integer + in_progress: + title: In Progress + type: integer + total: + title: Total + type: integer + required: + - completed + - cancelled + - failed + - in_progress + - total + title: VectorStoreFileCounts + type: object + description: >- + OpenAI Vector Store object. + + + :param id: Unique identifier for the vector store + + :param object: Object type identifier, always "vector_store" + + :param created_at: Timestamp when the vector store was created + + :param name: (Optional) Name of the vector store + + :param usage_bytes: Storage space used by the vector store in bytes + + :param file_counts: File processing status counts for the vector store + + :param status: Current status of the vector store + + :param expires_after: (Optional) Expiration policy for the vector store + + :param expires_at: (Optional) Timestamp when the vector store will expire + + :param last_active_at: (Optional) Timestamp of last activity on the vector + store + + :param metadata: Set of key-value pairs that can be attached to the vector + store properties: id: + title: Id type: string - description: Unique identifier for the vector store object: - type: string default: vector_store - description: >- - Object type identifier, always "vector_store" + title: Object + type: string created_at: + title: Created At type: integer - description: >- - Timestamp when the vector store was created name: - type: string - description: (Optional) Name of the vector store + anyOf: + - type: string + - type: 'null' + title: Name usage_bytes: - type: integer default: 0 - description: >- - Storage space used by the vector store in bytes + title: Usage Bytes + type: integer file_counts: - $ref: '#/components/schemas/VectorStoreFileCounts' - description: >- - File processing status counts for the vector store + $ref: '#/$defs/VectorStoreFileCounts' status: - type: string default: completed - description: Current status of the vector store + title: Status + type: string expires_after: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Expiration policy for the vector store + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After expires_at: - type: integer - description: >- - (Optional) Timestamp when the vector store will expire + anyOf: + - type: integer + - type: 'null' + title: Expires At last_active_at: - type: integer - description: >- - (Optional) Timestamp of last activity on the vector store + anyOf: + - type: integer + - type: 'null' + title: Last Active At metadata: + additionalProperties: true + title: Metadata type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Set of key-value pairs that can be attached to the vector store - additionalProperties: false required: - id - - object - created_at - - usage_bytes - file_counts - - status - - metadata title: VectorStoreObject - description: OpenAI Vector Store object. - "OpenAICreateVectorStoreRequestWithExtraBody": type: object - properties: - name: - type: string - description: (Optional) A name for the vector store - file_ids: - type: array - items: - type: string - description: >- - List of file IDs to include in the vector store - expires_after: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Expiration policy for the vector store - chunking_strategy: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Strategy for splitting files into chunks - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Set of key-value pairs that can be attached to the vector store - additionalProperties: false - title: >- - OpenAICreateVectorStoreRequestWithExtraBody - description: >- - Request to create a vector store with extra_body support. OpenaiUpdateVectorStoreRequest: type: object - properties: - name: - type: string - description: The name of the vector store. - expires_after: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The expiration policy for a vector store. - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Set of 16 key-value pairs that can be attached to an object. - additionalProperties: false - title: OpenaiUpdateVectorStoreRequest VectorStoreDeleteResponse: - type: object + description: >- + Response from deleting a vector store. + + + :param id: Unique identifier of the deleted vector store + + :param object: Object type identifier for the deletion response + + :param deleted: Whether the deletion operation was successful properties: id: + title: Id type: string - description: >- - Unique identifier of the deleted vector store object: - type: string default: vector_store.deleted - description: >- - Object type identifier for the deletion response + title: Object + type: string deleted: - type: boolean default: true - description: >- - Whether the deletion operation was successful - additionalProperties: false - required: - - id - - object - - deleted - title: VectorStoreDeleteResponse - description: Response from deleting a vector store. - VectorStoreChunkingStrategy: - oneOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' - discriminator: - propertyName: type - mapping: - auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' - static: '#/components/schemas/VectorStoreChunkingStrategyStatic' - VectorStoreChunkingStrategyAuto: - type: object - properties: - type: - type: string - const: auto - default: auto - description: >- - Strategy type, always "auto" for automatic chunking - additionalProperties: false - required: - - type - title: VectorStoreChunkingStrategyAuto - description: >- - Automatic chunking strategy for vector store files. - VectorStoreChunkingStrategyStatic: - type: object - properties: - type: - type: string - const: static - default: static - description: >- - Strategy type, always "static" for static chunking - static: - $ref: '#/components/schemas/VectorStoreChunkingStrategyStaticConfig' - description: >- - Configuration parameters for the static chunking strategy - additionalProperties: false - required: - - type - - static - title: VectorStoreChunkingStrategyStatic - description: >- - Static chunking strategy with configurable parameters. - VectorStoreChunkingStrategyStaticConfig: - type: object - properties: - chunk_overlap_tokens: - type: integer - default: 400 - description: >- - Number of tokens to overlap between adjacent chunks - max_chunk_size_tokens: - type: integer - default: 800 - description: >- - Maximum number of tokens per chunk, must be between 100 and 4096 - additionalProperties: false - required: - - chunk_overlap_tokens - - max_chunk_size_tokens - title: VectorStoreChunkingStrategyStaticConfig - description: >- - Configuration for static chunking strategy. - "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": - type: object - properties: - file_ids: - type: array - items: - type: string - description: >- - A list of File IDs that the vector store should use - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Key-value attributes to store with the files - chunking_strategy: - $ref: '#/components/schemas/VectorStoreChunkingStrategy' - description: >- - (Optional) The chunking strategy used to chunk the file(s). Defaults to - auto - additionalProperties: false + title: Deleted + type: boolean required: - - file_ids - title: >- - OpenAICreateVectorStoreFileBatchRequestWithExtraBody - description: >- - Request to create a vector store file batch with extra_body support. - VectorStoreFileBatchObject: + - id + title: VectorStoreDeleteResponse type: object + VectorStoreFileBatchObject: + $defs: + VectorStoreFileCounts: + description: >- + File processing status counts for a vector store. + + + :param completed: Number of files that have been successfully processed + + :param cancelled: Number of files that had their processing cancelled + + :param failed: Number of files that failed to process + + :param in_progress: Number of files currently being processed + + :param total: Total number of files in the vector store + properties: + completed: + title: Completed + type: integer + cancelled: + title: Cancelled + type: integer + failed: + title: Failed + type: integer + in_progress: + title: In Progress + type: integer + total: + title: Total + type: integer + required: + - completed + - cancelled + - failed + - in_progress + - total + title: VectorStoreFileCounts + type: object + description: >- + OpenAI Vector Store File Batch object. + + + :param id: Unique identifier for the file batch + + :param object: Object type identifier, always "vector_store.file_batch" + + :param created_at: Timestamp when the file batch was created + + :param vector_store_id: ID of the vector store containing the file batch + + :param status: Current processing status of the file batch + + :param file_counts: File processing status counts for the batch properties: id: + title: Id type: string - description: Unique identifier for the file batch object: - type: string default: vector_store.file_batch - description: >- - Object type identifier, always "vector_store.file_batch" + title: Object + type: string created_at: + title: Created At type: integer - description: >- - Timestamp when the file batch was created vector_store_id: + title: Vector Store Id type: string - description: >- - ID of the vector store containing the file batch status: - $ref: '#/components/schemas/VectorStoreFileStatus' - description: >- - Current processing status of the file batch + anyOf: + - const: completed + type: string + - const: in_progress + type: string + - const: cancelled + type: string + - const: failed + type: string + title: Status file_counts: - $ref: '#/components/schemas/VectorStoreFileCounts' - description: >- - File processing status counts for the batch - additionalProperties: false + $ref: '#/$defs/VectorStoreFileCounts' required: - id - - object - created_at - vector_store_id - status - file_counts title: VectorStoreFileBatchObject - description: OpenAI Vector Store File Batch object. - VectorStoreFileStatus: - oneOf: - - type: string - const: completed - - type: string - const: in_progress - - type: string - const: cancelled - - type: string - const: failed - VectorStoreFileLastError: type: object + VectorStoreFilesListInBatchResponse: + $defs: + VectorStoreChunkingStrategyAuto: + description: >- + Automatic chunking strategy for vector store files. + + + :param type: Strategy type, always "auto" for automatic chunking + properties: + type: + const: auto + default: auto + title: Type + type: string + title: VectorStoreChunkingStrategyAuto + type: object + VectorStoreChunkingStrategyStatic: + description: >- + Static chunking strategy with configurable parameters. + + + :param type: Strategy type, always "static" for static chunking + + :param static: Configuration parameters for the static chunking strategy + properties: + type: + const: static + default: static + title: Type + type: string + static: + $ref: >- + #/$defs/VectorStoreChunkingStrategyStaticConfig + required: + - static + title: VectorStoreChunkingStrategyStatic + type: object + VectorStoreChunkingStrategyStaticConfig: + description: >- + Configuration for static chunking strategy. + + + :param chunk_overlap_tokens: Number of tokens to overlap between adjacent + chunks + + :param max_chunk_size_tokens: Maximum number of tokens per chunk, must + be between 100 and 4096 + properties: + chunk_overlap_tokens: + default: 400 + title: Chunk Overlap Tokens + type: integer + max_chunk_size_tokens: + default: 800 + maximum: 4096 + minimum: 100 + title: Max Chunk Size Tokens + type: integer + title: VectorStoreChunkingStrategyStaticConfig + type: object + VectorStoreFileLastError: + description: >- + Error information for failed vector store file processing. + + + :param code: Error code indicating the type of failure + + :param message: Human-readable error message describing the failure + properties: + code: + anyOf: + - const: server_error + type: string + - const: rate_limit_exceeded + type: string + title: Code + message: + title: Message + type: string + required: + - code + - message + title: VectorStoreFileLastError + type: object + VectorStoreFileObject: + description: >- + OpenAI Vector Store File object. + + + :param id: Unique identifier for the file + + :param object: Object type identifier, always "vector_store.file" + + :param attributes: Key-value attributes associated with the file + + :param chunking_strategy: Strategy used for splitting the file into chunks + + :param created_at: Timestamp when the file was added to the vector store + + :param last_error: (Optional) Error information if file processing failed + + :param status: Current processing status of the file + + :param usage_bytes: Storage space used by this file in bytes + + :param vector_store_id: ID of the vector store containing this file + properties: + id: + title: Id + type: string + object: + default: vector_store.file + title: Object + type: string + attributes: + additionalProperties: true + title: Attributes + type: object + chunking_strategy: + discriminator: + mapping: + auto: '#/$defs/VectorStoreChunkingStrategyAuto' + static: >- + #/$defs/VectorStoreChunkingStrategyStatic + propertyName: type + oneOf: + - $ref: '#/$defs/VectorStoreChunkingStrategyAuto' + - $ref: >- + #/$defs/VectorStoreChunkingStrategyStatic + title: Chunking Strategy + created_at: + title: Created At + type: integer + last_error: + anyOf: + - $ref: '#/$defs/VectorStoreFileLastError' + - type: 'null' + status: + anyOf: + - const: completed + type: string + - const: in_progress + type: string + - const: cancelled + type: string + - const: failed + type: string + title: Status + usage_bytes: + default: 0 + title: Usage Bytes + type: integer + vector_store_id: + title: Vector Store Id + type: string + required: + - id + - chunking_strategy + - created_at + - status + - vector_store_id + title: VectorStoreFileObject + type: object + description: >- + Response from listing files in a vector store file batch. + + + :param object: Object type identifier, always "list" + + :param data: List of vector store file objects in the batch + + :param first_id: (Optional) ID of the first file in the list for pagination + + :param last_id: (Optional) ID of the last file in the list for pagination + + :param has_more: Whether there are more files available beyond this page properties: - code: - oneOf: + object: + default: list + title: Object + type: string + data: + items: + $ref: '#/$defs/VectorStoreFileObject' + title: Data + type: array + first_id: + anyOf: - type: string - const: server_error + - type: 'null' + title: First Id + last_id: + anyOf: - type: string - const: rate_limit_exceeded + - type: 'null' + title: Last Id + has_more: + default: false + title: Has More + type: boolean + required: + - data + title: VectorStoreFilesListInBatchResponse + type: object + Union: + type: object + nullable: true + VectorStoreListFilesResponse: + $defs: + VectorStoreChunkingStrategyAuto: description: >- - Error code indicating the type of failure - message: + Automatic chunking strategy for vector store files. + + + :param type: Strategy type, always "auto" for automatic chunking + properties: + type: + const: auto + default: auto + title: Type + type: string + title: VectorStoreChunkingStrategyAuto + type: object + VectorStoreChunkingStrategyStatic: + description: >- + Static chunking strategy with configurable parameters. + + + :param type: Strategy type, always "static" for static chunking + + :param static: Configuration parameters for the static chunking strategy + properties: + type: + const: static + default: static + title: Type + type: string + static: + $ref: >- + #/$defs/VectorStoreChunkingStrategyStaticConfig + required: + - static + title: VectorStoreChunkingStrategyStatic + type: object + VectorStoreChunkingStrategyStaticConfig: + description: >- + Configuration for static chunking strategy. + + + :param chunk_overlap_tokens: Number of tokens to overlap between adjacent + chunks + + :param max_chunk_size_tokens: Maximum number of tokens per chunk, must + be between 100 and 4096 + properties: + chunk_overlap_tokens: + default: 400 + title: Chunk Overlap Tokens + type: integer + max_chunk_size_tokens: + default: 800 + maximum: 4096 + minimum: 100 + title: Max Chunk Size Tokens + type: integer + title: VectorStoreChunkingStrategyStaticConfig + type: object + VectorStoreFileLastError: + description: >- + Error information for failed vector store file processing. + + + :param code: Error code indicating the type of failure + + :param message: Human-readable error message describing the failure + properties: + code: + anyOf: + - const: server_error + type: string + - const: rate_limit_exceeded + type: string + title: Code + message: + title: Message + type: string + required: + - code + - message + title: VectorStoreFileLastError + type: object + VectorStoreFileObject: + description: >- + OpenAI Vector Store File object. + + + :param id: Unique identifier for the file + + :param object: Object type identifier, always "vector_store.file" + + :param attributes: Key-value attributes associated with the file + + :param chunking_strategy: Strategy used for splitting the file into chunks + + :param created_at: Timestamp when the file was added to the vector store + + :param last_error: (Optional) Error information if file processing failed + + :param status: Current processing status of the file + + :param usage_bytes: Storage space used by this file in bytes + + :param vector_store_id: ID of the vector store containing this file + properties: + id: + title: Id + type: string + object: + default: vector_store.file + title: Object + type: string + attributes: + additionalProperties: true + title: Attributes + type: object + chunking_strategy: + discriminator: + mapping: + auto: '#/$defs/VectorStoreChunkingStrategyAuto' + static: >- + #/$defs/VectorStoreChunkingStrategyStatic + propertyName: type + oneOf: + - $ref: '#/$defs/VectorStoreChunkingStrategyAuto' + - $ref: >- + #/$defs/VectorStoreChunkingStrategyStatic + title: Chunking Strategy + created_at: + title: Created At + type: integer + last_error: + anyOf: + - $ref: '#/$defs/VectorStoreFileLastError' + - type: 'null' + status: + anyOf: + - const: completed + type: string + - const: in_progress + type: string + - const: cancelled + type: string + - const: failed + type: string + title: Status + usage_bytes: + default: 0 + title: Usage Bytes + type: integer + vector_store_id: + title: Vector Store Id + type: string + required: + - id + - chunking_strategy + - created_at + - status + - vector_store_id + title: VectorStoreFileObject + type: object + description: >- + Response from listing files in a vector store. + + + :param object: Object type identifier, always "list" + + :param data: List of vector store file objects + + :param first_id: (Optional) ID of the first file in the list for pagination + + :param last_id: (Optional) ID of the last file in the list for pagination + + :param has_more: Whether there are more files available beyond this page + properties: + object: + default: list + title: Object type: string + data: + items: + $ref: '#/$defs/VectorStoreFileObject' + title: Data + type: array + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + has_more: + default: false + title: Has More + type: boolean + required: + - data + title: VectorStoreListFilesResponse + type: object + OpenaiAttachFileToVectorStoreRequest: + type: object + VectorStoreFileObject: + $defs: + VectorStoreChunkingStrategyAuto: + description: >- + Automatic chunking strategy for vector store files. + + + :param type: Strategy type, always "auto" for automatic chunking + properties: + type: + const: auto + default: auto + title: Type + type: string + title: VectorStoreChunkingStrategyAuto + type: object + VectorStoreChunkingStrategyStatic: + description: >- + Static chunking strategy with configurable parameters. + + + :param type: Strategy type, always "static" for static chunking + + :param static: Configuration parameters for the static chunking strategy + properties: + type: + const: static + default: static + title: Type + type: string + static: + $ref: >- + #/$defs/VectorStoreChunkingStrategyStaticConfig + required: + - static + title: VectorStoreChunkingStrategyStatic + type: object + VectorStoreChunkingStrategyStaticConfig: + description: >- + Configuration for static chunking strategy. + + + :param chunk_overlap_tokens: Number of tokens to overlap between adjacent + chunks + + :param max_chunk_size_tokens: Maximum number of tokens per chunk, must + be between 100 and 4096 + properties: + chunk_overlap_tokens: + default: 400 + title: Chunk Overlap Tokens + type: integer + max_chunk_size_tokens: + default: 800 + maximum: 4096 + minimum: 100 + title: Max Chunk Size Tokens + type: integer + title: VectorStoreChunkingStrategyStaticConfig + type: object + VectorStoreFileLastError: description: >- - Human-readable error message describing the failure - additionalProperties: false - required: - - code - - message - title: VectorStoreFileLastError + Error information for failed vector store file processing. + + + :param code: Error code indicating the type of failure + + :param message: Human-readable error message describing the failure + properties: + code: + anyOf: + - const: server_error + type: string + - const: rate_limit_exceeded + type: string + title: Code + message: + title: Message + type: string + required: + - code + - message + title: VectorStoreFileLastError + type: object description: >- - Error information for failed vector store file processing. - VectorStoreFileObject: - type: object + OpenAI Vector Store File object. + + + :param id: Unique identifier for the file + + :param object: Object type identifier, always "vector_store.file" + + :param attributes: Key-value attributes associated with the file + + :param chunking_strategy: Strategy used for splitting the file into chunks + + :param created_at: Timestamp when the file was added to the vector store + + :param last_error: (Optional) Error information if file processing failed + + :param status: Current processing status of the file + + :param usage_bytes: Storage space used by this file in bytes + + :param vector_store_id: ID of the vector store containing this file properties: id: + title: Id type: string - description: Unique identifier for the file object: - type: string default: vector_store.file - description: >- - Object type identifier, always "vector_store.file" + title: Object + type: string attributes: + additionalProperties: true + title: Attributes type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Key-value attributes associated with the file chunking_strategy: - oneOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' discriminator: - propertyName: type mapping: - auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' - static: '#/components/schemas/VectorStoreChunkingStrategyStatic' - description: >- - Strategy used for splitting the file into chunks + auto: '#/$defs/VectorStoreChunkingStrategyAuto' + static: >- + #/$defs/VectorStoreChunkingStrategyStatic + propertyName: type + oneOf: + - $ref: '#/$defs/VectorStoreChunkingStrategyAuto' + - $ref: >- + #/$defs/VectorStoreChunkingStrategyStatic + title: Chunking Strategy created_at: + title: Created At type: integer - description: >- - Timestamp when the file was added to the vector store last_error: - $ref: '#/components/schemas/VectorStoreFileLastError' - description: >- - (Optional) Error information if file processing failed + anyOf: + - $ref: '#/$defs/VectorStoreFileLastError' + - type: 'null' status: - $ref: '#/components/schemas/VectorStoreFileStatus' - description: Current processing status of the file + anyOf: + - const: completed + type: string + - const: in_progress + type: string + - const: cancelled + type: string + - const: failed + type: string + title: Status usage_bytes: - type: integer default: 0 - description: Storage space used by this file in bytes + title: Usage Bytes + type: integer vector_store_id: + title: Vector Store Id type: string - description: >- - ID of the vector store containing this file - additionalProperties: false required: - id - - object - - attributes - chunking_strategy - created_at - status - - usage_bytes - vector_store_id title: VectorStoreFileObject - description: OpenAI Vector Store File object. - VectorStoreFilesListInBatchResponse: - type: object - properties: - object: - type: string - default: list - description: Object type identifier, always "list" - data: - type: array - items: - $ref: '#/components/schemas/VectorStoreFileObject' - description: >- - List of vector store file objects in the batch - first_id: - type: string - description: >- - (Optional) ID of the first file in the list for pagination - last_id: - type: string - description: >- - (Optional) ID of the last file in the list for pagination - has_more: - type: boolean - default: false - description: >- - Whether there are more files available beyond this page - additionalProperties: false - required: - - object - - data - - has_more - title: VectorStoreFilesListInBatchResponse - description: >- - Response from listing files in a vector store file batch. - VectorStoreListFilesResponse: - type: object - properties: - object: - type: string - default: list - description: Object type identifier, always "list" - data: - type: array - items: - $ref: '#/components/schemas/VectorStoreFileObject' - description: List of vector store file objects - first_id: - type: string - description: >- - (Optional) ID of the first file in the list for pagination - last_id: - type: string - description: >- - (Optional) ID of the last file in the list for pagination - has_more: - type: boolean - default: false - description: >- - Whether there are more files available beyond this page - additionalProperties: false - required: - - object - - data - - has_more - title: VectorStoreListFilesResponse - description: >- - Response from listing files in a vector store. - OpenaiAttachFileToVectorStoreRequest: type: object - properties: - file_id: - type: string - description: >- - The ID of the file to attach to the vector store. - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The key-value attributes stored with the file, which can be used for filtering. - chunking_strategy: - $ref: '#/components/schemas/VectorStoreChunkingStrategy' - description: >- - The chunking strategy to use for the file. - additionalProperties: false - required: - - file_id - title: OpenaiAttachFileToVectorStoreRequest OpenaiUpdateVectorStoreFileRequest: type: object - properties: - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The updated key-value attributes to store with the file. - additionalProperties: false - required: - - attributes - title: OpenaiUpdateVectorStoreFileRequest VectorStoreFileDeleteResponse: - type: object + description: >- + Response from deleting a vector store file. + + + :param id: Unique identifier of the deleted file + + :param object: Object type identifier for the deletion response + + :param deleted: Whether the deletion operation was successful properties: id: + title: Id type: string - description: Unique identifier of the deleted file object: - type: string default: vector_store.file.deleted - description: >- - Object type identifier for the deletion response + title: Object + type: string deleted: - type: boolean default: true - description: >- - Whether the deletion operation was successful - additionalProperties: false + title: Deleted + type: boolean required: - id - - object - - deleted title: VectorStoreFileDeleteResponse - description: >- - Response from deleting a vector store file. - VectorStoreContent: type: object - properties: - type: - type: string - const: text - description: >- - Content type, currently only "text" is supported - text: - type: string - description: The actual text content - additionalProperties: false - required: - - type - - text - title: VectorStoreContent - description: >- - Content item from a vector store file or search result. VectorStoreFileContentsResponse: - type: object - properties: - file_id: - type: string - description: Unique identifier for the file - filename: - type: string - description: Name of the file - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Key-value attributes associated with the file - content: - type: array - items: - $ref: '#/components/schemas/VectorStoreContent' - description: List of content items from the file - additionalProperties: false - required: - - file_id - - filename - - attributes - - content - title: VectorStoreFileContentsResponse - description: >- - Response from retrieving the contents of a vector store file. - OpenaiSearchVectorStoreRequest: - type: object - properties: - query: - oneOf: - - type: string - - type: array - items: - type: string - description: >- - The query string or array for performing the search. - filters: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + $defs: + VectorStoreContent: description: >- - Filters based on file attributes to narrow the search results. - max_num_results: - type: integer - description: >- - Maximum number of results to return (1 to 50 inclusive, default 10). - ranking_options: - type: object + Content item from a vector store file or search result. + + + :param type: Content type, currently only "text" is supported + + :param text: The actual text content properties: - ranker: + type: + const: text + title: Type type: string - description: >- - (Optional) Name of the ranking algorithm to use - score_threshold: - type: number - default: 0.0 - description: >- - (Optional) Minimum relevance score threshold for results - additionalProperties: false - description: >- - Ranking options for fine-tuning the search results. - rewrite_query: - type: boolean - description: >- - Whether to rewrite the natural language query for vector search (default - false) - search_mode: - type: string - description: >- - The search mode to use - "keyword", "vector", or "hybrid" (default "vector") - additionalProperties: false - required: - - query - title: OpenaiSearchVectorStoreRequest - VectorStoreSearchResponse: - type: object + text: + title: Text + type: string + required: + - type + - text + title: VectorStoreContent + type: object + description: >- + Response from retrieving the contents of a vector store file. + + + :param file_id: Unique identifier for the file + + :param filename: Name of the file + + :param attributes: Key-value attributes associated with the file + + :param content: List of content items from the file properties: file_id: + title: File Id type: string - description: >- - Unique identifier of the file containing the result filename: + title: Filename type: string - description: Name of the file containing the result - score: - type: number - description: Relevance score for this search result attributes: + additionalProperties: true + title: Attributes type: object - additionalProperties: - oneOf: - - type: string - - type: number - - type: boolean - description: >- - (Optional) Key-value attributes associated with the file content: - type: array items: - $ref: '#/components/schemas/VectorStoreContent' - description: >- - List of content items matching the search query - additionalProperties: false + $ref: '#/$defs/VectorStoreContent' + title: Content + type: array required: - file_id - filename - - score + - attributes - content - title: VectorStoreSearchResponse - description: Response from searching a vector store. - VectorStoreSearchResponsePage: + title: VectorStoreFileContentsResponse type: object + OpenaiSearchVectorStoreRequest: + type: object + VectorStoreSearchResponsePage: + $defs: + VectorStoreContent: + description: >- + Content item from a vector store file or search result. + + + :param type: Content type, currently only "text" is supported + + :param text: The actual text content + properties: + type: + const: text + title: Type + type: string + text: + title: Text + type: string + required: + - type + - text + title: VectorStoreContent + type: object + VectorStoreSearchResponse: + description: >- + Response from searching a vector store. + + + :param file_id: Unique identifier of the file containing the result + + :param filename: Name of the file containing the result + + :param score: Relevance score for this search result + + :param attributes: (Optional) Key-value attributes associated with the + file + + :param content: List of content items matching the search query + properties: + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + score: + title: Score + type: number + attributes: + anyOf: + - additionalProperties: + anyOf: + - type: string + - type: number + - type: boolean + type: object + - type: 'null' + title: Attributes + content: + items: + $ref: '#/$defs/VectorStoreContent' + title: Content + type: array + required: + - file_id + - filename + - score + - content + title: VectorStoreSearchResponse + type: object + description: >- + Paginated response from searching a vector store. + + + :param object: Object type identifier for the search results page + + :param search_query: The original search query that was executed + + :param data: List of search result objects + + :param has_more: Whether there are more results available beyond this page + + :param next_page: (Optional) Token for retrieving the next page of results properties: object: - type: string default: vector_store.search_results.page - description: >- - Object type identifier for the search results page + title: Object + type: string search_query: + title: Search Query type: string - description: >- - The original search query that was executed data: - type: array items: - $ref: '#/components/schemas/VectorStoreSearchResponse' - description: List of search result objects + $ref: '#/$defs/VectorStoreSearchResponse' + title: Data + type: array has_more: - type: boolean default: false - description: >- - Whether there are more results available beyond this page + title: Has More + type: boolean next_page: - type: string - description: >- - (Optional) Token for retrieving the next page of results - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: Next Page required: - - object - search_query - data - - has_more title: VectorStoreSearchResponsePage - description: >- - Paginated response from searching a vector store. - VersionInfo: type: object + VersionInfo: + description: >- + Version information for the service. + + + :param version: Version number of the service properties: version: + title: Version type: string - description: Version number of the service - additionalProperties: false required: - version title: VersionInfo - description: Version information for the service. + type: object AppendRowsRequest: type: object - properties: - rows: - type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The rows to append to the dataset. - additionalProperties: false - required: - - rows - title: AppendRowsRequest PaginatedResponse: - type: object + description: >- + A generic paginated response that follows a simple format. + + + :param data: The list of items for the current page + + :param has_more: Whether there are more items available after this set + + :param url: The URL for accessing this list properties: data: - type: array items: + additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The list of items for the current page + title: Data + type: array has_more: + title: Has More type: boolean - description: >- - Whether there are more items available after this set url: - type: string - description: The URL for accessing this list - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: Url required: - data - has_more title: PaginatedResponse - description: >- - A generic paginated response that follows a simple format. - Dataset: type: object - properties: - identifier: - type: string - provider_resource_id: - type: string - provider_id: - type: string - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: dataset - default: dataset + ListDatasetsResponse: + $defs: + Dataset: description: >- - Type of resource, always 'dataset' for datasets - purpose: - type: string + Dataset resource for storing and accessing training or evaluation data. + + + :param type: Type of resource, always 'dataset' for datasets + properties: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: dataset + default: dataset + title: Type + type: string + purpose: + $ref: '#/$defs/DatasetPurpose' + source: + discriminator: + mapping: + rows: '#/$defs/RowsDataSource' + uri: '#/$defs/URIDataSource' + propertyName: type + oneOf: + - $ref: '#/$defs/URIDataSource' + - $ref: '#/$defs/RowsDataSource' + title: Source + metadata: + additionalProperties: true + description: Any additional metadata for this dataset + title: Metadata + type: object + required: + - identifier + - provider_id + - purpose + - source + title: Dataset + type: object + DatasetPurpose: + description: >- + Purpose of the dataset. Each purpose has a required input data schema. + + + :cvar post-training/messages: The dataset contains messages used for post-training. + { + "messages": [ + {"role": "user", "content": "Hello, world!"}, + {"role": "assistant", "content": "Hello, world!"}, + ] + } + :cvar eval/question-answer: The dataset contains a question column and + an answer column. + { + "question": "What is the capital of France?", + "answer": "Paris" + } + :cvar eval/messages-answer: The dataset contains a messages column with + list of messages and an answer column. + { + "messages": [ + {"role": "user", "content": "Hello, my name is John Doe."}, + {"role": "assistant", "content": "Hello, John Doe. How can + I help you today?"}, + {"role": "user", "content": "What's my name?"}, + ], + "answer": "John Doe" + } enum: - post-training/messages - eval/question-answer - eval/messages-answer - description: >- - Purpose of the dataset indicating its intended use - source: - oneOf: - - $ref: '#/components/schemas/URIDataSource' - - $ref: '#/components/schemas/RowsDataSource' - discriminator: - propertyName: type - mapping: - uri: '#/components/schemas/URIDataSource' - rows: '#/components/schemas/RowsDataSource' - description: >- - Data source configuration for the dataset - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Additional metadata for the dataset - additionalProperties: false - required: - - identifier - - provider_id - - type - - purpose - - source - - metadata - title: Dataset - description: >- - Dataset resource for storing and accessing training or evaluation data. - RowsDataSource: - type: object - properties: - type: + title: DatasetPurpose type: string - const: rows - default: rows - rows: - type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + RowsDataSource: description: >- - The dataset is stored in rows. E.g. - [ {"messages": [{"role": "user", - "content": "Hello, world!"}, {"role": "assistant", "content": "Hello, - world!"}]} ] - additionalProperties: false - required: - - type - - rows - title: RowsDataSource - description: A dataset stored in rows. - URIDataSource: - type: object - properties: - type: - type: string - const: uri - default: uri - uri: - type: string + A dataset stored in rows. + + :param rows: The dataset is stored in rows. E.g. + - [ + {"messages": [{"role": "user", "content": "Hello, world!"}, {"role": + "assistant", "content": "Hello, world!"}]} + ] + properties: + type: + const: rows + default: rows + title: Type + type: string + rows: + items: + additionalProperties: true + type: object + title: Rows + type: array + required: + - rows + title: RowsDataSource + type: object + URIDataSource: description: >- - The dataset can be obtained from a URI. E.g. - "https://mywebsite.com/mydata.jsonl" - - "lsfs://mydata.jsonl" - "data:csv;base64,{base64_content}" - additionalProperties: false - required: - - type - - uri - title: URIDataSource + A dataset that can be obtained from a URI. + + :param uri: The dataset can be obtained from a URI. E.g. + - "https://mywebsite.com/mydata.jsonl" + - "lsfs://mydata.jsonl" + - "data:csv;base64,{base64_content}" + properties: + type: + const: uri + default: uri + title: Type + type: string + uri: + title: Uri + type: string + required: + - uri + title: URIDataSource + type: object description: >- - A dataset that can be obtained from a URI. - ListDatasetsResponse: - type: object + Response from listing datasets. + + + :param data: List of datasets properties: data: - type: array items: - $ref: '#/components/schemas/Dataset' - description: List of datasets - additionalProperties: false + $ref: '#/$defs/Dataset' + title: Data + type: array required: - data title: ListDatasetsResponse - description: Response from listing datasets. - DataSource: - oneOf: - - $ref: '#/components/schemas/URIDataSource' - - $ref: '#/components/schemas/RowsDataSource' - discriminator: - propertyName: type - mapping: - uri: '#/components/schemas/URIDataSource' - rows: '#/components/schemas/RowsDataSource' + type: object RegisterDatasetRequest: type: object + Dataset: + $defs: + DatasetPurpose: + description: >- + Purpose of the dataset. Each purpose has a required input data schema. + + + :cvar post-training/messages: The dataset contains messages used for post-training. + { + "messages": [ + {"role": "user", "content": "Hello, world!"}, + {"role": "assistant", "content": "Hello, world!"}, + ] + } + :cvar eval/question-answer: The dataset contains a question column and + an answer column. + { + "question": "What is the capital of France?", + "answer": "Paris" + } + :cvar eval/messages-answer: The dataset contains a messages column with + list of messages and an answer column. + { + "messages": [ + {"role": "user", "content": "Hello, my name is John Doe."}, + {"role": "assistant", "content": "Hello, John Doe. How can + I help you today?"}, + {"role": "user", "content": "What's my name?"}, + ], + "answer": "John Doe" + } + enum: + - post-training/messages + - eval/question-answer + - eval/messages-answer + title: DatasetPurpose + type: string + RowsDataSource: + description: >- + A dataset stored in rows. + + :param rows: The dataset is stored in rows. E.g. + - [ + {"messages": [{"role": "user", "content": "Hello, world!"}, {"role": + "assistant", "content": "Hello, world!"}]} + ] + properties: + type: + const: rows + default: rows + title: Type + type: string + rows: + items: + additionalProperties: true + type: object + title: Rows + type: array + required: + - rows + title: RowsDataSource + type: object + URIDataSource: + description: >- + A dataset that can be obtained from a URI. + + :param uri: The dataset can be obtained from a URI. E.g. + - "https://mywebsite.com/mydata.jsonl" + - "lsfs://mydata.jsonl" + - "data:csv;base64,{base64_content}" + properties: + type: + const: uri + default: uri + title: Type + type: string + uri: + title: Uri + type: string + required: + - uri + title: URIDataSource + type: object + description: >- + Dataset resource for storing and accessing training or evaluation data. + + + :param type: Type of resource, always 'dataset' for datasets properties: - purpose: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier type: string - enum: - - post-training/messages - - eval/question-answer - - eval/messages-answer + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: description: >- - The purpose of the dataset. One of: - "post-training/messages": The dataset - contains a messages column with list of messages for post-training. { - "messages": [ {"role": "user", "content": "Hello, world!"}, {"role": "assistant", - "content": "Hello, world!"}, ] } - "eval/question-answer": The dataset - contains a question column and an answer column for evaluation. { "question": - "What is the capital of France?", "answer": "Paris" } - "eval/messages-answer": - The dataset contains a messages column with list of messages and an answer - column for evaluation. { "messages": [ {"role": "user", "content": "Hello, - my name is John Doe."}, {"role": "assistant", "content": "Hello, John - Doe. How can I help you today?"}, {"role": "user", "content": "What's - my name?"}, ], "answer": "John Doe" } + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: dataset + default: dataset + title: Type + type: string + purpose: + $ref: '#/$defs/DatasetPurpose' source: - $ref: '#/components/schemas/DataSource' - description: >- - The data source of the dataset. Ensure that the data source schema is - compatible with the purpose of the dataset. Examples: - { "type": "uri", - "uri": "https://mywebsite.com/mydata.jsonl" } - { "type": "uri", "uri": - "lsfs://mydata.jsonl" } - { "type": "uri", "uri": "data:csv;base64,{base64_content}" - } - { "type": "uri", "uri": "huggingface://llamastack/simpleqa?split=train" - } - { "type": "rows", "rows": [ { "messages": [ {"role": "user", "content": - "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}, ] - } ] } + discriminator: + mapping: + rows: '#/$defs/RowsDataSource' + uri: '#/$defs/URIDataSource' + propertyName: type + oneOf: + - $ref: '#/$defs/URIDataSource' + - $ref: '#/$defs/RowsDataSource' + title: Source metadata: + additionalProperties: true + description: Any additional metadata for this dataset + title: Metadata type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The metadata for the dataset. - E.g. {"description": "My dataset"}. - dataset_id: - type: string - description: >- - The ID of the dataset. If not provided, an ID will be generated. - additionalProperties: false required: + - identifier + - provider_id - purpose - source - title: RegisterDatasetRequest - AgentConfig: + title: Dataset type: object + CreateAgentRequest: + type: object + AgentCreateResponse: + description: >- + Response returned when creating a new agent. + + + :param agent_id: Unique identifier for the created agent properties: - sampling_params: - $ref: '#/components/schemas/SamplingParams' - input_shields: - type: array - items: - type: string - output_shields: - type: array - items: - type: string - toolgroups: - type: array - items: - $ref: '#/components/schemas/AgentTool' - client_tools: - type: array - items: - $ref: '#/components/schemas/ToolDef' - tool_choice: - type: string - enum: - - auto - - required - - none - title: ToolChoice - description: >- - Whether tool use is required or automatic. This is a hint to the model - which may not be followed. It depends on the Instruction Following capabilities - of the model. - deprecated: true - tool_prompt_format: - type: string - enum: - - json - - function_tag - - python_list - title: ToolPromptFormat - description: >- - Prompt format for calling custom / zero shot tools. - deprecated: true - tool_config: - $ref: '#/components/schemas/ToolConfig' - max_infer_iters: - type: integer - default: 10 - model: - type: string - description: >- - The model identifier to use for the agent - instructions: - type: string - description: The system instructions for the agent - name: + agent_id: + title: Agent Id type: string - description: >- - Optional name for the agent, used in telemetry and identification - enable_session_persistence: - type: boolean - default: false - description: >- - Optional flag indicating whether session data has to be persisted - response_format: - $ref: '#/components/schemas/ResponseFormat' - description: Optional response format configuration - additionalProperties: false required: - - model - - instructions - title: AgentConfig - description: Configuration for an agent. - AgentTool: - oneOf: - - type: string - - type: object + - agent_id + title: AgentCreateResponse + type: object + Agent: + $defs: + AgentConfig: + description: >- + Configuration for an agent. + + + :param model: The model identifier to use for the agent + + :param instructions: The system instructions for the agent + + :param name: Optional name for the agent, used in telemetry and identification + + :param enable_session_persistence: Optional flag indicating whether session + data has to be persisted + + :param response_format: Optional response format configuration + properties: + sampling_params: + anyOf: + - $ref: '#/$defs/SamplingParams' + - type: 'null' + input_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Input Shields + output_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields + toolgroups: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/$defs/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups + client_tools: + anyOf: + - items: + $ref: '#/$defs/ToolDef' + type: array + - type: 'null' + title: Client Tools + tool_choice: + anyOf: + - $ref: '#/$defs/ToolChoice' + - type: 'null' + deprecated: true + tool_prompt_format: + anyOf: + - $ref: '#/$defs/ToolPromptFormat' + - type: 'null' + deprecated: true + tool_config: + anyOf: + - $ref: '#/$defs/ToolConfig' + - type: 'null' + max_infer_iters: + anyOf: + - type: integer + - type: 'null' + default: 10 + title: Max Infer Iters + model: + title: Model + type: string + instructions: + title: Instructions + type: string + name: + anyOf: + - type: string + - type: 'null' + title: Name + enable_session_persistence: + anyOf: + - type: boolean + - type: 'null' + default: false + title: Enable Session Persistence + response_format: + anyOf: + - discriminator: + mapping: + grammar: '#/$defs/GrammarResponseFormat' + json_schema: '#/$defs/JsonSchemaResponseFormat' + propertyName: type + oneOf: + - $ref: '#/$defs/JsonSchemaResponseFormat' + - $ref: '#/$defs/GrammarResponseFormat' + - type: 'null' + title: Response Format + required: + - model + - instructions + title: AgentConfig + type: object + AgentToolGroupWithArgs: properties: name: + title: Name type: string args: + additionalProperties: true + title: Args type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - additionalProperties: false required: - name - args title: AgentToolGroupWithArgs - GrammarResponseFormat: - type: object - properties: - type: - type: string - enum: - - json_schema - - grammar - description: >- - Must be "grammar" to identify this format type - const: grammar - default: grammar - bnf: type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The BNF grammar specification the response should conform to - additionalProperties: false - required: - - type - - bnf - title: GrammarResponseFormat - description: >- - Configuration for grammar-guided response generation. - GreedySamplingStrategy: - type: object - properties: - type: - type: string - const: greedy - default: greedy - description: >- - Must be "greedy" to identify this sampling strategy - additionalProperties: false - required: - - type - title: GreedySamplingStrategy - description: >- - Greedy sampling strategy that selects the highest probability token at each - step. - JsonSchemaResponseFormat: - type: object - properties: - type: - type: string - enum: - - json_schema - - grammar + GrammarResponseFormat: description: >- - Must be "json_schema" to identify this format type - const: json_schema - default: json_schema - json_schema: + Configuration for grammar-guided response generation. + + + :param type: Must be "grammar" to identify this format type + + :param bnf: The BNF grammar specification the response should conform + to + properties: + type: + const: grammar + default: grammar + title: Type + type: string + bnf: + additionalProperties: true + title: Bnf + type: object + required: + - bnf + title: GrammarResponseFormat type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The JSON schema the response should conform to. In a Python SDK, this - is often a `pydantic` model. - additionalProperties: false - required: - - type - - json_schema - title: JsonSchemaResponseFormat - description: >- - Configuration for JSON schema-guided response generation. - ResponseFormat: - oneOf: - - $ref: '#/components/schemas/JsonSchemaResponseFormat' - - $ref: '#/components/schemas/GrammarResponseFormat' - discriminator: - propertyName: type - mapping: - json_schema: '#/components/schemas/JsonSchemaResponseFormat' - grammar: '#/components/schemas/GrammarResponseFormat' - SamplingParams: - type: object - properties: - strategy: - oneOf: - - $ref: '#/components/schemas/GreedySamplingStrategy' - - $ref: '#/components/schemas/TopPSamplingStrategy' - - $ref: '#/components/schemas/TopKSamplingStrategy' - discriminator: - propertyName: type - mapping: - greedy: '#/components/schemas/GreedySamplingStrategy' - top_p: '#/components/schemas/TopPSamplingStrategy' - top_k: '#/components/schemas/TopKSamplingStrategy' - description: The sampling strategy. - max_tokens: - type: integer - description: >- - The maximum number of tokens that can be generated in the completion. - The token count of your prompt plus max_tokens cannot exceed the model's - context length. - repetition_penalty: - type: number - default: 1.0 + GreedySamplingStrategy: description: >- - Number between -2.0 and 2.0. Positive values penalize new tokens based - on whether they appear in the text so far, increasing the model's likelihood - to talk about new topics. - stop: - type: array - items: - type: string + Greedy sampling strategy that selects the highest probability token at + each step. + + + :param type: Must be "greedy" to identify this sampling strategy + properties: + type: + const: greedy + default: greedy + title: Type + type: string + title: GreedySamplingStrategy + type: object + JsonSchemaResponseFormat: description: >- - Up to 4 sequences where the API will stop generating further tokens. The - returned text will not contain the stop sequence. - additionalProperties: false - required: - - strategy - title: SamplingParams - description: Sampling parameters. - ToolConfig: - type: object - properties: - tool_choice: - oneOf: - - type: string - enum: - - auto - - required - - none - title: ToolChoice - description: >- - Whether tool use is required or automatic. This is a hint to the model - which may not be followed. It depends on the Instruction Following - capabilities of the model. - - type: string - default: auto + Configuration for JSON schema-guided response generation. + + + :param type: Must be "json_schema" to identify this format type + + :param json_schema: The JSON schema the response should conform to. In + a Python SDK, this is often a `pydantic` model. + properties: + type: + const: json_schema + default: json_schema + title: Type + type: string + json_schema: + additionalProperties: true + title: Json Schema + type: object + required: + - json_schema + title: JsonSchemaResponseFormat + type: object + SamplingParams: description: >- - (Optional) Whether tool use is automatic, required, or none. Can also - specify a tool name to use a specific tool. Defaults to ToolChoice.auto. - tool_prompt_format: - type: string - enum: - - json - - function_tag - - python_list + Sampling parameters. + + + :param strategy: The sampling strategy. + + :param max_tokens: The maximum number of tokens that can be generated + in the completion. The token count of + your prompt plus max_tokens cannot exceed the model's context length. + :param repetition_penalty: Number between -2.0 and 2.0. Positive values + penalize new tokens + based on whether they appear in the text so far, increasing the model's + likelihood to talk about new topics. + :param stop: Up to 4 sequences where the API will stop generating further + tokens. + The returned text will not contain the stop sequence. + properties: + strategy: + discriminator: + mapping: + greedy: '#/$defs/GreedySamplingStrategy' + top_k: '#/$defs/TopKSamplingStrategy' + top_p: '#/$defs/TopPSamplingStrategy' + propertyName: type + oneOf: + - $ref: '#/$defs/GreedySamplingStrategy' + - $ref: '#/$defs/TopPSamplingStrategy' + - $ref: '#/$defs/TopKSamplingStrategy' + title: Strategy + max_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Tokens + repetition_penalty: + anyOf: + - type: number + - type: 'null' + default: 1.0 + title: Repetition Penalty + stop: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Stop + title: SamplingParams + type: object + SystemMessageBehavior: description: >- - (Optional) Instructs the model how to format tool calls. By default, Llama - Stack will attempt to use a format that is best adapted to the model. - - `ToolPromptFormat.json`: The tool calls are formatted as a JSON object. - - `ToolPromptFormat.function_tag`: The tool calls are enclosed in a - tag. - `ToolPromptFormat.python_list`: The tool calls are output as Python - syntax -- a list of function calls. - system_message_behavior: - type: string + Config for how to override the default system prompt. + + + :cvar append: Appends the provided system message to the default system + prompt: + https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt- + :cvar replace: Replaces the default system prompt with the provided system + message. The system message can include the string + '{{function_definitions}}' to indicate where the function definitions + should be inserted. enum: - append - replace - description: >- - (Optional) Config for how to override the default system prompt. - `SystemMessageBehavior.append`: - Appends the provided system message to the default system prompt. - `SystemMessageBehavior.replace`: - Replaces the default system prompt with the provided system message. The - system message can include the string '{{function_definitions}}' to indicate - where the function definitions should be inserted. - default: append - additionalProperties: false - title: ToolConfig - description: Configuration for tool use. - TopKSamplingStrategy: - type: object - properties: - type: + title: SystemMessageBehavior type: string - const: top_k - default: top_k + ToolChoice: description: >- - Must be "top_k" to identify this sampling strategy - top_k: - type: integer - description: >- - Number of top tokens to consider for sampling. Must be at least 1 - additionalProperties: false - required: - - type - - top_k - title: TopKSamplingStrategy - description: >- - Top-k sampling strategy that restricts sampling to the k most likely tokens. - TopPSamplingStrategy: - type: object - properties: - type: + Whether tool use is required or automatic. This is a hint to the model + which may not be followed. It depends on the Instruction Following capabilities + of the model. + + + :cvar auto: The model may use tools if it determines that is appropriate. + + :cvar required: The model must use tools. + + :cvar none: The model must not use tools. + enum: + - auto + - required + - none + title: ToolChoice type: string - const: top_p - default: top_p + ToolConfig: description: >- - Must be "top_p" to identify this sampling strategy - temperature: - type: number + Configuration for tool use. + + + :param tool_choice: (Optional) Whether tool use is automatic, required, + or none. Can also specify a tool name to use a specific tool. Defaults + to ToolChoice.auto. + + :param tool_prompt_format: (Optional) Instructs the model how to format + tool calls. By default, Llama Stack will attempt to use a format that + is best adapted to the model. + - `ToolPromptFormat.json`: The tool calls are formatted as a JSON + object. + - `ToolPromptFormat.function_tag`: The tool calls are enclosed in + a tag. + - `ToolPromptFormat.python_list`: The tool calls are output as Python + syntax -- a list of function calls. + :param system_message_behavior: (Optional) Config for how to override + the default system prompt. + - `SystemMessageBehavior.append`: Appends the provided system message + to the default system prompt. + - `SystemMessageBehavior.replace`: Replaces the default system prompt + with the provided system message. The system message can include the string + '{{function_definitions}}' to indicate where the function definitions + should be inserted. + properties: + tool_choice: + anyOf: + - $ref: '#/$defs/ToolChoice' + - type: string + - type: 'null' + default: auto + title: Tool Choice + tool_prompt_format: + anyOf: + - $ref: '#/$defs/ToolPromptFormat' + - type: 'null' + system_message_behavior: + anyOf: + - $ref: '#/$defs/SystemMessageBehavior' + - type: 'null' + default: append + title: ToolConfig + type: object + ToolDef: description: >- - Controls randomness in sampling. Higher values increase randomness - top_p: - type: number - default: 0.95 + Tool definition used in runtime contexts. + + + :param name: Name of the tool + + :param description: (Optional) Human-readable description of what the + tool does + + :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) + + :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) + + :param metadata: (Optional) Additional metadata about the tool + + :param toolgroup_id: (Optional) ID of the tool group this tool belongs + to + properties: + toolgroup_id: + anyOf: + - type: string + - type: 'null' + title: Toolgroup Id + name: + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + input_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Input Schema + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Output Schema + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + required: + - name + title: ToolDef + type: object + ToolPromptFormat: description: >- - Cumulative probability threshold for nucleus sampling. Defaults to 0.95 - additionalProperties: false - required: - - type - title: TopPSamplingStrategy - description: >- - Top-p (nucleus) sampling strategy that samples from the smallest set of tokens - with cumulative probability >= p. - CreateAgentRequest: - type: object - properties: - agent_config: - $ref: '#/components/schemas/AgentConfig' - description: The configuration for the agent. - additionalProperties: false - required: - - agent_config - title: CreateAgentRequest - AgentCreateResponse: - type: object - properties: - agent_id: + Prompt format for calling custom / zero shot tools. + + + :cvar json: JSON format for calling tools. It takes the form: + { + "type": "function", + "function" : { + "name": "function_name", + "description": "function_description", + "parameters": {...} + } + } + :cvar function_tag: Function tag format, pseudo-XML. This looks like: + (parameters) + + :cvar python_list: Python list. The output is a valid Python expression + that can be + evaluated to a list. Each element in the list is a function call. + Example: + ["function_name(param1, param2)", "function_name(param1, param2)"] + enum: + - json + - function_tag + - python_list + title: ToolPromptFormat type: string - description: Unique identifier for the created agent - additionalProperties: false - required: - - agent_id - title: AgentCreateResponse + TopKSamplingStrategy: + description: >- + Top-k sampling strategy that restricts sampling to the k most likely tokens. + + + :param type: Must be "top_k" to identify this sampling strategy + + :param top_k: Number of top tokens to consider for sampling. Must be at + least 1 + properties: + type: + const: top_k + default: top_k + title: Type + type: string + top_k: + minimum: 1 + title: Top K + type: integer + required: + - top_k + title: TopKSamplingStrategy + type: object + TopPSamplingStrategy: + description: >- + Top-p (nucleus) sampling strategy that samples from the smallest set of + tokens with cumulative probability >= p. + + + :param type: Must be "top_p" to identify this sampling strategy + + :param temperature: Controls randomness in sampling. Higher values increase + randomness + + :param top_p: Cumulative probability threshold for nucleus sampling. Defaults + to 0.95 + properties: + type: + const: top_p + default: top_p + title: Type + type: string + temperature: + anyOf: + - exclusiveMinimum: 0.0 + type: number + - type: 'null' + title: Temperature + top_p: + anyOf: + - type: number + - type: 'null' + default: 0.95 + title: Top P + required: + - temperature + title: TopPSamplingStrategy + type: object description: >- - Response returned when creating a new agent. - Agent: - type: object + An agent instance with configuration and metadata. + + + :param agent_id: Unique identifier for the agent + + :param agent_config: Configuration settings for the agent + + :param created_at: Timestamp when the agent was created properties: agent_id: + title: Agent Id type: string - description: Unique identifier for the agent agent_config: - $ref: '#/components/schemas/AgentConfig' - description: Configuration settings for the agent + $ref: '#/$defs/AgentConfig' created_at: - type: string format: date-time - description: Timestamp when the agent was created - additionalProperties: false + title: Created At + type: string required: - agent_id - agent_config - created_at title: Agent - description: >- - An agent instance with configuration and metadata. + type: object CreateAgentSessionRequest: type: object + AgentSessionCreateResponse: + description: >- + Response returned when creating a new agent session. + + + :param session_id: Unique identifier for the created session properties: - session_name: + session_id: + title: Session Id type: string - description: The name of the session to create. - additionalProperties: false required: - - session_name - title: CreateAgentSessionRequest - AgentSessionCreateResponse: + - session_id + title: AgentSessionCreateResponse + description: >- + Response returned when creating a new agent session. + CompletionMessage: type: object properties: - session_id: + role: + type: string + const: assistant + default: assistant + description: >- + Must be "assistant" to identify this as the model's response + content: + $ref: '#/components/schemas/InterleavedContent' + description: The content of the model's response + stop_reason: + type: string + enum: + - end_of_turn + - end_of_message + - out_of_tokens + description: >- + Reason why the model stopped generating. Options are: - `StopReason.end_of_turn`: + The model finished generating the entire response. - `StopReason.end_of_message`: + The model finished generating but generated a partial response -- usually, + a tool call. The user may call the tool and continue the conversation + with the tool's response. - `StopReason.out_of_tokens`: The model ran + out of token budget. + tool_calls: + type: array + items: + $ref: '#/components/schemas/ToolCall' + description: >- + List of tool calls. Each tool call is a ToolCall object. + additionalProperties: false + required: + - role + - content + - stop_reason + title: CompletionMessage + description: >- + A message containing the model's (assistant) response in a chat conversation. + InferenceStep: + type: object + Session: + $defs: + Attachment: + description: >- + An attachment to an agent turn. + + + :param content: The content of the attachment. + + :param mime_type: The MIME type of the attachment. + properties: + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + - $ref: '#/$defs/URL' + title: Content + mime_type: + title: Mime Type + type: string + required: + - content + - mime_type + title: Attachment + type: object + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool type: string + CompletionMessage: + description: >- + A message containing the model's (assistant) response in a chat conversation. + + + :param role: Must be "assistant" to identify this as the model's response + + :param content: The content of the model's response + + :param stop_reason: Reason why the model stopped generating. Options are: + - `StopReason.end_of_turn`: The model finished generating the entire + response. + - `StopReason.end_of_message`: The model finished generating but generated + a partial response -- usually, a tool call. The user may call the tool + and continue the conversation with the tool's response. + - `StopReason.out_of_tokens`: The model ran out of token budget. + :param tool_calls: List of tool calls. Each tool call is a ToolCall object. + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/$defs/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/$defs/ToolCall' + type: array + - type: 'null' + title: Tool Calls + required: + - content + - stop_reason + title: CompletionMessage + type: object + ImageContentItem: + description: >- + A image content item + + + :param type: Discriminator type of the content item. Always "image" + + :param image: Image as a base64 encoded string or an URL + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/$defs/_URLOrData' + required: + - image + title: ImageContentItem + type: object + InferenceStep: + description: >- + An inference step in an agent turn. + + + :param model_response: The response from the LLM. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: inference + default: inference + title: Step Type + type: string + model_response: + $ref: '#/$defs/CompletionMessage' + required: + - turn_id + - step_id + - model_response + title: InferenceStep + type: object + MemoryRetrievalStep: description: >- - Unique identifier for the created session - additionalProperties: false - required: - - session_id - title: AgentSessionCreateResponse - description: >- - Response returned when creating a new agent session. - CompletionMessage: - type: object - properties: - role: - type: string - const: assistant - default: assistant + A memory retrieval step in an agent turn. + + + :param vector_store_ids: The IDs of the vector databases to retrieve context + from. + + :param inserted_context: The context retrieved from the vector databases. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: memory_retrieval + default: memory_retrieval + title: Step Type + type: string + vector_store_ids: + title: Vector Store Ids + type: string + inserted_context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Inserted Context + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + type: object + SafetyViolation: description: >- - Must be "assistant" to identify this as the model's response - content: - $ref: '#/components/schemas/InterleavedContent' - description: The content of the model's response - stop_reason: - type: string + Details of a safety violation detected by content moderation. + + + :param violation_level: Severity level of the violation + + :param user_message: (Optional) Message to convey to the user about the + violation + + :param metadata: Additional metadata including specific violation codes + for debugging and telemetry + properties: + violation_level: + $ref: '#/$defs/ViolationLevel' + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + metadata: + additionalProperties: true + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + type: object + ShieldCallStep: + description: >- + A shield call step in an agent turn. + + + :param violation: The violation from the shield call. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: shield_call + default: shield_call + title: Step Type + type: string + violation: + anyOf: + - $ref: '#/$defs/SafetyViolation' + - type: 'null' + required: + - turn_id + - step_id + - violation + title: ShieldCallStep + type: object + StopReason: enum: - end_of_turn - end_of_message - out_of_tokens + title: StopReason + type: string + TextContentItem: description: >- - Reason why the model stopped generating. Options are: - `StopReason.end_of_turn`: - The model finished generating the entire response. - `StopReason.end_of_message`: - The model finished generating but generated a partial response -- usually, - a tool call. The user may call the tool and continue the conversation - with the tool's response. - `StopReason.out_of_tokens`: The model ran - out of token budget. - tool_calls: - type: array - items: - $ref: '#/components/schemas/ToolCall' + A text content item + + + :param type: Discriminator type of the content item. Always "text" + + :param text: Text content + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/$defs/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolExecutionStep: description: >- - List of tool calls. Each tool call is a ToolCall object. - additionalProperties: false - required: - - role - - content - - stop_reason - title: CompletionMessage - description: >- - A message containing the model's (assistant) response in a chat conversation. - InferenceStep: - type: object - properties: - turn_id: - type: string - description: The ID of the turn. - step_id: - type: string - description: The ID of the step. - started_at: - type: string - format: date-time - description: The time the step started. - completed_at: - type: string - format: date-time - description: The time the step completed. - step_type: - type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - title: StepType - description: Type of the step in an agent turn. - const: inference - default: inference - model_response: - $ref: '#/components/schemas/CompletionMessage' - description: The response from the LLM. - additionalProperties: false - required: - - turn_id - - step_id - - step_type - - model_response - title: InferenceStep - description: An inference step in an agent turn. - MemoryRetrievalStep: - type: object - properties: - turn_id: - type: string - description: The ID of the turn. - step_id: - type: string - description: The ID of the step. - started_at: - type: string - format: date-time - description: The time the step started. - completed_at: - type: string - format: date-time - description: The time the step completed. - step_type: - type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - title: StepType - description: Type of the step in an agent turn. - const: memory_retrieval - default: memory_retrieval - vector_store_ids: - type: string + A tool execution step in an agent turn. + + + :param tool_calls: The tool calls to execute. + + :param tool_responses: The tool responses from the tool calls. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: tool_execution + default: tool_execution + title: Step Type + type: string + tool_calls: + items: + $ref: '#/$defs/ToolCall' + title: Tool Calls + type: array + tool_responses: + items: + $ref: '#/$defs/ToolResponse' + title: Tool Responses + type: array + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + type: object + ToolResponse: description: >- - The IDs of the vector databases to retrieve context from. - inserted_context: - $ref: '#/components/schemas/InterleavedContent' + Response from a tool invocation. + + + :param call_id: Unique identifier for the tool call this response is for + + :param tool_name: Name of the tool that was invoked + + :param content: The response content from the tool + + :param metadata: (Optional) Additional metadata about the tool response + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/$defs/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + required: + - call_id + - tool_name + - content + title: ToolResponse + type: object + ToolResponseMessage: description: >- - The context retrieved from the vector databases. - additionalProperties: false - required: - - turn_id - - step_id - - step_type - - vector_store_ids - - inserted_context - title: MemoryRetrievalStep + A message representing the result of a tool invocation. + + + :param role: Must be "tool" to identify this as a tool response + + :param call_id: Unique identifier for the tool call this response is for + + :param content: The response content from the tool + properties: + role: + const: tool + default: tool + title: Role + type: string + call_id: + title: Call Id + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + required: + - call_id + - content + title: ToolResponseMessage + type: object + Turn: + description: >- + A single turn in an interaction with an Agentic System. + + + :param turn_id: Unique identifier for the turn within a session + + :param session_id: Unique identifier for the conversation session + + :param input_messages: List of messages that initiated this turn + + :param steps: Ordered list of processing steps executed during this turn + + :param output_message: The model's generated response containing content + and metadata + + :param output_attachments: (Optional) Files or media attached to the agent's + response + + :param started_at: Timestamp when the turn began + + :param completed_at: (Optional) Timestamp when the turn finished, if completed + properties: + turn_id: + title: Turn Id + type: string + session_id: + title: Session Id + type: string + input_messages: + items: + anyOf: + - $ref: '#/$defs/UserMessage' + - $ref: '#/$defs/ToolResponseMessage' + title: Input Messages + type: array + steps: + items: + discriminator: + mapping: + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/$defs/InferenceStep' + - $ref: '#/$defs/ToolExecutionStep' + - $ref: '#/$defs/ShieldCallStep' + - $ref: '#/$defs/MemoryRetrievalStep' + title: Steps + type: array + output_message: + $ref: '#/$defs/CompletionMessage' + output_attachments: + anyOf: + - items: + $ref: '#/$defs/Attachment' + type: array + - type: 'null' + title: Output Attachments + started_at: + format: date-time + title: Started At + type: string + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + required: + - turn_id + - session_id + - input_messages + - steps + - output_message + - started_at + title: Turn + type: object + URL: + description: >- + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + UserMessage: + description: >- + A message from the user in a chat conversation. + + + :param role: Must be "user" to identify this as a user message + + :param content: The content of the message, which can include text and + other media + + :param context: (Optional) This field is used internally by Llama Stack + to pass RAG context. This field may be removed in the API in the future. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + - type: 'null' + title: Context + required: + - content + title: UserMessage + type: object + ViolationLevel: + description: >- + Severity level of a safety violation. + + + :cvar INFO: Informational level violation that does not require action + + :cvar WARN: Warning level violation that suggests caution but allows continuation + + :cvar ERROR: Error level violation that requires blocking or intervention + enum: + - info + - warn + - error + title: ViolationLevel + type: string + _URLOrData: + description: >- + A URL or a base64 encoded string + + + :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. + Note that URL could have length limits. + + :param data: base64 encoded image data as string + properties: + url: + anyOf: + - $ref: '#/$defs/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data + title: _URLOrData + type: object description: >- - A memory retrieval step in an agent turn. - Session: - type: object + A single session of an interaction with an Agentic System. + + + :param session_id: Unique identifier for the conversation session + + :param session_name: Human-readable name for the session + + :param turns: List of all turns that have occurred in this session + + :param started_at: Timestamp when the session was created properties: session_id: + title: Session Id type: string - description: >- - Unique identifier for the conversation session session_name: + title: Session Name type: string - description: Human-readable name for the session turns: - type: array items: - $ref: '#/components/schemas/Turn' - description: >- - List of all turns that have occurred in this session + $ref: '#/$defs/Turn' + title: Turns + type: array started_at: - type: string format: date-time - description: Timestamp when the session was created - additionalProperties: false + title: Started At + type: string required: - session_id - session_name - turns - started_at title: Session - description: >- - A single session of an interaction with an Agentic System. - ShieldCallStep: type: object properties: turn_id: @@ -12394,122 +17861,733 @@ components: description: The response content from the tool metadata: type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool response - additionalProperties: false - required: - - call_id - - tool_name - - content - title: ToolResponse - description: Response from a tool invocation. - ToolResponseMessage: - type: object - properties: - role: - type: string - const: tool - default: tool + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + (Optional) Additional metadata about the tool response + additionalProperties: false + required: + - call_id + - tool_name + - content + title: ToolResponse + description: Response from a tool invocation. + ToolResponseMessage: + type: object + properties: + role: + type: string + const: tool + default: tool + description: >- + Must be "tool" to identify this as a tool response + call_id: + type: string + description: >- + Unique identifier for the tool call this response is for + content: + $ref: '#/components/schemas/InterleavedContent' + description: The response content from the tool + additionalProperties: false + required: + - role + - call_id + - content + title: ToolResponseMessage + description: >- + A message representing the result of a tool invocation. + Turn: + $defs: + Attachment: + description: >- + An attachment to an agent turn. + + + :param content: The content of the attachment. + + :param mime_type: The MIME type of the attachment. + properties: + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + - $ref: '#/$defs/URL' + title: Content + mime_type: + title: Mime Type + type: string + required: + - content + - mime_type + title: Attachment + type: object + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + CompletionMessage: + description: >- + A message containing the model's (assistant) response in a chat conversation. + + + :param role: Must be "assistant" to identify this as the model's response + + :param content: The content of the model's response + + :param stop_reason: Reason why the model stopped generating. Options are: + - `StopReason.end_of_turn`: The model finished generating the entire + response. + - `StopReason.end_of_message`: The model finished generating but generated + a partial response -- usually, a tool call. The user may call the tool + and continue the conversation with the tool's response. + - `StopReason.out_of_tokens`: The model ran out of token budget. + :param tool_calls: List of tool calls. Each tool call is a ToolCall object. + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/$defs/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/$defs/ToolCall' + type: array + - type: 'null' + title: Tool Calls + required: + - content + - stop_reason + title: CompletionMessage + type: object + ImageContentItem: + description: >- + A image content item + + + :param type: Discriminator type of the content item. Always "image" + + :param image: Image as a base64 encoded string or an URL + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/$defs/_URLOrData' + required: + - image + title: ImageContentItem + type: object + InferenceStep: + description: >- + An inference step in an agent turn. + + + :param model_response: The response from the LLM. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: inference + default: inference + title: Step Type + type: string + model_response: + $ref: '#/$defs/CompletionMessage' + required: + - turn_id + - step_id + - model_response + title: InferenceStep + type: object + MemoryRetrievalStep: + description: >- + A memory retrieval step in an agent turn. + + + :param vector_store_ids: The IDs of the vector databases to retrieve context + from. + + :param inserted_context: The context retrieved from the vector databases. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: memory_retrieval + default: memory_retrieval + title: Step Type + type: string + vector_store_ids: + title: Vector Store Ids + type: string + inserted_context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Inserted Context + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + type: object + SafetyViolation: + description: >- + Details of a safety violation detected by content moderation. + + + :param violation_level: Severity level of the violation + + :param user_message: (Optional) Message to convey to the user about the + violation + + :param metadata: Additional metadata including specific violation codes + for debugging and telemetry + properties: + violation_level: + $ref: '#/$defs/ViolationLevel' + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + metadata: + additionalProperties: true + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + type: object + ShieldCallStep: + description: >- + A shield call step in an agent turn. + + + :param violation: The violation from the shield call. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: shield_call + default: shield_call + title: Step Type + type: string + violation: + anyOf: + - $ref: '#/$defs/SafetyViolation' + - type: 'null' + required: + - turn_id + - step_id + - violation + title: ShieldCallStep + type: object + StopReason: + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + type: string + TextContentItem: + description: >- + A text content item + + + :param type: Discriminator type of the content item. Always "text" + + :param text: Text content + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/$defs/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolExecutionStep: + description: >- + A tool execution step in an agent turn. + + + :param tool_calls: The tool calls to execute. + + :param tool_responses: The tool responses from the tool calls. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: tool_execution + default: tool_execution + title: Step Type + type: string + tool_calls: + items: + $ref: '#/$defs/ToolCall' + title: Tool Calls + type: array + tool_responses: + items: + $ref: '#/$defs/ToolResponse' + title: Tool Responses + type: array + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + type: object + ToolResponse: + description: >- + Response from a tool invocation. + + + :param call_id: Unique identifier for the tool call this response is for + + :param tool_name: Name of the tool that was invoked + + :param content: The response content from the tool + + :param metadata: (Optional) Additional metadata about the tool response + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/$defs/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + required: + - call_id + - tool_name + - content + title: ToolResponse + type: object + ToolResponseMessage: + description: >- + A message representing the result of a tool invocation. + + + :param role: Must be "tool" to identify this as a tool response + + :param call_id: Unique identifier for the tool call this response is for + + :param content: The response content from the tool + properties: + role: + const: tool + default: tool + title: Role + type: string + call_id: + title: Call Id + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + required: + - call_id + - content + title: ToolResponseMessage + type: object + URL: + description: >- + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + UserMessage: + description: >- + A message from the user in a chat conversation. + + + :param role: Must be "user" to identify this as a user message + + :param content: The content of the message, which can include text and + other media + + :param context: (Optional) This field is used internally by Llama Stack + to pass RAG context. This field may be removed in the API in the future. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + - type: 'null' + title: Context + required: + - content + title: UserMessage + type: object + ViolationLevel: description: >- - Must be "tool" to identify this as a tool response - call_id: + Severity level of a safety violation. + + + :cvar INFO: Informational level violation that does not require action + + :cvar WARN: Warning level violation that suggests caution but allows continuation + + :cvar ERROR: Error level violation that requires blocking or intervention + enum: + - info + - warn + - error + title: ViolationLevel type: string + _URLOrData: description: >- - Unique identifier for the tool call this response is for - content: - $ref: '#/components/schemas/InterleavedContent' - description: The response content from the tool - additionalProperties: false - required: - - role - - call_id - - content - title: ToolResponseMessage + A URL or a base64 encoded string + + + :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. + Note that URL could have length limits. + + :param data: base64 encoded image data as string + properties: + url: + anyOf: + - $ref: '#/$defs/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data + title: _URLOrData + type: object description: >- - A message representing the result of a tool invocation. - Turn: - type: object + A single turn in an interaction with an Agentic System. + + + :param turn_id: Unique identifier for the turn within a session + + :param session_id: Unique identifier for the conversation session + + :param input_messages: List of messages that initiated this turn + + :param steps: Ordered list of processing steps executed during this turn + + :param output_message: The model's generated response containing content and + metadata + + :param output_attachments: (Optional) Files or media attached to the agent's + response + + :param started_at: Timestamp when the turn began + + :param completed_at: (Optional) Timestamp when the turn finished, if completed properties: turn_id: + title: Turn Id type: string - description: >- - Unique identifier for the turn within a session session_id: + title: Session Id type: string - description: >- - Unique identifier for the conversation session input_messages: - type: array items: - oneOf: - - $ref: '#/components/schemas/UserMessage' - - $ref: '#/components/schemas/ToolResponseMessage' - description: >- - List of messages that initiated this turn - steps: + anyOf: + - $ref: '#/$defs/UserMessage' + - $ref: '#/$defs/ToolResponseMessage' + title: Input Messages type: array + steps: items: - oneOf: - - $ref: '#/components/schemas/InferenceStep' - - $ref: '#/components/schemas/ToolExecutionStep' - - $ref: '#/components/schemas/ShieldCallStep' - - $ref: '#/components/schemas/MemoryRetrievalStep' discriminator: - propertyName: step_type mapping: - inference: '#/components/schemas/InferenceStep' - tool_execution: '#/components/schemas/ToolExecutionStep' - shield_call: '#/components/schemas/ShieldCallStep' - memory_retrieval: '#/components/schemas/MemoryRetrievalStep' - description: >- - Ordered list of processing steps executed during this turn + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/$defs/InferenceStep' + - $ref: '#/$defs/ToolExecutionStep' + - $ref: '#/$defs/ShieldCallStep' + - $ref: '#/$defs/MemoryRetrievalStep' + title: Steps + type: array output_message: - $ref: '#/components/schemas/CompletionMessage' - description: >- - The model's generated response containing content and metadata + $ref: '#/$defs/CompletionMessage' output_attachments: - type: array - items: - type: object - properties: - content: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - - $ref: '#/components/schemas/URL' - description: The content of the attachment. - mime_type: - type: string - description: The MIME type of the attachment. - additionalProperties: false - required: - - content - - mime_type - title: Attachment - description: An attachment to an agent turn. - description: >- - (Optional) Files or media attached to the agent's response + anyOf: + - items: + $ref: '#/$defs/Attachment' + type: array + - type: 'null' + title: Output Attachments started_at: - type: string format: date-time - description: Timestamp when the turn began - completed_at: + title: Started At type: string - format: date-time - description: >- - (Optional) Timestamp when the turn finished, if completed - additionalProperties: false + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At required: - turn_id - session_id @@ -12547,544 +18625,621 @@ components: A message from the user in a chat conversation. CreateAgentTurnRequest: type: object - properties: - messages: - type: array - items: - oneOf: - - $ref: '#/components/schemas/UserMessage' - - $ref: '#/components/schemas/ToolResponseMessage' - description: List of messages to start the turn with. - stream: - type: boolean - description: >- - (Optional) If True, generate an SSE event stream of the response. Defaults - to False. - documents: - type: array - items: - type: object - properties: - content: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - - $ref: '#/components/schemas/URL' - description: The content of the document. - mime_type: - type: string - description: The MIME type of the document. - additionalProperties: false - required: - - content - - mime_type - title: Document - description: A document to be used by an agent. - description: >- - (Optional) List of documents to create the turn with. - toolgroups: - type: array - items: - $ref: '#/components/schemas/AgentTool' - description: >- - (Optional) List of toolgroups to create the turn with, will be used in - addition to the agent's config toolgroups for the request. - tool_config: - $ref: '#/components/schemas/ToolConfig' - description: >- - (Optional) The tool configuration to create the turn with, will be used - to override the agent's tool_config. - additionalProperties: false - required: - - messages - title: CreateAgentTurnRequest - AgentTurnResponseEvent: - type: object - properties: - payload: - oneOf: - - $ref: '#/components/schemas/AgentTurnResponseStepStartPayload' - - $ref: '#/components/schemas/AgentTurnResponseStepProgressPayload' - - $ref: '#/components/schemas/AgentTurnResponseStepCompletePayload' - - $ref: '#/components/schemas/AgentTurnResponseTurnStartPayload' - - $ref: '#/components/schemas/AgentTurnResponseTurnCompletePayload' - - $ref: '#/components/schemas/AgentTurnResponseTurnAwaitingInputPayload' - discriminator: - propertyName: event_type - mapping: - step_start: '#/components/schemas/AgentTurnResponseStepStartPayload' - step_progress: '#/components/schemas/AgentTurnResponseStepProgressPayload' - step_complete: '#/components/schemas/AgentTurnResponseStepCompletePayload' - turn_start: '#/components/schemas/AgentTurnResponseTurnStartPayload' - turn_complete: '#/components/schemas/AgentTurnResponseTurnCompletePayload' - turn_awaiting_input: '#/components/schemas/AgentTurnResponseTurnAwaitingInputPayload' - description: >- - Event-specific payload containing event data - additionalProperties: false - required: - - payload - title: AgentTurnResponseEvent - description: >- - An event in an agent turn response stream. - AgentTurnResponseStepCompletePayload: + ResumeAgentTurnRequest: type: object - properties: - event_type: - type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: step_complete - default: step_complete - description: Type of event being reported - step_type: - type: string + AgentStepResponse: + $defs: + BuiltinTool: enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - description: Type of step being executed - step_id: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool type: string + CompletionMessage: description: >- - Unique identifier for the step within a turn - step_details: - oneOf: - - $ref: '#/components/schemas/InferenceStep' - - $ref: '#/components/schemas/ToolExecutionStep' - - $ref: '#/components/schemas/ShieldCallStep' - - $ref: '#/components/schemas/MemoryRetrievalStep' - discriminator: - propertyName: step_type - mapping: - inference: '#/components/schemas/InferenceStep' - tool_execution: '#/components/schemas/ToolExecutionStep' - shield_call: '#/components/schemas/ShieldCallStep' - memory_retrieval: '#/components/schemas/MemoryRetrievalStep' - description: Complete details of the executed step - additionalProperties: false - required: - - event_type - - step_type - - step_id - - step_details - title: AgentTurnResponseStepCompletePayload - description: >- - Payload for step completion events in agent turn responses. - AgentTurnResponseStepProgressPayload: - type: object - properties: - event_type: - type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: step_progress - default: step_progress - description: Type of event being reported - step_type: - type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - description: Type of step being executed - step_id: - type: string + A message containing the model's (assistant) response in a chat conversation. + + + :param role: Must be "assistant" to identify this as the model's response + + :param content: The content of the model's response + + :param stop_reason: Reason why the model stopped generating. Options are: + - `StopReason.end_of_turn`: The model finished generating the entire + response. + - `StopReason.end_of_message`: The model finished generating but generated + a partial response -- usually, a tool call. The user may call the tool + and continue the conversation with the tool's response. + - `StopReason.out_of_tokens`: The model ran out of token budget. + :param tool_calls: List of tool calls. Each tool call is a ToolCall object. + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/$defs/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/$defs/ToolCall' + type: array + - type: 'null' + title: Tool Calls + required: + - content + - stop_reason + title: CompletionMessage + type: object + ImageContentItem: description: >- - Unique identifier for the step within a turn - delta: - oneOf: - - $ref: '#/components/schemas/TextDelta' - - $ref: '#/components/schemas/ImageDelta' - - $ref: '#/components/schemas/ToolCallDelta' - discriminator: - propertyName: type - mapping: - text: '#/components/schemas/TextDelta' - image: '#/components/schemas/ImageDelta' - tool_call: '#/components/schemas/ToolCallDelta' + A image content item + + + :param type: Discriminator type of the content item. Always "image" + + :param image: Image as a base64 encoded string or an URL + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/$defs/_URLOrData' + required: + - image + title: ImageContentItem + type: object + InferenceStep: description: >- - Incremental content changes during step execution - additionalProperties: false - required: - - event_type - - step_type - - step_id - - delta - title: AgentTurnResponseStepProgressPayload - description: >- - Payload for step progress events in agent turn responses. - AgentTurnResponseStepStartPayload: - type: object - properties: - event_type: - type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: step_start - default: step_start - description: Type of event being reported - step_type: - type: string + An inference step in an agent turn. + + + :param model_response: The response from the LLM. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: inference + default: inference + title: Step Type + type: string + model_response: + $ref: '#/$defs/CompletionMessage' + required: + - turn_id + - step_id + - model_response + title: InferenceStep + type: object + MemoryRetrievalStep: + description: >- + A memory retrieval step in an agent turn. + + + :param vector_store_ids: The IDs of the vector databases to retrieve context + from. + + :param inserted_context: The context retrieved from the vector databases. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: memory_retrieval + default: memory_retrieval + title: Step Type + type: string + vector_store_ids: + title: Vector Store Ids + type: string + inserted_context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Inserted Context + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + type: object + SafetyViolation: + description: >- + Details of a safety violation detected by content moderation. + + + :param violation_level: Severity level of the violation + + :param user_message: (Optional) Message to convey to the user about the + violation + + :param metadata: Additional metadata including specific violation codes + for debugging and telemetry + properties: + violation_level: + $ref: '#/$defs/ViolationLevel' + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + metadata: + additionalProperties: true + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + type: object + ShieldCallStep: + description: >- + A shield call step in an agent turn. + + + :param violation: The violation from the shield call. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: shield_call + default: shield_call + title: Step Type + type: string + violation: + anyOf: + - $ref: '#/$defs/SafetyViolation' + - type: 'null' + required: + - turn_id + - step_id + - violation + title: ShieldCallStep + type: object + StopReason: enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - description: Type of step being executed - step_id: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason type: string + TextContentItem: description: >- - Unique identifier for the step within a turn - metadata: + A text content item + + + :param type: Discriminator type of the content item. Always "text" + + :param text: Text content + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata for the step - additionalProperties: false - required: - - event_type - - step_type - - step_id - title: AgentTurnResponseStepStartPayload - description: >- - Payload for step start events in agent turn responses. - AgentTurnResponseStreamChunk: - type: object - properties: - event: - $ref: '#/components/schemas/AgentTurnResponseEvent' + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/$defs/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolExecutionStep: description: >- - Individual event in the agent turn response stream - additionalProperties: false - required: - - event - title: AgentTurnResponseStreamChunk - description: Streamed agent turn completion response. - "AgentTurnResponseTurnAwaitingInputPayload": - type: object - properties: - event_type: - type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: turn_awaiting_input - default: turn_awaiting_input - description: Type of event being reported - turn: - $ref: '#/components/schemas/Turn' - description: >- - Turn data when waiting for external tool responses - additionalProperties: false - required: - - event_type - - turn - title: >- - AgentTurnResponseTurnAwaitingInputPayload - description: >- - Payload for turn awaiting input events in agent turn responses. - AgentTurnResponseTurnCompletePayload: - type: object - properties: - event_type: - type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: turn_complete - default: turn_complete - description: Type of event being reported - turn: - $ref: '#/components/schemas/Turn' - description: >- - Complete turn data including all steps and results - additionalProperties: false - required: - - event_type - - turn - title: AgentTurnResponseTurnCompletePayload - description: >- - Payload for turn completion events in agent turn responses. - AgentTurnResponseTurnStartPayload: - type: object - properties: - event_type: - type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: turn_start - default: turn_start - description: Type of event being reported - turn_id: - type: string + A tool execution step in an agent turn. + + + :param tool_calls: The tool calls to execute. + + :param tool_responses: The tool responses from the tool calls. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: tool_execution + default: tool_execution + title: Step Type + type: string + tool_calls: + items: + $ref: '#/$defs/ToolCall' + title: Tool Calls + type: array + tool_responses: + items: + $ref: '#/$defs/ToolResponse' + title: Tool Responses + type: array + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + type: object + ToolResponse: description: >- - Unique identifier for the turn within a session - additionalProperties: false - required: - - event_type - - turn_id - title: AgentTurnResponseTurnStartPayload - description: >- - Payload for turn start events in agent turn responses. - ImageDelta: - type: object - properties: - type: - type: string - const: image - default: image + Response from a tool invocation. + + + :param call_id: Unique identifier for the tool call this response is for + + :param tool_name: Name of the tool that was invoked + + :param content: The response content from the tool + + :param metadata: (Optional) Additional metadata about the tool response + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/$defs/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + required: + - call_id + - tool_name + - content + title: ToolResponse + type: object + URL: description: >- - Discriminator type of the delta. Always "image" - image: - type: string - contentEncoding: base64 - description: The incremental image data as bytes - additionalProperties: false - required: - - type - - image - title: ImageDelta - description: >- - An image content delta for streaming responses. - TextDelta: - type: object - properties: - type: - type: string - const: text - default: text + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + ViolationLevel: description: >- - Discriminator type of the delta. Always "text" - text: - type: string - description: The incremental text content - additionalProperties: false - required: - - type - - text - title: TextDelta - description: >- - A text content delta for streaming responses. - ToolCallDelta: - type: object - properties: - type: + Severity level of a safety violation. + + + :cvar INFO: Informational level violation that does not require action + + :cvar WARN: Warning level violation that suggests caution but allows continuation + + :cvar ERROR: Error level violation that requires blocking or intervention + enum: + - info + - warn + - error + title: ViolationLevel type: string - const: tool_call - default: tool_call - description: >- - Discriminator type of the delta. Always "tool_call" - tool_call: - oneOf: - - type: string - - $ref: '#/components/schemas/ToolCall' + _URLOrData: description: >- - Either an in-progress tool call string or the final parsed tool call - parse_status: - type: string - enum: - - started - - in_progress - - failed - - succeeded - description: Current parsing status of the tool call - additionalProperties: false - required: - - type - - tool_call - - parse_status - title: ToolCallDelta + A URL or a base64 encoded string + + + :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. + Note that URL could have length limits. + + :param data: base64 encoded image data as string + properties: + url: + anyOf: + - $ref: '#/$defs/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data + title: _URLOrData + type: object description: >- - A tool call content delta for streaming responses. - ResumeAgentTurnRequest: - type: object - properties: - tool_responses: - type: array - items: - $ref: '#/components/schemas/ToolResponse' - description: >- - The tool call responses to resume the turn with. - stream: - type: boolean - description: Whether to stream the response. - additionalProperties: false - required: - - tool_responses - title: ResumeAgentTurnRequest - AgentStepResponse: - type: object + Response containing details of a specific agent step. + + + :param step: The complete step data and execution details properties: step: - oneOf: - - $ref: '#/components/schemas/InferenceStep' - - $ref: '#/components/schemas/ToolExecutionStep' - - $ref: '#/components/schemas/ShieldCallStep' - - $ref: '#/components/schemas/MemoryRetrievalStep' discriminator: - propertyName: step_type mapping: - inference: '#/components/schemas/InferenceStep' - tool_execution: '#/components/schemas/ToolExecutionStep' - shield_call: '#/components/schemas/ShieldCallStep' - memory_retrieval: '#/components/schemas/MemoryRetrievalStep' - description: >- - The complete step data and execution details - additionalProperties: false + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/$defs/InferenceStep' + - $ref: '#/$defs/ToolExecutionStep' + - $ref: '#/$defs/ShieldCallStep' + - $ref: '#/$defs/MemoryRetrievalStep' + title: Step required: - step title: AgentStepResponse - description: >- - Response containing details of a specific agent step. - Benchmark: type: object - properties: - identifier: - type: string - provider_resource_id: - type: string - provider_id: - type: string - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: benchmark - default: benchmark - description: The resource type, always benchmark - dataset_id: - type: string - description: >- - Identifier of the dataset to use for the benchmark evaluation - scoring_functions: - type: array - items: - type: string - description: >- - List of scoring function identifiers to apply during evaluation - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Metadata for this evaluation task - additionalProperties: false - required: - - identifier - - provider_id - - type - - dataset_id - - scoring_functions - - metadata - title: Benchmark - description: >- - A benchmark resource for evaluating model performance. ListBenchmarksResponse: - type: object + $defs: + Benchmark: + description: >- + A benchmark resource for evaluating model performance. + + + :param dataset_id: Identifier of the dataset to use for the benchmark + evaluation + + :param scoring_functions: List of scoring function identifiers to apply + during evaluation + + :param metadata: Metadata for this evaluation task + + :param type: The resource type, always benchmark + properties: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: benchmark + default: benchmark + title: Type + type: string + dataset_id: + title: Dataset Id + type: string + scoring_functions: + items: + type: string + title: Scoring Functions + type: array + metadata: + additionalProperties: true + description: Metadata for this evaluation task + title: Metadata + type: object + required: + - identifier + - provider_id + - dataset_id + - scoring_functions + title: Benchmark + type: object properties: data: - type: array items: - $ref: '#/components/schemas/Benchmark' - additionalProperties: false + $ref: '#/$defs/Benchmark' + title: Data + type: array required: - data title: ListBenchmarksResponse + type: object RegisterBenchmarkRequest: type: object + Benchmark: + description: >- + A benchmark resource for evaluating model performance. + + + :param dataset_id: Identifier of the dataset to use for the benchmark evaluation + + :param scoring_functions: List of scoring function identifiers to apply during + evaluation + + :param metadata: Metadata for this evaluation task + + :param type: The resource type, always benchmark properties: - benchmark_id: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: benchmark + default: benchmark + title: Type type: string - description: The ID of the benchmark to register. dataset_id: + title: Dataset Id type: string - description: >- - The ID of the dataset to use for the benchmark. scoring_functions: - type: array items: type: string - description: >- - The scoring functions to use for the benchmark. - provider_benchmark_id: - type: string - description: >- - The ID of the provider benchmark to use for the benchmark. - provider_id: - type: string - description: >- - The ID of the provider to use for the benchmark. + title: Scoring Functions + type: array metadata: + additionalProperties: true + description: Metadata for this evaluation task + title: Metadata type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The metadata to use for the benchmark. - additionalProperties: false required: - - benchmark_id + - identifier + - provider_id - dataset_id - scoring_functions - title: RegisterBenchmarkRequest - AgentCandidate: + title: Benchmark type: object properties: type: @@ -13182,692 +19337,437 @@ components: A system message providing instructions or context to the model. EvaluateRowsRequest: type: object - properties: - input_rows: - type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The rows to evaluate. - scoring_functions: - type: array - items: - type: string - description: >- - The scoring functions to use for the evaluation. - benchmark_config: - $ref: '#/components/schemas/BenchmarkConfig' - description: The configuration for the benchmark. - additionalProperties: false - required: - - input_rows - - scoring_functions - - benchmark_config - title: EvaluateRowsRequest EvaluateResponse: - type: object + $defs: + ScoringResult: + description: >- + A scoring result for a single row. + + + :param score_rows: The scoring result for each row. Each row is a map + of column name to value. + + :param aggregated_results: Map of metric name to aggregated value + properties: + score_rows: + items: + additionalProperties: true + type: object + title: Score Rows + type: array + aggregated_results: + additionalProperties: true + title: Aggregated Results + type: object + required: + - score_rows + - aggregated_results + title: ScoringResult + type: object + description: >- + The response from an evaluation. + + + :param generations: The generations from the evaluation. + + :param scores: The scores from the evaluation. properties: generations: - type: array items: + additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The generations from the evaluation. + title: Generations + type: array scores: - type: object additionalProperties: - $ref: '#/components/schemas/ScoringResult' - description: The scores from the evaluation. - additionalProperties: false + $ref: '#/$defs/ScoringResult' + title: Scores + type: object required: - generations - scores title: EvaluateResponse - description: The response from an evaluation. + type: object RunEvalRequest: type: object - properties: - benchmark_config: - $ref: '#/components/schemas/BenchmarkConfig' - description: The configuration for the benchmark. - additionalProperties: false - required: - - benchmark_config - title: RunEvalRequest Job: - type: object - properties: - job_id: - type: string - description: Unique identifier for the job - status: - type: string + $defs: + JobStatus: + description: >- + Status of a job execution. + + :cvar completed: Job has finished successfully + + :cvar in_progress: Job is currently running + + :cvar failed: Job has failed during execution + + :cvar scheduled: Job is scheduled but not yet started + + :cvar cancelled: Job was cancelled before completion enum: - completed - in_progress - failed - scheduled - cancelled - description: Current execution status of the job - additionalProperties: false - required: - - job_id - - status - title: Job + title: JobStatus + type: string description: >- A job execution instance with status tracking. - RerankRequest: - type: object + + + :param job_id: Unique identifier for the job + + :param status: Current execution status of the job properties: - model: + job_id: + title: Job Id type: string - description: >- - The identifier of the reranking model to use. - query: - oneOf: - - type: string - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - description: >- - The search query to rank items against. Can be a string, text content - part, or image content part. The input must not exceed the model's max - input token length. - items: - type: array - items: - oneOf: - - type: string - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - description: >- - List of items to rerank. Each item can be a string, text content part, - or image content part. Each input must not exceed the model's max input - token length. - max_num_results: - type: integer - description: >- - (Optional) Maximum number of results to return. Default: returns all. - additionalProperties: false + status: + $ref: '#/$defs/JobStatus' required: - - model - - query - - items - title: RerankRequest - RerankData: + - job_id + - status + title: Job type: object - properties: - index: - type: integer - description: >- - The original index of the document in the input list - relevance_score: - type: number + RerankRequest: + type: object + RerankResponse: + $defs: + RerankData: description: >- - The relevance score from the model output. Values are inverted when applicable - so that higher scores indicate greater relevance. - additionalProperties: false - required: - - index - - relevance_score - title: RerankData + A single rerank result from a reranking response. + + + :param index: The original index of the document in the input list + + :param relevance_score: The relevance score from the model output. Values + are inverted when applicable so that higher scores indicate greater relevance. + properties: + index: + title: Index + type: integer + relevance_score: + title: Relevance Score + type: number + required: + - index + - relevance_score + title: RerankData + type: object description: >- - A single rerank result from a reranking response. - RerankResponse: - type: object + Response from a reranking request. + + + :param data: List of rerank result objects, sorted by relevance score (descending) properties: data: - type: array items: - $ref: '#/components/schemas/RerankData' - description: >- - List of rerank result objects, sorted by relevance score (descending) - additionalProperties: false + $ref: '#/$defs/RerankData' + title: Data + type: array required: - data title: RerankResponse - description: Response from a reranking request. - Checkpoint: type: object - properties: - identifier: - type: string - description: Unique identifier for the checkpoint - created_at: - type: string - format: date-time - description: >- - Timestamp when the checkpoint was created - epoch: - type: integer - description: >- - Training epoch when the checkpoint was saved - post_training_job_id: - type: string - description: >- - Identifier of the training job that created this checkpoint - path: - type: string + PostTrainingJobArtifactsResponse: + $defs: + Checkpoint: description: >- - File system path where the checkpoint is stored - training_metrics: - $ref: '#/components/schemas/PostTrainingMetric' + Checkpoint created during training runs. + + + :param identifier: Unique identifier for the checkpoint + + :param created_at: Timestamp when the checkpoint was created + + :param epoch: Training epoch when the checkpoint was saved + + :param post_training_job_id: Identifier of the training job that created + this checkpoint + + :param path: File system path where the checkpoint is stored + + :param training_metrics: (Optional) Training metrics associated with this + checkpoint + properties: + identifier: + title: Identifier + type: string + created_at: + format: date-time + title: Created At + type: string + epoch: + title: Epoch + type: integer + post_training_job_id: + title: Post Training Job Id + type: string + path: + title: Path + type: string + training_metrics: + anyOf: + - $ref: '#/$defs/PostTrainingMetric' + - type: 'null' + required: + - identifier + - created_at + - epoch + - post_training_job_id + - path + title: Checkpoint + type: object + PostTrainingMetric: description: >- - (Optional) Training metrics associated with this checkpoint - additionalProperties: false - required: - - identifier - - created_at - - epoch - - post_training_job_id - - path - title: Checkpoint - description: Checkpoint created during training runs. - PostTrainingJobArtifactsResponse: - type: object + Training metrics captured during post-training jobs. + + + :param epoch: Training epoch number + + :param train_loss: Loss value on the training dataset + + :param validation_loss: Loss value on the validation dataset + + :param perplexity: Perplexity metric indicating model confidence + properties: + epoch: + title: Epoch + type: integer + train_loss: + title: Train Loss + type: number + validation_loss: + title: Validation Loss + type: number + perplexity: + title: Perplexity + type: number + required: + - epoch + - train_loss + - validation_loss + - perplexity + title: PostTrainingMetric + type: object + description: >- + Artifacts of a finetuning job. + + + :param job_uuid: Unique identifier for the training job + + :param checkpoints: List of model checkpoints created during training properties: job_uuid: + title: Job Uuid type: string - description: Unique identifier for the training job checkpoints: - type: array items: - $ref: '#/components/schemas/Checkpoint' - description: >- - List of model checkpoints created during training - additionalProperties: false + $ref: '#/$defs/Checkpoint' + title: Checkpoints + type: array required: - job_uuid - - checkpoints title: PostTrainingJobArtifactsResponse - description: Artifacts of a finetuning job. - PostTrainingMetric: type: object - properties: - epoch: - type: integer - description: Training epoch number - train_loss: - type: number - description: Loss value on the training dataset - validation_loss: - type: number - description: Loss value on the validation dataset - perplexity: - type: number - description: >- - Perplexity metric indicating model confidence - additionalProperties: false - required: - - epoch - - train_loss - - validation_loss - - perplexity - title: PostTrainingMetric - description: >- - Training metrics captured during post-training jobs. CancelTrainingJobRequest: type: object - properties: - job_uuid: - type: string - description: The UUID of the job to cancel. - additionalProperties: false - required: - - job_uuid - title: CancelTrainingJobRequest PostTrainingJobStatusResponse: - type: object - properties: - job_uuid: - type: string - description: Unique identifier for the training job - status: - type: string + $defs: + Checkpoint: + description: >- + Checkpoint created during training runs. + + + :param identifier: Unique identifier for the checkpoint + + :param created_at: Timestamp when the checkpoint was created + + :param epoch: Training epoch when the checkpoint was saved + + :param post_training_job_id: Identifier of the training job that created + this checkpoint + + :param path: File system path where the checkpoint is stored + + :param training_metrics: (Optional) Training metrics associated with this + checkpoint + properties: + identifier: + title: Identifier + type: string + created_at: + format: date-time + title: Created At + type: string + epoch: + title: Epoch + type: integer + post_training_job_id: + title: Post Training Job Id + type: string + path: + title: Path + type: string + training_metrics: + anyOf: + - $ref: '#/$defs/PostTrainingMetric' + - type: 'null' + required: + - identifier + - created_at + - epoch + - post_training_job_id + - path + title: Checkpoint + type: object + JobStatus: + description: >- + Status of a job execution. + + :cvar completed: Job has finished successfully + + :cvar in_progress: Job is currently running + + :cvar failed: Job has failed during execution + + :cvar scheduled: Job is scheduled but not yet started + + :cvar cancelled: Job was cancelled before completion enum: - completed - in_progress - failed - scheduled - cancelled - description: Current status of the training job - scheduled_at: + title: JobStatus type: string - format: date-time + PostTrainingMetric: description: >- - (Optional) Timestamp when the job was scheduled - started_at: + Training metrics captured during post-training jobs. + + + :param epoch: Training epoch number + + :param train_loss: Loss value on the training dataset + + :param validation_loss: Loss value on the validation dataset + + :param perplexity: Perplexity metric indicating model confidence + properties: + epoch: + title: Epoch + type: integer + train_loss: + title: Train Loss + type: number + validation_loss: + title: Validation Loss + type: number + perplexity: + title: Perplexity + type: number + required: + - epoch + - train_loss + - validation_loss + - perplexity + title: PostTrainingMetric + type: object + description: >- + Status of a finetuning job. + + + :param job_uuid: Unique identifier for the training job + + :param status: Current status of the training job + + :param scheduled_at: (Optional) Timestamp when the job was scheduled + + :param started_at: (Optional) Timestamp when the job execution began + + :param completed_at: (Optional) Timestamp when the job finished, if completed + + :param resources_allocated: (Optional) Information about computational resources + allocated to the job + + :param checkpoints: List of model checkpoints created during training + properties: + job_uuid: + title: Job Uuid type: string - format: date-time - description: >- - (Optional) Timestamp when the job execution began + status: + $ref: '#/$defs/JobStatus' + scheduled_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Scheduled At + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At completed_at: - type: string - format: date-time - description: >- - (Optional) Timestamp when the job finished, if completed + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At resources_allocated: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Information about computational resources allocated to the - job + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Resources Allocated checkpoints: - type: array items: - $ref: '#/components/schemas/Checkpoint' - description: >- - List of model checkpoints created during training - additionalProperties: false + $ref: '#/$defs/Checkpoint' + title: Checkpoints + type: array required: - job_uuid - status - - checkpoints title: PostTrainingJobStatusResponse - description: Status of a finetuning job. - ListPostTrainingJobsResponse: type: object + ListPostTrainingJobsResponse: + $defs: + PostTrainingJob: + properties: + job_uuid: + title: Job Uuid + type: string + required: + - job_uuid + title: PostTrainingJob + type: object properties: data: - type: array items: - type: object - properties: - job_uuid: - type: string - additionalProperties: false - required: - - job_uuid - title: PostTrainingJob - additionalProperties: false + $ref: '#/$defs/PostTrainingJob' + title: Data + type: array required: - data title: ListPostTrainingJobsResponse - DPOAlignmentConfig: - type: object - properties: - beta: - type: number - description: Temperature parameter for the DPO loss - loss_type: - $ref: '#/components/schemas/DPOLossType' - default: sigmoid - description: The type of loss function to use for DPO - additionalProperties: false - required: - - beta - - loss_type - title: DPOAlignmentConfig - description: >- - Configuration for Direct Preference Optimization (DPO) alignment. - DPOLossType: - type: string - enum: - - sigmoid - - hinge - - ipo - - kto_pair - title: DPOLossType - DataConfig: - type: object - properties: - dataset_id: - type: string - description: >- - Unique identifier for the training dataset - batch_size: - type: integer - description: Number of samples per training batch - shuffle: - type: boolean - description: >- - Whether to shuffle the dataset during training - data_format: - $ref: '#/components/schemas/DatasetFormat' - description: >- - Format of the dataset (instruct or dialog) - validation_dataset_id: - type: string - description: >- - (Optional) Unique identifier for the validation dataset - packed: - type: boolean - default: false - description: >- - (Optional) Whether to pack multiple samples into a single sequence for - efficiency - train_on_input: - type: boolean - default: false - description: >- - (Optional) Whether to compute loss on input tokens as well as output tokens - additionalProperties: false - required: - - dataset_id - - batch_size - - shuffle - - data_format - title: DataConfig - description: >- - Configuration for training data and data loading. - DatasetFormat: - type: string - enum: - - instruct - - dialog - title: DatasetFormat - description: Format of the training dataset. - EfficiencyConfig: - type: object - properties: - enable_activation_checkpointing: - type: boolean - default: false - description: >- - (Optional) Whether to use activation checkpointing to reduce memory usage - enable_activation_offloading: - type: boolean - default: false - description: >- - (Optional) Whether to offload activations to CPU to save GPU memory - memory_efficient_fsdp_wrap: - type: boolean - default: false - description: >- - (Optional) Whether to use memory-efficient FSDP wrapping - fsdp_cpu_offload: - type: boolean - default: false - description: >- - (Optional) Whether to offload FSDP parameters to CPU - additionalProperties: false - title: EfficiencyConfig - description: >- - Configuration for memory and compute efficiency optimizations. - OptimizerConfig: - type: object - properties: - optimizer_type: - $ref: '#/components/schemas/OptimizerType' - description: >- - Type of optimizer to use (adam, adamw, or sgd) - lr: - type: number - description: Learning rate for the optimizer - weight_decay: - type: number - description: >- - Weight decay coefficient for regularization - num_warmup_steps: - type: integer - description: Number of steps for learning rate warmup - additionalProperties: false - required: - - optimizer_type - - lr - - weight_decay - - num_warmup_steps - title: OptimizerConfig - description: >- - Configuration parameters for the optimization algorithm. - OptimizerType: - type: string - enum: - - adam - - adamw - - sgd - title: OptimizerType - description: >- - Available optimizer algorithms for training. - TrainingConfig: type: object - properties: - n_epochs: - type: integer - description: Number of training epochs to run - max_steps_per_epoch: - type: integer - default: 1 - description: Maximum number of steps to run per epoch - gradient_accumulation_steps: - type: integer - default: 1 - description: >- - Number of steps to accumulate gradients before updating - max_validation_steps: - type: integer - default: 1 - description: >- - (Optional) Maximum number of validation steps per epoch - data_config: - $ref: '#/components/schemas/DataConfig' - description: >- - (Optional) Configuration for data loading and formatting - optimizer_config: - $ref: '#/components/schemas/OptimizerConfig' - description: >- - (Optional) Configuration for the optimization algorithm - efficiency_config: - $ref: '#/components/schemas/EfficiencyConfig' - description: >- - (Optional) Configuration for memory and compute optimizations - dtype: - type: string - default: bf16 - description: >- - (Optional) Data type for model parameters (bf16, fp16, fp32) - additionalProperties: false - required: - - n_epochs - - max_steps_per_epoch - - gradient_accumulation_steps - title: TrainingConfig - description: >- - Comprehensive configuration for the training process. PreferenceOptimizeRequest: type: object - properties: - job_uuid: - type: string - description: The UUID of the job to create. - finetuned_model: - type: string - description: The model to fine-tune. - algorithm_config: - $ref: '#/components/schemas/DPOAlignmentConfig' - description: The algorithm configuration. - training_config: - $ref: '#/components/schemas/TrainingConfig' - description: The training configuration. - hyperparam_search_config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The hyperparam search configuration. - logger_config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The logger configuration. - additionalProperties: false - required: - - job_uuid - - finetuned_model - - algorithm_config - - training_config - - hyperparam_search_config - - logger_config - title: PreferenceOptimizeRequest PostTrainingJob: - type: object properties: job_uuid: + title: Job Uuid type: string - additionalProperties: false required: - job_uuid title: PostTrainingJob - AlgorithmConfig: - oneOf: - - $ref: '#/components/schemas/LoraFinetuningConfig' - - $ref: '#/components/schemas/QATFinetuningConfig' - discriminator: - propertyName: type - mapping: - LoRA: '#/components/schemas/LoraFinetuningConfig' - QAT: '#/components/schemas/QATFinetuningConfig' - LoraFinetuningConfig: - type: object - properties: - type: - type: string - const: LoRA - default: LoRA - description: Algorithm type identifier, always "LoRA" - lora_attn_modules: - type: array - items: - type: string - description: >- - List of attention module names to apply LoRA to - apply_lora_to_mlp: - type: boolean - description: Whether to apply LoRA to MLP layers - apply_lora_to_output: - type: boolean - description: >- - Whether to apply LoRA to output projection layers - rank: - type: integer - description: >- - Rank of the LoRA adaptation (lower rank = fewer parameters) - alpha: - type: integer - description: >- - LoRA scaling parameter that controls adaptation strength - use_dora: - type: boolean - default: false - description: >- - (Optional) Whether to use DoRA (Weight-Decomposed Low-Rank Adaptation) - quantize_base: - type: boolean - default: false - description: >- - (Optional) Whether to quantize the base model weights - additionalProperties: false - required: - - type - - lora_attn_modules - - apply_lora_to_mlp - - apply_lora_to_output - - rank - - alpha - title: LoraFinetuningConfig - description: >- - Configuration for Low-Rank Adaptation (LoRA) fine-tuning. - QATFinetuningConfig: type: object - properties: - type: - type: string - const: QAT - default: QAT - description: Algorithm type identifier, always "QAT" - quantizer_name: - type: string - description: >- - Name of the quantization algorithm to use - group_size: - type: integer - description: Size of groups for grouped quantization - additionalProperties: false - required: - - type - - quantizer_name - - group_size - title: QATFinetuningConfig - description: >- - Configuration for Quantization-Aware Training (QAT) fine-tuning. SupervisedFineTuneRequest: type: object - properties: - job_uuid: - type: string - description: The UUID of the job to create. - training_config: - $ref: '#/components/schemas/TrainingConfig' - description: The training configuration. - hyperparam_search_config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The hyperparam search configuration. - logger_config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The logger configuration. - model: - type: string - description: The model to fine-tune. - checkpoint_dir: - type: string - description: The directory to save checkpoint(s) to. - algorithm_config: - $ref: '#/components/schemas/AlgorithmConfig' - description: The algorithm configuration. - additionalProperties: false - required: - - job_uuid - - training_config - - hyperparam_search_config - - logger_config - title: SupervisedFineTuneRequest responses: BadRequest400: description: The request was invalid or malformed @@ -13957,16 +19857,12 @@ tags: Llama Stack Inference API for generating completions, chat completions, and embeddings. - - This API provides the raw interface to the underlying models. Three kinds of - models are supported: - - - LLM models: these models generate "raw" and "chat" (conversational) completions. - - - Embedding models: these models generate embeddings to be used for semantic + This API provides the raw interface to the underlying models. Three kinds + of models are supported: + - LLM models: these models generate "raw" and "chat" (conversational) completions. + - Embedding models: these models generate embeddings to be used for semantic search. - - - Rerank models: these models reorder the documents based on their relevance + - Rerank models: these models reorder the documents based on their relevance to a query. x-displayName: Inference - name: Inspect diff --git a/docs/openapi_generator/README.md b/docs/openapi_generator/README.md deleted file mode 100644 index 85021d911e..0000000000 --- a/docs/openapi_generator/README.md +++ /dev/null @@ -1 +0,0 @@ -The RFC Specification (OpenAPI format) is generated from the set of API endpoints located in `llama_stack.core/server/endpoints.py` using the `generate.py` utility. diff --git a/docs/openapi_generator/generate.py b/docs/openapi_generator/generate.py deleted file mode 100644 index 65720df4a5..0000000000 --- a/docs/openapi_generator/generate.py +++ /dev/null @@ -1,134 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described found in the -# LICENSE file in the root directory of this source tree. - -from datetime import datetime -from pathlib import Path -import sys -import fire -import ruamel.yaml as yaml - -from llama_stack.apis.version import LLAMA_STACK_API_V1 # noqa: E402 -from llama_stack.core.stack import LlamaStack # noqa: E402 - -from .pyopenapi.options import Options # noqa: E402 -from .pyopenapi.specification import Info, Server # noqa: E402 -from .pyopenapi.utility import Specification, validate_api # noqa: E402 - - -def str_presenter(dumper, data): - if data.startswith(f"/{LLAMA_STACK_API_V1}") or data.startswith( - "#/components/schemas/" - ): - style = None - else: - style = ">" if "\n" in data or len(data) > 40 else None - return dumper.represent_scalar("tag:yaml.org,2002:str", data, style=style) - - -def generate_spec(output_dir: Path, stability_filter: str = None, main_spec: bool = False, combined_spec: bool = False): - """Generate OpenAPI spec with optional stability filtering.""" - - if combined_spec: - # Special case for combined stable + experimental APIs - title_suffix = " - Stable & Experimental APIs" - filename_prefix = "stainless-" - description_suffix = "\n\n**🔗 COMBINED**: This specification includes both stable production-ready APIs and experimental pre-release APIs. Use stable APIs for production deployments and experimental APIs for testing new features." - # Use the special "stainless" filter to include stable + experimental APIs - stability_filter = "stainless" - elif stability_filter: - title_suffix = { - "stable": " - Stable APIs" if not main_spec else "", - "experimental": " - Experimental APIs", - "deprecated": " - Deprecated APIs" - }.get(stability_filter, f" - {stability_filter.title()} APIs") - - # Use main spec filename for stable when main_spec=True - if main_spec and stability_filter == "stable": - filename_prefix = "" - else: - filename_prefix = f"{stability_filter}-" - - description_suffix = { - "stable": "\n\n**✅ STABLE**: Production-ready APIs with backward compatibility guarantees.", - "experimental": "\n\n**🧪 EXPERIMENTAL**: Pre-release APIs (v1alpha, v1beta) that may change before becoming stable.", - "deprecated": "\n\n**⚠️ DEPRECATED**: Legacy APIs that may be removed in future versions. Use for migration reference only." - }.get(stability_filter, "") - else: - title_suffix = "" - filename_prefix = "" - description_suffix = "" - - spec = Specification( - LlamaStack, - Options( - server=Server(url="http://any-hosted-llama-stack.com"), - info=Info( - title=f"Llama Stack Specification{title_suffix}", - version=LLAMA_STACK_API_V1, - description=f"""This is the specification of the Llama Stack that provides - a set of endpoints and their corresponding interfaces that are tailored to - best leverage Llama Models.{description_suffix}""", - ), - include_standard_error_responses=True, - stability_filter=stability_filter, # Pass the filter to the generator - ), - ) - - yaml_filename = f"{filename_prefix}llama-stack-spec.yaml" - - with open(output_dir / yaml_filename, "w", encoding="utf-8") as fp: - y = yaml.YAML() - y.default_flow_style = False - y.block_seq_indent = 2 - y.map_indent = 2 - y.sequence_indent = 4 - y.sequence_dash_offset = 2 - y.width = 80 - y.allow_unicode = True - y.representer.add_representer(str, str_presenter) - - y.dump( - spec.get_json(), - fp, - ) - -def main(output_dir: str): - output_dir = Path(output_dir) - if not output_dir.exists(): - raise ValueError(f"Directory {output_dir} does not exist") - - # Validate API protocols before generating spec - return_type_errors = validate_api() - if return_type_errors: - print("\nAPI Method Return Type Validation Errors:\n") - for error in return_type_errors: - print(error, file=sys.stderr) - sys.exit(1) - - now = str(datetime.now()) - print(f"Converting the spec to YAML (openapi.yaml) and HTML (openapi.html) at {now}") - print("") - - # Generate main spec as stable APIs (llama-stack-spec.yaml) - print("Generating main specification (stable APIs)...") - generate_spec(output_dir, "stable", main_spec=True) - - print("Generating other stability-filtered specifications...") - generate_spec(output_dir, "experimental") - generate_spec(output_dir, "deprecated") - - print("Generating combined stable + experimental specification...") - generate_spec(output_dir, combined_spec=True) - - -if __name__ == "__main__": - fire.Fire(main) diff --git a/docs/openapi_generator/pyopenapi/README.md b/docs/openapi_generator/pyopenapi/README.md deleted file mode 100644 index 1b5fbce197..0000000000 --- a/docs/openapi_generator/pyopenapi/README.md +++ /dev/null @@ -1 +0,0 @@ -This is forked from https://github.com/hunyadi/pyopenapi diff --git a/docs/openapi_generator/pyopenapi/__init__.py b/docs/openapi_generator/pyopenapi/__init__.py deleted file mode 100644 index 756f351d88..0000000000 --- a/docs/openapi_generator/pyopenapi/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. diff --git a/docs/openapi_generator/pyopenapi/generator.py b/docs/openapi_generator/pyopenapi/generator.py deleted file mode 100644 index 30fc9038dd..0000000000 --- a/docs/openapi_generator/pyopenapi/generator.py +++ /dev/null @@ -1,1175 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -import hashlib -import inspect -import ipaddress -import os -import types -import typing -from dataclasses import make_dataclass -from pathlib import Path -from typing import Annotated, Any, Dict, get_args, get_origin, Set, Union - -from fastapi import UploadFile - -from llama_stack.apis.datatypes import Error -from llama_stack.strong_typing.core import JsonType -from llama_stack.strong_typing.docstring import Docstring, parse_type -from llama_stack.strong_typing.inspection import ( - is_generic_list, - is_type_optional, - is_type_union, - is_unwrapped_body_param, - unwrap_generic_list, - unwrap_optional_type, - unwrap_union_types, -) -from llama_stack.strong_typing.name import python_type_to_name -from llama_stack.strong_typing.schema import ( - get_schema_identifier, - JsonSchemaGenerator, - register_schema, - Schema, - SchemaOptions, -) -from llama_stack.strong_typing.serialization import json_dump_string, object_to_json -from pydantic import BaseModel - -from .operations import ( - EndpointOperation, - get_endpoint_events, - get_endpoint_operations, - HTTPMethod, -) -from .options import * -from .specification import ( - Components, - Document, - Example, - ExampleRef, - ExtraBodyParameter, - MediaType, - Operation, - Parameter, - ParameterLocation, - PathItem, - RequestBody, - Response, - ResponseRef, - SchemaOrRef, - SchemaRef, - Tag, - TagGroup, -) - -register_schema( - ipaddress.IPv4Address, - schema={ - "type": "string", - "format": "ipv4", - "title": "IPv4 address", - "description": "IPv4 address, according to dotted-quad ABNF syntax as defined in RFC 2673, section 3.2.", - }, - examples=["192.0.2.0", "198.51.100.1", "203.0.113.255"], -) - -register_schema( - ipaddress.IPv6Address, - schema={ - "type": "string", - "format": "ipv6", - "title": "IPv6 address", - "description": "IPv6 address, as defined in RFC 2373, section 2.2.", - }, - examples=[ - "FEDC:BA98:7654:3210:FEDC:BA98:7654:3210", - "1080:0:0:0:8:800:200C:417A", - "1080::8:800:200C:417A", - "FF01::101", - "::1", - ], -) - - -def http_status_to_string(status_code: HTTPStatusCode) -> str: - "Converts an HTTP status code to a string." - - if isinstance(status_code, HTTPStatus): - return str(status_code.value) - elif isinstance(status_code, int): - return str(status_code) - elif isinstance(status_code, str): - return status_code - else: - raise TypeError("expected: HTTP status code") - - -class SchemaBuilder: - schema_generator: JsonSchemaGenerator - schemas: Dict[str, Schema] - - def __init__(self, schema_generator: JsonSchemaGenerator) -> None: - self.schema_generator = schema_generator - self.schemas = {} - - def classdef_to_schema(self, typ: type) -> Schema: - """ - Converts a type to a JSON schema. - For nested types found in the type hierarchy, adds the type to the schema registry in the OpenAPI specification section `components`. - """ - - type_schema, type_definitions = self.schema_generator.classdef_to_schema(typ) - - # append schema to list of known schemas, to be used in OpenAPI's Components Object section - for ref, schema in type_definitions.items(): - self._add_ref(ref, schema) - - return type_schema - - def classdef_to_named_schema(self, name: str, typ: type) -> Schema: - schema = self.classdef_to_schema(typ) - self._add_ref(name, schema) - return schema - - def classdef_to_ref(self, typ: type) -> SchemaOrRef: - """ - Converts a type to a JSON schema, and if possible, returns a schema reference. - For composite types (such as classes), adds the type to the schema registry in the OpenAPI specification section `components`. - """ - - type_schema = self.classdef_to_schema(typ) - if typ is str or typ is int or typ is float: - # represent simple types as themselves - return type_schema - - type_name = get_schema_identifier(typ) - if type_name is not None: - return self._build_ref(type_name, type_schema) - - try: - type_name = python_type_to_name(typ) - return self._build_ref(type_name, type_schema) - except TypeError: - pass - - return type_schema - - def _build_ref(self, type_name: str, type_schema: Schema) -> SchemaRef: - self._add_ref(type_name, type_schema) - return SchemaRef(type_name) - - def _add_ref(self, type_name: str, type_schema: Schema) -> None: - if type_name not in self.schemas: - self.schemas[type_name] = type_schema - - -class ContentBuilder: - schema_builder: SchemaBuilder - schema_transformer: Optional[Callable[[SchemaOrRef], SchemaOrRef]] - sample_transformer: Optional[Callable[[JsonType], JsonType]] - - def __init__( - self, - schema_builder: SchemaBuilder, - schema_transformer: Optional[Callable[[SchemaOrRef], SchemaOrRef]] = None, - sample_transformer: Optional[Callable[[JsonType], JsonType]] = None, - ) -> None: - self.schema_builder = schema_builder - self.schema_transformer = schema_transformer - self.sample_transformer = sample_transformer - - def build_content( - self, payload_type: type, examples: Optional[List[Any]] = None - ) -> Dict[str, MediaType]: - "Creates the content subtree for a request or response." - - def is_iterator_type(t): - return "StreamChunk" in str(t) or "OpenAIResponseObjectStream" in str(t) - - def get_media_type(t): - if is_generic_list(t): - return "application/jsonl" - elif is_iterator_type(t): - return "text/event-stream" - else: - return "application/json" - - if typing.get_origin(payload_type) in (typing.Union, types.UnionType): - media_types = [] - item_types = [] - for x in typing.get_args(payload_type): - media_types.append(get_media_type(x)) - item_types.append(x) - - if len(set(media_types)) == 1: - # all types have the same media type - return {media_types[0]: self.build_media_type(payload_type, examples)} - else: - # different types have different media types - return { - media_type: self.build_media_type(item_type, examples) - for media_type, item_type in zip(media_types, item_types) - } - - if is_generic_list(payload_type): - media_type = "application/jsonl" - item_type = unwrap_generic_list(payload_type) - else: - media_type = "application/json" - item_type = payload_type - - return {media_type: self.build_media_type(item_type, examples)} - - def build_media_type( - self, item_type: type, examples: Optional[List[Any]] = None - ) -> MediaType: - schema = self.schema_builder.classdef_to_ref(item_type) - if self.schema_transformer: - schema_transformer: Callable[[SchemaOrRef], SchemaOrRef] = ( - self.schema_transformer - ) - schema = schema_transformer(schema) - - if not examples: - return MediaType(schema=schema) - - if len(examples) == 1: - return MediaType(schema=schema, example=self._build_example(examples[0])) - - return MediaType( - schema=schema, - examples=self._build_examples(examples), - ) - - def _build_examples( - self, examples: List[Any] - ) -> Dict[str, Union[Example, ExampleRef]]: - "Creates a set of several examples for a media type." - - if self.sample_transformer: - sample_transformer: Callable[[JsonType], JsonType] = self.sample_transformer # type: ignore - else: - sample_transformer = lambda sample: sample - - results: Dict[str, Union[Example, ExampleRef]] = {} - for example in examples: - value = sample_transformer(object_to_json(example)) - - hash_string = ( - hashlib.sha256(json_dump_string(value).encode("utf-8")) - .digest() - .hex()[:16] - ) - name = f"ex-{hash_string}" - - results[name] = Example(value=value) - - return results - - def _build_example(self, example: Any) -> Any: - "Creates a single example for a media type." - - if self.sample_transformer: - sample_transformer: Callable[[JsonType], JsonType] = self.sample_transformer # type: ignore - else: - sample_transformer = lambda sample: sample - - return sample_transformer(object_to_json(example)) - - -@dataclass -class ResponseOptions: - """ - Configuration options for building a response for an operation. - - :param type_descriptions: Maps each response type to a textual description (if available). - :param examples: A list of response examples. - :param status_catalog: Maps each response type to an HTTP status code. - :param default_status_code: HTTP status code assigned to responses that have no mapping. - """ - - type_descriptions: Dict[type, str] - examples: Optional[List[Any]] - status_catalog: Dict[type, HTTPStatusCode] - default_status_code: HTTPStatusCode - - -@dataclass -class StatusResponse: - status_code: str - types: List[type] = dataclasses.field(default_factory=list) - examples: List[Any] = dataclasses.field(default_factory=list) - - -def create_docstring_for_request( - request_name: str, fields: List[Tuple[str, type, Any]], doc_params: Dict[str, str] -) -> str: - """Creates a ReST-style docstring for a dynamically generated request dataclass.""" - lines = ["\n"] # Short description - - # Add parameter documentation in ReST format - for name, type_ in fields: - desc = doc_params.get(name, "") - lines.append(f":param {name}: {desc}") - - return "\n".join(lines) - - -class ResponseBuilder: - content_builder: ContentBuilder - - def __init__(self, content_builder: ContentBuilder) -> None: - self.content_builder = content_builder - - def _get_status_responses( - self, options: ResponseOptions - ) -> Dict[str, StatusResponse]: - status_responses: Dict[str, StatusResponse] = {} - - for response_type in options.type_descriptions.keys(): - status_code = http_status_to_string( - options.status_catalog.get(response_type, options.default_status_code) - ) - - # look up response for status code - if status_code not in status_responses: - status_responses[status_code] = StatusResponse(status_code) - status_response = status_responses[status_code] - - # append response types that are assigned the given status code - status_response.types.append(response_type) - - # append examples that have the matching response type - if options.examples: - status_response.examples.extend( - example - for example in options.examples - if isinstance(example, response_type) - ) - - return dict(sorted(status_responses.items())) - - def build_response( - self, options: ResponseOptions - ) -> Dict[str, Union[Response, ResponseRef]]: - """ - Groups responses that have the same status code. - """ - - responses: Dict[str, Union[Response, ResponseRef]] = {} - status_responses = self._get_status_responses(options) - for status_code, status_response in status_responses.items(): - response_types = tuple(status_response.types) - if len(response_types) > 1: - composite_response_type: type = Union[response_types] # type: ignore - else: - (response_type,) = response_types - composite_response_type = response_type - - description = " **OR** ".join( - filter( - None, - ( - options.type_descriptions[response_type] - for response_type in response_types - ), - ) - ) - - responses[status_code] = self._build_response( - response_type=composite_response_type, - description=description, - examples=status_response.examples or None, - ) - - return responses - - def _build_response( - self, - response_type: type, - description: str, - examples: Optional[List[Any]] = None, - ) -> Response: - "Creates a response subtree." - - if response_type is not None: - return Response( - description=description, - content=self.content_builder.build_content(response_type, examples), - ) - else: - return Response(description=description) - - -def schema_error_wrapper(schema: SchemaOrRef) -> Schema: - "Wraps an error output schema into a top-level error schema." - - return { - "type": "object", - "properties": { - "error": schema, # type: ignore - }, - "additionalProperties": False, - "required": [ - "error", - ], - } - - -def sample_error_wrapper(error: JsonType) -> JsonType: - "Wraps an error output sample into a top-level error sample." - - return {"error": error} - - -class Generator: - endpoint: type - options: Options - schema_builder: SchemaBuilder - responses: Dict[str, Response] - - def __init__(self, endpoint: type, options: Options) -> None: - self.endpoint = endpoint - self.options = options - schema_generator = JsonSchemaGenerator( - SchemaOptions( - definitions_path="#/components/schemas/", - use_examples=self.options.use_examples, - property_description_fun=options.property_description_fun, - ) - ) - self.schema_builder = SchemaBuilder(schema_generator) - self.responses = {} - - # Create standard error responses - self._create_standard_error_responses() - - def _create_standard_error_responses(self) -> None: - """ - Creates standard error responses that can be reused across operations. - These will be added to the components.responses section of the OpenAPI document. - """ - # Get the Error schema - error_schema = self.schema_builder.classdef_to_ref(Error) - - # Create standard error responses - self.responses["BadRequest400"] = Response( - description="The request was invalid or malformed", - content={ - "application/json": MediaType( - schema=error_schema, - example={ - "status": 400, - "title": "Bad Request", - "detail": "The request was invalid or malformed", - }, - ) - }, - ) - - self.responses["TooManyRequests429"] = Response( - description="The client has sent too many requests in a given amount of time", - content={ - "application/json": MediaType( - schema=error_schema, - example={ - "status": 429, - "title": "Too Many Requests", - "detail": "You have exceeded the rate limit. Please try again later.", - }, - ) - }, - ) - - self.responses["InternalServerError500"] = Response( - description="The server encountered an unexpected error", - content={ - "application/json": MediaType( - schema=error_schema, - example={ - "status": 500, - "title": "Internal Server Error", - "detail": "An unexpected error occurred. Our team has been notified.", - }, - ) - }, - ) - - # Add a default error response for any unhandled error cases - self.responses["DefaultError"] = Response( - description="An unexpected error occurred", - content={ - "application/json": MediaType( - schema=error_schema, - example={ - "status": 0, - "title": "Error", - "detail": "An unexpected error occurred", - }, - ) - }, - ) - - def _build_type_tag(self, ref: str, schema: Schema) -> Tag: - # Don't include schema definition in the tag description because for one, - # it is not very valuable and for another, it causes string formatting - # discrepancies via the Stainless Studio. - # - # definition = f'' - title = typing.cast(str, schema.get("title")) - description = typing.cast(str, schema.get("description")) - return Tag( - name=ref, - description="\n\n".join(s for s in (title, description) if s is not None), - ) - - def _build_extra_tag_groups( - self, extra_types: Dict[str, Dict[str, type]] - ) -> Dict[str, List[Tag]]: - """ - Creates a dictionary of tag group captions as keys, and tag lists as values. - - :param extra_types: A dictionary of type categories and list of types in that category. - """ - - extra_tags: Dict[str, List[Tag]] = {} - - for category_name, category_items in extra_types.items(): - tag_list: List[Tag] = [] - - for name, extra_type in category_items.items(): - schema = self.schema_builder.classdef_to_schema(extra_type) - tag_list.append(self._build_type_tag(name, schema)) - - if tag_list: - extra_tags[category_name] = tag_list - - return extra_tags - - def _get_api_group_for_operation(self, op) -> str | None: - """ - Determine the API group for an operation based on its route path. - - Args: - op: The endpoint operation - - Returns: - The API group name derived from the route, or None if unable to determine - """ - if not hasattr(op, 'webmethod') or not op.webmethod or not hasattr(op.webmethod, 'route'): - return None - - route = op.webmethod.route - if not route or not route.startswith('/'): - return None - - # Extract API group from route path - # Examples: /v1/agents/list -> agents-api - # /v1/responses -> responses-api - # /v1/models -> models-api - path_parts = route.strip('/').split('/') - - if len(path_parts) < 2: - return None - - # Skip version prefix (v1, v1alpha, v1beta, etc.) - if path_parts[0].startswith('v1'): - if len(path_parts) < 2: - return None - api_segment = path_parts[1] - else: - api_segment = path_parts[0] - - # Convert to supplementary file naming convention - # agents -> agents-api, responses -> responses-api, etc. - return f"{api_segment}-api" - - def _load_supplemental_content(self, api_group: str | None) -> str: - """ - Load supplemental content for an API group based on stability level. - - Follows this resolution order: - 1. docs/supplementary/{stability}/{api_group}.md - 2. docs/supplementary/shared/{api_group}.md (fallback) - 3. Empty string if no files found - - Args: - api_group: The API group name (e.g., "agents-responses-api"), or None if no mapping exists - - Returns: - The supplemental content as markdown string, or empty string if not found - """ - if not api_group: - return "" - - base_path = Path(__file__).parent.parent.parent / "supplementary" - - # Try stability-specific content first if stability filter is set - if self.options.stability_filter: - stability_path = base_path / self.options.stability_filter / f"{api_group}.md" - if stability_path.exists(): - try: - return stability_path.read_text(encoding="utf-8") - except Exception as e: - print(f"Warning: Could not read stability-specific supplemental content from {stability_path}: {e}") - - # Fall back to shared content - shared_path = base_path / "shared" / f"{api_group}.md" - if shared_path.exists(): - try: - return shared_path.read_text(encoding="utf-8") - except Exception as e: - print(f"Warning: Could not read shared supplemental content from {shared_path}: {e}") - - # No supplemental content found - return "" - - def _build_operation(self, op: EndpointOperation) -> Operation: - if op.defining_class.__name__ in [ - "SyntheticDataGeneration", - "PostTraining", - ]: - op.defining_class.__name__ = f"{op.defining_class.__name__} (Coming Soon)" - print(op.defining_class.__name__) - - # TODO (xiyan): temporary fix for datasetio inner impl + datasets api - # if op.defining_class.__name__ in ["DatasetIO"]: - # op.defining_class.__name__ = "Datasets" - - doc_string = parse_type(op.func_ref) - doc_params = dict( - (param.name, param.description) for param in doc_string.params.values() - ) - - # parameters passed in URL component path - path_parameters = [ - Parameter( - name=param_name, - in_=ParameterLocation.Path, - description=doc_params.get(param_name), - required=True, - schema=self.schema_builder.classdef_to_ref(param_type), - ) - for param_name, param_type in op.path_params - ] - - # parameters passed in URL component query string - query_parameters = [] - for param_name, param_type in op.query_params: - if is_type_optional(param_type): - inner_type: type = unwrap_optional_type(param_type) - required = False - else: - inner_type = param_type - required = True - - query_parameter = Parameter( - name=param_name, - in_=ParameterLocation.Query, - description=doc_params.get(param_name), - required=required, - schema=self.schema_builder.classdef_to_ref(inner_type), - ) - query_parameters.append(query_parameter) - - # parameters passed anywhere - parameters = path_parameters + query_parameters - - # Build extra body parameters documentation - extra_body_parameters = [] - for param_name, param_type, description in op.extra_body_params: - if is_type_optional(param_type): - inner_type: type = unwrap_optional_type(param_type) - required = False - else: - inner_type = param_type - required = True - - # Use description from ExtraBodyField if available, otherwise from docstring - param_description = description or doc_params.get(param_name) - - extra_body_param = ExtraBodyParameter( - name=param_name, - schema=self.schema_builder.classdef_to_ref(inner_type), - description=param_description, - required=required, - ) - extra_body_parameters.append(extra_body_param) - - webmethod = getattr(op.func_ref, "__webmethod__", None) - raw_bytes_request_body = False - if webmethod: - raw_bytes_request_body = getattr(webmethod, "raw_bytes_request_body", False) - - # data passed in request body as raw bytes cannot have request parameters - if raw_bytes_request_body and op.request_params: - raise ValueError( - "Cannot have both raw bytes request body and request parameters" - ) - - # data passed in request body as raw bytes - if raw_bytes_request_body: - requestBody = RequestBody( - content={ - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary", - } - } - }, - required=True, - ) - # data passed in request body as multipart/form-data - elif op.multipart_params: - builder = ContentBuilder(self.schema_builder) - - # Create schema properties for multipart form fields - properties = {} - required_fields = [] - - for name, param_type in op.multipart_params: - if get_origin(param_type) is Annotated: - base_type = get_args(param_type)[0] - else: - base_type = param_type - - # Check if the type is optional - is_optional = is_type_optional(base_type) - if is_optional: - base_type = unwrap_optional_type(base_type) - - if base_type is UploadFile: - # File upload - properties[name] = {"type": "string", "format": "binary"} - else: - # All other types - generate schema reference - # This includes enums, BaseModels, and simple types - properties[name] = self.schema_builder.classdef_to_ref(base_type) - - if not is_optional: - required_fields.append(name) - - multipart_schema = { - "type": "object", - "properties": properties, - "required": required_fields, - } - - requestBody = RequestBody( - content={"multipart/form-data": {"schema": multipart_schema}}, - required=True, - ) - # data passed in payload as JSON and mapped to request parameters - elif op.request_params: - builder = ContentBuilder(self.schema_builder) - first = next(iter(op.request_params)) - request_name, request_type = first - - # Special case: if there's a single parameter with Body(embed=False) that's a BaseModel, - # unwrap it to show the flat structure in the OpenAPI spec - # Example: openai_chat_completion() - if (len(op.request_params) == 1 and is_unwrapped_body_param(request_type)): - pass - else: - op_name = "".join(word.capitalize() for word in op.name.split("_")) - request_name = f"{op_name}Request" - fields = [ - ( - name, - type_, - ) - for name, type_ in op.request_params - ] - request_type = make_dataclass( - request_name, - fields, - namespace={ - "__doc__": create_docstring_for_request( - request_name, fields, doc_params - ) - }, - ) - - requestBody = RequestBody( - content={ - "application/json": builder.build_media_type( - request_type, op.request_examples - ) - }, - description=doc_params.get(request_name), - required=True, - ) - else: - requestBody = None - - # success response types - if doc_string.returns is None and is_type_union(op.response_type): - # split union of return types into a list of response types - success_type_docstring: Dict[type, Docstring] = { - typing.cast(type, item): parse_type(item) - for item in unwrap_union_types(op.response_type) - } - success_type_descriptions = { - item: doc_string.short_description - for item, doc_string in success_type_docstring.items() - } - else: - # use return type as a single response type - success_type_descriptions = { - op.response_type: ( - doc_string.returns.description if doc_string.returns else "OK" - ) - } - - response_examples = op.response_examples or [] - success_examples = [ - example - for example in response_examples - if not isinstance(example, Exception) - ] - - content_builder = ContentBuilder(self.schema_builder) - response_builder = ResponseBuilder(content_builder) - response_options = ResponseOptions( - success_type_descriptions, - success_examples if self.options.use_examples else None, - self.options.success_responses, - "200", - ) - responses = response_builder.build_response(response_options) - - # failure response types - if doc_string.raises: - exception_types: Dict[type, str] = { - item.raise_type: item.description for item in doc_string.raises.values() - } - exception_examples = [ - example - for example in response_examples - if isinstance(example, Exception) - ] - - if self.options.error_wrapper: - schema_transformer = schema_error_wrapper - sample_transformer = sample_error_wrapper - else: - schema_transformer = None - sample_transformer = None - - content_builder = ContentBuilder( - self.schema_builder, - schema_transformer=schema_transformer, - sample_transformer=sample_transformer, - ) - response_builder = ResponseBuilder(content_builder) - response_options = ResponseOptions( - exception_types, - exception_examples if self.options.use_examples else None, - self.options.error_responses, - "500", - ) - responses.update(response_builder.build_response(response_options)) - - assert len(responses.keys()) > 0, f"No responses found for {op.name}" - - # Add standard error response references - if self.options.include_standard_error_responses: - if "400" not in responses: - responses["400"] = ResponseRef("BadRequest400") - if "429" not in responses: - responses["429"] = ResponseRef("TooManyRequests429") - if "500" not in responses: - responses["500"] = ResponseRef("InternalServerError500") - if "default" not in responses: - responses["default"] = ResponseRef("DefaultError") - - if op.event_type is not None: - builder = ContentBuilder(self.schema_builder) - callbacks = { - f"{op.func_name}_callback": { - "{$request.query.callback}": PathItem( - post=Operation( - requestBody=RequestBody( - content=builder.build_content(op.event_type) - ), - responses={"200": Response(description="OK")}, - ) - ) - } - } - - else: - callbacks = None - - # Build base description from docstring - base_description = "\n".join( - filter(None, [doc_string.short_description, doc_string.long_description]) - ) - - # Individual endpoints get clean descriptions only - description = base_description - - return Operation( - tags=[ - getattr(op.defining_class, "API_NAMESPACE", op.defining_class.__name__) - ], - summary=doc_string.short_description, - description=description, - parameters=parameters, - requestBody=requestBody, - responses=responses, - callbacks=callbacks, - deprecated=getattr(op.webmethod, "deprecated", False) - or "DEPRECATED" in op.func_name, - security=[] if op.public else None, - extraBodyParameters=extra_body_parameters if extra_body_parameters else None, - ) - - def _get_api_stability_priority(self, api_level: str) -> int: - """ - Return sorting priority for API stability levels. - Lower numbers = higher priority (appear first) - - :param api_level: The API level (e.g., "v1", "v1beta", "v1alpha") - :return: Priority number for sorting - """ - stability_order = { - "v1": 0, # Stable - highest priority - "v1beta": 1, # Beta - medium priority - "v1alpha": 2, # Alpha - lowest priority - } - return stability_order.get(api_level, 999) # Unknown levels go last - - def generate(self) -> Document: - paths: Dict[str, PathItem] = {} - endpoint_classes: Set[type] = set() - - # Collect all operations and filter by stability if specified - operations = list( - get_endpoint_operations( - self.endpoint, use_examples=self.options.use_examples - ) - ) - - # Filter operations by stability level if requested - if self.options.stability_filter: - filtered_operations = [] - for op in operations: - deprecated = ( - getattr(op.webmethod, "deprecated", False) - or "DEPRECATED" in op.func_name - ) - stability_level = op.webmethod.level - - if self.options.stability_filter == "stable": - # Include v1 non-deprecated endpoints - if stability_level == "v1" and not deprecated: - filtered_operations.append(op) - elif self.options.stability_filter == "experimental": - # Include v1alpha and v1beta endpoints (deprecated or not) - if stability_level in ["v1alpha", "v1beta"]: - filtered_operations.append(op) - elif self.options.stability_filter == "deprecated": - # Include only deprecated endpoints - if deprecated: - filtered_operations.append(op) - elif self.options.stability_filter == "stainless": - # Include both stable (v1 non-deprecated) and experimental (v1alpha, v1beta) endpoints - if (stability_level == "v1" and not deprecated) or stability_level in ["v1alpha", "v1beta"]: - filtered_operations.append(op) - - operations = filtered_operations - print( - f"Filtered to {len(operations)} operations for stability level: {self.options.stability_filter}" - ) - - # Sort operations by multiple criteria for consistent ordering: - # 1. Stability level with deprecation handling (global priority): - # - Active stable (v1) comes first - # - Beta (v1beta) comes next - # - Alpha (v1alpha) comes next - # - Deprecated stable (v1 deprecated) comes last - # 2. Route path (group related endpoints within same stability level) - # 3. HTTP method (GET, POST, PUT, DELETE, PATCH) - # 4. Operation name (alphabetical) - def sort_key(op): - http_method_order = { - HTTPMethod.GET: 0, - HTTPMethod.POST: 1, - HTTPMethod.PUT: 2, - HTTPMethod.DELETE: 3, - HTTPMethod.PATCH: 4, - } - - # Enhanced stability priority for migration pattern support - deprecated = getattr(op.webmethod, "deprecated", False) - stability_priority = self._get_api_stability_priority(op.webmethod.level) - - # Deprecated versions should appear after everything else - # This ensures deprecated stable endpoints come last globally - if deprecated: - stability_priority += 10 # Push deprecated endpoints to the end - - return ( - stability_priority, # Global stability handling comes first - op.get_route( - op.webmethod - ), # Group by route path within stability level - http_method_order.get(op.http_method, 999), - op.func_name, - ) - - operations.sort(key=sort_key) - - # Debug output for migration pattern tracking - migration_routes = {} - for op in operations: - route_key = (op.get_route(op.webmethod), op.http_method) - if route_key not in migration_routes: - migration_routes[route_key] = [] - migration_routes[route_key].append( - (op.webmethod.level, getattr(op.webmethod, "deprecated", False)) - ) - - for route_key, versions in migration_routes.items(): - if len(versions) > 1: - print(f"Migration pattern detected for {route_key[1]} {route_key[0]}:") - for level, deprecated in versions: - status = "DEPRECATED" if deprecated else "ACTIVE" - print(f" - {level} ({status})") - - for op in operations: - endpoint_classes.add(op.defining_class) - - operation = self._build_operation(op) - - if op.http_method is HTTPMethod.GET: - pathItem = PathItem(get=operation) - elif op.http_method is HTTPMethod.PUT: - pathItem = PathItem(put=operation) - elif op.http_method is HTTPMethod.POST: - pathItem = PathItem(post=operation) - elif op.http_method is HTTPMethod.DELETE: - pathItem = PathItem(delete=operation) - elif op.http_method is HTTPMethod.PATCH: - pathItem = PathItem(patch=operation) - else: - raise NotImplementedError(f"unknown HTTP method: {op.http_method}") - - route = op.get_route(op.webmethod) - route = route.replace(":path", "") - print(f"route: {route}") - if route in paths: - paths[route].update(pathItem) - else: - paths[route] = pathItem - - operation_tags: List[Tag] = [] - for cls in endpoint_classes: - doc_string = parse_type(cls) - if hasattr(cls, "API_NAMESPACE") and cls.API_NAMESPACE != cls.__name__: - continue - - # Add supplemental content to tag pages - api_group = f"{cls.__name__.lower()}-api" - supplemental_content = self._load_supplemental_content(api_group) - - tag_description = doc_string.long_description or "" - if supplemental_content: - if tag_description: - tag_description = f"{tag_description}\n\n{supplemental_content}" - else: - tag_description = supplemental_content - - operation_tags.append( - Tag( - name=cls.__name__, - description=tag_description, - displayName=doc_string.short_description, - ) - ) - - # types that are emitted by events - event_tags: List[Tag] = [] - events = get_endpoint_events(self.endpoint) - for ref, event_type in events.items(): - event_schema = self.schema_builder.classdef_to_named_schema(ref, event_type) - event_tags.append(self._build_type_tag(ref, event_schema)) - - # types that are explicitly declared - extra_tag_groups: Dict[str, List[Tag]] = {} - if self.options.extra_types is not None: - if isinstance(self.options.extra_types, list): - extra_tag_groups = self._build_extra_tag_groups( - {"AdditionalTypes": self.options.extra_types} - ) - elif isinstance(self.options.extra_types, dict): - extra_tag_groups = self._build_extra_tag_groups( - self.options.extra_types - ) - else: - raise TypeError( - f"type mismatch for collection of extra types: {type(self.options.extra_types)}" - ) - - # list all operations and types - tags: List[Tag] = [] - tags.extend(operation_tags) - tags.extend(event_tags) - for extra_tag_group in extra_tag_groups.values(): - tags.extend(extra_tag_group) - - tags = sorted(tags, key=lambda t: t.name) - - tag_groups = [] - if operation_tags: - tag_groups.append( - TagGroup( - name=self.options.map("Operations"), - tags=sorted(tag.name for tag in operation_tags), - ) - ) - if event_tags: - tag_groups.append( - TagGroup( - name=self.options.map("Events"), - tags=sorted(tag.name for tag in event_tags), - ) - ) - for caption, extra_tag_group in extra_tag_groups.items(): - tag_groups.append( - TagGroup( - name=caption, - tags=sorted(tag.name for tag in extra_tag_group), - ) - ) - - if self.options.default_security_scheme: - securitySchemes = {"Default": self.options.default_security_scheme} - else: - securitySchemes = None - - return Document( - openapi=".".join(str(item) for item in self.options.version), - info=self.options.info, - jsonSchemaDialect=( - "https://json-schema.org/draft/2020-12/schema" - if self.options.version >= (3, 1, 0) - else None - ), - servers=[self.options.server], - paths=paths, - components=Components( - schemas=self.schema_builder.schemas, - responses=self.responses, - securitySchemes=securitySchemes, - ), - security=[{"Default": []}], - tags=tags, - tagGroups=tag_groups, - ) diff --git a/docs/openapi_generator/pyopenapi/operations.py b/docs/openapi_generator/pyopenapi/operations.py deleted file mode 100644 index 2970d7e53c..0000000000 --- a/docs/openapi_generator/pyopenapi/operations.py +++ /dev/null @@ -1,463 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -import collections.abc -import enum -import inspect -import typing -from dataclasses import dataclass -from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, Union - -from llama_stack.apis.version import LLAMA_STACK_API_V1, LLAMA_STACK_API_V1BETA, LLAMA_STACK_API_V1ALPHA - -from termcolor import colored - -from llama_stack.strong_typing.inspection import get_signature - -from typing import get_origin, get_args - -from fastapi import UploadFile -from fastapi.params import File, Form -from typing import Annotated - -from llama_stack.schema_utils import ExtraBodyField - - -def split_prefix( - s: str, sep: str, prefix: Union[str, Iterable[str]] -) -> Tuple[Optional[str], str]: - """ - Recognizes a prefix at the beginning of a string. - - :param s: The string to check. - :param sep: A separator between (one of) the prefix(es) and the rest of the string. - :param prefix: A string or a set of strings to identify as a prefix. - :return: A tuple of the recognized prefix (if any) and the rest of the string excluding the separator (or the entire string). - """ - - if isinstance(prefix, str): - if s.startswith(prefix + sep): - return prefix, s[len(prefix) + len(sep) :] - else: - return None, s - - for p in prefix: - if s.startswith(p + sep): - return p, s[len(p) + len(sep) :] - - return None, s - - -def _get_annotation_type(annotation: Union[type, str], callable: Callable) -> type: - "Maps a stringized reference to a type, as if using `from __future__ import annotations`." - - if isinstance(annotation, str): - return eval(annotation, callable.__globals__) - else: - return annotation - - -class HTTPMethod(enum.Enum): - "HTTP method used to invoke an endpoint operation." - - GET = "GET" - POST = "POST" - PUT = "PUT" - DELETE = "DELETE" - PATCH = "PATCH" - - -OperationParameter = Tuple[str, type] - - -class ValidationError(TypeError): - pass - - -@dataclass -class EndpointOperation: - """ - Type information and metadata associated with an endpoint operation. - - "param defining_class: The most specific class that defines the endpoint operation. - :param name: The short name of the endpoint operation. - :param func_name: The name of the function to invoke when the operation is triggered. - :param func_ref: The callable to invoke when the operation is triggered. - :param route: A custom route string assigned to the operation. - :param path_params: Parameters of the operation signature that are passed in the path component of the URL string. - :param query_params: Parameters of the operation signature that are passed in the query string as `key=value` pairs. - :param request_params: The parameter that corresponds to the data transmitted in the request body. - :param multipart_params: Parameters that indicate multipart/form-data request body. - :param extra_body_params: Parameters that arrive via extra_body and are documented but not in SDK. - :param event_type: The Python type of the data that is transmitted out-of-band (e.g. via websockets) while the operation is in progress. - :param response_type: The Python type of the data that is transmitted in the response body. - :param http_method: The HTTP method used to invoke the endpoint such as POST, GET or PUT. - :param public: True if the operation can be invoked without prior authentication. - :param request_examples: Sample requests that the operation might take. - :param response_examples: Sample responses that the operation might produce. - """ - - defining_class: type - name: str - func_name: str - func_ref: Callable[..., Any] - route: Optional[str] - path_params: List[OperationParameter] - query_params: List[OperationParameter] - request_params: Optional[OperationParameter] - multipart_params: List[OperationParameter] - extra_body_params: List[tuple[str, type, str | None]] - event_type: Optional[type] - response_type: type - http_method: HTTPMethod - public: bool - request_examples: Optional[List[Any]] = None - response_examples: Optional[List[Any]] = None - - def get_route(self, webmethod) -> str: - api_level = webmethod.level - - if self.route is not None: - return "/".join(["", api_level, self.route.lstrip("/")]) - - route_parts = ["", api_level, self.name] - for param_name, _ in self.path_params: - route_parts.append("{" + param_name + "}") - return "/".join(route_parts) - - -class _FormatParameterExtractor: - "A visitor to exract parameters in a format string." - - keys: List[str] - - def __init__(self) -> None: - self.keys = [] - - def __getitem__(self, key: str) -> None: - self.keys.append(key) - return None - - -def _get_route_parameters(route: str) -> List[str]: - extractor = _FormatParameterExtractor() - # Replace all occurrences of ":path" with empty string - route = route.replace(":path", "") - route.format_map(extractor) - return extractor.keys - - -def _get_endpoint_functions( - endpoint: type, prefixes: List[str] -) -> Iterator[Tuple[str, str, str, Callable]]: - if not inspect.isclass(endpoint): - raise ValueError(f"object is not a class type: {endpoint}") - - functions = inspect.getmembers(endpoint, inspect.isfunction) - for func_name, func_ref in functions: - webmethods = [] - - # Check for multiple webmethods (stacked decorators) - if hasattr(func_ref, "__webmethods__"): - webmethods = func_ref.__webmethods__ - - if not webmethods: - continue - - for webmethod in webmethods: - print(f"Processing {colored(func_name, 'white')}...") - operation_name = func_name - - if webmethod.method == "GET": - prefix = "get" - elif webmethod.method == "DELETE": - prefix = "delete" - elif webmethod.method == "POST": - prefix = "post" - elif operation_name.startswith("get_") or operation_name.endswith("/get"): - prefix = "get" - elif ( - operation_name.startswith("delete_") - or operation_name.startswith("remove_") - or operation_name.endswith("/delete") - or operation_name.endswith("/remove") - ): - prefix = "delete" - else: - # by default everything else is a POST - prefix = "post" - - yield prefix, operation_name, func_name, func_ref - - -def _get_defining_class(member_fn: str, derived_cls: type) -> type: - "Find the class in which a member function is first defined in a class inheritance hierarchy." - - # This import must be dynamic here - from llama_stack.apis.tools import RAGToolRuntime, ToolRuntime - - # iterate in reverse member resolution order to find most specific class first - for cls in reversed(inspect.getmro(derived_cls)): - for name, _ in inspect.getmembers(cls, inspect.isfunction): - if name == member_fn: - # HACK ALERT - if cls == RAGToolRuntime: - return ToolRuntime - return cls - - raise ValidationError( - f"cannot find defining class for {member_fn} in {derived_cls}" - ) - - -def get_endpoint_operations( - endpoint: type, use_examples: bool = True -) -> List[EndpointOperation]: - """ - Extracts a list of member functions in a class eligible for HTTP interface binding. - - These member functions are expected to have a signature like - ``` - async def get_object(self, uuid: str, version: int) -> Object: - ... - ``` - where the prefix `get_` translates to an HTTP GET, `object` corresponds to the name of the endpoint operation, - `uuid` and `version` are mapped to route path elements in "/object/{uuid}/{version}", and `Object` becomes - the response payload type, transmitted as an object serialized to JSON. - - If the member function has a composite class type in the argument list, it becomes the request payload type, - and the caller is expected to provide the data as serialized JSON in an HTTP POST request. - - :param endpoint: A class with member functions that can be mapped to an HTTP endpoint. - :param use_examples: Whether to return examples associated with member functions. - """ - - result = [] - - for prefix, operation_name, func_name, func_ref in _get_endpoint_functions( - endpoint, - [ - "create", - "delete", - "do", - "get", - "post", - "put", - "remove", - "set", - "update", - ], - ): - # Get all webmethods for this function - webmethods = getattr(func_ref, "__webmethods__", []) - - # Create one EndpointOperation for each webmethod - for webmethod in webmethods: - route = webmethod.route - route_params = _get_route_parameters(route) if route is not None else None - public = webmethod.public - request_examples = webmethod.request_examples - response_examples = webmethod.response_examples - - # inspect function signature for path and query parameters, and request/response payload type - signature = get_signature(func_ref) - - path_params = [] - query_params = [] - request_params = [] - multipart_params = [] - extra_body_params = [] - - for param_name, parameter in signature.parameters.items(): - param_type = _get_annotation_type(parameter.annotation, func_ref) - - # omit "self" for instance methods - if param_name == "self" and param_type is inspect.Parameter.empty: - continue - - # check if all parameters have explicit type - if parameter.annotation is inspect.Parameter.empty: - raise ValidationError( - f"parameter '{param_name}' in function '{func_name}' has no type annotation" - ) - - # Check if this is an extra_body parameter - is_extra_body, extra_body_desc = _is_extra_body_param(param_type) - if is_extra_body: - # Store in a separate list for documentation - extra_body_params.append((param_name, param_type, extra_body_desc)) - continue # Skip adding to request_params - - is_multipart = _is_multipart_param(param_type) - - if prefix in ["get", "delete"]: - if route_params is not None and param_name in route_params: - path_params.append((param_name, param_type)) - else: - query_params.append((param_name, param_type)) - else: - if route_params is not None and param_name in route_params: - path_params.append((param_name, param_type)) - elif is_multipart: - multipart_params.append((param_name, param_type)) - else: - request_params.append((param_name, param_type)) - - # check if function has explicit return type - if signature.return_annotation is inspect.Signature.empty: - raise ValidationError( - f"function '{func_name}' has no return type annotation" - ) - - return_type = _get_annotation_type(signature.return_annotation, func_ref) - - # operations that produce events are labeled as Generator[YieldType, SendType, ReturnType] - # where YieldType is the event type, SendType is None, and ReturnType is the immediate response type to the request - if typing.get_origin(return_type) is collections.abc.Generator: - event_type, send_type, response_type = typing.get_args(return_type) - if send_type is not type(None): - raise ValidationError( - f"function '{func_name}' has a return type Generator[Y,S,R] and therefore looks like an event but has an explicit send type" - ) - else: - event_type = None - - def process_type(t): - if typing.get_origin(t) is collections.abc.AsyncIterator: - # NOTE(ashwin): this is SSE and there is no way to represent it. either we make it a List - # or the item type. I am choosing it to be the latter - args = typing.get_args(t) - return args[0] - elif typing.get_origin(t) is typing.Union: - types = [process_type(a) for a in typing.get_args(t)] - return typing._UnionGenericAlias(typing.Union, tuple(types)) - else: - return t - - response_type = process_type(return_type) - - if prefix in ["delete", "remove"]: - http_method = HTTPMethod.DELETE - elif prefix == "post": - http_method = HTTPMethod.POST - elif prefix == "get": - http_method = HTTPMethod.GET - elif prefix == "set": - http_method = HTTPMethod.PUT - elif prefix == "update": - http_method = HTTPMethod.PATCH - else: - raise ValidationError(f"unknown prefix {prefix}") - - # Create an EndpointOperation for this specific webmethod - operation = EndpointOperation( - defining_class=_get_defining_class(func_name, endpoint), - name=operation_name, - func_name=func_name, - func_ref=func_ref, - route=route, - path_params=path_params, - query_params=query_params, - request_params=request_params, - multipart_params=multipart_params, - extra_body_params=extra_body_params, - event_type=event_type, - response_type=response_type, - http_method=http_method, - public=public, - request_examples=request_examples if use_examples else None, - response_examples=response_examples if use_examples else None, - ) - - # Store the specific webmethod with this operation - operation.webmethod = webmethod - result.append(operation) - - if not result: - raise ValidationError(f"no eligible endpoint operations in type {endpoint}") - - return result - - -def get_endpoint_events(endpoint: type) -> Dict[str, type]: - results = {} - - for decl in typing.get_type_hints(endpoint).values(): - # check if signature is Callable[...] - origin = typing.get_origin(decl) - if origin is None or not issubclass(origin, Callable): # type: ignore - continue - - # check if signature is Callable[[...], Any] - args = typing.get_args(decl) - if len(args) != 2: - continue - params_type, return_type = args - if not isinstance(params_type, list): - continue - - # check if signature is Callable[[...], None] - if not issubclass(return_type, type(None)): - continue - - # check if signature is Callable[[EventType], None] - if len(params_type) != 1: - continue - - param_type = params_type[0] - results[param_type.__name__] = param_type - - return results - - -def _is_multipart_param(param_type: type) -> bool: - """ - Check if a parameter type indicates multipart form data. - - Returns True if the type is: - - UploadFile - - Annotated[UploadFile, File()] - - Annotated[str, Form()] - - Annotated[Any, File()] - - Annotated[Any, Form()] - """ - if param_type is UploadFile: - return True - - # Check for Annotated types - origin = get_origin(param_type) - if origin is None: - return False - - if origin is Annotated: - args = get_args(param_type) - if len(args) < 2: - return False - - # Check the annotations for File() or Form() - for annotation in args[1:]: - if isinstance(annotation, (File, Form)): - return True - return False - - -def _is_extra_body_param(param_type: type) -> tuple[bool, str | None]: - """ - Check if parameter is marked as coming from extra_body. - - Returns: - (is_extra_body, description): Tuple of boolean and optional description - """ - origin = get_origin(param_type) - if origin is Annotated: - args = get_args(param_type) - for annotation in args[1:]: - if isinstance(annotation, ExtraBodyField): - return True, annotation.description - # Also check by type name for cases where import matters - if type(annotation).__name__ == 'ExtraBodyField': - return True, getattr(annotation, 'description', None) - return False, None diff --git a/docs/openapi_generator/pyopenapi/options.py b/docs/openapi_generator/pyopenapi/options.py deleted file mode 100644 index 53855b5b67..0000000000 --- a/docs/openapi_generator/pyopenapi/options.py +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -import dataclasses -from dataclasses import dataclass -from http import HTTPStatus -from typing import Callable, ClassVar, Dict, List, Optional, Tuple, Union - -from .specification import ( - Info, - SecurityScheme, - SecuritySchemeAPI, - SecuritySchemeHTTP, - SecuritySchemeOpenIDConnect, - Server, -) - -HTTPStatusCode = Union[HTTPStatus, int, str] - - -@dataclass -class Options: - """ - :param server: Base URL for the API endpoint. - :param info: Meta-information for the endpoint specification. - :param version: OpenAPI specification version as a tuple of major, minor, revision. - :param default_security_scheme: Security scheme to apply to endpoints, unless overridden on a per-endpoint basis. - :param extra_types: Extra types in addition to those found in operation signatures. Use a dictionary to group related types. - :param use_examples: Whether to emit examples for operations. - :param success_responses: Associates operation response types with HTTP status codes. - :param error_responses: Associates error response types with HTTP status codes. - :param error_wrapper: True if errors are encapsulated in an error object wrapper. - :param property_description_fun: Custom transformation function to apply to class property documentation strings. - :param captions: User-defined captions for sections such as "Operations" or "Types", and (if applicable) groups of extra types. - :param include_standard_error_responses: Whether to include standard error responses (400, 429, 500, 503) in all operations. - """ - - server: Server - info: Info - version: Tuple[int, int, int] = (3, 1, 0) - default_security_scheme: Optional[SecurityScheme] = None - extra_types: Union[List[type], Dict[str, List[type]], None] = None - use_examples: bool = True - success_responses: Dict[type, HTTPStatusCode] = dataclasses.field( - default_factory=dict - ) - error_responses: Dict[type, HTTPStatusCode] = dataclasses.field( - default_factory=dict - ) - error_wrapper: bool = False - property_description_fun: Optional[Callable[[type, str, str], str]] = None - captions: Optional[Dict[str, str]] = None - include_standard_error_responses: bool = True - stability_filter: Optional[str] = None - - default_captions: ClassVar[Dict[str, str]] = { - "Operations": "Operations", - "Types": "Types", - "Events": "Events", - "AdditionalTypes": "Additional types", - } - - def map(self, id: str) -> str: - "Maps a language-neutral placeholder string to language-dependent text." - - if self.captions is not None: - caption = self.captions.get(id) - if caption is not None: - return caption - - caption = self.__class__.default_captions.get(id) - if caption is not None: - return caption - - raise KeyError(f"no caption found for ID: {id}") diff --git a/docs/openapi_generator/pyopenapi/specification.py b/docs/openapi_generator/pyopenapi/specification.py deleted file mode 100644 index 90bf543166..0000000000 --- a/docs/openapi_generator/pyopenapi/specification.py +++ /dev/null @@ -1,269 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -import dataclasses -import enum -from dataclasses import dataclass -from typing import Any, ClassVar, Dict, List, Optional, Union - -from llama_stack.strong_typing.schema import JsonType, Schema, StrictJsonType - -URL = str - - -@dataclass -class Ref: - ref_type: ClassVar[str] - id: str - - def to_json(self) -> StrictJsonType: - return {"$ref": f"#/components/{self.ref_type}/{self.id}"} - - -@dataclass -class SchemaRef(Ref): - ref_type: ClassVar[str] = "schemas" - - -SchemaOrRef = Union[Schema, SchemaRef] - - -@dataclass -class ResponseRef(Ref): - ref_type: ClassVar[str] = "responses" - - -@dataclass -class ParameterRef(Ref): - ref_type: ClassVar[str] = "parameters" - - -@dataclass -class ExampleRef(Ref): - ref_type: ClassVar[str] = "examples" - - -@dataclass -class Contact: - name: Optional[str] = None - url: Optional[URL] = None - email: Optional[str] = None - - -@dataclass -class License: - name: str - url: Optional[URL] = None - - -@dataclass -class Info: - title: str - version: str - description: Optional[str] = None - termsOfService: Optional[str] = None - contact: Optional[Contact] = None - license: Optional[License] = None - - -@dataclass -class MediaType: - schema: Optional[SchemaOrRef] = None - example: Optional[Any] = None - examples: Optional[Dict[str, Union["Example", ExampleRef]]] = None - - -@dataclass -class RequestBody: - content: Dict[str, MediaType | Dict[str, Any]] - description: Optional[str] = None - required: Optional[bool] = None - - -@dataclass -class Response: - description: str - content: Optional[Dict[str, MediaType]] = None - - -class ParameterLocation(enum.Enum): - Query = "query" - Header = "header" - Path = "path" - Cookie = "cookie" - - -@dataclass -class Parameter: - name: str - in_: ParameterLocation - description: Optional[str] = None - required: Optional[bool] = None - schema: Optional[SchemaOrRef] = None - example: Optional[Any] = None - - -@dataclass -class ExtraBodyParameter: - """Represents a parameter that arrives via extra_body in the request.""" - name: str - schema: SchemaOrRef - description: Optional[str] = None - required: Optional[bool] = None - - -@dataclass -class Operation: - responses: Dict[str, Union[Response, ResponseRef]] - tags: Optional[List[str]] = None - summary: Optional[str] = None - description: Optional[str] = None - operationId: Optional[str] = None - parameters: Optional[List[Parameter]] = None - requestBody: Optional[RequestBody] = None - callbacks: Optional[Dict[str, "Callback"]] = None - security: Optional[List["SecurityRequirement"]] = None - deprecated: Optional[bool] = None - extraBodyParameters: Optional[List[ExtraBodyParameter]] = None - - -@dataclass -class PathItem: - summary: Optional[str] = None - description: Optional[str] = None - get: Optional[Operation] = None - put: Optional[Operation] = None - post: Optional[Operation] = None - delete: Optional[Operation] = None - options: Optional[Operation] = None - head: Optional[Operation] = None - patch: Optional[Operation] = None - trace: Optional[Operation] = None - - def update(self, other: "PathItem") -> None: - "Merges another instance of this class into this object." - - for field in dataclasses.fields(self.__class__): - value = getattr(other, field.name) - if value is not None: - setattr(self, field.name, value) - - -# maps run-time expressions such as "$request.body#/url" to path items -Callback = Dict[str, PathItem] - - -@dataclass -class Example: - summary: Optional[str] = None - description: Optional[str] = None - value: Optional[Any] = None - externalValue: Optional[URL] = None - - -@dataclass -class Server: - url: URL - description: Optional[str] = None - - -class SecuritySchemeType(enum.Enum): - ApiKey = "apiKey" - HTTP = "http" - OAuth2 = "oauth2" - OpenIDConnect = "openIdConnect" - - -@dataclass -class SecurityScheme: - type: SecuritySchemeType - description: str - - -@dataclass(init=False) -class SecuritySchemeAPI(SecurityScheme): - name: str - in_: ParameterLocation - - def __init__(self, description: str, name: str, in_: ParameterLocation) -> None: - super().__init__(SecuritySchemeType.ApiKey, description) - self.name = name - self.in_ = in_ - - -@dataclass(init=False) -class SecuritySchemeHTTP(SecurityScheme): - scheme: str - bearerFormat: Optional[str] = None - - def __init__( - self, description: str, scheme: str, bearerFormat: Optional[str] = None - ) -> None: - super().__init__(SecuritySchemeType.HTTP, description) - self.scheme = scheme - self.bearerFormat = bearerFormat - - -@dataclass(init=False) -class SecuritySchemeOpenIDConnect(SecurityScheme): - openIdConnectUrl: str - - def __init__(self, description: str, openIdConnectUrl: str) -> None: - super().__init__(SecuritySchemeType.OpenIDConnect, description) - self.openIdConnectUrl = openIdConnectUrl - - -@dataclass -class Components: - schemas: Optional[Dict[str, Schema]] = None - responses: Optional[Dict[str, Response]] = None - parameters: Optional[Dict[str, Parameter]] = None - examples: Optional[Dict[str, Example]] = None - requestBodies: Optional[Dict[str, RequestBody]] = None - securitySchemes: Optional[Dict[str, SecurityScheme]] = None - callbacks: Optional[Dict[str, Callback]] = None - - -SecurityScope = str -SecurityRequirement = Dict[str, List[SecurityScope]] - - -@dataclass -class Tag: - name: str - description: Optional[str] = None - displayName: Optional[str] = None - - -@dataclass -class TagGroup: - """ - A ReDoc extension to provide information about groups of tags. - - Exposed via the vendor-specific property "x-tagGroups" of the top-level object. - """ - - name: str - tags: List[str] - - -@dataclass -class Document: - """ - This class is a Python dataclass adaptation of the OpenAPI Specification. - - For details, see - """ - - openapi: str - info: Info - servers: List[Server] - paths: Dict[str, PathItem] - jsonSchemaDialect: Optional[str] = None - components: Optional[Components] = None - security: Optional[List[SecurityRequirement]] = None - tags: Optional[List[Tag]] = None - tagGroups: Optional[List[TagGroup]] = None diff --git a/docs/openapi_generator/pyopenapi/template.html b/docs/openapi_generator/pyopenapi/template.html deleted file mode 100644 index 5848f364ed..0000000000 --- a/docs/openapi_generator/pyopenapi/template.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - OpenAPI specification - - - - - - - - - - - - - diff --git a/docs/openapi_generator/pyopenapi/utility.py b/docs/openapi_generator/pyopenapi/utility.py deleted file mode 100644 index c1425b250f..0000000000 --- a/docs/openapi_generator/pyopenapi/utility.py +++ /dev/null @@ -1,288 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -import json -import typing -import inspect -from pathlib import Path -from typing import Any, List, Optional, TextIO, Union, get_type_hints, get_origin, get_args - -from pydantic import BaseModel -from llama_stack.strong_typing.schema import object_to_json, StrictJsonType -from llama_stack.strong_typing.inspection import is_unwrapped_body_param -from llama_stack.core.resolver import api_protocol_map - -from .generator import Generator -from .options import Options -from .specification import Document - -THIS_DIR = Path(__file__).parent - - -class Specification: - document: Document - - def __init__(self, endpoint: type, options: Options): - generator = Generator(endpoint, options) - self.document = generator.generate() - - def get_json(self) -> StrictJsonType: - """ - Returns the OpenAPI specification as a Python data type (e.g. `dict` for an object, `list` for an array). - - The result can be serialized to a JSON string with `json.dump` or `json.dumps`. - """ - - json_doc = typing.cast(StrictJsonType, object_to_json(self.document)) - - if isinstance(json_doc, dict): - # rename vendor-specific properties - tag_groups = json_doc.pop("tagGroups", None) - if tag_groups: - json_doc["x-tagGroups"] = tag_groups - tags = json_doc.get("tags") - if tags and isinstance(tags, list): - for tag in tags: - if not isinstance(tag, dict): - continue - - display_name = tag.pop("displayName", None) - if display_name: - tag["x-displayName"] = display_name - - # Handle operations to rename extraBodyParameters -> x-llama-stack-extra-body-params - paths = json_doc.get("paths", {}) - for path_item in paths.values(): - if isinstance(path_item, dict): - for method in ["get", "post", "put", "delete", "patch"]: - operation = path_item.get(method) - if operation and isinstance(operation, dict): - extra_body_params = operation.pop("extraBodyParameters", None) - if extra_body_params: - operation["x-llama-stack-extra-body-params"] = extra_body_params - - return json_doc - - def get_json_string(self, pretty_print: bool = False) -> str: - """ - Returns the OpenAPI specification as a JSON string. - - :param pretty_print: Whether to use line indents to beautify the output. - """ - - json_doc = self.get_json() - if pretty_print: - return json.dumps( - json_doc, check_circular=False, ensure_ascii=False, indent=4 - ) - else: - return json.dumps( - json_doc, - check_circular=False, - ensure_ascii=False, - separators=(",", ":"), - ) - - def write_json(self, f: TextIO, pretty_print: bool = False) -> None: - """ - Writes the OpenAPI specification to a file as a JSON string. - - :param pretty_print: Whether to use line indents to beautify the output. - """ - - json_doc = self.get_json() - if pretty_print: - json.dump( - json_doc, - f, - check_circular=False, - ensure_ascii=False, - indent=4, - ) - else: - json.dump( - json_doc, - f, - check_circular=False, - ensure_ascii=False, - separators=(",", ":"), - ) - - def write_html(self, f: TextIO, pretty_print: bool = False) -> None: - """ - Creates a stand-alone HTML page for the OpenAPI specification with ReDoc. - - :param pretty_print: Whether to use line indents to beautify the JSON string in the HTML file. - """ - - path = THIS_DIR / "template.html" - with path.open(encoding="utf-8", errors="strict") as html_template_file: - html_template = html_template_file.read() - - html = html_template.replace( - "{ /* OPENAPI_SPECIFICATION */ }", - self.get_json_string(pretty_print=pretty_print), - ) - - f.write(html) - -def is_optional_type(type_: Any) -> bool: - """Check if a type is Optional.""" - origin = get_origin(type_) - args = get_args(type_) - return origin is Optional or (origin is Union and type(None) in args) - - -def _validate_api_method_return_type(method) -> str | None: - hints = get_type_hints(method) - - if 'return' not in hints: - return "has no return type annotation" - - return_type = hints['return'] - if is_optional_type(return_type): - return "returns Optional type where a return value is mandatory" - - -def _validate_api_method_doesnt_return_list(method) -> str | None: - hints = get_type_hints(method) - - if 'return' not in hints: - return "has no return type annotation" - - return_type = hints['return'] - if get_origin(return_type) is list: - return "returns a list where a PaginatedResponse or List*Response object is expected" - - -def _validate_api_delete_method_returns_none(method) -> str | None: - hints = get_type_hints(method) - - if 'return' not in hints: - return "has no return type annotation" - - return_type = hints['return'] - - # Allow OpenAI endpoints to return response objects since they follow OpenAI specification - method_name = getattr(method, '__name__', '') - if method_name.__contains__('openai_'): - return None - - if return_type is not None and return_type is not type(None): - return "does not return None where None is mandatory" - - -def _validate_list_parameters_contain_data(method) -> str | None: - hints = get_type_hints(method) - - if 'return' not in hints: - return "has no return type annotation" - - return_type = hints['return'] - if not inspect.isclass(return_type): - return - - if not return_type.__name__.startswith('List'): - return - - if 'data' not in return_type.model_fields: - return "does not have a mandatory data attribute containing the list of objects" - - -def _validate_has_ellipsis(method) -> str | None: - source = inspect.getsource(method) - if "..." not in source and not "NotImplementedError" in source: - return "does not contain ellipsis (...) in its implementation" - -def _validate_has_return_in_docstring(method) -> str | None: - source = inspect.getsource(method) - return_type = method.__annotations__.get('return') - if return_type is not None and return_type != type(None) and ":returns:" not in source: - return "does not have a ':returns:' in its docstring" - -def _validate_has_params_in_docstring(method) -> str | None: - source = inspect.getsource(method) - sig = inspect.signature(method) - - params_list = [p for p in sig.parameters.values() if p.name != "self"] - if len(params_list) == 1: - param = params_list[0] - param_type = param.annotation - if is_unwrapped_body_param(param_type): - return - - # Only check if the method has more than one parameter - if len(sig.parameters) > 1 and ":param" not in source: - return "does not have a ':param' in its docstring" - -def _validate_has_no_return_none_in_docstring(method) -> str | None: - source = inspect.getsource(method) - return_type = method.__annotations__.get('return') - if return_type is None and ":returns: None" in source: - return "has a ':returns: None' in its docstring which is redundant for None-returning functions" - -def _validate_docstring_lines_end_with_dot(method) -> str | None: - docstring = inspect.getdoc(method) - if docstring is None: - return None - - lines = docstring.split('\n') - for line in lines: - line = line.strip() - if line and not any(line.endswith(char) for char in '.:{}[]()",'): - return f"docstring line '{line}' does not end with a valid character: . : {{ }} [ ] ( ) , \"" - -_VALIDATORS = { - "GET": [ - _validate_api_method_return_type, - _validate_list_parameters_contain_data, - _validate_api_method_doesnt_return_list, - _validate_has_ellipsis, - _validate_has_return_in_docstring, - _validate_has_params_in_docstring, - _validate_docstring_lines_end_with_dot, - ], - "DELETE": [ - _validate_api_delete_method_returns_none, - _validate_has_ellipsis, - _validate_has_return_in_docstring, - _validate_has_params_in_docstring, - _validate_has_no_return_none_in_docstring - ], - "POST": [ - _validate_has_ellipsis, - _validate_has_return_in_docstring, - _validate_has_params_in_docstring, - _validate_has_no_return_none_in_docstring, - _validate_docstring_lines_end_with_dot, - ], -} - - -def _get_methods_by_type(protocol, method_type: str): - members = inspect.getmembers(protocol, predicate=inspect.isfunction) - return { - method_name: method - for method_name, method in members - if (webmethod := getattr(method, '__webmethod__', None)) - if webmethod and webmethod.method == method_type - } - - -def validate_api() -> List[str]: - """Validate the API protocols.""" - errors = [] - protocols = api_protocol_map() - - for target, validators in _VALIDATORS.items(): - for protocol_name, protocol in protocols.items(): - for validator in validators: - for method_name, method in _get_methods_by_type(protocol, target).items(): - err = validator(method) - if err: - errors.append(f"Method {protocol_name}.{method_name} {err}") - - return errors diff --git a/docs/openapi_generator/run_openapi_generator.sh b/docs/openapi_generator/run_openapi_generator.sh deleted file mode 100755 index 6cffd42b06..0000000000 --- a/docs/openapi_generator/run_openapi_generator.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -PYTHONPATH=${PYTHONPATH:-} -THIS_DIR="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" - -set -euo pipefail - -missing_packages=() - -check_package() { - if ! pip show "$1" &>/dev/null; then - missing_packages+=("$1") - fi -} - -if [ ${#missing_packages[@]} -ne 0 ]; then - echo "Error: The following package(s) are not installed:" - printf " - %s\n" "${missing_packages[@]}" - echo "Please install them using:" - echo "pip install ${missing_packages[*]}" - exit 1 -fi - -stack_dir=$(dirname $(dirname $THIS_DIR)) -PYTHONPATH=$PYTHONPATH:$stack_dir \ - python -m docs.openapi_generator.generate $(dirname $THIS_DIR)/static - -cp $stack_dir/docs/static/stainless-llama-stack-spec.yaml $stack_dir/client-sdks/stainless/openapi.yml diff --git a/docs/static/deprecated-llama-stack-spec.yaml b/docs/static/deprecated-llama-stack-spec.yaml index 3bc965eb75..d77423732c 100644 --- a/docs/static/deprecated-llama-stack-spec.yaml +++ b/docs/static/deprecated-llama-stack-spec.yaml @@ -1,16 +1,8 @@ openapi: 3.1.0 info: - title: >- - Llama Stack Specification - Deprecated APIs - version: v1 - description: >- - This is the specification of the Llama Stack that provides - a set of endpoints and their corresponding interfaces that are - tailored to - best leverage Llama Models. - - **⚠️ DEPRECATED**: Legacy APIs that may be removed in future versions. Use for - migration reference only. + title: Llama Stack API + description: A comprehensive API for building and deploying AI applications + version: 1.0.0 servers: - url: http://any-hosted-llama-stack.com paths: {} @@ -58,8 +50,7 @@ components: title: Bad Request detail: The request was invalid or malformed TooManyRequests429: - description: >- - The client has sent too many requests in a given amount of time + description: The client has sent too many requests in a given amount of time content: application/json: schema: @@ -67,11 +58,9 @@ components: example: status: 429 title: Too Many Requests - detail: >- - You have exceeded the rate limit. Please try again later. + detail: You have exceeded the rate limit. Please try again later. InternalServerError500: - description: >- - The server encountered an unexpected error + description: The server encountered an unexpected error content: application/json: schema: @@ -79,10 +68,9 @@ components: example: status: 500 title: Internal Server Error - detail: >- - An unexpected error occurred. Our team has been notified. + detail: An unexpected error occurred DefaultError: - description: An unexpected error occurred + description: An error occurred content: application/json: schema: diff --git a/docs/static/experimental-llama-stack-spec.yaml b/docs/static/experimental-llama-stack-spec.yaml index 0a52bc89b2..c81b375b02 100644 --- a/docs/static/experimental-llama-stack-spec.yaml +++ b/docs/static/experimental-llama-stack-spec.yaml @@ -1,55 +1,76 @@ openapi: 3.1.0 info: - title: >- - Llama Stack Specification - Experimental APIs - version: v1 - description: >- - This is the specification of the Llama Stack that provides - a set of endpoints and their corresponding interfaces that are - tailored to - best leverage Llama Models. - - **🧪 EXPERIMENTAL**: Pre-release APIs (v1alpha, v1beta) that may change before - becoming stable. + title: Llama Stack API + description: A comprehensive API for building and deploying AI applications + version: 1.0.0 servers: - - url: http://any-hosted-llama-stack.com +- url: https://api.llamastack.com + description: Production server +- url: https://staging-api.llamastack.com + description: Staging server paths: /v1beta/datasetio/append-rows/{dataset_id}: post: + tags: + - V1Beta + summary: Append Rows + description: Generic endpoint - this would be replaced with actual implementation. + operationId: append_rows_v1beta_datasetio_append_rows__dataset_id__post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1beta/datasetio/iterrows/{dataset_id}: + get: tags: - - DatasetIO - summary: Append rows to a dataset. - description: Append rows to a dataset. + - V1Beta + summary: Iterrows + description: Query endpoint for proper schema generation. + operationId: iterrows_v1beta_datasetio_iterrows__dataset_id__get parameters: - - name: dataset_id - in: path - description: >- - The ID of the dataset to append the rows to. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AppendRowsRequest' + - name: dataset_id + in: path required: true - deprecated: false - /v1beta/datasetio/iterrows/{dataset_id}: - get: + schema: + type: string + title: Dataset Id + - name: start_index + in: query + required: false + schema: + type: integer + title: Start Index + - name: limit + in: query + required: false + schema: + type: integer + title: Limit responses: '200': description: A PaginatedResponse. @@ -59,57 +80,23 @@ paths: $ref: '#/components/schemas/PaginatedResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - DatasetIO - summary: >- - Get a paginated list of rows from a dataset. - description: >- - Get a paginated list of rows from a dataset. - - Uses offset-based pagination where: - - - start_index: The starting index (0-based). If None, starts from beginning. - - - limit: Number of items to return. If None or -1, returns all items. - - - The response includes: - - - data: List of items for the current page. - - - has_more: Whether there are more items available after this set. - parameters: - - name: dataset_id - in: path - description: >- - The ID of the dataset to get the rows from. - required: true - schema: - type: string - - name: start_index - in: query - description: >- - Index into dataset for the first row to get. Get all rows if None. - required: false - schema: - type: integer - - name: limit - in: query - description: The number of rows to get. - required: false - schema: - type: integer - deprecated: false + description: Default Response /v1beta/datasets: get: + tags: + - V1Beta + summary: List Datasets + description: Response-only endpoint for proper schema generation. + operationId: list_datasets_v1beta_datasets_get responses: '200': description: A ListDatasetsResponse. @@ -119,21 +106,40 @@ paths: $ref: '#/components/schemas/ListDatasetsResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Datasets - summary: List all datasets. - description: List all datasets. - parameters: [] - deprecated: false + description: Default Response post: + tags: + - V1Beta + summary: Register Dataset + description: Query endpoint for proper schema generation. + operationId: register_dataset_v1beta_datasets_post + parameters: + - name: purpose + in: query + required: false + schema: + $ref: '#/components/schemas/DatasetPurpose' + - name: metadata + in: query + required: false + schema: + type: string + title: Metadata + - name: dataset_id + in: query + required: false + schema: + type: string + title: Dataset Id responses: '200': description: A Dataset. @@ -143,85 +149,104 @@ paths: $ref: '#/components/schemas/Dataset' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1beta/datasets/{dataset_id}: + delete: tags: - - Datasets - summary: Register a new dataset. - description: Register a new dataset. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterDatasetRequest' + - V1Beta + summary: Unregister Dataset + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_dataset_v1beta_datasets__dataset_id__delete + parameters: + - name: args + in: query required: true - deprecated: false - /v1beta/datasets/{dataset_id}: - get: + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: A Dataset. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/Dataset' + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Datasets - summary: Get a dataset by its ID. - description: Get a dataset by its ID. + - V1Beta + summary: Get Dataset + description: Query endpoint for proper schema generation. + operationId: get_dataset_v1beta_datasets__dataset_id__get parameters: - - name: dataset_id - in: path - description: The ID of the dataset to get. - required: true - schema: - type: string - deprecated: false - delete: + - name: dataset_id + in: path + required: true + schema: + type: string + title: Dataset Id responses: '200': - description: OK + description: A Dataset. + content: + application/json: + schema: + $ref: '#/components/schemas/Dataset' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Datasets - summary: Unregister a dataset by its ID. - description: Unregister a dataset by its ID. - parameters: - - name: dataset_id - in: path - description: The ID of the dataset to unregister. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1alpha/agents: get: + tags: + - V1Alpha + summary: List Agents + description: Query endpoint for proper schema generation. + operationId: list_agents_v1alpha_agents_get + parameters: + - name: start_index + in: query + required: false + schema: + type: integer + title: Start Index + - name: limit + in: query + required: false + schema: + type: integer + title: Limit responses: '200': description: A PaginatedResponse. @@ -231,126 +256,135 @@ paths: $ref: '#/components/schemas/PaginatedResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: List all agents. - description: List all agents. - parameters: - - name: start_index - in: query - description: The index to start the pagination from. - required: false - schema: - type: integer - - name: limit - in: query - description: The number of agents to return. - required: false - schema: - type: integer - deprecated: false + description: Default Response post: + tags: + - V1Alpha + summary: Create Agent + description: Typed endpoint for proper schema generation. + operationId: create_agent_v1alpha_agents_post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AgentConfig' responses: '200': - description: >- - An AgentCreateResponse with the agent ID. + description: An AgentCreateResponse with the agent ID. content: application/json: schema: $ref: '#/components/schemas/AgentCreateResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/agents/{agent_id}: + delete: tags: - - Agents - summary: >- - Create an agent with the given configuration. - description: >- - Create an agent with the given configuration. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateAgentRequest' + - V1Alpha + summary: Delete Agent + description: Generic endpoint - this would be replaced with actual implementation. + operationId: delete_agent_v1alpha_agents__agent_id__delete + parameters: + - name: args + in: query required: true - deprecated: false - /v1alpha/agents/{agent_id}: - get: + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: An Agent of the agent. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/Agent' + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Agents - summary: Describe an agent by its ID. - description: Describe an agent by its ID. + - V1Alpha + summary: Get Agent + description: Query endpoint for proper schema generation. + operationId: get_agent_v1alpha_agents__agent_id__get parameters: - - name: agent_id - in: path - description: ID of the agent. - required: true - schema: - type: string - deprecated: false - delete: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id responses: '200': - description: OK + description: An Agent of the agent. + content: + application/json: + schema: + $ref: '#/components/schemas/Agent' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: >- - Delete an agent by its ID and its associated sessions and turns. - description: >- - Delete an agent by its ID and its associated sessions and turns. - parameters: - - name: agent_id - in: path - description: The ID of the agent to delete. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1alpha/agents/{agent_id}/session: post: + tags: + - V1Alpha + summary: Create Agent Session + description: Query endpoint for proper schema generation. + operationId: create_agent_session_v1alpha_agents__agent_id__session_post + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + - name: session_name + in: query + required: false + schema: + type: string + title: Session Name responses: '200': description: An AgentSessionCreateResponse. @@ -360,167 +394,173 @@ paths: $ref: '#/components/schemas/AgentSessionCreateResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/agents/{agent_id}/session/{session_id}: + delete: tags: - - Agents - summary: Create a new session for an agent. - description: Create a new session for an agent. + - V1Alpha + summary: Delete Agents Session + description: Generic endpoint - this would be replaced with actual implementation. + operationId: delete_agents_session_v1alpha_agents__agent_id__session__session_id__delete parameters: - - name: agent_id - in: path - description: >- - The ID of the agent to create the session for. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateAgentSessionRequest' + - name: args + in: query required: true - deprecated: false - /v1alpha/agents/{agent_id}/session/{session_id}: - get: + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: A Session. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/Session' + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Agents - summary: Retrieve an agent session by its ID. - description: Retrieve an agent session by its ID. + - V1Alpha + summary: Get Agents Session + description: Query endpoint for proper schema generation. + operationId: get_agents_session_v1alpha_agents__agent_id__session__session_id__get parameters: - - name: session_id - in: path - description: The ID of the session to get. - required: true - schema: - type: string - - name: agent_id - in: path - description: >- - The ID of the agent to get the session for. - required: true - schema: - type: string - - name: turn_ids - in: query - description: >- - (Optional) List of turn IDs to filter the session by. - required: false - schema: - type: array - items: - type: string - deprecated: false - delete: + - name: session_id + in: path + required: true + schema: + type: string + title: Session Id + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + - name: turn_ids + in: query + required: false + schema: + type: string + title: Turn Ids responses: '200': - description: OK + description: A Session. + content: + application/json: + schema: + $ref: '#/components/schemas/Session' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: >- - Delete an agent session by its ID and its associated turns. - description: >- - Delete an agent session by its ID and its associated turns. - parameters: - - name: session_id - in: path - description: The ID of the session to delete. - required: true - schema: - type: string - - name: agent_id - in: path - description: >- - The ID of the agent to delete the session for. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1alpha/agents/{agent_id}/session/{session_id}/turn: post: + tags: + - V1Alpha + summary: Create Agent Turn + description: Query endpoint for proper schema generation. + operationId: create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + - name: session_id + in: path + required: true + schema: + type: string + title: Session Id + - name: stream + in: query + required: false + schema: + type: boolean + default: false + title: Stream + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Body_create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post' responses: '200': - description: >- - If stream=False, returns a Turn object. If stream=True, returns an SSE - event stream of AgentTurnResponseStreamChunk. + description: If stream=False, returns a Turn object. content: application/json: schema: $ref: '#/components/schemas/Turn' - text/event-stream: - schema: - $ref: '#/components/schemas/AgentTurnResponseStreamChunk' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}: + get: tags: - - Agents - summary: Create a new turn for an agent. - description: Create a new turn for an agent. + - V1Alpha + summary: Get Agents Turn + description: Query endpoint for proper schema generation. + operationId: get_agents_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__get parameters: - - name: agent_id - in: path - description: >- - The ID of the agent to create the turn for. - required: true - schema: - type: string - - name: session_id - in: path - description: >- - The ID of the session to create the turn for. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateAgentTurnRequest' + - name: agent_id + in: path required: true - deprecated: false - /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}: - get: + schema: + type: string + title: Agent Id + - name: session_id + in: path + required: true + schema: + type: string + title: Session Id + - name: turn_id + in: path + required: true + schema: + type: string + title: Turn Id responses: '200': description: A Turn. @@ -530,101 +570,106 @@ paths: $ref: '#/components/schemas/Turn' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: Retrieve an agent turn by its ID. - description: Retrieve an agent turn by its ID. - parameters: - - name: agent_id - in: path - description: The ID of the agent to get the turn for. - required: true - schema: - type: string - - name: session_id - in: path - description: >- - The ID of the session to get the turn for. - required: true - schema: - type: string - - name: turn_id - in: path - description: The ID of the turn to get. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume: post: + tags: + - V1Alpha + summary: Resume Agent Turn + description: Query endpoint for proper schema generation. + operationId: resume_agent_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__resume_post + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + - name: session_id + in: path + required: true + schema: + type: string + title: Session Id + - name: turn_id + in: path + required: true + schema: + type: string + title: Turn Id + - name: stream + in: query + required: false + schema: + type: boolean + default: false + title: Stream + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ToolResponse' responses: '200': - description: >- - A Turn object if stream is False, otherwise an AsyncIterator of AgentTurnResponseStreamChunk - objects. + description: A Turn object if stream is False, otherwise an AsyncIterator + of AgentTurnResponseStreamChunk objects. content: application/json: schema: $ref: '#/components/schemas/Turn' - text/event-stream: - schema: - $ref: '#/components/schemas/AgentTurnResponseStreamChunk' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}: + get: tags: - - Agents - summary: >- - Resume an agent turn with executed tool call responses. - description: >- - Resume an agent turn with executed tool call responses. - - When a Turn has the status `awaiting_input` due to pending input from client - side tool calls, this endpoint can be used to submit the outputs from the - tool calls once they are ready. + - V1Alpha + summary: Get Agents Step + description: Query endpoint for proper schema generation. + operationId: get_agents_step_v1alpha_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get parameters: - - name: agent_id - in: path - description: The ID of the agent to resume. - required: true - schema: - type: string - - name: session_id - in: path - description: The ID of the session to resume. - required: true - schema: - type: string - - name: turn_id - in: path - description: The ID of the turn to resume. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ResumeAgentTurnRequest' + - name: agent_id + in: path required: true - deprecated: false - /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}: - get: + schema: + type: string + title: Agent Id + - name: session_id + in: path + required: true + schema: + type: string + title: Session Id + - name: turn_id + in: path + required: true + schema: + type: string + title: Turn Id + - name: step_id + in: path + required: true + schema: + type: string + title: Step Id responses: '200': description: An AgentStepResponse. @@ -634,47 +679,42 @@ paths: $ref: '#/components/schemas/AgentStepResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: Retrieve an agent step by its ID. - description: Retrieve an agent step by its ID. - parameters: - - name: agent_id - in: path - description: The ID of the agent to get the step for. - required: true - schema: - type: string - - name: session_id - in: path - description: >- - The ID of the session to get the step for. - required: true - schema: - type: string - - name: turn_id - in: path - description: The ID of the turn to get the step for. - required: true - schema: - type: string - - name: step_id - in: path - description: The ID of the step to get. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1alpha/agents/{agent_id}/sessions: get: + tags: + - V1Alpha + summary: List Agent Sessions + description: Query endpoint for proper schema generation. + operationId: list_agent_sessions_v1alpha_agents__agent_id__sessions_get + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + - name: start_index + in: query + required: false + schema: + type: integer + title: Start Index + - name: limit + in: query + required: false + schema: + type: integer + title: Limit responses: '200': description: A PaginatedResponse. @@ -684,41 +724,23 @@ paths: $ref: '#/components/schemas/PaginatedResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: List all session(s) of a given agent. - description: List all session(s) of a given agent. - parameters: - - name: agent_id - in: path - description: >- - The ID of the agent to list sessions for. - required: true - schema: - type: string - - name: start_index - in: query - description: The index to start the pagination from. - required: false - schema: - type: integer - - name: limit - in: query - description: The number of sessions to return. - required: false - schema: - type: integer - deprecated: false + description: Default Response /v1alpha/eval/benchmarks: get: + tags: + - V1Alpha + summary: List Benchmarks + description: Response-only endpoint for proper schema generation. + operationId: list_benchmarks_v1alpha_eval_benchmarks_get responses: '200': description: A ListBenchmarksResponse. @@ -728,254 +750,277 @@ paths: $ref: '#/components/schemas/ListBenchmarksResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Benchmarks - summary: List all benchmarks. - description: List all benchmarks. - parameters: [] - deprecated: false + description: Default Response post: + tags: + - V1Alpha + summary: Register Benchmark + description: Generic endpoint - this would be replaced with actual implementation. + operationId: register_benchmark_v1alpha_eval_benchmarks_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/eval/benchmarks/{benchmark_id}: + delete: tags: - - Benchmarks - summary: Register a benchmark. - description: Register a benchmark. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterBenchmarkRequest' + - V1Alpha + summary: Unregister Benchmark + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_benchmark_v1alpha_eval_benchmarks__benchmark_id__delete + parameters: + - name: args + in: query required: true - deprecated: false - /v1alpha/eval/benchmarks/{benchmark_id}: - get: + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: A Benchmark. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/Benchmark' + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Benchmarks - summary: Get a benchmark by its ID. - description: Get a benchmark by its ID. + - V1Alpha + summary: Get Benchmark + description: Query endpoint for proper schema generation. + operationId: get_benchmark_v1alpha_eval_benchmarks__benchmark_id__get parameters: - - name: benchmark_id - in: path - description: The ID of the benchmark to get. - required: true - schema: - type: string - deprecated: false - delete: + - name: benchmark_id + in: path + required: true + schema: + type: string + title: Benchmark Id responses: '200': - description: OK + description: A Benchmark. + content: + application/json: + schema: + $ref: '#/components/schemas/Benchmark' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Benchmarks - summary: Unregister a benchmark. - description: Unregister a benchmark. - parameters: - - name: benchmark_id - in: path - description: The ID of the benchmark to unregister. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1alpha/eval/benchmarks/{benchmark_id}/evaluations: post: + tags: + - V1Alpha + summary: Evaluate Rows + description: Typed endpoint for proper schema generation. + operationId: evaluate_rows_v1alpha_eval_benchmarks__benchmark_id__evaluations_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BenchmarkConfig' + required: true responses: '200': - description: >- - EvaluateResponse object containing generations and scores. + description: EvaluateResponse object containing generations and scores. content: application/json: schema: $ref: '#/components/schemas/EvaluateResponse' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' + /v1alpha/eval/benchmarks/{benchmark_id}/jobs: + post: tags: - - Eval - summary: Evaluate a list of rows on a benchmark. - description: Evaluate a list of rows on a benchmark. - parameters: - - name: benchmark_id - in: path - description: >- - The ID of the benchmark to run the evaluation on. - required: true - schema: - type: string + - V1Alpha + summary: Run Eval + description: Typed endpoint for proper schema generation. + operationId: run_eval_v1alpha_eval_benchmarks__benchmark_id__jobs_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/EvaluateRowsRequest' + $ref: '#/components/schemas/BenchmarkConfig' required: true - deprecated: false - /v1alpha/eval/benchmarks/{benchmark_id}/jobs: - post: responses: '200': - description: >- - The job that was created to run the evaluation. + description: The job that was created to run the evaluation. content: application/json: schema: $ref: '#/components/schemas/Job' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' + /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}: + delete: tags: - - Eval - summary: Run an evaluation on a benchmark. - description: Run an evaluation on a benchmark. + - V1Alpha + summary: Job Cancel + description: Generic endpoint - this would be replaced with actual implementation. + operationId: job_cancel_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__delete parameters: - - name: benchmark_id - in: path - description: >- - The ID of the benchmark to run the evaluation on. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RunEvalRequest' + - name: args + in: query required: true - deprecated: false - /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}: - get: + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: The status of the evaluation job. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/Job' + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Eval - summary: Get the status of a job. - description: Get the status of a job. + - V1Alpha + summary: Job Status + description: Query endpoint for proper schema generation. + operationId: job_status_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__get parameters: - - name: benchmark_id - in: path - description: >- - The ID of the benchmark to run the evaluation on. - required: true - schema: - type: string - - name: job_id - in: path - description: The ID of the job to get the status of. - required: true - schema: - type: string - deprecated: false - delete: + - name: benchmark_id + in: path + required: true + schema: + type: string + title: Benchmark Id + - name: job_id + in: path + required: true + schema: + type: string + title: Job Id responses: '200': - description: OK + description: The status of the evaluation job. + content: + application/json: + schema: + $ref: '#/components/schemas/Job' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Eval - summary: Cancel a job. - description: Cancel a job. - parameters: - - name: benchmark_id - in: path - description: >- - The ID of the benchmark to run the evaluation on. - required: true - schema: - type: string - - name: job_id - in: path - description: The ID of the job to cancel. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result: get: + tags: + - V1Alpha + summary: Job Result + description: Query endpoint for proper schema generation. + operationId: job_result_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__result_get + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + title: Benchmark Id + - name: job_id + in: path + required: true + schema: + type: string + title: Job Id responses: '200': description: The result of the job. @@ -985,69 +1030,81 @@ paths: $ref: '#/components/schemas/EvaluateResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Eval - summary: Get the result of a job. - description: Get the result of a job. - parameters: - - name: benchmark_id - in: path - description: >- - The ID of the benchmark to run the evaluation on. - required: true - schema: - type: string - - name: job_id - in: path - description: The ID of the job to get the result of. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1alpha/inference/rerank: post: + tags: + - V1Alpha + summary: Rerank + description: Query endpoint for proper schema generation. + operationId: rerank_v1alpha_inference_rerank_post + parameters: + - name: model + in: query + required: false + schema: + type: string + title: Model + - name: query + in: query + required: false + schema: + type: string + title: Query + - name: items + in: query + required: false + schema: + type: string + title: Items + - name: max_num_results + in: query + required: false + schema: + type: integer + title: Max Num Results responses: '200': - description: >- - RerankResponse with indices sorted by relevance score (descending). + description: RerankResponse with indices sorted by relevance score (descending). content: application/json: schema: $ref: '#/components/schemas/RerankResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Inference - summary: >- - Rerank a list of documents based on their relevance to a query. - description: >- - Rerank a list of documents based on their relevance to a query. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RerankRequest' - required: true - deprecated: false + description: Default Response /v1alpha/post-training/job/artifacts: get: + tags: + - V1Alpha + summary: Get Training Job Artifacts + description: Query endpoint for proper schema generation. + operationId: get_training_job_artifacts_v1alpha_post_training_job_artifacts_get + parameters: + - name: job_uuid + in: query + required: false + schema: + type: string + title: Job Uuid responses: '200': description: A PostTrainingJobArtifactsResponse. @@ -1057,56 +1114,66 @@ paths: $ref: '#/components/schemas/PostTrainingJobArtifactsResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - PostTraining (Coming Soon) - summary: Get the artifacts of a training job. - description: Get the artifacts of a training job. - parameters: - - name: job_uuid - in: query - description: >- - The UUID of the job to get the artifacts of. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1alpha/post-training/job/cancel: post: + tags: + - V1Alpha + summary: Cancel Training Job + description: Generic endpoint - this would be replaced with actual implementation. + operationId: cancel_training_job_v1alpha_post_training_job_cancel_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - PostTraining (Coming Soon) - summary: Cancel a training job. - description: Cancel a training job. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CancelTrainingJobRequest' - required: true - deprecated: false + description: Default Response /v1alpha/post-training/job/status: get: + tags: + - V1Alpha + summary: Get Training Job Status + description: Query endpoint for proper schema generation. + operationId: get_training_job_status_v1alpha_post_training_job_status_get + parameters: + - name: job_uuid + in: query + required: false + schema: + type: string + title: Job Uuid responses: '200': description: A PostTrainingJobStatusResponse. @@ -1116,29 +1183,23 @@ paths: $ref: '#/components/schemas/PostTrainingJobStatusResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - PostTraining (Coming Soon) - summary: Get the status of a training job. - description: Get the status of a training job. - parameters: - - name: job_uuid - in: query - description: >- - The UUID of the job to get the status of. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1alpha/post-training/jobs: get: + tags: + - V1Alpha + summary: Get Training Jobs + description: Response-only endpoint for proper schema generation. + operationId: get_training_jobs_v1alpha_post_training_jobs_get responses: '200': description: A ListPostTrainingJobsResponse. @@ -1147,23 +1208,30 @@ paths: schema: $ref: '#/components/schemas/ListPostTrainingJobsResponse' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - PostTraining (Coming Soon) - summary: Get all training jobs. - description: Get all training jobs. - parameters: [] - deprecated: false /v1alpha/post-training/preference-optimize: post: + tags: + - V1Alpha + summary: Preference Optimize + description: Typed endpoint for proper schema generation. + operationId: preference_optimize_v1alpha_post_training_preference_optimize_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DPOAlignmentConfig' + required: true responses: '200': description: A PostTrainingJob. @@ -1172,29 +1240,30 @@ paths: schema: $ref: '#/components/schemas/PostTrainingJob' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' + /v1alpha/post-training/supervised-fine-tune: + post: tags: - - PostTraining (Coming Soon) - summary: Run preference optimization of a model. - description: Run preference optimization of a model. - parameters: [] + - V1Alpha + summary: Supervised Fine Tune + description: Typed endpoint for proper schema generation. + operationId: supervised_fine_tune_v1alpha_post_training_supervised_fine_tune_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/PreferenceOptimizeRequest' + $ref: '#/components/schemas/TrainingConfig' required: true - deprecated: false - /v1alpha/post-training/supervised-fine-tune: - post: responses: '200': description: A PostTrainingJob. @@ -1203,2819 +1272,1512 @@ paths: schema: $ref: '#/components/schemas/PostTrainingJob' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - PostTraining (Coming Soon) - summary: Run supervised fine-tuning of a model. - description: Run supervised fine-tuning of a model. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SupervisedFineTuneRequest' - required: true - deprecated: false -jsonSchemaDialect: >- - https://json-schema.org/draft/2020-12/schema components: schemas: - Error: - type: object + AgentCandidate: properties: - status: - type: integer - description: HTTP status code - title: + type: type: string - description: >- - Error title, a short summary of the error which is invariant for an error - type - detail: + const: agent + title: Type + default: agent + config: + $ref: '#/components/schemas/AgentConfig' + type: object + required: + - config + title: AgentCandidate + description: 'An agent candidate for evaluation. + + + :param config: The configuration for the agent candidate.' + AgentConfig: + properties: + sampling_params: + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' + input_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Input Shields + output_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields + toolgroups: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups + client_tools: + anyOf: + - items: + $ref: '#/components/schemas/ToolDef' + type: array + - type: 'null' + title: Client Tools + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: 'null' + deprecated: true + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + deprecated: true + tool_config: + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' + max_infer_iters: + anyOf: + - type: integer + - type: 'null' + title: Max Infer Iters + default: 10 + model: type: string - description: >- - Error detail, a longer human-readable description of the error - instance: + title: Model + instructions: type: string - description: >- - (Optional) A URL which can be used to retrieve more information about - the specific occurrence of the error - additionalProperties: false - required: - - status - - title - - detail - title: Error - description: >- - Error response from the API. Roughly follows RFC 7807. - AppendRowsRequest: + title: Instructions + name: + anyOf: + - type: string + - type: 'null' + title: Name + enable_session_persistence: + anyOf: + - type: boolean + - type: 'null' + title: Enable Session Persistence + default: false + response_format: + anyOf: + - oneOf: + - $ref: '#/components/schemas/JsonSchemaResponseFormat' + - $ref: '#/components/schemas/GrammarResponseFormat' + discriminator: + propertyName: type + mapping: + grammar: '#/components/schemas/GrammarResponseFormat' + json_schema: '#/components/schemas/JsonSchemaResponseFormat' + - type: 'null' + title: Response Format type: object - properties: - rows: - type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The rows to append to the dataset. - additionalProperties: false required: - - rows - title: AppendRowsRequest - PaginatedResponse: + - model + - instructions + title: AgentConfig + description: 'Configuration for an agent. + + + :param model: The model identifier to use for the agent + + :param instructions: The system instructions for the agent + + :param name: Optional name for the agent, used in telemetry and identification + + :param enable_session_persistence: Optional flag indicating whether session + data has to be persisted + + :param response_format: Optional response format configuration' + AgentCreateResponse: + properties: + agent_id: + type: string + title: Agent Id type: object + required: + - agent_id + title: AgentCreateResponse + description: 'Response returned when creating a new agent. + + + :param agent_id: Unique identifier for the created agent' + AgentToolGroupWithArgs: properties: - data: - type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The list of items for the current page - has_more: - type: boolean - description: >- - Whether there are more items available after this set - url: + name: type: string - description: The URL for accessing this list - additionalProperties: false + title: Name + args: + additionalProperties: true + type: object + title: Args + type: object required: - - data - - has_more - title: PaginatedResponse - description: >- - A generic paginated response that follows a simple format. - Dataset: + - name + - args + title: AgentToolGroupWithArgs + AggregationFunctionType: + type: string + enum: + - average + - weighted_average + - median + - categorical_count + - accuracy + title: AggregationFunctionType + description: 'Types of aggregation functions for scoring results. + + :cvar average: Calculate the arithmetic mean of scores + + :cvar weighted_average: Calculate a weighted average of scores + + :cvar median: Calculate the median value of scores + + :cvar categorical_count: Count occurrences of categorical values + + :cvar accuracy: Calculate accuracy as the proportion of correct answers' + BasicScoringFnParams: + properties: + type: + type: string + const: basic + title: Type + default: basic + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row type: object + title: BasicScoringFnParams + description: 'Parameters for basic scoring function configuration. + + :param type: The type of scoring function parameters, always basic + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row' + Benchmark: properties: identifier: type: string + title: Identifier + description: Unique identifier for this resource in llama stack provider_resource_id: - type: string + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider provider_id: type: string + title: Provider Id + description: ID of the provider that owns this resource type: type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: dataset - default: dataset - description: >- - Type of resource, always 'dataset' for datasets - purpose: + const: benchmark + title: Type + default: benchmark + dataset_id: type: string - enum: - - post-training/messages - - eval/question-answer - - eval/messages-answer - description: >- - Purpose of the dataset indicating its intended use - source: - oneOf: - - $ref: '#/components/schemas/URIDataSource' - - $ref: '#/components/schemas/RowsDataSource' - discriminator: - propertyName: type - mapping: - uri: '#/components/schemas/URIDataSource' - rows: '#/components/schemas/RowsDataSource' - description: >- - Data source configuration for the dataset - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Additional metadata for the dataset - additionalProperties: false - required: - - identifier - - provider_id - - type - - purpose - - source - - metadata - title: Dataset - description: >- - Dataset resource for storing and accessing training or evaluation data. - RowsDataSource: - type: object - properties: - type: - type: string - const: rows - default: rows - rows: - type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The dataset is stored in rows. E.g. - [ {"messages": [{"role": "user", - "content": "Hello, world!"}, {"role": "assistant", "content": "Hello, - world!"}]} ] - additionalProperties: false - required: - - type - - rows - title: RowsDataSource - description: A dataset stored in rows. - URIDataSource: - type: object - properties: - type: - type: string - const: uri - default: uri - uri: - type: string - description: >- - The dataset can be obtained from a URI. E.g. - "https://mywebsite.com/mydata.jsonl" - - "lsfs://mydata.jsonl" - "data:csv;base64,{base64_content}" - additionalProperties: false - required: - - type - - uri - title: URIDataSource - description: >- - A dataset that can be obtained from a URI. - ListDatasetsResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/Dataset' - description: List of datasets - additionalProperties: false - required: - - data - title: ListDatasetsResponse - description: Response from listing datasets. - DataSource: - oneOf: - - $ref: '#/components/schemas/URIDataSource' - - $ref: '#/components/schemas/RowsDataSource' - discriminator: - propertyName: type - mapping: - uri: '#/components/schemas/URIDataSource' - rows: '#/components/schemas/RowsDataSource' - RegisterDatasetRequest: - type: object - properties: - purpose: - type: string - enum: - - post-training/messages - - eval/question-answer - - eval/messages-answer - description: >- - The purpose of the dataset. One of: - "post-training/messages": The dataset - contains a messages column with list of messages for post-training. { - "messages": [ {"role": "user", "content": "Hello, world!"}, {"role": "assistant", - "content": "Hello, world!"}, ] } - "eval/question-answer": The dataset - contains a question column and an answer column for evaluation. { "question": - "What is the capital of France?", "answer": "Paris" } - "eval/messages-answer": - The dataset contains a messages column with list of messages and an answer - column for evaluation. { "messages": [ {"role": "user", "content": "Hello, - my name is John Doe."}, {"role": "assistant", "content": "Hello, John - Doe. How can I help you today?"}, {"role": "user", "content": "What's - my name?"}, ], "answer": "John Doe" } - source: - $ref: '#/components/schemas/DataSource' - description: >- - The data source of the dataset. Ensure that the data source schema is - compatible with the purpose of the dataset. Examples: - { "type": "uri", - "uri": "https://mywebsite.com/mydata.jsonl" } - { "type": "uri", "uri": - "lsfs://mydata.jsonl" } - { "type": "uri", "uri": "data:csv;base64,{base64_content}" - } - { "type": "uri", "uri": "huggingface://llamastack/simpleqa?split=train" - } - { "type": "rows", "rows": [ { "messages": [ {"role": "user", "content": - "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}, ] - } ] } - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The metadata for the dataset. - E.g. {"description": "My dataset"}. - dataset_id: - type: string - description: >- - The ID of the dataset. If not provided, an ID will be generated. - additionalProperties: false - required: - - purpose - - source - title: RegisterDatasetRequest - AgentConfig: - type: object - properties: - sampling_params: - $ref: '#/components/schemas/SamplingParams' - input_shields: - type: array - items: - type: string - output_shields: - type: array + title: Dataset Id + scoring_functions: items: type: string - toolgroups: type: array - items: - $ref: '#/components/schemas/AgentTool' - client_tools: - type: array - items: - $ref: '#/components/schemas/ToolDef' - tool_choice: - type: string - enum: - - auto - - required - - none - title: ToolChoice - description: >- - Whether tool use is required or automatic. This is a hint to the model - which may not be followed. It depends on the Instruction Following capabilities - of the model. - deprecated: true - tool_prompt_format: - type: string - enum: - - json - - function_tag - - python_list - title: ToolPromptFormat - description: >- - Prompt format for calling custom / zero shot tools. - deprecated: true - tool_config: - $ref: '#/components/schemas/ToolConfig' - max_infer_iters: - type: integer - default: 10 - model: - type: string - description: >- - The model identifier to use for the agent - instructions: - type: string - description: The system instructions for the agent - name: - type: string - description: >- - Optional name for the agent, used in telemetry and identification - enable_session_persistence: - type: boolean - default: false - description: >- - Optional flag indicating whether session data has to be persisted - response_format: - $ref: '#/components/schemas/ResponseFormat' - description: Optional response format configuration - additionalProperties: false - required: - - model - - instructions - title: AgentConfig - description: Configuration for an agent. - AgentTool: - oneOf: - - type: string - - type: object - properties: - name: - type: string - args: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - additionalProperties: false - required: - - name - - args - title: AgentToolGroupWithArgs - GrammarResponseFormat: - type: object - properties: - type: - type: string - enum: - - json_schema - - grammar - description: >- - Must be "grammar" to identify this format type - const: grammar - default: grammar - bnf: + title: Scoring Functions + metadata: + additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The BNF grammar specification the response should conform to - additionalProperties: false - required: - - type - - bnf - title: GrammarResponseFormat - description: >- - Configuration for grammar-guided response generation. - GreedySamplingStrategy: - type: object - properties: - type: - type: string - const: greedy - default: greedy - description: >- - Must be "greedy" to identify this sampling strategy - additionalProperties: false - required: - - type - title: GreedySamplingStrategy - description: >- - Greedy sampling strategy that selects the highest probability token at each - step. - JsonSchemaResponseFormat: + title: Metadata + description: Metadata for this evaluation task type: object - properties: - type: - type: string - enum: - - json_schema - - grammar - description: >- - Must be "json_schema" to identify this format type - const: json_schema - default: json_schema - json_schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The JSON schema the response should conform to. In a Python SDK, this - is often a `pydantic` model. - additionalProperties: false required: - - type - - json_schema - title: JsonSchemaResponseFormat - description: >- - Configuration for JSON schema-guided response generation. - ResponseFormat: - oneOf: - - $ref: '#/components/schemas/JsonSchemaResponseFormat' - - $ref: '#/components/schemas/GrammarResponseFormat' - discriminator: - propertyName: type - mapping: - json_schema: '#/components/schemas/JsonSchemaResponseFormat' - grammar: '#/components/schemas/GrammarResponseFormat' - SamplingParams: - type: object + - identifier + - provider_id + - dataset_id + - scoring_functions + title: Benchmark + description: 'A benchmark resource for evaluating model performance. + + + :param dataset_id: Identifier of the dataset to use for the benchmark evaluation + + :param scoring_functions: List of scoring function identifiers to apply during + evaluation + + :param metadata: Metadata for this evaluation task + + :param type: The resource type, always benchmark' + BenchmarkConfig: properties: - strategy: + eval_candidate: oneOf: - - $ref: '#/components/schemas/GreedySamplingStrategy' - - $ref: '#/components/schemas/TopPSamplingStrategy' - - $ref: '#/components/schemas/TopKSamplingStrategy' + - $ref: '#/components/schemas/ModelCandidate' + - $ref: '#/components/schemas/AgentCandidate' + title: Eval Candidate discriminator: propertyName: type mapping: - greedy: '#/components/schemas/GreedySamplingStrategy' - top_p: '#/components/schemas/TopPSamplingStrategy' - top_k: '#/components/schemas/TopKSamplingStrategy' - description: The sampling strategy. - max_tokens: - type: integer - description: >- - The maximum number of tokens that can be generated in the completion. - The token count of your prompt plus max_tokens cannot exceed the model's - context length. - repetition_penalty: - type: number - default: 1.0 - description: >- - Number between -2.0 and 2.0. Positive values penalize new tokens based - on whether they appear in the text so far, increasing the model's likelihood - to talk about new topics. - stop: - type: array - items: - type: string - description: >- - Up to 4 sequences where the API will stop generating further tokens. The - returned text will not contain the stop sequence. - additionalProperties: false - required: - - strategy - title: SamplingParams - description: Sampling parameters. - ToolConfig: - type: object - properties: - tool_choice: - oneOf: - - type: string - enum: - - auto - - required - - none - title: ToolChoice - description: >- - Whether tool use is required or automatic. This is a hint to the model - which may not be followed. It depends on the Instruction Following - capabilities of the model. - - type: string - default: auto - description: >- - (Optional) Whether tool use is automatic, required, or none. Can also - specify a tool name to use a specific tool. Defaults to ToolChoice.auto. - tool_prompt_format: - type: string - enum: - - json - - function_tag - - python_list - description: >- - (Optional) Instructs the model how to format tool calls. By default, Llama - Stack will attempt to use a format that is best adapted to the model. - - `ToolPromptFormat.json`: The tool calls are formatted as a JSON object. - - `ToolPromptFormat.function_tag`: The tool calls are enclosed in a - tag. - `ToolPromptFormat.python_list`: The tool calls are output as Python - syntax -- a list of function calls. - system_message_behavior: - type: string - enum: - - append - - replace - description: >- - (Optional) Config for how to override the default system prompt. - `SystemMessageBehavior.append`: - Appends the provided system message to the default system prompt. - `SystemMessageBehavior.replace`: - Replaces the default system prompt with the provided system message. The - system message can include the string '{{function_definitions}}' to indicate - where the function definitions should be inserted. - default: append - additionalProperties: false - title: ToolConfig - description: Configuration for tool use. - ToolDef: - type: object - properties: - toolgroup_id: - type: string - description: >- - (Optional) ID of the tool group this tool belongs to - name: - type: string - description: Name of the tool - description: - type: string - description: >- - (Optional) Human-readable description of what the tool does - input_schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON Schema for tool inputs (MCP inputSchema) - output_schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON Schema for tool outputs (MCP outputSchema) - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool - additionalProperties: false - required: - - name - title: ToolDef - description: >- - Tool definition used in runtime contexts. - TopKSamplingStrategy: - type: object - properties: - type: - type: string - const: top_k - default: top_k - description: >- - Must be "top_k" to identify this sampling strategy - top_k: - type: integer - description: >- - Number of top tokens to consider for sampling. Must be at least 1 - additionalProperties: false - required: - - type - - top_k - title: TopKSamplingStrategy - description: >- - Top-k sampling strategy that restricts sampling to the k most likely tokens. - TopPSamplingStrategy: - type: object - properties: - type: - type: string - const: top_p - default: top_p - description: >- - Must be "top_p" to identify this sampling strategy - temperature: - type: number - description: >- - Controls randomness in sampling. Higher values increase randomness - top_p: - type: number - default: 0.95 - description: >- - Cumulative probability threshold for nucleus sampling. Defaults to 0.95 - additionalProperties: false - required: - - type - title: TopPSamplingStrategy - description: >- - Top-p (nucleus) sampling strategy that samples from the smallest set of tokens - with cumulative probability >= p. - CreateAgentRequest: - type: object - properties: - agent_config: - $ref: '#/components/schemas/AgentConfig' - description: The configuration for the agent. - additionalProperties: false - required: - - agent_config - title: CreateAgentRequest - AgentCreateResponse: - type: object - properties: - agent_id: - type: string - description: Unique identifier for the created agent - additionalProperties: false - required: - - agent_id - title: AgentCreateResponse - description: >- - Response returned when creating a new agent. - Agent: - type: object - properties: - agent_id: - type: string - description: Unique identifier for the agent - agent_config: - $ref: '#/components/schemas/AgentConfig' - description: Configuration settings for the agent - created_at: - type: string - format: date-time - description: Timestamp when the agent was created - additionalProperties: false - required: - - agent_id - - agent_config - - created_at - title: Agent - description: >- - An agent instance with configuration and metadata. - CreateAgentSessionRequest: - type: object - properties: - session_name: - type: string - description: The name of the session to create. - additionalProperties: false - required: - - session_name - title: CreateAgentSessionRequest - AgentSessionCreateResponse: - type: object - properties: - session_id: - type: string - description: >- - Unique identifier for the created session - additionalProperties: false - required: - - session_id - title: AgentSessionCreateResponse - description: >- - Response returned when creating a new agent session. - CompletionMessage: - type: object - properties: - role: - type: string - const: assistant - default: assistant - description: >- - Must be "assistant" to identify this as the model's response - content: - $ref: '#/components/schemas/InterleavedContent' - description: The content of the model's response - stop_reason: - type: string - enum: - - end_of_turn - - end_of_message - - out_of_tokens - description: >- - Reason why the model stopped generating. Options are: - `StopReason.end_of_turn`: - The model finished generating the entire response. - `StopReason.end_of_message`: - The model finished generating but generated a partial response -- usually, - a tool call. The user may call the tool and continue the conversation - with the tool's response. - `StopReason.out_of_tokens`: The model ran - out of token budget. - tool_calls: - type: array - items: - $ref: '#/components/schemas/ToolCall' - description: >- - List of tool calls. Each tool call is a ToolCall object. - additionalProperties: false - required: - - role - - content - - stop_reason - title: CompletionMessage - description: >- - A message containing the model's (assistant) response in a chat conversation. - ImageContentItem: - type: object - properties: - type: - type: string - const: image - default: image - description: >- - Discriminator type of the content item. Always "image" - image: - type: object - properties: - url: - $ref: '#/components/schemas/URL' - description: >- - A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - data: - type: string - contentEncoding: base64 - description: base64 encoded image data as string - additionalProperties: false - description: >- - Image as a base64 encoded string or an URL - additionalProperties: false - required: - - type - - image - title: ImageContentItem - description: A image content item - InferenceStep: - type: object - properties: - turn_id: - type: string - description: The ID of the turn. - step_id: - type: string - description: The ID of the step. - started_at: - type: string - format: date-time - description: The time the step started. - completed_at: - type: string - format: date-time - description: The time the step completed. - step_type: - type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - title: StepType - description: Type of the step in an agent turn. - const: inference - default: inference - model_response: - $ref: '#/components/schemas/CompletionMessage' - description: The response from the LLM. - additionalProperties: false - required: - - turn_id - - step_id - - step_type - - model_response - title: InferenceStep - description: An inference step in an agent turn. - InterleavedContent: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - InterleavedContentItem: - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem' - text: '#/components/schemas/TextContentItem' - MemoryRetrievalStep: - type: object - properties: - turn_id: - type: string - description: The ID of the turn. - step_id: - type: string - description: The ID of the step. - started_at: - type: string - format: date-time - description: The time the step started. - completed_at: - type: string - format: date-time - description: The time the step completed. - step_type: - type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - title: StepType - description: Type of the step in an agent turn. - const: memory_retrieval - default: memory_retrieval - vector_store_ids: - type: string - description: >- - The IDs of the vector databases to retrieve context from. - inserted_context: - $ref: '#/components/schemas/InterleavedContent' - description: >- - The context retrieved from the vector databases. - additionalProperties: false - required: - - turn_id - - step_id - - step_type - - vector_store_ids - - inserted_context - title: MemoryRetrievalStep - description: >- - A memory retrieval step in an agent turn. - SafetyViolation: - type: object - properties: - violation_level: - $ref: '#/components/schemas/ViolationLevel' - description: Severity level of the violation - user_message: - type: string - description: >- - (Optional) Message to convey to the user about the violation - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Additional metadata including specific violation codes for debugging and - telemetry - additionalProperties: false - required: - - violation_level - - metadata - title: SafetyViolation - description: >- - Details of a safety violation detected by content moderation. - Session: - type: object - properties: - session_id: - type: string - description: >- - Unique identifier for the conversation session - session_name: - type: string - description: Human-readable name for the session - turns: - type: array - items: - $ref: '#/components/schemas/Turn' - description: >- - List of all turns that have occurred in this session - started_at: - type: string - format: date-time - description: Timestamp when the session was created - additionalProperties: false - required: - - session_id - - session_name - - turns - - started_at - title: Session - description: >- - A single session of an interaction with an Agentic System. - ShieldCallStep: - type: object - properties: - turn_id: - type: string - description: The ID of the turn. - step_id: - type: string - description: The ID of the step. - started_at: - type: string - format: date-time - description: The time the step started. - completed_at: - type: string - format: date-time - description: The time the step completed. - step_type: - type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - title: StepType - description: Type of the step in an agent turn. - const: shield_call - default: shield_call - violation: - $ref: '#/components/schemas/SafetyViolation' - description: The violation from the shield call. - additionalProperties: false - required: - - turn_id - - step_id - - step_type - title: ShieldCallStep - description: A shield call step in an agent turn. - TextContentItem: - type: object - properties: - type: - type: string - const: text - default: text - description: >- - Discriminator type of the content item. Always "text" - text: - type: string - description: Text content - additionalProperties: false - required: - - type - - text - title: TextContentItem - description: A text content item - ToolCall: - type: object - properties: - call_id: - type: string - tool_name: - oneOf: - - type: string - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - - type: string - arguments: - type: string - additionalProperties: false - required: - - call_id - - tool_name - - arguments - title: ToolCall - ToolExecutionStep: - type: object - properties: - turn_id: - type: string - description: The ID of the turn. - step_id: - type: string - description: The ID of the step. - started_at: - type: string - format: date-time - description: The time the step started. - completed_at: - type: string - format: date-time - description: The time the step completed. - step_type: - type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - title: StepType - description: Type of the step in an agent turn. - const: tool_execution - default: tool_execution - tool_calls: - type: array - items: - $ref: '#/components/schemas/ToolCall' - description: The tool calls to execute. - tool_responses: - type: array - items: - $ref: '#/components/schemas/ToolResponse' - description: The tool responses from the tool calls. - additionalProperties: false - required: - - turn_id - - step_id - - step_type - - tool_calls - - tool_responses - title: ToolExecutionStep - description: A tool execution step in an agent turn. - ToolResponse: - type: object - properties: - call_id: - type: string - description: >- - Unique identifier for the tool call this response is for - tool_name: - oneOf: - - type: string - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - - type: string - description: Name of the tool that was invoked - content: - $ref: '#/components/schemas/InterleavedContent' - description: The response content from the tool - metadata: - type: object + agent: '#/components/schemas/AgentCandidate' + model: '#/components/schemas/ModelCandidate' + scoring_params: additionalProperties: oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool response - additionalProperties: false - required: - - call_id - - tool_name - - content - title: ToolResponse - description: Response from a tool invocation. - ToolResponseMessage: - type: object - properties: - role: - type: string - const: tool - default: tool - description: >- - Must be "tool" to identify this as a tool response - call_id: - type: string - description: >- - Unique identifier for the tool call this response is for - content: - $ref: '#/components/schemas/InterleavedContent' - description: The response content from the tool - additionalProperties: false - required: - - role - - call_id - - content - title: ToolResponseMessage - description: >- - A message representing the result of a tool invocation. - Turn: - type: object - properties: - turn_id: - type: string - description: >- - Unique identifier for the turn within a session - session_id: - type: string - description: >- - Unique identifier for the conversation session - input_messages: - type: array - items: - oneOf: - - $ref: '#/components/schemas/UserMessage' - - $ref: '#/components/schemas/ToolResponseMessage' - description: >- - List of messages that initiated this turn - steps: - type: array - items: - oneOf: - - $ref: '#/components/schemas/InferenceStep' - - $ref: '#/components/schemas/ToolExecutionStep' - - $ref: '#/components/schemas/ShieldCallStep' - - $ref: '#/components/schemas/MemoryRetrievalStep' + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' discriminator: - propertyName: step_type + propertyName: type mapping: - inference: '#/components/schemas/InferenceStep' - tool_execution: '#/components/schemas/ToolExecutionStep' - shield_call: '#/components/schemas/ShieldCallStep' - memory_retrieval: '#/components/schemas/MemoryRetrievalStep' - description: >- - Ordered list of processing steps executed during this turn - output_message: - $ref: '#/components/schemas/CompletionMessage' - description: >- - The model's generated response containing content and metadata - output_attachments: - type: array - items: - type: object - properties: - content: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - - $ref: '#/components/schemas/URL' - description: The content of the attachment. - mime_type: - type: string - description: The MIME type of the attachment. - additionalProperties: false - required: - - content - - mime_type - title: Attachment - description: An attachment to an agent turn. - description: >- - (Optional) Files or media attached to the agent's response - started_at: - type: string - format: date-time - description: Timestamp when the turn began - completed_at: - type: string - format: date-time - description: >- - (Optional) Timestamp when the turn finished, if completed - additionalProperties: false - required: - - turn_id - - session_id - - input_messages - - steps - - output_message - - started_at - title: Turn - description: >- - A single turn in an interaction with an Agentic System. - URL: - type: object - properties: - uri: - type: string - description: The URL string pointing to the resource - additionalProperties: false - required: - - uri - title: URL - description: A URL reference to external content. - UserMessage: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + type: object + title: Scoring Params + description: Map between scoring function id and parameters for each scoring + function you want to run + num_examples: + anyOf: + - type: integer + - type: 'null' + title: Num Examples + description: Number of examples to evaluate (useful for testing), if not + provided, all examples in the dataset will be evaluated type: object - properties: - role: - type: string - const: user - default: user - description: >- - Must be "user" to identify this as a user message - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - The content of the message, which can include text and other media - context: - $ref: '#/components/schemas/InterleavedContent' - description: >- - (Optional) This field is used internally by Llama Stack to pass RAG context. - This field may be removed in the API in the future. - additionalProperties: false required: - - role - - content - title: UserMessage - description: >- - A message from the user in a chat conversation. - ViolationLevel: - type: string - enum: - - info - - warn - - error - title: ViolationLevel - description: Severity level of a safety violation. - CreateAgentTurnRequest: - type: object + - eval_candidate + title: BenchmarkConfig + description: 'A benchmark configuration for evaluation. + + + :param eval_candidate: The candidate to evaluate. + + :param scoring_params: Map between scoring function id and parameters for + each scoring function you want to run + + :param num_examples: (Optional) The number of examples to evaluate. If not + provided, all examples in the dataset will be evaluated' + Body_create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post: properties: messages: - type: array - items: - oneOf: - - $ref: '#/components/schemas/UserMessage' - - $ref: '#/components/schemas/ToolResponseMessage' - description: List of messages to start the turn with. - stream: - type: boolean - description: >- - (Optional) If True, generate an SSE event stream of the response. Defaults - to False. + $ref: '#/components/schemas/UserMessage' documents: - type: array - items: - type: object - properties: - content: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - - $ref: '#/components/schemas/URL' - description: The content of the document. - mime_type: - type: string - description: The MIME type of the document. - additionalProperties: false - required: - - content - - mime_type - title: Document - description: A document to be used by an agent. - description: >- - (Optional) List of documents to create the turn with. + $ref: '#/components/schemas/Document' toolgroups: - type: array - items: - $ref: '#/components/schemas/AgentTool' - description: >- - (Optional) List of toolgroups to create the turn with, will be used in - addition to the agent's config toolgroups for the request. + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + title: Toolgroups tool_config: $ref: '#/components/schemas/ToolConfig' - description: >- - (Optional) The tool configuration to create the turn with, will be used - to override the agent's tool_config. - additionalProperties: false - required: - - messages - title: CreateAgentTurnRequest - AgentTurnResponseEvent: type: object + title: Body_create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post + BuiltinTool: + type: string + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + DPOAlignmentConfig: properties: - payload: - oneOf: - - $ref: '#/components/schemas/AgentTurnResponseStepStartPayload' - - $ref: '#/components/schemas/AgentTurnResponseStepProgressPayload' - - $ref: '#/components/schemas/AgentTurnResponseStepCompletePayload' - - $ref: '#/components/schemas/AgentTurnResponseTurnStartPayload' - - $ref: '#/components/schemas/AgentTurnResponseTurnCompletePayload' - - $ref: '#/components/schemas/AgentTurnResponseTurnAwaitingInputPayload' - discriminator: - propertyName: event_type - mapping: - step_start: '#/components/schemas/AgentTurnResponseStepStartPayload' - step_progress: '#/components/schemas/AgentTurnResponseStepProgressPayload' - step_complete: '#/components/schemas/AgentTurnResponseStepCompletePayload' - turn_start: '#/components/schemas/AgentTurnResponseTurnStartPayload' - turn_complete: '#/components/schemas/AgentTurnResponseTurnCompletePayload' - turn_awaiting_input: '#/components/schemas/AgentTurnResponseTurnAwaitingInputPayload' - description: >- - Event-specific payload containing event data - additionalProperties: false - required: - - payload - title: AgentTurnResponseEvent - description: >- - An event in an agent turn response stream. - AgentTurnResponseStepCompletePayload: + beta: + type: number + title: Beta + loss_type: + $ref: '#/components/schemas/DPOLossType' + default: sigmoid type: object + required: + - beta + title: DPOAlignmentConfig + description: 'Configuration for Direct Preference Optimization (DPO) alignment. + + + :param beta: Temperature parameter for the DPO loss + + :param loss_type: The type of loss function to use for DPO' + DPOLossType: + type: string + enum: + - sigmoid + - hinge + - ipo + - kto_pair + title: DPOLossType + DataConfig: properties: - event_type: - type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: step_complete - default: step_complete - description: Type of event being reported - step_type: - type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - description: Type of step being executed - step_id: + dataset_id: type: string - description: >- - Unique identifier for the step within a turn - step_details: - oneOf: - - $ref: '#/components/schemas/InferenceStep' - - $ref: '#/components/schemas/ToolExecutionStep' - - $ref: '#/components/schemas/ShieldCallStep' - - $ref: '#/components/schemas/MemoryRetrievalStep' - discriminator: - propertyName: step_type - mapping: - inference: '#/components/schemas/InferenceStep' - tool_execution: '#/components/schemas/ToolExecutionStep' - shield_call: '#/components/schemas/ShieldCallStep' - memory_retrieval: '#/components/schemas/MemoryRetrievalStep' - description: Complete details of the executed step - additionalProperties: false - required: - - event_type - - step_type - - step_id - - step_details - title: AgentTurnResponseStepCompletePayload - description: >- - Payload for step completion events in agent turn responses. - AgentTurnResponseStepProgressPayload: + title: Dataset Id + batch_size: + type: integer + title: Batch Size + shuffle: + type: boolean + title: Shuffle + data_format: + $ref: '#/components/schemas/DatasetFormat' + validation_dataset_id: + anyOf: + - type: string + - type: 'null' + title: Validation Dataset Id + packed: + anyOf: + - type: boolean + - type: 'null' + title: Packed + default: false + train_on_input: + anyOf: + - type: boolean + - type: 'null' + title: Train On Input + default: false type: object + required: + - dataset_id + - batch_size + - shuffle + - data_format + title: DataConfig + description: 'Configuration for training data and data loading. + + + :param dataset_id: Unique identifier for the training dataset + + :param batch_size: Number of samples per training batch + + :param shuffle: Whether to shuffle the dataset during training + + :param data_format: Format of the dataset (instruct or dialog) + + :param validation_dataset_id: (Optional) Unique identifier for the validation + dataset + + :param packed: (Optional) Whether to pack multiple samples into a single sequence + for efficiency + + :param train_on_input: (Optional) Whether to compute loss on input tokens + as well as output tokens' + Dataset: properties: - event_type: + identifier: type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: step_progress - default: step_progress - description: Type of event being reported - step_type: + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - description: Type of step being executed - step_id: + title: Provider Id + description: ID of the provider that owns this resource + type: type: string - description: >- - Unique identifier for the step within a turn - delta: + const: dataset + title: Type + default: dataset + purpose: + $ref: '#/components/schemas/DatasetPurpose' + source: oneOf: - - $ref: '#/components/schemas/TextDelta' - - $ref: '#/components/schemas/ImageDelta' - - $ref: '#/components/schemas/ToolCallDelta' + - $ref: '#/components/schemas/URIDataSource' + - $ref: '#/components/schemas/RowsDataSource' + title: Source discriminator: propertyName: type mapping: - text: '#/components/schemas/TextDelta' - image: '#/components/schemas/ImageDelta' - tool_call: '#/components/schemas/ToolCallDelta' - description: >- - Incremental content changes during step execution - additionalProperties: false - required: - - event_type - - step_type - - step_id - - delta - title: AgentTurnResponseStepProgressPayload - description: >- - Payload for step progress events in agent turn responses. - AgentTurnResponseStepStartPayload: - type: object - properties: - event_type: - type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: step_start - default: step_start - description: Type of event being reported - step_type: - type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - description: Type of step being executed - step_id: - type: string - description: >- - Unique identifier for the step within a turn + rows: '#/components/schemas/RowsDataSource' + uri: '#/components/schemas/URIDataSource' metadata: + additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata for the step - additionalProperties: false - required: - - event_type - - step_type - - step_id - title: AgentTurnResponseStepStartPayload - description: >- - Payload for step start events in agent turn responses. - AgentTurnResponseStreamChunk: + title: Metadata + description: Any additional metadata for this dataset type: object - properties: - event: - $ref: '#/components/schemas/AgentTurnResponseEvent' - description: >- - Individual event in the agent turn response stream - additionalProperties: false required: - - event - title: AgentTurnResponseStreamChunk - description: Streamed agent turn completion response. - "AgentTurnResponseTurnAwaitingInputPayload": - type: object + - identifier + - provider_id + - purpose + - source + title: Dataset + description: 'Dataset resource for storing and accessing training or evaluation + data. + + + :param type: Type of resource, always ''dataset'' for datasets' + DatasetFormat: + type: string + enum: + - instruct + - dialog + title: DatasetFormat + description: 'Format of the training dataset. + + :cvar instruct: Instruction-following format with prompt and completion + + :cvar dialog: Multi-turn conversation format with messages' + DatasetPurpose: + type: string + enum: + - post-training/messages + - eval/question-answer + - eval/messages-answer + title: DatasetPurpose + description: "Purpose of the dataset. Each purpose has a required input data\ + \ schema.\n\n:cvar post-training/messages: The dataset contains messages used\ + \ for post-training.\n {\n \"messages\": [\n {\"role\"\ + : \"user\", \"content\": \"Hello, world!\"},\n {\"role\": \"assistant\"\ + , \"content\": \"Hello, world!\"},\n ]\n }\n:cvar eval/question-answer:\ + \ The dataset contains a question column and an answer column.\n {\n \ + \ \"question\": \"What is the capital of France?\",\n \"answer\"\ + : \"Paris\"\n }\n:cvar eval/messages-answer: The dataset contains a messages\ + \ column with list of messages and an answer column.\n {\n \"messages\"\ + : [\n {\"role\": \"user\", \"content\": \"Hello, my name is John\ + \ Doe.\"},\n {\"role\": \"assistant\", \"content\": \"Hello, John\ + \ Doe. How can I help you today?\"},\n {\"role\": \"user\", \"\ + content\": \"What's my name?\"},\n ],\n \"answer\": \"John Doe\"\ + \n }" + Document: properties: - event_type: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem' + text: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + title: Content + mime_type: type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: turn_awaiting_input - default: turn_awaiting_input - description: Type of event being reported - turn: - $ref: '#/components/schemas/Turn' - description: >- - Turn data when waiting for external tool responses - additionalProperties: false + title: Mime Type + type: object required: - - event_type - - turn - title: >- - AgentTurnResponseTurnAwaitingInputPayload - description: >- - Payload for turn awaiting input events in agent turn responses. - AgentTurnResponseTurnCompletePayload: + - content + - mime_type + title: Document + description: 'A document to be used by an agent. + + + :param content: The content of the document. + + :param mime_type: The MIME type of the document.' + EfficiencyConfig: + properties: + enable_activation_checkpointing: + anyOf: + - type: boolean + - type: 'null' + title: Enable Activation Checkpointing + default: false + enable_activation_offloading: + anyOf: + - type: boolean + - type: 'null' + title: Enable Activation Offloading + default: false + memory_efficient_fsdp_wrap: + anyOf: + - type: boolean + - type: 'null' + title: Memory Efficient Fsdp Wrap + default: false + fsdp_cpu_offload: + anyOf: + - type: boolean + - type: 'null' + title: Fsdp Cpu Offload + default: false type: object + title: EfficiencyConfig + description: 'Configuration for memory and compute efficiency optimizations. + + + :param enable_activation_checkpointing: (Optional) Whether to use activation + checkpointing to reduce memory usage + + :param enable_activation_offloading: (Optional) Whether to offload activations + to CPU to save GPU memory + + :param memory_efficient_fsdp_wrap: (Optional) Whether to use memory-efficient + FSDP wrapping + + :param fsdp_cpu_offload: (Optional) Whether to offload FSDP parameters to + CPU' + EvaluateResponse: properties: - event_type: - type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: turn_complete - default: turn_complete - description: Type of event being reported - turn: - $ref: '#/components/schemas/Turn' - description: >- - Complete turn data including all steps and results - additionalProperties: false - required: - - event_type - - turn - title: AgentTurnResponseTurnCompletePayload - description: >- - Payload for turn completion events in agent turn responses. - AgentTurnResponseTurnStartPayload: + generations: + items: + additionalProperties: true + type: object + type: array + title: Generations + scores: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' + type: object + title: Scores type: object + required: + - generations + - scores + title: EvaluateResponse + description: 'The response from an evaluation. + + + :param generations: The generations from the evaluation. + + :param scores: The scores from the evaluation.' + GrammarResponseFormat: properties: - event_type: - type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: turn_start - default: turn_start - description: Type of event being reported - turn_id: + type: type: string - description: >- - Unique identifier for the turn within a session - additionalProperties: false + const: grammar + title: Type + default: grammar + bnf: + additionalProperties: true + type: object + title: Bnf + type: object required: - - event_type - - turn_id - title: AgentTurnResponseTurnStartPayload - description: >- - Payload for turn start events in agent turn responses. - ImageDelta: + - bnf + title: GrammarResponseFormat + description: 'Configuration for grammar-guided response generation. + + + :param type: Must be "grammar" to identify this format type + + :param bnf: The BNF grammar specification the response should conform to' + GreedySamplingStrategy: + properties: + type: + type: string + const: greedy + title: Type + default: greedy type: object + title: GreedySamplingStrategy + description: 'Greedy sampling strategy that selects the highest probability + token at each step. + + + :param type: Must be "greedy" to identify this sampling strategy' + ImageContentItem: properties: type: type: string const: image + title: Type default: image - description: >- - Discriminator type of the delta. Always "image" image: - type: string - contentEncoding: base64 - description: The incremental image data as bytes - additionalProperties: false - required: - - type - - image - title: ImageDelta - description: >- - An image content delta for streaming responses. - TextDelta: + $ref: '#/components/schemas/_URLOrData' type: object + required: + - image + title: ImageContentItem + description: 'A image content item + + + :param type: Discriminator type of the content item. Always "image" + + :param image: Image as a base64 encoded string or an URL' + Job: properties: - type: - type: string - const: text - default: text - description: >- - Discriminator type of the delta. Always "text" - text: + job_id: type: string - description: The incremental text content - additionalProperties: false - required: - - type - - text - title: TextDelta - description: >- - A text content delta for streaming responses. - ToolCallDelta: + title: Job Id + status: + $ref: '#/components/schemas/JobStatus' type: object + required: + - job_id + - status + title: Job + description: 'A job execution instance with status tracking. + + + :param job_id: Unique identifier for the job + + :param status: Current execution status of the job' + JobStatus: + type: string + enum: + - completed + - in_progress + - failed + - scheduled + - cancelled + title: JobStatus + description: 'Status of a job execution. + + :cvar completed: Job has finished successfully + + :cvar in_progress: Job is currently running + + :cvar failed: Job has failed during execution + + :cvar scheduled: Job is scheduled but not yet started + + :cvar cancelled: Job was cancelled before completion' + JsonSchemaResponseFormat: properties: type: type: string - const: tool_call - default: tool_call - description: >- - Discriminator type of the delta. Always "tool_call" - tool_call: - oneOf: - - type: string - - $ref: '#/components/schemas/ToolCall' - description: >- - Either an in-progress tool call string or the final parsed tool call - parse_status: - type: string - enum: - - started - - in_progress - - failed - - succeeded - description: Current parsing status of the tool call - additionalProperties: false - required: - - type - - tool_call - - parse_status - title: ToolCallDelta - description: >- - A tool call content delta for streaming responses. - ResumeAgentTurnRequest: - type: object - properties: - tool_responses: - type: array - items: - $ref: '#/components/schemas/ToolResponse' - description: >- - The tool call responses to resume the turn with. - stream: - type: boolean - description: Whether to stream the response. - additionalProperties: false - required: - - tool_responses - title: ResumeAgentTurnRequest - AgentStepResponse: + const: json_schema + title: Type + default: json_schema + json_schema: + additionalProperties: true + type: object + title: Json Schema type: object - properties: - step: - oneOf: - - $ref: '#/components/schemas/InferenceStep' - - $ref: '#/components/schemas/ToolExecutionStep' - - $ref: '#/components/schemas/ShieldCallStep' - - $ref: '#/components/schemas/MemoryRetrievalStep' - discriminator: - propertyName: step_type - mapping: - inference: '#/components/schemas/InferenceStep' - tool_execution: '#/components/schemas/ToolExecutionStep' - shield_call: '#/components/schemas/ShieldCallStep' - memory_retrieval: '#/components/schemas/MemoryRetrievalStep' - description: >- - The complete step data and execution details - additionalProperties: false required: - - step - title: AgentStepResponse - description: >- - Response containing details of a specific agent step. - Benchmark: - type: object + - json_schema + title: JsonSchemaResponseFormat + description: 'Configuration for JSON schema-guided response generation. + + + :param type: Must be "json_schema" to identify this format type + + :param json_schema: The JSON schema the response should conform to. In a Python + SDK, this is often a `pydantic` model.' + LLMAsJudgeScoringFnParams: properties: - identifier: - type: string - provider_resource_id: - type: string - provider_id: - type: string type: type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: benchmark - default: benchmark - description: The resource type, always benchmark - dataset_id: + const: llm_as_judge + title: Type + default: llm_as_judge + judge_model: type: string - description: >- - Identifier of the dataset to use for the benchmark evaluation - scoring_functions: - type: array + title: Judge Model + prompt_template: + anyOf: + - type: string + - type: 'null' + title: Prompt Template + judge_score_regexes: items: type: string - description: >- - List of scoring function identifiers to apply during evaluation - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Metadata for this evaluation task - additionalProperties: false + type: array + title: Judge Score Regexes + description: Regexes to extract the answer from generated response + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row + type: object required: - - identifier - - provider_id - - type - - dataset_id - - scoring_functions - - metadata - title: Benchmark - description: >- - A benchmark resource for evaluating model performance. + - judge_model + title: LLMAsJudgeScoringFnParams + description: 'Parameters for LLM-as-judge scoring function configuration. + + :param type: The type of scoring function parameters, always llm_as_judge + + :param judge_model: Identifier of the LLM model to use as a judge for scoring + + :param prompt_template: (Optional) Custom prompt template for the judge model + + :param judge_score_regexes: Regexes to extract the answer from generated response + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row' ListBenchmarksResponse: - type: object properties: data: - type: array items: $ref: '#/components/schemas/Benchmark' - additionalProperties: false - required: - - data - title: ListBenchmarksResponse - RegisterBenchmarkRequest: - type: object - properties: - benchmark_id: - type: string - description: The ID of the benchmark to register. - dataset_id: - type: string - description: >- - The ID of the dataset to use for the benchmark. - scoring_functions: type: array - items: - type: string - description: >- - The scoring functions to use for the benchmark. - provider_benchmark_id: - type: string - description: >- - The ID of the provider benchmark to use for the benchmark. - provider_id: - type: string - description: >- - The ID of the provider to use for the benchmark. - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The metadata to use for the benchmark. - additionalProperties: false - required: - - benchmark_id - - dataset_id - - scoring_functions - title: RegisterBenchmarkRequest - AgentCandidate: + title: Data type: object - properties: - type: - type: string - const: agent - default: agent - config: - $ref: '#/components/schemas/AgentConfig' - description: >- - The configuration for the agent candidate. - additionalProperties: false required: - - type - - config - title: AgentCandidate - description: An agent candidate for evaluation. - AggregationFunctionType: - type: string - enum: - - average - - weighted_average - - median - - categorical_count - - accuracy - title: AggregationFunctionType - description: >- - Types of aggregation functions for scoring results. - BasicScoringFnParams: - type: object + - data + title: ListBenchmarksResponse + ListDatasetsResponse: properties: - type: - $ref: '#/components/schemas/ScoringFnParamsType' - const: basic - default: basic - description: >- - The type of scoring function parameters, always basic - aggregation_functions: - type: array + data: items: - $ref: '#/components/schemas/AggregationFunctionType' - description: >- - Aggregation functions to apply to the scores of each row - additionalProperties: false - required: - - type - - aggregation_functions - title: BasicScoringFnParams - description: >- - Parameters for basic scoring function configuration. - BenchmarkConfig: - type: object - properties: - eval_candidate: - oneOf: - - $ref: '#/components/schemas/ModelCandidate' - - $ref: '#/components/schemas/AgentCandidate' - discriminator: - propertyName: type - mapping: - model: '#/components/schemas/ModelCandidate' - agent: '#/components/schemas/AgentCandidate' - description: The candidate to evaluate. - scoring_params: - type: object - additionalProperties: - $ref: '#/components/schemas/ScoringFnParams' - description: >- - Map between scoring function id and parameters for each scoring function - you want to run - num_examples: - type: integer - description: >- - (Optional) The number of examples to evaluate. If not provided, all examples - in the dataset will be evaluated - additionalProperties: false - required: - - eval_candidate - - scoring_params - title: BenchmarkConfig - description: >- - A benchmark configuration for evaluation. - LLMAsJudgeScoringFnParams: - type: object - properties: - type: - $ref: '#/components/schemas/ScoringFnParamsType' - const: llm_as_judge - default: llm_as_judge - description: >- - The type of scoring function parameters, always llm_as_judge - judge_model: - type: string - description: >- - Identifier of the LLM model to use as a judge for scoring - prompt_template: - type: string - description: >- - (Optional) Custom prompt template for the judge model - judge_score_regexes: + $ref: '#/components/schemas/Dataset' type: array + title: Data + type: object + required: + - data + title: ListDatasetsResponse + description: 'Response from listing datasets. + + + :param data: List of datasets' + ListPostTrainingJobsResponse: + properties: + data: items: - type: string - description: >- - Regexes to extract the answer from generated response - aggregation_functions: + $ref: '#/components/schemas/PostTrainingJob' type: array - items: - $ref: '#/components/schemas/AggregationFunctionType' - description: >- - Aggregation functions to apply to the scores of each row - additionalProperties: false + title: Data + type: object required: - - type - - judge_model - - judge_score_regexes - - aggregation_functions - title: LLMAsJudgeScoringFnParams - description: >- - Parameters for LLM-as-judge scoring function configuration. + - data + title: ListPostTrainingJobsResponse ModelCandidate: - type: object properties: type: type: string const: model + title: Type default: model model: type: string - description: The model ID to evaluate. + title: Model sampling_params: $ref: '#/components/schemas/SamplingParams' - description: The sampling parameters for the model. system_message: - $ref: '#/components/schemas/SystemMessage' - description: >- - (Optional) The system message providing instructions or context to the - model. - additionalProperties: false + anyOf: + - $ref: '#/components/schemas/SystemMessage' + - type: 'null' + type: object required: - - type - - model - - sampling_params + - model + - sampling_params title: ModelCandidate - description: A model candidate for evaluation. - RegexParserScoringFnParams: + description: 'A model candidate for evaluation. + + + :param model: The model ID to evaluate. + + :param sampling_params: The sampling parameters for the model. + + :param system_message: (Optional) The system message providing instructions + or context to the model.' + OptimizerConfig: + properties: + optimizer_type: + $ref: '#/components/schemas/OptimizerType' + lr: + type: number + title: Lr + weight_decay: + type: number + title: Weight Decay + num_warmup_steps: + type: integer + title: Num Warmup Steps type: object + required: + - optimizer_type + - lr + - weight_decay + - num_warmup_steps + title: OptimizerConfig + description: 'Configuration parameters for the optimization algorithm. + + + :param optimizer_type: Type of optimizer to use (adam, adamw, or sgd) + + :param lr: Learning rate for the optimizer + + :param weight_decay: Weight decay coefficient for regularization + + :param num_warmup_steps: Number of steps for learning rate warmup' + OptimizerType: + type: string + enum: + - adam + - adamw + - sgd + title: OptimizerType + description: 'Available optimizer algorithms for training. + + :cvar adam: Adaptive Moment Estimation optimizer + + :cvar adamw: AdamW optimizer with weight decay + + :cvar sgd: Stochastic Gradient Descent optimizer' + PostTrainingJob: + properties: + job_uuid: + type: string + title: Job Uuid + type: object + required: + - job_uuid + title: PostTrainingJob + RegexParserScoringFnParams: properties: type: - $ref: '#/components/schemas/ScoringFnParamsType' + type: string const: regex_parser + title: Type default: regex_parser - description: >- - The type of scoring function parameters, always regex_parser parsing_regexes: - type: array items: type: string - description: >- - Regex to extract the answer from generated response - aggregation_functions: type: array + title: Parsing Regexes + description: Regex to extract the answer from generated response + aggregation_functions: items: $ref: '#/components/schemas/AggregationFunctionType' - description: >- - Aggregation functions to apply to the scores of each row - additionalProperties: false - required: - - type - - parsing_regexes - - aggregation_functions - title: RegexParserScoringFnParams - description: >- - Parameters for regex parser scoring function configuration. - ScoringFnParams: - oneOf: - - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - - $ref: '#/components/schemas/RegexParserScoringFnParams' - - $ref: '#/components/schemas/BasicScoringFnParams' - discriminator: - propertyName: type - mapping: - llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' - regex_parser: '#/components/schemas/RegexParserScoringFnParams' - basic: '#/components/schemas/BasicScoringFnParams' - ScoringFnParamsType: - type: string - enum: - - llm_as_judge - - regex_parser - - basic - title: ScoringFnParamsType - description: >- - Types of scoring function parameter configurations. - SystemMessage: + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row type: object + title: RegexParserScoringFnParams + description: 'Parameters for regex parser scoring function configuration. + + :param type: The type of scoring function parameters, always regex_parser + + :param parsing_regexes: Regex to extract the answer from generated response + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row' + RowsDataSource: properties: - role: + type: type: string - const: system - default: system - description: >- - Must be "system" to identify this as a system message - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - The content of the "system prompt". If multiple system messages are provided, - they are concatenated. The underlying Llama Stack code may also add other - system messages (for example, for formatting tool definitions). - additionalProperties: false - required: - - role - - content - title: SystemMessage - description: >- - A system message providing instructions or context to the model. - EvaluateRowsRequest: - type: object - properties: - input_rows: - type: array + const: rows + title: Type + default: rows + rows: items: + additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The rows to evaluate. - scoring_functions: type: array - items: - type: string - description: >- - The scoring functions to use for the evaluation. - benchmark_config: - $ref: '#/components/schemas/BenchmarkConfig' - description: The configuration for the benchmark. - additionalProperties: false - required: - - input_rows - - scoring_functions - - benchmark_config - title: EvaluateRowsRequest - EvaluateResponse: + title: Rows type: object - properties: - generations: - type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The generations from the evaluation. - scores: - type: object - additionalProperties: - $ref: '#/components/schemas/ScoringResult' - description: The scores from the evaluation. - additionalProperties: false required: - - generations - - scores - title: EvaluateResponse - description: The response from an evaluation. - ScoringResult: + - rows + title: RowsDataSource + description: "A dataset stored in rows.\n:param rows: The dataset is stored\ + \ in rows. E.g.\n - [\n {\"messages\": [{\"role\": \"user\", \"\ + content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello,\ + \ world!\"}]}\n ]" + SamplingParams: + properties: + strategy: + oneOf: + - $ref: '#/components/schemas/GreedySamplingStrategy' + - $ref: '#/components/schemas/TopPSamplingStrategy' + - $ref: '#/components/schemas/TopKSamplingStrategy' + title: Strategy + discriminator: + propertyName: type + mapping: + greedy: '#/components/schemas/GreedySamplingStrategy' + top_k: '#/components/schemas/TopKSamplingStrategy' + top_p: '#/components/schemas/TopPSamplingStrategy' + max_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Tokens + repetition_penalty: + anyOf: + - type: number + - type: 'null' + title: Repetition Penalty + default: 1.0 + stop: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Stop type: object + title: SamplingParams + description: "Sampling parameters.\n\n:param strategy: The sampling strategy.\n\ + :param max_tokens: The maximum number of tokens that can be generated in the\ + \ completion. The token count of\n your prompt plus max_tokens cannot exceed\ + \ the model's context length.\n:param repetition_penalty: Number between -2.0\ + \ and 2.0. Positive values penalize new tokens\n based on whether they\ + \ appear in the text so far, increasing the model's likelihood to talk about\ + \ new topics.\n:param stop: Up to 4 sequences where the API will stop generating\ + \ further tokens.\n The returned text will not contain the stop sequence." + ScoringResult: properties: score_rows: - type: array items: + additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The scoring result for each row. Each row is a map of column name to value. + type: array + title: Score Rows aggregated_results: + additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Map of metric name to aggregated value - additionalProperties: false - required: - - score_rows - - aggregated_results - title: ScoringResult - description: A scoring result for a single row. - RunEvalRequest: + title: Aggregated Results type: object - properties: - benchmark_config: - $ref: '#/components/schemas/BenchmarkConfig' - description: The configuration for the benchmark. - additionalProperties: false required: - - benchmark_config - title: RunEvalRequest - Job: - type: object + - score_rows + - aggregated_results + title: ScoringResult + description: 'A scoring result for a single row. + + + :param score_rows: The scoring result for each row. Each row is a map of column + name to value. + + :param aggregated_results: Map of metric name to aggregated value' + SystemMessage: properties: - job_id: - type: string - description: Unique identifier for the job - status: + role: type: string - enum: - - completed - - in_progress - - failed - - scheduled - - cancelled - description: Current execution status of the job - additionalProperties: false - required: - - job_id - - status - title: Job - description: >- - A job execution instance with status tracking. - "OpenAIChatCompletionContentPartImageParam": + const: system + title: Role + default: system + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem' + text: '#/components/schemas/TextContentItem' + type: array + title: Content type: object - properties: - type: - type: string - const: image_url - default: image_url - description: >- - Must be "image_url" to identify this as image content - image_url: - $ref: '#/components/schemas/OpenAIImageURL' - description: >- - Image URL specification and processing details - additionalProperties: false required: - - type - - image_url - title: >- - OpenAIChatCompletionContentPartImageParam - description: >- - Image content part for OpenAI-compatible chat completion messages. - OpenAIChatCompletionContentPartTextParam: - type: object + - content + title: SystemMessage + description: 'A system message providing instructions or context to the model. + + + :param role: Must be "system" to identify this as a system message + + :param content: The content of the "system prompt". If multiple system messages + are provided, they are concatenated. The underlying Llama Stack code may also + add other system messages (for example, for formatting tool definitions).' + SystemMessageBehavior: + type: string + enum: + - append + - replace + title: SystemMessageBehavior + description: "Config for how to override the default system prompt.\n\n:cvar\ + \ append: Appends the provided system message to the default system prompt:\n\ + \ https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt-\n\ + :cvar replace: Replaces the default system prompt with the provided system\ + \ message. The system message can include the string\n '{{function_definitions}}'\ + \ to indicate where the function definitions should be inserted." + TextContentItem: properties: type: type: string const: text + title: Type default: text - description: >- - Must be "text" to identify this as text content text: type: string - description: The text content of the message - additionalProperties: false - required: - - type - - text - title: OpenAIChatCompletionContentPartTextParam - description: >- - Text content part for OpenAI-compatible chat completion messages. - OpenAIImageURL: - type: object - properties: - url: - type: string - description: >- - URL of the image to include in the message - detail: - type: string - description: >- - (Optional) Level of detail for image processing. Can be "low", "high", - or "auto" - additionalProperties: false - required: - - url - title: OpenAIImageURL - description: >- - Image URL specification for OpenAI-compatible chat completion messages. - RerankRequest: - type: object - properties: - model: - type: string - description: >- - The identifier of the reranking model to use. - query: - oneOf: - - type: string - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - description: >- - The search query to rank items against. Can be a string, text content - part, or image content part. The input must not exceed the model's max - input token length. - items: - type: array - items: - oneOf: - - type: string - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - description: >- - List of items to rerank. Each item can be a string, text content part, - or image content part. Each input must not exceed the model's max input - token length. - max_num_results: - type: integer - description: >- - (Optional) Maximum number of results to return. Default: returns all. - additionalProperties: false - required: - - model - - query - - items - title: RerankRequest - RerankData: - type: object - properties: - index: - type: integer - description: >- - The original index of the document in the input list - relevance_score: - type: number - description: >- - The relevance score from the model output. Values are inverted when applicable - so that higher scores indicate greater relevance. - additionalProperties: false - required: - - index - - relevance_score - title: RerankData - description: >- - A single rerank result from a reranking response. - RerankResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/RerankData' - description: >- - List of rerank result objects, sorted by relevance score (descending) - additionalProperties: false - required: - - data - title: RerankResponse - description: Response from a reranking request. - Checkpoint: - type: object - properties: - identifier: - type: string - description: Unique identifier for the checkpoint - created_at: - type: string - format: date-time - description: >- - Timestamp when the checkpoint was created - epoch: - type: integer - description: >- - Training epoch when the checkpoint was saved - post_training_job_id: - type: string - description: >- - Identifier of the training job that created this checkpoint - path: - type: string - description: >- - File system path where the checkpoint is stored - training_metrics: - $ref: '#/components/schemas/PostTrainingMetric' - description: >- - (Optional) Training metrics associated with this checkpoint - additionalProperties: false - required: - - identifier - - created_at - - epoch - - post_training_job_id - - path - title: Checkpoint - description: Checkpoint created during training runs. - PostTrainingJobArtifactsResponse: - type: object - properties: - job_uuid: - type: string - description: Unique identifier for the training job - checkpoints: - type: array - items: - $ref: '#/components/schemas/Checkpoint' - description: >- - List of model checkpoints created during training - additionalProperties: false - required: - - job_uuid - - checkpoints - title: PostTrainingJobArtifactsResponse - description: Artifacts of a finetuning job. - PostTrainingMetric: - type: object - properties: - epoch: - type: integer - description: Training epoch number - train_loss: - type: number - description: Loss value on the training dataset - validation_loss: - type: number - description: Loss value on the validation dataset - perplexity: - type: number - description: >- - Perplexity metric indicating model confidence - additionalProperties: false - required: - - epoch - - train_loss - - validation_loss - - perplexity - title: PostTrainingMetric - description: >- - Training metrics captured during post-training jobs. - CancelTrainingJobRequest: - type: object - properties: - job_uuid: - type: string - description: The UUID of the job to cancel. - additionalProperties: false - required: - - job_uuid - title: CancelTrainingJobRequest - PostTrainingJobStatusResponse: + title: Text type: object - properties: - job_uuid: - type: string - description: Unique identifier for the training job - status: - type: string - enum: - - completed - - in_progress - - failed - - scheduled - - cancelled - description: Current status of the training job - scheduled_at: - type: string - format: date-time - description: >- - (Optional) Timestamp when the job was scheduled - started_at: - type: string - format: date-time - description: >- - (Optional) Timestamp when the job execution began - completed_at: - type: string - format: date-time - description: >- - (Optional) Timestamp when the job finished, if completed - resources_allocated: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Information about computational resources allocated to the - job - checkpoints: - type: array - items: - $ref: '#/components/schemas/Checkpoint' - description: >- - List of model checkpoints created during training - additionalProperties: false required: - - job_uuid - - status - - checkpoints - title: PostTrainingJobStatusResponse - description: Status of a finetuning job. - ListPostTrainingJobsResponse: - type: object + - text + title: TextContentItem + description: 'A text content item + + + :param type: Discriminator type of the content item. Always "text" + + :param text: Text content' + ToolChoice: + type: string + enum: + - auto + - required + - none + title: ToolChoice + description: 'Whether tool use is required or automatic. This is a hint to the + model which may not be followed. It depends on the Instruction Following capabilities + of the model. + + + :cvar auto: The model may use tools if it determines that is appropriate. + + :cvar required: The model must use tools. + + :cvar none: The model must not use tools.' + ToolConfig: properties: - data: - type: array - items: - type: object - properties: - job_uuid: - type: string - additionalProperties: false - required: - - job_uuid - title: PostTrainingJob - additionalProperties: false - required: - - data - title: ListPostTrainingJobsResponse - DPOAlignmentConfig: + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: string + - type: 'null' + title: Tool Choice + default: auto + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + system_message_behavior: + anyOf: + - $ref: '#/components/schemas/SystemMessageBehavior' + - type: 'null' + default: append type: object + title: ToolConfig + description: "Configuration for tool use.\n\n:param tool_choice: (Optional)\ + \ Whether tool use is automatic, required, or none. Can also specify a tool\ + \ name to use a specific tool. Defaults to ToolChoice.auto.\n:param tool_prompt_format:\ + \ (Optional) Instructs the model how to format tool calls. By default, Llama\ + \ Stack will attempt to use a format that is best adapted to the model.\n\ + \ - `ToolPromptFormat.json`: The tool calls are formatted as a JSON object.\n\ + \ - `ToolPromptFormat.function_tag`: The tool calls are enclosed in a \ + \ tag.\n - `ToolPromptFormat.python_list`: The tool calls are output as\ + \ Python syntax -- a list of function calls.\n:param system_message_behavior:\ + \ (Optional) Config for how to override the default system prompt.\n -\ + \ `SystemMessageBehavior.append`: Appends the provided system message to the\ + \ default system prompt.\n - `SystemMessageBehavior.replace`: Replaces\ + \ the default system prompt with the provided system message. The system message\ + \ can include the string\n '{{function_definitions}}' to indicate where\ + \ the function definitions should be inserted." + ToolDef: properties: - beta: - type: number - description: Temperature parameter for the DPO loss - loss_type: - $ref: '#/components/schemas/DPOLossType' - default: sigmoid - description: The type of loss function to use for DPO - additionalProperties: false + toolgroup_id: + anyOf: + - type: string + - type: 'null' + title: Toolgroup Id + name: + type: string + title: Name + description: + anyOf: + - type: string + - type: 'null' + title: Description + input_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Input Schema + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Output Schema + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + type: object required: - - beta - - loss_type - title: DPOAlignmentConfig - description: >- - Configuration for Direct Preference Optimization (DPO) alignment. - DPOLossType: + - name + title: ToolDef + description: 'Tool definition used in runtime contexts. + + + :param name: Name of the tool + + :param description: (Optional) Human-readable description of what the tool + does + + :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) + + :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) + + :param metadata: (Optional) Additional metadata about the tool + + :param toolgroup_id: (Optional) ID of the tool group this tool belongs to' + ToolPromptFormat: type: string enum: - - sigmoid - - hinge - - ipo - - kto_pair - title: DPOLossType - DataConfig: + - json + - function_tag + - python_list + title: ToolPromptFormat + description: "Prompt format for calling custom / zero shot tools.\n\n:cvar json:\ + \ JSON format for calling tools. It takes the form:\n {\n \"type\"\ + : \"function\",\n \"function\" : {\n \"name\": \"function_name\"\ + ,\n \"description\": \"function_description\",\n \"\ + parameters\": {...}\n }\n }\n:cvar function_tag: Function tag format,\ + \ pseudo-XML. This looks like:\n (parameters)\n\ + \n:cvar python_list: Python list. The output is a valid Python expression\ + \ that can be\n evaluated to a list. Each element in the list is a function\ + \ call. Example:\n [\"function_name(param1, param2)\", \"function_name(param1,\ + \ param2)\"]" + ToolResponse: + properties: + call_id: + type: string + title: Call Id + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata type: object + required: + - call_id + - tool_name + - content + title: ToolResponse + description: 'Response from a tool invocation. + + + :param call_id: Unique identifier for the tool call this response is for + + :param tool_name: Name of the tool that was invoked + + :param content: The response content from the tool + + :param metadata: (Optional) Additional metadata about the tool response' + TopKSamplingStrategy: properties: - dataset_id: + type: type: string - description: >- - Unique identifier for the training dataset - batch_size: + const: top_k + title: Type + default: top_k + top_k: type: integer - description: Number of samples per training batch - shuffle: - type: boolean - description: >- - Whether to shuffle the dataset during training - data_format: - $ref: '#/components/schemas/DatasetFormat' - description: >- - Format of the dataset (instruct or dialog) - validation_dataset_id: - type: string - description: >- - (Optional) Unique identifier for the validation dataset - packed: - type: boolean - default: false - description: >- - (Optional) Whether to pack multiple samples into a single sequence for - efficiency - train_on_input: - type: boolean - default: false - description: >- - (Optional) Whether to compute loss on input tokens as well as output tokens - additionalProperties: false - required: - - dataset_id - - batch_size - - shuffle - - data_format - title: DataConfig - description: >- - Configuration for training data and data loading. - DatasetFormat: - type: string - enum: - - instruct - - dialog - title: DatasetFormat - description: Format of the training dataset. - EfficiencyConfig: + minimum: 1.0 + title: Top K type: object + required: + - top_k + title: TopKSamplingStrategy + description: 'Top-k sampling strategy that restricts sampling to the k most + likely tokens. + + + :param type: Must be "top_k" to identify this sampling strategy + + :param top_k: Number of top tokens to consider for sampling. Must be at least + 1' + TopPSamplingStrategy: properties: - enable_activation_checkpointing: - type: boolean - default: false - description: >- - (Optional) Whether to use activation checkpointing to reduce memory usage - enable_activation_offloading: - type: boolean - default: false - description: >- - (Optional) Whether to offload activations to CPU to save GPU memory - memory_efficient_fsdp_wrap: - type: boolean - default: false - description: >- - (Optional) Whether to use memory-efficient FSDP wrapping - fsdp_cpu_offload: - type: boolean - default: false - description: >- - (Optional) Whether to offload FSDP parameters to CPU - additionalProperties: false - title: EfficiencyConfig - description: >- - Configuration for memory and compute efficiency optimizations. - OptimizerConfig: + type: + type: string + const: top_p + title: Type + default: top_p + temperature: + anyOf: + - type: number + minimum: 0.0 + - type: 'null' + title: Temperature + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + default: 0.95 type: object - properties: - optimizer_type: - $ref: '#/components/schemas/OptimizerType' - description: >- - Type of optimizer to use (adam, adamw, or sgd) - lr: - type: number - description: Learning rate for the optimizer - weight_decay: - type: number - description: >- - Weight decay coefficient for regularization - num_warmup_steps: - type: integer - description: Number of steps for learning rate warmup - additionalProperties: false required: - - optimizer_type - - lr - - weight_decay - - num_warmup_steps - title: OptimizerConfig - description: >- - Configuration parameters for the optimization algorithm. - OptimizerType: - type: string - enum: - - adam - - adamw - - sgd - title: OptimizerType - description: >- - Available optimizer algorithms for training. + - temperature + title: TopPSamplingStrategy + description: 'Top-p (nucleus) sampling strategy that samples from the smallest + set of tokens with cumulative probability >= p. + + + :param type: Must be "top_p" to identify this sampling strategy + + :param temperature: Controls randomness in sampling. Higher values increase + randomness + + :param top_p: Cumulative probability threshold for nucleus sampling. Defaults + to 0.95' TrainingConfig: - type: object properties: n_epochs: type: integer - description: Number of training epochs to run + title: N Epochs max_steps_per_epoch: type: integer + title: Max Steps Per Epoch default: 1 - description: Maximum number of steps to run per epoch gradient_accumulation_steps: type: integer + title: Gradient Accumulation Steps default: 1 - description: >- - Number of steps to accumulate gradients before updating max_validation_steps: - type: integer + anyOf: + - type: integer + - type: 'null' + title: Max Validation Steps default: 1 - description: >- - (Optional) Maximum number of validation steps per epoch data_config: - $ref: '#/components/schemas/DataConfig' - description: >- - (Optional) Configuration for data loading and formatting + anyOf: + - $ref: '#/components/schemas/DataConfig' + - type: 'null' optimizer_config: - $ref: '#/components/schemas/OptimizerConfig' - description: >- - (Optional) Configuration for the optimization algorithm + anyOf: + - $ref: '#/components/schemas/OptimizerConfig' + - type: 'null' efficiency_config: - $ref: '#/components/schemas/EfficiencyConfig' - description: >- - (Optional) Configuration for memory and compute optimizations + anyOf: + - $ref: '#/components/schemas/EfficiencyConfig' + - type: 'null' dtype: - type: string + anyOf: + - type: string + - type: 'null' + title: Dtype default: bf16 - description: >- - (Optional) Data type for model parameters (bf16, fp16, fp32) - additionalProperties: false + type: object required: - - n_epochs - - max_steps_per_epoch - - gradient_accumulation_steps + - n_epochs title: TrainingConfig - description: >- - Comprehensive configuration for the training process. - PreferenceOptimizeRequest: - type: object + description: 'Comprehensive configuration for the training process. + + + :param n_epochs: Number of training epochs to run + + :param max_steps_per_epoch: Maximum number of steps to run per epoch + + :param gradient_accumulation_steps: Number of steps to accumulate gradients + before updating + + :param max_validation_steps: (Optional) Maximum number of validation steps + per epoch + + :param data_config: (Optional) Configuration for data loading and formatting + + :param optimizer_config: (Optional) Configuration for the optimization algorithm + + :param efficiency_config: (Optional) Configuration for memory and compute + optimizations + + :param dtype: (Optional) Data type for model parameters (bf16, fp16, fp32)' + URIDataSource: properties: - job_uuid: + type: type: string - description: The UUID of the job to create. - finetuned_model: + const: uri + title: Type + default: uri + uri: type: string - description: The model to fine-tune. - algorithm_config: - $ref: '#/components/schemas/DPOAlignmentConfig' - description: The algorithm configuration. - training_config: - $ref: '#/components/schemas/TrainingConfig' - description: The training configuration. - hyperparam_search_config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The hyperparam search configuration. - logger_config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The logger configuration. - additionalProperties: false - required: - - job_uuid - - finetuned_model - - algorithm_config - - training_config - - hyperparam_search_config - - logger_config - title: PreferenceOptimizeRequest - PostTrainingJob: + title: Uri type: object - properties: - job_uuid: - type: string - additionalProperties: false required: - - job_uuid - title: PostTrainingJob - AlgorithmConfig: - oneOf: - - $ref: '#/components/schemas/LoraFinetuningConfig' - - $ref: '#/components/schemas/QATFinetuningConfig' - discriminator: - propertyName: type - mapping: - LoRA: '#/components/schemas/LoraFinetuningConfig' - QAT: '#/components/schemas/QATFinetuningConfig' - LoraFinetuningConfig: - type: object + - uri + title: URIDataSource + description: "A dataset that can be obtained from a URI.\n:param uri: The dataset\ + \ can be obtained from a URI. E.g.\n - \"https://mywebsite.com/mydata.jsonl\"\ + \n - \"lsfs://mydata.jsonl\"\n - \"data:csv;base64,{base64_content}\"" + URL: properties: - type: + uri: type: string - const: LoRA - default: LoRA - description: Algorithm type identifier, always "LoRA" - lora_attn_modules: - type: array - items: - type: string - description: >- - List of attention module names to apply LoRA to - apply_lora_to_mlp: - type: boolean - description: Whether to apply LoRA to MLP layers - apply_lora_to_output: - type: boolean - description: >- - Whether to apply LoRA to output projection layers - rank: - type: integer - description: >- - Rank of the LoRA adaptation (lower rank = fewer parameters) - alpha: - type: integer - description: >- - LoRA scaling parameter that controls adaptation strength - use_dora: - type: boolean - default: false - description: >- - (Optional) Whether to use DoRA (Weight-Decomposed Low-Rank Adaptation) - quantize_base: - type: boolean - default: false - description: >- - (Optional) Whether to quantize the base model weights - additionalProperties: false - required: - - type - - lora_attn_modules - - apply_lora_to_mlp - - apply_lora_to_output - - rank - - alpha - title: LoraFinetuningConfig - description: >- - Configuration for Low-Rank Adaptation (LoRA) fine-tuning. - QATFinetuningConfig: + title: Uri type: object + required: + - uri + title: URL + description: 'A URL reference to external content. + + + :param uri: The URL string pointing to the resource' + UserMessage: properties: - type: - type: string - const: QAT - default: QAT - description: Algorithm type identifier, always "QAT" - quantizer_name: + role: type: string - description: >- - Name of the quantization algorithm to use - group_size: - type: integer - description: Size of groups for grouped quantization - additionalProperties: false + const: user + title: Role + default: user + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem' + text: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + title: Context + type: object required: - - type - - quantizer_name - - group_size - title: QATFinetuningConfig - description: >- - Configuration for Quantization-Aware Training (QAT) fine-tuning. - SupervisedFineTuneRequest: + - content + title: UserMessage + description: 'A message from the user in a chat conversation. + + + :param role: Must be "user" to identify this as a user message + + :param content: The content of the message, which can include text and other + media + + :param context: (Optional) This field is used internally by Llama Stack to + pass RAG context. This field may be removed in the API in the future.' + _URLOrData: + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data type: object + title: _URLOrData + description: 'A URL or a base64 encoded string + + + :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. + Note that URL could have length limits. + + :param data: base64 encoded image data as string' + Error: + description: 'Error response from the API. Roughly follows RFC 7807. + + + :param status: HTTP status code + + :param title: Error title, a short summary of the error which is invariant + for an error type + + :param detail: Error detail, a longer human-readable description of the error + + :param instance: (Optional) A URL which can be used to retrieve more information + about the specific occurrence of the error' properties: - job_uuid: - type: string - description: The UUID of the job to create. - training_config: - $ref: '#/components/schemas/TrainingConfig' - description: The training configuration. - hyperparam_search_config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The hyperparam search configuration. - logger_config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The logger configuration. - model: + status: + title: Status + type: integer + title: + title: Title type: string - description: The model to fine-tune. - checkpoint_dir: + detail: + title: Detail type: string - description: The directory to save checkpoint(s) to. - algorithm_config: - $ref: '#/components/schemas/AlgorithmConfig' - description: The algorithm configuration. - additionalProperties: false - required: - - job_uuid - - training_config - - hyperparam_search_config - - logger_config - title: SupervisedFineTuneRequest + instance: + anyOf: + - type: string + - type: 'null' + default: null + title: Instance + required: + - status + - title + - detail + title: Error + type: object responses: BadRequest400: description: The request was invalid or malformed @@ -4028,8 +2790,7 @@ components: title: Bad Request detail: The request was invalid or malformed TooManyRequests429: - description: >- - The client has sent too many requests in a given amount of time + description: The client has sent too many requests in a given amount of time content: application/json: schema: @@ -4037,11 +2798,9 @@ components: example: status: 429 title: Too Many Requests - detail: >- - You have exceeded the rate limit. Please try again later. + detail: You have exceeded the rate limit. Please try again later. InternalServerError500: - description: >- - The server encountered an unexpected error + description: The server encountered an unexpected error content: application/json: schema: @@ -4049,86 +2808,10 @@ components: example: status: 500 title: Internal Server Error - detail: >- - An unexpected error occurred. Our team has been notified. + detail: An unexpected error occurred DefaultError: - description: An unexpected error occurred + description: An error occurred content: application/json: schema: $ref: '#/components/schemas/Error' - example: - status: 0 - title: Error - detail: An unexpected error occurred -security: - - Default: [] -tags: - - name: Agents - description: >- - APIs for creating and interacting with agentic systems. - - - ## Agents API (Experimental) - - - > **🧪 EXPERIMENTAL**: This API is in preview and may change based on user feedback. - Great for exploring new capabilities and providing feedback to influence the - final design. - - - Main functionalities provided by this API: - - - - Create agents with specific instructions and ability to use tools. - - - Interactions with agents are grouped into sessions ("threads"), and each interaction - is called a "turn". - - - Agents can be provided with various tools (see the ToolGroups and ToolRuntime - APIs for more details). - - - Agents can be provided with various shields (see the Safety API for more details). - - - Agents can also use Memory to retrieve information from knowledge bases. See - the RAG Tool and Vector IO APIs for more details. - - - ### 🧪 Feedback Welcome - - - This API is actively being developed. We welcome feedback on: - - - API design and usability - - - Performance characteristics - - - Missing features or capabilities - - - Integration patterns - - - **Provide Feedback**: [GitHub Discussions](https://github.com/llamastack/llama-stack/discussions) - or [GitHub Issues](https://github.com/llamastack/llama-stack/issues) - x-displayName: Agents - - name: Benchmarks - description: '' - - name: DatasetIO - description: '' - - name: Datasets - description: '' - - name: Eval - description: >- - Llama Stack Evaluation API for running evaluations on model and agent candidates. - x-displayName: Evaluations - - name: PostTraining (Coming Soon) - description: '' -x-tagGroups: - - name: Operations - tags: - - Agents - - Benchmarks - - DatasetIO - - Datasets - - Eval - - PostTraining (Coming Soon) diff --git a/docs/static/llama-stack-spec.html b/docs/static/llama-stack-spec.html deleted file mode 100644 index 514bff145a..0000000000 --- a/docs/static/llama-stack-spec.html +++ /dev/null @@ -1,13724 +0,0 @@ - - - - - - - OpenAPI specification - - - - - - - - - - - - - diff --git a/docs/static/llama-stack-spec.yaml b/docs/static/llama-stack-spec.yaml index 2e87550ed5..16e00b829e 100644 --- a/docs/static/llama-stack-spec.yaml +++ b/docs/static/llama-stack-spec.yaml @@ -1,19 +1,35 @@ openapi: 3.1.0 info: - title: Llama Stack Specification - version: v1 - description: >- - This is the specification of the Llama Stack that provides - a set of endpoints and their corresponding interfaces that are - tailored to - best leverage Llama Models. - - **✅ STABLE**: Production-ready APIs with backward compatibility guarantees. + title: Llama Stack API + description: A comprehensive API for building and deploying AI applications + version: 1.0.0 servers: - - url: http://any-hosted-llama-stack.com +- url: https://api.llamastack.com + description: Production server +- url: https://staging-api.llamastack.com + description: Staging server paths: /v1/batches: get: + tags: + - V1 + summary: List Batches + description: Query endpoint for proper schema generation. + operationId: list_batches_v1_batches_get + parameters: + - name: after + in: query + required: false + schema: + type: string + title: After + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit responses: '200': description: A list of batch objects. @@ -23,35 +39,53 @@ paths: $ref: '#/components/schemas/ListBatchesResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + post: tags: - - Batches - summary: List all batches for the current user. - description: List all batches for the current user. + - V1 + summary: Create Batch + description: Query endpoint for proper schema generation. + operationId: create_batch_v1_batches_post parameters: - - name: after - in: query - description: >- - A cursor for pagination; returns batches after this batch ID. - required: false - schema: - type: string - - name: limit - in: query - description: >- - Number of batches to return (default 20, max 100). - required: true - schema: - type: integer - deprecated: false - post: + - name: input_file_id + in: query + required: false + schema: + type: string + title: Input File Id + - name: endpoint + in: query + required: false + schema: + type: string + title: Endpoint + - name: completion_window + in: query + required: false + schema: + type: string + title: Completion Window + - name: metadata + in: query + required: false + schema: + type: string + title: Metadata + - name: idempotency_key + in: query + required: false + schema: + type: string + title: Idempotency Key responses: '200': description: The created batch object. @@ -61,30 +95,30 @@ paths: $ref: '#/components/schemas/Batch' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Batches - summary: >- - Create a new batch for processing multiple API requests. - description: >- - Create a new batch for processing multiple API requests. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateBatchRequest' - required: true - deprecated: false + description: Default Response /v1/batches/{batch_id}: get: + tags: + - V1 + summary: Retrieve Batch + description: Query endpoint for proper schema generation. + operationId: retrieve_batch_v1_batches__batch_id__get + parameters: + - name: batch_id + in: path + required: true + schema: + type: string + title: Batch Id responses: '200': description: The batch object. @@ -94,30 +128,30 @@ paths: $ref: '#/components/schemas/Batch' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Batches - summary: >- - Retrieve information about a specific batch. - description: >- - Retrieve information about a specific batch. - parameters: - - name: batch_id - in: path - description: The ID of the batch to retrieve. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1/batches/{batch_id}/cancel: post: + tags: + - V1 + summary: Cancel Batch + description: Query endpoint for proper schema generation. + operationId: cancel_batch_v1_batches__batch_id__cancel_post + parameters: + - name: batch_id + in: path + required: true + schema: + type: string + title: Batch Id responses: '200': description: The updated batch object. @@ -127,28 +161,49 @@ paths: $ref: '#/components/schemas/Batch' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Batches - summary: Cancel a batch that is in progress. - description: Cancel a batch that is in progress. - parameters: - - name: batch_id - in: path - description: The ID of the batch to cancel. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1/chat/completions: get: + tags: + - V1 + summary: List Chat Completions + description: Query endpoint for proper schema generation. + operationId: list_chat_completions_v1_chat_completions_get + parameters: + - name: after + in: query + required: false + schema: + type: string + title: After + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit + - name: model + in: query + required: false + schema: + type: string + title: Model + - name: order + in: query + required: false + schema: + $ref: '#/components/schemas/Order' + default: desc responses: '200': description: A ListOpenAIChatCompletionResponse. @@ -158,86 +213,61 @@ paths: $ref: '#/components/schemas/ListOpenAIChatCompletionResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Inference - summary: List chat completions. - description: List chat completions. - parameters: - - name: after - in: query - description: >- - The ID of the last chat completion to return. - required: false - schema: - type: string - - name: limit - in: query - description: >- - The maximum number of chat completions to return. - required: false - schema: - type: integer - - name: model - in: query - description: The model to filter by. - required: false - schema: - type: string - - name: order - in: query - description: >- - The order to sort the chat completions by: "asc" or "desc". Defaults to - "desc". - required: false - schema: - $ref: '#/components/schemas/Order' - deprecated: false + description: Default Response post: + tags: + - V1 + summary: Openai Chat Completion + description: Typed endpoint for proper schema generation. + operationId: openai_chat_completion_v1_chat_completions_post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIChatCompletionRequestWithExtraBody' responses: '200': description: An OpenAIChatCompletion. content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletion' - - $ref: '#/components/schemas/OpenAIChatCompletionChunk' + $ref: '#/components/schemas/OpenAIChatCompletion' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Inference - summary: Create chat completions. - description: >- - Create chat completions. - - Generate an OpenAI-compatible chat completion for the given messages using - the specified model. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAIChatCompletionRequestWithExtraBody' - required: true - deprecated: false + description: Default Response /v1/chat/completions/{completion_id}: get: + tags: + - V1 + summary: Get Chat Completion + description: Query endpoint for proper schema generation. + operationId: get_chat_completion_v1_chat_completions__completion_id__get + parameters: + - name: completion_id + in: path + required: true + schema: + type: string + title: Completion Id responses: '200': description: A OpenAICompletionWithInputMessages. @@ -247,31 +277,29 @@ paths: $ref: '#/components/schemas/OpenAICompletionWithInputMessages' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Inference - summary: Get chat completion. - description: >- - Get chat completion. - - Describe a chat completion by its ID. - parameters: - - name: completion_id - in: path - description: ID of the chat completion. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1/completions: post: + tags: + - V1 + summary: Openai Completion + description: Typed endpoint for proper schema generation. + operationId: openai_completion_v1_completions_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAICompletionRequestWithExtraBody' + required: true responses: '200': description: An OpenAICompletion. @@ -280,33 +308,58 @@ paths: schema: $ref: '#/components/schemas/OpenAICompletion' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' + /v1/conversations: + post: tags: - - Inference - summary: Create completion. - description: >- - Create completion. - - Generate an OpenAI-compatible completion for the given prompt using the specified - model. - parameters: [] + - V1 + summary: Create Conversation + description: Query endpoint for proper schema generation. + operationId: create_conversation_v1_conversations_post + parameters: + - name: metadata + in: query + required: false + schema: + type: string + title: Metadata requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenAICompletionRequestWithExtraBody' - required: true - deprecated: false - /v1/conversations: - post: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + discriminator: + propertyName: type + mapping: + message: '#/components/schemas/OpenAIResponseMessage' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + title: Items responses: '200': description: The created conversation object. @@ -316,137 +369,156 @@ paths: $ref: '#/components/schemas/Conversation' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/conversations/{conversation_id}: + delete: tags: - - Conversations - summary: Create a conversation. - description: >- - Create a conversation. - - Create a conversation. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateConversationRequest' + - V1 + summary: Openai Delete Conversation + description: Query endpoint for proper schema generation. + operationId: openai_delete_conversation_v1_conversations__conversation_id__delete + parameters: + - name: conversation_id + in: path required: true - deprecated: false - /v1/conversations/{conversation_id}: - get: + schema: + type: string + title: Conversation Id responses: '200': - description: The conversation object. + description: The deleted conversation resource. content: application/json: schema: - $ref: '#/components/schemas/Conversation' + $ref: '#/components/schemas/ConversationDeletedResource' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Conversations - summary: Retrieve a conversation. - description: >- - Retrieve a conversation. - - Get a conversation with the given ID. + - V1 + summary: Get Conversation + description: Query endpoint for proper schema generation. + operationId: get_conversation_v1_conversations__conversation_id__get parameters: - - name: conversation_id - in: path - description: The conversation identifier. - required: true - schema: - type: string - deprecated: false - post: + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id responses: '200': - description: The updated conversation object. + description: The conversation object. content: application/json: schema: $ref: '#/components/schemas/Conversation' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + post: tags: - - Conversations - summary: Update a conversation. - description: >- - Update a conversation. - - Update a conversation's metadata with the given ID. + - V1 + summary: Update Conversation + description: Query endpoint for proper schema generation. + operationId: update_conversation_v1_conversations__conversation_id__post parameters: - - name: conversation_id - in: path - description: The conversation identifier. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateConversationRequest' + - name: conversation_id + in: path required: true - deprecated: false - delete: + schema: + type: string + title: Conversation Id + - name: metadata + in: query + required: false + schema: + type: string + title: Metadata responses: '200': - description: The deleted conversation resource. + description: The updated conversation object. content: application/json: schema: - $ref: '#/components/schemas/ConversationDeletedResource' + $ref: '#/components/schemas/Conversation' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/conversations/{conversation_id}/items: + get: tags: - - Conversations - summary: Delete a conversation. - description: >- - Delete a conversation. - - Delete a conversation with the given ID. + - V1 + summary: List Items + description: Query endpoint for proper schema generation. + operationId: list_items_v1_conversations__conversation_id__items_get parameters: - - name: conversation_id - in: path - description: The conversation identifier. - required: true - schema: - type: string - deprecated: false - /v1/conversations/{conversation_id}/items: - get: + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id + - name: after + in: query + required: false + schema: + type: string + title: After + - name: include + in: query + required: false + schema: + $ref: '#/components/schemas/ConversationItemInclude' + - name: limit + in: query + required: false + schema: + type: integer + title: Limit + - name: order + in: query + required: false + schema: + type: string + title: Order responses: '200': description: List of conversation items. @@ -456,153 +528,83 @@ paths: $ref: '#/components/schemas/ConversationItemList' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Conversations - summary: List items. - description: >- - List items. - - List items in the conversation. - parameters: - - name: conversation_id - in: path - description: The conversation identifier. - required: true - schema: - type: string - - name: after - in: query - description: >- - An item ID to list items after, used in pagination. - required: false - schema: - type: string - - name: include - in: query - description: >- - Specify additional output data to include in the response. - required: false - schema: - type: array - items: - type: string - enum: - - web_search_call.action.sources - - code_interpreter_call.outputs - - computer_call_output.output.image_url - - file_search_call.results - - message.input_image.image_url - - message.output_text.logprobs - - reasoning.encrypted_content - title: ConversationItemInclude - description: >- - Specify additional output data to include in the model response. - - name: limit - in: query - description: >- - A limit on the number of objects to be returned (1-100, default 20). - required: false - schema: - type: integer - - name: order - in: query - description: >- - The order to return items in (asc or desc, default desc). - required: false - schema: - type: string - enum: - - asc - - desc - deprecated: false + description: Default Response post: - responses: - '200': - description: List of created items. - content: - application/json: - schema: - $ref: '#/components/schemas/ConversationItemList' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' tags: - - Conversations - summary: Create items. - description: >- - Create items. - - Create items in the conversation. + - V1 + summary: Add Items + description: Query endpoint for proper schema generation. + operationId: add_items_v1_conversations__conversation_id__items_post parameters: - - name: conversation_id - in: path - description: The conversation identifier. - required: true - schema: - type: string + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id requestBody: content: application/json: schema: - $ref: '#/components/schemas/AddItemsRequest' - required: true - deprecated: false - /v1/conversations/{conversation_id}/items/{item_id}: - get: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + title: Items responses: '200': - description: The conversation item. + description: List of created items. content: application/json: schema: - $ref: '#/components/schemas/ConversationItem' + $ref: '#/components/schemas/ConversationItemList' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/conversations/{conversation_id}/items/{item_id}: + delete: tags: - - Conversations - summary: Retrieve an item. - description: >- - Retrieve an item. - - Retrieve a conversation item. + - V1 + summary: Openai Delete Conversation Item + description: Query endpoint for proper schema generation. + operationId: openai_delete_conversation_item_v1_conversations__conversation_id__items__item_id__delete parameters: - - name: conversation_id - in: path - description: The conversation identifier. - required: true - schema: - type: string - - name: item_id - in: path - description: The item identifier. - required: true - schema: - type: string - deprecated: false - delete: + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id + - name: item_id + in: path + required: true + schema: + type: string + title: Item Id responses: '200': description: The deleted item resource. @@ -612,339 +614,311 @@ paths: $ref: '#/components/schemas/ConversationItemDeletedResource' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Conversations - summary: Delete an item. - description: >- - Delete an item. - - Delete a conversation item. + - V1 + summary: Retrieve + description: Generic endpoint - this would be replaced with actual implementation. + operationId: retrieve_v1_conversations__conversation_id__items__item_id__get parameters: - - name: conversation_id - in: path - description: The conversation identifier. - required: true - schema: - type: string - - name: item_id - in: path - description: The item identifier. - required: true - schema: - type: string - deprecated: false - /v1/embeddings: - post: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: >- - An OpenAIEmbeddingsResponse containing the embeddings. + description: The conversation item. content: application/json: - schema: - $ref: '#/components/schemas/OpenAIEmbeddingsResponse' + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/embeddings: + post: tags: - - Inference - summary: Create embeddings. - description: >- - Create embeddings. - - Generate OpenAI-compatible embeddings for the given input using the specified - model. - parameters: [] + - V1 + summary: Openai Embeddings + description: Typed endpoint for proper schema generation. + operationId: openai_embeddings_v1_embeddings_post requestBody: content: application/json: schema: $ref: '#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody' required: true - deprecated: false - /v1/files: - get: responses: '200': - description: >- - An ListOpenAIFileResponse containing the list of files. + description: An OpenAIEmbeddingsResponse containing the embeddings. content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIFileResponse' + $ref: '#/components/schemas/OpenAIEmbeddingsResponse' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' + /v1/files: + get: tags: - - Files - summary: List files. - description: >- - List files. - - Returns a list of files that belong to the user's organization. + - V1 + summary: Openai List Files + description: Query endpoint for proper schema generation. + operationId: openai_list_files_v1_files_get parameters: - - name: after - in: query - description: >- - A cursor for use in pagination. `after` is an object ID that defines your - place in the list. For instance, if you make a list request and receive - 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo - in order to fetch the next page of the list. - required: false - schema: - type: string - - name: limit - in: query - description: >- - A limit on the number of objects to be returned. Limit can range between - 1 and 10,000, and the default is 10,000. - required: false - schema: - type: integer - - name: order - in: query - description: >- - Sort order by the `created_at` timestamp of the objects. `asc` for ascending - order and `desc` for descending order. - required: false - schema: - $ref: '#/components/schemas/Order' - - name: purpose - in: query - description: >- - Only return files with the given purpose. - required: false - schema: - $ref: '#/components/schemas/OpenAIFilePurpose' - deprecated: false - post: + - name: after + in: query + required: false + schema: + type: string + title: After + - name: limit + in: query + required: false + schema: + type: integer + default: 10000 + title: Limit + - name: order + in: query + required: false + schema: + $ref: '#/components/schemas/Order' + default: desc + - name: purpose + in: query + required: false + schema: + $ref: '#/components/schemas/OpenAIFilePurpose' responses: '200': - description: >- - An OpenAIFileObject representing the uploaded file. + description: An ListOpenAIFileResponse containing the list of files. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileObject' + $ref: '#/components/schemas/ListOpenAIFileResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + post: tags: - - Files - summary: Upload file. - description: >- - Upload file. - - Upload a file that can be used across various endpoints. - - - The file upload should be a multipart form request with: - - - file: The File object (not file name) to be uploaded. - - - purpose: The intended purpose of the uploaded file. - - - expires_after: Optional form values describing expiration for the file. - parameters: [] - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - file: - type: string - format: binary - purpose: - $ref: '#/components/schemas/OpenAIFilePurpose' - expires_after: - $ref: '#/components/schemas/ExpiresAfter' - required: - - file - - purpose - required: true - deprecated: false - /v1/files/{file_id}: - get: + - V1 + summary: Openai Upload File + description: Response-only endpoint for proper schema generation. + operationId: openai_upload_file_v1_files_post responses: '200': - description: >- - An OpenAIFileObject containing file information. + description: An OpenAIFileObject representing the uploaded file. content: application/json: schema: $ref: '#/components/schemas/OpenAIFileObject' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/files/{file_id}: + delete: tags: - - Files - summary: Retrieve file. - description: >- - Retrieve file. - - Returns information about a specific file. + - V1 + summary: Openai Delete File + description: Query endpoint for proper schema generation. + operationId: openai_delete_file_v1_files__file_id__delete parameters: - - name: file_id - in: path - description: >- - The ID of the file to use for this request. - required: true - schema: - type: string - deprecated: false - delete: + - name: file_id + in: path + required: true + schema: + type: string + title: File Id responses: '200': - description: >- - An OpenAIFileDeleteResponse indicating successful deletion. + description: An OpenAIFileDeleteResponse indicating successful deletion. content: application/json: schema: $ref: '#/components/schemas/OpenAIFileDeleteResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Files - summary: Delete file. - description: Delete file. + - V1 + summary: Openai Retrieve File + description: Query endpoint for proper schema generation. + operationId: openai_retrieve_file_v1_files__file_id__get parameters: - - name: file_id - in: path - description: >- - The ID of the file to use for this request. - required: true - schema: - type: string - deprecated: false - /v1/files/{file_id}/content: - get: + - name: file_id + in: path + required: true + schema: + type: string + title: File Id responses: '200': - description: >- - The raw file content as a binary response. + description: An OpenAIFileObject containing file information. content: application/json: schema: - $ref: '#/components/schemas/Response' + $ref: '#/components/schemas/OpenAIFileObject' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/files/{file_id}/content: + get: tags: - - Files - summary: Retrieve file content. - description: >- - Retrieve file content. - - Returns the contents of the specified file. + - V1 + summary: Openai Retrieve File Content + description: Generic endpoint - this would be replaced with actual implementation. + operationId: openai_retrieve_file_content_v1_files__file_id__content_get parameters: - - name: file_id - in: path - description: >- - The ID of the file to use for this request. - required: true - schema: - type: string - deprecated: false + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + responses: + '200': + description: The raw file content as a binary response. + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response /v1/health: get: + tags: + - V1 + summary: Health + description: Response-only endpoint for proper schema generation. + operationId: health_v1_health_get responses: '200': - description: >- - Health information indicating if the service is operational. + description: Health information indicating if the service is operational. content: application/json: schema: $ref: '#/components/schemas/HealthInfo' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - Inspect - summary: Get health status. - description: >- - Get health status. - - Get the current health status of the service. - parameters: [] - deprecated: false /v1/inspect/routes: get: + tags: + - V1 + summary: List Routes + description: Response-only endpoint for proper schema generation. + operationId: list_routes_v1_inspect_routes_get responses: '200': - description: >- - Response containing information about all available routes. + description: Response containing information about all available routes. content: application/json: schema: $ref: '#/components/schemas/ListRoutesResponse' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' tags: - Inspect @@ -972,6 +946,11 @@ paths: deprecated: false /v1/models: get: + tags: + - V1 + summary: List Models + description: Response-only endpoint for proper schema generation. + operationId: list_models_v1_models_get responses: '200': description: A OpenAIListModelsResponse. @@ -981,12 +960,13 @@ paths: $ref: '#/components/schemas/OpenAIListModelsResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' tags: @@ -996,6 +976,41 @@ paths: parameters: [] deprecated: false post: + tags: + - V1 + summary: Register Model + description: Query endpoint for proper schema generation. + operationId: register_model_v1_models_post + parameters: + - name: model_id + in: query + required: false + schema: + type: string + title: Model Id + - name: provider_model_id + in: query + required: false + schema: + type: string + title: Provider Model Id + - name: provider_id + in: query + required: false + schema: + type: string + title: Provider Id + - name: metadata + in: query + required: false + schema: + type: string + title: Metadata + - name: model_type + in: query + required: false + schema: + $ref: '#/components/schemas/ModelType' responses: '200': description: A Model. @@ -1005,95 +1020,104 @@ paths: $ref: '#/components/schemas/Model' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/models/{model_id}: + delete: tags: - - Models - summary: Register model. - description: >- - Register model. - - Register a model. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterModelRequest' + - V1 + summary: Unregister Model + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_model_v1_models__model_id__delete + parameters: + - name: args + in: query required: true - deprecated: false - /v1/models/{model_id}: - get: + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: A Model. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/Model' + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Models - summary: Get model. - description: >- - Get model. - - Get a model by its identifier. + - V1 + summary: Get Model + description: Query endpoint for proper schema generation. + operationId: get_model_v1_models__model_id__get parameters: - - name: model_id - in: path - description: The identifier of the model to get. - required: true - schema: - type: string - deprecated: false - delete: + - name: model_id + in: path + required: true + schema: + type: string + title: Model Id responses: '200': - description: OK + description: A Model. + content: + application/json: + schema: + $ref: '#/components/schemas/Model' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Models - summary: Unregister model. - description: >- - Unregister model. - - Unregister a model. - parameters: - - name: model_id - in: path - description: >- - The identifier of the model to unregister. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1/moderations: post: + tags: + - V1 + summary: Run Moderation + description: Query endpoint for proper schema generation. + operationId: run_moderation_v1_moderations_post + parameters: + - name: input + in: query + required: false + schema: + type: string + title: Input + - name: model + in: query + required: false + schema: + type: string + title: Model responses: '200': description: A moderation object. @@ -1103,56 +1127,61 @@ paths: $ref: '#/components/schemas/ModerationObject' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Safety - summary: Create moderation. - description: >- - Create moderation. - - Classifies if text and/or image inputs are potentially harmful. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RunModerationRequest' - required: true - deprecated: false + description: Default Response /v1/prompts: get: + tags: + - V1 + summary: List Prompts + description: Response-only endpoint for proper schema generation. + operationId: list_prompts_v1_prompts_get responses: '200': - description: >- - A ListPromptsResponse containing all prompts. + description: A ListPromptsResponse containing all prompts. content: application/json: schema: $ref: '#/components/schemas/ListPromptsResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Prompts - summary: List all prompts. - description: List all prompts. - parameters: [] - deprecated: false + description: Default Response post: + tags: + - V1 + summary: Create Prompt + description: Query endpoint for proper schema generation. + operationId: create_prompt_v1_prompts_post + parameters: + - name: prompt + in: query + required: false + schema: + type: string + title: Prompt + - name: variables + in: query + required: false + schema: + type: string + title: Variables responses: '200': description: The created Prompt resource. @@ -1162,282 +1191,311 @@ paths: $ref: '#/components/schemas/Prompt' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/prompts/{prompt_id}: + delete: tags: - - Prompts - summary: Create prompt. - description: >- - Create prompt. - - Create a new prompt. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreatePromptRequest' + - V1 + summary: Delete Prompt + description: Generic endpoint - this would be replaced with actual implementation. + operationId: delete_prompt_v1_prompts__prompt_id__delete + parameters: + - name: args + in: query required: true - deprecated: false - /v1/prompts/{prompt_id}: - get: + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: A Prompt resource. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/Prompt' + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Prompts - summary: Get prompt. - description: >- - Get prompt. - - Get a prompt by its identifier and optional version. + - V1 + summary: Get Prompt + description: Query endpoint for proper schema generation. + operationId: get_prompt_v1_prompts__prompt_id__get parameters: - - name: prompt_id - in: path - description: The identifier of the prompt to get. - required: true - schema: - type: string - - name: version - in: query - description: >- - The version of the prompt to get (defaults to latest). - required: false - schema: - type: integer - deprecated: false - post: + - name: prompt_id + in: path + required: true + schema: + type: string + title: Prompt Id + - name: version + in: query + required: false + schema: + type: integer + title: Version responses: '200': - description: >- - The updated Prompt resource with incremented version. + description: A Prompt resource. content: application/json: schema: $ref: '#/components/schemas/Prompt' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + post: tags: - - Prompts - summary: Update prompt. - description: >- - Update prompt. - - Update an existing prompt (increments version). + - V1 + summary: Update Prompt + description: Query endpoint for proper schema generation. + operationId: update_prompt_v1_prompts__prompt_id__post parameters: - - name: prompt_id - in: path - description: The identifier of the prompt to update. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePromptRequest' + - name: prompt_id + in: path required: true - deprecated: false - delete: + schema: + type: string + title: Prompt Id + - name: prompt + in: query + required: false + schema: + type: string + title: Prompt + - name: version + in: query + required: false + schema: + type: integer + title: Version + - name: variables + in: query + required: false + schema: + type: string + title: Variables + - name: set_as_default + in: query + required: false + schema: + type: boolean + default: true + title: Set As Default responses: '200': - description: OK + description: The updated Prompt resource with incremented version. + content: + application/json: + schema: + $ref: '#/components/schemas/Prompt' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Prompts - summary: Delete prompt. - description: >- - Delete prompt. - - Delete a prompt. - parameters: - - name: prompt_id - in: path - description: The identifier of the prompt to delete. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1/prompts/{prompt_id}/set-default-version: post: + tags: + - V1 + summary: Set Default Version + description: Query endpoint for proper schema generation. + operationId: set_default_version_v1_prompts__prompt_id__set_default_version_post + parameters: + - name: prompt_id + in: path + required: true + schema: + type: string + title: Prompt Id + - name: version + in: query + required: false + schema: + type: integer + title: Version responses: '200': - description: >- - The prompt with the specified version now set as default. + description: The prompt with the specified version now set as default. content: application/json: schema: $ref: '#/components/schemas/Prompt' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/prompts/{prompt_id}/versions: + get: tags: - - Prompts - summary: Set prompt version. - description: >- - Set prompt version. - - Set which version of a prompt should be the default in get_prompt (latest). + - V1 + summary: List Prompt Versions + description: Query endpoint for proper schema generation. + operationId: list_prompt_versions_v1_prompts__prompt_id__versions_get parameters: - - name: prompt_id - in: path - description: The identifier of the prompt. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SetDefaultVersionRequest' + - name: prompt_id + in: path required: true - deprecated: false - /v1/prompts/{prompt_id}/versions: - get: + schema: + type: string + title: Prompt Id responses: '200': - description: >- - A ListPromptsResponse containing all versions of the prompt. + description: A ListPromptsResponse containing all versions of the prompt. content: application/json: schema: $ref: '#/components/schemas/ListPromptsResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Prompts - summary: List prompt versions. - description: >- - List prompt versions. - - List all versions of a specific prompt. - parameters: - - name: prompt_id - in: path - description: >- - The identifier of the prompt to list versions for. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1/providers: get: + tags: + - V1 + summary: List Providers + description: Response-only endpoint for proper schema generation. + operationId: list_providers_v1_providers_get responses: '200': - description: >- - A ListProvidersResponse containing information about all providers. + description: A ListProvidersResponse containing information about all providers. content: application/json: schema: $ref: '#/components/schemas/ListProvidersResponse' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: List providers. - description: >- - List providers. - - List all available providers. - parameters: [] - deprecated: false /v1/providers/{provider_id}: get: + tags: + - V1 + summary: Inspect Provider + description: Query endpoint for proper schema generation. + operationId: inspect_provider_v1_providers__provider_id__get + parameters: + - name: provider_id + in: path + required: true + schema: + type: string + title: Provider Id responses: '200': - description: >- - A ProviderInfo object containing the provider's details. + description: A ProviderInfo object containing the provider's details. content: application/json: schema: $ref: '#/components/schemas/ProviderInfo' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: Get provider. - description: >- - Get provider. - - Get detailed information about a specific provider. - parameters: - - name: provider_id - in: path - description: The ID of the provider to inspect. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1/responses: get: + tags: + - V1 + summary: List Openai Responses + description: Query endpoint for proper schema generation. + operationId: list_openai_responses_v1_responses_get + parameters: + - name: after + in: query + required: false + schema: + type: string + title: After + - name: limit + in: query + required: false + schema: + type: integer + default: 50 + title: Limit + - name: model + in: query + required: false + schema: + type: string + title: Model + - name: order + in: query + required: false + schema: + $ref: '#/components/schemas/Order' + default: desc responses: '200': description: A ListOpenAIResponseObject. @@ -1447,46 +1505,91 @@ paths: $ref: '#/components/schemas/ListOpenAIResponseObject' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + post: tags: - - Agents - summary: List all responses. - description: List all responses. + - V1 + summary: Create Openai Response + description: Query endpoint for proper schema generation. + operationId: create_openai_response_v1_responses_post parameters: - - name: after - in: query - description: The ID of the last response to return. - required: false - schema: - type: string - - name: limit - in: query - description: The number of responses to return. - required: false - schema: - type: integer - - name: model - in: query - description: The model to filter responses by. - required: false - schema: - type: string - - name: order - in: query - description: >- - The order to sort responses by when sorted by created_at ('asc' or 'desc'). - required: false - schema: - $ref: '#/components/schemas/Order' - deprecated: false - post: + - name: input + in: query + required: false + schema: + type: string + title: Input + - name: model + in: query + required: false + schema: + type: string + title: Model + - name: instructions + in: query + required: false + schema: + type: string + title: Instructions + - name: previous_response_id + in: query + required: false + schema: + type: string + title: Previous Response Id + - name: conversation + in: query + required: false + schema: + type: string + title: Conversation + - name: store + in: query + required: false + schema: + type: boolean + default: true + title: Store + - name: stream + in: query + required: false + schema: + type: boolean + default: false + title: Stream + - name: temperature + in: query + required: false + schema: + type: number + title: Temperature + - name: include + in: query + required: false + schema: + type: string + title: Include + - name: max_infer_iters + in: query + required: false + schema: + type: integer + default: 10 + title: Max Infer Iters + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Body_create_openai_response_v1_responses_post' responses: '200': description: An OpenAIResponseObject. @@ -1494,107 +1597,128 @@ paths: application/json: schema: $ref: '#/components/schemas/OpenAIResponseObject' - text/event-stream: - schema: - $ref: '#/components/schemas/OpenAIResponseObjectStream' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/responses/{response_id}: + delete: tags: - - Agents - summary: Create a model response. - description: Create a model response. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateOpenaiResponseRequest' + - V1 + summary: Delete Openai Response + description: Query endpoint for proper schema generation. + operationId: delete_openai_response_v1_responses__response_id__delete + parameters: + - name: response_id + in: path required: true - deprecated: false - x-llama-stack-extra-body-params: - - name: guardrails - schema: - type: array - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ResponseGuardrailSpec' - description: >- - List of guardrails to apply during response generation. Guardrails provide - safety and content moderation. - required: false - /v1/responses/{response_id}: - get: + schema: + type: string + title: Response Id responses: '200': - description: An OpenAIResponseObject. + description: An OpenAIDeleteResponseObject content: application/json: schema: - $ref: '#/components/schemas/OpenAIResponseObject' + $ref: '#/components/schemas/OpenAIDeleteResponseObject' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Agents - summary: Get a model response. - description: Get a model response. + - V1 + summary: Get Openai Response + description: Query endpoint for proper schema generation. + operationId: get_openai_response_v1_responses__response_id__get parameters: - - name: response_id - in: path - description: >- - The ID of the OpenAI response to retrieve. - required: true - schema: - type: string - deprecated: false - delete: + - name: response_id + in: path + required: true + schema: + type: string + title: Response Id responses: '200': - description: An OpenAIDeleteResponseObject + description: An OpenAIResponseObject. content: application/json: schema: - $ref: '#/components/schemas/OpenAIDeleteResponseObject' + $ref: '#/components/schemas/OpenAIResponseObject' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: Delete a response. - description: Delete a response. - parameters: - - name: response_id - in: path - description: The ID of the OpenAI response to delete. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1/responses/{response_id}/input_items: get: + tags: + - V1 + summary: List Openai Response Input Items + description: Query endpoint for proper schema generation. + operationId: list_openai_response_input_items_v1_responses__response_id__input_items_get + parameters: + - name: response_id + in: path + required: true + schema: + type: string + title: Response Id + - name: after + in: query + required: false + schema: + type: string + title: After + - name: before + in: query + required: false + schema: + type: string + title: Before + - name: include + in: query + required: false + schema: + type: string + title: Include + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit + - name: order + in: query + required: false + schema: + $ref: '#/components/schemas/Order' + default: desc responses: '200': description: An ListOpenAIResponseInputItem. @@ -1604,67 +1728,47 @@ paths: $ref: '#/components/schemas/ListOpenAIResponseInputItem' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: List input items. - description: List input items. - parameters: - - name: response_id - in: path - description: >- - The ID of the response to retrieve input items for. - required: true - schema: - type: string - - name: after - in: query - description: >- - An item ID to list items after, used for pagination. - required: false - schema: - type: string - - name: before - in: query - description: >- - An item ID to list items before, used for pagination. - required: false - schema: - type: string - - name: include - in: query - description: >- - Additional fields to include in the response. - required: false - schema: - type: array - items: - type: string - - name: limit - in: query - description: >- - A limit on the number of objects to be returned. Limit can range between - 1 and 100, and the default is 20. - required: false - schema: - type: integer - - name: order - in: query - description: >- - The order to return the input items in. Default is desc. - required: false - schema: - $ref: '#/components/schemas/Order' - deprecated: false + description: Default Response /v1/safety/run-shield: post: + tags: + - V1 + summary: Run Shield + description: Query endpoint for proper schema generation. + operationId: run_shield_v1_safety_run_shield_post + parameters: + - name: shield_id + in: query + required: false + schema: + type: string + title: Shield Id + - name: params + in: query + required: false + schema: + type: string + title: Params + requestBody: + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Messages responses: '200': description: A RunShieldResponse. @@ -1674,31 +1778,23 @@ paths: $ref: '#/components/schemas/RunShieldResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/scoring-functions: + get: tags: - - Safety - summary: Run shield. - description: >- - Run shield. - - Run a shield. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RunShieldRequest' - required: true - deprecated: false - /v1/scoring-functions: - get: + - V1 + summary: List Scoring Functions + description: Response-only endpoint for proper schema generation. + operationId: list_scoring_functions_v1_scoring_functions_get responses: '200': description: A ListScoringFunctionsResponse. @@ -1708,138 +1804,185 @@ paths: $ref: '#/components/schemas/ListScoringFunctionsResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - ScoringFunctions - summary: List all scoring functions. - description: List all scoring functions. - parameters: [] - deprecated: false + description: Default Response post: + tags: + - V1 + summary: Register Scoring Function + description: Generic endpoint - this would be replaced with actual implementation. + operationId: register_scoring_function_v1_scoring_functions_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/scoring-functions/{scoring_fn_id}: + delete: tags: - - ScoringFunctions - summary: Register a scoring function. - description: Register a scoring function. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterScoringFunctionRequest' + - V1 + summary: Unregister Scoring Function + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_scoring_function_v1_scoring_functions__scoring_fn_id__delete + parameters: + - name: args + in: query required: true - deprecated: false - /v1/scoring-functions/{scoring_fn_id}: - get: + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: A ScoringFn. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/ScoringFn' + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - ScoringFunctions - summary: Get a scoring function by its ID. - description: Get a scoring function by its ID. + - V1 + summary: Get Scoring Function + description: Query endpoint for proper schema generation. + operationId: get_scoring_function_v1_scoring_functions__scoring_fn_id__get parameters: - - name: scoring_fn_id - in: path - description: The ID of the scoring function to get. - required: true - schema: - type: string - deprecated: false - delete: + - name: scoring_fn_id + in: path + required: true + schema: + type: string + title: Scoring Fn Id responses: '200': - description: OK + description: A ScoringFn. + content: + application/json: + schema: + $ref: '#/components/schemas/ScoringFn' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - ScoringFunctions - summary: Unregister a scoring function. - description: Unregister a scoring function. - parameters: - - name: scoring_fn_id - in: path - description: >- - The ID of the scoring function to unregister. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1/scoring/score: post: + tags: + - V1 + summary: Score + description: Query endpoint for proper schema generation. + operationId: score_v1_scoring_score_post + parameters: + - name: input_rows + in: query + required: false + schema: + type: string + title: Input Rows + - name: scoring_functions + in: query + required: false + schema: + type: string + title: Scoring Functions responses: '200': - description: >- - A ScoreResponse object containing rows and aggregated results. + description: A ScoreResponse object containing rows and aggregated results. content: application/json: schema: $ref: '#/components/schemas/ScoreResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Scoring - summary: Score a list of rows. - description: Score a list of rows. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ScoreRequest' - required: true - deprecated: false + description: Default Response /v1/scoring/score-batch: post: + tags: + - V1 + summary: Score Batch + description: Query endpoint for proper schema generation. + operationId: score_batch_v1_scoring_score_batch_post + parameters: + - name: dataset_id + in: query + required: false + schema: + type: string + title: Dataset Id + - name: scoring_functions + in: query + required: false + schema: + type: string + title: Scoring Functions + - name: save_results_dataset + in: query + required: false + schema: + type: boolean + default: false + title: Save Results Dataset responses: '200': description: A ScoreBatchResponse. @@ -1849,28 +1992,23 @@ paths: $ref: '#/components/schemas/ScoreBatchResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Scoring - summary: Score a batch of rows. - description: Score a batch of rows. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ScoreBatchRequest' - required: true - deprecated: false + description: Default Response /v1/shields: get: + tags: + - V1 + summary: List Shields + description: Response-only endpoint for proper schema generation. + operationId: list_shields_v1_shields_get responses: '200': description: A ListShieldsResponse. @@ -1880,21 +2018,47 @@ paths: $ref: '#/components/schemas/ListShieldsResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Shields - summary: List all shields. - description: List all shields. - parameters: [] - deprecated: false + description: Default Response post: + tags: + - V1 + summary: Register Shield + description: Query endpoint for proper schema generation. + operationId: register_shield_v1_shields_post + parameters: + - name: shield_id + in: query + required: false + schema: + type: string + title: Shield Id + - name: provider_shield_id + in: query + required: false + schema: + type: string + title: Provider Shield Id + - name: provider_id + in: query + required: false + schema: + type: string + title: Provider Id + - name: params + in: query + required: false + schema: + type: string + title: Params responses: '200': description: A Shield. @@ -1904,28 +2068,65 @@ paths: $ref: '#/components/schemas/Shield' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/shields/{identifier}: + delete: tags: - - Shields - summary: Register a shield. - description: Register a shield. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterShieldRequest' + - V1 + summary: Unregister Shield + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_shield_v1_shields__identifier__delete + parameters: + - name: args + in: query required: true - deprecated: false - /v1/shields/{identifier}: + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response get: + tags: + - V1 + summary: Get Shield + description: Query endpoint for proper schema generation. + operationId: get_shield_v1_shields__identifier__get + parameters: + - name: identifier + in: path + required: true + schema: + type: string + title: Identifier responses: '200': description: A Shield. @@ -1935,12 +2136,13 @@ paths: $ref: '#/components/schemas/Shield' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' tags: @@ -1984,6 +2186,24 @@ paths: deprecated: false /v1/tool-runtime/invoke: post: + tags: + - V1 + summary: Invoke Tool + description: Query endpoint for proper schema generation. + operationId: invoke_tool_v1_tool_runtime_invoke_post + parameters: + - name: tool_name + in: query + required: false + schema: + type: string + title: Tool Name + - name: kwargs + in: query + required: false + schema: + type: string + title: Kwargs responses: '200': description: A ToolInvocationResult. @@ -1993,28 +2213,35 @@ paths: $ref: '#/components/schemas/ToolInvocationResult' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/tool-runtime/list-tools: + get: tags: - - ToolRuntime - summary: Run a tool with the given arguments. - description: Run a tool with the given arguments. - parameters: [] + - V1 + summary: List Runtime Tools + description: Query endpoint for proper schema generation. + operationId: list_runtime_tools_v1_tool_runtime_list_tools_get + parameters: + - name: tool_group_id + in: query + required: false + schema: + type: string + title: Tool Group Id requestBody: content: application/json: schema: - $ref: '#/components/schemas/InvokeToolRequest' - required: true - deprecated: false - /v1/tool-runtime/list-tools: - get: + $ref: '#/components/schemas/URL' responses: '200': description: A ListToolDefsResponse. @@ -2024,99 +2251,103 @@ paths: $ref: '#/components/schemas/ListToolDefsResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - ToolRuntime - summary: List all tools in the runtime. - description: List all tools in the runtime. - parameters: - - name: tool_group_id - in: query - description: >- - The ID of the tool group to list tools for. - required: false - schema: - type: string - - name: mcp_endpoint - in: query - description: >- - The MCP endpoint to use for the tool group. - required: false - schema: - $ref: '#/components/schemas/URL' - deprecated: false + description: Default Response /v1/tool-runtime/rag-tool/insert: post: + tags: + - V1 + summary: Rag Tool.Insert + description: Generic endpoint - this would be replaced with actual implementation. + operationId: rag_tool_insert_v1_tool_runtime_rag_tool_insert_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/tool-runtime/rag-tool/query: + post: tags: - - ToolRuntime - summary: >- - Index documents so they can be used by the RAG system. - description: >- - Index documents so they can be used by the RAG system. - parameters: [] + - V1 + summary: Rag Tool.Query + description: Query endpoint for proper schema generation. + operationId: rag_tool_query_v1_tool_runtime_rag_tool_query_post + parameters: + - name: content + in: query + required: false + schema: + type: string + title: Content + - name: vector_store_ids + in: query + required: false + schema: + type: string + title: Vector Store Ids requestBody: content: application/json: schema: - $ref: '#/components/schemas/InsertRequest' - required: true - deprecated: false - /v1/tool-runtime/rag-tool/query: - post: + $ref: '#/components/schemas/RAGQueryConfig' responses: '200': - description: >- - RAGQueryResult containing the retrieved content and metadata + description: RAGQueryResult containing the retrieved content and metadata content: application/json: schema: $ref: '#/components/schemas/RAGQueryResult' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - ToolRuntime - summary: >- - Query the RAG system for context; typically invoked by the agent. - description: >- - Query the RAG system for context; typically invoked by the agent. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QueryRequest' - required: true - deprecated: false + description: Default Response /v1/toolgroups: get: + tags: + - V1 + summary: List Tool Groups + description: Response-only endpoint for proper schema generation. + operationId: list_tool_groups_v1_toolgroups_get responses: '200': description: A ListToolGroupsResponse. @@ -2126,105 +2357,133 @@ paths: $ref: '#/components/schemas/ListToolGroupsResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + post: tags: - - ToolGroups - summary: List tool groups with optional provider. - description: List tool groups with optional provider. - parameters: [] - deprecated: false - post: + - V1 + summary: Register Tool Group + description: Generic endpoint - this would be replaced with actual implementation. + operationId: register_tool_group_v1_toolgroups_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/toolgroups/{toolgroup_id}: + delete: tags: - - ToolGroups - summary: Register a tool group. - description: Register a tool group. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterToolGroupRequest' + - V1 + summary: Unregister Toolgroup + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_toolgroup_v1_toolgroups__toolgroup_id__delete + parameters: + - name: args + in: query required: true - deprecated: false - /v1/toolgroups/{toolgroup_id}: - get: + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: A ToolGroup. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/ToolGroup' + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - ToolGroups - summary: Get a tool group by its ID. - description: Get a tool group by its ID. + - V1 + summary: Get Tool Group + description: Query endpoint for proper schema generation. + operationId: get_tool_group_v1_toolgroups__toolgroup_id__get parameters: - - name: toolgroup_id - in: path - description: The ID of the tool group to get. - required: true - schema: - type: string - deprecated: false - delete: + - name: toolgroup_id + in: path + required: true + schema: + type: string + title: Toolgroup Id responses: '200': - description: OK + description: A ToolGroup. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolGroup' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - ToolGroups - summary: Unregister a tool group. - description: Unregister a tool group. - parameters: - - name: toolgroup_id - in: path - description: The ID of the tool group to unregister. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1/tools: get: + tags: + - V1 + summary: List Tools + description: Query endpoint for proper schema generation. + operationId: list_tools_v1_tools_get + parameters: + - name: toolgroup_id + in: query + required: false + schema: + type: string + title: Toolgroup Id responses: '200': description: A ListToolDefsResponse. @@ -2234,29 +2493,30 @@ paths: $ref: '#/components/schemas/ListToolDefsResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - ToolGroups - summary: List tools with optional tool group. - description: List tools with optional tool group. - parameters: - - name: toolgroup_id - in: query - description: >- - The ID of the tool group to list tools for. - required: false - schema: - type: string - deprecated: false + description: Default Response /v1/tools/{tool_name}: get: + tags: + - V1 + summary: Get Tool + description: Query endpoint for proper schema generation. + operationId: get_tool_v1_tools__tool_name__get + parameters: + - name: tool_name + in: path + required: true + schema: + type: string + title: Tool Name responses: '200': description: A ToolDef. @@ -2266,55 +2526,78 @@ paths: $ref: '#/components/schemas/ToolDef' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - ToolGroups - summary: Get a tool by its name. - description: Get a tool by its name. - parameters: - - name: tool_name - in: path - description: The name of the tool to get. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1/vector-io/insert: post: + tags: + - V1 + summary: Insert Chunks + description: Generic endpoint - this would be replaced with actual implementation. + operationId: insert_chunks_v1_vector_io_insert_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: Insert chunks into a vector database. - description: Insert chunks into a vector database. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/InsertChunksRequest' - required: true - deprecated: false + description: Default Response /v1/vector-io/query: post: + tags: + - V1 + summary: Query Chunks + description: Query endpoint for proper schema generation. + operationId: query_chunks_v1_vector_io_query_post + parameters: + - name: vector_store_id + in: query + required: false + schema: + type: string + title: Vector Store Id + - name: query + in: query + required: false + schema: + type: string + title: Query + - name: params + in: query + required: false + schema: + type: string + title: Params responses: '200': description: A QueryChunksResponse. @@ -2324,767 +2607,773 @@ paths: $ref: '#/components/schemas/QueryChunksResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector_stores: + get: + tags: + - V1 + summary: Openai List Vector Stores + description: Query endpoint for proper schema generation. + operationId: openai_list_vector_stores_v1_vector_stores_get + parameters: + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit + - name: order + in: query + required: false + schema: + type: string + default: desc + title: Order + - name: after + in: query + required: false + schema: + type: string + title: After + - name: before + in: query + required: false + schema: + type: string + title: Before + responses: + '200': + description: A VectorStoreListResponse containing the list of vector stores. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreListResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + post: tags: - - VectorIO - summary: Query chunks from a vector database. - description: Query chunks from a vector database. - parameters: [] + - V1 + summary: Openai Create Vector Store + description: Typed endpoint for proper schema generation. + operationId: openai_create_vector_store_v1_vector_stores_post requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/QueryChunksRequest' - required: true - deprecated: false - /v1/vector_stores: - get: + $ref: '#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody' responses: '200': - description: >- - A VectorStoreListResponse containing the list of vector stores. + description: A VectorStoreObject representing the created vector store. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreListResponse' + $ref: '#/components/schemas/VectorStoreObject' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector_stores/{vector_store_id}: + delete: tags: - - VectorIO - summary: Returns a list of vector stores. - description: Returns a list of vector stores. + - V1 + summary: Openai Delete Vector Store + description: Query endpoint for proper schema generation. + operationId: openai_delete_vector_store_v1_vector_stores__vector_store_id__delete parameters: - - name: limit - in: query - description: >- - A limit on the number of objects to be returned. Limit can range between - 1 and 100, and the default is 20. - required: false - schema: - type: integer - - name: order - in: query - description: >- - Sort order by the `created_at` timestamp of the objects. `asc` for ascending - order and `desc` for descending order. - required: false - schema: - type: string - - name: after - in: query - description: >- - A cursor for use in pagination. `after` is an object ID that defines your - place in the list. - required: false - schema: - type: string - - name: before - in: query - description: >- - A cursor for use in pagination. `before` is an object ID that defines - your place in the list. - required: false - schema: - type: string - deprecated: false - post: + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id responses: '200': - description: >- - A VectorStoreObject representing the created vector store. + description: A VectorStoreDeleteResponse indicating the deletion status. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreObject' + $ref: '#/components/schemas/VectorStoreDeleteResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - VectorIO - summary: Creates a vector store. - description: >- - Creates a vector store. - - Generate an OpenAI-compatible vector store with the given parameters. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody' + - V1 + summary: Openai Retrieve Vector Store + description: Query endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_v1_vector_stores__vector_store_id__get + parameters: + - name: vector_store_id + in: path required: true - deprecated: false - /v1/vector_stores/{vector_store_id}: - get: + schema: + type: string + title: Vector Store Id responses: '200': - description: >- - A VectorStoreObject representing the vector store. + description: A VectorStoreObject representing the vector store. content: application/json: schema: $ref: '#/components/schemas/VectorStoreObject' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + post: tags: - - VectorIO - summary: Retrieves a vector store. - description: Retrieves a vector store. + - V1 + summary: Openai Update Vector Store + description: Query endpoint for proper schema generation. + operationId: openai_update_vector_store_v1_vector_stores__vector_store_id__post parameters: - - name: vector_store_id - in: path - description: The ID of the vector store to retrieve. - required: true - schema: - type: string - deprecated: false - post: + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + - name: name + in: query + required: false + schema: + type: string + title: Name + - name: expires_after + in: query + required: false + schema: + type: string + title: Expires After + - name: metadata + in: query + required: false + schema: + type: string + title: Metadata responses: '200': - description: >- - A VectorStoreObject representing the updated vector store. + description: A VectorStoreObject representing the updated vector store. content: application/json: schema: $ref: '#/components/schemas/VectorStoreObject' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector_stores/{vector_store_id}/file_batches: + post: tags: - - VectorIO - summary: Updates a vector store. - description: Updates a vector store. - parameters: - - name: vector_store_id - in: path - description: The ID of the vector store to update. - required: true - schema: - type: string + - V1 + summary: Openai Create Vector Store File Batch + description: Typed endpoint for proper schema generation. + operationId: openai_create_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenaiUpdateVectorStoreRequest' + $ref: '#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody' required: true - deprecated: false - delete: responses: '200': - description: >- - A VectorStoreDeleteResponse indicating the deletion status. + description: A VectorStoreFileBatchObject representing the created file + batch. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreDeleteResponse' + $ref: '#/components/schemas/VectorStoreFileBatchObject' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' + /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: + get: tags: - - VectorIO - summary: Delete a vector store. - description: Delete a vector store. + - V1 + summary: Openai Retrieve Vector Store File Batch + description: Query endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__get parameters: - - name: vector_store_id - in: path - description: The ID of the vector store to delete. - required: true - schema: - type: string - deprecated: false - /v1/vector_stores/{vector_store_id}/file_batches: - post: + - name: batch_id + in: path + required: true + schema: + type: string + title: Batch Id + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id responses: '200': - description: >- - A VectorStoreFileBatchObject representing the created file batch. + description: A VectorStoreFileBatchObject representing the file batch. content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileBatchObject' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: + post: tags: - - VectorIO - summary: Create a vector store file batch. - description: >- - Create a vector store file batch. - - Generate an OpenAI-compatible vector store file batch for the given vector - store. + - V1 + summary: Openai Cancel Vector Store File Batch + description: Query endpoint for proper schema generation. + operationId: openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post parameters: - - name: vector_store_id - in: path - description: >- - The ID of the vector store to create the file batch for. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody' + - name: batch_id + in: path required: true - deprecated: false - /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: - get: + schema: + type: string + title: Batch Id + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id responses: '200': - description: >- - A VectorStoreFileBatchObject representing the file batch. + description: A VectorStoreFileBatchObject representing the cancelled file + batch. content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileBatchObject' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: + get: tags: - - VectorIO - summary: Retrieve a vector store file batch. - description: Retrieve a vector store file batch. + - V1 + summary: Openai List Files In Vector Store File Batch + description: Query endpoint for proper schema generation. + operationId: openai_list_files_in_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get parameters: - - name: batch_id - in: path - description: The ID of the file batch to retrieve. - required: true - schema: - type: string - - name: vector_store_id - in: path - description: >- - The ID of the vector store containing the file batch. - required: true - schema: - type: string - deprecated: false - /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: - post: + - name: batch_id + in: path + required: true + schema: + type: string + title: Batch Id + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + - name: after + in: query + required: false + schema: + type: string + title: After + - name: before + in: query + required: false + schema: + type: string + title: Before + - name: filter + in: query + required: false + schema: + type: string + title: Filter + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit + - name: order + in: query + required: false + schema: + type: string + default: desc + title: Order responses: '200': - description: >- - A VectorStoreFileBatchObject representing the cancelled file batch. + description: A VectorStoreFilesListInBatchResponse containing the list of + files in the batch. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileBatchObject' + $ref: '#/components/schemas/VectorStoreFilesListInBatchResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector_stores/{vector_store_id}/files: + get: tags: - - VectorIO - summary: Cancels a vector store file batch. - description: Cancels a vector store file batch. + - V1 + summary: Openai List Files In Vector Store + description: Query endpoint for proper schema generation. + operationId: openai_list_files_in_vector_store_v1_vector_stores__vector_store_id__files_get parameters: - - name: batch_id - in: path - description: The ID of the file batch to cancel. - required: true - schema: - type: string - - name: vector_store_id - in: path - description: >- - The ID of the vector store containing the file batch. - required: true - schema: - type: string - deprecated: false - /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: - get: + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit + - name: order + in: query + required: false + schema: + type: string + default: desc + title: Order + - name: after + in: query + required: false + schema: + type: string + title: After + - name: before + in: query + required: false + schema: + type: string + title: Before + - name: filter + in: query + required: false + schema: + type: string + title: Filter responses: '200': - description: >- - A VectorStoreFilesListInBatchResponse containing the list of files in - the batch. + description: A VectorStoreListFilesResponse containing the list of files. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFilesListInBatchResponse' + $ref: '#/components/schemas/VectorStoreListFilesResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + post: tags: - - VectorIO - summary: >- - Returns a list of vector store files in a batch. - description: >- - Returns a list of vector store files in a batch. + - V1 + summary: Openai Attach File To Vector Store + description: Query endpoint for proper schema generation. + operationId: openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post parameters: - - name: batch_id - in: path - description: >- - The ID of the file batch to list files from. - required: true - schema: - type: string - - name: vector_store_id - in: path - description: >- - The ID of the vector store containing the file batch. - required: true - schema: - type: string - - name: after - in: query - description: >- - A cursor for use in pagination. `after` is an object ID that defines your - place in the list. - required: false - schema: - type: string - - name: before - in: query - description: >- - A cursor for use in pagination. `before` is an object ID that defines - your place in the list. - required: false - schema: - type: string - - name: filter - in: query - description: >- - Filter by file status. One of in_progress, completed, failed, cancelled. - required: false - schema: - type: string - - name: limit - in: query - description: >- - A limit on the number of objects to be returned. Limit can range between - 1 and 100, and the default is 20. - required: false - schema: - type: integer - - name: order - in: query - description: >- - Sort order by the `created_at` timestamp of the objects. `asc` for ascending - order and `desc` for descending order. - required: false - schema: - type: string - deprecated: false - /v1/vector_stores/{vector_store_id}/files: - get: + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + - name: file_id + in: query + required: false + schema: + type: string + title: File Id + - name: attributes + in: query + required: false + schema: + type: string + title: Attributes + requestBody: + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + title: Chunking Strategy responses: '200': - description: >- - A VectorStoreListFilesResponse containing the list of files. + description: A VectorStoreFileObject representing the attached file. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreListFilesResponse' + $ref: '#/components/schemas/VectorStoreFileObject' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector_stores/{vector_store_id}/files/{file_id}: + delete: tags: - - VectorIO - summary: List files in a vector store. - description: List files in a vector store. + - V1 + summary: Openai Delete Vector Store File + description: Query endpoint for proper schema generation. + operationId: openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete parameters: - - name: vector_store_id - in: path - description: >- - The ID of the vector store to list files from. - required: true - schema: - type: string - - name: limit - in: query - description: >- - (Optional) A limit on the number of objects to be returned. Limit can - range between 1 and 100, and the default is 20. - required: false - schema: - type: integer - - name: order - in: query - description: >- - (Optional) Sort order by the `created_at` timestamp of the objects. `asc` - for ascending order and `desc` for descending order. - required: false - schema: - type: string - - name: after - in: query - description: >- - (Optional) A cursor for use in pagination. `after` is an object ID that - defines your place in the list. - required: false - schema: - type: string - - name: before - in: query - description: >- - (Optional) A cursor for use in pagination. `before` is an object ID that - defines your place in the list. - required: false - schema: - type: string - - name: filter - in: query - description: >- - (Optional) Filter by file status to only return files with the specified - status. - required: false - schema: - $ref: '#/components/schemas/VectorStoreFileStatus' - deprecated: false - post: + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + - name: file_id + in: path + required: true + schema: + type: string + title: File Id responses: '200': - description: >- - A VectorStoreFileObject representing the attached file. + description: A VectorStoreFileDeleteResponse indicating the deletion status. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileObject' + $ref: '#/components/schemas/VectorStoreFileDeleteResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - VectorIO - summary: Attach a file to a vector store. - description: Attach a file to a vector store. + - V1 + summary: Openai Retrieve Vector Store File + description: Query endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get parameters: - - name: vector_store_id - in: path - description: >- - The ID of the vector store to attach the file to. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenaiAttachFileToVectorStoreRequest' + - name: vector_store_id + in: path required: true - deprecated: false - /v1/vector_stores/{vector_store_id}/files/{file_id}: - get: + schema: + type: string + title: Vector Store Id + - name: file_id + in: path + required: true + schema: + type: string + title: File Id responses: '200': - description: >- - A VectorStoreFileObject representing the file. + description: A VectorStoreFileObject representing the file. content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileObject' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + post: tags: - - VectorIO - summary: Retrieves a vector store file. - description: Retrieves a vector store file. + - V1 + summary: Openai Update Vector Store File + description: Query endpoint for proper schema generation. + operationId: openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post parameters: - - name: vector_store_id - in: path - description: >- - The ID of the vector store containing the file to retrieve. - required: true - schema: - type: string - - name: file_id - in: path - description: The ID of the file to retrieve. - required: true - schema: - type: string - deprecated: false - post: + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + - name: file_id + in: path + required: true + schema: + type: string + title: File Id + - name: attributes + in: query + required: false + schema: + type: string + title: Attributes responses: '200': - description: >- - A VectorStoreFileObject representing the updated file. + description: A VectorStoreFileObject representing the updated file. content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileObject' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector_stores/{vector_store_id}/files/{file_id}/content: + get: tags: - - VectorIO - summary: Updates a vector store file. - description: Updates a vector store file. + - V1 + summary: Openai Retrieve Vector Store File Contents + description: Query endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get parameters: - - name: vector_store_id - in: path - description: >- - The ID of the vector store containing the file to update. - required: true - schema: - type: string - - name: file_id - in: path - description: The ID of the file to update. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenaiUpdateVectorStoreFileRequest' + - name: vector_store_id + in: path required: true - deprecated: false - delete: - responses: - '200': - description: >- - A VectorStoreFileDeleteResponse indicating the deletion status. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileDeleteResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: Delete a vector store file. - description: Delete a vector store file. - parameters: - - name: vector_store_id - in: path - description: >- - The ID of the vector store containing the file to delete. - required: true - schema: - type: string - - name: file_id - in: path - description: The ID of the file to delete. - required: true - schema: - type: string - deprecated: false - /v1/vector_stores/{vector_store_id}/files/{file_id}/content: - get: + schema: + type: string + title: Vector Store Id + - name: file_id + in: path + required: true + schema: + type: string + title: File Id responses: '200': - description: >- - A list of InterleavedContent representing the file contents. + description: A list of InterleavedContent representing the file contents. content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileContentsResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: >- - Retrieves the contents of a vector store file. - description: >- - Retrieves the contents of a vector store file. - parameters: - - name: vector_store_id - in: path - description: >- - The ID of the vector store containing the file to retrieve. - required: true - schema: - type: string - - name: file_id - in: path - description: The ID of the file to retrieve. - required: true - schema: - type: string - deprecated: false + description: Default Response /v1/vector_stores/{vector_store_id}/search: post: + tags: + - V1 + summary: Openai Search Vector Store + description: Query endpoint for proper schema generation. + operationId: openai_search_vector_store_v1_vector_stores__vector_store_id__search_post + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + - name: query + in: query + required: false + schema: + type: string + title: Query + - name: filters + in: query + required: false + schema: + type: string + title: Filters + - name: max_num_results + in: query + required: false + schema: + type: integer + default: 10 + title: Max Num Results + - name: rewrite_query + in: query + required: false + schema: + type: boolean + default: false + title: Rewrite Query + - name: search_mode + in: query + required: false + schema: + type: string + default: vector + title: Search Mode + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SearchRankingOptions' responses: '200': - description: >- - A VectorStoreSearchResponse containing the search results. + description: A VectorStoreSearchResponse containing the search results. content: application/json: schema: $ref: '#/components/schemas/VectorStoreSearchResponsePage' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: Search for chunks in a vector store. - description: >- - Search for chunks in a vector store. - - Searches a vector store for relevant chunks based on a query and optional - file attribute filters. - parameters: - - name: vector_store_id - in: path - description: The ID of the vector store to search. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenaiSearchVectorStoreRequest' - required: true - deprecated: false + description: Default Response /v1/version: get: + tags: + - V1 + summary: Version + description: Response-only endpoint for proper schema generation. + operationId: version_v1_version_get responses: '200': - description: >- - Version information containing the service version number. + description: Version information containing the service version number. content: application/json: schema: $ref: '#/components/schemas/VersionInfo' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - Inspect - summary: Get version. - description: >- - Get version. - - Get the version of the service. - parameters: [] - deprecated: false -jsonSchemaDialect: >- - https://json-schema.org/draft/2020-12/schema components: schemas: Error: @@ -8138,321 +8427,188 @@ components: title: ViolationLevel description: Severity level of a safety violation. AgentTurnInputType: - type: object properties: type: type: string const: agent_turn_input + title: Type default: agent_turn_input - description: >- - Discriminator type. Always "agent_turn_input" - additionalProperties: false - required: - - type + type: object title: AgentTurnInputType - description: Parameter type for agent turn input. + description: 'Parameter type for agent turn input. + + + :param type: Discriminator type. Always "agent_turn_input"' AggregationFunctionType: type: string enum: - - average - - weighted_average - - median - - categorical_count - - accuracy + - average + - weighted_average + - median + - categorical_count + - accuracy title: AggregationFunctionType - description: >- - Types of aggregation functions for scoring results. - ArrayType: + description: 'Types of aggregation functions for scoring results. + + :cvar average: Calculate the arithmetic mean of scores + + :cvar weighted_average: Calculate a weighted average of scores + + :cvar median: Calculate the median value of scores + + :cvar categorical_count: Count occurrences of categorical values + + :cvar accuracy: Calculate accuracy as the proportion of correct answers' + AllowedToolsFilter: + properties: + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Tool Names + type: object + title: AllowedToolsFilter + description: 'Filter configuration for restricting which MCP tools can be used. + + + :param tool_names: (Optional) List of specific tool names that are allowed' + ApprovalFilter: + properties: + always: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Always + never: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Never type: object + title: ApprovalFilter + description: 'Filter configuration for MCP tool approval requirements. + + + :param always: (Optional) List of tool names that always require approval + + :param never: (Optional) List of tool names that never require approval' + ArrayType: properties: type: type: string const: array + title: Type default: array - description: Discriminator type. Always "array" - additionalProperties: false - required: - - type + type: object title: ArrayType - description: Parameter type for array values. + description: 'Parameter type for array values. + + + :param type: Discriminator type. Always "array"' BasicScoringFnParams: - type: object properties: type: - $ref: '#/components/schemas/ScoringFnParamsType' + type: string const: basic + title: Type default: basic - description: >- - The type of scoring function parameters, always basic aggregation_functions: - type: array items: $ref: '#/components/schemas/AggregationFunctionType' - description: >- - Aggregation functions to apply to the scores of each row - additionalProperties: false - required: - - type - - aggregation_functions + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row + type: object title: BasicScoringFnParams - description: >- - Parameters for basic scoring function configuration. + description: 'Parameters for basic scoring function configuration. + + :param type: The type of scoring function parameters, always basic + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row' + Body_create_openai_response_v1_responses_post: + properties: + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' + text: + $ref: '#/components/schemas/OpenAIResponseText' + tools: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' + title: Tools + type: object + title: Body_create_openai_response_v1_responses_post BooleanType: - type: object properties: type: type: string const: boolean + title: Type default: boolean - description: Discriminator type. Always "boolean" - additionalProperties: false - required: - - type + type: object title: BooleanType - description: Parameter type for boolean values. + description: 'Parameter type for boolean values. + + + :param type: Discriminator type. Always "boolean"' ChatCompletionInputType: - type: object properties: type: type: string const: chat_completion_input + title: Type default: chat_completion_input - description: >- - Discriminator type. Always "chat_completion_input" - additionalProperties: false - required: - - type + type: object title: ChatCompletionInputType - description: >- - Parameter type for chat completion input. + description: 'Parameter type for chat completion input. + + + :param type: Discriminator type. Always "chat_completion_input"' CompletionInputType: - type: object properties: type: type: string const: completion_input + title: Type default: completion_input - description: >- - Discriminator type. Always "completion_input" - additionalProperties: false - required: - - type + type: object title: CompletionInputType - description: Parameter type for completion input. - JsonType: + description: 'Parameter type for completion input. + + + :param type: Discriminator type. Always "completion_input"' + ConversationItemInclude: + type: string + enum: + - llm_as_judge + - regex_parser + - basic + title: ScoringFnParamsType + description: >- + Types of scoring function parameter configurations. + StringType: type: object properties: type: type: string - const: json - default: json - description: Discriminator type. Always "json" + const: string + default: string + description: Discriminator type. Always "string" additionalProperties: false required: - type - title: JsonType - description: Parameter type for JSON values. - LLMAsJudgeScoringFnParams: - type: object - properties: - type: - $ref: '#/components/schemas/ScoringFnParamsType' - const: llm_as_judge - default: llm_as_judge - description: >- - The type of scoring function parameters, always llm_as_judge - judge_model: - type: string - description: >- - Identifier of the LLM model to use as a judge for scoring - prompt_template: - type: string - description: >- - (Optional) Custom prompt template for the judge model - judge_score_regexes: - type: array - items: - type: string - description: >- - Regexes to extract the answer from generated response - aggregation_functions: - type: array - items: - $ref: '#/components/schemas/AggregationFunctionType' - description: >- - Aggregation functions to apply to the scores of each row - additionalProperties: false - required: - - type - - judge_model - - judge_score_regexes - - aggregation_functions - title: LLMAsJudgeScoringFnParams - description: >- - Parameters for LLM-as-judge scoring function configuration. - NumberType: - type: object - properties: - type: - type: string - const: number - default: number - description: Discriminator type. Always "number" - additionalProperties: false - required: - - type - title: NumberType - description: Parameter type for numeric values. - ObjectType: - type: object - properties: - type: - type: string - const: object - default: object - description: Discriminator type. Always "object" - additionalProperties: false - required: - - type - title: ObjectType - description: Parameter type for object values. - RegexParserScoringFnParams: - type: object - properties: - type: - $ref: '#/components/schemas/ScoringFnParamsType' - const: regex_parser - default: regex_parser - description: >- - The type of scoring function parameters, always regex_parser - parsing_regexes: - type: array - items: - type: string - description: >- - Regex to extract the answer from generated response - aggregation_functions: - type: array - items: - $ref: '#/components/schemas/AggregationFunctionType' - description: >- - Aggregation functions to apply to the scores of each row - additionalProperties: false - required: - - type - - parsing_regexes - - aggregation_functions - title: RegexParserScoringFnParams - description: >- - Parameters for regex parser scoring function configuration. - ScoringFn: - type: object - properties: - identifier: - type: string - provider_resource_id: - type: string - provider_id: - type: string - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: scoring_function - default: scoring_function - description: >- - The resource type, always scoring_function - description: - type: string - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - return_type: - oneOf: - - $ref: '#/components/schemas/StringType' - - $ref: '#/components/schemas/NumberType' - - $ref: '#/components/schemas/BooleanType' - - $ref: '#/components/schemas/ArrayType' - - $ref: '#/components/schemas/ObjectType' - - $ref: '#/components/schemas/JsonType' - - $ref: '#/components/schemas/UnionType' - - $ref: '#/components/schemas/ChatCompletionInputType' - - $ref: '#/components/schemas/CompletionInputType' - - $ref: '#/components/schemas/AgentTurnInputType' - discriminator: - propertyName: type - mapping: - string: '#/components/schemas/StringType' - number: '#/components/schemas/NumberType' - boolean: '#/components/schemas/BooleanType' - array: '#/components/schemas/ArrayType' - object: '#/components/schemas/ObjectType' - json: '#/components/schemas/JsonType' - union: '#/components/schemas/UnionType' - chat_completion_input: '#/components/schemas/ChatCompletionInputType' - completion_input: '#/components/schemas/CompletionInputType' - agent_turn_input: '#/components/schemas/AgentTurnInputType' - params: - $ref: '#/components/schemas/ScoringFnParams' - additionalProperties: false - required: - - identifier - - provider_id - - type - - metadata - - return_type - title: ScoringFn - description: >- - A scoring function resource for evaluating model outputs. - ScoringFnParams: - oneOf: - - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - - $ref: '#/components/schemas/RegexParserScoringFnParams' - - $ref: '#/components/schemas/BasicScoringFnParams' - discriminator: - propertyName: type - mapping: - llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' - regex_parser: '#/components/schemas/RegexParserScoringFnParams' - basic: '#/components/schemas/BasicScoringFnParams' - ScoringFnParamsType: - type: string - enum: - - llm_as_judge - - regex_parser - - basic - title: ScoringFnParamsType - description: >- - Types of scoring function parameter configurations. - StringType: - type: object - properties: - type: - type: string - const: string - default: string - description: Discriminator type. Always "string" - additionalProperties: false - required: - - type - title: StringType - description: Parameter type for string values. - UnionType: + title: StringType + description: Parameter type for string values. + UnionType: type: object properties: type: @@ -8996,1286 +9152,3543 @@ components: - chunk_size_in_tokens title: InsertRequest DefaultRAGQueryGeneratorConfig: - type: object properties: type: type: string const: default + title: Type default: default - description: >- - Type of query generator, always 'default' separator: type: string + title: Separator default: ' ' - description: >- - String separator used to join query terms - additionalProperties: false - required: - - type - - separator + type: object title: DefaultRAGQueryGeneratorConfig - description: >- - Configuration for the default RAG query generator. - LLMRAGQueryGeneratorConfig: + description: 'Configuration for the default RAG query generator. + + + :param type: Type of query generator, always ''default'' + + :param separator: String separator used to join query terms' + HealthInfo: + properties: + status: + $ref: '#/components/schemas/HealthStatus' + type: object + required: + - status + title: HealthInfo + description: 'Health status information for the service. + + + :param status: Current health status of the service' + HealthStatus: + type: string + enum: + - OK + - Error + - Not Implemented + title: HealthStatus + JsonType: + properties: + type: + type: string + const: json + title: Type + default: json + type: object + title: JsonType + description: 'Parameter type for JSON values. + + + :param type: Discriminator type. Always "json"' + LLMAsJudgeScoringFnParams: + properties: + type: + type: string + const: llm_as_judge + title: Type + default: llm_as_judge + judge_model: + type: string + title: Judge Model + prompt_template: + anyOf: + - type: string + - type: 'null' + title: Prompt Template + judge_score_regexes: + items: + type: string + type: array + title: Judge Score Regexes + description: Regexes to extract the answer from generated response + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row type: object + required: + - judge_model + title: LLMAsJudgeScoringFnParams + description: 'Parameters for LLM-as-judge scoring function configuration. + + :param type: The type of scoring function parameters, always llm_as_judge + + :param judge_model: Identifier of the LLM model to use as a judge for scoring + + :param prompt_template: (Optional) Custom prompt template for the judge model + + :param judge_score_regexes: Regexes to extract the answer from generated response + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row' + LLMRAGQueryGeneratorConfig: properties: type: type: string const: llm + title: Type default: llm - description: Type of query generator, always 'llm' model: type: string - description: >- - Name of the language model to use for query generation + title: Model template: type: string - description: >- - Template string for formatting the query generation prompt - additionalProperties: false + title: Template + type: object required: - - type - - model - - template + - model + - template title: LLMRAGQueryGeneratorConfig - description: >- - Configuration for the LLM-based RAG query generator. - RAGQueryConfig: - type: object - properties: - query_generator_config: - oneOf: - - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' - - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' - discriminator: - propertyName: type - mapping: - default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' - llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' - description: Configuration for the query generator. - max_tokens_in_context: - type: integer - default: 4096 - description: Maximum number of tokens in the context. - max_chunks: - type: integer - default: 5 - description: Maximum number of chunks to retrieve. - chunk_template: - type: string - default: > - Result {index} + description: 'Configuration for the LLM-based RAG query generator. - Content: {chunk.content} - Metadata: {metadata} - description: >- - Template for formatting each retrieved chunk in the context. Available - placeholders: {index} (1-based chunk ordinal), {chunk.content} (chunk - content string), {metadata} (chunk metadata dict). Default: "Result {index}\nContent: - {chunk.content}\nMetadata: {metadata}\n" - mode: - $ref: '#/components/schemas/RAGSearchMode' - default: vector - description: >- - Search mode for retrieval—either "vector", "keyword", or "hybrid". Default - "vector". - ranker: - $ref: '#/components/schemas/Ranker' - description: >- - Configuration for the ranker to use in hybrid search. Defaults to RRF - ranker. - additionalProperties: false - required: - - query_generator_config - - max_tokens_in_context - - max_chunks - - chunk_template - title: RAGQueryConfig - description: >- - Configuration for the RAG query generation. - RAGSearchMode: - type: string - enum: - - vector - - keyword - - hybrid - title: RAGSearchMode - description: >- - Search modes for RAG query retrieval: - VECTOR: Uses vector similarity search - for semantic matching - KEYWORD: Uses keyword-based search for exact matching - - HYBRID: Combines both vector and keyword search for better results - RRFRanker: + :param type: Type of query generator, always ''llm'' + + :param model: Name of the language model to use for query generation + + :param template: Template string for formatting the query generation prompt' + ListModelsResponse: + properties: + data: + items: + $ref: '#/components/schemas/Model' + type: array + title: Data type: object + required: + - data + title: ListModelsResponse + ListPromptsResponse: properties: - type: - type: string - const: rrf - default: rrf - description: The type of ranker, always "rrf" - impact_factor: - type: number - default: 60.0 - description: >- - The impact factor for RRF scoring. Higher values give more weight to higher-ranked - results. Must be greater than 0 - additionalProperties: false - required: - - type - - impact_factor - title: RRFRanker - description: >- - Reciprocal Rank Fusion (RRF) ranker configuration. - Ranker: - oneOf: - - $ref: '#/components/schemas/RRFRanker' - - $ref: '#/components/schemas/WeightedRanker' - discriminator: - propertyName: type - mapping: - rrf: '#/components/schemas/RRFRanker' - weighted: '#/components/schemas/WeightedRanker' - WeightedRanker: + data: + items: + $ref: '#/components/schemas/Prompt' + type: array + title: Data type: object + required: + - data + title: ListPromptsResponse + description: Response model to list prompts. + ListProvidersResponse: properties: - type: - type: string - const: weighted - default: weighted - description: The type of ranker, always "weighted" - alpha: - type: number - default: 0.5 - description: >- - Weight factor between 0 and 1. 0 means only use keyword scores, 1 means - only use vector scores, values in between blend both scores. - additionalProperties: false + data: + items: + $ref: '#/components/schemas/ProviderInfo' + type: array + title: Data + type: object required: - - type - - alpha - title: WeightedRanker - description: >- - Weighted ranker configuration that combines vector and keyword scores. - QueryRequest: + - data + title: ListProvidersResponse + description: 'Response containing a list of all available providers. + + + :param data: List of provider information objects' + ListRoutesResponse: + properties: + data: + items: + $ref: '#/components/schemas/RouteInfo' + type: array + title: Data type: object + required: + - data + title: ListRoutesResponse + description: 'Response containing a list of all available API routes. + + + :param data: List of available route information objects' + ListScoringFunctionsResponse: properties: - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - The query content to search for in the indexed documents - vector_store_ids: + data: + items: + $ref: '#/components/schemas/ScoringFn-Output' type: array + title: Data + type: object + required: + - data + title: ListScoringFunctionsResponse + ListShieldsResponse: + properties: + data: items: - type: string - description: >- - List of vector database IDs to search within - query_config: - $ref: '#/components/schemas/RAGQueryConfig' - description: >- - (Optional) Configuration parameters for the query operation - additionalProperties: false + $ref: '#/components/schemas/Shield' + type: array + title: Data + type: object required: - - content - - vector_store_ids - title: QueryRequest - RAGQueryResult: + - data + title: ListShieldsResponse + ListToolGroupsResponse: + properties: + data: + items: + $ref: '#/components/schemas/ToolGroup' + type: array + title: Data type: object + required: + - data + title: ListToolGroupsResponse + description: 'Response containing a list of tool groups. + + + :param data: List of tool groups' + MCPListToolsTool: properties: - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - (Optional) The retrieved content from the query - metadata: + input_schema: + additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Additional metadata about the query result - additionalProperties: false - required: - - metadata - title: RAGQueryResult - description: >- - Result of a RAG query containing retrieved content and metadata. - ToolGroup: + title: Input Schema + name: + type: string + title: Name + description: + anyOf: + - type: string + - type: 'null' + title: Description type: object + required: + - input_schema + - name + title: MCPListToolsTool + description: 'Tool definition returned by MCP list tools operation. + + + :param input_schema: JSON schema defining the tool''s input parameters + + :param name: Name of the tool + + :param description: (Optional) Description of what the tool does' + Model: properties: identifier: type: string + title: Identifier + description: Unique identifier for this resource in llama stack provider_resource_id: - type: string + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider provider_id: type: string + title: Provider Id + description: ID of the provider that owns this resource type: type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: tool_group - default: tool_group - description: Type of resource, always 'tool_group' - mcp_endpoint: - $ref: '#/components/schemas/URL' - description: >- - (Optional) Model Context Protocol endpoint for remote tools - args: + const: model + title: Type + default: model + metadata: + additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional arguments for the tool group - additionalProperties: false - required: - - identifier - - provider_id - - type - title: ToolGroup - description: >- - A group of related tools managed together. - ListToolGroupsResponse: + title: Metadata + description: Any additional metadata for this model + model_type: + $ref: '#/components/schemas/ModelType' + default: llm type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/ToolGroup' - description: List of tool groups - additionalProperties: false required: - - data - title: ListToolGroupsResponse - description: >- - Response containing a list of tool groups. - RegisterToolGroupRequest: - type: object + - identifier + - provider_id + title: Model + description: 'A model resource representing an AI model registered in Llama + Stack. + + + :param type: The resource type, always ''model'' for model resources + + :param model_type: The type of model (LLM or embedding model) + + :param metadata: Any additional metadata for this model + + :param identifier: Unique identifier for this resource in llama stack + + :param provider_resource_id: Unique identifier for this resource in the provider + + :param provider_id: ID of the provider that owns this resource' + ModelType: + type: string + enum: + - llm + - embedding + - rerank + title: ModelType + description: 'Enumeration of supported model types in Llama Stack. + + :cvar llm: Large language model for text generation and completion + + :cvar embedding: Embedding model for converting text to vector representations + + :cvar rerank: Reranking model for reordering documents based on their relevance + to a query' + NumberType: properties: - toolgroup_id: - type: string - description: The ID of the tool group to register. - provider_id: + type: type: string - description: >- - The ID of the provider to use for the tool group. - mcp_endpoint: - $ref: '#/components/schemas/URL' - description: >- - The MCP endpoint to use for the tool group. - args: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - A dictionary of arguments to pass to the tool group. - additionalProperties: false - required: - - toolgroup_id - - provider_id - title: RegisterToolGroupRequest - Chunk: + const: number + title: Type + default: number type: object + title: NumberType + description: 'Parameter type for numeric values. + + + :param type: Discriminator type. Always "number"' + ObjectType: properties: - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - The content of the chunk, which can be interleaved text, images, or other - types. - chunk_id: + type: type: string - description: >- - Unique identifier for the chunk. Must be provided explicitly. - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Metadata associated with the chunk that will be used in the model context - during inference. - embedding: - type: array - items: - type: number - description: >- - Optional embedding for the chunk. If not provided, it will be computed - later. - chunk_metadata: - $ref: '#/components/schemas/ChunkMetadata' - description: >- - Metadata for the chunk that will NOT be used in the context during inference. - The `chunk_metadata` is required backend functionality. - additionalProperties: false - required: - - content - - chunk_id - - metadata - title: Chunk - description: >- - A chunk of content that can be inserted into a vector database. - ChunkMetadata: + const: object + title: Type + default: object type: object + title: ObjectType + description: 'Parameter type for object values. + + + :param type: Discriminator type. Always "object"' + OpenAIAssistantMessageParam-Input: properties: - chunk_id: + role: type: string - description: >- - The ID of the chunk. If not set, it will be generated based on the document - ID and content. - document_id: + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + - type: 'null' + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + title: Tool Calls + type: object + title: OpenAIAssistantMessageParam + description: 'A message containing the model''s (assistant) response in an OpenAI-compatible + chat completion request. + + + :param role: Must be "assistant" to identify this as the model''s response + + :param content: The content of the model''s response + + :param name: (Optional) The name of the assistant message participant. + + :param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall + object.' + OpenAIAssistantMessageParam-Output: + properties: + role: type: string - description: >- - The ID of the document this chunk belongs to. - source: - type: string - description: >- - The source of the content, such as a URL, file path, or other identifier. - created_timestamp: - type: integer - description: >- - An optional timestamp indicating when the chunk was created. - updated_timestamp: - type: integer - description: >- - An optional timestamp indicating when the chunk was last updated. - chunk_window: - type: string - description: >- - The window of the chunk, which can be used to group related chunks together. - chunk_tokenizer: - type: string - description: >- - The tokenizer used to create the chunk. Default is Tiktoken. - chunk_embedding_model: - type: string - description: >- - The embedding model used to create the chunk's embedding. - chunk_embedding_dimension: - type: integer - description: >- - The dimension of the embedding vector for the chunk. - content_token_count: - type: integer - description: >- - The number of tokens in the content of the chunk. - metadata_token_count: - type: integer - description: >- - The number of tokens in the metadata of the chunk. - additionalProperties: false - title: ChunkMetadata - description: >- - `ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional - information about the chunk that will not be used in the context during - inference, but is required for backend functionality. The `ChunkMetadata` is - set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not - expected to change after. Use `Chunk.metadata` for metadata that will - be used in the context during inference. - InsertChunksRequest: + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + - type: 'null' + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + title: Tool Calls type: object + title: OpenAIAssistantMessageParam + description: 'A message containing the model''s (assistant) response in an OpenAI-compatible + chat completion request. + + + :param role: Must be "assistant" to identify this as the model''s response + + :param content: The content of the model''s response + + :param name: (Optional) The name of the assistant message participant. + + :param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall + object.' + OpenAIChatCompletion: properties: - vector_store_id: + id: type: string - description: >- - The identifier of the vector database to insert the chunks into. - chunks: - type: array + title: Id + choices: items: - $ref: '#/components/schemas/Chunk' - description: >- - The chunks to insert. Each `Chunk` should contain content which can be - interleaved text, images, or other types. `metadata`: `dict[str, Any]` - and `embedding`: `List[float]` are optional. If `metadata` is provided, - you configure how Llama Stack formats the chunk during generation. If - `embedding` is not provided, it will be computed later. - ttl_seconds: + $ref: '#/components/schemas/OpenAIChoice-Output' + type: array + title: Choices + object: + type: string + const: chat.completion + title: Object + default: chat.completion + created: type: integer - description: The time to live of the chunks. - additionalProperties: false - required: - - vector_store_id - - chunks - title: InsertChunksRequest - QueryChunksRequest: + title: Created + model: + type: string + title: Model + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsage' + - type: 'null' type: object + required: + - id + - choices + - created + - model + title: OpenAIChatCompletion + description: 'Response from an OpenAI-compatible chat completion request. + + + :param id: The ID of the chat completion + + :param choices: List of choices + + :param object: The object type, which will be "chat.completion" + + :param created: The Unix timestamp in seconds when the chat completion was + created + + :param model: The model that was used to generate the chat completion + + :param usage: Token usage information for the completion' + OpenAIChatCompletionContentPartImageParam: properties: - vector_store_id: + type: type: string - description: >- - The identifier of the vector database to query. - query: - $ref: '#/components/schemas/InterleavedContent' - description: The query to search for. - params: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The parameters of the query. - additionalProperties: false + const: image_url + title: Type + default: image_url + image_url: + $ref: '#/components/schemas/OpenAIImageURL' + type: object required: - - vector_store_id - - query - title: QueryChunksRequest - QueryChunksResponse: + - image_url + title: OpenAIChatCompletionContentPartImageParam + description: 'Image content part for OpenAI-compatible chat completion messages. + + + :param type: Must be "image_url" to identify this as image content + + :param image_url: Image URL specification and processing details' + OpenAIChatCompletionContentPartTextParam: + properties: + type: + type: string + const: text + title: Type + default: text + text: + type: string + title: Text type: object + required: + - text + title: OpenAIChatCompletionContentPartTextParam + description: 'Text content part for OpenAI-compatible chat completion messages. + + + :param type: Must be "text" to identify this as text content + + :param text: The text content of the message' + OpenAIChatCompletionRequestWithExtraBody: properties: - chunks: - type: array + model: + type: string + title: Model + messages: items: - $ref: '#/components/schemas/Chunk' - description: >- - List of content chunks returned from the query - scores: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Input' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Input' type: array - items: - type: number - description: >- - Relevance scores corresponding to each returned chunk - additionalProperties: false + minItems: 1 + title: Messages + frequency_penalty: + anyOf: + - type: number + - type: 'null' + title: Frequency Penalty + function_call: + anyOf: + - type: string + - additionalProperties: true + type: object + - type: 'null' + title: Function Call + functions: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Functions + logit_bias: + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Logit Bias + logprobs: + anyOf: + - type: boolean + - type: 'null' + title: Logprobs + max_completion_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Completion Tokens + max_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Tokens + n: + anyOf: + - type: integer + - type: 'null' + title: N + parallel_tool_calls: + anyOf: + - type: boolean + - type: 'null' + title: Parallel Tool Calls + presence_penalty: + anyOf: + - type: number + - type: 'null' + title: Presence Penalty + response_format: + anyOf: + - oneOf: + - $ref: '#/components/schemas/OpenAIResponseFormatText' + - $ref: '#/components/schemas/OpenAIResponseFormatJSONSchema' + - $ref: '#/components/schemas/OpenAIResponseFormatJSONObject' + discriminator: + propertyName: type + mapping: + json_object: '#/components/schemas/OpenAIResponseFormatJSONObject' + json_schema: '#/components/schemas/OpenAIResponseFormatJSONSchema' + text: '#/components/schemas/OpenAIResponseFormatText' + - type: 'null' + title: Response Format + seed: + anyOf: + - type: integer + - type: 'null' + title: Seed + stop: + anyOf: + - type: string + - items: + type: string + type: array + - type: 'null' + title: Stop + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + stream_options: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Stream Options + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + tool_choice: + anyOf: + - type: string + - additionalProperties: true + type: object + - type: 'null' + title: Tool Choice + tools: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Tools + top_logprobs: + anyOf: + - type: integer + - type: 'null' + title: Top Logprobs + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + user: + anyOf: + - type: string + - type: 'null' + title: User + additionalProperties: true + type: object required: - - chunks - - scores - title: QueryChunksResponse - description: >- - Response from querying chunks in a vector database. - VectorStoreFileCounts: + - model + - messages + title: OpenAIChatCompletionRequestWithExtraBody + description: 'Request parameters for OpenAI-compatible chat completion endpoint. + + + :param model: The identifier of the model to use. The model must be registered + with Llama Stack and available via the /models endpoint. + + :param messages: List of messages in the conversation. + + :param frequency_penalty: (Optional) The penalty for repeated tokens. + + :param function_call: (Optional) The function call to use. + + :param functions: (Optional) List of functions to use. + + :param logit_bias: (Optional) The logit bias to use. + + :param logprobs: (Optional) The log probabilities to use. + + :param max_completion_tokens: (Optional) The maximum number of tokens to generate. + + :param max_tokens: (Optional) The maximum number of tokens to generate. + + :param n: (Optional) The number of completions to generate. + + :param parallel_tool_calls: (Optional) Whether to parallelize tool calls. + + :param presence_penalty: (Optional) The penalty for repeated tokens. + + :param response_format: (Optional) The response format to use. + + :param seed: (Optional) The seed to use. + + :param stop: (Optional) The stop tokens to use. + + :param stream: (Optional) Whether to stream the response. + + :param stream_options: (Optional) The stream options to use. + + :param temperature: (Optional) The temperature to use. + + :param tool_choice: (Optional) The tool choice to use. + + :param tools: (Optional) The tools to use. + + :param top_logprobs: (Optional) The top log probabilities to use. + + :param top_p: (Optional) The top p to use. + + :param user: (Optional) The user to use.' + OpenAIChatCompletionToolCall: + properties: + index: + anyOf: + - type: integer + - type: 'null' + title: Index + id: + anyOf: + - type: string + - type: 'null' + title: Id + type: + type: string + const: function + title: Type + default: function + function: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' + - type: 'null' type: object + title: OpenAIChatCompletionToolCall + description: 'Tool call specification for OpenAI-compatible chat completion + responses. + + + :param index: (Optional) Index of the tool call in the list + + :param id: (Optional) Unique identifier for the tool call + + :param type: Must be "function" to identify this as a function call + + :param function: (Optional) Function call details' + OpenAIChatCompletionToolCallFunction: properties: - completed: - type: integer - description: >- - Number of files that have been successfully processed - cancelled: - type: integer - description: >- - Number of files that had their processing cancelled - failed: + name: + anyOf: + - type: string + - type: 'null' + title: Name + arguments: + anyOf: + - type: string + - type: 'null' + title: Arguments + type: object + title: OpenAIChatCompletionToolCallFunction + description: 'Function call details for OpenAI-compatible tool calls. + + + :param name: (Optional) Name of the function to call + + :param arguments: (Optional) Arguments to pass to the function as a JSON string' + OpenAIChatCompletionUsage: + properties: + prompt_tokens: type: integer - description: Number of files that failed to process - in_progress: + title: Prompt Tokens + completion_tokens: type: integer - description: >- - Number of files currently being processed - total: + title: Completion Tokens + total_tokens: type: integer - description: >- - Total number of files in the vector store - additionalProperties: false + title: Total Tokens + prompt_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails' + - type: 'null' + completion_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails' + - type: 'null' + type: object required: - - completed - - cancelled - - failed - - in_progress - - total - title: VectorStoreFileCounts - description: >- - File processing status counts for a vector store. - VectorStoreListResponse: + - prompt_tokens + - completion_tokens + - total_tokens + title: OpenAIChatCompletionUsage + description: 'Usage information for OpenAI chat completion. + + + :param prompt_tokens: Number of tokens in the prompt + + :param completion_tokens: Number of tokens in the completion + + :param total_tokens: Total tokens used (prompt + completion) + + :param input_tokens_details: Detailed breakdown of input token usage + + :param output_tokens_details: Detailed breakdown of output token usage' + OpenAIChatCompletionUsageCompletionTokensDetails: + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens type: object + title: OpenAIChatCompletionUsageCompletionTokensDetails + description: 'Token details for output tokens in OpenAI chat completion usage. + + + :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)' + OpenAIChatCompletionUsagePromptTokensDetails: properties: - object: - type: string - default: list - description: Object type identifier, always "list" - data: - type: array - items: - $ref: '#/components/schemas/VectorStoreObject' - description: List of vector store objects - first_id: - type: string - description: >- - (Optional) ID of the first vector store in the list for pagination - last_id: - type: string - description: >- - (Optional) ID of the last vector store in the list for pagination - has_more: - type: boolean - default: false - description: >- - Whether there are more vector stores available beyond this page - additionalProperties: false - required: - - object - - data - - has_more - title: VectorStoreListResponse - description: Response from listing vector stores. - VectorStoreObject: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens type: object + title: OpenAIChatCompletionUsagePromptTokensDetails + description: 'Token details for prompt tokens in OpenAI chat completion usage. + + + :param cached_tokens: Number of tokens retrieved from cache' + OpenAIChoice-Output: properties: - id: - type: string - description: Unique identifier for the vector store - object: + message: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Output' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Output' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Message + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Output' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Output' + finish_reason: type: string - default: vector_store - description: >- - Object type identifier, always "vector_store" - created_at: + title: Finish Reason + index: type: integer - description: >- - Timestamp when the vector store was created - name: + title: Index + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + - type: 'null' + type: object + required: + - message + - finish_reason + - index + title: OpenAIChoice + description: 'A choice from an OpenAI-compatible chat completion response. + + + :param message: The message from the model + + :param finish_reason: The reason the model stopped generating + + :param index: The index of the choice + + :param logprobs: (Optional) The log probabilities for the tokens in the message' + OpenAIChoiceLogprobs-Output: + properties: + content: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + title: Content + refusal: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + title: Refusal + type: object + title: OpenAIChoiceLogprobs + description: 'The log probabilities for the tokens in the message from an OpenAI-compatible + chat completion response. + + + :param content: (Optional) The log probabilities for the tokens in the message + + :param refusal: (Optional) The log probabilities for the tokens in the message' + OpenAICompletion: + properties: + id: type: string - description: (Optional) Name of the vector store - usage_bytes: + title: Id + choices: + items: + $ref: '#/components/schemas/OpenAICompletionChoice-Output' + type: array + title: Choices + created: type: integer - default: 0 - description: >- - Storage space used by the vector store in bytes - file_counts: - $ref: '#/components/schemas/VectorStoreFileCounts' - description: >- - File processing status counts for the vector store - status: + title: Created + model: type: string - default: completed - description: Current status of the vector store - expires_after: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Expiration policy for the vector store - expires_at: - type: integer - description: >- - (Optional) Timestamp when the vector store will expire - last_active_at: - type: integer - description: >- - (Optional) Timestamp of last activity on the vector store - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Set of key-value pairs that can be attached to the vector store - additionalProperties: false + title: Model + object: + type: string + const: text_completion + title: Object + default: text_completion + type: object required: - - id - - object - - created_at - - usage_bytes - - file_counts - - status - - metadata - title: VectorStoreObject - description: OpenAI Vector Store object. - "OpenAICreateVectorStoreRequestWithExtraBody": + - id + - choices + - created + - model + title: OpenAICompletion + description: 'Response from an OpenAI-compatible completion request. + + + :id: The ID of the completion + + :choices: List of choices + + :created: The Unix timestamp in seconds when the completion was created + + :model: The model that was used to generate the completion + + :object: The object type, which will be "text_completion"' + OpenAICompletionChoice-Output: + properties: + finish_reason: + type: string + title: Finish Reason + text: + type: string + title: Text + index: + type: integer + title: Index + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + - type: 'null' type: object + required: + - finish_reason + - text + - index + title: OpenAICompletionChoice + description: 'A choice from an OpenAI-compatible completion response. + + + :finish_reason: The reason the model stopped generating + + :text: The text of the choice + + :index: The index of the choice + + :logprobs: (Optional) The log probabilities for the tokens in the choice' + OpenAICompletionRequestWithExtraBody: properties: - name: + model: type: string - description: (Optional) A name for the vector store + title: Model + prompt: + anyOf: + - type: string + - items: + type: string + type: array + - items: + type: integer + type: array + - items: + items: + type: integer + type: array + type: array + title: Prompt + best_of: + anyOf: + - type: integer + - type: 'null' + title: Best Of + echo: + anyOf: + - type: boolean + - type: 'null' + title: Echo + frequency_penalty: + anyOf: + - type: number + - type: 'null' + title: Frequency Penalty + logit_bias: + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Logit Bias + logprobs: + anyOf: + - type: boolean + - type: 'null' + title: Logprobs + max_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Tokens + n: + anyOf: + - type: integer + - type: 'null' + title: N + presence_penalty: + anyOf: + - type: number + - type: 'null' + title: Presence Penalty + seed: + anyOf: + - type: integer + - type: 'null' + title: Seed + stop: + anyOf: + - type: string + - items: + type: string + type: array + - type: 'null' + title: Stop + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + stream_options: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Stream Options + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + user: + anyOf: + - type: string + - type: 'null' + title: User + suffix: + anyOf: + - type: string + - type: 'null' + title: Suffix + additionalProperties: true + type: object + required: + - model + - prompt + title: OpenAICompletionRequestWithExtraBody + description: 'Request parameters for OpenAI-compatible completion endpoint. + + + :param model: The identifier of the model to use. The model must be registered + with Llama Stack and available via the /models endpoint. + + :param prompt: The prompt to generate a completion for. + + :param best_of: (Optional) The number of completions to generate. + + :param echo: (Optional) Whether to echo the prompt. + + :param frequency_penalty: (Optional) The penalty for repeated tokens. + + :param logit_bias: (Optional) The logit bias to use. + + :param logprobs: (Optional) The log probabilities to use. + + :param max_tokens: (Optional) The maximum number of tokens to generate. + + :param n: (Optional) The number of completions to generate. + + :param presence_penalty: (Optional) The penalty for repeated tokens. + + :param seed: (Optional) The seed to use. + + :param stop: (Optional) The stop tokens to use. + + :param stream: (Optional) Whether to stream the response. + + :param stream_options: (Optional) The stream options to use. + + :param temperature: (Optional) The temperature to use. + + :param top_p: (Optional) The top p to use. + + :param user: (Optional) The user to use. + + :param suffix: (Optional) The suffix that should be appended to the completion.' + OpenAICreateVectorStoreFileBatchRequestWithExtraBody: + properties: file_ids: - type: array items: type: string - description: >- - List of file IDs to include in the vector store + type: array + title: File Ids + attributes: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Attributes + chunking_strategy: + anyOf: + - oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + - type: 'null' + title: Chunking Strategy + additionalProperties: true + type: object + required: + - file_ids + title: OpenAICreateVectorStoreFileBatchRequestWithExtraBody + description: 'Request to create a vector store file batch with extra_body support. + + + :param file_ids: A list of File IDs that the vector store should use + + :param attributes: (Optional) Key-value attributes to store with the files + + :param chunking_strategy: (Optional) The chunking strategy used to chunk the + file(s). Defaults to auto' + OpenAICreateVectorStoreRequestWithExtraBody: + properties: + name: + anyOf: + - type: string + - type: 'null' + title: Name + file_ids: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: File Ids expires_after: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Expiration policy for the vector store + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After chunking_strategy: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Strategy for splitting files into chunks + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Chunking Strategy metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Set of key-value pairs that can be attached to the vector store - additionalProperties: false - title: >- - OpenAICreateVectorStoreRequestWithExtraBody - description: >- - Request to create a vector store with extra_body support. - OpenaiUpdateVectorStoreRequest: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + additionalProperties: true type: object + title: OpenAICreateVectorStoreRequestWithExtraBody + description: 'Request to create a vector store with extra_body support. + + + :param name: (Optional) A name for the vector store + + :param file_ids: List of file IDs to include in the vector store + + :param expires_after: (Optional) Expiration policy for the vector store + + :param chunking_strategy: (Optional) Strategy for splitting files into chunks + + :param metadata: Set of key-value pairs that can be attached to the vector + store' + OpenAIDeveloperMessageParam: properties: + role: + type: string + const: developer + title: Role + default: developer + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content name: + anyOf: + - type: string + - type: 'null' + title: Name + type: object + required: + - content + title: OpenAIDeveloperMessageParam + description: 'A message from the developer in an OpenAI-compatible chat completion + request. + + + :param role: Must be "developer" to identify this as a developer message + + :param content: The content of the developer message + + :param name: (Optional) The name of the developer message participant.' + OpenAIEmbeddingData: + properties: + object: type: string - description: The name of the vector store. - expires_after: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The expiration policy for a vector store. - metadata: - type: object - additionalProperties: + const: embedding + title: Object + default: embedding + embedding: + anyOf: + - items: + type: number + type: array + - type: string + title: Embedding + index: + type: integer + title: Index + type: object + required: + - embedding + - index + title: OpenAIEmbeddingData + description: 'A single embedding data object from an OpenAI-compatible embeddings + response. + + + :param object: The object type, which will be "embedding" + + :param embedding: The embedding vector as a list of floats (when encoding_format="float") + or as a base64-encoded string (when encoding_format="base64") + + :param index: The index of the embedding in the input list' + OpenAIEmbeddingUsage: + properties: + prompt_tokens: + type: integer + title: Prompt Tokens + total_tokens: + type: integer + title: Total Tokens + type: object + required: + - prompt_tokens + - total_tokens + title: OpenAIEmbeddingUsage + description: 'Usage information for an OpenAI-compatible embeddings response. + + + :param prompt_tokens: The number of tokens in the input + + :param total_tokens: The total number of tokens used' + OpenAIEmbeddingsRequestWithExtraBody: + properties: + model: + type: string + title: Model + input: + anyOf: + - type: string + - items: + type: string + type: array + title: Input + encoding_format: + anyOf: + - type: string + - type: 'null' + title: Encoding Format + default: float + dimensions: + anyOf: + - type: integer + - type: 'null' + title: Dimensions + user: + anyOf: + - type: string + - type: 'null' + title: User + additionalProperties: true + type: object + required: + - model + - input + title: OpenAIEmbeddingsRequestWithExtraBody + description: 'Request parameters for OpenAI-compatible embeddings endpoint. + + + :param model: The identifier of the model to use. The model must be an embedding + model registered with Llama Stack and available via the /models endpoint. + + :param input: Input text to embed, encoded as a string or array of strings. + To embed multiple inputs in a single request, pass an array of strings. + + :param encoding_format: (Optional) The format to return the embeddings in. + Can be either "float" or "base64". Defaults to "float". + + :param dimensions: (Optional) The number of dimensions the resulting output + embeddings should have. Only supported in text-embedding-3 and later models. + + :param user: (Optional) A unique identifier representing your end-user, which + can help OpenAI to monitor and detect abuse.' + OpenAIEmbeddingsResponse: + properties: + object: + type: string + const: list + title: Object + default: list + data: + items: + $ref: '#/components/schemas/OpenAIEmbeddingData' + type: array + title: Data + model: + type: string + title: Model + usage: + $ref: '#/components/schemas/OpenAIEmbeddingUsage' + type: object + required: + - data + - model + - usage + title: OpenAIEmbeddingsResponse + description: 'Response from an OpenAI-compatible embeddings request. + + + :param object: The object type, which will be "list" + + :param data: List of embedding data objects + + :param model: The model that was used to generate the embeddings + + :param usage: Usage information' + OpenAIFile: + properties: + type: + type: string + const: file + title: Type + default: file + file: + $ref: '#/components/schemas/OpenAIFileFile' + type: object + required: + - file + title: OpenAIFile + OpenAIFileFile: + properties: + file_data: + anyOf: + - type: string + - type: 'null' + title: File Data + file_id: + anyOf: + - type: string + - type: 'null' + title: File Id + filename: + anyOf: + - type: string + - type: 'null' + title: Filename + type: object + title: OpenAIFileFile + OpenAIFileObject: + properties: + object: + type: string + const: file + title: Object + default: file + id: + type: string + title: Id + bytes: + type: integer + title: Bytes + created_at: + type: integer + title: Created At + expires_at: + type: integer + title: Expires At + filename: + type: string + title: Filename + purpose: + $ref: '#/components/schemas/OpenAIFilePurpose' + type: object + required: + - id + - bytes + - created_at + - expires_at + - filename + - purpose + title: OpenAIFileObject + description: 'OpenAI File object as defined in the OpenAI Files API. + + + :param object: The object type, which is always "file" + + :param id: The file identifier, which can be referenced in the API endpoints + + :param bytes: The size of the file, in bytes + + :param created_at: The Unix timestamp (in seconds) for when the file was created + + :param expires_at: The Unix timestamp (in seconds) for when the file expires + + :param filename: The name of the file + + :param purpose: The intended purpose of the file' + OpenAIFilePurpose: + type: string + enum: + - assistants + - batch + title: OpenAIFilePurpose + description: Valid purpose values for OpenAI Files API. + OpenAIImageURL: + properties: + url: + type: string + title: Url + detail: + anyOf: + - type: string + - type: 'null' + title: Detail + type: object + required: + - url + title: OpenAIImageURL + description: 'Image URL specification for OpenAI-compatible chat completion + messages. + + + :param url: URL of the image to include in the message + + :param detail: (Optional) Level of detail for image processing. Can be "low", + "high", or "auto"' + OpenAIJSONSchema: + properties: + name: + type: string + title: Name + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + type: object + title: OpenAIJSONSchema + description: 'JSON schema specification for OpenAI-compatible structured response + format. + + + :param name: Name of the schema + + :param description: (Optional) Description of the schema + + :param strict: (Optional) Whether to enforce strict adherence to the schema + + :param schema: (Optional) The JSON schema definition' + OpenAIResponseAnnotationCitation: + properties: + type: + type: string + const: url_citation + title: Type + default: url_citation + end_index: + type: integer + title: End Index + start_index: + type: integer + title: Start Index + title: + type: string + title: Title + url: + type: string + title: Url + type: object + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + description: 'URL citation annotation for referencing external web resources. + + + :param type: Annotation type identifier, always "url_citation" + + :param end_index: End position of the citation span in the content + + :param start_index: Start position of the citation span in the content + + :param title: Title of the referenced web resource + + :param url: URL of the referenced web resource' + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + type: string + const: container_file_citation + title: Type + default: container_file_citation + container_id: + type: string + title: Container Id + end_index: + type: integer + title: End Index + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + start_index: + type: integer + title: Start Index + type: object + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + OpenAIResponseAnnotationFileCitation: + properties: + type: + type: string + const: file_citation + title: Type + default: file_citation + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + index: + type: integer + title: Index + type: object + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + description: 'File citation annotation for referencing specific files in response + content. + + + :param type: Annotation type identifier, always "file_citation" + + :param file_id: Unique identifier of the referenced file + + :param filename: Name of the referenced file + + :param index: Position index of the citation within the content' + OpenAIResponseAnnotationFilePath: + properties: + type: + type: string + const: file_path + title: Type + default: file_path + file_id: + type: string + title: File Id + index: + type: integer + title: Index + type: object + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + OpenAIResponseContentPartRefusal: + properties: + type: + type: string + const: refusal + title: Type + default: refusal + refusal: + type: string + title: Refusal + type: object + required: + - refusal + title: OpenAIResponseContentPartRefusal + description: 'Refusal content within a streamed response part. + + + :param type: Content part type identifier, always "refusal" + + :param refusal: Refusal text supplied by the model' + OpenAIResponseFormatJSONObject: + properties: + type: + type: string + const: json_object + title: Type + default: json_object + type: object + title: OpenAIResponseFormatJSONObject + description: 'JSON object response format for OpenAI-compatible chat completion + requests. + + + :param type: Must be "json_object" to indicate generic JSON object response + format' + OpenAIResponseFormatJSONSchema: + properties: + type: + type: string + const: json_schema + title: Type + default: json_schema + json_schema: + $ref: '#/components/schemas/OpenAIJSONSchema' + type: object + required: + - json_schema + title: OpenAIResponseFormatJSONSchema + description: 'JSON schema response format for OpenAI-compatible chat completion + requests. + + + :param type: Must be "json_schema" to indicate structured JSON response format + + :param json_schema: The JSON schema specification for the response' + OpenAIResponseFormatText: + properties: + type: + type: string + const: text + title: Type + default: text + type: object + title: OpenAIResponseFormatText + description: 'Text response format for OpenAI-compatible chat completion requests. + + + :param type: Must be "text" to indicate plain text response format' + OpenAIResponseInputFunctionToolCallOutput: + properties: + call_id: + type: string + title: Call Id + output: + type: string + title: Output + type: + type: string + const: function_call_output + title: Type + default: function_call_output + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + type: object + required: + - call_id + - output + title: OpenAIResponseInputFunctionToolCallOutput + description: This represents the output of a function call that gets passed + back to the model. + OpenAIResponseInputMessageContentFile: + properties: + type: + type: string + const: input_file + title: Type + default: input_file + file_data: + anyOf: + - type: string + - type: 'null' + title: File Data + file_id: + anyOf: + - type: string + - type: 'null' + title: File Id + file_url: + anyOf: + - type: string + - type: 'null' + title: File Url + filename: + anyOf: + - type: string + - type: 'null' + title: Filename + type: object + title: OpenAIResponseInputMessageContentFile + description: 'File content for input messages in OpenAI response format. + + + :param type: The type of the input item. Always `input_file`. + + :param file_data: The data of the file to be sent to the model. + + :param file_id: (Optional) The ID of the file to be sent to the model. + + :param file_url: The URL of the file to be sent to the model. + + :param filename: The name of the file to be sent to the model.' + OpenAIResponseInputMessageContentImage: + properties: + detail: + anyOf: + - type: string + const: low + - type: string + const: high + - type: string + const: auto + title: Detail + default: auto + type: + type: string + const: input_image + title: Type + default: input_image + file_id: + anyOf: + - type: string + - type: 'null' + title: File Id + image_url: + anyOf: + - type: string + - type: 'null' + title: Image Url + type: object + title: OpenAIResponseInputMessageContentImage + description: 'Image content for input messages in OpenAI response format. + + + :param detail: Level of detail for image processing, can be "low", "high", + or "auto" + + :param type: Content type identifier, always "input_image" + + :param file_id: (Optional) The ID of the file to be sent to the model. + + :param image_url: (Optional) URL of the image content' + OpenAIResponseInputMessageContentText: + properties: + text: + type: string + title: Text + type: + type: string + const: input_text + title: Type + default: input_text + type: object + required: + - text + title: OpenAIResponseInputMessageContentText + description: 'Text content for input messages in OpenAI response format. + + + :param text: The text content of the input message + + :param type: Content type identifier, always "input_text"' + OpenAIResponseInputToolFileSearch: + properties: + type: + type: string + const: file_search + title: Type + default: file_search + vector_store_ids: + items: + type: string + type: array + title: Vector Store Ids + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Filters + max_num_results: + anyOf: + - type: integer + maximum: 50.0 + minimum: 1.0 + - type: 'null' + title: Max Num Results + default: 10 + ranking_options: + anyOf: + - $ref: '#/components/schemas/SearchRankingOptions' + - type: 'null' + type: object + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + description: 'File search tool configuration for OpenAI response inputs. + + + :param type: Tool type identifier, always "file_search" + + :param vector_store_ids: List of vector store identifiers to search within + + :param filters: (Optional) Additional filters to apply to the search + + :param max_num_results: (Optional) Maximum number of search results to return + (1-50) + + :param ranking_options: (Optional) Options for ranking and scoring search + results' + OpenAIResponseInputToolFunction: + properties: + type: + type: string + const: function + title: Type + default: function + name: + type: string + title: Name + description: + anyOf: + - type: string + - type: 'null' + title: Description + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Parameters + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + type: object + required: + - name + - parameters + title: OpenAIResponseInputToolFunction + description: 'Function tool configuration for OpenAI response inputs. + + + :param type: Tool type identifier, always "function" + + :param name: Name of the function that can be called + + :param description: (Optional) Description of what the function does + + :param parameters: (Optional) JSON schema defining the function''s parameters + + :param strict: (Optional) Whether to enforce strict parameter validation' + OpenAIResponseInputToolMCP: + properties: + type: + type: string + const: mcp + title: Type + default: mcp + server_label: + type: string + title: Server Label + server_url: + type: string + title: Server Url + headers: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Headers + require_approval: + anyOf: + - type: string + const: always + - type: string + const: never + - $ref: '#/components/schemas/ApprovalFilter' + title: Require Approval + default: never + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + title: Allowed Tools + type: object + required: + - server_label + - server_url + title: OpenAIResponseInputToolMCP + description: 'Model Context Protocol (MCP) tool configuration for OpenAI response + inputs. + + + :param type: Tool type identifier, always "mcp" + + :param server_label: Label to identify this MCP server + + :param server_url: URL endpoint of the MCP server + + :param headers: (Optional) HTTP headers to include when connecting to the + server + + :param require_approval: Approval requirement for tool calls ("always", "never", + or filter) + + :param allowed_tools: (Optional) Restriction on which tools can be used from + this server' + OpenAIResponseInputToolWebSearch: + properties: + type: + anyOf: + - type: string + const: web_search + - type: string + const: web_search_preview + - type: string + const: web_search_preview_2025_03_11 + title: Type + default: web_search + search_context_size: + anyOf: + - type: string + pattern: ^low|medium|high$ + - type: 'null' + title: Search Context Size + default: medium + type: object + title: OpenAIResponseInputToolWebSearch + description: 'Web search tool configuration for OpenAI response inputs. + + + :param type: Web search tool type variant to use + + :param search_context_size: (Optional) Size of search context, must be "low", + "medium", or "high"' + OpenAIResponseMCPApprovalRequest: + properties: + arguments: + type: string + title: Arguments + id: + type: string + title: Id + name: + type: string + title: Name + server_label: + type: string + title: Server Label + type: + type: string + const: mcp_approval_request + title: Type + default: mcp_approval_request + type: object + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + description: A request for human approval of a tool invocation. + OpenAIResponseMCPApprovalResponse: + properties: + approval_request_id: + type: string + title: Approval Request Id + approve: + type: boolean + title: Approve + type: + type: string + const: mcp_approval_response + title: Type + default: mcp_approval_response + id: + anyOf: + - type: string + - type: 'null' + title: Id + reason: + anyOf: + - type: string + - type: 'null' + title: Reason + type: object + required: + - approval_request_id + - approve + title: OpenAIResponseMCPApprovalResponse + description: A response to an MCP approval request. + OpenAIResponseMessage: + properties: + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - type: string + const: system + - type: string + const: developer + - type: string + const: user + - type: string + const: assistant + title: Role + type: + type: string + const: message + title: Type + default: message + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + type: object + required: + - content + - role + title: OpenAIResponseMessage + description: 'Corresponds to the various Message types in the Responses API. + + They are all under one type because the Responses API gives them all + + the same "type" value, and there is no way to tell them apart in certain + + scenarios.' + OpenAIResponseOutputMessageContentOutputText: + properties: + text: + type: string + title: Text + type: + type: string + const: output_text + title: Type + default: output_text + annotations: + items: oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Set of 16 key-value pairs that can be attached to an object. - additionalProperties: false - title: OpenaiUpdateVectorStoreRequest - VectorStoreDeleteResponse: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + discriminator: + propertyName: type + mapping: + container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' + url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' + type: array + title: Annotations + type: object + required: + - text + title: OpenAIResponseOutputMessageContentOutputText + OpenAIResponseOutputMessageFileSearchToolCall: + properties: + id: + type: string + title: Id + queries: + items: + type: string + type: array + title: Queries + status: + type: string + title: Status + type: + type: string + const: file_search_call + title: Type + default: file_search_call + results: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' + type: array + - type: 'null' + title: Results + type: object + required: + - id + - queries + - status + title: OpenAIResponseOutputMessageFileSearchToolCall + description: 'File search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param queries: List of search queries executed + + :param status: Current status of the file search operation + + :param type: Tool call type identifier, always "file_search_call" + + :param results: (Optional) Search results returned by the file search operation' + OpenAIResponseOutputMessageFileSearchToolCallResults: + properties: + attributes: + additionalProperties: true + type: object + title: Attributes + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + score: + type: number + title: Score + text: + type: string + title: Text + type: object + required: + - attributes + - file_id + - filename + - score + - text + title: OpenAIResponseOutputMessageFileSearchToolCallResults + description: 'Search results returned by the file search operation. + + + :param attributes: (Optional) Key-value attributes associated with the file + + :param file_id: Unique identifier of the file containing the result + + :param filename: Name of the file containing the result + + :param score: Relevance score for this search result (between 0 and 1) + + :param text: Text content of the search result' + OpenAIResponseOutputMessageFunctionToolCall: + properties: + call_id: + type: string + title: Call Id + name: + type: string + title: Name + arguments: + type: string + title: Arguments + type: + type: string + const: function_call + title: Type + default: function_call + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + type: object + required: + - call_id + - name + - arguments + title: OpenAIResponseOutputMessageFunctionToolCall + description: 'Function tool call output message for OpenAI responses. + + + :param call_id: Unique identifier for the function call + + :param name: Name of the function being called + + :param arguments: JSON string containing the function arguments + + :param type: Tool call type identifier, always "function_call" + + :param id: (Optional) Additional identifier for the tool call + + :param status: (Optional) Current status of the function call execution' + OpenAIResponseOutputMessageMCPCall: + properties: + id: + type: string + title: Id + type: + type: string + const: mcp_call + title: Type + default: mcp_call + arguments: + type: string + title: Arguments + name: + type: string + title: Name + server_label: + type: string + title: Server Label + error: + anyOf: + - type: string + - type: 'null' + title: Error + output: + anyOf: + - type: string + - type: 'null' + title: Output + type: object + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + description: 'Model Context Protocol (MCP) call output message for OpenAI responses. + + + :param id: Unique identifier for this MCP call + + :param type: Tool call type identifier, always "mcp_call" + + :param arguments: JSON string containing the MCP call arguments + + :param name: Name of the MCP method being called + + :param server_label: Label identifying the MCP server handling the call + + :param error: (Optional) Error message if the MCP call failed + + :param output: (Optional) Output result from the successful MCP call' + OpenAIResponseOutputMessageMCPListTools: + properties: + id: + type: string + title: Id + type: + type: string + const: mcp_list_tools + title: Type + default: mcp_list_tools + server_label: + type: string + title: Server Label + tools: + items: + $ref: '#/components/schemas/MCPListToolsTool' + type: array + title: Tools + type: object + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + description: 'MCP list tools output message containing available tools from + an MCP server. + + + :param id: Unique identifier for this MCP list tools operation + + :param type: Tool call type identifier, always "mcp_list_tools" + + :param server_label: Label identifying the MCP server providing the tools + + :param tools: List of available tools provided by the MCP server' + OpenAIResponseOutputMessageWebSearchToolCall: + properties: + id: + type: string + title: Id + status: + type: string + title: Status + type: + type: string + const: web_search_call + title: Type + default: web_search_call + type: object + required: + - id + - status + title: OpenAIResponseOutputMessageWebSearchToolCall + description: 'Web search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param status: Current status of the web search operation + + :param type: Tool call type identifier, always "web_search_call"' + OpenAIResponsePrompt: + properties: + id: + type: string + title: Id + variables: + anyOf: + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: object + - type: 'null' + title: Variables + version: + anyOf: + - type: string + - type: 'null' + title: Version + type: object + required: + - id + title: OpenAIResponsePrompt + description: 'OpenAI compatible Prompt object that is used in OpenAI responses. + + + :param id: Unique identifier of the prompt template + + :param variables: Dictionary of variable names to OpenAIResponseInputMessageContent + structure for template substitution. The substitution values can either be + strings, or other Response input types + + like images or files. + + :param version: Version number of the prompt to use (defaults to latest if + not specified)' + OpenAIResponseText: + properties: + format: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseTextFormat' + - type: 'null' + type: object + title: OpenAIResponseText + description: 'Text response configuration for OpenAI responses. + + + :param format: (Optional) Text format configuration specifying output format + requirements' + OpenAIResponseTextFormat: + properties: + type: + anyOf: + - type: string + const: text + - type: string + const: json_schema + - type: string + const: json_object + title: Type + name: + anyOf: + - type: string + - type: 'null' + title: Name + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + type: object + title: OpenAIResponseTextFormat + description: 'Configuration for Responses API text format. + + + :param type: Must be "text", "json_schema", or "json_object" to identify the + format type + + :param name: The name of the response format. Only used for json_schema. + + :param schema: The JSON schema the response should conform to. In a Python + SDK, this is often a `pydantic` model. Only used for json_schema. + + :param description: (Optional) A description of the response format. Only + used for json_schema. + + :param strict: (Optional) Whether to strictly enforce the JSON schema. If + true, the response must match the schema exactly. Only used for json_schema.' + OpenAISystemMessageParam: + properties: + role: + type: string + const: system + title: Role + default: system + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + type: object + required: + - content + title: OpenAISystemMessageParam + description: 'A system message providing instructions or context to the model. + + + :param role: Must be "system" to identify this as a system message + + :param content: The content of the "system prompt". If multiple system messages + are provided, they are concatenated. The underlying Llama Stack code may also + add other system messages (for example, for formatting tool definitions). + + :param name: (Optional) The name of the system message participant.' + OpenAITokenLogProb: + properties: + token: + type: string + title: Token + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + type: number + title: Logprob + top_logprobs: + items: + $ref: '#/components/schemas/OpenAITopLogProb' + type: array + title: Top Logprobs type: object + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + description: 'The log probability for a token from an OpenAI-compatible chat + completion response. + + + :token: The token + + :bytes: (Optional) The bytes for the token + + :logprob: The log probability of the token + + :top_logprobs: The top log probabilities for the token' + OpenAIToolMessageParam: properties: - id: + role: type: string - description: >- - Unique identifier of the deleted vector store - object: + const: tool + title: Role + default: tool + tool_call_id: type: string - default: vector_store.deleted - description: >- - Object type identifier for the deletion response - deleted: - type: boolean - default: true - description: >- - Whether the deletion operation was successful - additionalProperties: false - required: - - id - - object - - deleted - title: VectorStoreDeleteResponse - description: Response from deleting a vector store. - VectorStoreChunkingStrategy: - oneOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' - discriminator: - propertyName: type - mapping: - auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' - static: '#/components/schemas/VectorStoreChunkingStrategyStatic' - VectorStoreChunkingStrategyAuto: + title: Tool Call Id + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content type: object + required: + - tool_call_id + - content + title: OpenAIToolMessageParam + description: 'A message representing the result of a tool invocation in an OpenAI-compatible + chat completion request. + + + :param role: Must be "tool" to identify this as a tool response + + :param tool_call_id: Unique identifier for the tool call this response is + for + + :param content: The response content from the tool' + OpenAITopLogProb: properties: - type: + token: type: string - const: auto - default: auto - description: >- - Strategy type, always "auto" for automatic chunking - additionalProperties: false - required: - - type - title: VectorStoreChunkingStrategyAuto - description: >- - Automatic chunking strategy for vector store files. - VectorStoreChunkingStrategyStatic: + title: Token + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + type: number + title: Logprob type: object + required: + - token + - logprob + title: OpenAITopLogProb + description: 'The top log probability for a token from an OpenAI-compatible + chat completion response. + + + :token: The token + + :bytes: (Optional) The bytes for the token + + :logprob: The log probability of the token' + OpenAIUserMessageParam-Input: properties: - type: + role: type: string - const: static - default: static - description: >- - Strategy type, always "static" for static chunking - static: - $ref: '#/components/schemas/VectorStoreChunkingStrategyStaticConfig' - description: >- - Configuration parameters for the static chunking strategy - additionalProperties: false - required: - - type - - static - title: VectorStoreChunkingStrategyStatic - description: >- - Static chunking strategy with configurable parameters. - VectorStoreChunkingStrategyStaticConfig: + const: user + title: Role + default: user + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/OpenAIFile' + image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name type: object - properties: - chunk_overlap_tokens: - type: integer - default: 400 - description: >- - Number of tokens to overlap between adjacent chunks - max_chunk_size_tokens: - type: integer - default: 800 - description: >- - Maximum number of tokens per chunk, must be between 100 and 4096 - additionalProperties: false required: - - chunk_overlap_tokens - - max_chunk_size_tokens - title: VectorStoreChunkingStrategyStaticConfig - description: >- - Configuration for static chunking strategy. - "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": + - content + title: OpenAIUserMessageParam + description: 'A message from the user in an OpenAI-compatible chat completion + request. + + + :param role: Must be "user" to identify this as a user message + + :param content: The content of the message, which can include text and other + media + + :param name: (Optional) The name of the user message participant.' + OpenAIUserMessageParam-Output: + properties: + role: + type: string + const: user + title: Role + default: user + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/OpenAIFile' + image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name type: object + required: + - content + title: OpenAIUserMessageParam + description: 'A message from the user in an OpenAI-compatible chat completion + request. + + + :param role: Must be "user" to identify this as a user message + + :param content: The content of the message, which can include text and other + media + + :param name: (Optional) The name of the user message participant.' + Order: + type: string + enum: + - asc + - desc + title: Order + description: 'Sort order for paginated responses. + + :cvar asc: Ascending order + + :cvar desc: Descending order' + Prompt: properties: - file_ids: - type: array + prompt: + anyOf: + - type: string + - type: 'null' + title: Prompt + description: The system prompt with variable placeholders + version: + type: integer + minimum: 1.0 + title: Version + description: Version (integer starting at 1, incremented on save) + prompt_id: + type: string + title: Prompt Id + description: Unique identifier in format 'pmpt_<48-digit-hash>' + variables: items: type: string - description: >- - A list of File IDs that the vector store should use - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Key-value attributes to store with the files - chunking_strategy: - $ref: '#/components/schemas/VectorStoreChunkingStrategy' - description: >- - (Optional) The chunking strategy used to chunk the file(s). Defaults to - auto - additionalProperties: false - required: - - file_ids - title: >- - OpenAICreateVectorStoreFileBatchRequestWithExtraBody - description: >- - Request to create a vector store file batch with extra_body support. - VectorStoreFileBatchObject: + type: array + title: Variables + description: List of variable names that can be used in the prompt template + is_default: + type: boolean + title: Is Default + description: Boolean indicating whether this version is the default version + default: false type: object + required: + - version + - prompt_id + title: Prompt + description: 'A prompt resource representing a stored OpenAI Compatible prompt + template in Llama Stack. + + + :param prompt: The system prompt text with variable placeholders. Variables + are only supported when using the Responses API. + + :param version: Version (integer starting at 1, incremented on save) + + :param prompt_id: Unique identifier formatted as ''pmpt_<48-digit-hash>'' + + :param variables: List of prompt variable names that can be used in the prompt + template + + :param is_default: Boolean indicating whether this version is the default + version for this prompt' + ProviderInfo: properties: - id: + api: type: string - description: Unique identifier for the file batch - object: + title: Api + provider_id: type: string - default: vector_store.file_batch - description: >- - Object type identifier, always "vector_store.file_batch" - created_at: - type: integer - description: >- - Timestamp when the file batch was created - vector_store_id: + title: Provider Id + provider_type: type: string - description: >- - ID of the vector store containing the file batch - status: - $ref: '#/components/schemas/VectorStoreFileStatus' - description: >- - Current processing status of the file batch - file_counts: - $ref: '#/components/schemas/VectorStoreFileCounts' - description: >- - File processing status counts for the batch - additionalProperties: false + title: Provider Type + config: + additionalProperties: true + type: object + title: Config + health: + additionalProperties: true + type: object + title: Health + type: object required: - - id - - object - - created_at - - vector_store_id - - status - - file_counts - title: VectorStoreFileBatchObject - description: OpenAI Vector Store File Batch object. - VectorStoreFileStatus: - oneOf: - - type: string - const: completed - - type: string - const: in_progress - - type: string - const: cancelled - - type: string - const: failed - VectorStoreFileLastError: + - api + - provider_id + - provider_type + - config + - health + title: ProviderInfo + description: 'Information about a registered provider including its configuration + and health status. + + + :param api: The API name this provider implements + + :param provider_id: Unique identifier for the provider + + :param provider_type: The type of provider implementation + + :param config: Configuration parameters for the provider + + :param health: Current health status of the provider' + RAGQueryConfig: + properties: + query_generator_config: + oneOf: + - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' + title: Query Generator Config + default: + type: default + separator: ' ' + discriminator: + propertyName: type + mapping: + default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' + max_tokens_in_context: + type: integer + title: Max Tokens In Context + default: 4096 + max_chunks: + type: integer + title: Max Chunks + default: 5 + chunk_template: + type: string + title: Chunk Template + default: 'Result {index} + + Content: {chunk.content} + + Metadata: {metadata} + + ' + mode: + anyOf: + - $ref: '#/components/schemas/RAGSearchMode' + - type: 'null' + default: vector + ranker: + anyOf: + - oneOf: + - $ref: '#/components/schemas/RRFRanker' + - $ref: '#/components/schemas/WeightedRanker' + discriminator: + propertyName: type + mapping: + rrf: '#/components/schemas/RRFRanker' + weighted: '#/components/schemas/WeightedRanker' + - type: 'null' + title: Ranker + type: object + title: RAGQueryConfig + description: "Configuration for the RAG query generation.\n\n:param query_generator_config:\ + \ Configuration for the query generator.\n:param max_tokens_in_context: Maximum\ + \ number of tokens in the context.\n:param max_chunks: Maximum number of chunks\ + \ to retrieve.\n:param chunk_template: Template for formatting each retrieved\ + \ chunk in the context.\n Available placeholders: {index} (1-based chunk\ + \ ordinal), {chunk.content} (chunk content string), {metadata} (chunk metadata\ + \ dict).\n Default: \"Result {index}\\nContent: {chunk.content}\\nMetadata:\ + \ {metadata}\\n\"\n:param mode: Search mode for retrieval\u2014either \"vector\"\ + , \"keyword\", or \"hybrid\". Default \"vector\".\n:param ranker: Configuration\ + \ for the ranker to use in hybrid search. Defaults to RRF ranker." + RAGSearchMode: + type: string + enum: + - vector + - keyword + - hybrid + title: RAGSearchMode + description: 'Search modes for RAG query retrieval: + + - VECTOR: Uses vector similarity search for semantic matching + + - KEYWORD: Uses keyword-based search for exact matching + + - HYBRID: Combines both vector and keyword search for better results' + RRFRanker: + properties: + type: + type: string + const: rrf + title: Type + default: rrf + impact_factor: + type: number + title: Impact Factor + default: 60.0 + minimum: 0.0 + type: object + title: RRFRanker + description: "Reciprocal Rank Fusion (RRF) ranker configuration.\n\n:param type:\ + \ The type of ranker, always \"rrf\"\n:param impact_factor: The impact factor\ + \ for RRF scoring. Higher values give more weight to higher-ranked results.\n\ + \ Must be greater than 0" + RegexParserScoringFnParams: + properties: + type: + type: string + const: regex_parser + title: Type + default: regex_parser + parsing_regexes: + items: + type: string + type: array + title: Parsing Regexes + description: Regex to extract the answer from generated response + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row type: object + title: RegexParserScoringFnParams + description: 'Parameters for regex parser scoring function configuration. + + :param type: The type of scoring function parameters, always regex_parser + + :param parsing_regexes: Regex to extract the answer from generated response + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row' + RouteInfo: properties: - code: - oneOf: - - type: string - const: server_error - - type: string - const: rate_limit_exceeded - description: >- - Error code indicating the type of failure - message: + route: type: string - description: >- - Human-readable error message describing the failure - additionalProperties: false - required: - - code - - message - title: VectorStoreFileLastError - description: >- - Error information for failed vector store file processing. - VectorStoreFileObject: + title: Route + method: + type: string + title: Method + provider_types: + items: + type: string + type: array + title: Provider Types type: object + required: + - route + - method + - provider_types + title: RouteInfo + description: 'Information about an API route including its path, method, and + implementing providers. + + + :param route: The API endpoint path + + :param method: HTTP method for the route + + :param provider_types: List of provider types that implement this route' + ScoringFn-Output: properties: - id: + identifier: type: string - description: Unique identifier for the file - object: + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: type: string - default: vector_store.file - description: >- - Object type identifier, always "vector_store.file" - attributes: + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: scoring_function + title: Type + default: scoring_function + description: + anyOf: + - type: string + - type: 'null' + title: Description + metadata: + additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Key-value attributes associated with the file - chunking_strategy: + title: Metadata + description: Any additional metadata for this definition + return_type: oneOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + - $ref: '#/components/schemas/StringType' + - $ref: '#/components/schemas/NumberType' + - $ref: '#/components/schemas/BooleanType' + - $ref: '#/components/schemas/ArrayType' + - $ref: '#/components/schemas/ObjectType' + - $ref: '#/components/schemas/JsonType' + - $ref: '#/components/schemas/UnionType' + - $ref: '#/components/schemas/ChatCompletionInputType' + - $ref: '#/components/schemas/CompletionInputType' + - $ref: '#/components/schemas/AgentTurnInputType' + title: Return Type + description: The return type of the deterministic function discriminator: propertyName: type mapping: - auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' - static: '#/components/schemas/VectorStoreChunkingStrategyStatic' - description: >- - Strategy used for splitting the file into chunks - created_at: - type: integer - description: >- - Timestamp when the file was added to the vector store - last_error: - $ref: '#/components/schemas/VectorStoreFileLastError' - description: >- - (Optional) Error information if file processing failed - status: - $ref: '#/components/schemas/VectorStoreFileStatus' - description: Current processing status of the file - usage_bytes: - type: integer - default: 0 - description: Storage space used by this file in bytes - vector_store_id: - type: string - description: >- - ID of the vector store containing this file - additionalProperties: false - required: - - id - - object - - attributes - - chunking_strategy - - created_at - - status - - usage_bytes - - vector_store_id - title: VectorStoreFileObject - description: OpenAI Vector Store File object. - VectorStoreFilesListInBatchResponse: - type: object + agent_turn_input: '#/components/schemas/AgentTurnInputType' + array: '#/components/schemas/ArrayType' + boolean: '#/components/schemas/BooleanType' + chat_completion_input: '#/components/schemas/ChatCompletionInputType' + completion_input: '#/components/schemas/CompletionInputType' + json: '#/components/schemas/JsonType' + number: '#/components/schemas/NumberType' + object: '#/components/schemas/ObjectType' + string: '#/components/schemas/StringType' + union: '#/components/schemas/UnionType' + params: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' + title: Params + description: The parameters for the scoring function for benchmark eval, + these can be overridden for app eval + type: object + required: + - identifier + - provider_id + - return_type + title: ScoringFn + description: 'A scoring function resource for evaluating model outputs. + + :param type: The resource type, always scoring_function' + SearchRankingOptions: properties: - object: + ranker: + anyOf: + - type: string + - type: 'null' + title: Ranker + score_threshold: + anyOf: + - type: number + - type: 'null' + title: Score Threshold + default: 0.0 + type: object + title: SearchRankingOptions + description: 'Options for ranking and filtering search results. + + + :param ranker: (Optional) Name of the ranking algorithm to use + + :param score_threshold: (Optional) Minimum relevance score threshold for results' + Shield: + properties: + identifier: type: string - default: list - description: Object type identifier, always "list" - data: - type: array - items: - $ref: '#/components/schemas/VectorStoreFileObject' - description: >- - List of vector store file objects in the batch - first_id: + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: type: string - description: >- - (Optional) ID of the first file in the list for pagination - last_id: + title: Provider Id + description: ID of the provider that owns this resource + type: type: string - description: >- - (Optional) ID of the last file in the list for pagination - has_more: - type: boolean - default: false - description: >- - Whether there are more files available beyond this page - additionalProperties: false - required: - - object - - data - - has_more - title: VectorStoreFilesListInBatchResponse - description: >- - Response from listing files in a vector store file batch. - VectorStoreListFilesResponse: + const: shield + title: Type + default: shield + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params type: object + required: + - identifier + - provider_id + title: Shield + description: 'A safety shield resource that can be used to check content. + + + :param params: (Optional) Configuration parameters for the shield + + :param type: The resource type, always shield' + StringType: properties: - object: - type: string - default: list - description: Object type identifier, always "list" - data: - type: array - items: - $ref: '#/components/schemas/VectorStoreFileObject' - description: List of vector store file objects - first_id: - type: string - description: >- - (Optional) ID of the first file in the list for pagination - last_id: + type: type: string - description: >- - (Optional) ID of the last file in the list for pagination - has_more: - type: boolean - default: false - description: >- - Whether there are more files available beyond this page - additionalProperties: false - required: - - object - - data - - has_more - title: VectorStoreListFilesResponse - description: >- - Response from listing files in a vector store. - OpenaiAttachFileToVectorStoreRequest: + const: string + title: Type + default: string type: object + title: StringType + description: 'Parameter type for string values. + + + :param type: Discriminator type. Always "string"' + ToolDef: properties: - file_id: + toolgroup_id: + anyOf: + - type: string + - type: 'null' + title: Toolgroup Id + name: type: string - description: >- - The ID of the file to attach to the vector store. - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The key-value attributes stored with the file, which can be used for filtering. - chunking_strategy: - $ref: '#/components/schemas/VectorStoreChunkingStrategy' - description: >- - The chunking strategy to use for the file. - additionalProperties: false - required: - - file_id - title: OpenaiAttachFileToVectorStoreRequest - OpenaiUpdateVectorStoreFileRequest: + title: Name + description: + anyOf: + - type: string + - type: 'null' + title: Description + input_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Input Schema + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Output Schema + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata type: object - properties: - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The updated key-value attributes to store with the file. - additionalProperties: false required: - - attributes - title: OpenaiUpdateVectorStoreFileRequest - VectorStoreFileDeleteResponse: - type: object + - name + title: ToolDef + description: 'Tool definition used in runtime contexts. + + + :param name: Name of the tool + + :param description: (Optional) Human-readable description of what the tool + does + + :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) + + :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) + + :param metadata: (Optional) Additional metadata about the tool + + :param toolgroup_id: (Optional) ID of the tool group this tool belongs to' + ToolGroup: properties: - id: + identifier: type: string - description: Unique identifier of the deleted file - object: + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: type: string - default: vector_store.file.deleted - description: >- - Object type identifier for the deletion response - deleted: - type: boolean - default: true - description: >- - Whether the deletion operation was successful - additionalProperties: false + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: tool_group + title: Type + default: tool_group + mcp_endpoint: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + args: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Args + type: object required: - - id - - object - - deleted - title: VectorStoreFileDeleteResponse - description: >- - Response from deleting a vector store file. - VectorStoreContent: + - identifier + - provider_id + title: ToolGroup + description: 'A group of related tools managed together. + + + :param type: Type of resource, always ''tool_group'' + + :param mcp_endpoint: (Optional) Model Context Protocol endpoint for remote + tools + + :param args: (Optional) Additional arguments for the tool group' + URL: + properties: + uri: + type: string + title: Uri type: object + required: + - uri + title: URL + description: 'A URL reference to external content. + + + :param uri: The URL string pointing to the resource' + UnionType: properties: type: type: string - const: text - description: >- - Content type, currently only "text" is supported - text: - type: string - description: The actual text content - additionalProperties: false - required: - - type - - text - title: VectorStoreContent - description: >- - Content item from a vector store file or search result. - VectorStoreFileContentsResponse: + const: union + title: Type + default: union type: object + title: UnionType + description: 'Parameter type for union values. + + + :param type: Discriminator type. Always "union"' + VectorStoreChunkingStrategyAuto: properties: - file_id: - type: string - description: Unique identifier for the file - filename: + type: type: string - description: Name of the file - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Key-value attributes associated with the file - content: - type: array - items: - $ref: '#/components/schemas/VectorStoreContent' - description: List of content items from the file - additionalProperties: false - required: - - file_id - - filename - - attributes - - content - title: VectorStoreFileContentsResponse - description: >- - Response from retrieving the contents of a vector store file. - OpenaiSearchVectorStoreRequest: + const: auto + title: Type + default: auto type: object + title: VectorStoreChunkingStrategyAuto + description: 'Automatic chunking strategy for vector store files. + + + :param type: Strategy type, always "auto" for automatic chunking' + VectorStoreChunkingStrategyStatic: properties: - query: - oneOf: - - type: string - - type: array - items: - type: string - description: >- - The query string or array for performing the search. - filters: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Filters based on file attributes to narrow the search results. - max_num_results: - type: integer - description: >- - Maximum number of results to return (1 to 50 inclusive, default 10). - ranking_options: - type: object - properties: - ranker: - type: string - description: >- - (Optional) Name of the ranking algorithm to use - score_threshold: - type: number - default: 0.0 - description: >- - (Optional) Minimum relevance score threshold for results - additionalProperties: false - description: >- - Ranking options for fine-tuning the search results. - rewrite_query: - type: boolean - description: >- - Whether to rewrite the natural language query for vector search (default - false) - search_mode: + type: type: string - description: >- - The search mode to use - "keyword", "vector", or "hybrid" (default "vector") - additionalProperties: false + const: static + title: Type + default: static + static: + $ref: '#/components/schemas/VectorStoreChunkingStrategyStaticConfig' + type: object required: - - query - title: OpenaiSearchVectorStoreRequest - VectorStoreSearchResponse: + - static + title: VectorStoreChunkingStrategyStatic + description: 'Static chunking strategy with configurable parameters. + + + :param type: Strategy type, always "static" for static chunking + + :param static: Configuration parameters for the static chunking strategy' + VectorStoreChunkingStrategyStaticConfig: + properties: + chunk_overlap_tokens: + type: integer + title: Chunk Overlap Tokens + default: 400 + max_chunk_size_tokens: + type: integer + maximum: 4096.0 + minimum: 100.0 + title: Max Chunk Size Tokens + default: 800 type: object + title: VectorStoreChunkingStrategyStaticConfig + description: 'Configuration for static chunking strategy. + + + :param chunk_overlap_tokens: Number of tokens to overlap between adjacent + chunks + + :param max_chunk_size_tokens: Maximum number of tokens per chunk, must be + between 100 and 4096' + VectorStoreFileBatchObject: properties: - file_id: + id: type: string - description: >- - Unique identifier of the file containing the result - filename: + title: Id + object: type: string - description: Name of the file containing the result - score: - type: number - description: Relevance score for this search result - attributes: - type: object - additionalProperties: - oneOf: - - type: string - - type: number - - type: boolean - description: >- - (Optional) Key-value attributes associated with the file - content: - type: array - items: - $ref: '#/components/schemas/VectorStoreContent' - description: >- - List of content items matching the search query - additionalProperties: false + title: Object + default: vector_store.file_batch + created_at: + type: integer + title: Created At + vector_store_id: + type: string + title: Vector Store Id + status: + anyOf: + - type: string + const: completed + - type: string + const: in_progress + - type: string + const: cancelled + - type: string + const: failed + title: Status + file_counts: + $ref: '#/components/schemas/VectorStoreFileCounts' + type: object required: - - file_id - - filename - - score - - content - title: VectorStoreSearchResponse - description: Response from searching a vector store. - VectorStoreSearchResponsePage: + - id + - created_at + - vector_store_id + - status + - file_counts + title: VectorStoreFileBatchObject + description: 'OpenAI Vector Store File Batch object. + + + :param id: Unique identifier for the file batch + + :param object: Object type identifier, always "vector_store.file_batch" + + :param created_at: Timestamp when the file batch was created + + :param vector_store_id: ID of the vector store containing the file batch + + :param status: Current processing status of the file batch + + :param file_counts: File processing status counts for the batch' + VectorStoreFileCounts: + properties: + completed: + type: integer + title: Completed + cancelled: + type: integer + title: Cancelled + failed: + type: integer + title: Failed + in_progress: + type: integer + title: In Progress + total: + type: integer + title: Total type: object + required: + - completed + - cancelled + - failed + - in_progress + - total + title: VectorStoreFileCounts + description: 'File processing status counts for a vector store. + + + :param completed: Number of files that have been successfully processed + + :param cancelled: Number of files that had their processing cancelled + + :param failed: Number of files that failed to process + + :param in_progress: Number of files currently being processed + + :param total: Total number of files in the vector store' + VectorStoreObject: properties: - object: + id: type: string - default: vector_store.search_results.page - description: >- - Object type identifier for the search results page - search_query: + title: Id + object: type: string - description: >- - The original search query that was executed - data: - type: array - items: - $ref: '#/components/schemas/VectorStoreSearchResponse' - description: List of search result objects - has_more: - type: boolean - default: false - description: >- - Whether there are more results available beyond this page - next_page: + title: Object + default: vector_store + created_at: + type: integer + title: Created At + name: + anyOf: + - type: string + - type: 'null' + title: Name + usage_bytes: + type: integer + title: Usage Bytes + default: 0 + file_counts: + $ref: '#/components/schemas/VectorStoreFileCounts' + status: type: string - description: >- - (Optional) Token for retrieving the next page of results - additionalProperties: false + title: Status + default: completed + expires_after: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After + expires_at: + anyOf: + - type: integer + - type: 'null' + title: Expires At + last_active_at: + anyOf: + - type: integer + - type: 'null' + title: Last Active At + metadata: + additionalProperties: true + type: object + title: Metadata + type: object required: - - object - - search_query - - data - - has_more - title: VectorStoreSearchResponsePage - description: >- - Paginated response from searching a vector store. + - id + - created_at + - file_counts + title: VectorStoreObject + description: 'OpenAI Vector Store object. + + + :param id: Unique identifier for the vector store + + :param object: Object type identifier, always "vector_store" + + :param created_at: Timestamp when the vector store was created + + :param name: (Optional) Name of the vector store + + :param usage_bytes: Storage space used by the vector store in bytes + + :param file_counts: File processing status counts for the vector store + + :param status: Current status of the vector store + + :param expires_after: (Optional) Expiration policy for the vector store + + :param expires_at: (Optional) Timestamp when the vector store will expire + + :param last_active_at: (Optional) Timestamp of last activity on the vector + store + + :param metadata: Set of key-value pairs that can be attached to the vector + store' VersionInfo: - type: object properties: version: type: string - description: Version number of the service - additionalProperties: false + title: Version + type: object required: - - version + - version title: VersionInfo - description: Version information for the service. + description: 'Version information for the service. + + + :param version: Version number of the service' + WeightedRanker: + properties: + type: + type: string + const: weighted + title: Type + default: weighted + alpha: + type: number + maximum: 1.0 + minimum: 0.0 + title: Alpha + description: Weight factor between 0 and 1. 0 means only keyword scores, + 1 means only vector scores. + default: 0.5 + type: object + title: WeightedRanker + description: "Weighted ranker configuration that combines vector and keyword\ + \ scores.\n\n:param type: The type of ranker, always \"weighted\"\n:param\ + \ alpha: Weight factor between 0 and 1.\n 0 means only use keyword\ + \ scores,\n 1 means only use vector scores,\n values\ + \ in between blend both scores." + Error: + description: 'Error response from the API. Roughly follows RFC 7807. + + + :param status: HTTP status code + + :param title: Error title, a short summary of the error which is invariant + for an error type + + :param detail: Error detail, a longer human-readable description of the error + + :param instance: (Optional) A URL which can be used to retrieve more information + about the specific occurrence of the error' + properties: + status: + title: Status + type: integer + title: + title: Title + type: string + detail: + title: Detail + type: string + instance: + anyOf: + - type: string + - type: 'null' + default: null + title: Instance + required: + - status + - title + - detail + title: Error + type: object responses: BadRequest400: description: The request was invalid or malformed @@ -10288,8 +12701,7 @@ components: title: Bad Request detail: The request was invalid or malformed TooManyRequests429: - description: >- - The client has sent too many requests in a given amount of time + description: The client has sent too many requests in a given amount of time content: application/json: schema: @@ -10297,11 +12709,9 @@ components: example: status: 429 title: Too Many Requests - detail: >- - You have exceeded the rate limit. Please try again later. + detail: You have exceeded the rate limit. Please try again later. InternalServerError500: - description: >- - The server encountered an unexpected error + description: The server encountered an unexpected error content: application/json: schema: @@ -10309,10 +12719,9 @@ components: example: status: 500 title: Internal Server Error - detail: >- - An unexpected error occurred. Our team has been notified. + detail: An unexpected error occurred DefaultError: - description: An unexpected error occurred + description: An error occurred content: application/json: schema: diff --git a/docs/static/stainless-llama-stack-spec.yaml b/docs/static/stainless-llama-stack-spec.yaml index f6699aef24..496fdbdf63 100644 --- a/docs/static/stainless-llama-stack-spec.yaml +++ b/docs/static/stainless-llama-stack-spec.yaml @@ -172,36 +172,44 @@ paths: tags: - Inference summary: List chat completions. - description: List chat completions. + description: >- + List chat completions. + + :param after: The ID of the last chat completion to return. + :param limit: The maximum number of chat completions to return. + :param model: The model to filter by. + :param order: The order to sort the chat completions by: "asc" or + "desc". Defaults to "desc". + :returns: A ListOpenAIChatCompletionResponse. parameters: - name: after - in: query description: >- The ID of the last chat completion to return. required: false schema: type: string - - name: limit in: query + - name: limit description: >- The maximum number of chat completions to return. required: false schema: type: integer - - name: model in: query + - name: model description: The model to filter by. required: false schema: type: string - - name: order in: query + - name: order description: >- The order to sort the chat completions by: "asc" or "desc". Defaults to "desc". required: false schema: $ref: '#/components/schemas/Order' + in: query deprecated: false post: responses: @@ -210,9 +218,8 @@ paths: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletion' - - $ref: '#/components/schemas/OpenAIChatCompletionChunk' + $ref: '#/components/schemas/llama_stack.apis.inference.inference.OpenAIChatCompletion + | collections.abc.AsyncIterator[llama_stack.apis.inference.inference.OpenAIChatCompletionChunk]' '400': $ref: '#/components/responses/BadRequest400' '429': @@ -231,12 +238,13 @@ paths: Generate an OpenAI-compatible chat completion for the given messages using the specified model. + :returns: An OpenAIChatCompletion. parameters: [] requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenAIChatCompletionRequestWithExtraBody' + id: Annotated required: true deprecated: false /v1/chat/completions/{completion_id}: @@ -265,13 +273,16 @@ paths: Get chat completion. Describe a chat completion by its ID. + + :param completion_id: ID of the chat completion. + :returns: A OpenAICompletionWithInputMessages. parameters: - name: completion_id - in: path description: ID of the chat completion. required: true schema: type: string + in: path deprecated: false /v1/completions: post: @@ -300,12 +311,13 @@ paths: Generate an OpenAI-compatible completion for the given prompt using the specified model. + :returns: An OpenAICompletion. parameters: [] requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenAICompletionRequestWithExtraBody' + id: Annotated required: true deprecated: false /v1/conversations: @@ -334,6 +346,11 @@ paths: Create a conversation. Create a conversation. + + :param items: Initial items to include in the conversation context. + :param metadata: Set of key-value pairs that can be attached to an + object. + :returns: The created conversation object. parameters: [] requestBody: content: @@ -368,13 +385,16 @@ paths: Retrieve a conversation. Get a conversation with the given ID. + + :param conversation_id: The conversation identifier. + :returns: The conversation object. parameters: - name: conversation_id - in: path description: The conversation identifier. required: true schema: type: string + in: path deprecated: false post: responses: @@ -401,13 +421,18 @@ paths: Update a conversation. Update a conversation's metadata with the given ID. + + :param conversation_id: The conversation identifier. + :param metadata: Set of key-value pairs that can be attached to an + object. + :returns: The updated conversation object. parameters: - name: conversation_id - in: path description: The conversation identifier. required: true schema: type: string + in: path requestBody: content: application/json: @@ -440,13 +465,16 @@ paths: Delete a conversation. Delete a conversation with the given ID. + + :param conversation_id: The conversation identifier. + :returns: The deleted conversation resource. parameters: - name: conversation_id - in: path description: The conversation identifier. required: true schema: type: string + in: path deprecated: false /v1/conversations/{conversation_id}/items: get: @@ -474,57 +502,49 @@ paths: List items. List items in the conversation. + + :param conversation_id: The conversation identifier. + :param after: An item ID to list items after, used in pagination. + :param include: Specify additional output data to include in the response. + :param limit: A limit on the number of objects to be returned (1-100, + default 20). + :param order: The order to return items in (asc or desc, default desc). + :returns: List of conversation items. parameters: - name: conversation_id - in: path description: The conversation identifier. required: true schema: type: string + in: path - name: after - in: query description: >- An item ID to list items after, used in pagination. required: false schema: type: string - - name: include in: query + - name: include description: >- Specify additional output data to include in the response. required: false schema: - type: array - items: - type: string - enum: - - web_search_call.action.sources - - code_interpreter_call.outputs - - computer_call_output.output.image_url - - file_search_call.results - - message.input_image.image_url - - message.output_text.logprobs - - reasoning.encrypted_content - title: ConversationItemInclude - description: >- - Specify additional output data to include in the model response. - - name: limit + $ref: '#/components/schemas/list' in: query + - name: limit description: >- A limit on the number of objects to be returned (1-100, default 20). required: false schema: type: integer - - name: order in: query + - name: order description: >- The order to return items in (asc or desc, default desc). required: false schema: - type: string - enum: - - asc - - desc + $ref: '#/components/schemas/Literal' + in: query deprecated: false post: responses: @@ -551,13 +571,17 @@ paths: Create items. Create items in the conversation. + + :param conversation_id: The conversation identifier. + :param items: Items to include in the conversation context. + :returns: List of created items. parameters: - name: conversation_id - in: path description: The conversation identifier. required: true schema: type: string + in: path requestBody: content: application/json: @@ -573,7 +597,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ConversationItem' + id: Annotated '400': $ref: '#/components/responses/BadRequest400' '429': @@ -591,19 +615,23 @@ paths: Retrieve an item. Retrieve a conversation item. + + :param conversation_id: The conversation identifier. + :param item_id: The item identifier. + :returns: The conversation item. parameters: - name: conversation_id - in: path description: The conversation identifier. required: true schema: type: string - - name: item_id in: path + - name: item_id description: The item identifier. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -630,19 +658,23 @@ paths: Delete an item. Delete a conversation item. + + :param conversation_id: The conversation identifier. + :param item_id: The item identifier. + :returns: The deleted item resource. parameters: - name: conversation_id - in: path description: The conversation identifier. required: true schema: type: string - - name: item_id in: path + - name: item_id description: The item identifier. required: true schema: type: string + in: path deprecated: false /v1/embeddings: post: @@ -672,12 +704,13 @@ paths: Generate OpenAI-compatible embeddings for the given input using the specified model. + :returns: An OpenAIEmbeddingsResponse containing the embeddings. parameters: [] requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody' + id: Annotated required: true deprecated: false /v1/files: @@ -707,9 +740,19 @@ paths: List files. Returns a list of files that belong to the user's organization. + + :param after: A cursor for use in pagination. `after` is an object + ID that defines your place in the list. For instance, if you make a list request + and receive 100 objects, ending with obj_foo, your subsequent call can include + after=obj_foo in order to fetch the next page of the list. + :param limit: A limit on the number of objects to be returned. Limit + can range between 1 and 10,000, and the default is 10,000. + :param order: Sort order by the `created_at` timestamp of the objects. + `asc` for ascending order and `desc` for descending order. + :param purpose: Only return files with the given purpose. + :returns: An ListOpenAIFileResponse containing the list of files. parameters: - name: after - in: query description: >- A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive @@ -718,29 +761,30 @@ paths: required: false schema: type: string - - name: limit in: query + - name: limit description: >- A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000. required: false schema: type: integer - - name: order in: query + - name: order description: >- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. required: false schema: $ref: '#/components/schemas/Order' - - name: purpose in: query + - name: purpose description: >- Only return files with the given purpose. required: false schema: $ref: '#/components/schemas/OpenAIFilePurpose' + in: query deprecated: false post: responses: @@ -769,14 +813,19 @@ paths: Upload a file that can be used across various endpoints. + The file upload should be a multipart form request with: + - file: The File object (not file name) to be uploaded. + - purpose: The intended purpose of the uploaded file. + - expires_after: Optional form values describing expiration for the + file. - The file upload should be a multipart form request with: - - - file: The File object (not file name) to be uploaded. - - - purpose: The intended purpose of the uploaded file. - - - expires_after: Optional form values describing expiration for the file. + :param file: The uploaded file object containing content and metadata + (filename, content_type, etc.). + :param purpose: The intended purpose of the uploaded file (e.g., "assistants", + "fine-tune"). + :param expires_after: Optional form values describing expiration for + the file. + :returns: An OpenAIFileObject representing the uploaded file. parameters: [] requestBody: content: @@ -823,14 +872,17 @@ paths: Retrieve file. Returns information about a specific file. + + :param file_id: The ID of the file to use for this request. + :returns: An OpenAIFileObject containing file information. parameters: - name: file_id - in: path description: >- The ID of the file to use for this request. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -854,15 +906,19 @@ paths: tags: - Files summary: Delete file. - description: Delete file. + description: >- + Delete file. + + :param file_id: The ID of the file to use for this request. + :returns: An OpenAIFileDeleteResponse indicating successful deletion. parameters: - name: file_id - in: path description: >- The ID of the file to use for this request. required: true schema: type: string + in: path deprecated: false /v1/files/{file_id}/content: get: @@ -891,14 +947,17 @@ paths: Retrieve file content. Returns the contents of the specified file. + + :param file_id: The ID of the file to use for this request. + :returns: The raw file content as a binary response. parameters: - name: file_id - in: path description: >- The ID of the file to use for this request. required: true schema: type: string + in: path deprecated: false /v1/health: get: @@ -927,6 +986,8 @@ paths: Get health status. Get the current health status of the service. + + :returns: Health information indicating if the service is operational. parameters: [] deprecated: false /v1/inspect/routes: @@ -1023,6 +1084,13 @@ paths: Register model. Register a model. + + :param model_id: The identifier of the model to register. + :param provider_model_id: The identifier of the model in the provider. + :param provider_id: The identifier of the provider. + :param metadata: Any additional metadata for this model. + :param model_type: The type of model to register. + :returns: A Model. parameters: [] requestBody: content: @@ -1057,13 +1125,16 @@ paths: Get model. Get a model by its identifier. + + :param model_id: The identifier of the model to get. + :returns: A Model. parameters: - name: model_id - in: path description: The identifier of the model to get. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -1086,14 +1157,16 @@ paths: Unregister model. Unregister a model. + + :param model_id: The identifier of the model to unregister. parameters: - name: model_id - in: path description: >- The identifier of the model to unregister. required: true schema: type: string + in: path deprecated: false /v1/moderations: post: @@ -1121,6 +1194,12 @@ paths: Create moderation. Classifies if text and/or image inputs are potentially harmful. + :param input: Input (or inputs) to classify. + Can be a single string, an array of strings, or an array of multi-modal + input objects similar to other models. + :param model: (Optional) The content moderation model you would like + to use. + :returns: A moderation object. parameters: [] requestBody: content: @@ -1152,7 +1231,10 @@ paths: tags: - Prompts summary: List all prompts. - description: List all prompts. + description: >- + List all prompts. + + :returns: A ListPromptsResponse containing all prompts. parameters: [] deprecated: false post: @@ -1180,6 +1262,11 @@ paths: Create prompt. Create a new prompt. + + :param prompt: The prompt text content with variable placeholders. + :param variables: List of variable names that can be used in the prompt + template. + :returns: The created Prompt resource. parameters: [] requestBody: content: @@ -1214,20 +1301,24 @@ paths: Get prompt. Get a prompt by its identifier and optional version. + + :param prompt_id: The identifier of the prompt to get. + :param version: The version of the prompt to get (defaults to latest). + :returns: A Prompt resource. parameters: - name: prompt_id - in: path description: The identifier of the prompt to get. required: true schema: type: string + in: path - name: version - in: query description: >- The version of the prompt to get (defaults to latest). required: false schema: type: integer + in: query deprecated: false post: responses: @@ -1255,13 +1346,21 @@ paths: Update prompt. Update an existing prompt (increments version). + + :param prompt_id: The identifier of the prompt to update. + :param prompt: The updated prompt text content. + :param version: The current version of the prompt being updated. + :param variables: Updated list of variable names that can be used + in the prompt template. + :param set_as_default: Set the new version as the default (default=True). + :returns: The updated Prompt resource with incremented version. parameters: - name: prompt_id - in: path description: The identifier of the prompt to update. required: true schema: type: string + in: path requestBody: content: application/json: @@ -1290,13 +1389,15 @@ paths: Delete prompt. Delete a prompt. + + :param prompt_id: The identifier of the prompt to delete. parameters: - name: prompt_id - in: path description: The identifier of the prompt to delete. required: true schema: type: string + in: path deprecated: false /v1/prompts/{prompt_id}/set-default-version: post: @@ -1325,13 +1426,17 @@ paths: Set prompt version. Set which version of a prompt should be the default in get_prompt (latest). + + :param prompt_id: The identifier of the prompt. + :param version: The version to set as default. + :returns: The prompt with the specified version now set as default. parameters: - name: prompt_id - in: path description: The identifier of the prompt. required: true schema: type: string + in: path requestBody: content: application/json: @@ -1366,14 +1471,17 @@ paths: List prompt versions. List all versions of a specific prompt. + + :param prompt_id: The identifier of the prompt to list versions for. + :returns: A ListPromptsResponse containing all versions of the prompt. parameters: - name: prompt_id - in: path description: >- The identifier of the prompt to list versions for. required: true schema: type: string + in: path deprecated: false /v1/providers: get: @@ -1402,6 +1510,9 @@ paths: List providers. List all available providers. + + :returns: A ListProvidersResponse containing information about all + providers. parameters: [] deprecated: false /v1/providers/{provider_id}: @@ -1431,13 +1542,16 @@ paths: Get provider. Get detailed information about a specific provider. + + :param provider_id: The ID of the provider to inspect. + :returns: A ProviderInfo object containing the provider's details. parameters: - name: provider_id - in: path description: The ID of the provider to inspect. required: true schema: type: string + in: path deprecated: false /v1/responses: get: @@ -1461,33 +1575,41 @@ paths: tags: - Agents summary: List all responses. - description: List all responses. + description: >- + List all responses. + + :param after: The ID of the last response to return. + :param limit: The number of responses to return. + :param model: The model to filter responses by. + :param order: The order to sort responses by when sorted by created_at + ('asc' or 'desc'). + :returns: A ListOpenAIResponseObject. parameters: - name: after - in: query description: The ID of the last response to return. required: false schema: type: string - - name: limit in: query + - name: limit description: The number of responses to return. required: false schema: type: integer - - name: model in: query + - name: model description: The model to filter responses by. required: false schema: type: string - - name: order in: query + - name: order description: >- The order to sort responses by when sorted by created_at ('asc' or 'desc'). required: false schema: $ref: '#/components/schemas/Order' + in: query deprecated: false post: responses: @@ -1499,7 +1621,7 @@ paths: $ref: '#/components/schemas/OpenAIResponseObject' text/event-stream: schema: - $ref: '#/components/schemas/OpenAIResponseObjectStream' + $ref: '#/components/schemas/AsyncIterator' '400': $ref: '#/components/responses/BadRequest400' '429': @@ -1513,7 +1635,21 @@ paths: tags: - Agents summary: Create a model response. - description: Create a model response. + description: >- + Create a model response. + + :param input: Input message(s) to create the response. + :param model: The underlying LLM used for completions. + :param previous_response_id: (Optional) if specified, the new response + will be a continuation of the previous response. This can be used to easily + fork-off new responses from existing responses. + :param conversation: (Optional) The ID of a conversation to add the + response to. Must begin with 'conv_'. Input and output messages will be automatically + added to the conversation. + :param include: (Optional) Additional fields to include in the response. + :param guardrails: (Optional) List of guardrails to apply during response + generation. Can be guardrail IDs (strings) or guardrail specifications. + :returns: An OpenAIResponseObject. parameters: [] requestBody: content: @@ -1525,15 +1661,11 @@ paths: x-llama-stack-extra-body-params: - name: guardrails schema: - type: array - items: - oneOf: - - type: string - - $ref: '#/components/schemas/ResponseGuardrailSpec' + id: Annotated description: >- List of guardrails to apply during response generation. Guardrails provide safety and content moderation. - required: false + required: true /v1/responses/{response_id}: get: responses: @@ -1556,15 +1688,19 @@ paths: tags: - Agents summary: Get a model response. - description: Get a model response. + description: >- + Get a model response. + + :param response_id: The ID of the OpenAI response to retrieve. + :returns: An OpenAIResponseObject. parameters: - name: response_id - in: path description: >- The ID of the OpenAI response to retrieve. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -1587,14 +1723,18 @@ paths: tags: - Agents summary: Delete a response. - description: Delete a response. + description: >- + Delete a response. + + :param response_id: The ID of the OpenAI response to delete. + :returns: An OpenAIDeleteResponseObject parameters: - name: response_id - in: path description: The ID of the OpenAI response to delete. required: true schema: type: string + in: path deprecated: false /v1/responses/{response_id}/input_items: get: @@ -1618,53 +1758,61 @@ paths: tags: - Agents summary: List input items. - description: List input items. + description: >- + List input items. + + :param response_id: The ID of the response to retrieve input items for. + :param after: An item ID to list items after, used for pagination. + :param before: An item ID to list items before, used for pagination. + :param include: Additional fields to include in the response. + :param limit: A limit on the number of objects to be returned. Limit + can range between 1 and 100, and the default is 20. + :param order: The order to return the input items in. Default is desc. + :returns: An ListOpenAIResponseInputItem. parameters: - name: response_id - in: path description: >- The ID of the response to retrieve input items for. required: true schema: type: string + in: path - name: after - in: query description: >- An item ID to list items after, used for pagination. required: false schema: type: string - - name: before in: query + - name: before description: >- An item ID to list items before, used for pagination. required: false schema: type: string - - name: include in: query + - name: include description: >- Additional fields to include in the response. required: false schema: - type: array - items: - type: string - - name: limit + $ref: '#/components/schemas/list' in: query + - name: limit description: >- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. required: false schema: type: integer - - name: order in: query + - name: order description: >- The order to return the input items in. Default is desc. required: false schema: $ref: '#/components/schemas/Order' + in: query deprecated: false /v1/safety/run-shield: post: @@ -1692,6 +1840,11 @@ paths: Run shield. Run a shield. + + :param shield_id: The identifier of the shield to run. + :param messages: The messages to run the shield on. + :param params: The parameters of the shield. + :returns: A RunShieldResponse. parameters: [] requestBody: content: @@ -1722,7 +1875,10 @@ paths: tags: - ScoringFunctions summary: List all scoring functions. - description: List all scoring functions. + description: >- + List all scoring functions. + + :returns: A ListScoringFunctionsResponse. parameters: [] deprecated: false post: @@ -1742,7 +1898,18 @@ paths: tags: - ScoringFunctions summary: Register a scoring function. - description: Register a scoring function. + description: >- + Register a scoring function. + + :param scoring_fn_id: The ID of the scoring function to register. + :param description: The description of the scoring function. + :param return_type: The return type of the scoring function. + :param provider_scoring_fn_id: The ID of the provider scoring function + to use for the scoring function. + :param provider_id: The ID of the provider to use for the scoring + function. + :param params: The parameters for the scoring function for benchmark + eval, these can be overridden for app eval. parameters: [] requestBody: content: @@ -1773,14 +1940,18 @@ paths: tags: - ScoringFunctions summary: Get a scoring function by its ID. - description: Get a scoring function by its ID. + description: >- + Get a scoring function by its ID. + + :param scoring_fn_id: The ID of the scoring function to get. + :returns: A ScoringFn. parameters: - name: scoring_fn_id - in: path description: The ID of the scoring function to get. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -1799,15 +1970,18 @@ paths: tags: - ScoringFunctions summary: Unregister a scoring function. - description: Unregister a scoring function. + description: >- + Unregister a scoring function. + + :param scoring_fn_id: The ID of the scoring function to unregister. parameters: - name: scoring_fn_id - in: path description: >- The ID of the scoring function to unregister. required: true schema: type: string + in: path deprecated: false /v1/scoring/score: post: @@ -1832,7 +2006,12 @@ paths: tags: - Scoring summary: Score a list of rows. - description: Score a list of rows. + description: >- + Score a list of rows. + + :param input_rows: The rows to score. + :param scoring_functions: The scoring functions to use for the scoring. + :returns: A ScoreResponse object containing rows and aggregated results. parameters: [] requestBody: content: @@ -1863,7 +2042,13 @@ paths: tags: - Scoring summary: Score a batch of rows. - description: Score a batch of rows. + description: >- + Score a batch of rows. + + :param dataset_id: The ID of the dataset to score. + :param scoring_functions: The scoring functions to use for the scoring. + :param save_results_dataset: Whether to save the results to a dataset. + :returns: A ScoreBatchResponse. parameters: [] requestBody: content: @@ -1894,7 +2079,10 @@ paths: tags: - Shields summary: List all shields. - description: List all shields. + description: >- + List all shields. + + :returns: A ListShieldsResponse. parameters: [] deprecated: false post: @@ -1918,7 +2106,14 @@ paths: tags: - Shields summary: Register a shield. - description: Register a shield. + description: >- + Register a shield. + + :param shield_id: The identifier of the shield to register. + :param provider_shield_id: The identifier of the shield in the provider. + :param provider_id: The identifier of the provider. + :param params: The parameters of the shield. + :returns: A Shield. parameters: [] requestBody: content: @@ -1949,14 +2144,18 @@ paths: tags: - Shields summary: Get a shield by its identifier. - description: Get a shield by its identifier. + description: >- + Get a shield by its identifier. + + :param identifier: The identifier of the shield to get. + :returns: A Shield. parameters: - name: identifier - in: path description: The identifier of the shield to get. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -1975,16 +2174,65 @@ paths: tags: - Shields summary: Unregister a shield. - description: Unregister a shield. + description: >- + Unregister a shield. + + :param identifier: The identifier of the shield to unregister. parameters: - name: identifier - in: path description: >- The identifier of the shield to unregister. required: true schema: type: string + in: path + deprecated: false +<<<<<<< HEAD +======= + /v1/synthetic-data-generation/generate: + post: + responses: + '200': + description: >- + Response containing filtered synthetic data samples and optional statistics + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticDataGenerationResponse' + '400': + $ref: '#/components/responses/BadRequest400' + '429': + $ref: >- + #/components/responses/TooManyRequests429 + '500': + $ref: >- + #/components/responses/InternalServerError500 + default: + $ref: '#/components/responses/DefaultError' + tags: + - SyntheticDataGeneration (Coming Soon) + summary: >- + Generate synthetic data based on input dialogs and apply filtering. + description: >- + Generate synthetic data based on input dialogs and apply filtering. + + :param dialogs: List of conversation messages to use as input for synthetic + data generation + :param filtering_function: Type of filtering to apply to generated + synthetic data samples + :param model: (Optional) The identifier of the model to use. The model + must be registered with Llama Stack and available via the /models endpoint + :returns: Response containing filtered synthetic data samples and + optional statistics + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticDataGenerateRequest' + required: true deprecated: false +>>>>>>> 0e623067d (chore: use Pydantic to generate OpenAPI schema) /v1/tool-runtime/invoke: post: responses: @@ -2007,7 +2255,12 @@ paths: tags: - ToolRuntime summary: Run a tool with the given arguments. - description: Run a tool with the given arguments. + description: >- + Run a tool with the given arguments. + + :param tool_name: The name of the tool to invoke. + :param kwargs: A dictionary of arguments to pass to the tool. + :returns: A ToolInvocationResult. parameters: [] requestBody: content: @@ -2038,22 +2291,27 @@ paths: tags: - ToolRuntime summary: List all tools in the runtime. - description: List all tools in the runtime. + description: >- + List all tools in the runtime. + + :param tool_group_id: The ID of the tool group to list tools for. + :param mcp_endpoint: The MCP endpoint to use for the tool group. + :returns: A ListToolDefsResponse. parameters: - name: tool_group_id - in: query description: >- The ID of the tool group to list tools for. required: false schema: type: string - - name: mcp_endpoint in: query + - name: mcp_endpoint description: >- The MCP endpoint to use for the tool group. required: false schema: $ref: '#/components/schemas/URL' + in: query deprecated: false /v1/tool-runtime/rag-tool/insert: post: @@ -2076,6 +2334,12 @@ paths: Index documents so they can be used by the RAG system. description: >- Index documents so they can be used by the RAG system. + + :param documents: List of documents to index in the RAG system + :param vector_store_id: ID of the vector database to store the document + embeddings + :param chunk_size_in_tokens: (Optional) Size in tokens for document + chunking during indexing parameters: [] requestBody: content: @@ -2110,6 +2374,12 @@ paths: Query the RAG system for context; typically invoked by the agent. description: >- Query the RAG system for context; typically invoked by the agent. + + :param content: The query content to search for in the indexed documents + :param vector_store_ids: List of vector database IDs to search within + :param query_config: (Optional) Configuration parameters for the query + operation + :returns: RAGQueryResult containing the retrieved content and metadata parameters: [] requestBody: content: @@ -2140,7 +2410,10 @@ paths: tags: - ToolGroups summary: List tool groups with optional provider. - description: List tool groups with optional provider. + description: >- + List tool groups with optional provider. + + :returns: A ListToolGroupsResponse. parameters: [] deprecated: false post: @@ -2160,7 +2433,13 @@ paths: tags: - ToolGroups summary: Register a tool group. - description: Register a tool group. + description: >- + Register a tool group. + + :param toolgroup_id: The ID of the tool group to register. + :param provider_id: The ID of the provider to use for the tool group. + :param mcp_endpoint: The MCP endpoint to use for the tool group. + :param args: A dictionary of arguments to pass to the tool group. parameters: [] requestBody: content: @@ -2191,14 +2470,18 @@ paths: tags: - ToolGroups summary: Get a tool group by its ID. - description: Get a tool group by its ID. + description: >- + Get a tool group by its ID. + + :param toolgroup_id: The ID of the tool group to get. + :returns: A ToolGroup. parameters: - name: toolgroup_id - in: path description: The ID of the tool group to get. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -2217,14 +2500,17 @@ paths: tags: - ToolGroups summary: Unregister a tool group. - description: Unregister a tool group. + description: >- + Unregister a tool group. + + :param toolgroup_id: The ID of the tool group to unregister. parameters: - name: toolgroup_id - in: path description: The ID of the tool group to unregister. required: true schema: type: string + in: path deprecated: false /v1/tools: get: @@ -2248,15 +2534,19 @@ paths: tags: - ToolGroups summary: List tools with optional tool group. - description: List tools with optional tool group. + description: >- + List tools with optional tool group. + + :param toolgroup_id: The ID of the tool group to list tools for. + :returns: A ListToolDefsResponse. parameters: - name: toolgroup_id - in: query description: >- The ID of the tool group to list tools for. required: false schema: type: string + in: query deprecated: false /v1/tools/{tool_name}: get: @@ -2280,14 +2570,18 @@ paths: tags: - ToolGroups summary: Get a tool by its name. - description: Get a tool by its name. + description: >- + Get a tool by its name. + + :param tool_name: The name of the tool to get. + :returns: A ToolDef. parameters: - name: tool_name - in: path description: The name of the tool to get. required: true schema: type: string + in: path deprecated: false /v1/vector-io/insert: post: @@ -2307,7 +2601,19 @@ paths: tags: - VectorIO summary: Insert chunks into a vector database. - description: Insert chunks into a vector database. + description: >- + Insert chunks into a vector database. + + :param vector_store_id: The identifier of the vector database to insert the + chunks into. + :param chunks: The chunks to insert. Each `Chunk` should contain content + which can be interleaved text, images, or other types. + `metadata`: `dict[str, Any]` and `embedding`: `List[float]` are + optional. + If `metadata` is provided, you configure how Llama Stack formats + the chunk during generation. + If `embedding` is not provided, it will be computed later. + :param ttl_seconds: The time to live of the chunks. parameters: [] requestBody: content: @@ -2338,7 +2644,13 @@ paths: tags: - VectorIO summary: Query chunks from a vector database. - description: Query chunks from a vector database. + description: >- + Query chunks from a vector database. + + :param vector_store_id: The identifier of the vector database to query. + :param query: The query to search for. + :param params: The parameters of the query. + :returns: A QueryChunksResponse. parameters: [] requestBody: content: @@ -2370,40 +2682,52 @@ paths: tags: - VectorIO summary: Returns a list of vector stores. - description: Returns a list of vector stores. + description: >- + Returns a list of vector stores. + + :param limit: A limit on the number of objects to be returned. Limit can range + between 1 and 100, and the default is 20. + :param order: Sort order by the `created_at` timestamp of the objects. + `asc` for ascending order and `desc` for descending order. + :param after: A cursor for use in pagination. `after` is an object + ID that defines your place in the list. + :param before: A cursor for use in pagination. `before` is an object + ID that defines your place in the list. + :returns: A VectorStoreListResponse containing the list of vector + stores. parameters: - name: limit - in: query description: >- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. required: false schema: type: integer - - name: order in: query + - name: order description: >- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. required: false schema: type: string - - name: after in: query + - name: after description: >- A cursor for use in pagination. `after` is an object ID that defines your place in the list. required: false schema: type: string - - name: before in: query + - name: before description: >- A cursor for use in pagination. `before` is an object ID that defines your place in the list. required: false schema: type: string + in: query deprecated: false post: responses: @@ -2431,12 +2755,13 @@ paths: Creates a vector store. Generate an OpenAI-compatible vector store with the given parameters. + :returns: A VectorStoreObject representing the created vector store. parameters: [] requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody' + id: Annotated required: true deprecated: false /v1/vector_stores/{vector_store_id}: @@ -2462,14 +2787,18 @@ paths: tags: - VectorIO summary: Retrieves a vector store. - description: Retrieves a vector store. + description: >- + Retrieves a vector store. + + :param vector_store_id: The ID of the vector store to retrieve. + :returns: A VectorStoreObject representing the vector store. parameters: - name: vector_store_id - in: path description: The ID of the vector store to retrieve. required: true schema: type: string + in: path deprecated: false post: responses: @@ -2493,14 +2822,22 @@ paths: tags: - VectorIO summary: Updates a vector store. - description: Updates a vector store. + description: >- + Updates a vector store. + + :param vector_store_id: The ID of the vector store to update. + :param name: The name of the vector store. + :param expires_after: The expiration policy for a vector store. + :param metadata: Set of 16 key-value pairs that can be attached to + an object. + :returns: A VectorStoreObject representing the updated vector store. parameters: - name: vector_store_id - in: path description: The ID of the vector store to update. required: true schema: type: string + in: path requestBody: content: application/json: @@ -2530,14 +2867,18 @@ paths: tags: - VectorIO summary: Delete a vector store. - description: Delete a vector store. + description: >- + Delete a vector store. + + :param vector_store_id: The ID of the vector store to delete. + :returns: A VectorStoreDeleteResponse indicating the deletion status. parameters: - name: vector_store_id - in: path description: The ID of the vector store to delete. required: true schema: type: string + in: path deprecated: false /v1/vector_stores/{vector_store_id}/file_batches: post: @@ -2567,19 +2908,23 @@ paths: Generate an OpenAI-compatible vector store file batch for the given vector store. + :param vector_store_id: The ID of the vector store to create the file + batch for. + :returns: A VectorStoreFileBatchObject representing the created file + batch. parameters: - name: vector_store_id - in: path description: >- The ID of the vector store to create the file batch for. required: true schema: type: string + in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody' + id: Annotated required: true deprecated: false /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: @@ -2605,21 +2950,27 @@ paths: tags: - VectorIO summary: Retrieve a vector store file batch. - description: Retrieve a vector store file batch. + description: >- + Retrieve a vector store file batch. + + :param batch_id: The ID of the file batch to retrieve. + :param vector_store_id: The ID of the vector store containing the + file batch. + :returns: A VectorStoreFileBatchObject representing the file batch. parameters: - name: batch_id - in: path description: The ID of the file batch to retrieve. required: true schema: type: string - - name: vector_store_id in: path + - name: vector_store_id description: >- The ID of the vector store containing the file batch. required: true schema: type: string + in: path deprecated: false /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: post: @@ -2644,21 +2995,28 @@ paths: tags: - VectorIO summary: Cancels a vector store file batch. - description: Cancels a vector store file batch. + description: >- + Cancels a vector store file batch. + + :param batch_id: The ID of the file batch to cancel. + :param vector_store_id: The ID of the vector store containing the + file batch. + :returns: A VectorStoreFileBatchObject representing the cancelled + file batch. parameters: - name: batch_id - in: path description: The ID of the file batch to cancel. required: true schema: type: string - - name: vector_store_id in: path + - name: vector_store_id description: >- The ID of the vector store containing the file batch. required: true schema: type: string + in: path deprecated: false /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: get: @@ -2687,60 +3045,76 @@ paths: Returns a list of vector store files in a batch. description: >- Returns a list of vector store files in a batch. + + :param batch_id: The ID of the file batch to list files from. + :param vector_store_id: The ID of the vector store containing the + file batch. + :param after: A cursor for use in pagination. `after` is an object + ID that defines your place in the list. + :param before: A cursor for use in pagination. `before` is an object + ID that defines your place in the list. + :param filter: Filter by file status. One of in_progress, completed, + failed, cancelled. + :param limit: A limit on the number of objects to be returned. Limit + can range between 1 and 100, and the default is 20. + :param order: Sort order by the `created_at` timestamp of the objects. + `asc` for ascending order and `desc` for descending order. + :returns: A VectorStoreFilesListInBatchResponse containing the list + of files in the batch. parameters: - name: batch_id - in: path description: >- The ID of the file batch to list files from. required: true schema: type: string - - name: vector_store_id in: path + - name: vector_store_id description: >- The ID of the vector store containing the file batch. required: true schema: type: string + in: path - name: after - in: query description: >- A cursor for use in pagination. `after` is an object ID that defines your place in the list. required: false schema: type: string - - name: before in: query + - name: before description: >- A cursor for use in pagination. `before` is an object ID that defines your place in the list. required: false schema: type: string - - name: filter in: query + - name: filter description: >- Filter by file status. One of in_progress, completed, failed, cancelled. required: false schema: type: string - - name: limit in: query + - name: limit description: >- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. required: false schema: type: integer - - name: order in: query + - name: order description: >- Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. required: false schema: type: string + in: query deprecated: false /v1/vector_stores/{vector_store_id}/files: get: @@ -2765,55 +3139,69 @@ paths: tags: - VectorIO summary: List files in a vector store. - description: List files in a vector store. + description: >- + List files in a vector store. + + :param vector_store_id: The ID of the vector store to list files from. + :param limit: (Optional) A limit on the number of objects to be returned. + Limit can range between 1 and 100, and the default is 20. + :param order: (Optional) Sort order by the `created_at` timestamp + of the objects. `asc` for ascending order and `desc` for descending order. + :param after: (Optional) A cursor for use in pagination. `after` is + an object ID that defines your place in the list. + :param before: (Optional) A cursor for use in pagination. `before` + is an object ID that defines your place in the list. + :param filter: (Optional) Filter by file status to only return files + with the specified status. + :returns: A VectorStoreListFilesResponse containing the list of files. parameters: - name: vector_store_id - in: path description: >- The ID of the vector store to list files from. required: true schema: type: string + in: path - name: limit - in: query description: >- (Optional) A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. required: false schema: type: integer - - name: order in: query + - name: order description: >- (Optional) Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. required: false schema: type: string - - name: after in: query + - name: after description: >- (Optional) A cursor for use in pagination. `after` is an object ID that defines your place in the list. required: false schema: type: string - - name: before in: query + - name: before description: >- (Optional) A cursor for use in pagination. `before` is an object ID that defines your place in the list. required: false schema: type: string - - name: filter in: query + - name: filter description: >- (Optional) Filter by file status to only return files with the specified status. required: false schema: - $ref: '#/components/schemas/VectorStoreFileStatus' + id: Union + in: query deprecated: false post: responses: @@ -2837,15 +3225,23 @@ paths: tags: - VectorIO summary: Attach a file to a vector store. - description: Attach a file to a vector store. + description: >- + Attach a file to a vector store. + + :param vector_store_id: The ID of the vector store to attach the file to. + :param file_id: The ID of the file to attach to the vector store. + :param attributes: The key-value attributes stored with the file, + which can be used for filtering. + :param chunking_strategy: The chunking strategy to use for the file. + :returns: A VectorStoreFileObject representing the attached file. parameters: - name: vector_store_id - in: path description: >- The ID of the vector store to attach the file to. required: true schema: type: string + in: path requestBody: content: application/json: @@ -2876,21 +3272,27 @@ paths: tags: - VectorIO summary: Retrieves a vector store file. - description: Retrieves a vector store file. + description: >- + Retrieves a vector store file. + + :param vector_store_id: The ID of the vector store containing the file to + retrieve. + :param file_id: The ID of the file to retrieve. + :returns: A VectorStoreFileObject representing the file. parameters: - name: vector_store_id - in: path description: >- The ID of the vector store containing the file to retrieve. required: true schema: type: string - - name: file_id in: path + - name: file_id description: The ID of the file to retrieve. required: true schema: type: string + in: path deprecated: false post: responses: @@ -2914,21 +3316,29 @@ paths: tags: - VectorIO summary: Updates a vector store file. - description: Updates a vector store file. + description: >- + Updates a vector store file. + + :param vector_store_id: The ID of the vector store containing the file to + update. + :param file_id: The ID of the file to update. + :param attributes: The updated key-value attributes to store with + the file. + :returns: A VectorStoreFileObject representing the updated file. parameters: - name: vector_store_id - in: path description: >- The ID of the vector store containing the file to update. required: true schema: type: string - - name: file_id in: path + - name: file_id description: The ID of the file to update. required: true schema: type: string + in: path requestBody: content: application/json: @@ -2958,21 +3368,28 @@ paths: tags: - VectorIO summary: Delete a vector store file. - description: Delete a vector store file. + description: >- + Delete a vector store file. + + :param vector_store_id: The ID of the vector store containing the file to + delete. + :param file_id: The ID of the file to delete. + :returns: A VectorStoreFileDeleteResponse indicating the deletion + status. parameters: - name: vector_store_id - in: path description: >- The ID of the vector store containing the file to delete. required: true schema: type: string - - name: file_id in: path + - name: file_id description: The ID of the file to delete. required: true schema: type: string + in: path deprecated: false /v1/vector_stores/{vector_store_id}/files/{file_id}/content: get: @@ -3000,20 +3417,25 @@ paths: Retrieves the contents of a vector store file. description: >- Retrieves the contents of a vector store file. + + :param vector_store_id: The ID of the vector store containing the file to + retrieve. + :param file_id: The ID of the file to retrieve. + :returns: A list of InterleavedContent representing the file contents. parameters: - name: vector_store_id - in: path description: >- The ID of the vector store containing the file to retrieve. required: true schema: type: string - - name: file_id in: path + - name: file_id description: The ID of the file to retrieve. required: true schema: type: string + in: path deprecated: false /v1/vector_stores/{vector_store_id}/search: post: @@ -3043,13 +3465,27 @@ paths: Searches a vector store for relevant chunks based on a query and optional file attribute filters. + + :param vector_store_id: The ID of the vector store to search. + :param query: The query string or array for performing the search. + :param filters: Filters based on file attributes to narrow the search + results. + :param max_num_results: Maximum number of results to return (1 to + 50 inclusive, default 10). + :param ranking_options: Ranking options for fine-tuning the search + results. + :param rewrite_query: Whether to rewrite the natural language query + for vector search (default false) + :param search_mode: The search mode to use - "keyword", "vector", + or "hybrid" (default "vector") + :returns: A VectorStoreSearchResponse containing the search results. parameters: - name: vector_store_id - in: path description: The ID of the vector store to search. required: true schema: type: string + in: path requestBody: content: application/json: @@ -3084,6 +3520,8 @@ paths: Get version. Get the version of the service. + + :returns: Version information containing the service version number. parameters: [] deprecated: false /v1beta/datasetio/append-rows/{dataset_id}: @@ -3104,15 +3542,19 @@ paths: tags: - DatasetIO summary: Append rows to a dataset. - description: Append rows to a dataset. + description: >- + Append rows to a dataset. + + :param dataset_id: The ID of the dataset to append the rows to. + :param rows: The rows to append to the dataset. parameters: - name: dataset_id - in: path description: >- The ID of the dataset to append the rows to. required: true schema: type: string + in: path requestBody: content: application/json: @@ -3147,38 +3589,40 @@ paths: Get a paginated list of rows from a dataset. Uses offset-based pagination where: + - start_index: The starting index (0-based). If None, starts from + beginning. + - limit: Number of items to return. If None or -1, returns all items. - - start_index: The starting index (0-based). If None, starts from beginning. - - - limit: Number of items to return. If None or -1, returns all items. + The response includes: + - data: List of items for the current page. + - has_more: Whether there are more items available after this set. - - The response includes: - - - data: List of items for the current page. - - - has_more: Whether there are more items available after this set. + :param dataset_id: The ID of the dataset to get the rows from. + :param start_index: Index into dataset for the first row to get. Get + all rows if None. + :param limit: The number of rows to get. + :returns: A PaginatedResponse. parameters: - name: dataset_id - in: path description: >- The ID of the dataset to get the rows from. required: true schema: type: string + in: path - name: start_index - in: query description: >- Index into dataset for the first row to get. Get all rows if None. required: false schema: type: integer - - name: limit in: query + - name: limit description: The number of rows to get. required: false schema: type: integer + in: query deprecated: false /v1beta/datasets: get: @@ -3202,7 +3646,10 @@ paths: tags: - Datasets summary: List all datasets. - description: List all datasets. + description: >- + List all datasets. + + :returns: A ListDatasetsResponse. parameters: [] deprecated: false post: @@ -3226,7 +3673,71 @@ paths: tags: - Datasets summary: Register a new dataset. - description: Register a new dataset. + description: >- + Register a new dataset. + + :param purpose: The purpose of the dataset. + One of: + - "post-training/messages": The dataset contains a messages column + with list of messages for post-training. + { + "messages": [ + {"role": "user", "content": "Hello, world!"}, + {"role": "assistant", "content": "Hello, world!"}, + ] + } + - "eval/question-answer": The dataset contains a question column + and an answer column for evaluation. + { + "question": "What is the capital of France?", + "answer": "Paris" + } + - "eval/messages-answer": The dataset contains a messages column + with list of messages and an answer column for evaluation. + { + "messages": [ + {"role": "user", "content": "Hello, my name is John + Doe."}, + {"role": "assistant", "content": "Hello, John Doe. + How can I help you today?"}, + {"role": "user", "content": "What's my name?"}, + ], + "answer": "John Doe" + } + :param source: The data source of the dataset. Ensure that the data + source schema is compatible with the purpose of the dataset. Examples: + - { + "type": "uri", + "uri": "https://mywebsite.com/mydata.jsonl" + } + - { + "type": "uri", + "uri": "lsfs://mydata.jsonl" + } + - { + "type": "uri", + "uri": "data:csv;base64,{base64_content}" + } + - { + "type": "uri", + "uri": "huggingface://llamastack/simpleqa?split=train" + } + - { + "type": "rows", + "rows": [ + { + "messages": [ + {"role": "user", "content": "Hello, world!"}, + {"role": "assistant", "content": "Hello, world!"}, + ] + } + ] + } + :param metadata: The metadata for the dataset. + - E.g. {"description": "My dataset"}. + :param dataset_id: The ID of the dataset. If not provided, an ID will + be generated. + :returns: A Dataset. parameters: [] requestBody: content: @@ -3257,14 +3768,18 @@ paths: tags: - Datasets summary: Get a dataset by its ID. - description: Get a dataset by its ID. + description: >- + Get a dataset by its ID. + + :param dataset_id: The ID of the dataset to get. + :returns: A Dataset. parameters: - name: dataset_id - in: path description: The ID of the dataset to get. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -3283,14 +3798,17 @@ paths: tags: - Datasets summary: Unregister a dataset by its ID. - description: Unregister a dataset by its ID. + description: >- + Unregister a dataset by its ID. + + :param dataset_id: The ID of the dataset to unregister. parameters: - name: dataset_id - in: path description: The ID of the dataset to unregister. required: true schema: type: string + in: path deprecated: false /v1alpha/agents: get: @@ -3314,20 +3832,25 @@ paths: tags: - Agents summary: List all agents. - description: List all agents. + description: >- + List all agents. + + :param start_index: The index to start the pagination from. + :param limit: The number of agents to return. + :returns: A PaginatedResponse. parameters: - name: start_index - in: query description: The index to start the pagination from. required: false schema: type: integer - - name: limit in: query + - name: limit description: The number of agents to return. required: false schema: type: integer + in: query deprecated: false post: responses: @@ -3354,6 +3877,9 @@ paths: Create an agent with the given configuration. description: >- Create an agent with the given configuration. + + :param agent_config: The configuration for the agent. + :returns: An AgentCreateResponse with the agent ID. parameters: [] requestBody: content: @@ -3384,14 +3910,18 @@ paths: tags: - Agents summary: Describe an agent by its ID. - description: Describe an agent by its ID. + description: >- + Describe an agent by its ID. + + :param agent_id: ID of the agent. + :returns: An Agent of the agent. parameters: - name: agent_id - in: path description: ID of the agent. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -3413,13 +3943,15 @@ paths: Delete an agent by its ID and its associated sessions and turns. description: >- Delete an agent by its ID and its associated sessions and turns. + + :param agent_id: The ID of the agent to delete. parameters: - name: agent_id - in: path description: The ID of the agent to delete. required: true schema: type: string + in: path deprecated: false /v1alpha/agents/{agent_id}/session: post: @@ -3443,15 +3975,20 @@ paths: tags: - Agents summary: Create a new session for an agent. - description: Create a new session for an agent. + description: >- + Create a new session for an agent. + + :param agent_id: The ID of the agent to create the session for. + :param session_name: The name of the session to create. + :returns: An AgentSessionCreateResponse. parameters: - name: agent_id - in: path description: >- The ID of the agent to create the session for. required: true schema: type: string + in: path requestBody: content: application/json: @@ -3481,30 +4018,35 @@ paths: tags: - Agents summary: Retrieve an agent session by its ID. - description: Retrieve an agent session by its ID. + description: >- + Retrieve an agent session by its ID. + + :param session_id: The ID of the session to get. + :param agent_id: The ID of the agent to get the session for. + :param turn_ids: (Optional) List of turn IDs to filter the session + by. + :returns: A Session. parameters: - name: session_id - in: path description: The ID of the session to get. required: true schema: type: string - - name: agent_id in: path + - name: agent_id description: >- The ID of the agent to get the session for. required: true schema: type: string + in: path - name: turn_ids - in: query description: >- (Optional) List of turn IDs to filter the session by. required: false schema: - type: array - items: - type: string + $ref: '#/components/schemas/list' + in: query deprecated: false delete: responses: @@ -3526,35 +4068,36 @@ paths: Delete an agent session by its ID and its associated turns. description: >- Delete an agent session by its ID and its associated turns. + + :param session_id: The ID of the session to delete. + :param agent_id: The ID of the agent to delete the session for. parameters: - name: session_id - in: path description: The ID of the session to delete. required: true schema: type: string - - name: agent_id in: path + - name: agent_id description: >- The ID of the agent to delete the session for. required: true schema: type: string + in: path deprecated: false /v1alpha/agents/{agent_id}/session/{session_id}/turn: post: responses: '200': - description: >- - If stream=False, returns a Turn object. If stream=True, returns an SSE - event stream of AgentTurnResponseStreamChunk. + description: If stream=False, returns a Turn object. content: application/json: schema: $ref: '#/components/schemas/Turn' text/event-stream: schema: - $ref: '#/components/schemas/AgentTurnResponseStreamChunk' + $ref: '#/components/schemas/AsyncIterator' '400': $ref: '#/components/responses/BadRequest400' '429': @@ -3568,22 +4111,37 @@ paths: tags: - Agents summary: Create a new turn for an agent. - description: Create a new turn for an agent. + description: >- + Create a new turn for an agent. + + :param agent_id: The ID of the agent to create the turn for. + :param session_id: The ID of the session to create the turn for. + :param messages: List of messages to start the turn with. + :param stream: (Optional) If True, generate an SSE event stream of + the response. Defaults to False. + :param documents: (Optional) List of documents to create the turn + with. + :param toolgroups: (Optional) List of toolgroups to create the turn + with, will be used in addition to the agent's config toolgroups for the request. + :param tool_config: (Optional) The tool configuration to create the + turn with, will be used to override the agent's tool_config. + :returns: If stream=False, returns a Turn object. + If stream=True, returns an SSE event stream of AgentTurnResponseStreamChunk. parameters: - name: agent_id - in: path description: >- The ID of the agent to create the turn for. required: true schema: type: string - - name: session_id in: path + - name: session_id description: >- The ID of the session to create the turn for. required: true schema: type: string + in: path requestBody: content: application/json: @@ -3613,27 +4171,33 @@ paths: tags: - Agents summary: Retrieve an agent turn by its ID. - description: Retrieve an agent turn by its ID. + description: >- + Retrieve an agent turn by its ID. + + :param agent_id: The ID of the agent to get the turn for. + :param session_id: The ID of the session to get the turn for. + :param turn_id: The ID of the turn to get. + :returns: A Turn. parameters: - name: agent_id - in: path description: The ID of the agent to get the turn for. required: true schema: type: string - - name: session_id in: path + - name: session_id description: >- The ID of the session to get the turn for. required: true schema: type: string - - name: turn_id in: path + - name: turn_id description: The ID of the turn to get. required: true schema: type: string + in: path deprecated: false /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume: post: @@ -3648,7 +4212,7 @@ paths: $ref: '#/components/schemas/Turn' text/event-stream: schema: - $ref: '#/components/schemas/AgentTurnResponseStreamChunk' + $ref: '#/components/schemas/AsyncIterator' '400': $ref: '#/components/responses/BadRequest400' '429': @@ -3669,25 +4233,34 @@ paths: When a Turn has the status `awaiting_input` due to pending input from client side tool calls, this endpoint can be used to submit the outputs from the tool calls once they are ready. + + :param agent_id: The ID of the agent to resume. + :param session_id: The ID of the session to resume. + :param turn_id: The ID of the turn to resume. + :param tool_responses: The tool call responses to resume the turn + with. + :param stream: Whether to stream the response. + :returns: A Turn object if stream is False, otherwise an AsyncIterator + of AgentTurnResponseStreamChunk objects. parameters: - name: agent_id - in: path description: The ID of the agent to resume. required: true schema: type: string - - name: session_id in: path + - name: session_id description: The ID of the session to resume. required: true schema: type: string - - name: turn_id in: path + - name: turn_id description: The ID of the turn to resume. required: true schema: type: string + in: path requestBody: content: application/json: @@ -3717,33 +4290,40 @@ paths: tags: - Agents summary: Retrieve an agent step by its ID. - description: Retrieve an agent step by its ID. + description: >- + Retrieve an agent step by its ID. + + :param agent_id: The ID of the agent to get the step for. + :param session_id: The ID of the session to get the step for. + :param turn_id: The ID of the turn to get the step for. + :param step_id: The ID of the step to get. + :returns: An AgentStepResponse. parameters: - name: agent_id - in: path description: The ID of the agent to get the step for. required: true schema: type: string - - name: session_id in: path + - name: session_id description: >- The ID of the session to get the step for. required: true schema: type: string - - name: turn_id in: path + - name: turn_id description: The ID of the turn to get the step for. required: true schema: type: string - - name: step_id in: path + - name: step_id description: The ID of the step to get. required: true schema: type: string + in: path deprecated: false /v1alpha/agents/{agent_id}/sessions: get: @@ -3767,27 +4347,33 @@ paths: tags: - Agents summary: List all session(s) of a given agent. - description: List all session(s) of a given agent. + description: >- + List all session(s) of a given agent. + + :param agent_id: The ID of the agent to list sessions for. + :param start_index: The index to start the pagination from. + :param limit: The number of sessions to return. + :returns: A PaginatedResponse. parameters: - name: agent_id - in: path description: >- The ID of the agent to list sessions for. required: true schema: type: string + in: path - name: start_index - in: query description: The index to start the pagination from. required: false schema: type: integer - - name: limit in: query + - name: limit description: The number of sessions to return. required: false schema: type: integer + in: query deprecated: false /v1alpha/eval/benchmarks: get: @@ -3811,7 +4397,10 @@ paths: tags: - Benchmarks summary: List all benchmarks. - description: List all benchmarks. + description: >- + List all benchmarks. + + :returns: A ListBenchmarksResponse. parameters: [] deprecated: false post: @@ -3831,7 +4420,16 @@ paths: tags: - Benchmarks summary: Register a benchmark. - description: Register a benchmark. + description: >- + Register a benchmark. + + :param benchmark_id: The ID of the benchmark to register. + :param dataset_id: The ID of the dataset to use for the benchmark. + :param scoring_functions: The scoring functions to use for the benchmark. + :param provider_benchmark_id: The ID of the provider benchmark to + use for the benchmark. + :param provider_id: The ID of the provider to use for the benchmark. + :param metadata: The metadata to use for the benchmark. parameters: [] requestBody: content: @@ -3862,14 +4460,18 @@ paths: tags: - Benchmarks summary: Get a benchmark by its ID. - description: Get a benchmark by its ID. + description: >- + Get a benchmark by its ID. + + :param benchmark_id: The ID of the benchmark to get. + :returns: A Benchmark. parameters: - name: benchmark_id - in: path description: The ID of the benchmark to get. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -3888,14 +4490,17 @@ paths: tags: - Benchmarks summary: Unregister a benchmark. - description: Unregister a benchmark. + description: >- + Unregister a benchmark. + + :param benchmark_id: The ID of the benchmark to unregister. parameters: - name: benchmark_id - in: path description: The ID of the benchmark to unregister. required: true schema: type: string + in: path deprecated: false /v1alpha/eval/benchmarks/{benchmark_id}/evaluations: post: @@ -3920,15 +4525,22 @@ paths: tags: - Eval summary: Evaluate a list of rows on a benchmark. - description: Evaluate a list of rows on a benchmark. + description: >- + Evaluate a list of rows on a benchmark. + + :param benchmark_id: The ID of the benchmark to run the evaluation on. + :param input_rows: The rows to evaluate. + :param scoring_functions: The scoring functions to use for the evaluation. + :param benchmark_config: The configuration for the benchmark. + :returns: EvaluateResponse object containing generations and scores. parameters: - name: benchmark_id - in: path description: >- The ID of the benchmark to run the evaluation on. required: true schema: type: string + in: path requestBody: content: application/json: @@ -3959,15 +4571,20 @@ paths: tags: - Eval summary: Run an evaluation on a benchmark. - description: Run an evaluation on a benchmark. + description: >- + Run an evaluation on a benchmark. + + :param benchmark_id: The ID of the benchmark to run the evaluation on. + :param benchmark_config: The configuration for the benchmark. + :returns: The job that was created to run the evaluation. parameters: - name: benchmark_id - in: path description: >- The ID of the benchmark to run the evaluation on. required: true schema: type: string + in: path requestBody: content: application/json: @@ -3997,21 +4614,26 @@ paths: tags: - Eval summary: Get the status of a job. - description: Get the status of a job. + description: >- + Get the status of a job. + + :param benchmark_id: The ID of the benchmark to run the evaluation on. + :param job_id: The ID of the job to get the status of. + :returns: The status of the evaluation job. parameters: - name: benchmark_id - in: path description: >- The ID of the benchmark to run the evaluation on. required: true schema: type: string - - name: job_id in: path + - name: job_id description: The ID of the job to get the status of. required: true schema: type: string + in: path deprecated: false delete: responses: @@ -4030,21 +4652,25 @@ paths: tags: - Eval summary: Cancel a job. - description: Cancel a job. + description: >- + Cancel a job. + + :param benchmark_id: The ID of the benchmark to run the evaluation on. + :param job_id: The ID of the job to cancel. parameters: - name: benchmark_id - in: path description: >- The ID of the benchmark to run the evaluation on. required: true schema: type: string - - name: job_id in: path + - name: job_id description: The ID of the job to cancel. required: true schema: type: string + in: path deprecated: false /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result: get: @@ -4068,21 +4694,26 @@ paths: tags: - Eval summary: Get the result of a job. - description: Get the result of a job. + description: >- + Get the result of a job. + + :param benchmark_id: The ID of the benchmark to run the evaluation on. + :param job_id: The ID of the job to get the result of. + :returns: The result of the job. parameters: - name: benchmark_id - in: path description: >- The ID of the benchmark to run the evaluation on. required: true schema: type: string - - name: job_id in: path + - name: job_id description: The ID of the job to get the result of. required: true schema: type: string + in: path deprecated: false /v1alpha/inference/rerank: post: @@ -4110,6 +4741,17 @@ paths: Rerank a list of documents based on their relevance to a query. description: >- Rerank a list of documents based on their relevance to a query. + + :param model: The identifier of the reranking model to use. + :param query: The search query to rank items against. Can be a string, + text content part, or image content part. The input must not exceed the model's + max input token length. + :param items: List of items to rerank. Each item can be a string, + text content part, or image content part. Each input must not exceed the model's + max input token length. + :param max_num_results: (Optional) Maximum number of results to return. + Default: returns all. + :returns: RerankResponse with indices sorted by relevance score (descending). parameters: [] requestBody: content: @@ -4140,15 +4782,19 @@ paths: tags: - PostTraining (Coming Soon) summary: Get the artifacts of a training job. - description: Get the artifacts of a training job. + description: >- + Get the artifacts of a training job. + + :param job_uuid: The UUID of the job to get the artifacts of. + :returns: A PostTrainingJobArtifactsResponse. parameters: - name: job_uuid - in: query description: >- The UUID of the job to get the artifacts of. required: true schema: type: string + in: query deprecated: false /v1alpha/post-training/job/cancel: post: @@ -4168,7 +4814,10 @@ paths: tags: - PostTraining (Coming Soon) summary: Cancel a training job. - description: Cancel a training job. + description: >- + Cancel a training job. + + :param job_uuid: The UUID of the job to cancel. parameters: [] requestBody: content: @@ -4199,15 +4848,19 @@ paths: tags: - PostTraining (Coming Soon) summary: Get the status of a training job. - description: Get the status of a training job. + description: >- + Get the status of a training job. + + :param job_uuid: The UUID of the job to get the status of. + :returns: A PostTrainingJobStatusResponse. parameters: - name: job_uuid - in: query description: >- The UUID of the job to get the status of. required: true schema: type: string + in: query deprecated: false /v1alpha/post-training/jobs: get: @@ -4231,7 +4884,10 @@ paths: tags: - PostTraining (Coming Soon) summary: Get all training jobs. - description: Get all training jobs. + description: >- + Get all training jobs. + + :returns: A ListPostTrainingJobsResponse. parameters: [] deprecated: false /v1alpha/post-training/preference-optimize: @@ -4256,7 +4912,16 @@ paths: tags: - PostTraining (Coming Soon) summary: Run preference optimization of a model. - description: Run preference optimization of a model. + description: >- + Run preference optimization of a model. + + :param job_uuid: The UUID of the job to create. + :param finetuned_model: The model to fine-tune. + :param algorithm_config: The algorithm configuration. + :param training_config: The training configuration. + :param hyperparam_search_config: The hyperparam search configuration. + :param logger_config: The logger configuration. + :returns: A PostTrainingJob. parameters: [] requestBody: content: @@ -4287,7 +4952,17 @@ paths: tags: - PostTraining (Coming Soon) summary: Run supervised fine-tuning of a model. - description: Run supervised fine-tuning of a model. + description: >- + Run supervised fine-tuning of a model. + + :param job_uuid: The UUID of the job to create. + :param training_config: The training configuration. + :param hyperparam_search_config: The hyperparam search configuration. + :param logger_config: The logger configuration. + :param model: The model to fine-tune. + :param checkpoint_dir: The directory to save checkpoint(s) to. + :param algorithm_config: The algorithm configuration. + :returns: A PostTrainingJob. parameters: [] requestBody: content: @@ -4301,26 +4976,34 @@ jsonSchemaDialect: >- components: schemas: Error: - type: object + description: >- + Error response from the API. Roughly follows RFC 7807. + + + :param status: HTTP status code + + :param title: Error title, a short summary of the error which is invariant + for an error type + + :param detail: Error detail, a longer human-readable description of the error + + :param instance: (Optional) A URL which can be used to retrieve more information + about the specific occurrence of the error properties: status: + title: Status type: integer - description: HTTP status code title: + title: Title type: string - description: >- - Error title, a short summary of the error which is invariant for an error - type detail: + title: Detail type: string - description: >- - Error detail, a longer human-readable description of the error instance: - type: string - description: >- - (Optional) A URL which can be used to retrieve more information about - the specific occurrence of the error - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: Instance required: - status - title @@ -4662,1068 +5345,1459 @@ components: description: Sort order for paginated responses. ListOpenAIChatCompletionResponse: type: object - properties: - data: - type: array - items: - type: object - properties: - id: - type: string - description: The ID of the chat completion - choices: - type: array - items: - $ref: '#/components/schemas/OpenAIChoice' - description: List of choices - object: - type: string - const: chat.completion - default: chat.completion - description: >- - The object type, which will be "chat.completion" - created: - type: integer - description: >- - The Unix timestamp in seconds when the chat completion was created - model: - type: string - description: >- - The model that was used to generate the chat completion - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - description: >- - Token usage information for the completion - input_messages: - type: array - items: - $ref: '#/components/schemas/OpenAIMessageParam' - additionalProperties: false - required: - - id - - choices - - object - - created - - model - - input_messages - title: OpenAICompletionWithInputMessages - description: >- - List of chat completion objects with their input messages - has_more: - type: boolean - description: >- - Whether there are more completions available beyond this list - first_id: - type: string - description: ID of the first completion in this list - last_id: - type: string - description: ID of the last completion in this list - object: - type: string - const: list - default: list - description: >- - Must be "list" to identify this as a list response - additionalProperties: false - required: - - data - - has_more - - first_id - - last_id - - object - title: ListOpenAIChatCompletionResponse - description: >- - Response from listing OpenAI-compatible chat completions. - OpenAIAssistantMessageParam: + Order: type: object - properties: - role: - type: string - const: assistant - default: assistant - description: >- - Must be "assistant" to identify this as the model's response - content: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - description: The content of the model's response - name: - type: string - description: >- - (Optional) The name of the assistant message participant. - tool_calls: - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + ListOpenAIChatCompletionResponse: + $defs: + OpenAIAssistantMessageParam: description: >- - List of tool calls. Each tool call is an OpenAIChatCompletionToolCall + A message containing the model's (assistant) response in an OpenAI-compatible + chat completion request. + + + :param role: Must be "assistant" to identify this as the model's response + + :param content: The content of the model's response + + :param name: (Optional) The name of the assistant message participant. + + :param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object. - additionalProperties: false - required: - - role - title: OpenAIAssistantMessageParam - description: >- - A message containing the model's (assistant) response in an OpenAI-compatible - chat completion request. - "OpenAIChatCompletionContentPartImageParam": - type: object - properties: - type: - type: string - const: image_url - default: image_url - description: >- - Must be "image_url" to identify this as image content - image_url: - $ref: '#/components/schemas/OpenAIImageURL' + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + type: array + - type: 'null' + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/$defs/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + title: Tool Calls + title: OpenAIAssistantMessageParam + type: object + "OpenAIChatCompletionContentPartImageParam": description: >- - Image URL specification and processing details - additionalProperties: false - required: - - type - - image_url - title: >- - OpenAIChatCompletionContentPartImageParam - description: >- - Image content part for OpenAI-compatible chat completion messages. - OpenAIChatCompletionContentPartParam: - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - - $ref: '#/components/schemas/OpenAIFile' - discriminator: - propertyName: type - mapping: - text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - file: '#/components/schemas/OpenAIFile' - OpenAIChatCompletionContentPartTextParam: - type: object - properties: - type: - type: string - const: text - default: text + Image content part for OpenAI-compatible chat completion messages. + + + :param type: Must be "image_url" to identify this as image content + + :param image_url: Image URL specification and processing details + properties: + type: + const: image_url + default: image_url + title: Type + type: string + image_url: + $ref: '#/$defs/OpenAIImageURL' + required: + - image_url + title: >- + OpenAIChatCompletionContentPartImageParam + type: object + OpenAIChatCompletionContentPartTextParam: description: >- - Must be "text" to identify this as text content - text: - type: string - description: The text content of the message - additionalProperties: false - required: - - type - - text - title: OpenAIChatCompletionContentPartTextParam - description: >- - Text content part for OpenAI-compatible chat completion messages. - OpenAIChatCompletionToolCall: - type: object - properties: - index: - type: integer + Text content part for OpenAI-compatible chat completion messages. + + + :param type: Must be "text" to identify this as text content + + :param text: The text content of the message + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: OpenAIChatCompletionContentPartTextParam + type: object + OpenAIChatCompletionToolCall: description: >- - (Optional) Index of the tool call in the list - id: - type: string + Tool call specification for OpenAI-compatible chat completion responses. + + + :param index: (Optional) Index of the tool call in the list + + :param id: (Optional) Unique identifier for the tool call + + :param type: Must be "function" to identify this as a function call + + :param function: (Optional) Function call details + properties: + index: + anyOf: + - type: integer + - type: 'null' + title: Index + id: + anyOf: + - type: string + - type: 'null' + title: Id + type: + const: function + default: function + title: Type + type: string + function: + anyOf: + - $ref: >- + #/$defs/OpenAIChatCompletionToolCallFunction + - type: 'null' + title: OpenAIChatCompletionToolCall + type: object + OpenAIChatCompletionToolCallFunction: description: >- - (Optional) Unique identifier for the tool call - type: - type: string - const: function - default: function + Function call details for OpenAI-compatible tool calls. + + + :param name: (Optional) Name of the function to call + + :param arguments: (Optional) Arguments to pass to the function as a JSON + string + properties: + name: + anyOf: + - type: string + - type: 'null' + title: Name + arguments: + anyOf: + - type: string + - type: 'null' + title: Arguments + title: OpenAIChatCompletionToolCallFunction + type: object + OpenAIChatCompletionUsage: description: >- - Must be "function" to identify this as a function call - function: - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' - description: (Optional) Function call details - additionalProperties: false - required: - - type - title: OpenAIChatCompletionToolCall - description: >- - Tool call specification for OpenAI-compatible chat completion responses. - OpenAIChatCompletionToolCallFunction: - type: object - properties: - name: - type: string - description: (Optional) Name of the function to call - arguments: - type: string + Usage information for OpenAI chat completion. + + + :param prompt_tokens: Number of tokens in the prompt + + :param completion_tokens: Number of tokens in the completion + + :param total_tokens: Total tokens used (prompt + completion) + + :param input_tokens_details: Detailed breakdown of input token usage + + :param output_tokens_details: Detailed breakdown of output token usage + properties: + prompt_tokens: + title: Prompt Tokens + type: integer + completion_tokens: + title: Completion Tokens + type: integer + total_tokens: + title: Total Tokens + type: integer + prompt_tokens_details: + anyOf: + - $ref: >- + #/$defs/OpenAIChatCompletionUsagePromptTokensDetails + - type: 'null' + completion_tokens_details: + anyOf: + - $ref: >- + #/$defs/OpenAIChatCompletionUsageCompletionTokensDetails + - type: 'null' + required: + - prompt_tokens + - completion_tokens + - total_tokens + title: OpenAIChatCompletionUsage + type: object + "OpenAIChatCompletionUsageCompletionTokensDetails": description: >- - (Optional) Arguments to pass to the function as a JSON string - additionalProperties: false - title: OpenAIChatCompletionToolCallFunction - description: >- - Function call details for OpenAI-compatible tool calls. - OpenAIChatCompletionUsage: - type: object - properties: - prompt_tokens: - type: integer - description: Number of tokens in the prompt - completion_tokens: - type: integer - description: Number of tokens in the completion - total_tokens: - type: integer - description: Total tokens used (prompt + completion) - prompt_tokens_details: + Token details for output tokens in OpenAI chat completion usage. + + + :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens + title: >- + OpenAIChatCompletionUsageCompletionTokensDetails type: object + "OpenAIChatCompletionUsagePromptTokensDetails": + description: >- + Token details for prompt tokens in OpenAI chat completion usage. + + + :param cached_tokens: Number of tokens retrieved from cache properties: cached_tokens: - type: integer - description: Number of tokens retrieved from cache - additionalProperties: false + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens title: >- OpenAIChatCompletionUsagePromptTokensDetails + type: object + OpenAIChoice: description: >- - Token details for prompt tokens in OpenAI chat completion usage. - completion_tokens_details: + A choice from an OpenAI-compatible chat completion response. + + + :param message: The message from the model + + :param finish_reason: The reason the model stopped generating + + :param index: The index of the choice + + :param logprobs: (Optional) The log probabilities for the tokens in the + message + properties: + message: + discriminator: + mapping: + assistant: '#/$defs/OpenAIAssistantMessageParam' + developer: '#/$defs/OpenAIDeveloperMessageParam' + system: '#/$defs/OpenAISystemMessageParam' + tool: '#/$defs/OpenAIToolMessageParam' + user: '#/$defs/OpenAIUserMessageParam' + propertyName: role + oneOf: + - $ref: '#/$defs/OpenAIUserMessageParam' + - $ref: '#/$defs/OpenAISystemMessageParam' + - $ref: '#/$defs/OpenAIAssistantMessageParam' + - $ref: '#/$defs/OpenAIToolMessageParam' + - $ref: '#/$defs/OpenAIDeveloperMessageParam' + title: Message + finish_reason: + title: Finish Reason + type: string + index: + title: Index + type: integer + logprobs: + anyOf: + - $ref: '#/$defs/OpenAIChoiceLogprobs' + - type: 'null' + required: + - message + - finish_reason + - index + title: OpenAIChoice type: object + OpenAIChoiceLogprobs: + description: >- + The log probabilities for the tokens in the message from an OpenAI-compatible + chat completion response. + + + :param content: (Optional) The log probabilities for the tokens in the + message + + :param refusal: (Optional) The log probabilities for the tokens in the + message properties: - reasoning_tokens: + content: + anyOf: + - items: + $ref: '#/$defs/OpenAITokenLogProb' + type: array + - type: 'null' + title: Content + refusal: + anyOf: + - items: + $ref: '#/$defs/OpenAITokenLogProb' + type: array + - type: 'null' + title: Refusal + title: OpenAIChoiceLogprobs + type: object + OpenAICompletionWithInputMessages: + properties: + id: + title: Id + type: string + choices: + items: + $ref: '#/$defs/OpenAIChoice' + title: Choices + type: array + object: + const: chat.completion + default: chat.completion + title: Object + type: string + created: + title: Created type: integer - description: >- - Number of tokens used for reasoning (o1/o3 models) - additionalProperties: false - title: >- - OpenAIChatCompletionUsageCompletionTokensDetails + model: + title: Model + type: string + usage: + anyOf: + - $ref: '#/$defs/OpenAIChatCompletionUsage' + - type: 'null' + input_messages: + items: + discriminator: + mapping: + assistant: '#/$defs/OpenAIAssistantMessageParam' + developer: '#/$defs/OpenAIDeveloperMessageParam' + system: '#/$defs/OpenAISystemMessageParam' + tool: '#/$defs/OpenAIToolMessageParam' + user: '#/$defs/OpenAIUserMessageParam' + propertyName: role + oneOf: + - $ref: '#/$defs/OpenAIUserMessageParam' + - $ref: '#/$defs/OpenAISystemMessageParam' + - $ref: '#/$defs/OpenAIAssistantMessageParam' + - $ref: '#/$defs/OpenAIToolMessageParam' + - $ref: '#/$defs/OpenAIDeveloperMessageParam' + title: Input Messages + type: array + required: + - id + - choices + - created + - model + - input_messages + title: OpenAICompletionWithInputMessages + type: object + OpenAIDeveloperMessageParam: description: >- - Token details for output tokens in OpenAI chat completion usage. - additionalProperties: false - required: - - prompt_tokens - - completion_tokens - - total_tokens - title: OpenAIChatCompletionUsage - description: >- - Usage information for OpenAI chat completion. - OpenAIChoice: - type: object - properties: - message: - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - discriminator: - propertyName: role - mapping: - user: '#/components/schemas/OpenAIUserMessageParam' - system: '#/components/schemas/OpenAISystemMessageParam' - assistant: '#/components/schemas/OpenAIAssistantMessageParam' - tool: '#/components/schemas/OpenAIToolMessageParam' - developer: '#/components/schemas/OpenAIDeveloperMessageParam' - description: The message from the model - finish_reason: - type: string - description: The reason the model stopped generating - index: - type: integer - description: The index of the choice - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - description: >- - (Optional) The log probabilities for the tokens in the message - additionalProperties: false - required: - - message - - finish_reason - - index - title: OpenAIChoice - description: >- - A choice from an OpenAI-compatible chat completion response. - OpenAIChoiceLogprobs: - type: object - properties: - content: - type: array - items: - $ref: '#/components/schemas/OpenAITokenLogProb' + A message from the developer in an OpenAI-compatible chat completion request. + + + :param role: Must be "developer" to identify this as a developer message + + :param content: The content of the developer message + + :param name: (Optional) The name of the developer message participant. + properties: + role: + const: developer + default: developer + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + required: + - content + title: OpenAIDeveloperMessageParam + type: object + OpenAIFile: + properties: + type: + const: file + default: file + title: Type + type: string + file: + $ref: '#/$defs/OpenAIFileFile' + required: + - file + title: OpenAIFile + type: object + OpenAIFileFile: + properties: + file_data: + anyOf: + - type: string + - type: 'null' + title: File Data + file_id: + anyOf: + - type: string + - type: 'null' + title: File Id + filename: + anyOf: + - type: string + - type: 'null' + title: Filename + title: OpenAIFileFile + type: object + OpenAIImageURL: description: >- - (Optional) The log probabilities for the tokens in the message - refusal: - type: array - items: - $ref: '#/components/schemas/OpenAITokenLogProb' + Image URL specification for OpenAI-compatible chat completion messages. + + + :param url: URL of the image to include in the message + + :param detail: (Optional) Level of detail for image processing. Can be + "low", "high", or "auto" + properties: + url: + title: Url + type: string + detail: + anyOf: + - type: string + - type: 'null' + title: Detail + required: + - url + title: OpenAIImageURL + type: object + OpenAISystemMessageParam: description: >- - (Optional) The log probabilities for the tokens in the message - additionalProperties: false - title: OpenAIChoiceLogprobs - description: >- - The log probabilities for the tokens in the message from an OpenAI-compatible - chat completion response. - OpenAIDeveloperMessageParam: - type: object - properties: - role: - type: string - const: developer - default: developer + A system message providing instructions or context to the model. + + + :param role: Must be "system" to identify this as a system message + + :param content: The content of the "system prompt". If multiple system + messages are provided, they are concatenated. The underlying Llama Stack + code may also add other system messages (for example, for formatting tool + definitions). + + :param name: (Optional) The name of the system message participant. + properties: + role: + const: system + default: system + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + required: + - content + title: OpenAISystemMessageParam + type: object + OpenAITokenLogProb: description: >- - Must be "developer" to identify this as a developer message - content: - oneOf: - - type: string - - type: array + The log probability for a token from an OpenAI-compatible chat completion + response. + + + :token: The token + + :bytes: (Optional) The bytes for the token + + :logprob: The log probability of the token + + :top_logprobs: The top log probabilities for the token + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + title: Logprob + type: number + top_logprobs: items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - description: The content of the developer message - name: - type: string - description: >- - (Optional) The name of the developer message participant. - additionalProperties: false - required: - - role - - content - title: OpenAIDeveloperMessageParam - description: >- - A message from the developer in an OpenAI-compatible chat completion request. - OpenAIFile: - type: object - properties: - type: - type: string - const: file - default: file - file: - $ref: '#/components/schemas/OpenAIFileFile' - additionalProperties: false - required: - - type - - file - title: OpenAIFile - OpenAIFileFile: - type: object - properties: - file_data: - type: string - file_id: - type: string - filename: - type: string - additionalProperties: false - title: OpenAIFileFile - OpenAIImageURL: - type: object - properties: - url: - type: string - description: >- - URL of the image to include in the message - detail: - type: string - description: >- - (Optional) Level of detail for image processing. Can be "low", "high", - or "auto" - additionalProperties: false - required: - - url - title: OpenAIImageURL - description: >- - Image URL specification for OpenAI-compatible chat completion messages. - OpenAIMessageParam: - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - discriminator: - propertyName: role - mapping: - user: '#/components/schemas/OpenAIUserMessageParam' - system: '#/components/schemas/OpenAISystemMessageParam' - assistant: '#/components/schemas/OpenAIAssistantMessageParam' - tool: '#/components/schemas/OpenAIToolMessageParam' - developer: '#/components/schemas/OpenAIDeveloperMessageParam' - OpenAISystemMessageParam: - type: object - properties: - role: - type: string - const: system - default: system + $ref: '#/$defs/OpenAITopLogProb' + title: Top Logprobs + type: array + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + type: object + OpenAIToolMessageParam: description: >- - Must be "system" to identify this as a system message - content: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + A message representing the result of a tool invocation in an OpenAI-compatible + chat completion request. + + + :param role: Must be "tool" to identify this as a tool response + + :param tool_call_id: Unique identifier for the tool call this response + is for + + :param content: The response content from the tool + properties: + role: + const: tool + default: tool + title: Role + type: string + tool_call_id: + title: Tool Call Id + type: string + content: + anyOf: + - type: string + - items: + $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + type: array + title: Content + required: + - tool_call_id + - content + title: OpenAIToolMessageParam + type: object + OpenAITopLogProb: description: >- - The content of the "system prompt". If multiple system messages are provided, - they are concatenated. The underlying Llama Stack code may also add other - system messages (for example, for formatting tool definitions). - name: - type: string + The top log probability for a token from an OpenAI-compatible chat completion + response. + + + :token: The token + + :bytes: (Optional) The bytes for the token + + :logprob: The log probability of the token + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + title: Logprob + type: number + required: + - token + - logprob + title: OpenAITopLogProb + type: object + OpenAIUserMessageParam: description: >- - (Optional) The name of the system message participant. - additionalProperties: false - required: - - role - - content - title: OpenAISystemMessageParam + A message from the user in an OpenAI-compatible chat completion request. + + + :param role: Must be "user" to identify this as a user message + + :param content: The content of the message, which can include text and + other media + + :param name: (Optional) The name of the user message participant. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + file: '#/$defs/OpenAIFile' + image_url: >- + #/$defs/OpenAIChatCompletionContentPartImageParam + text: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + - $ref: >- + #/$defs/OpenAIChatCompletionContentPartImageParam + - $ref: '#/$defs/OpenAIFile' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + required: + - content + title: OpenAIUserMessageParam + type: object description: >- - A system message providing instructions or context to the model. - OpenAITokenLogProb: - type: object + Response from listing OpenAI-compatible chat completions. + + + :param data: List of chat completion objects with their input messages + + :param has_more: Whether there are more completions available beyond this + list + + :param first_id: ID of the first completion in this list + + :param last_id: ID of the last completion in this list + + :param object: Must be "list" to identify this as a list response properties: - token: - type: string - bytes: - type: array + data: items: - type: integer - logprob: - type: number - top_logprobs: + $ref: >- + #/$defs/OpenAICompletionWithInputMessages + title: Data type: array - items: - $ref: '#/components/schemas/OpenAITopLogProb' - additionalProperties: false - required: - - token - - logprob - - top_logprobs - title: OpenAITokenLogProb - description: >- - The log probability for a token from an OpenAI-compatible chat completion - response. - OpenAIToolMessageParam: - type: object - properties: - role: + has_more: + title: Has More + type: boolean + first_id: + title: First Id type: string - const: tool - default: tool - description: >- - Must be "tool" to identify this as a tool response - tool_call_id: + last_id: + title: Last Id type: string - description: >- - Unique identifier for the tool call this response is for - content: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - description: The response content from the tool - additionalProperties: false - required: - - role - - tool_call_id - - content - title: OpenAIToolMessageParam - description: >- - A message representing the result of a tool invocation in an OpenAI-compatible - chat completion request. - OpenAITopLogProb: - type: object - properties: - token: + object: + const: list + default: list + title: Object type: string - bytes: - type: array - items: - type: integer - logprob: - type: number - additionalProperties: false required: - - token - - logprob - title: OpenAITopLogProb - description: >- - The top log probability for a token from an OpenAI-compatible chat completion - response. - OpenAIUserMessageParam: - type: object - properties: - role: - type: string - const: user - default: user - description: >- - Must be "user" to identify this as a user message - content: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartParam' - description: >- - The content of the message, which can include text and other media - name: - type: string - description: >- - (Optional) The name of the user message participant. - additionalProperties: false - required: - - role - - content - title: OpenAIUserMessageParam - description: >- - A message from the user in an OpenAI-compatible chat completion request. - OpenAIJSONSchema: - type: object - properties: - name: - type: string - description: Name of the schema - description: - type: string - description: (Optional) Description of the schema - strict: - type: boolean - description: >- - (Optional) Whether to enforce strict adherence to the schema - schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The JSON schema definition - additionalProperties: false - required: - - name - title: OpenAIJSONSchema - description: >- - JSON schema specification for OpenAI-compatible structured response format. - OpenAIResponseFormatJSONObject: + - data + - has_more + - first_id + - last_id + title: ListOpenAIChatCompletionResponse type: object - properties: - type: - type: string - const: json_object - default: json_object - description: >- - Must be "json_object" to indicate generic JSON object response format - additionalProperties: false - required: - - type - title: OpenAIResponseFormatJSONObject - description: >- - JSON object response format for OpenAI-compatible chat completion requests. - OpenAIResponseFormatJSONSchema: + Annotated: type: object - properties: - type: - type: string - const: json_schema - default: json_schema - description: >- - Must be "json_schema" to indicate structured JSON response format - json_schema: - $ref: '#/components/schemas/OpenAIJSONSchema' + ? >- + llama_stack.apis.inference.inference.OpenAIChatCompletion | collections.abc.AsyncIterator[llama_stack.apis.inference.inference.OpenAIChatCompletionChunk] + : type: object + OpenAICompletionWithInputMessages: + $defs: + OpenAIAssistantMessageParam: description: >- - The JSON schema specification for the response - additionalProperties: false - required: - - type - - json_schema - title: OpenAIResponseFormatJSONSchema - description: >- - JSON schema response format for OpenAI-compatible chat completion requests. - OpenAIResponseFormatParam: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseFormatText' - - $ref: '#/components/schemas/OpenAIResponseFormatJSONSchema' - - $ref: '#/components/schemas/OpenAIResponseFormatJSONObject' - discriminator: - propertyName: type - mapping: - text: '#/components/schemas/OpenAIResponseFormatText' - json_schema: '#/components/schemas/OpenAIResponseFormatJSONSchema' - json_object: '#/components/schemas/OpenAIResponseFormatJSONObject' - OpenAIResponseFormatText: - type: object - properties: - type: - type: string - const: text - default: text + A message containing the model's (assistant) response in an OpenAI-compatible + chat completion request. + + + :param role: Must be "assistant" to identify this as the model's response + + :param content: The content of the model's response + + :param name: (Optional) The name of the assistant message participant. + + :param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall + object. + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + type: array + - type: 'null' + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/$defs/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + title: Tool Calls + title: OpenAIAssistantMessageParam + type: object + "OpenAIChatCompletionContentPartImageParam": description: >- - Must be "text" to indicate plain text response format - additionalProperties: false - required: - - type - title: OpenAIResponseFormatText - description: >- - Text response format for OpenAI-compatible chat completion requests. - OpenAIChatCompletionRequestWithExtraBody: - type: object - properties: - model: - type: string + Image content part for OpenAI-compatible chat completion messages. + + + :param type: Must be "image_url" to identify this as image content + + :param image_url: Image URL specification and processing details + properties: + type: + const: image_url + default: image_url + title: Type + type: string + image_url: + $ref: '#/$defs/OpenAIImageURL' + required: + - image_url + title: >- + OpenAIChatCompletionContentPartImageParam + type: object + OpenAIChatCompletionContentPartTextParam: description: >- - The identifier of the model to use. The model must be registered with - Llama Stack and available via the /models endpoint. - messages: - type: array - items: - $ref: '#/components/schemas/OpenAIMessageParam' - description: List of messages in the conversation. - frequency_penalty: - type: number + Text content part for OpenAI-compatible chat completion messages. + + + :param type: Must be "text" to identify this as text content + + :param text: The text content of the message + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: OpenAIChatCompletionContentPartTextParam + type: object + OpenAIChatCompletionToolCall: description: >- - (Optional) The penalty for repeated tokens. - function_call: - oneOf: - - type: string - - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The function call to use. - functions: - type: array - items: - type: object - additionalProperties: - oneOf: + Tool call specification for OpenAI-compatible chat completion responses. + + + :param index: (Optional) Index of the tool call in the list + + :param id: (Optional) Unique identifier for the tool call + + :param type: Must be "function" to identify this as a function call + + :param function: (Optional) Function call details + properties: + index: + anyOf: + - type: integer - type: 'null' - - type: boolean - - type: number + title: Index + id: + anyOf: - type: string - - type: array - - type: object - description: (Optional) List of functions to use. - logit_bias: + - type: 'null' + title: Id + type: + const: function + default: function + title: Type + type: string + function: + anyOf: + - $ref: >- + #/$defs/OpenAIChatCompletionToolCallFunction + - type: 'null' + title: OpenAIChatCompletionToolCall type: object - additionalProperties: - type: number - description: (Optional) The logit bias to use. - logprobs: - type: boolean - description: (Optional) The log probabilities to use. - max_completion_tokens: - type: integer - description: >- - (Optional) The maximum number of tokens to generate. - max_tokens: - type: integer + OpenAIChatCompletionToolCallFunction: description: >- - (Optional) The maximum number of tokens to generate. - n: - type: integer - description: >- - (Optional) The number of completions to generate. - parallel_tool_calls: - type: boolean + Function call details for OpenAI-compatible tool calls. + + + :param name: (Optional) Name of the function to call + + :param arguments: (Optional) Arguments to pass to the function as a JSON + string + properties: + name: + anyOf: + - type: string + - type: 'null' + title: Name + arguments: + anyOf: + - type: string + - type: 'null' + title: Arguments + title: OpenAIChatCompletionToolCallFunction + type: object + OpenAIChatCompletionUsage: description: >- - (Optional) Whether to parallelize tool calls. - presence_penalty: - type: number + Usage information for OpenAI chat completion. + + + :param prompt_tokens: Number of tokens in the prompt + + :param completion_tokens: Number of tokens in the completion + + :param total_tokens: Total tokens used (prompt + completion) + + :param input_tokens_details: Detailed breakdown of input token usage + + :param output_tokens_details: Detailed breakdown of output token usage + properties: + prompt_tokens: + title: Prompt Tokens + type: integer + completion_tokens: + title: Completion Tokens + type: integer + total_tokens: + title: Total Tokens + type: integer + prompt_tokens_details: + anyOf: + - $ref: >- + #/$defs/OpenAIChatCompletionUsagePromptTokensDetails + - type: 'null' + completion_tokens_details: + anyOf: + - $ref: >- + #/$defs/OpenAIChatCompletionUsageCompletionTokensDetails + - type: 'null' + required: + - prompt_tokens + - completion_tokens + - total_tokens + title: OpenAIChatCompletionUsage + type: object + "OpenAIChatCompletionUsageCompletionTokensDetails": description: >- - (Optional) The penalty for repeated tokens. - response_format: - $ref: '#/components/schemas/OpenAIResponseFormatParam' - description: (Optional) The response format to use. - seed: - type: integer - description: (Optional) The seed to use. - stop: - oneOf: - - type: string - - type: array - items: - type: string - description: (Optional) The stop tokens to use. - stream: - type: boolean + Token details for output tokens in OpenAI chat completion usage. + + + :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens + title: >- + OpenAIChatCompletionUsageCompletionTokensDetails + type: object + "OpenAIChatCompletionUsagePromptTokensDetails": description: >- - (Optional) Whether to stream the response. - stream_options: + Token details for prompt tokens in OpenAI chat completion usage. + + + :param cached_tokens: Number of tokens retrieved from cache + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens + title: >- + OpenAIChatCompletionUsagePromptTokensDetails type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The stream options to use. - temperature: - type: number - description: (Optional) The temperature to use. - tool_choice: - oneOf: - - type: string - - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The tool choice to use. - tools: - type: array - items: - type: object - additionalProperties: + OpenAIChoice: + description: >- + A choice from an OpenAI-compatible chat completion response. + + + :param message: The message from the model + + :param finish_reason: The reason the model stopped generating + + :param index: The index of the choice + + :param logprobs: (Optional) The log probabilities for the tokens in the + message + properties: + message: + discriminator: + mapping: + assistant: '#/$defs/OpenAIAssistantMessageParam' + developer: '#/$defs/OpenAIDeveloperMessageParam' + system: '#/$defs/OpenAISystemMessageParam' + tool: '#/$defs/OpenAIToolMessageParam' + user: '#/$defs/OpenAIUserMessageParam' + propertyName: role oneOf: + - $ref: '#/$defs/OpenAIUserMessageParam' + - $ref: '#/$defs/OpenAISystemMessageParam' + - $ref: '#/$defs/OpenAIAssistantMessageParam' + - $ref: '#/$defs/OpenAIToolMessageParam' + - $ref: '#/$defs/OpenAIDeveloperMessageParam' + title: Message + finish_reason: + title: Finish Reason + type: string + index: + title: Index + type: integer + logprobs: + anyOf: + - $ref: '#/$defs/OpenAIChoiceLogprobs' - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The tools to use. - top_logprobs: - type: integer + required: + - message + - finish_reason + - index + title: OpenAIChoice + type: object + OpenAIChoiceLogprobs: description: >- - (Optional) The top log probabilities to use. - top_p: - type: number - description: (Optional) The top p to use. - user: - type: string - description: (Optional) The user to use. - additionalProperties: false - required: - - model - - messages - title: OpenAIChatCompletionRequestWithExtraBody - description: >- - Request parameters for OpenAI-compatible chat completion endpoint. - OpenAIChatCompletion: - type: object + The log probabilities for the tokens in the message from an OpenAI-compatible + chat completion response. + + + :param content: (Optional) The log probabilities for the tokens in the + message + + :param refusal: (Optional) The log probabilities for the tokens in the + message + properties: + content: + anyOf: + - items: + $ref: '#/$defs/OpenAITokenLogProb' + type: array + - type: 'null' + title: Content + refusal: + anyOf: + - items: + $ref: '#/$defs/OpenAITokenLogProb' + type: array + - type: 'null' + title: Refusal + title: OpenAIChoiceLogprobs + type: object + OpenAIDeveloperMessageParam: + description: >- + A message from the developer in an OpenAI-compatible chat completion request. + + + :param role: Must be "developer" to identify this as a developer message + + :param content: The content of the developer message + + :param name: (Optional) The name of the developer message participant. + properties: + role: + const: developer + default: developer + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + required: + - content + title: OpenAIDeveloperMessageParam + type: object + OpenAIFile: + properties: + type: + const: file + default: file + title: Type + type: string + file: + $ref: '#/$defs/OpenAIFileFile' + required: + - file + title: OpenAIFile + type: object + OpenAIFileFile: + properties: + file_data: + anyOf: + - type: string + - type: 'null' + title: File Data + file_id: + anyOf: + - type: string + - type: 'null' + title: File Id + filename: + anyOf: + - type: string + - type: 'null' + title: Filename + title: OpenAIFileFile + type: object + OpenAIImageURL: + description: >- + Image URL specification for OpenAI-compatible chat completion messages. + + + :param url: URL of the image to include in the message + + :param detail: (Optional) Level of detail for image processing. Can be + "low", "high", or "auto" + properties: + url: + title: Url + type: string + detail: + anyOf: + - type: string + - type: 'null' + title: Detail + required: + - url + title: OpenAIImageURL + type: object + OpenAISystemMessageParam: + description: >- + A system message providing instructions or context to the model. + + + :param role: Must be "system" to identify this as a system message + + :param content: The content of the "system prompt". If multiple system + messages are provided, they are concatenated. The underlying Llama Stack + code may also add other system messages (for example, for formatting tool + definitions). + + :param name: (Optional) The name of the system message participant. + properties: + role: + const: system + default: system + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + required: + - content + title: OpenAISystemMessageParam + type: object + OpenAITokenLogProb: + description: >- + The log probability for a token from an OpenAI-compatible chat completion + response. + + + :token: The token + + :bytes: (Optional) The bytes for the token + + :logprob: The log probability of the token + + :top_logprobs: The top log probabilities for the token + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + title: Logprob + type: number + top_logprobs: + items: + $ref: '#/$defs/OpenAITopLogProb' + title: Top Logprobs + type: array + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + type: object + OpenAIToolMessageParam: + description: >- + A message representing the result of a tool invocation in an OpenAI-compatible + chat completion request. + + + :param role: Must be "tool" to identify this as a tool response + + :param tool_call_id: Unique identifier for the tool call this response + is for + + :param content: The response content from the tool + properties: + role: + const: tool + default: tool + title: Role + type: string + tool_call_id: + title: Tool Call Id + type: string + content: + anyOf: + - type: string + - items: + $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + type: array + title: Content + required: + - tool_call_id + - content + title: OpenAIToolMessageParam + type: object + OpenAITopLogProb: + description: >- + The top log probability for a token from an OpenAI-compatible chat completion + response. + + + :token: The token + + :bytes: (Optional) The bytes for the token + + :logprob: The log probability of the token + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + title: Logprob + type: number + required: + - token + - logprob + title: OpenAITopLogProb + type: object + OpenAIUserMessageParam: + description: >- + A message from the user in an OpenAI-compatible chat completion request. + + + :param role: Must be "user" to identify this as a user message + + :param content: The content of the message, which can include text and + other media + + :param name: (Optional) The name of the user message participant. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + file: '#/$defs/OpenAIFile' + image_url: >- + #/$defs/OpenAIChatCompletionContentPartImageParam + text: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIChatCompletionContentPartTextParam + - $ref: >- + #/$defs/OpenAIChatCompletionContentPartImageParam + - $ref: '#/$defs/OpenAIFile' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + required: + - content + title: OpenAIUserMessageParam + type: object properties: id: + title: Id type: string - description: The ID of the chat completion choices: - type: array items: - $ref: '#/components/schemas/OpenAIChoice' - description: List of choices + $ref: '#/$defs/OpenAIChoice' + title: Choices + type: array object: - type: string const: chat.completion default: chat.completion - description: >- - The object type, which will be "chat.completion" + title: Object + type: string created: + title: Created type: integer - description: >- - The Unix timestamp in seconds when the chat completion was created model: + title: Model type: string - description: >- - The model that was used to generate the chat completion usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - description: >- - Token usage information for the completion - additionalProperties: false + anyOf: + - $ref: '#/$defs/OpenAIChatCompletionUsage' + - type: 'null' + input_messages: + items: + discriminator: + mapping: + assistant: '#/$defs/OpenAIAssistantMessageParam' + developer: '#/$defs/OpenAIDeveloperMessageParam' + system: '#/$defs/OpenAISystemMessageParam' + tool: '#/$defs/OpenAIToolMessageParam' + user: '#/$defs/OpenAIUserMessageParam' + propertyName: role + oneOf: + - $ref: '#/$defs/OpenAIUserMessageParam' + - $ref: '#/$defs/OpenAISystemMessageParam' + - $ref: '#/$defs/OpenAIAssistantMessageParam' + - $ref: '#/$defs/OpenAIToolMessageParam' + - $ref: '#/$defs/OpenAIDeveloperMessageParam' + title: Input Messages + type: array required: - id - choices - - object - created - model - title: OpenAIChatCompletion - description: >- - Response from an OpenAI-compatible chat completion request. - OpenAIChatCompletionChunk: + - input_messages + title: OpenAICompletionWithInputMessages type: object + OpenAICompletion: + $defs: + OpenAIChoiceLogprobs: + description: >- + The log probabilities for the tokens in the message from an OpenAI-compatible + chat completion response. + + + :param content: (Optional) The log probabilities for the tokens in the + message + + :param refusal: (Optional) The log probabilities for the tokens in the + message + properties: + content: + anyOf: + - items: + $ref: '#/$defs/OpenAITokenLogProb' + type: array + - type: 'null' + title: Content + refusal: + anyOf: + - items: + $ref: '#/$defs/OpenAITokenLogProb' + type: array + - type: 'null' + title: Refusal + title: OpenAIChoiceLogprobs + type: object + OpenAICompletionChoice: + description: >- + A choice from an OpenAI-compatible completion response. + + + :finish_reason: The reason the model stopped generating + + :text: The text of the choice + + :index: The index of the choice + + :logprobs: (Optional) The log probabilities for the tokens in the choice + properties: + finish_reason: + title: Finish Reason + type: string + text: + title: Text + type: string + index: + title: Index + type: integer + logprobs: + anyOf: + - $ref: '#/$defs/OpenAIChoiceLogprobs' + - type: 'null' + required: + - finish_reason + - text + - index + title: OpenAICompletionChoice + type: object + OpenAITokenLogProb: + description: >- + The log probability for a token from an OpenAI-compatible chat completion + response. + + + :token: The token + + :bytes: (Optional) The bytes for the token + + :logprob: The log probability of the token + + :top_logprobs: The top log probabilities for the token + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + title: Logprob + type: number + top_logprobs: + items: + $ref: '#/$defs/OpenAITopLogProb' + title: Top Logprobs + type: array + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + type: object + OpenAITopLogProb: + description: >- + The top log probability for a token from an OpenAI-compatible chat completion + response. + + + :token: The token + + :bytes: (Optional) The bytes for the token + + :logprob: The log probability of the token + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + title: Logprob + type: number + required: + - token + - logprob + title: OpenAITopLogProb + type: object + description: >- + Response from an OpenAI-compatible completion request. + + + :id: The ID of the completion + + :choices: List of choices + + :created: The Unix timestamp in seconds when the completion was created + + :model: The model that was used to generate the completion + + :object: The object type, which will be "text_completion" properties: id: + title: Id type: string - description: The ID of the chat completion choices: - type: array items: - $ref: '#/components/schemas/OpenAIChunkChoice' - description: List of choices - object: - type: string - const: chat.completion.chunk - default: chat.completion.chunk - description: >- - The object type, which will be "chat.completion.chunk" + $ref: '#/$defs/OpenAICompletionChoice' + title: Choices + type: array created: + title: Created type: integer - description: >- - The Unix timestamp in seconds when the chat completion was created model: + title: Model + type: string + object: + const: text_completion + default: text_completion + title: Object type: string - description: >- - The model that was used to generate the chat completion - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - description: >- - Token usage information (typically included in final chunk with stream_options) - additionalProperties: false required: - id - choices - - object - created - model - title: OpenAIChatCompletionChunk - description: >- - Chunk from a streaming response to an OpenAI-compatible chat completion request. - OpenAIChoiceDelta: - type: object - properties: - content: - type: string - description: (Optional) The content of the delta - refusal: - type: string - description: (Optional) The refusal of the delta - role: - type: string - description: (Optional) The role of the delta - tool_calls: - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' - description: (Optional) The tool calls of the delta - reasoning_content: - type: string - description: >- - (Optional) The reasoning content from the model (non-standard, for o1/o3 - models) - additionalProperties: false - title: OpenAIChoiceDelta - description: >- - A delta from an OpenAI-compatible chat completion streaming response. - OpenAIChunkChoice: + title: OpenAICompletion type: object properties: - delta: - $ref: '#/components/schemas/OpenAIChoiceDelta' - description: The delta from the chunk finish_reason: type: string - description: The reason the model stopped generating + text: + type: string index: type: integer - description: The index of the choice logprobs: $ref: '#/components/schemas/OpenAIChoiceLogprobs' - description: >- - (Optional) The log probabilities for the tokens in the message additionalProperties: false required: - - delta - finish_reason + - text - index - title: OpenAIChunkChoice - description: >- - A chunk choice from an OpenAI-compatible chat completion streaming response. - OpenAICompletionWithInputMessages: - type: object - properties: - id: - type: string - description: The ID of the chat completion - choices: - type: array - items: - $ref: '#/components/schemas/OpenAIChoice' - description: List of choices - object: - type: string - const: chat.completion - default: chat.completion - description: >- - The object type, which will be "chat.completion" - created: - type: integer - description: >- - The Unix timestamp in seconds when the chat completion was created - model: - type: string - description: >- - The model that was used to generate the chat completion - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - description: >- - Token usage information for the completion - input_messages: - type: array - items: - $ref: '#/components/schemas/OpenAIMessageParam' - additionalProperties: false - required: - - id - - choices - - object - - created - - model - - input_messages - title: OpenAICompletionWithInputMessages - OpenAICompletionRequestWithExtraBody: - type: object - properties: - model: - type: string - description: >- - The identifier of the model to use. The model must be registered with - Llama Stack and available via the /models endpoint. - prompt: - oneOf: - - type: string - - type: array - items: - type: string - - type: array - items: - type: integer - - type: array - items: - type: array - items: - type: integer - description: The prompt to generate a completion for. - best_of: - type: integer - description: >- - (Optional) The number of completions to generate. - echo: - type: boolean - description: (Optional) Whether to echo the prompt. - frequency_penalty: - type: number - description: >- - (Optional) The penalty for repeated tokens. - logit_bias: - type: object - additionalProperties: - type: number - description: (Optional) The logit bias to use. - logprobs: - type: boolean - description: (Optional) The log probabilities to use. - max_tokens: - type: integer - description: >- - (Optional) The maximum number of tokens to generate. - n: - type: integer - description: >- - (Optional) The number of completions to generate. - presence_penalty: - type: number - description: >- - (Optional) The penalty for repeated tokens. - seed: - type: integer - description: (Optional) The seed to use. - stop: - oneOf: - - type: string - - type: array - items: - type: string - description: (Optional) The stop tokens to use. - stream: - type: boolean - description: >- - (Optional) Whether to stream the response. - stream_options: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The stream options to use. - temperature: - type: number - description: (Optional) The temperature to use. - top_p: - type: number - description: (Optional) The top p to use. - user: - type: string - description: (Optional) The user to use. - suffix: - type: string - description: >- - (Optional) The suffix that should be appended to the completion. - additionalProperties: false - required: - - model - - prompt - title: OpenAICompletionRequestWithExtraBody - description: >- - Request parameters for OpenAI-compatible completion endpoint. - OpenAICompletion: - type: object - properties: - id: - type: string - choices: - type: array - items: - $ref: '#/components/schemas/OpenAICompletionChoice' - created: - type: integer - model: - type: string - object: - type: string - const: text_completion - default: text_completion - additionalProperties: false - required: - - id - - choices - - created - - model - - object - title: OpenAICompletion - description: >- - Response from an OpenAI-compatible completion request. - OpenAICompletionChoice: - type: object - properties: - finish_reason: - type: string - text: - type: string - index: - type: integer - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - additionalProperties: false - required: - - finish_reason - - text - - index - title: OpenAICompletionChoice + title: OpenAICompletionChoice description: >- A choice from an OpenAI-compatible completion response. ConversationItem: @@ -6361,1326 +7435,1281 @@ components: Web search tool call output message for OpenAI responses. CreateConversationRequest: type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/ConversationItem' - description: >- - Initial items to include in the conversation context. - metadata: - type: object - additionalProperties: - type: string - description: >- - Set of key-value pairs that can be attached to an object. - additionalProperties: false - title: CreateConversationRequest Conversation: - type: object + description: OpenAI-compatible conversation object. properties: id: + description: The unique ID of the conversation. + title: Id type: string object: - type: string const: conversation default: conversation + description: >- + The object type, which is always conversation. + title: Object + type: string created_at: + description: >- + The time at which the conversation was created, measured in seconds since + the Unix epoch. + title: Created At type: integer metadata: - type: object - additionalProperties: - type: string + anyOf: + - additionalProperties: + type: string + type: object + - type: 'null' + description: >- + Set of 16 key-value pairs that can be attached to an object. This can + be useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + title: Metadata items: - type: array - items: - type: object - title: dict - description: >- - dict() -> new empty dictionary dict(mapping) -> new dictionary initialized - from a mapping object's (key, value) pairs dict(iterable) -> new - dictionary initialized as if via: d = {} for k, v in iterable: d[k] - = v dict(**kwargs) -> new dictionary initialized with the name=value - pairs in the keyword argument list. For example: dict(one=1, two=2) - additionalProperties: false + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + description: >- + Initial items to include in the conversation context. You may add up to + 20 items at a time. + title: Items required: - id - - object - created_at title: Conversation - description: OpenAI-compatible conversation object. + type: object UpdateConversationRequest: type: object - properties: - metadata: - type: object - additionalProperties: - type: string - description: >- - Set of key-value pairs that can be attached to an object. - additionalProperties: false - required: - - metadata - title: UpdateConversationRequest ConversationDeletedResource: - type: object + description: Response for deleted conversation. properties: id: + description: The deleted conversation identifier + title: Id type: string object: - type: string default: conversation.deleted + description: Object type + title: Object + type: string deleted: - type: boolean default: true - additionalProperties: false + description: Whether the object was deleted + title: Deleted + type: boolean required: - id - - object - - deleted title: ConversationDeletedResource - description: Response for deleted conversation. - ConversationItemList: - type: object - properties: - object: - type: string - default: list - data: - type: array - items: - $ref: '#/components/schemas/ConversationItem' - first_id: - type: string - last_id: - type: string - has_more: - type: boolean - default: false - additionalProperties: false - required: - - object - - data - - has_more - title: ConversationItemList - description: >- - List of conversation items with pagination. - AddItemsRequest: type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/ConversationItem' - description: >- - Items to include in the conversation context. - additionalProperties: false - required: - - items - title: AddItemsRequest - ConversationItemDeletedResource: + list: type: object - properties: - id: - type: string - object: - type: string - default: conversation.item.deleted - deleted: - type: boolean - default: true - additionalProperties: false - required: - - id - - object - - deleted - title: ConversationItemDeletedResource - description: Response for deleted conversation item. - OpenAIEmbeddingsRequestWithExtraBody: + Literal: type: object - properties: - model: - type: string - description: >- - The identifier of the model to use. The model must be an embedding model - registered with Llama Stack and available via the /models endpoint. - input: - oneOf: - - type: string - - type: array - items: - type: string - description: >- - Input text to embed, encoded as a string or array of strings. To embed - multiple inputs in a single request, pass an array of strings. - encoding_format: - type: string - default: float - description: >- - (Optional) The format to return the embeddings in. Can be either "float" - or "base64". Defaults to "float". - dimensions: - type: integer + ConversationItemList: + $defs: + MCPListToolsTool: description: >- - (Optional) The number of dimensions the resulting output embeddings should - have. Only supported in text-embedding-3 and later models. - user: - type: string + Tool definition returned by MCP list tools operation. + + + :param input_schema: JSON schema defining the tool's input parameters + + :param name: Name of the tool + + :param description: (Optional) Description of what the tool does + properties: + input_schema: + additionalProperties: true + title: Input Schema + type: object + name: + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + required: + - input_schema + - name + title: MCPListToolsTool + type: object + OpenAIResponseAnnotationCitation: description: >- - (Optional) A unique identifier representing your end-user, which can help - OpenAI to monitor and detect abuse. - additionalProperties: false - required: - - model - - input - title: OpenAIEmbeddingsRequestWithExtraBody - description: >- - Request parameters for OpenAI-compatible embeddings endpoint. - OpenAIEmbeddingData: - type: object - properties: - object: - type: string - const: embedding - default: embedding - description: >- - The object type, which will be "embedding" - embedding: - oneOf: - - type: array - items: - type: number - - type: string - description: >- - The embedding vector as a list of floats (when encoding_format="float") - or as a base64-encoded string (when encoding_format="base64") - index: - type: integer - description: >- - The index of the embedding in the input list - additionalProperties: false - required: - - object - - embedding - - index - title: OpenAIEmbeddingData - description: >- - A single embedding data object from an OpenAI-compatible embeddings response. - OpenAIEmbeddingUsage: - type: object - properties: - prompt_tokens: - type: integer - description: The number of tokens in the input - total_tokens: - type: integer - description: The total number of tokens used - additionalProperties: false - required: - - prompt_tokens - - total_tokens - title: OpenAIEmbeddingUsage - description: >- - Usage information for an OpenAI-compatible embeddings response. - OpenAIEmbeddingsResponse: - type: object - properties: - object: - type: string - const: list - default: list - description: The object type, which will be "list" - data: - type: array - items: - $ref: '#/components/schemas/OpenAIEmbeddingData' - description: List of embedding data objects - model: - type: string - description: >- - The model that was used to generate the embeddings - usage: - $ref: '#/components/schemas/OpenAIEmbeddingUsage' - description: Usage information - additionalProperties: false - required: - - object - - data - - model - - usage - title: OpenAIEmbeddingsResponse - description: >- - Response from an OpenAI-compatible embeddings request. - OpenAIFilePurpose: - type: string - enum: - - assistants - - batch - title: OpenAIFilePurpose - description: >- - Valid purpose values for OpenAI Files API. - ListOpenAIFileResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAIFileObject' - description: List of file objects - has_more: - type: boolean - description: >- - Whether there are more files available beyond this page - first_id: - type: string - description: >- - ID of the first file in the list for pagination - last_id: - type: string - description: >- - ID of the last file in the list for pagination - object: - type: string - const: list - default: list - description: The object type, which is always "list" - additionalProperties: false - required: - - data - - has_more - - first_id - - last_id - - object - title: ListOpenAIFileResponse - description: >- - Response for listing files in OpenAI Files API. - OpenAIFileObject: - type: object - properties: - object: - type: string - const: file - default: file - description: The object type, which is always "file" - id: - type: string - description: >- - The file identifier, which can be referenced in the API endpoints - bytes: - type: integer - description: The size of the file, in bytes - created_at: - type: integer - description: >- - The Unix timestamp (in seconds) for when the file was created - expires_at: - type: integer - description: >- - The Unix timestamp (in seconds) for when the file expires - filename: - type: string - description: The name of the file - purpose: - type: string - enum: - - assistants - - batch - description: The intended purpose of the file - additionalProperties: false - required: - - object - - id - - bytes - - created_at - - expires_at - - filename - - purpose - title: OpenAIFileObject - description: >- - OpenAI File object as defined in the OpenAI Files API. - ExpiresAfter: - type: object - properties: - anchor: - type: string - const: created_at - seconds: - type: integer - additionalProperties: false - required: - - anchor - - seconds - title: ExpiresAfter - description: >- - Control expiration of uploaded files. + URL citation annotation for referencing external web resources. - Params: - - anchor, must be "created_at" - - seconds, must be int between 3600 and 2592000 (1 hour to 30 days) - OpenAIFileDeleteResponse: - type: object - properties: - id: - type: string - description: The file identifier that was deleted - object: - type: string - const: file - default: file - description: The object type, which is always "file" - deleted: - type: boolean - description: >- - Whether the file was successfully deleted - additionalProperties: false - required: - - id - - object - - deleted - title: OpenAIFileDeleteResponse - description: >- - Response for deleting a file in OpenAI Files API. - Response: - type: object - title: Response - HealthInfo: - type: object - properties: - status: - type: string - enum: - - OK - - Error - - Not Implemented - description: Current health status of the service - additionalProperties: false - required: - - status - title: HealthInfo - description: >- - Health status information for the service. - RouteInfo: - type: object - properties: - route: - type: string - description: The API endpoint path - method: - type: string - description: HTTP method for the route - provider_types: - type: array - items: - type: string - description: >- - List of provider types that implement this route - additionalProperties: false - required: - - route - - method - - provider_types - title: RouteInfo - description: >- - Information about an API route including its path, method, and implementing - providers. - ListRoutesResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/RouteInfo' + + :param type: Annotation type identifier, always "url_citation" + + :param end_index: End position of the citation span in the content + + :param start_index: Start position of the citation span in the content + + :param title: Title of the referenced web resource + + :param url: URL of the referenced web resource + properties: + type: + const: url_citation + default: url_citation + title: Type + type: string + end_index: + title: End Index + type: integer + start_index: + title: Start Index + type: integer + title: + title: Title + type: string + url: + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + "OpenAIResponseAnnotationContainerFileCitation": + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: >- + OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: description: >- - List of available route information objects - additionalProperties: false - required: - - data - title: ListRoutesResponse - description: >- - Response containing a list of all available API routes. - OpenAIModel: - type: object - properties: - id: - type: string - object: - type: string - const: model - default: model - created: - type: integer - owned_by: - type: string - custom_metadata: + File citation annotation for referencing specific files in response content. + + + :param type: Annotation type identifier, always "file_citation" + + :param file_id: Unique identifier of the referenced file + + :param filename: Name of the referenced file + + :param index: Position index of the citation within the content + properties: + type: + const: file_citation + default: file_citation + title: Type + type: string + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + index: + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - additionalProperties: false - required: - - id - - object - - created - - owned_by - title: OpenAIModel - description: A model from OpenAI. - OpenAIListModelsResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAIModel' - additionalProperties: false - required: - - data - title: OpenAIListModelsResponse - ModelType: - type: string - enum: - - llm - - embedding - - rerank - title: ModelType - description: >- - Enumeration of supported model types in Llama Stack. - RegisterModelRequest: - type: object - properties: - model_id: - type: string - description: The identifier of the model to register. - provider_model_id: - type: string + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: + description: >- + Refusal content within a streamed response part. + + + :param type: Content part type identifier, always "refusal" + + :param refusal: Refusal text supplied by the model + properties: + type: + const: refusal + default: refusal + title: Type + type: string + refusal: + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + "OpenAIResponseInputFunctionToolCallOutput": description: >- - The identifier of the model in the provider. - provider_id: - type: string - description: The identifier of the provider. - metadata: + This represents the output of a function call that gets passed back to + the model. + properties: + call_id: + title: Call Id + type: string + output: + title: Output + type: string + type: + const: function_call_output + default: function_call_output + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - call_id + - output + title: >- + OpenAIResponseInputFunctionToolCallOutput type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Any additional metadata for this model. - model_type: - $ref: '#/components/schemas/ModelType' - description: The type of model to register. - additionalProperties: false - required: - - model_id - title: RegisterModelRequest - Model: - type: object - properties: - identifier: - type: string + OpenAIResponseInputMessageContentImage: description: >- - Unique identifier for this resource in llama stack - provider_resource_id: - type: string + Image content for input messages in OpenAI response format. + + + :param detail: Level of detail for image processing, can be "low", "high", + or "auto" + + :param type: Content type identifier, always "input_image" + + :param image_url: (Optional) URL of the image content + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + title: Detail + type: + const: input_image + default: input_image + title: Type + type: string + image_url: + anyOf: + - type: string + - type: 'null' + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: description: >- - Unique identifier for this resource in the provider - provider_id: - type: string + Text content for input messages in OpenAI response format. + + + :param text: The text content of the input message + + :param type: Content type identifier, always "input_text" + properties: + text: + title: Text + type: string + type: + const: input_text + default: input_text + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseMCPApprovalRequest: description: >- - ID of the provider that owns this resource - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: model - default: model + A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments + type: string + id: + title: Id + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMCPApprovalResponse: + description: A response to an MCP approval request. + properties: + approval_request_id: + title: Approval Request Id + type: string + approve: + title: Approve + type: boolean + type: + const: mcp_approval_response + default: mcp_approval_response + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + reason: + anyOf: + - type: string + - type: 'null' + title: Reason + required: + - approval_request_id + - approve + title: OpenAIResponseMCPApprovalResponse + type: object + OpenAIResponseMessage: description: >- - The resource type, always 'model' for model resources - metadata: + Corresponds to the various Message types in the Responses API. + + They are all under one type because the Responses API gives them all + + the same "type" value, and there is no way to tell them apart in certain + + scenarios. + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_image: >- + #/$defs/OpenAIResponseInputMessageContentImage + input_text: >- + #/$defs/OpenAIResponseInputMessageContentText + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentText + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentImage + type: array + - items: + discriminator: + mapping: + output_text: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + - $ref: '#/$defs/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - content + - role + title: OpenAIResponseMessage type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Any additional metadata for this model - model_type: - $ref: '#/components/schemas/ModelType' - default: llm + "OpenAIResponseOutputMessageContentOutputText": + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + file_citation: >- + #/$defs/OpenAIResponseAnnotationFileCitation + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseAnnotationFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationCitation' + - $ref: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: >- + OpenAIResponseOutputMessageContentOutputText + type: object + "OpenAIResponseOutputMessageFileSearchToolCall": description: >- - The type of model (LLM or embedding model) - additionalProperties: false - required: - - identifier - - provider_id - - type - - metadata - - model_type - title: Model - description: >- - A model resource representing an AI model registered in Llama Stack. - RunModerationRequest: - type: object - properties: - input: - oneOf: - - type: string - - type: array + File search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param queries: List of search queries executed + + :param status: Current status of the file search operation + + :param type: Tool call type identifier, always "file_search_call" + + :param results: (Optional) Search results returned by the file search + operation + properties: + id: + title: Id + type: string + queries: items: type: string + title: Queries + type: array + status: + title: Status + type: string + type: + const: file_search_call + default: file_search_call + title: Type + type: string + results: + anyOf: + - items: + $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults + type: array + - type: 'null' + title: Results + required: + - id + - queries + - status + title: >- + OpenAIResponseOutputMessageFileSearchToolCall + type: object + "OpenAIResponseOutputMessageFileSearchToolCallResults": description: >- - Input (or inputs) to classify. Can be a single string, an array of strings, - or an array of multi-modal input objects similar to other models. - model: - type: string - description: >- - (Optional) The content moderation model you would like to use. - additionalProperties: false - required: - - input - title: RunModerationRequest - ModerationObject: - type: object - properties: - id: - type: string - description: >- - The unique identifier for the moderation request. - model: - type: string + Search results returned by the file search operation. + + + :param attributes: (Optional) Key-value attributes associated with the + file + + :param file_id: Unique identifier of the file containing the result + + :param filename: Name of the file containing the result + + :param score: Relevance score for this search result (between 0 and 1) + + :param text: Text content of the search result + properties: + attributes: + additionalProperties: true + title: Attributes + type: object + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + score: + title: Score + type: number + text: + title: Text + type: string + required: + - attributes + - file_id + - filename + - score + - text + title: >- + OpenAIResponseOutputMessageFileSearchToolCallResults + type: object + "OpenAIResponseOutputMessageFunctionToolCall": description: >- - The model used to generate the moderation results. - results: - type: array - items: - $ref: '#/components/schemas/ModerationObjectResults' - description: A list of moderation objects - additionalProperties: false - required: - - id - - model - - results - title: ModerationObject - description: A moderation object. - ModerationObjectResults: - type: object - properties: - flagged: - type: boolean + Function tool call output message for OpenAI responses. + + + :param call_id: Unique identifier for the function call + + :param name: Name of the function being called + + :param arguments: JSON string containing the function arguments + + :param type: Tool call type identifier, always "function_call" + + :param id: (Optional) Additional identifier for the tool call + + :param status: (Optional) Current status of the function call execution + properties: + call_id: + title: Call Id + type: string + name: + title: Name + type: string + arguments: + title: Arguments + type: string + type: + const: function_call + default: function_call + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - call_id + - name + - arguments + title: >- + OpenAIResponseOutputMessageFunctionToolCall + type: object + OpenAIResponseOutputMessageMCPCall: description: >- - Whether any of the below categories are flagged. - categories: + Model Context Protocol (MCP) call output message for OpenAI responses. + + + :param id: Unique identifier for this MCP call + + :param type: Tool call type identifier, always "mcp_call" + + :param arguments: JSON string containing the MCP call arguments + + :param name: Name of the MCP method being called + + :param server_label: Label identifying the MCP server handling the call + + :param error: (Optional) Error message if the MCP call failed + + :param output: (Optional) Output result from the successful MCP call + properties: + id: + title: Id + type: string + type: + const: mcp_call + default: mcp_call + title: Type + type: string + arguments: + title: Arguments + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + error: + anyOf: + - type: string + - type: 'null' + title: Error + output: + anyOf: + - type: string + - type: 'null' + title: Output + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall type: object - additionalProperties: - type: boolean + OpenAIResponseOutputMessageMCPListTools: description: >- - A list of the categories, and whether they are flagged or not. - category_applied_input_types: - type: object - additionalProperties: - type: array - items: + MCP list tools output message containing available tools from an MCP server. + + + :param id: Unique identifier for this MCP list tools operation + + :param type: Tool call type identifier, always "mcp_list_tools" + + :param server_label: Label identifying the MCP server providing the tools + + :param tools: List of available tools provided by the MCP server + properties: + id: + title: Id type: string - description: >- - A list of the categories along with the input type(s) that the score applies - to. - category_scores: + type: + const: mcp_list_tools + default: mcp_list_tools + title: Type + type: string + server_label: + title: Server Label + type: string + tools: + items: + $ref: '#/$defs/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools type: object - additionalProperties: - type: number + "OpenAIResponseOutputMessageWebSearchToolCall": description: >- - A list of the categories along with their scores as predicted by model. - user_message: - type: string - metadata: + Web search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param status: Current status of the web search operation + + :param type: Tool call type identifier, always "web_search_call" + properties: + id: + title: Id + type: string + status: + title: Status + type: string + type: + const: web_search_call + default: web_search_call + title: Type + type: string + required: + - id + - status + title: >- + OpenAIResponseOutputMessageWebSearchToolCall type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - additionalProperties: false - required: - - flagged - - metadata - title: ModerationObjectResults - description: A moderation object. - Prompt: - type: object - properties: - prompt: - type: string - description: >- - The system prompt text with variable placeholders. Variables are only - supported when using the Responses API. - version: - type: integer - description: >- - Version (integer starting at 1, incremented on save) - prompt_id: - type: string - description: >- - Unique identifier formatted as 'pmpt_<48-digit-hash>' - variables: - type: array - items: - type: string - description: >- - List of prompt variable names that can be used in the prompt template - is_default: - type: boolean - default: false - description: >- - Boolean indicating whether this version is the default version for this - prompt - additionalProperties: false - required: - - version - - prompt_id - - variables - - is_default - title: Prompt description: >- - A prompt resource representing a stored OpenAI Compatible prompt template - in Llama Stack. - ListPromptsResponse: - type: object + List of conversation items with pagination. properties: + object: + default: list + description: Object type + title: Object + type: string data: - type: array + description: List of conversation items items: - $ref: '#/components/schemas/Prompt' - additionalProperties: false + discriminator: + mapping: + file_search_call: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + function_call: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + function_call_output: >- + #/$defs/OpenAIResponseInputFunctionToolCallOutput + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: >- + #/$defs/OpenAIResponseMCPApprovalResponse + mcp_call: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + mcp_list_tools: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + message: '#/$defs/OpenAIResponseMessage' + web_search_call: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseMessage' + - $ref: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + - $ref: >- + #/$defs/OpenAIResponseInputFunctionToolCallOutput + - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' + - $ref: >- + #/$defs/OpenAIResponseMCPApprovalResponse + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + title: Data + type: array + first_id: + anyOf: + - type: string + - type: 'null' + description: The ID of the first item in the list + title: First Id + last_id: + anyOf: + - type: string + - type: 'null' + description: The ID of the last item in the list + title: Last Id + has_more: + default: false + description: Whether there are more items available + title: Has More + type: boolean required: - data - title: ListPromptsResponse - description: Response model to list prompts. - CreatePromptRequest: + title: ConversationItemList type: object - properties: - prompt: - type: string - description: >- - The prompt text content with variable placeholders. - variables: - type: array - items: - type: string - description: >- - List of variable names that can be used in the prompt template. - additionalProperties: false - required: - - prompt - title: CreatePromptRequest - UpdatePromptRequest: + AddItemsRequest: type: object + ConversationItemDeletedResource: + description: Response for deleted conversation item. properties: - prompt: + id: + description: The deleted item identifier + title: Id type: string - description: The updated prompt text content. - version: - type: integer - description: >- - The current version of the prompt being updated. - variables: - type: array - items: - type: string - description: >- - Updated list of variable names that can be used in the prompt template. - set_as_default: + object: + default: conversation.item.deleted + description: Object type + title: Object + type: string + deleted: + default: true + description: Whether the object was deleted + title: Deleted type: boolean - description: >- - Set the new version as the default (default=True). - additionalProperties: false - required: - - prompt - - version - - set_as_default - title: UpdatePromptRequest - SetDefaultVersionRequest: - type: object - properties: - version: - type: integer - description: The version to set as default. - additionalProperties: false required: - - version - title: SetDefaultVersionRequest - ProviderInfo: + - id + title: ConversationItemDeletedResource type: object - properties: - api: - type: string - description: The API name this provider implements - provider_id: - type: string - description: Unique identifier for the provider - provider_type: - type: string - description: The type of provider implementation - config: + OpenAIEmbeddingsResponse: + $defs: + OpenAIEmbeddingData: + description: >- + A single embedding data object from an OpenAI-compatible embeddings response. + + + :param object: The object type, which will be "embedding" + + :param embedding: The embedding vector as a list of floats (when encoding_format="float") + or as a base64-encoded string (when encoding_format="base64") + + :param index: The index of the embedding in the input list + properties: + object: + const: embedding + default: embedding + title: Object + type: string + embedding: + anyOf: + - items: + type: number + type: array + - type: string + title: Embedding + index: + title: Index + type: integer + required: + - embedding + - index + title: OpenAIEmbeddingData type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + OpenAIEmbeddingUsage: description: >- - Configuration parameters for the provider - health: + Usage information for an OpenAI-compatible embeddings response. + + + :param prompt_tokens: The number of tokens in the input + + :param total_tokens: The total number of tokens used + properties: + prompt_tokens: + title: Prompt Tokens + type: integer + total_tokens: + title: Total Tokens + type: integer + required: + - prompt_tokens + - total_tokens + title: OpenAIEmbeddingUsage type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Current health status of the provider - additionalProperties: false - required: - - api - - provider_id - - provider_type - - config - - health - title: ProviderInfo description: >- - Information about a registered provider including its configuration and health - status. - ListProvidersResponse: - type: object + Response from an OpenAI-compatible embeddings request. + + + :param object: The object type, which will be "list" + + :param data: List of embedding data objects + + :param model: The model that was used to generate the embeddings + + :param usage: Usage information properties: + object: + const: list + default: list + title: Object + type: string data: - type: array items: - $ref: '#/components/schemas/ProviderInfo' - description: List of provider information objects - additionalProperties: false + $ref: '#/$defs/OpenAIEmbeddingData' + title: Data + type: array + model: + title: Model + type: string + usage: + $ref: '#/$defs/OpenAIEmbeddingUsage' required: - data - title: ListProvidersResponse + - model + - usage + title: OpenAIEmbeddingsResponse + type: object + OpenAIFilePurpose: + type: object + ListOpenAIFileResponse: + $defs: + OpenAIFileObject: + description: >- + OpenAI File object as defined in the OpenAI Files API. + + + :param object: The object type, which is always "file" + + :param id: The file identifier, which can be referenced in the API endpoints + + :param bytes: The size of the file, in bytes + + :param created_at: The Unix timestamp (in seconds) for when the file was + created + + :param expires_at: The Unix timestamp (in seconds) for when the file expires + + :param filename: The name of the file + + :param purpose: The intended purpose of the file + properties: + object: + const: file + default: file + title: Object + type: string + id: + title: Id + type: string + bytes: + title: Bytes + type: integer + created_at: + title: Created At + type: integer + expires_at: + title: Expires At + type: integer + filename: + title: Filename + type: string + purpose: + $ref: '#/$defs/OpenAIFilePurpose' + required: + - id + - bytes + - created_at + - expires_at + - filename + - purpose + title: OpenAIFileObject + type: object + OpenAIFilePurpose: + description: >- + Valid purpose values for OpenAI Files API. + enum: + - assistants + - batch + title: OpenAIFilePurpose + type: string description: >- - Response containing a list of all available providers. - ListOpenAIResponseObject: - type: object + Response for listing files in OpenAI Files API. + + + :param data: List of file objects + + :param has_more: Whether there are more files available beyond this page + + :param first_id: ID of the first file in the list for pagination + + :param last_id: ID of the last file in the list for pagination + + :param object: The object type, which is always "list" properties: data: - type: array items: - $ref: '#/components/schemas/OpenAIResponseObjectWithInput' - description: >- - List of response objects with their input context + $ref: '#/$defs/OpenAIFileObject' + title: Data + type: array has_more: + title: Has More type: boolean - description: >- - Whether there are more results available beyond this page first_id: + title: First Id type: string - description: >- - Identifier of the first item in this page last_id: + title: Last Id type: string - description: Identifier of the last item in this page object: - type: string const: list default: list - description: Object type identifier, always "list" - additionalProperties: false + title: Object + type: string required: - data - has_more - first_id - last_id - - object - title: ListOpenAIResponseObject - description: >- - Paginated list of OpenAI response objects with navigation metadata. - OpenAIResponseError: + title: ListOpenAIFileResponse type: object - properties: - code: - type: string - description: >- - Error code identifying the type of failure - message: - type: string - description: >- - Human-readable error message describing the failure - additionalProperties: false - required: - - code - - message - title: OpenAIResponseError + ExpiresAfter: description: >- - Error details for failed OpenAI response requests. - OpenAIResponseInput: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutput' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseMessage' - OpenAIResponseInputToolFileSearch: - type: object + Control expiration of uploaded files. + + + Params: + - anchor, must be "created_at" + - seconds, must be int between 3600 and 2592000 (1 hour to 30 days) properties: - type: + anchor: + const: created_at + title: Anchor type: string - const: file_search - default: file_search - description: >- - Tool type identifier, always "file_search" - vector_store_ids: - type: array - items: - type: string - description: >- - List of vector store identifiers to search within - filters: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional filters to apply to the search - max_num_results: + seconds: + maximum: 2592000 + minimum: 3600 + title: Seconds type: integer - default: 10 - description: >- - (Optional) Maximum number of search results to return (1-50) - ranking_options: - type: object - properties: - ranker: - type: string - description: >- - (Optional) Name of the ranking algorithm to use - score_threshold: - type: number - default: 0.0 - description: >- - (Optional) Minimum relevance score threshold for results - additionalProperties: false - description: >- - (Optional) Options for ranking and scoring search results - additionalProperties: false required: - - type - - vector_store_ids - title: OpenAIResponseInputToolFileSearch - description: >- - File search tool configuration for OpenAI response inputs. - OpenAIResponseInputToolFunction: + - anchor + - seconds + title: ExpiresAfter type: object - properties: - type: - type: string - const: function - default: function - description: Tool type identifier, always "function" - name: - type: string - description: Name of the function that can be called - description: - type: string - description: >- - (Optional) Description of what the function does - parameters: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON schema defining the function's parameters - strict: - type: boolean + OpenAIFileObject: + $defs: + OpenAIFilePurpose: description: >- - (Optional) Whether to enforce strict parameter validation - additionalProperties: false - required: - - type - - name - title: OpenAIResponseInputToolFunction - description: >- - Function tool configuration for OpenAI response inputs. - OpenAIResponseInputToolWebSearch: - type: object - properties: - type: - oneOf: - - type: string - const: web_search - - type: string - const: web_search_preview - - type: string - const: web_search_preview_2025_03_11 - default: web_search - description: Web search tool type variant to use - search_context_size: + Valid purpose values for OpenAI Files API. + enum: + - assistants + - batch + title: OpenAIFilePurpose type: string - default: medium - description: >- - (Optional) Size of search context, must be "low", "medium", or "high" - additionalProperties: false - required: - - type - title: OpenAIResponseInputToolWebSearch description: >- - Web search tool configuration for OpenAI response inputs. - OpenAIResponseObjectWithInput: - type: object + OpenAI File object as defined in the OpenAI Files API. + + + :param object: The object type, which is always "file" + + :param id: The file identifier, which can be referenced in the API endpoints + + :param bytes: The size of the file, in bytes + + :param created_at: The Unix timestamp (in seconds) for when the file was created + + :param expires_at: The Unix timestamp (in seconds) for when the file expires + + :param filename: The name of the file + + :param purpose: The intended purpose of the file properties: - created_at: - type: integer - description: >- - Unix timestamp when the response was created - error: - $ref: '#/components/schemas/OpenAIResponseError' - description: >- - (Optional) Error details if the response generation failed - id: - type: string - description: Unique identifier for this response - model: - type: string - description: Model identifier used for generation - object: - type: string - const: response - default: response - description: >- - Object type identifier, always "response" - output: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseOutput' - description: >- - List of generated output items (messages, tool calls, etc.) - parallel_tool_calls: - type: boolean - default: false - description: >- - Whether tool calls can be executed in parallel - previous_response_id: - type: string - description: >- - (Optional) ID of the previous response in a conversation - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - description: >- - (Optional) Reference to a prompt template and its variables. - status: - type: string - description: >- - Current status of the response generation - temperature: - type: number - description: >- - (Optional) Sampling temperature used for generation - text: - $ref: '#/components/schemas/OpenAIResponseText' - description: >- - Text formatting configuration for the response - top_p: - type: number - description: >- - (Optional) Nucleus sampling parameter used for generation - tools: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseTool' - description: >- - (Optional) An array of tools the model may call while generating a response. - truncation: - type: string - description: >- - (Optional) Truncation strategy applied to the response - usage: - $ref: '#/components/schemas/OpenAIResponseUsage' - description: >- - (Optional) Token usage information for the response - instructions: + object: + const: file + default: file + title: Object type: string - description: >- - (Optional) System message inserted into the model's context - input: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInput' - description: >- - List of input items that led to this response - additionalProperties: false + id: + title: Id + type: string + bytes: + title: Bytes + type: integer + created_at: + title: Created At + type: integer + expires_at: + title: Expires At + type: integer + filename: + title: Filename + type: string + purpose: + $ref: '#/$defs/OpenAIFilePurpose' required: - - created_at - id - - model - - object - - output - - parallel_tool_calls - - status - - text - - input - title: OpenAIResponseObjectWithInput - description: >- - OpenAI response object extended with input context information. - OpenAIResponseOutput: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - OpenAIResponsePrompt: + - bytes + - created_at + - expires_at + - filename + - purpose + title: OpenAIFileObject type: object + OpenAIFileDeleteResponse: + description: >- + Response for deleting a file in OpenAI Files API. + + + :param id: The file identifier that was deleted + + :param object: The object type, which is always "file" + + :param deleted: Whether the file was successfully deleted properties: id: + title: Id type: string - description: Unique identifier of the prompt template - variables: - type: object - additionalProperties: - $ref: '#/components/schemas/OpenAIResponseInputMessageContent' - description: >- - Dictionary of variable names to OpenAIResponseInputMessageContent structure - for template substitution. The substitution values can either be strings, - or other Response input types like images or files. - version: + object: + const: file + default: file + title: Object type: string - description: >- - Version number of the prompt to use (defaults to latest if not specified) - additionalProperties: false + deleted: + title: Deleted + type: boolean required: - id - title: OpenAIResponsePrompt - description: >- - OpenAI compatible Prompt object that is used in OpenAI responses. - OpenAIResponseText: + - deleted + title: OpenAIFileDeleteResponse + type: object + Response: type: object + HealthInfo: + $defs: + HealthStatus: + enum: + - OK + - Error + - Not Implemented + title: HealthStatus + type: string + description: >- + Health status information for the service. + + + :param status: Current health status of the service properties: - format: - type: object + status: + $ref: '#/$defs/HealthStatus' + required: + - status + title: HealthInfo + type: object + ListRoutesResponse: + $defs: + RouteInfo: + description: >- + Information about an API route including its path, method, and implementing + providers. + + + :param route: The API endpoint path + + :param method: HTTP method for the route + + :param provider_types: List of provider types that implement this route properties: - type: - oneOf: - - type: string - const: text - - type: string - const: json_schema - - type: string - const: json_object - description: >- - Must be "text", "json_schema", or "json_object" to identify the format - type - name: + route: + title: Route type: string - description: >- - The name of the response format. Only used for json_schema. - schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The JSON schema the response should conform to. In a Python SDK, this - is often a `pydantic` model. Only used for json_schema. - description: + method: + title: Method type: string - description: >- - (Optional) A description of the response format. Only used for json_schema. - strict: - type: boolean - description: >- - (Optional) Whether to strictly enforce the JSON schema. If true, the - response must match the schema exactly. Only used for json_schema. - additionalProperties: false + provider_types: + items: + type: string + title: Provider Types + type: array required: - - type - description: >- - (Optional) Text format configuration specifying output format requirements - additionalProperties: false - title: OpenAIResponseText + - route + - method + - provider_types + title: RouteInfo + type: object description: >- - Text response configuration for OpenAI responses. - OpenAIResponseTool: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseToolMCP' - discriminator: - propertyName: type - mapping: - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseToolMCP' - OpenAIResponseToolMCP: - type: object + Response containing a list of all available API routes. + + + :param data: List of available route information objects properties: - type: - type: string - const: mcp - default: mcp - description: Tool type identifier, always "mcp" - server_label: - type: string - description: Label to identify this MCP server - allowed_tools: - oneOf: - - type: array - items: - type: string - - type: object - properties: - tool_names: - type: array - items: - type: string - description: >- - (Optional) List of specific tool names that are allowed - additionalProperties: false - title: AllowedToolsFilter - description: >- - Filter configuration for restricting which MCP tools can be used. - description: >- - (Optional) Restriction on which tools can be used from this server - additionalProperties: false + data: + items: + $ref: '#/$defs/RouteInfo' + title: Data + type: array required: - - type - - server_label - title: OpenAIResponseToolMCP + - data + title: ListRoutesResponse description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response object. - OpenAIResponseUsage: + Response containing a list of all available API routes. + OpenAIModel: type: object properties: - input_tokens: - type: integer - description: Number of tokens in the input - output_tokens: - type: integer - description: Number of tokens in the output - total_tokens: + id: + type: string + object: + type: string + const: model + default: model + created: type: integer - description: Total tokens used (input + output) - input_tokens_details: - type: object - properties: - cached_tokens: - type: integer - description: Number of tokens retrieved from cache - additionalProperties: false - description: Detailed breakdown of input token usage - output_tokens_details: + owned_by: + type: string + custom_metadata: type: object - properties: - reasoning_tokens: - type: integer - description: >- - Number of tokens used for reasoning (o1/o3 models) - additionalProperties: false - description: Detailed breakdown of output token usage + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object additionalProperties: false required: - - input_tokens - - output_tokens - - total_tokens - title: OpenAIResponseUsage - description: Usage information for OpenAI response. - ResponseGuardrailSpec: + - id + - object + - created + - owned_by + title: OpenAIModel + description: A model from OpenAI. + OpenAIListModelsResponse: type: object properties: - type: - type: string - description: The type/identifier of the guardrail. + data: + type: array + items: + $ref: '#/components/schemas/OpenAIModel' additionalProperties: false required: - - type - title: ResponseGuardrailSpec + - data + title: OpenAIListModelsResponse + ModelType: + type: string + enum: + - llm + - embedding + - rerank + title: ModelType description: >- - Specification for a guardrail to apply during response generation. - OpenAIResponseInputTool: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' - discriminator: - propertyName: type - mapping: - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseInputToolMCP' - OpenAIResponseInputToolMCP: + Enumeration of supported model types in Llama Stack. + RegisterModelRequest: type: object properties: - type: + model_id: type: string - const: mcp - default: mcp - description: Tool type identifier, always "mcp" - server_label: + description: The identifier of the model to register. + provider_model_id: type: string - description: Label to identify this MCP server - server_url: + description: >- + The identifier of the model in the provider. + provider_id: type: string - description: URL endpoint of the MCP server - headers: + description: The identifier of the provider. + metadata: type: object additionalProperties: oneOf: @@ -7690,2237 +8719,4999 @@ components: - type: string - type: array - type: object + description: Any additional metadata for this model. + model_type: + $ref: '#/components/schemas/ModelType' + description: The type of model to register. + additionalProperties: false + required: + - model_id + title: RegisterModelRequest + Model: + type: object + properties: + identifier: + type: string description: >- - (Optional) HTTP headers to include when connecting to the server - require_approval: - oneOf: - - type: string - const: always - - type: string - const: never - - type: object - properties: - always: - type: array - items: - type: string - description: >- - (Optional) List of tool names that always require approval - never: - type: array - items: - type: string - description: >- - (Optional) List of tool names that never require approval - additionalProperties: false - title: ApprovalFilter - description: >- - Filter configuration for MCP tool approval requirements. - default: never + Unique identifier for this resource in llama stack + provider_resource_id: + type: string description: >- - Approval requirement for tool calls ("always", "never", or filter) - allowed_tools: - oneOf: - - type: array - items: - type: string - - type: object - properties: - tool_names: - type: array - items: - type: string - description: >- - (Optional) List of specific tool names that are allowed - additionalProperties: false - title: AllowedToolsFilter - description: >- - Filter configuration for restricting which MCP tools can be used. + Unique identifier for this resource in the provider + provider_id: + type: string description: >- - (Optional) Restriction on which tools can be used from this server + ID of the provider that owns this resource + type: + type: string + enum: + - model + - shield + - vector_store + - dataset + - scoring_function + - benchmark + - tool + - tool_group + - prompt + const: model + default: model + description: >- + The resource type, always 'model' for model resources + metadata: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: Any additional metadata for this model + model_type: + $ref: '#/components/schemas/ModelType' + default: llm + description: >- + The type of model (LLM or embedding model) additionalProperties: false required: + - identifier + - provider_id - type - - server_label - - server_url - - require_approval - title: OpenAIResponseInputToolMCP + - metadata + - model_type + title: Model description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response inputs. - CreateOpenaiResponseRequest: + A model resource representing an AI model registered in Llama Stack. + RunModerationRequest: + type: object + ModerationObject: + $defs: + ModerationObjectResults: + description: >- + A moderation object. + + :param flagged: Whether any of the below categories are flagged. + + :param categories: A list of the categories, and whether they are flagged + or not. + + :param category_applied_input_types: A list of the categories along with + the input type(s) that the score applies to. + + :param category_scores: A list of the categories along with their scores + as predicted by model. + properties: + flagged: + title: Flagged + type: boolean + categories: + anyOf: + - additionalProperties: + type: boolean + type: object + - type: 'null' + title: Categories + category_applied_input_types: + anyOf: + - additionalProperties: + items: + type: string + type: array + type: object + - type: 'null' + title: Category Applied Input Types + category_scores: + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Category Scores + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + metadata: + additionalProperties: true + title: Metadata + type: object + required: + - flagged + title: ModerationObjectResults + type: object + description: >- + A moderation object. + + :param id: The unique identifier for the moderation request. + + :param model: The model used to generate the moderation results. + + :param results: A list of moderation objects + properties: + id: + title: Id + type: string + model: + title: Model + type: string + results: + items: + $ref: '#/$defs/ModerationObjectResults' + title: Results + type: array + required: + - id + - model + - results + title: ModerationObject + type: object + ListPromptsResponse: + $defs: + Prompt: + description: >- + A prompt resource representing a stored OpenAI Compatible prompt template + in Llama Stack. + + + :param prompt: The system prompt text with variable placeholders. Variables + are only supported when using the Responses API. + + :param version: Version (integer starting at 1, incremented on save) + + :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' + + :param variables: List of prompt variable names that can be used in the + prompt template + + :param is_default: Boolean indicating whether this version is the default + version for this prompt + properties: + prompt: + anyOf: + - type: string + - type: 'null' + description: >- + The system prompt with variable placeholders + title: Prompt + version: + description: >- + Version (integer starting at 1, incremented on save) + minimum: 1 + title: Version + type: integer + prompt_id: + description: >- + Unique identifier in format 'pmpt_<48-digit-hash>' + title: Prompt Id + type: string + variables: + description: >- + List of variable names that can be used in the prompt template + items: + type: string + title: Variables + type: array + is_default: + default: false + description: >- + Boolean indicating whether this version is the default version + title: Is Default + type: boolean + required: + - version + - prompt_id + title: Prompt + type: object + description: Response model to list prompts. + properties: + data: + items: + $ref: '#/$defs/Prompt' + title: Data + type: array + required: + - data + title: ListPromptsResponse + type: object + CreatePromptRequest: type: object + Prompt: + description: >- + A prompt resource representing a stored OpenAI Compatible prompt template + in Llama Stack. + + + :param prompt: The system prompt text with variable placeholders. Variables + are only supported when using the Responses API. + + :param version: Version (integer starting at 1, incremented on save) + + :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' + + :param variables: List of prompt variable names that can be used in the prompt + template + + :param is_default: Boolean indicating whether this version is the default + version for this prompt properties: - input: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInput' - description: Input message(s) to create the response. - model: - type: string - description: The underlying LLM used for completions. prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' + anyOf: + - type: string + - type: 'null' description: >- - (Optional) Prompt object with ID, version, and variables. - instructions: - type: string - previous_response_id: - type: string + The system prompt with variable placeholders + title: Prompt + version: description: >- - (Optional) if specified, the new response will be a continuation of the - previous response. This can be used to easily fork-off new responses from - existing responses. - conversation: + Version (integer starting at 1, incremented on save) + minimum: 1 + title: Version + type: integer + prompt_id: + description: >- + Unique identifier in format 'pmpt_<48-digit-hash>' + title: Prompt Id type: string + variables: description: >- - (Optional) The ID of a conversation to add the response to. Must begin - with 'conv_'. Input and output messages will be automatically added to - the conversation. - store: - type: boolean - stream: - type: boolean - temperature: - type: number - text: - $ref: '#/components/schemas/OpenAIResponseText' - tools: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInputTool' - include: - type: array + List of variable names that can be used in the prompt template items: type: string + title: Variables + type: array + is_default: + default: false description: >- - (Optional) Additional fields to include in the response. - max_infer_iters: - type: integer - additionalProperties: false + Boolean indicating whether this version is the default version + title: Is Default + type: boolean required: - - input - - model - title: CreateOpenaiResponseRequest - OpenAIResponseObject: + - version + - prompt_id + title: Prompt type: object - properties: - created_at: - type: integer - description: >- - Unix timestamp when the response was created - error: - $ref: '#/components/schemas/OpenAIResponseError' + UpdatePromptRequest: + type: object + SetDefaultVersionRequest: + type: object + ListProvidersResponse: + $defs: + ProviderInfo: description: >- - (Optional) Error details if the response generation failed - id: + Information about a registered provider including its configuration and + health status. + + + :param api: The API name this provider implements + + :param provider_id: Unique identifier for the provider + + :param provider_type: The type of provider implementation + + :param config: Configuration parameters for the provider + + :param health: Current health status of the provider + properties: + api: + title: Api + type: string + provider_id: + title: Provider Id + type: string + provider_type: + title: Provider Type + type: string + config: + additionalProperties: true + title: Config + type: object + health: + additionalProperties: true + title: Health + type: object + required: + - api + - provider_id + - provider_type + - config + - health + title: ProviderInfo + type: object + description: >- + Response containing a list of all available providers. + + + :param data: List of provider information objects + properties: + data: + items: + $ref: '#/$defs/ProviderInfo' + title: Data + type: array + required: + - data + title: ListProvidersResponse + type: object + ProviderInfo: + description: >- + Information about a registered provider including its configuration and health + status. + + + :param api: The API name this provider implements + + :param provider_id: Unique identifier for the provider + + :param provider_type: The type of provider implementation + + :param config: Configuration parameters for the provider + + :param health: Current health status of the provider + properties: + api: + title: Api type: string - description: Unique identifier for this response - model: + provider_id: + title: Provider Id type: string - description: Model identifier used for generation - object: + provider_type: + title: Provider Type type: string - const: response - default: response + config: + additionalProperties: true + title: Config + type: object + health: + additionalProperties: true + title: Health + type: object + required: + - api + - provider_id + - provider_type + - config + - health + title: ProviderInfo + type: object + ListOpenAIResponseObject: + $defs: + AllowedToolsFilter: description: >- - Object type identifier, always "response" - output: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseOutput' + Filter configuration for restricting which MCP tools can be used. + + + :param tool_names: (Optional) List of specific tool names that are allowed + properties: + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Tool Names + title: AllowedToolsFilter + type: object + MCPListToolsTool: description: >- - List of generated output items (messages, tool calls, etc.) - parallel_tool_calls: - type: boolean - default: false + Tool definition returned by MCP list tools operation. + + + :param input_schema: JSON schema defining the tool's input parameters + + :param name: Name of the tool + + :param description: (Optional) Description of what the tool does + properties: + input_schema: + additionalProperties: true + title: Input Schema + type: object + name: + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + required: + - input_schema + - name + title: MCPListToolsTool + type: object + OpenAIResponseAnnotationCitation: description: >- - Whether tool calls can be executed in parallel - previous_response_id: - type: string + URL citation annotation for referencing external web resources. + + + :param type: Annotation type identifier, always "url_citation" + + :param end_index: End position of the citation span in the content + + :param start_index: Start position of the citation span in the content + + :param title: Title of the referenced web resource + + :param url: URL of the referenced web resource + properties: + type: + const: url_citation + default: url_citation + title: Type + type: string + end_index: + title: End Index + type: integer + start_index: + title: Start Index + type: integer + title: + title: Title + type: string + url: + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + "OpenAIResponseAnnotationContainerFileCitation": + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: >- + OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: description: >- - (Optional) ID of the previous response in a conversation - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' + File citation annotation for referencing specific files in response content. + + + :param type: Annotation type identifier, always "file_citation" + + :param file_id: Unique identifier of the referenced file + + :param filename: Name of the referenced file + + :param index: Position index of the citation within the content + properties: + type: + const: file_citation + default: file_citation + title: Type + type: string + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + index: + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: + description: >- + Refusal content within a streamed response part. + + + :param type: Content part type identifier, always "refusal" + + :param refusal: Refusal text supplied by the model + properties: + type: + const: refusal + default: refusal + title: Type + type: string + refusal: + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + OpenAIResponseError: + description: >- + Error details for failed OpenAI response requests. + + + :param code: Error code identifying the type of failure + + :param message: Human-readable error message describing the failure + properties: + code: + title: Code + type: string + message: + title: Message + type: string + required: + - code + - message + title: OpenAIResponseError + type: object + "OpenAIResponseInputFunctionToolCallOutput": + description: >- + This represents the output of a function call that gets passed back to + the model. + properties: + call_id: + title: Call Id + type: string + output: + title: Output + type: string + type: + const: function_call_output + default: function_call_output + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - call_id + - output + title: >- + OpenAIResponseInputFunctionToolCallOutput + type: object + OpenAIResponseInputMessageContentImage: + description: >- + Image content for input messages in OpenAI response format. + + + :param detail: Level of detail for image processing, can be "low", "high", + or "auto" + + :param type: Content type identifier, always "input_image" + + :param image_url: (Optional) URL of the image content + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + title: Detail + type: + const: input_image + default: input_image + title: Type + type: string + image_url: + anyOf: + - type: string + - type: 'null' + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: description: >- - (Optional) Reference to a prompt template and its variables. - status: - type: string + Text content for input messages in OpenAI response format. + + + :param text: The text content of the input message + + :param type: Content type identifier, always "input_text" + properties: + text: + title: Text + type: string + type: + const: input_text + default: input_text + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseInputToolFileSearch: description: >- - Current status of the response generation - temperature: - type: number + File search tool configuration for OpenAI response inputs. + + + :param type: Tool type identifier, always "file_search" + + :param vector_store_ids: List of vector store identifiers to search within + + :param filters: (Optional) Additional filters to apply to the search + + :param max_num_results: (Optional) Maximum number of search results to + return (1-50) + + :param ranking_options: (Optional) Options for ranking and scoring search + results + properties: + type: + const: file_search + default: file_search + title: Type + type: string + vector_store_ids: + items: + type: string + title: Vector Store Ids + type: array + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Filters + max_num_results: + anyOf: + - maximum: 50 + minimum: 1 + type: integer + - type: 'null' + default: 10 + title: Max Num Results + ranking_options: + anyOf: + - $ref: '#/$defs/SearchRankingOptions' + - type: 'null' + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + type: object + OpenAIResponseInputToolFunction: description: >- - (Optional) Sampling temperature used for generation - text: - $ref: '#/components/schemas/OpenAIResponseText' + Function tool configuration for OpenAI response inputs. + + + :param type: Tool type identifier, always "function" + + :param name: Name of the function that can be called + + :param description: (Optional) Description of what the function does + + :param parameters: (Optional) JSON schema defining the function's parameters + + :param strict: (Optional) Whether to enforce strict parameter validation + properties: + type: + const: function + default: function + title: Type + type: string + name: + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Parameters + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + required: + - name + - parameters + title: OpenAIResponseInputToolFunction + type: object + OpenAIResponseInputToolWebSearch: description: >- - Text formatting configuration for the response - top_p: - type: number + Web search tool configuration for OpenAI response inputs. + + + :param type: Web search tool type variant to use + + :param search_context_size: (Optional) Size of search context, must be + "low", "medium", or "high" + properties: + type: + anyOf: + - const: web_search + type: string + - const: web_search_preview + type: string + - const: web_search_preview_2025_03_11 + type: string + default: web_search + title: Type + search_context_size: + anyOf: + - pattern: ^low|medium|high$ + type: string + - type: 'null' + default: medium + title: Search Context Size + title: OpenAIResponseInputToolWebSearch + type: object + OpenAIResponseMCPApprovalRequest: description: >- - (Optional) Nucleus sampling parameter used for generation - tools: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseTool' + A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments + type: string + id: + title: Id + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMCPApprovalResponse: + description: A response to an MCP approval request. + properties: + approval_request_id: + title: Approval Request Id + type: string + approve: + title: Approve + type: boolean + type: + const: mcp_approval_response + default: mcp_approval_response + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + reason: + anyOf: + - type: string + - type: 'null' + title: Reason + required: + - approval_request_id + - approve + title: OpenAIResponseMCPApprovalResponse + type: object + OpenAIResponseMessage: description: >- - (Optional) An array of tools the model may call while generating a response. - truncation: - type: string + Corresponds to the various Message types in the Responses API. + + They are all under one type because the Responses API gives them all + + the same "type" value, and there is no way to tell them apart in certain + + scenarios. + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_image: >- + #/$defs/OpenAIResponseInputMessageContentImage + input_text: >- + #/$defs/OpenAIResponseInputMessageContentText + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentText + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentImage + type: array + - items: + discriminator: + mapping: + output_text: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + - $ref: '#/$defs/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + OpenAIResponseObjectWithInput: description: >- - (Optional) Truncation strategy applied to the response - usage: - $ref: '#/components/schemas/OpenAIResponseUsage' + OpenAI response object extended with input context information. + + + :param input: List of input items that led to this response + properties: + created_at: + title: Created At + type: integer + error: + anyOf: + - $ref: '#/$defs/OpenAIResponseError' + - type: 'null' + id: + title: Id + type: string + model: + title: Model + type: string + object: + const: response + default: response + title: Object + type: string + output: + items: + discriminator: + mapping: + file_search_call: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + function_call: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + mcp_list_tools: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + message: '#/$defs/OpenAIResponseMessage' + web_search_call: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseMessage' + - $ref: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' + title: Output + type: array + parallel_tool_calls: + default: false + title: Parallel Tool Calls + type: boolean + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + status: + title: Status + type: string + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + text: + $ref: '#/$defs/OpenAIResponseText' + default: + format: + type: text + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + tools: + anyOf: + - items: + discriminator: + mapping: + file_search: >- + #/$defs/OpenAIResponseInputToolFileSearch + function: '#/$defs/OpenAIResponseInputToolFunction' + mcp: '#/$defs/OpenAIResponseToolMCP' + web_search: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseInputToolWebSearch' + - $ref: >- + #/$defs/OpenAIResponseInputToolFileSearch + - $ref: '#/$defs/OpenAIResponseInputToolFunction' + - $ref: '#/$defs/OpenAIResponseToolMCP' + type: array + - type: 'null' + title: Tools + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + usage: + anyOf: + - $ref: '#/$defs/OpenAIResponseUsage' + - type: 'null' + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + input: + items: + anyOf: + - discriminator: + mapping: + file_search_call: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + function_call: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + mcp_list_tools: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + message: '#/$defs/OpenAIResponseMessage' + web_search_call: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseMessage' + - $ref: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' + - $ref: >- + #/$defs/OpenAIResponseInputFunctionToolCallOutput + - $ref: >- + #/$defs/OpenAIResponseMCPApprovalResponse + - $ref: '#/$defs/OpenAIResponseMessage' + title: Input + type: array + required: + - created_at + - id + - model + - output + - status + - input + title: OpenAIResponseObjectWithInput + type: object + "OpenAIResponseOutputMessageContentOutputText": + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + file_citation: >- + #/$defs/OpenAIResponseAnnotationFileCitation + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseAnnotationFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationCitation' + - $ref: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: >- + OpenAIResponseOutputMessageContentOutputText + type: object + "OpenAIResponseOutputMessageFileSearchToolCall": description: >- - (Optional) Token usage information for the response - instructions: - type: string + File search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param queries: List of search queries executed + + :param status: Current status of the file search operation + + :param type: Tool call type identifier, always "file_search_call" + + :param results: (Optional) Search results returned by the file search + operation + properties: + id: + title: Id + type: string + queries: + items: + type: string + title: Queries + type: array + status: + title: Status + type: string + type: + const: file_search_call + default: file_search_call + title: Type + type: string + results: + anyOf: + - items: + $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults + type: array + - type: 'null' + title: Results + required: + - id + - queries + - status + title: >- + OpenAIResponseOutputMessageFileSearchToolCall + type: object + "OpenAIResponseOutputMessageFileSearchToolCallResults": description: >- - (Optional) System message inserted into the model's context - additionalProperties: false - required: - - created_at - - id - - model - - object - - output - - parallel_tool_calls - - status - - text - title: OpenAIResponseObject - description: >- - Complete OpenAI response object containing generation results and metadata. - OpenAIResponseContentPartOutputText: - type: object - properties: - type: - type: string - const: output_text - default: output_text + Search results returned by the file search operation. + + + :param attributes: (Optional) Key-value attributes associated with the + file + + :param file_id: Unique identifier of the file containing the result + + :param filename: Name of the file containing the result + + :param score: Relevance score for this search result (between 0 and 1) + + :param text: Text content of the search result + properties: + attributes: + additionalProperties: true + title: Attributes + type: object + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + score: + title: Score + type: number + text: + title: Text + type: string + required: + - attributes + - file_id + - filename + - score + - text + title: >- + OpenAIResponseOutputMessageFileSearchToolCallResults + type: object + "OpenAIResponseOutputMessageFunctionToolCall": description: >- - Content part type identifier, always "output_text" - text: - type: string - description: Text emitted for this content part - annotations: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseAnnotations' + Function tool call output message for OpenAI responses. + + + :param call_id: Unique identifier for the function call + + :param name: Name of the function being called + + :param arguments: JSON string containing the function arguments + + :param type: Tool call type identifier, always "function_call" + + :param id: (Optional) Additional identifier for the tool call + + :param status: (Optional) Current status of the function call execution + properties: + call_id: + title: Call Id + type: string + name: + title: Name + type: string + arguments: + title: Arguments + type: string + type: + const: function_call + default: function_call + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - call_id + - name + - arguments + title: >- + OpenAIResponseOutputMessageFunctionToolCall + type: object + OpenAIResponseOutputMessageMCPCall: description: >- - Structured annotations associated with the text - logprobs: - type: array - items: - type: object - additionalProperties: - oneOf: + Model Context Protocol (MCP) call output message for OpenAI responses. + + + :param id: Unique identifier for this MCP call + + :param type: Tool call type identifier, always "mcp_call" + + :param arguments: JSON string containing the MCP call arguments + + :param name: Name of the MCP method being called + + :param server_label: Label identifying the MCP server handling the call + + :param error: (Optional) Error message if the MCP call failed + + :param output: (Optional) Output result from the successful MCP call + properties: + id: + title: Id + type: string + type: + const: mcp_call + default: mcp_call + title: Type + type: string + arguments: + title: Arguments + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + error: + anyOf: + - type: string - type: 'null' - - type: boolean - - type: number + title: Error + output: + anyOf: - type: string - - type: array - - type: object - description: (Optional) Token log probability details - additionalProperties: false - required: - - type - - text - - annotations - title: OpenAIResponseContentPartOutputText - description: >- - Text content within a streamed response part. - "OpenAIResponseContentPartReasoningSummary": - type: object - properties: - type: - type: string - const: summary_text - default: summary_text + - type: 'null' + title: Output + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + type: object + OpenAIResponseOutputMessageMCPListTools: description: >- - Content part type identifier, always "summary_text" - text: - type: string - description: Summary text - additionalProperties: false - required: - - type - - text - title: >- - OpenAIResponseContentPartReasoningSummary - description: >- - Reasoning summary part in a streamed response. - OpenAIResponseContentPartReasoningText: - type: object - properties: - type: - type: string - const: reasoning_text - default: reasoning_text + MCP list tools output message containing available tools from an MCP server. + + + :param id: Unique identifier for this MCP list tools operation + + :param type: Tool call type identifier, always "mcp_list_tools" + + :param server_label: Label identifying the MCP server providing the tools + + :param tools: List of available tools provided by the MCP server + properties: + id: + title: Id + type: string + type: + const: mcp_list_tools + default: mcp_list_tools + title: Type + type: string + server_label: + title: Server Label + type: string + tools: + items: + $ref: '#/$defs/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + type: object + "OpenAIResponseOutputMessageWebSearchToolCall": description: >- - Content part type identifier, always "reasoning_text" - text: - type: string - description: Reasoning text supplied by the model - additionalProperties: false - required: - - type - - text - title: OpenAIResponseContentPartReasoningText - description: >- - Reasoning text emitted as part of a streamed response. - OpenAIResponseObjectStream: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseCreated' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseInProgress' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputItemAdded' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputItemDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallInProgress' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallSearching' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallCompleted' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsInProgress' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsFailed' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsCompleted' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallArgumentsDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallInProgress' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallFailed' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted' - discriminator: - propertyName: type - mapping: - response.created: '#/components/schemas/OpenAIResponseObjectStreamResponseCreated' - response.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseInProgress' - response.output_item.added: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputItemAdded' - response.output_item.done: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputItemDone' - response.output_text.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextDelta' - response.output_text.done: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextDone' - response.function_call_arguments.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta' - response.function_call_arguments.done: '#/components/schemas/OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone' - response.web_search_call.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallInProgress' - response.web_search_call.searching: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallSearching' - response.web_search_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallCompleted' - response.mcp_list_tools.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsInProgress' - response.mcp_list_tools.failed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsFailed' - response.mcp_list_tools.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsCompleted' - response.mcp_call.arguments.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta' - response.mcp_call.arguments.done: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallArgumentsDone' - response.mcp_call.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallInProgress' - response.mcp_call.failed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallFailed' - response.mcp_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted' - response.content_part.added: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded' - response.content_part.done: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone' - response.reasoning_text.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta' - response.reasoning_text.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone' - response.reasoning_summary_part.added: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded' - response.reasoning_summary_part.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone' - response.reasoning_summary_text.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta' - response.reasoning_summary_text.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone' - response.refusal.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta' - response.refusal.done: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone' - response.output_text.annotation.added: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded' - response.file_search_call.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress' - response.file_search_call.searching: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching' - response.file_search_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted' - response.incomplete: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete' - response.failed: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed' - response.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted' - "OpenAIResponseObjectStreamResponseCompleted": - type: object - properties: - response: - $ref: '#/components/schemas/OpenAIResponseObject' - description: Completed response object - type: - type: string - const: response.completed - default: response.completed + Web search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param status: Current status of the web search operation + + :param type: Tool call type identifier, always "web_search_call" + properties: + id: + title: Id + type: string + status: + title: Status + type: string + type: + const: web_search_call + default: web_search_call + title: Type + type: string + required: + - id + - status + title: >- + OpenAIResponseOutputMessageWebSearchToolCall + type: object + OpenAIResponseText: description: >- - Event type identifier, always "response.completed" - additionalProperties: false - required: - - response - - type - title: >- - OpenAIResponseObjectStreamResponseCompleted - description: >- - Streaming event indicating a response has been completed. - "OpenAIResponseObjectStreamResponseContentPartAdded": - type: object - properties: - content_index: - type: integer + Text response configuration for OpenAI responses. + + + :param format: (Optional) Text format configuration specifying output + format requirements + properties: + format: + anyOf: + - $ref: '#/$defs/OpenAIResponseTextFormat' + - type: 'null' + title: OpenAIResponseText + type: object + OpenAIResponseTextFormat: description: >- - Index position of the part within the content array - response_id: - type: string + Configuration for Responses API text format. + + + :param type: Must be "text", "json_schema", or "json_object" to identify + the format type + + :param name: The name of the response format. Only used for json_schema. + + :param schema: The JSON schema the response should conform to. In a Python + SDK, this is often a `pydantic` model. Only used for json_schema. + + :param description: (Optional) A description of the response format. Only + used for json_schema. + + :param strict: (Optional) Whether to strictly enforce the JSON schema. + If true, the response must match the schema exactly. Only used for json_schema. + properties: + type: + anyOf: + - const: text + type: string + - const: json_schema + type: string + - const: json_object + type: string + title: Type + name: + anyOf: + - type: string + - type: 'null' + title: Name + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + title: OpenAIResponseTextFormat + type: object + OpenAIResponseToolMCP: description: >- - Unique identifier of the response containing this content - item_id: - type: string + Model Context Protocol (MCP) tool configuration for OpenAI response object. + + + :param type: Tool type identifier, always "mcp" + + :param server_label: Label to identify this MCP server + + :param allowed_tools: (Optional) Restriction on which tools can be used + from this server + properties: + type: + const: mcp + default: mcp + title: Type + type: string + server_label: + title: Server Label + type: string + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/$defs/AllowedToolsFilter' + - type: 'null' + title: Allowed Tools + required: + - server_label + title: OpenAIResponseToolMCP + type: object + OpenAIResponseUsage: description: >- - Unique identifier of the output item containing this content part - output_index: - type: integer + Usage information for OpenAI response. + + + :param input_tokens: Number of tokens in the input + + :param output_tokens: Number of tokens in the output + + :param total_tokens: Total tokens used (input + output) + + :param input_tokens_details: Detailed breakdown of input token usage + + :param output_tokens_details: Detailed breakdown of output token usage + properties: + input_tokens: + title: Input Tokens + type: integer + output_tokens: + title: Output Tokens + type: integer + total_tokens: + title: Total Tokens + type: integer + input_tokens_details: + anyOf: + - $ref: >- + #/$defs/OpenAIResponseUsageInputTokensDetails + - type: 'null' + output_tokens_details: + anyOf: + - $ref: >- + #/$defs/OpenAIResponseUsageOutputTokensDetails + - type: 'null' + required: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + type: object + OpenAIResponseUsageInputTokensDetails: description: >- - Index position of the output item in the response - part: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseContentPartOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' - - $ref: '#/components/schemas/OpenAIResponseContentPartReasoningText' - discriminator: - propertyName: type - mapping: - output_text: '#/components/schemas/OpenAIResponseContentPartOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' - reasoning_text: '#/components/schemas/OpenAIResponseContentPartReasoningText' - description: The content part that was added - sequence_number: - type: integer + Token details for input tokens in OpenAI response usage. + + + :param cached_tokens: Number of tokens retrieved from cache + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens + title: OpenAIResponseUsageInputTokensDetails + type: object + OpenAIResponseUsageOutputTokensDetails: description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.content_part.added - default: response.content_part.added + Token details for output tokens in OpenAI response usage. + + + :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens + title: OpenAIResponseUsageOutputTokensDetails + type: object + SearchRankingOptions: description: >- - Event type identifier, always "response.content_part.added" - additionalProperties: false - required: - - content_index - - response_id - - item_id - - output_index - - part - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseContentPartAdded + Options for ranking and filtering search results. + + + :param ranker: (Optional) Name of the ranking algorithm to use + + :param score_threshold: (Optional) Minimum relevance score threshold for + results + properties: + ranker: + anyOf: + - type: string + - type: 'null' + title: Ranker + score_threshold: + anyOf: + - type: number + - type: 'null' + default: 0.0 + title: Score Threshold + title: SearchRankingOptions + type: object description: >- - Streaming event for when a new content part is added to a response item. - "OpenAIResponseObjectStreamResponseContentPartDone": - type: object + Paginated list of OpenAI response objects with navigation metadata. + + + :param data: List of response objects with their input context + + :param has_more: Whether there are more results available beyond this page + + :param first_id: Identifier of the first item in this page + + :param last_id: Identifier of the last item in this page + + :param object: Object type identifier, always "list" properties: - content_index: - type: integer - description: >- - Index position of the part within the content array - response_id: + data: + items: + $ref: '#/$defs/OpenAIResponseObjectWithInput' + title: Data + type: array + has_more: + title: Has More + type: boolean + first_id: + title: First Id type: string - description: >- - Unique identifier of the response containing this content - item_id: + last_id: + title: Last Id type: string - description: >- - Unique identifier of the output item containing this content part - output_index: - type: integer - description: >- - Index position of the output item in the response - part: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseContentPartOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' - - $ref: '#/components/schemas/OpenAIResponseContentPartReasoningText' - discriminator: - propertyName: type - mapping: - output_text: '#/components/schemas/OpenAIResponseContentPartOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' - reasoning_text: '#/components/schemas/OpenAIResponseContentPartReasoningText' - description: The completed content part - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: + object: + const: list + default: list + title: Object type: string - const: response.content_part.done - default: response.content_part.done - description: >- - Event type identifier, always "response.content_part.done" - additionalProperties: false required: - - content_index - - response_id - - item_id - - output_index - - part - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseContentPartDone - description: >- - Streaming event for when a content part is completed. - "OpenAIResponseObjectStreamResponseCreated": + - data + - has_more + - first_id + - last_id + title: ListOpenAIResponseObject type: object properties: - response: - $ref: '#/components/schemas/OpenAIResponseObject' - description: The response object that was created - type: + code: type: string - const: response.created - default: response.created - description: >- - Event type identifier, always "response.created" - additionalProperties: false - required: - - response - - type - title: >- - OpenAIResponseObjectStreamResponseCreated - description: >- - Streaming event indicating a new response has been created. - OpenAIResponseObjectStreamResponseFailed: - type: object - properties: - response: - $ref: '#/components/schemas/OpenAIResponseObject' - description: Response object describing the failure - sequence_number: - type: integer description: >- - Sequential number for ordering streaming events - type: + Error code identifying the type of failure + message: type: string - const: response.failed - default: response.failed description: >- - Event type identifier, always "response.failed" + Human-readable error message describing the failure additionalProperties: false required: - - response - - sequence_number - - type - title: OpenAIResponseObjectStreamResponseFailed + - code + - message + title: OpenAIResponseError description: >- - Streaming event emitted when a response fails. - "OpenAIResponseObjectStreamResponseFileSearchCallCompleted": + Error details for failed OpenAI response requests. + OpenAIResponseInput: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutput' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage' + OpenAIResponseInputToolFileSearch: type: object properties: - item_id: + type: type: string + const: file_search + default: file_search description: >- - Unique identifier of the completed file search call - output_index: - type: integer + Tool type identifier, always "file_search" + vector_store_ids: + type: array + items: + type: string + description: >- + List of vector store identifiers to search within + filters: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object description: >- - Index position of the item in the output list - sequence_number: + (Optional) Additional filters to apply to the search + max_num_results: type: integer + default: 10 description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.file_search_call.completed - default: response.file_search_call.completed + (Optional) Maximum number of search results to return (1-50) + ranking_options: + type: object + properties: + ranker: + type: string + description: >- + (Optional) Name of the ranking algorithm to use + score_threshold: + type: number + default: 0.0 + description: >- + (Optional) Minimum relevance score threshold for results + additionalProperties: false description: >- - Event type identifier, always "response.file_search_call.completed" + (Optional) Options for ranking and scoring search results additionalProperties: false required: - - item_id - - output_index - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseFileSearchCallCompleted + - vector_store_ids + title: OpenAIResponseInputToolFileSearch description: >- - Streaming event for completed file search calls. - "OpenAIResponseObjectStreamResponseFileSearchCallInProgress": + File search tool configuration for OpenAI response inputs. + OpenAIResponseInputToolFunction: type: object properties: - item_id: + type: + type: string + const: function + default: function + description: Tool type identifier, always "function" + name: + type: string + description: Name of the function that can be called + description: type: string description: >- - Unique identifier of the file search call - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer + (Optional) Description of what the function does + parameters: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.file_search_call.in_progress - default: response.file_search_call.in_progress + (Optional) JSON schema defining the function's parameters + strict: + type: boolean description: >- - Event type identifier, always "response.file_search_call.in_progress" + (Optional) Whether to enforce strict parameter validation additionalProperties: false required: - - item_id - - output_index - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseFileSearchCallInProgress + - name + title: OpenAIResponseInputToolFunction description: >- - Streaming event for file search calls in progress. - "OpenAIResponseObjectStreamResponseFileSearchCallSearching": + Function tool configuration for OpenAI response inputs. + OpenAIResponseInputToolWebSearch: type: object properties: - item_id: - type: string - description: >- - Unique identifier of the file search call - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events type: + oneOf: + - type: string + const: web_search + - type: string + const: web_search_preview + - type: string + const: web_search_preview_2025_03_11 + default: web_search + description: Web search tool type variant to use + search_context_size: type: string - const: response.file_search_call.searching - default: response.file_search_call.searching + default: medium description: >- - Event type identifier, always "response.file_search_call.searching" + (Optional) Size of search context, must be "low", "medium", or "high" additionalProperties: false required: - - item_id - - output_index - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseFileSearchCallSearching + title: OpenAIResponseInputToolWebSearch description: >- - Streaming event for file search currently searching. - "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": + Web search tool configuration for OpenAI response inputs. + OpenAIResponseObjectWithInput: type: object properties: - delta: - type: string + created_at: + type: integer + description: >- + Unix timestamp when the response was created + error: + $ref: '#/components/schemas/OpenAIResponseError' description: >- - Incremental function call arguments being added - item_id: + (Optional) Error details if the response generation failed + id: + type: string + description: Unique identifier for this response + model: + type: string + description: Model identifier used for generation + object: type: string + const: response + default: response description: >- - Unique identifier of the function call being updated - output_index: - type: integer + Object type identifier, always "response" + output: + type: array + items: + $ref: '#/components/schemas/OpenAIResponseOutput' description: >- - Index position of the item in the output list - sequence_number: - type: integer + List of generated output items (messages, tool calls, etc.) + parallel_tool_calls: + type: boolean + default: false description: >- - Sequential number for ordering streaming events - type: + Whether tool calls can be executed in parallel + previous_response_id: type: string - const: response.function_call_arguments.delta - default: response.function_call_arguments.delta description: >- - Event type identifier, always "response.function_call_arguments.delta" - additionalProperties: false - required: - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta - description: >- - Streaming event for incremental function call argument updates. - "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone": - type: object - properties: - arguments: - type: string + (Optional) ID of the previous response in a conversation + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' description: >- - Final complete arguments JSON string for the function call - item_id: + (Optional) Reference to a prompt template and its variables. + status: type: string description: >- - Unique identifier of the completed function call - output_index: - type: integer + Current status of the response generation + temperature: + type: number description: >- - Index position of the item in the output list - sequence_number: - type: integer + (Optional) Sampling temperature used for generation + text: + $ref: '#/components/schemas/OpenAIResponseText' description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.function_call_arguments.done - default: response.function_call_arguments.done + Text formatting configuration for the response + top_p: + type: number description: >- - Event type identifier, always "response.function_call_arguments.done" - additionalProperties: false - required: - - arguments - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone - description: >- - Streaming event for when function call arguments are completed. - "OpenAIResponseObjectStreamResponseInProgress": - type: object - properties: - response: - $ref: '#/components/schemas/OpenAIResponseObject' - description: Current response state while in progress - sequence_number: - type: integer + (Optional) Nucleus sampling parameter used for generation + tools: + type: array + items: + $ref: '#/components/schemas/OpenAIResponseTool' description: >- - Sequential number for ordering streaming events - type: + (Optional) An array of tools the model may call while generating a response. + truncation: type: string - const: response.in_progress - default: response.in_progress - description: >- - Event type identifier, always "response.in_progress" - additionalProperties: false - required: - - response - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseInProgress - description: >- - Streaming event indicating the response remains in progress. - "OpenAIResponseObjectStreamResponseIncomplete": - type: object - properties: - response: - $ref: '#/components/schemas/OpenAIResponseObject' description: >- - Response object describing the incomplete state - sequence_number: - type: integer + (Optional) Truncation strategy applied to the response + usage: + $ref: '#/components/schemas/OpenAIResponseUsage' description: >- - Sequential number for ordering streaming events - type: + (Optional) Token usage information for the response + instructions: type: string - const: response.incomplete - default: response.incomplete description: >- - Event type identifier, always "response.incomplete" + (Optional) System message inserted into the model's context + input: + type: array + items: + $ref: '#/components/schemas/OpenAIResponseInput' + description: >- + List of input items that led to this response additionalProperties: false required: - - response - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseIncomplete + - created_at + - id + - model + - object + - output + - parallel_tool_calls + - status + - text + - input + title: OpenAIResponseObjectWithInput description: >- - Streaming event emitted when a response ends in an incomplete state. - "OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta": - type: object - properties: - delta: - type: string - item_id: - type: string - output_index: - type: integer - sequence_number: - type: integer - type: - type: string - const: response.mcp_call.arguments.delta - default: response.mcp_call.arguments.delta - additionalProperties: false - required: - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta - "OpenAIResponseObjectStreamResponseMcpCallArgumentsDone": + OpenAI response object extended with input context information. + OpenAIResponseOutput: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + message: '#/components/schemas/OpenAIResponseMessage' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + OpenAIResponsePrompt: type: object properties: - arguments: - type: string - item_id: - type: string - output_index: - type: integer - sequence_number: - type: integer - type: + id: type: string - const: response.mcp_call.arguments.done - default: response.mcp_call.arguments.done - additionalProperties: false - required: - - arguments - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallArgumentsDone - "OpenAIResponseObjectStreamResponseMcpCallCompleted": - type: object - properties: - sequence_number: - type: integer + description: Unique identifier of the prompt template + variables: + type: object + additionalProperties: + $ref: '#/components/schemas/OpenAIResponseInputMessageContent' description: >- - Sequential number for ordering streaming events - type: + Dictionary of variable names to OpenAIResponseInputMessageContent structure + for template substitution. The substitution values can either be strings, + or other Response input types like images or files. + version: type: string - const: response.mcp_call.completed - default: response.mcp_call.completed description: >- - Event type identifier, always "response.mcp_call.completed" + Version number of the prompt to use (defaults to latest if not specified) additionalProperties: false required: - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallCompleted - description: Streaming event for completed MCP calls. - "OpenAIResponseObjectStreamResponseMcpCallFailed": + - id + title: OpenAIResponsePrompt + description: >- + OpenAI compatible Prompt object that is used in OpenAI responses. + OpenAIResponseText: type: object properties: - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.mcp_call.failed - default: response.mcp_call.failed + format: + type: object + properties: + type: + oneOf: + - type: string + const: text + - type: string + const: json_schema + - type: string + const: json_object + description: >- + Must be "text", "json_schema", or "json_object" to identify the format + type + name: + type: string + description: >- + The name of the response format. Only used for json_schema. + schema: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + The JSON schema the response should conform to. In a Python SDK, this + is often a `pydantic` model. Only used for json_schema. + description: + type: string + description: >- + (Optional) A description of the response format. Only used for json_schema. + strict: + type: boolean + description: >- + (Optional) Whether to strictly enforce the JSON schema. If true, the + response must match the schema exactly. Only used for json_schema. + additionalProperties: false + required: + - type description: >- - Event type identifier, always "response.mcp_call.failed" + (Optional) Text format configuration specifying output format requirements additionalProperties: false - required: - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallFailed - description: Streaming event for failed MCP calls. - "OpenAIResponseObjectStreamResponseMcpCallInProgress": + title: OpenAIResponseText + description: >- + Text response configuration for OpenAI responses. + OpenAIResponseTool: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + discriminator: + propertyName: type + mapping: + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseToolMCP' + OpenAIResponseToolMCP: type: object properties: - item_id: - type: string - description: Unique identifier of the MCP call - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events type: type: string - const: response.mcp_call.in_progress - default: response.mcp_call.in_progress + const: mcp + default: mcp + description: Tool type identifier, always "mcp" + server_label: + type: string + description: Label to identify this MCP server + allowed_tools: + oneOf: + - type: array + items: + type: string + - type: object + properties: + tool_names: + type: array + items: + type: string + description: >- + (Optional) List of specific tool names that are allowed + additionalProperties: false + title: AllowedToolsFilter + description: >- + Filter configuration for restricting which MCP tools can be used. description: >- - Event type identifier, always "response.mcp_call.in_progress" + (Optional) Restriction on which tools can be used from this server additionalProperties: false required: - - item_id - - output_index - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallInProgress + - server_label + title: OpenAIResponseToolMCP description: >- - Streaming event for MCP calls in progress. - "OpenAIResponseObjectStreamResponseMcpListToolsCompleted": + Model Context Protocol (MCP) tool configuration for OpenAI response object. + OpenAIResponseUsage: type: object properties: - sequence_number: + input_tokens: type: integer - type: - type: string - const: response.mcp_list_tools.completed - default: response.mcp_list_tools.completed + description: Number of tokens in the input + output_tokens: + type: integer + description: Number of tokens in the output + total_tokens: + type: integer + description: Total tokens used (input + output) + input_tokens_details: + type: object + properties: + cached_tokens: + type: integer + description: Number of tokens retrieved from cache + additionalProperties: false + description: Detailed breakdown of input token usage + output_tokens_details: + type: object + properties: + reasoning_tokens: + type: integer + description: >- + Number of tokens used for reasoning (o1/o3 models) + additionalProperties: false + description: Detailed breakdown of output token usage additionalProperties: false required: - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpListToolsCompleted - "OpenAIResponseObjectStreamResponseMcpListToolsFailed": + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + description: Usage information for OpenAI response. + ResponseGuardrailSpec: type: object properties: - sequence_number: - type: integer type: type: string - const: response.mcp_list_tools.failed - default: response.mcp_list_tools.failed + description: The type/identifier of the guardrail. additionalProperties: false required: - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseMcpListToolsFailed - "OpenAIResponseObjectStreamResponseMcpListToolsInProgress": + title: ResponseGuardrailSpec + description: >- + Specification for a guardrail to apply during response generation. + OpenAIResponseInputTool: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' + discriminator: + propertyName: type + mapping: + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseInputToolMCP' + OpenAIResponseInputToolMCP: type: object properties: - sequence_number: - type: integer type: type: string - const: response.mcp_list_tools.in_progress - default: response.mcp_list_tools.in_progress + const: mcp + default: mcp + description: Tool type identifier, always "mcp" + server_label: + type: string + description: Label to identify this MCP server + server_url: + type: string + description: URL endpoint of the MCP server + headers: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + (Optional) HTTP headers to include when connecting to the server + require_approval: + oneOf: + - type: string + const: always + - type: string + const: never + - type: object + properties: + always: + type: array + items: + type: string + description: >- + (Optional) List of tool names that always require approval + never: + type: array + items: + type: string + description: >- + (Optional) List of tool names that never require approval + additionalProperties: false + title: ApprovalFilter + description: >- + Filter configuration for MCP tool approval requirements. + default: never + description: >- + Approval requirement for tool calls ("always", "never", or filter) + allowed_tools: + oneOf: + - type: array + items: + type: string + - type: object + properties: + tool_names: + type: array + items: + type: string + description: >- + (Optional) List of specific tool names that are allowed + additionalProperties: false + title: AllowedToolsFilter + description: >- + Filter configuration for restricting which MCP tools can be used. + description: >- + (Optional) Restriction on which tools can be used from this server additionalProperties: false required: - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseMcpListToolsInProgress - "OpenAIResponseObjectStreamResponseOutputItemAdded": + - server_label + - server_url + - require_approval + title: OpenAIResponseInputToolMCP + description: >- + Model Context Protocol (MCP) tool configuration for OpenAI response inputs. + CreateOpenaiResponseRequest: type: object properties: - response_id: - type: string - description: >- - Unique identifier of the response containing this output - item: + input: oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - description: >- - The output item that was added (message, tool call, etc.) - output_index: - type: integer + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAIResponseInput' + description: Input message(s) to create the response. + model: + type: string + description: The underlying LLM used for completions. + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' description: >- - Index position of this item in the output list - sequence_number: - type: integer + (Optional) Prompt object with ID, version, and variables. + instructions: + type: string + previous_response_id: + type: string description: >- - Sequential number for ordering streaming events - type: + (Optional) if specified, the new response will be a continuation of the + previous response. This can be used to easily fork-off new responses from + existing responses. + conversation: type: string - const: response.output_item.added - default: response.output_item.added description: >- - Event type identifier, always "response.output_item.added" + (Optional) The ID of a conversation to add the response to. Must begin + with 'conv_'. Input and output messages will be automatically added to + the conversation. + store: + type: boolean + stream: + type: boolean + temperature: + type: number + text: + $ref: '#/components/schemas/OpenAIResponseText' + tools: + type: array + items: + $ref: '#/components/schemas/OpenAIResponseInputTool' + include: + type: array + items: + type: string + description: >- + (Optional) Additional fields to include in the response. + max_infer_iters: + type: integer additionalProperties: false required: - - response_id - - item - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseOutputItemAdded - description: >- - Streaming event for when a new output item is added to the response. - "OpenAIResponseObjectStreamResponseOutputItemDone": - type: object - properties: - response_id: - type: string + - input + - model + title: CreateOpenaiResponseRequest + OpenAIResponseObject: + $defs: + AllowedToolsFilter: description: >- - Unique identifier of the response containing this output - item: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - description: >- - The completed output item (message, tool call, etc.) - output_index: - type: integer + Filter configuration for restricting which MCP tools can be used. + + + :param tool_names: (Optional) List of specific tool names that are allowed + properties: + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Tool Names + title: AllowedToolsFilter + type: object + MCPListToolsTool: description: >- - Index position of this item in the output list - sequence_number: - type: integer + Tool definition returned by MCP list tools operation. + + + :param input_schema: JSON schema defining the tool's input parameters + + :param name: Name of the tool + + :param description: (Optional) Description of what the tool does + properties: + input_schema: + additionalProperties: true + title: Input Schema + type: object + name: + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + required: + - input_schema + - name + title: MCPListToolsTool + type: object + OpenAIResponseAnnotationCitation: description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.output_item.done - default: response.output_item.done + URL citation annotation for referencing external web resources. + + + :param type: Annotation type identifier, always "url_citation" + + :param end_index: End position of the citation span in the content + + :param start_index: Start position of the citation span in the content + + :param title: Title of the referenced web resource + + :param url: URL of the referenced web resource + properties: + type: + const: url_citation + default: url_citation + title: Type + type: string + end_index: + title: End Index + type: integer + start_index: + title: Start Index + type: integer + title: + title: Title + type: string + url: + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + "OpenAIResponseAnnotationContainerFileCitation": + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: >- + OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: description: >- - Event type identifier, always "response.output_item.done" - additionalProperties: false - required: - - response_id - - item - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseOutputItemDone - description: >- - Streaming event for when an output item is completed. - "OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded": - type: object - properties: - item_id: - type: string + File citation annotation for referencing specific files in response content. + + + :param type: Annotation type identifier, always "file_citation" + + :param file_id: Unique identifier of the referenced file + + :param filename: Name of the referenced file + + :param index: Position index of the citation within the content + properties: + type: + const: file_citation + default: file_citation + title: Type + type: string + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + index: + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: description: >- - Unique identifier of the item to which the annotation is being added - output_index: - type: integer + Refusal content within a streamed response part. + + + :param type: Content part type identifier, always "refusal" + + :param refusal: Refusal text supplied by the model + properties: + type: + const: refusal + default: refusal + title: Type + type: string + refusal: + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + OpenAIResponseError: description: >- - Index position of the output item in the response's output array - content_index: - type: integer + Error details for failed OpenAI response requests. + + + :param code: Error code identifying the type of failure + + :param message: Human-readable error message describing the failure + properties: + code: + title: Code + type: string + message: + title: Message + type: string + required: + - code + - message + title: OpenAIResponseError + type: object + OpenAIResponseInputMessageContentImage: description: >- - Index position of the content part within the output item - annotation_index: - type: integer + Image content for input messages in OpenAI response format. + + + :param detail: Level of detail for image processing, can be "low", "high", + or "auto" + + :param type: Content type identifier, always "input_image" + + :param image_url: (Optional) URL of the image content + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + title: Detail + type: + const: input_image + default: input_image + title: Type + type: string + image_url: + anyOf: + - type: string + - type: 'null' + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: description: >- - Index of the annotation within the content part - annotation: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' - discriminator: - propertyName: type - mapping: - file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' - container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' - description: The annotation object being added - sequence_number: - type: integer + Text content for input messages in OpenAI response format. + + + :param text: The text content of the input message + + :param type: Content type identifier, always "input_text" + properties: + text: + title: Text + type: string + type: + const: input_text + default: input_text + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseInputToolFileSearch: description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.output_text.annotation.added - default: response.output_text.annotation.added + File search tool configuration for OpenAI response inputs. + + + :param type: Tool type identifier, always "file_search" + + :param vector_store_ids: List of vector store identifiers to search within + + :param filters: (Optional) Additional filters to apply to the search + + :param max_num_results: (Optional) Maximum number of search results to + return (1-50) + + :param ranking_options: (Optional) Options for ranking and scoring search + results + properties: + type: + const: file_search + default: file_search + title: Type + type: string + vector_store_ids: + items: + type: string + title: Vector Store Ids + type: array + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Filters + max_num_results: + anyOf: + - maximum: 50 + minimum: 1 + type: integer + - type: 'null' + default: 10 + title: Max Num Results + ranking_options: + anyOf: + - $ref: '#/$defs/SearchRankingOptions' + - type: 'null' + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + type: object + OpenAIResponseInputToolFunction: description: >- - Event type identifier, always "response.output_text.annotation.added" - additionalProperties: false - required: - - item_id - - output_index - - content_index - - annotation_index - - annotation - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded - description: >- - Streaming event for when an annotation is added to output text. - "OpenAIResponseObjectStreamResponseOutputTextDelta": - type: object - properties: - content_index: - type: integer - description: Index position within the text content - delta: - type: string - description: Incremental text content being added - item_id: - type: string + Function tool configuration for OpenAI response inputs. + + + :param type: Tool type identifier, always "function" + + :param name: Name of the function that can be called + + :param description: (Optional) Description of what the function does + + :param parameters: (Optional) JSON schema defining the function's parameters + + :param strict: (Optional) Whether to enforce strict parameter validation + properties: + type: + const: function + default: function + title: Type + type: string + name: + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Parameters + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + required: + - name + - parameters + title: OpenAIResponseInputToolFunction + type: object + OpenAIResponseInputToolWebSearch: description: >- - Unique identifier of the output item being updated - output_index: - type: integer + Web search tool configuration for OpenAI response inputs. + + + :param type: Web search tool type variant to use + + :param search_context_size: (Optional) Size of search context, must be + "low", "medium", or "high" + properties: + type: + anyOf: + - const: web_search + type: string + - const: web_search_preview + type: string + - const: web_search_preview_2025_03_11 + type: string + default: web_search + title: Type + search_context_size: + anyOf: + - pattern: ^low|medium|high$ + type: string + - type: 'null' + default: medium + title: Search Context Size + title: OpenAIResponseInputToolWebSearch + type: object + OpenAIResponseMCPApprovalRequest: description: >- - Index position of the item in the output list - sequence_number: - type: integer + A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments + type: string + id: + title: Id + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMessage: description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.output_text.delta - default: response.output_text.delta + Corresponds to the various Message types in the Responses API. + + They are all under one type because the Responses API gives them all + + the same "type" value, and there is no way to tell them apart in certain + + scenarios. + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_image: >- + #/$defs/OpenAIResponseInputMessageContentImage + input_text: >- + #/$defs/OpenAIResponseInputMessageContentText + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentText + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentImage + type: array + - items: + discriminator: + mapping: + output_text: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + - $ref: '#/$defs/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + "OpenAIResponseOutputMessageContentOutputText": + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + file_citation: >- + #/$defs/OpenAIResponseAnnotationFileCitation + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseAnnotationFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationCitation' + - $ref: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: >- + OpenAIResponseOutputMessageContentOutputText + type: object + "OpenAIResponseOutputMessageFileSearchToolCall": description: >- - Event type identifier, always "response.output_text.delta" - additionalProperties: false - required: - - content_index - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseOutputTextDelta - description: >- - Streaming event for incremental text content updates. - "OpenAIResponseObjectStreamResponseOutputTextDone": - type: object - properties: - content_index: - type: integer - description: Index position within the text content - text: - type: string + File search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param queries: List of search queries executed + + :param status: Current status of the file search operation + + :param type: Tool call type identifier, always "file_search_call" + + :param results: (Optional) Search results returned by the file search + operation + properties: + id: + title: Id + type: string + queries: + items: + type: string + title: Queries + type: array + status: + title: Status + type: string + type: + const: file_search_call + default: file_search_call + title: Type + type: string + results: + anyOf: + - items: + $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults + type: array + - type: 'null' + title: Results + required: + - id + - queries + - status + title: >- + OpenAIResponseOutputMessageFileSearchToolCall + type: object + "OpenAIResponseOutputMessageFileSearchToolCallResults": description: >- - Final complete text content of the output item - item_id: - type: string + Search results returned by the file search operation. + + + :param attributes: (Optional) Key-value attributes associated with the + file + + :param file_id: Unique identifier of the file containing the result + + :param filename: Name of the file containing the result + + :param score: Relevance score for this search result (between 0 and 1) + + :param text: Text content of the search result + properties: + attributes: + additionalProperties: true + title: Attributes + type: object + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + score: + title: Score + type: number + text: + title: Text + type: string + required: + - attributes + - file_id + - filename + - score + - text + title: >- + OpenAIResponseOutputMessageFileSearchToolCallResults + type: object + "OpenAIResponseOutputMessageFunctionToolCall": description: >- - Unique identifier of the completed output item - output_index: - type: integer + Function tool call output message for OpenAI responses. + + + :param call_id: Unique identifier for the function call + + :param name: Name of the function being called + + :param arguments: JSON string containing the function arguments + + :param type: Tool call type identifier, always "function_call" + + :param id: (Optional) Additional identifier for the tool call + + :param status: (Optional) Current status of the function call execution + properties: + call_id: + title: Call Id + type: string + name: + title: Name + type: string + arguments: + title: Arguments + type: string + type: + const: function_call + default: function_call + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - call_id + - name + - arguments + title: >- + OpenAIResponseOutputMessageFunctionToolCall + type: object + OpenAIResponseOutputMessageMCPCall: description: >- - Index position of the item in the output list - sequence_number: - type: integer + Model Context Protocol (MCP) call output message for OpenAI responses. + + + :param id: Unique identifier for this MCP call + + :param type: Tool call type identifier, always "mcp_call" + + :param arguments: JSON string containing the MCP call arguments + + :param name: Name of the MCP method being called + + :param server_label: Label identifying the MCP server handling the call + + :param error: (Optional) Error message if the MCP call failed + + :param output: (Optional) Output result from the successful MCP call + properties: + id: + title: Id + type: string + type: + const: mcp_call + default: mcp_call + title: Type + type: string + arguments: + title: Arguments + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + error: + anyOf: + - type: string + - type: 'null' + title: Error + output: + anyOf: + - type: string + - type: 'null' + title: Output + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + type: object + OpenAIResponseOutputMessageMCPListTools: description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.output_text.done - default: response.output_text.done + MCP list tools output message containing available tools from an MCP server. + + + :param id: Unique identifier for this MCP list tools operation + + :param type: Tool call type identifier, always "mcp_list_tools" + + :param server_label: Label identifying the MCP server providing the tools + + :param tools: List of available tools provided by the MCP server + properties: + id: + title: Id + type: string + type: + const: mcp_list_tools + default: mcp_list_tools + title: Type + type: string + server_label: + title: Server Label + type: string + tools: + items: + $ref: '#/$defs/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + type: object + "OpenAIResponseOutputMessageWebSearchToolCall": description: >- - Event type identifier, always "response.output_text.done" - additionalProperties: false - required: - - content_index - - text - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseOutputTextDone - description: >- - Streaming event for when text output is completed. - "OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded": - type: object - properties: - item_id: - type: string - description: Unique identifier of the output item - output_index: - type: integer - description: Index position of the output item - part: - $ref: '#/components/schemas/OpenAIResponseContentPartReasoningSummary' - description: The summary part that was added - sequence_number: - type: integer + Web search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param status: Current status of the web search operation + + :param type: Tool call type identifier, always "web_search_call" + properties: + id: + title: Id + type: string + status: + title: Status + type: string + type: + const: web_search_call + default: web_search_call + title: Type + type: string + required: + - id + - status + title: >- + OpenAIResponseOutputMessageWebSearchToolCall + type: object + OpenAIResponseText: description: >- - Sequential number for ordering streaming events - summary_index: - type: integer + Text response configuration for OpenAI responses. + + + :param format: (Optional) Text format configuration specifying output + format requirements + properties: + format: + anyOf: + - $ref: '#/$defs/OpenAIResponseTextFormat' + - type: 'null' + title: OpenAIResponseText + type: object + OpenAIResponseTextFormat: description: >- - Index of the summary part within the reasoning summary - type: - type: string - const: response.reasoning_summary_part.added - default: response.reasoning_summary_part.added + Configuration for Responses API text format. + + + :param type: Must be "text", "json_schema", or "json_object" to identify + the format type + + :param name: The name of the response format. Only used for json_schema. + + :param schema: The JSON schema the response should conform to. In a Python + SDK, this is often a `pydantic` model. Only used for json_schema. + + :param description: (Optional) A description of the response format. Only + used for json_schema. + + :param strict: (Optional) Whether to strictly enforce the JSON schema. + If true, the response must match the schema exactly. Only used for json_schema. + properties: + type: + anyOf: + - const: text + type: string + - const: json_schema + type: string + - const: json_object + type: string + title: Type + name: + anyOf: + - type: string + - type: 'null' + title: Name + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + title: OpenAIResponseTextFormat + type: object + OpenAIResponseToolMCP: description: >- - Event type identifier, always "response.reasoning_summary_part.added" - additionalProperties: false - required: - - item_id - - output_index - - part - - sequence_number - - summary_index - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded - description: >- - Streaming event for when a new reasoning summary part is added. - "OpenAIResponseObjectStreamResponseReasoningSummaryPartDone": - type: object - properties: - item_id: - type: string - description: Unique identifier of the output item - output_index: - type: integer - description: Index position of the output item - part: - $ref: '#/components/schemas/OpenAIResponseContentPartReasoningSummary' - description: The completed summary part - sequence_number: - type: integer + Model Context Protocol (MCP) tool configuration for OpenAI response object. + + + :param type: Tool type identifier, always "mcp" + + :param server_label: Label to identify this MCP server + + :param allowed_tools: (Optional) Restriction on which tools can be used + from this server + properties: + type: + const: mcp + default: mcp + title: Type + type: string + server_label: + title: Server Label + type: string + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/$defs/AllowedToolsFilter' + - type: 'null' + title: Allowed Tools + required: + - server_label + title: OpenAIResponseToolMCP + type: object + OpenAIResponseUsage: + description: >- + Usage information for OpenAI response. + + + :param input_tokens: Number of tokens in the input + + :param output_tokens: Number of tokens in the output + + :param total_tokens: Total tokens used (input + output) + + :param input_tokens_details: Detailed breakdown of input token usage + + :param output_tokens_details: Detailed breakdown of output token usage + properties: + input_tokens: + title: Input Tokens + type: integer + output_tokens: + title: Output Tokens + type: integer + total_tokens: + title: Total Tokens + type: integer + input_tokens_details: + anyOf: + - $ref: >- + #/$defs/OpenAIResponseUsageInputTokensDetails + - type: 'null' + output_tokens_details: + anyOf: + - $ref: >- + #/$defs/OpenAIResponseUsageOutputTokensDetails + - type: 'null' + required: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + type: object + OpenAIResponseUsageInputTokensDetails: description: >- - Sequential number for ordering streaming events - summary_index: - type: integer + Token details for input tokens in OpenAI response usage. + + + :param cached_tokens: Number of tokens retrieved from cache + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens + title: OpenAIResponseUsageInputTokensDetails + type: object + OpenAIResponseUsageOutputTokensDetails: description: >- - Index of the summary part within the reasoning summary - type: - type: string - const: response.reasoning_summary_part.done - default: response.reasoning_summary_part.done + Token details for output tokens in OpenAI response usage. + + + :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens + title: OpenAIResponseUsageOutputTokensDetails + type: object + SearchRankingOptions: description: >- - Event type identifier, always "response.reasoning_summary_part.done" - additionalProperties: false - required: - - item_id - - output_index - - part - - sequence_number - - summary_index - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningSummaryPartDone + Options for ranking and filtering search results. + + + :param ranker: (Optional) Name of the ranking algorithm to use + + :param score_threshold: (Optional) Minimum relevance score threshold for + results + properties: + ranker: + anyOf: + - type: string + - type: 'null' + title: Ranker + score_threshold: + anyOf: + - type: number + - type: 'null' + default: 0.0 + title: Score Threshold + title: SearchRankingOptions + type: object description: >- - Streaming event for when a reasoning summary part is completed. - "OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta": - type: object + Complete OpenAI response object containing generation results and metadata. + + + :param created_at: Unix timestamp when the response was created + + :param error: (Optional) Error details if the response generation failed + + :param id: Unique identifier for this response + + :param model: Model identifier used for generation + + :param object: Object type identifier, always "response" + + :param output: List of generated output items (messages, tool calls, etc.) + + :param parallel_tool_calls: Whether tool calls can be executed in parallel + + :param previous_response_id: (Optional) ID of the previous response in a conversation + + :param status: Current status of the response generation + + :param temperature: (Optional) Sampling temperature used for generation + + :param text: Text formatting configuration for the response + + :param top_p: (Optional) Nucleus sampling parameter used for generation + + :param tools: (Optional) An array of tools the model may call while generating + a response. + + :param truncation: (Optional) Truncation strategy applied to the response + + :param usage: (Optional) Token usage information for the response + + :param instructions: (Optional) System message inserted into the model's context properties: - delta: - type: string - description: Incremental summary text being added - item_id: - type: string - description: Unique identifier of the output item - output_index: - type: integer - description: Index position of the output item - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - summary_index: + created_at: + title: Created At type: integer - description: >- - Index of the summary part within the reasoning summary - type: - type: string - const: response.reasoning_summary_text.delta - default: response.reasoning_summary_text.delta - description: >- - Event type identifier, always "response.reasoning_summary_text.delta" - additionalProperties: false - required: - - delta - - item_id - - output_index - - sequence_number - - summary_index - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta - description: >- - Streaming event for incremental reasoning summary text updates. - "OpenAIResponseObjectStreamResponseReasoningSummaryTextDone": - type: object - properties: - text: - type: string - description: Final complete summary text - item_id: + error: + anyOf: + - $ref: '#/$defs/OpenAIResponseError' + - type: 'null' + id: + title: Id type: string - description: Unique identifier of the output item - output_index: - type: integer - description: Index position of the output item - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - summary_index: - type: integer - description: >- - Index of the summary part within the reasoning summary - type: + model: + title: Model type: string - const: response.reasoning_summary_text.done - default: response.reasoning_summary_text.done - description: >- - Event type identifier, always "response.reasoning_summary_text.done" - additionalProperties: false - required: - - text - - item_id - - output_index - - sequence_number - - summary_index - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningSummaryTextDone - description: >- - Streaming event for when reasoning summary text is completed. - "OpenAIResponseObjectStreamResponseReasoningTextDelta": - type: object - properties: - content_index: - type: integer - description: >- - Index position of the reasoning content part - delta: + object: + const: response + default: response + title: Object type: string - description: Incremental reasoning text being added - item_id: + output: + items: + discriminator: + mapping: + file_search_call: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + function_call: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + mcp_list_tools: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + message: '#/$defs/OpenAIResponseMessage' + web_search_call: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseMessage' + - $ref: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' + title: Output + type: array + parallel_tool_calls: + default: false + title: Parallel Tool Calls + type: boolean + previous_response_id: type: string description: >- - Unique identifier of the output item being updated - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer + (Optional) ID of the previous response in a conversation + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' description: >- - Sequential number for ordering streaming events - type: + (Optional) Reference to a prompt template and its variables. + status: + title: Status type: string - const: response.reasoning_text.delta - default: response.reasoning_text.delta - description: >- - Event type identifier, always "response.reasoning_text.delta" - additionalProperties: false + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + text: + $ref: '#/$defs/OpenAIResponseText' + default: + format: + type: text + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + tools: + anyOf: + - items: + discriminator: + mapping: + file_search: >- + #/$defs/OpenAIResponseInputToolFileSearch + function: '#/$defs/OpenAIResponseInputToolFunction' + mcp: '#/$defs/OpenAIResponseToolMCP' + web_search: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseInputToolWebSearch' + - $ref: >- + #/$defs/OpenAIResponseInputToolFileSearch + - $ref: '#/$defs/OpenAIResponseInputToolFunction' + - $ref: '#/$defs/OpenAIResponseToolMCP' + type: array + - type: 'null' + title: Tools + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + usage: + anyOf: + - $ref: '#/$defs/OpenAIResponseUsage' + - type: 'null' + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions required: - - content_index - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningTextDelta - description: >- - Streaming event for incremental reasoning text updates. - "OpenAIResponseObjectStreamResponseReasoningTextDone": + - created_at + - id + - model + - output + - status + title: OpenAIResponseObject type: object + AsyncIterator: + type: object + OpenAIDeleteResponseObject: + description: >- + Response object confirming deletion of an OpenAI response. + + + :param id: Unique identifier of the deleted response + + :param object: Object type identifier, always "response" + + :param deleted: Deletion confirmation flag, always True properties: - content_index: - type: integer - description: >- - Index position of the reasoning content part - text: - type: string - description: Final complete reasoning text - item_id: + id: + title: Id type: string - description: >- - Unique identifier of the completed output item - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: + object: + const: response + default: response + title: Object type: string - const: response.reasoning_text.done - default: response.reasoning_text.done - description: >- - Event type identifier, always "response.reasoning_text.done" - additionalProperties: false + deleted: + default: true + title: Deleted + type: boolean required: - - content_index - - text - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningTextDone - description: >- - Streaming event for when reasoning text is completed. - "OpenAIResponseObjectStreamResponseRefusalDelta": + - id + title: OpenAIDeleteResponseObject type: object - properties: - content_index: - type: integer - description: Index position of the content part - delta: - type: string - description: Incremental refusal text being added - item_id: - type: string - description: Unique identifier of the output item - output_index: - type: integer + ListOpenAIResponseInputItem: + $defs: + MCPListToolsTool: description: >- - Index position of the item in the output list - sequence_number: - type: integer + Tool definition returned by MCP list tools operation. + + + :param input_schema: JSON schema defining the tool's input parameters + + :param name: Name of the tool + + :param description: (Optional) Description of what the tool does + properties: + input_schema: + additionalProperties: true + title: Input Schema + type: object + name: + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + required: + - input_schema + - name + title: MCPListToolsTool + type: object + OpenAIResponseAnnotationCitation: description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.refusal.delta - default: response.refusal.delta + URL citation annotation for referencing external web resources. + + + :param type: Annotation type identifier, always "url_citation" + + :param end_index: End position of the citation span in the content + + :param start_index: Start position of the citation span in the content + + :param title: Title of the referenced web resource + + :param url: URL of the referenced web resource + properties: + type: + const: url_citation + default: url_citation + title: Type + type: string + end_index: + title: End Index + type: integer + start_index: + title: Start Index + type: integer + title: + title: Title + type: string + url: + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + "OpenAIResponseAnnotationContainerFileCitation": + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: >- + OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: description: >- - Event type identifier, always "response.refusal.delta" - additionalProperties: false - required: - - content_index - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseRefusalDelta - description: >- - Streaming event for incremental refusal text updates. - "OpenAIResponseObjectStreamResponseRefusalDone": - type: object - properties: - content_index: - type: integer - description: Index position of the content part - refusal: - type: string - description: Final complete refusal text - item_id: - type: string - description: Unique identifier of the output item - output_index: - type: integer + File citation annotation for referencing specific files in response content. + + + :param type: Annotation type identifier, always "file_citation" + + :param file_id: Unique identifier of the referenced file + + :param filename: Name of the referenced file + + :param index: Position index of the citation within the content + properties: + type: + const: file_citation + default: file_citation + title: Type + type: string + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + index: + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: description: >- - Index position of the item in the output list - sequence_number: - type: integer + Refusal content within a streamed response part. + + + :param type: Content part type identifier, always "refusal" + + :param refusal: Refusal text supplied by the model + properties: + type: + const: refusal + default: refusal + title: Type + type: string + refusal: + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + "OpenAIResponseInputFunctionToolCallOutput": description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.refusal.done - default: response.refusal.done + This represents the output of a function call that gets passed back to + the model. + properties: + call_id: + title: Call Id + type: string + output: + title: Output + type: string + type: + const: function_call_output + default: function_call_output + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - call_id + - output + title: >- + OpenAIResponseInputFunctionToolCallOutput + type: object + OpenAIResponseInputMessageContentImage: description: >- - Event type identifier, always "response.refusal.done" - additionalProperties: false - required: - - content_index - - refusal - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseRefusalDone - description: >- - Streaming event for when refusal text is completed. - "OpenAIResponseObjectStreamResponseWebSearchCallCompleted": - type: object - properties: - item_id: - type: string + Image content for input messages in OpenAI response format. + + + :param detail: Level of detail for image processing, can be "low", "high", + or "auto" + + :param type: Content type identifier, always "input_image" + + :param image_url: (Optional) URL of the image content + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + title: Detail + type: + const: input_image + default: input_image + title: Type + type: string + image_url: + anyOf: + - type: string + - type: 'null' + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: description: >- - Unique identifier of the completed web search call - output_index: - type: integer + Text content for input messages in OpenAI response format. + + + :param text: The text content of the input message + + :param type: Content type identifier, always "input_text" + properties: + text: + title: Text + type: string + type: + const: input_text + default: input_text + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseMCPApprovalRequest: description: >- - Index position of the item in the output list - sequence_number: - type: integer + A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments + type: string + id: + title: Id + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMCPApprovalResponse: + description: A response to an MCP approval request. + properties: + approval_request_id: + title: Approval Request Id + type: string + approve: + title: Approve + type: boolean + type: + const: mcp_approval_response + default: mcp_approval_response + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + reason: + anyOf: + - type: string + - type: 'null' + title: Reason + required: + - approval_request_id + - approve + title: OpenAIResponseMCPApprovalResponse + type: object + OpenAIResponseMessage: description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.web_search_call.completed - default: response.web_search_call.completed + Corresponds to the various Message types in the Responses API. + + They are all under one type because the Responses API gives them all + + the same "type" value, and there is no way to tell them apart in certain + + scenarios. + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_image: >- + #/$defs/OpenAIResponseInputMessageContentImage + input_text: >- + #/$defs/OpenAIResponseInputMessageContentText + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentText + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentImage + type: array + - items: + discriminator: + mapping: + output_text: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + - $ref: '#/$defs/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + "OpenAIResponseOutputMessageContentOutputText": + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + file_citation: >- + #/$defs/OpenAIResponseAnnotationFileCitation + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseAnnotationFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationCitation' + - $ref: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: >- + OpenAIResponseOutputMessageContentOutputText + type: object + "OpenAIResponseOutputMessageFileSearchToolCall": description: >- - Event type identifier, always "response.web_search_call.completed" - additionalProperties: false - required: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseWebSearchCallCompleted - description: >- - Streaming event for completed web search calls. - "OpenAIResponseObjectStreamResponseWebSearchCallInProgress": - type: object - properties: - item_id: - type: string - description: Unique identifier of the web search call - output_index: - type: integer + File search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param queries: List of search queries executed + + :param status: Current status of the file search operation + + :param type: Tool call type identifier, always "file_search_call" + + :param results: (Optional) Search results returned by the file search + operation + properties: + id: + title: Id + type: string + queries: + items: + type: string + title: Queries + type: array + status: + title: Status + type: string + type: + const: file_search_call + default: file_search_call + title: Type + type: string + results: + anyOf: + - items: + $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults + type: array + - type: 'null' + title: Results + required: + - id + - queries + - status + title: >- + OpenAIResponseOutputMessageFileSearchToolCall + type: object + "OpenAIResponseOutputMessageFileSearchToolCallResults": description: >- - Index position of the item in the output list - sequence_number: - type: integer + Search results returned by the file search operation. + + + :param attributes: (Optional) Key-value attributes associated with the + file + + :param file_id: Unique identifier of the file containing the result + + :param filename: Name of the file containing the result + + :param score: Relevance score for this search result (between 0 and 1) + + :param text: Text content of the search result + properties: + attributes: + additionalProperties: true + title: Attributes + type: object + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + score: + title: Score + type: number + text: + title: Text + type: string + required: + - attributes + - file_id + - filename + - score + - text + title: >- + OpenAIResponseOutputMessageFileSearchToolCallResults + type: object + "OpenAIResponseOutputMessageFunctionToolCall": description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.web_search_call.in_progress - default: response.web_search_call.in_progress + Function tool call output message for OpenAI responses. + + + :param call_id: Unique identifier for the function call + + :param name: Name of the function being called + + :param arguments: JSON string containing the function arguments + + :param type: Tool call type identifier, always "function_call" + + :param id: (Optional) Additional identifier for the tool call + + :param status: (Optional) Current status of the function call execution + properties: + call_id: + title: Call Id + type: string + name: + title: Name + type: string + arguments: + title: Arguments + type: string + type: + const: function_call + default: function_call + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - call_id + - name + - arguments + title: >- + OpenAIResponseOutputMessageFunctionToolCall + type: object + OpenAIResponseOutputMessageMCPCall: description: >- - Event type identifier, always "response.web_search_call.in_progress" - additionalProperties: false - required: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseWebSearchCallInProgress - description: >- - Streaming event for web search calls in progress. - "OpenAIResponseObjectStreamResponseWebSearchCallSearching": - type: object - properties: - item_id: - type: string - output_index: - type: integer - sequence_number: - type: integer - type: - type: string - const: response.web_search_call.searching - default: response.web_search_call.searching - additionalProperties: false - required: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseWebSearchCallSearching - OpenAIDeleteResponseObject: - type: object - properties: - id: - type: string + Model Context Protocol (MCP) call output message for OpenAI responses. + + + :param id: Unique identifier for this MCP call + + :param type: Tool call type identifier, always "mcp_call" + + :param arguments: JSON string containing the MCP call arguments + + :param name: Name of the MCP method being called + + :param server_label: Label identifying the MCP server handling the call + + :param error: (Optional) Error message if the MCP call failed + + :param output: (Optional) Output result from the successful MCP call + properties: + id: + title: Id + type: string + type: + const: mcp_call + default: mcp_call + title: Type + type: string + arguments: + title: Arguments + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + error: + anyOf: + - type: string + - type: 'null' + title: Error + output: + anyOf: + - type: string + - type: 'null' + title: Output + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + type: object + OpenAIResponseOutputMessageMCPListTools: description: >- - Unique identifier of the deleted response - object: - type: string - const: response - default: response + MCP list tools output message containing available tools from an MCP server. + + + :param id: Unique identifier for this MCP list tools operation + + :param type: Tool call type identifier, always "mcp_list_tools" + + :param server_label: Label identifying the MCP server providing the tools + + :param tools: List of available tools provided by the MCP server + properties: + id: + title: Id + type: string + type: + const: mcp_list_tools + default: mcp_list_tools + title: Type + type: string + server_label: + title: Server Label + type: string + tools: + items: + $ref: '#/$defs/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + type: object + "OpenAIResponseOutputMessageWebSearchToolCall": description: >- - Object type identifier, always "response" - deleted: - type: boolean - default: true - description: Deletion confirmation flag, always True - additionalProperties: false - required: - - id - - object - - deleted - title: OpenAIDeleteResponseObject + Web search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param status: Current status of the web search operation + + :param type: Tool call type identifier, always "web_search_call" + properties: + id: + title: Id + type: string + status: + title: Status + type: string + type: + const: web_search_call + default: web_search_call + title: Type + type: string + required: + - id + - status + title: >- + OpenAIResponseOutputMessageWebSearchToolCall + type: object description: >- - Response object confirming deletion of an OpenAI response. - ListOpenAIResponseInputItem: - type: object + List container for OpenAI response input items. + + + :param data: List of input items + + :param object: Object type identifier, always "list" properties: data: - type: array items: - $ref: '#/components/schemas/OpenAIResponseInput' - description: List of input items + anyOf: + - discriminator: + mapping: + file_search_call: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + function_call: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + mcp_list_tools: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + message: '#/$defs/OpenAIResponseMessage' + web_search_call: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseMessage' + - $ref: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' + - $ref: >- + #/$defs/OpenAIResponseInputFunctionToolCallOutput + - $ref: >- + #/$defs/OpenAIResponseMCPApprovalResponse + - $ref: '#/$defs/OpenAIResponseMessage' + title: Data + type: array object: - type: string const: list default: list - description: Object type identifier, always "list" - additionalProperties: false + title: Object + type: string required: - data - - object title: ListOpenAIResponseInputItem - description: >- - List container for OpenAI response input items. + type: object RunShieldRequest: type: object - properties: - shield_id: - type: string - description: The identifier of the shield to run. - messages: - type: array - items: - $ref: '#/components/schemas/OpenAIMessageParam' - description: The messages to run the shield on. - params: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The parameters of the shield. - additionalProperties: false - required: - - shield_id - - messages - - params - title: RunShieldRequest RunShieldResponse: - type: object + $defs: + SafetyViolation: + description: >- + Details of a safety violation detected by content moderation. + + + :param violation_level: Severity level of the violation + + :param user_message: (Optional) Message to convey to the user about the + violation + + :param metadata: Additional metadata including specific violation codes + for debugging and telemetry + properties: + violation_level: + $ref: '#/$defs/ViolationLevel' + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + metadata: + additionalProperties: true + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + type: object + ViolationLevel: + description: >- + Severity level of a safety violation. + + + :cvar INFO: Informational level violation that does not require action + + :cvar WARN: Warning level violation that suggests caution but allows continuation + + :cvar ERROR: Error level violation that requires blocking or intervention + enum: + - info + - warn + - error + title: ViolationLevel + type: string + description: >- + Response from running a safety shield. + + + :param violation: (Optional) Safety violation detected by the shield, if any properties: violation: - $ref: '#/components/schemas/SafetyViolation' - description: >- - (Optional) Safety violation detected by the shield, if any - additionalProperties: false + anyOf: + - $ref: '#/$defs/SafetyViolation' + - type: 'null' title: RunShieldResponse - description: Response from running a safety shield. - SafetyViolation: type: object - properties: - violation_level: - $ref: '#/components/schemas/ViolationLevel' - description: Severity level of the violation - user_message: - type: string + ListScoringFunctionsResponse: + $defs: + AgentTurnInputType: description: >- - (Optional) Message to convey to the user about the violation - metadata: + Parameter type for agent turn input. + + + :param type: Discriminator type. Always "agent_turn_input" + properties: + type: + const: agent_turn_input + default: agent_turn_input + title: Type + type: string + title: AgentTurnInputType type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + AggregationFunctionType: description: >- - Additional metadata including specific violation codes for debugging and - telemetry - additionalProperties: false - required: - - violation_level - - metadata - title: SafetyViolation - description: >- - Details of a safety violation detected by content moderation. - ViolationLevel: - type: string - enum: - - info - - warn - - error - title: ViolationLevel - description: Severity level of a safety violation. - AgentTurnInputType: - type: object - properties: - type: + Types of aggregation functions for scoring results. + + :cvar average: Calculate the arithmetic mean of scores + + :cvar weighted_average: Calculate a weighted average of scores + + :cvar median: Calculate the median value of scores + + :cvar categorical_count: Count occurrences of categorical values + + :cvar accuracy: Calculate accuracy as the proportion of correct answers + enum: + - average + - weighted_average + - median + - categorical_count + - accuracy + title: AggregationFunctionType type: string - const: agent_turn_input - default: agent_turn_input + ArrayType: description: >- - Discriminator type. Always "agent_turn_input" - additionalProperties: false - required: - - type - title: AgentTurnInputType - description: Parameter type for agent turn input. - AggregationFunctionType: - type: string - enum: - - average - - weighted_average - - median - - categorical_count - - accuracy - title: AggregationFunctionType - description: >- - Types of aggregation functions for scoring results. - ArrayType: - type: object - properties: - type: - type: string - const: array - default: array - description: Discriminator type. Always "array" - additionalProperties: false - required: - - type - title: ArrayType - description: Parameter type for array values. - BasicScoringFnParams: - type: object - properties: - type: - $ref: '#/components/schemas/ScoringFnParamsType' - const: basic - default: basic + Parameter type for array values. + + + :param type: Discriminator type. Always "array" + properties: + type: + const: array + default: array + title: Type + type: string + title: ArrayType + type: object + BasicScoringFnParams: description: >- - The type of scoring function parameters, always basic - aggregation_functions: - type: array - items: - $ref: '#/components/schemas/AggregationFunctionType' + Parameters for basic scoring function configuration. + + :param type: The type of scoring function parameters, always basic + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row + properties: + type: + const: basic + default: basic + title: Type + type: string + aggregation_functions: + description: >- + Aggregation functions to apply to the scores of each row + items: + $ref: '#/$defs/AggregationFunctionType' + title: Aggregation Functions + type: array + title: BasicScoringFnParams + type: object + BooleanType: description: >- - Aggregation functions to apply to the scores of each row - additionalProperties: false - required: - - type - - aggregation_functions - title: BasicScoringFnParams - description: >- - Parameters for basic scoring function configuration. - BooleanType: - type: object - properties: - type: - type: string - const: boolean - default: boolean - description: Discriminator type. Always "boolean" - additionalProperties: false - required: - - type - title: BooleanType - description: Parameter type for boolean values. - ChatCompletionInputType: - type: object - properties: - type: - type: string - const: chat_completion_input - default: chat_completion_input + Parameter type for boolean values. + + + :param type: Discriminator type. Always "boolean" + properties: + type: + const: boolean + default: boolean + title: Type + type: string + title: BooleanType + type: object + ChatCompletionInputType: + description: >- + Parameter type for chat completion input. + + + :param type: Discriminator type. Always "chat_completion_input" + properties: + type: + const: chat_completion_input + default: chat_completion_input + title: Type + type: string + title: ChatCompletionInputType + type: object + CompletionInputType: + description: >- + Parameter type for completion input. + + + :param type: Discriminator type. Always "completion_input" + properties: + type: + const: completion_input + default: completion_input + title: Type + type: string + title: CompletionInputType + type: object + JsonType: + description: >- + Parameter type for JSON values. + + + :param type: Discriminator type. Always "json" + properties: + type: + const: json + default: json + title: Type + type: string + title: JsonType + type: object + LLMAsJudgeScoringFnParams: + description: >- + Parameters for LLM-as-judge scoring function configuration. + + :param type: The type of scoring function parameters, always llm_as_judge + + :param judge_model: Identifier of the LLM model to use as a judge for + scoring + + :param prompt_template: (Optional) Custom prompt template for the judge + model + + :param judge_score_regexes: Regexes to extract the answer from generated + response + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row + properties: + type: + const: llm_as_judge + default: llm_as_judge + title: Type + type: string + judge_model: + title: Judge Model + type: string + prompt_template: + anyOf: + - type: string + - type: 'null' + title: Prompt Template + judge_score_regexes: + description: >- + Regexes to extract the answer from generated response + items: + type: string + title: Judge Score Regexes + type: array + aggregation_functions: + description: >- + Aggregation functions to apply to the scores of each row + items: + $ref: '#/$defs/AggregationFunctionType' + title: Aggregation Functions + type: array + required: + - judge_model + title: LLMAsJudgeScoringFnParams + type: object + NumberType: + description: >- + Parameter type for numeric values. + + + :param type: Discriminator type. Always "number" + properties: + type: + const: number + default: number + title: Type + type: string + title: NumberType + type: object + ObjectType: + description: >- + Parameter type for object values. + + + :param type: Discriminator type. Always "object" + properties: + type: + const: object + default: object + title: Type + type: string + title: ObjectType + type: object + RegexParserScoringFnParams: + description: >- + Parameters for regex parser scoring function configuration. + + :param type: The type of scoring function parameters, always regex_parser + + :param parsing_regexes: Regex to extract the answer from generated response + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row + properties: + type: + const: regex_parser + default: regex_parser + title: Type + type: string + parsing_regexes: + description: >- + Regex to extract the answer from generated response + items: + type: string + title: Parsing Regexes + type: array + aggregation_functions: + description: >- + Aggregation functions to apply to the scores of each row + items: + $ref: '#/$defs/AggregationFunctionType' + title: Aggregation Functions + type: array + title: RegexParserScoringFnParams + type: object + ScoringFn: + description: >- + A scoring function resource for evaluating model outputs. + + :param type: The resource type, always scoring_function + properties: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: scoring_function + default: scoring_function + title: Type + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + metadata: + additionalProperties: true + description: >- + Any additional metadata for this definition + title: Metadata + type: object + return_type: + description: >- + The return type of the deterministic function + discriminator: + mapping: + agent_turn_input: '#/$defs/AgentTurnInputType' + array: '#/$defs/ArrayType' + boolean: '#/$defs/BooleanType' + chat_completion_input: '#/$defs/ChatCompletionInputType' + completion_input: '#/$defs/CompletionInputType' + json: '#/$defs/JsonType' + number: '#/$defs/NumberType' + object: '#/$defs/ObjectType' + string: '#/$defs/StringType' + union: '#/$defs/UnionType' + propertyName: type + oneOf: + - $ref: '#/$defs/StringType' + - $ref: '#/$defs/NumberType' + - $ref: '#/$defs/BooleanType' + - $ref: '#/$defs/ArrayType' + - $ref: '#/$defs/ObjectType' + - $ref: '#/$defs/JsonType' + - $ref: '#/$defs/UnionType' + - $ref: '#/$defs/ChatCompletionInputType' + - $ref: '#/$defs/CompletionInputType' + - $ref: '#/$defs/AgentTurnInputType' + title: Return Type + params: + anyOf: + - discriminator: + mapping: + basic: '#/$defs/BasicScoringFnParams' + llm_as_judge: '#/$defs/LLMAsJudgeScoringFnParams' + regex_parser: '#/$defs/RegexParserScoringFnParams' + propertyName: type + oneOf: + - $ref: '#/$defs/LLMAsJudgeScoringFnParams' + - $ref: '#/$defs/RegexParserScoringFnParams' + - $ref: '#/$defs/BasicScoringFnParams' + - type: 'null' + description: >- + The parameters for the scoring function for benchmark eval, these + can be overridden for app eval + title: Params + required: + - identifier + - provider_id + - return_type + title: ScoringFn + type: object + StringType: + description: >- + Parameter type for string values. + + + :param type: Discriminator type. Always "string" + properties: + type: + const: string + default: string + title: Type + type: string + title: StringType + type: object + UnionType: description: >- - Discriminator type. Always "chat_completion_input" - additionalProperties: false - required: - - type - title: ChatCompletionInputType - description: >- - Parameter type for chat completion input. - CompletionInputType: - type: object + Parameter type for union values. + + + :param type: Discriminator type. Always "union" + properties: + type: + const: union + default: union + title: Type + type: string + title: UnionType + type: object properties: - type: - type: string - const: completion_input - default: completion_input - description: >- - Discriminator type. Always "completion_input" - additionalProperties: false + data: + items: + $ref: '#/$defs/ScoringFn' + title: Data + type: array required: - - type - title: CompletionInputType - description: Parameter type for completion input. - JsonType: + - data + title: ListScoringFunctionsResponse type: object - properties: - type: - type: string - const: json - default: json - description: Discriminator type. Always "json" - additionalProperties: false - required: - - type - title: JsonType - description: Parameter type for JSON values. - LLMAsJudgeScoringFnParams: + RegisterScoringFunctionRequest: type: object - properties: - type: - $ref: '#/components/schemas/ScoringFnParamsType' - const: llm_as_judge - default: llm_as_judge + ScoringFn: + $defs: + AgentTurnInputType: description: >- - The type of scoring function parameters, always llm_as_judge - judge_model: - type: string + Parameter type for agent turn input. + + + :param type: Discriminator type. Always "agent_turn_input" + properties: + type: + const: agent_turn_input + default: agent_turn_input + title: Type + type: string + title: AgentTurnInputType + type: object + AggregationFunctionType: description: >- - Identifier of the LLM model to use as a judge for scoring - prompt_template: + Types of aggregation functions for scoring results. + + :cvar average: Calculate the arithmetic mean of scores + + :cvar weighted_average: Calculate a weighted average of scores + + :cvar median: Calculate the median value of scores + + :cvar categorical_count: Count occurrences of categorical values + + :cvar accuracy: Calculate accuracy as the proportion of correct answers + enum: + - average + - weighted_average + - median + - categorical_count + - accuracy + title: AggregationFunctionType type: string + ArrayType: description: >- - (Optional) Custom prompt template for the judge model - judge_score_regexes: - type: array - items: - type: string + Parameter type for array values. + + + :param type: Discriminator type. Always "array" + properties: + type: + const: array + default: array + title: Type + type: string + title: ArrayType + type: object + BasicScoringFnParams: description: >- - Regexes to extract the answer from generated response - aggregation_functions: - type: array - items: - $ref: '#/components/schemas/AggregationFunctionType' + Parameters for basic scoring function configuration. + + :param type: The type of scoring function parameters, always basic + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row + properties: + type: + const: basic + default: basic + title: Type + type: string + aggregation_functions: + description: >- + Aggregation functions to apply to the scores of each row + items: + $ref: '#/$defs/AggregationFunctionType' + title: Aggregation Functions + type: array + title: BasicScoringFnParams + type: object + BooleanType: description: >- - Aggregation functions to apply to the scores of each row - additionalProperties: false - required: - - type - - judge_model - - judge_score_regexes - - aggregation_functions - title: LLMAsJudgeScoringFnParams - description: >- - Parameters for LLM-as-judge scoring function configuration. - NumberType: - type: object - properties: - type: - type: string - const: number - default: number - description: Discriminator type. Always "number" - additionalProperties: false - required: - - type - title: NumberType - description: Parameter type for numeric values. - ObjectType: - type: object - properties: - type: - type: string - const: object - default: object - description: Discriminator type. Always "object" - additionalProperties: false - required: - - type - title: ObjectType - description: Parameter type for object values. - RegexParserScoringFnParams: - type: object - properties: - type: - $ref: '#/components/schemas/ScoringFnParamsType' - const: regex_parser - default: regex_parser + Parameter type for boolean values. + + + :param type: Discriminator type. Always "boolean" + properties: + type: + const: boolean + default: boolean + title: Type + type: string + title: BooleanType + type: object + ChatCompletionInputType: description: >- - The type of scoring function parameters, always regex_parser - parsing_regexes: - type: array - items: - type: string + Parameter type for chat completion input. + + + :param type: Discriminator type. Always "chat_completion_input" + properties: + type: + const: chat_completion_input + default: chat_completion_input + title: Type + type: string + title: ChatCompletionInputType + type: object + CompletionInputType: description: >- - Regex to extract the answer from generated response - aggregation_functions: - type: array - items: - $ref: '#/components/schemas/AggregationFunctionType' + Parameter type for completion input. + + + :param type: Discriminator type. Always "completion_input" + properties: + type: + const: completion_input + default: completion_input + title: Type + type: string + title: CompletionInputType + type: object + JsonType: description: >- - Aggregation functions to apply to the scores of each row - additionalProperties: false - required: - - type - - parsing_regexes - - aggregation_functions - title: RegexParserScoringFnParams - description: >- - Parameters for regex parser scoring function configuration. - ScoringFn: - type: object - properties: - identifier: - type: string - provider_resource_id: - type: string - provider_id: - type: string - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: scoring_function - default: scoring_function + Parameter type for JSON values. + + + :param type: Discriminator type. Always "json" + properties: + type: + const: json + default: json + title: Type + type: string + title: JsonType + type: object + LLMAsJudgeScoringFnParams: description: >- - The resource type, always scoring_function - description: - type: string - metadata: + Parameters for LLM-as-judge scoring function configuration. + + :param type: The type of scoring function parameters, always llm_as_judge + + :param judge_model: Identifier of the LLM model to use as a judge for + scoring + + :param prompt_template: (Optional) Custom prompt template for the judge + model + + :param judge_score_regexes: Regexes to extract the answer from generated + response + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row + properties: + type: + const: llm_as_judge + default: llm_as_judge + title: Type + type: string + judge_model: + title: Judge Model + type: string + prompt_template: + anyOf: + - type: string + - type: 'null' + title: Prompt Template + judge_score_regexes: + description: >- + Regexes to extract the answer from generated response + items: + type: string + title: Judge Score Regexes + type: array + aggregation_functions: + description: >- + Aggregation functions to apply to the scores of each row + items: + $ref: '#/$defs/AggregationFunctionType' + title: Aggregation Functions + type: array + required: + - judge_model + title: LLMAsJudgeScoringFnParams type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - return_type: - oneOf: - - $ref: '#/components/schemas/StringType' - - $ref: '#/components/schemas/NumberType' - - $ref: '#/components/schemas/BooleanType' - - $ref: '#/components/schemas/ArrayType' - - $ref: '#/components/schemas/ObjectType' - - $ref: '#/components/schemas/JsonType' - - $ref: '#/components/schemas/UnionType' - - $ref: '#/components/schemas/ChatCompletionInputType' - - $ref: '#/components/schemas/CompletionInputType' - - $ref: '#/components/schemas/AgentTurnInputType' - discriminator: - propertyName: type - mapping: - string: '#/components/schemas/StringType' - number: '#/components/schemas/NumberType' - boolean: '#/components/schemas/BooleanType' - array: '#/components/schemas/ArrayType' - object: '#/components/schemas/ObjectType' - json: '#/components/schemas/JsonType' - union: '#/components/schemas/UnionType' - chat_completion_input: '#/components/schemas/ChatCompletionInputType' - completion_input: '#/components/schemas/CompletionInputType' - agent_turn_input: '#/components/schemas/AgentTurnInputType' - params: - $ref: '#/components/schemas/ScoringFnParams' - additionalProperties: false - required: - - identifier - - provider_id - - type - - metadata - - return_type - title: ScoringFn - description: >- - A scoring function resource for evaluating model outputs. - ScoringFnParams: - oneOf: - - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - - $ref: '#/components/schemas/RegexParserScoringFnParams' - - $ref: '#/components/schemas/BasicScoringFnParams' - discriminator: - propertyName: type - mapping: - llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' - regex_parser: '#/components/schemas/RegexParserScoringFnParams' - basic: '#/components/schemas/BasicScoringFnParams' - ScoringFnParamsType: - type: string - enum: - - llm_as_judge - - regex_parser - - basic - title: ScoringFnParamsType - description: >- - Types of scoring function parameter configurations. - StringType: - type: object - properties: - type: - type: string - const: string - default: string - description: Discriminator type. Always "string" - additionalProperties: false - required: - - type - title: StringType - description: Parameter type for string values. - UnionType: - type: object - properties: - type: - type: string - const: union - default: union - description: Discriminator type. Always "union" - additionalProperties: false - required: - - type - title: UnionType - description: Parameter type for union values. - ListScoringFunctionsResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/ScoringFn' - additionalProperties: false - required: - - data - title: ListScoringFunctionsResponse - ParamType: - oneOf: - - $ref: '#/components/schemas/StringType' - - $ref: '#/components/schemas/NumberType' - - $ref: '#/components/schemas/BooleanType' - - $ref: '#/components/schemas/ArrayType' - - $ref: '#/components/schemas/ObjectType' - - $ref: '#/components/schemas/JsonType' - - $ref: '#/components/schemas/UnionType' - - $ref: '#/components/schemas/ChatCompletionInputType' - - $ref: '#/components/schemas/CompletionInputType' - - $ref: '#/components/schemas/AgentTurnInputType' - discriminator: - propertyName: type - mapping: - string: '#/components/schemas/StringType' - number: '#/components/schemas/NumberType' - boolean: '#/components/schemas/BooleanType' - array: '#/components/schemas/ArrayType' - object: '#/components/schemas/ObjectType' - json: '#/components/schemas/JsonType' - union: '#/components/schemas/UnionType' - chat_completion_input: '#/components/schemas/ChatCompletionInputType' - completion_input: '#/components/schemas/CompletionInputType' - agent_turn_input: '#/components/schemas/AgentTurnInputType' - RegisterScoringFunctionRequest: - type: object + NumberType: + description: >- + Parameter type for numeric values. + + + :param type: Discriminator type. Always "number" + properties: + type: + const: number + default: number + title: Type + type: string + title: NumberType + type: object + ObjectType: + description: >- + Parameter type for object values. + + + :param type: Discriminator type. Always "object" + properties: + type: + const: object + default: object + title: Type + type: string + title: ObjectType + type: object + RegexParserScoringFnParams: + description: >- + Parameters for regex parser scoring function configuration. + + :param type: The type of scoring function parameters, always regex_parser + + :param parsing_regexes: Regex to extract the answer from generated response + + :param aggregation_functions: Aggregation functions to apply to the scores + of each row + properties: + type: + const: regex_parser + default: regex_parser + title: Type + type: string + parsing_regexes: + description: >- + Regex to extract the answer from generated response + items: + type: string + title: Parsing Regexes + type: array + aggregation_functions: + description: >- + Aggregation functions to apply to the scores of each row + items: + $ref: '#/$defs/AggregationFunctionType' + title: Aggregation Functions + type: array + title: RegexParserScoringFnParams + type: object + StringType: + description: >- + Parameter type for string values. + + + :param type: Discriminator type. Always "string" + properties: + type: + const: string + default: string + title: Type + type: string + title: StringType + type: object + UnionType: + description: >- + Parameter type for union values. + + + :param type: Discriminator type. Always "union" + properties: + type: + const: union + default: union + title: Type + type: string + title: UnionType + type: object + description: >- + A scoring function resource for evaluating model outputs. + + :param type: The resource type, always scoring_function properties: - scoring_fn_id: - type: string + identifier: description: >- - The ID of the scoring function to register. - description: - type: string - description: The description of the scoring function. - return_type: - $ref: '#/components/schemas/ParamType' - description: The return type of the scoring function. - provider_scoring_fn_id: + Unique identifier for this resource in llama stack + title: Identifier type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' description: >- - The ID of the provider scoring function to use for the scoring function. + Unique identifier for this resource in the provider + title: Provider Resource Id provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: scoring_function + default: scoring_function + title: Type type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + metadata: + additionalProperties: true + description: >- + Any additional metadata for this definition + title: Metadata + type: object + return_type: description: >- - The ID of the provider to use for the scoring function. + The return type of the deterministic function + discriminator: + mapping: + agent_turn_input: '#/$defs/AgentTurnInputType' + array: '#/$defs/ArrayType' + boolean: '#/$defs/BooleanType' + chat_completion_input: '#/$defs/ChatCompletionInputType' + completion_input: '#/$defs/CompletionInputType' + json: '#/$defs/JsonType' + number: '#/$defs/NumberType' + object: '#/$defs/ObjectType' + string: '#/$defs/StringType' + union: '#/$defs/UnionType' + propertyName: type + oneOf: + - $ref: '#/$defs/StringType' + - $ref: '#/$defs/NumberType' + - $ref: '#/$defs/BooleanType' + - $ref: '#/$defs/ArrayType' + - $ref: '#/$defs/ObjectType' + - $ref: '#/$defs/JsonType' + - $ref: '#/$defs/UnionType' + - $ref: '#/$defs/ChatCompletionInputType' + - $ref: '#/$defs/CompletionInputType' + - $ref: '#/$defs/AgentTurnInputType' + title: Return Type params: - $ref: '#/components/schemas/ScoringFnParams' + anyOf: + - discriminator: + mapping: + basic: '#/$defs/BasicScoringFnParams' + llm_as_judge: '#/$defs/LLMAsJudgeScoringFnParams' + regex_parser: '#/$defs/RegexParserScoringFnParams' + propertyName: type + oneOf: + - $ref: '#/$defs/LLMAsJudgeScoringFnParams' + - $ref: '#/$defs/RegexParserScoringFnParams' + - $ref: '#/$defs/BasicScoringFnParams' + - type: 'null' description: >- The parameters for the scoring function for benchmark eval, these can - be overridden for app eval. - additionalProperties: false + be overridden for app eval + title: Params required: - - scoring_fn_id - - description + - identifier + - provider_id - return_type - title: RegisterScoringFunctionRequest + title: ScoringFn + type: object ScoreRequest: type: object - properties: - input_rows: - type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The rows to score. - scoring_functions: - type: object - additionalProperties: - oneOf: - - $ref: '#/components/schemas/ScoringFnParams' - - type: 'null' - description: >- - The scoring functions to use for the scoring. - additionalProperties: false - required: - - input_rows - - scoring_functions - title: ScoreRequest ScoreResponse: - type: object + $defs: + ScoringResult: + description: >- + A scoring result for a single row. + + + :param score_rows: The scoring result for each row. Each row is a map + of column name to value. + + :param aggregated_results: Map of metric name to aggregated value + properties: + score_rows: + items: + additionalProperties: true + type: object + title: Score Rows + type: array + aggregated_results: + additionalProperties: true + title: Aggregated Results + type: object + required: + - score_rows + - aggregated_results + title: ScoringResult + type: object + description: >- + The response from scoring. + + + :param results: A map of scoring function name to ScoringResult. properties: results: - type: object additionalProperties: - $ref: '#/components/schemas/ScoringResult' - description: >- - A map of scoring function name to ScoringResult. - additionalProperties: false + $ref: '#/$defs/ScoringResult' + title: Results + type: object required: - results title: ScoreResponse - description: The response from scoring. - ScoringResult: type: object - properties: - score_rows: - type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The scoring result for each row. Each row is a map of column name to value. - aggregated_results: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Map of metric name to aggregated value - additionalProperties: false - required: - - score_rows - - aggregated_results - title: ScoringResult - description: A scoring result for a single row. ScoreBatchRequest: type: object - properties: - dataset_id: - type: string - description: The ID of the dataset to score. - scoring_functions: - type: object - additionalProperties: - oneOf: - - $ref: '#/components/schemas/ScoringFnParams' - - type: 'null' - description: >- - The scoring functions to use for the scoring. - save_results_dataset: - type: boolean - description: >- - Whether to save the results to a dataset. - additionalProperties: false - required: - - dataset_id - - scoring_functions - - save_results_dataset - title: ScoreBatchRequest ScoreBatchResponse: - type: object + $defs: + ScoringResult: + description: >- + A scoring result for a single row. + + + :param score_rows: The scoring result for each row. Each row is a map + of column name to value. + + :param aggregated_results: Map of metric name to aggregated value + properties: + score_rows: + items: + additionalProperties: true + type: object + title: Score Rows + type: array + aggregated_results: + additionalProperties: true + title: Aggregated Results + type: object + required: + - score_rows + - aggregated_results + title: ScoringResult + type: object + description: >- + Response from batch scoring operations on datasets. + + + :param dataset_id: (Optional) The identifier of the dataset that was scored + + :param results: A map of scoring function name to ScoringResult properties: dataset_id: - type: string - description: >- - (Optional) The identifier of the dataset that was scored + anyOf: + - type: string + - type: 'null' + title: Dataset Id results: - type: object additionalProperties: - $ref: '#/components/schemas/ScoringResult' - description: >- - A map of scoring function name to ScoringResult - additionalProperties: false + $ref: '#/$defs/ScoringResult' + title: Results + type: object required: - results title: ScoreBatchResponse - description: >- - Response from batch scoring operations on datasets. - Shield: type: object - properties: - identifier: - type: string - provider_resource_id: - type: string - provider_id: - type: string - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: shield - default: shield - description: The resource type, always shield - params: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Configuration parameters for the shield - additionalProperties: false - required: - - identifier - - provider_id - - type - title: Shield - description: >- - A safety shield resource that can be used to check content. ListShieldsResponse: - type: object + $defs: + Shield: + description: >- + A safety shield resource that can be used to check content. + + + :param params: (Optional) Configuration parameters for the shield + + :param type: The resource type, always shield + properties: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: shield + default: shield + title: Type + type: string + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + required: + - identifier + - provider_id + title: Shield + type: object properties: data: - type: array items: - $ref: '#/components/schemas/Shield' - additionalProperties: false + $ref: '#/$defs/Shield' + title: Data + type: array required: - data title: ListShieldsResponse + type: object RegisterShieldRequest: type: object properties: @@ -10279,209 +14070,584 @@ components: default: > Result {index} - Content: {chunk.content} - Metadata: {metadata} - description: >- - Template for formatting each retrieved chunk in the context. Available - placeholders: {index} (1-based chunk ordinal), {chunk.content} (chunk - content string), {metadata} (chunk metadata dict). Default: "Result {index}\nContent: - {chunk.content}\nMetadata: {metadata}\n" - mode: - $ref: '#/components/schemas/RAGSearchMode' - default: vector + :param params: (Optional) Configuration parameters for the shield + + :param type: The resource type, always shield + properties: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: shield + default: shield + title: Type + type: string + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + required: + - identifier + - provider_id + title: Shield + type: object + SyntheticDataGenerateRequest: + type: object + SyntheticDataGenerationResponse: + description: >- + Response from the synthetic data generation. Batch of (prompt, response, score) + tuples that pass the threshold. + + + :param synthetic_data: List of generated synthetic data samples that passed + the filtering criteria + + :param statistics: (Optional) Statistical information about the generation + process and filtering results + properties: + synthetic_data: + items: + additionalProperties: true + type: object + title: Synthetic Data + type: array + statistics: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Statistics + required: + - synthetic_data + title: SyntheticDataGenerationResponse + type: object + InvokeToolRequest: + type: object + ToolInvocationResult: + $defs: + ImageContentItem: + description: >- + A image content item + + + :param type: Discriminator type of the content item. Always "image" + + :param image: Image as a base64 encoded string or an URL + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/$defs/_URLOrData' + required: + - image + title: ImageContentItem + type: object + TextContentItem: + description: >- + A text content item + + + :param type: Discriminator type of the content item. Always "text" + + :param text: Text content + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + URL: description: >- - Search mode for retrieval—either "vector", "keyword", or "hybrid". Default - "vector". - ranker: - $ref: '#/components/schemas/Ranker' + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + _URLOrData: description: >- - Configuration for the ranker to use in hybrid search. Defaults to RRF - ranker. - additionalProperties: false - required: - - query_generator_config - - max_tokens_in_context - - max_chunks - - chunk_template - title: RAGQueryConfig - description: >- - Configuration for the RAG query generation. - RAGSearchMode: - type: string - enum: - - vector - - keyword - - hybrid - title: RAGSearchMode + A URL or a base64 encoded string + + + :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. + Note that URL could have length limits. + + :param data: base64 encoded image data as string + properties: + url: + anyOf: + - $ref: '#/$defs/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data + title: _URLOrData + type: object description: >- - Search modes for RAG query retrieval: - VECTOR: Uses vector similarity search - for semantic matching - KEYWORD: Uses keyword-based search for exact matching - - HYBRID: Combines both vector and keyword search for better results - RRFRanker: + Result of a tool invocation. + + + :param content: (Optional) The output content from the tool execution + + :param error_message: (Optional) Error message if the tool execution failed + + :param error_code: (Optional) Numeric error code if the tool execution failed + + :param metadata: (Optional) Additional metadata about the tool execution + properties: + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + - type: 'null' + title: Content + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + error_code: + anyOf: + - type: integer + - type: 'null' + title: Error Code + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + title: ToolInvocationResult type: object + URL: + description: >- + A URL reference to external content. + + + :param uri: The URL string pointing to the resource properties: - type: + uri: + title: Uri type: string - const: rrf - default: rrf - description: The type of ranker, always "rrf" - impact_factor: - type: number - default: 60.0 - description: >- - The impact factor for RRF scoring. Higher values give more weight to higher-ranked - results. Must be greater than 0 - additionalProperties: false required: - - type - - impact_factor - title: RRFRanker - description: >- - Reciprocal Rank Fusion (RRF) ranker configuration. - Ranker: - oneOf: - - $ref: '#/components/schemas/RRFRanker' - - $ref: '#/components/schemas/WeightedRanker' - discriminator: - propertyName: type - mapping: - rrf: '#/components/schemas/RRFRanker' - weighted: '#/components/schemas/WeightedRanker' - WeightedRanker: + - uri + title: URL type: object - properties: - type: - type: string - const: weighted - default: weighted - description: The type of ranker, always "weighted" - alpha: - type: number - default: 0.5 + ListToolDefsResponse: + $defs: + ToolDef: description: >- - Weight factor between 0 and 1. 0 means only use keyword scores, 1 means - only use vector scores, values in between blend both scores. - additionalProperties: false - required: - - type - - alpha - title: WeightedRanker + Tool definition used in runtime contexts. + + + :param name: Name of the tool + + :param description: (Optional) Human-readable description of what the + tool does + + :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) + + :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) + + :param metadata: (Optional) Additional metadata about the tool + + :param toolgroup_id: (Optional) ID of the tool group this tool belongs + to + properties: + toolgroup_id: + anyOf: + - type: string + - type: 'null' + title: Toolgroup Id + name: + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + input_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Input Schema + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Output Schema + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + required: + - name + title: ToolDef + type: object description: >- - Weighted ranker configuration that combines vector and keyword scores. + Response containing a list of tool definitions. + + + :param data: List of tool definitions + properties: + data: + items: + $ref: '#/$defs/ToolDef' + title: Data + type: array + required: + - data + title: ListToolDefsResponse + type: object + InsertRequest: + type: object QueryRequest: type: object - properties: - content: - $ref: '#/components/schemas/InterleavedContent' + RAGQueryResult: + $defs: + ImageContentItem: description: >- - The query content to search for in the indexed documents - vector_store_ids: - type: array - items: - type: string + A image content item + + + :param type: Discriminator type of the content item. Always "image" + + :param image: Image as a base64 encoded string or an URL + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/$defs/_URLOrData' + required: + - image + title: ImageContentItem + type: object + TextContentItem: + description: >- + A text content item + + + :param type: Discriminator type of the content item. Always "text" + + :param text: Text content + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + URL: description: >- - List of vector database IDs to search within - query_config: - $ref: '#/components/schemas/RAGQueryConfig' + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + _URLOrData: description: >- - (Optional) Configuration parameters for the query operation - additionalProperties: false - required: - - content - - vector_store_ids - title: QueryRequest - RAGQueryResult: - type: object + A URL or a base64 encoded string + + + :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. + Note that URL could have length limits. + + :param data: base64 encoded image data as string + properties: + url: + anyOf: + - $ref: '#/$defs/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data + title: _URLOrData + type: object + description: >- + Result of a RAG query containing retrieved content and metadata. + + + :param content: (Optional) The retrieved content from the query + + :param metadata: Additional metadata about the query result properties: content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - (Optional) The retrieved content from the query + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + - type: 'null' + title: Content metadata: + additionalProperties: true + title: Metadata type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Additional metadata about the query result - additionalProperties: false - required: - - metadata title: RAGQueryResult + type: object + ListToolGroupsResponse: + $defs: + ToolGroup: + description: >- + A group of related tools managed together. + + + :param type: Type of resource, always 'tool_group' + + :param mcp_endpoint: (Optional) Model Context Protocol endpoint for remote + tools + + :param args: (Optional) Additional arguments for the tool group + properties: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: tool_group + default: tool_group + title: Type + type: string + mcp_endpoint: + anyOf: + - $ref: '#/$defs/URL' + - type: 'null' + args: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Args + required: + - identifier + - provider_id + title: ToolGroup + type: object + URL: + description: >- + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object description: >- - Result of a RAG query containing retrieved content and metadata. - ToolGroup: + Response containing a list of tool groups. + + + :param data: List of tool groups + properties: + data: + items: + $ref: '#/$defs/ToolGroup' + title: Data + type: array + required: + - data + title: ListToolGroupsResponse + type: object + RegisterToolGroupRequest: type: object + ToolGroup: + $defs: + URL: + description: >- + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + description: >- + A group of related tools managed together. + + + :param type: Type of resource, always 'tool_group' + + :param mcp_endpoint: (Optional) Model Context Protocol endpoint for remote + tools + + :param args: (Optional) Additional arguments for the tool group properties: identifier: - type: string - provider_resource_id: - type: string - provider_id: - type: string - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt + description: >- + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: const: tool_group default: tool_group - description: Type of resource, always 'tool_group' + title: Type + type: string mcp_endpoint: - $ref: '#/components/schemas/URL' - description: >- - (Optional) Model Context Protocol endpoint for remote tools + anyOf: + - $ref: '#/$defs/URL' + - type: 'null' args: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional arguments for the tool group - additionalProperties: false + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Args required: - identifier - provider_id - - type title: ToolGroup - description: >- - A group of related tools managed together. - ListToolGroupsResponse: type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/ToolGroup' - description: List of tool groups - additionalProperties: false - required: - - data - title: ListToolGroupsResponse + ToolDef: description: >- - Response containing a list of tool groups. - RegisterToolGroupRequest: - type: object + Tool definition used in runtime contexts. + + + :param name: Name of the tool + + :param description: (Optional) Human-readable description of what the tool + does + + :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) + + :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) + + :param metadata: (Optional) Additional metadata about the tool + + :param toolgroup_id: (Optional) ID of the tool group this tool belongs to properties: toolgroup_id: + anyOf: + - type: string + - type: 'null' + title: Toolgroup Id + name: + title: Name type: string description: The ID of the tool group to register. provider_id: @@ -10556,1714 +14722,3061 @@ components: A chunk of content that can be inserted into a vector database. ChunkMetadata: type: object - properties: - chunk_id: - type: string - description: >- - The ID of the chunk. If not set, it will be generated based on the document - ID and content. - document_id: - type: string - description: >- - The ID of the document this chunk belongs to. - source: - type: string - description: >- - The source of the content, such as a URL, file path, or other identifier. - created_timestamp: - type: integer - description: >- - An optional timestamp indicating when the chunk was created. - updated_timestamp: - type: integer - description: >- - An optional timestamp indicating when the chunk was last updated. - chunk_window: - type: string - description: >- - The window of the chunk, which can be used to group related chunks together. - chunk_tokenizer: - type: string - description: >- - The tokenizer used to create the chunk. Default is Tiktoken. - chunk_embedding_model: - type: string - description: >- - The embedding model used to create the chunk's embedding. - chunk_embedding_dimension: - type: integer - description: >- - The dimension of the embedding vector for the chunk. - content_token_count: - type: integer - description: >- - The number of tokens in the content of the chunk. - metadata_token_count: - type: integer - description: >- - The number of tokens in the metadata of the chunk. - additionalProperties: false - title: ChunkMetadata - description: >- - `ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional - information about the chunk that will not be used in the context during - inference, but is required for backend functionality. The `ChunkMetadata` is - set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not - expected to change after. Use `Chunk.metadata` for metadata that will - be used in the context during inference. InsertChunksRequest: type: object - properties: - vector_store_id: - type: string - description: >- - The identifier of the vector database to insert the chunks into. - chunks: - type: array - items: - $ref: '#/components/schemas/Chunk' - description: >- - The chunks to insert. Each `Chunk` should contain content which can be - interleaved text, images, or other types. `metadata`: `dict[str, Any]` - and `embedding`: `List[float]` are optional. If `metadata` is provided, - you configure how Llama Stack formats the chunk during generation. If - `embedding` is not provided, it will be computed later. - ttl_seconds: - type: integer - description: The time to live of the chunks. - additionalProperties: false - required: - - vector_store_id - - chunks - title: InsertChunksRequest QueryChunksRequest: type: object - properties: - vector_store_id: - type: string + QueryChunksResponse: + $defs: + Chunk: description: >- - The identifier of the vector database to query. - query: - $ref: '#/components/schemas/InterleavedContent' - description: The query to search for. - params: + A chunk of content that can be inserted into a vector database. + + :param content: The content of the chunk, which can be interleaved text, + images, or other types. + + :param embedding: Optional embedding for the chunk. If not provided, it + will be computed later. + + :param metadata: Metadata associated with the chunk that will be used + in the model context during inference. + + :param stored_chunk_id: The chunk ID that is stored in the vector database. + Used for backend functionality. + + :param chunk_metadata: Metadata for the chunk that will NOT be used in + the context during inference. + The `chunk_metadata` is required backend functionality. + properties: + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + metadata: + additionalProperties: true + title: Metadata + type: object + embedding: + anyOf: + - items: + type: number + type: array + - type: 'null' + title: Embedding + chunk_id: + anyOf: + - type: string + - type: 'null' + title: Chunk Id + chunk_metadata: + anyOf: + - $ref: '#/$defs/ChunkMetadata' + - type: 'null' + required: + - content + title: Chunk type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The parameters of the query. - additionalProperties: false - required: - - vector_store_id - - query - title: QueryChunksRequest - QueryChunksResponse: - type: object + ChunkMetadata: + description: >- + `ChunkMetadata` is backend metadata for a `Chunk` that is used to store + additional information about the chunk that + will not be used in the context during inference, but is required + for backend functionality. The `ChunkMetadata` + is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and + is not expected to change after. + Use `Chunk.metadata` for metadata that will be used in the context + during inference. + :param chunk_id: The ID of the chunk. If not set, it will be generated + based on the document ID and content. + + :param document_id: The ID of the document this chunk belongs to. + + :param source: The source of the content, such as a URL, file path, or + other identifier. + + :param created_timestamp: An optional timestamp indicating when the chunk + was created. + + :param updated_timestamp: An optional timestamp indicating when the chunk + was last updated. + + :param chunk_window: The window of the chunk, which can be used to group + related chunks together. + + :param chunk_tokenizer: The tokenizer used to create the chunk. Default + is Tiktoken. + + :param chunk_embedding_model: The embedding model used to create the chunk's + embedding. + + :param chunk_embedding_dimension: The dimension of the embedding vector + for the chunk. + + :param content_token_count: The number of tokens in the content of the + chunk. + + :param metadata_token_count: The number of tokens in the metadata of the + chunk. + properties: + chunk_id: + anyOf: + - type: string + - type: 'null' + title: Chunk Id + document_id: + anyOf: + - type: string + - type: 'null' + title: Document Id + source: + anyOf: + - type: string + - type: 'null' + title: Source + created_timestamp: + anyOf: + - type: integer + - type: 'null' + title: Created Timestamp + updated_timestamp: + anyOf: + - type: integer + - type: 'null' + title: Updated Timestamp + chunk_window: + anyOf: + - type: string + - type: 'null' + title: Chunk Window + chunk_tokenizer: + anyOf: + - type: string + - type: 'null' + title: Chunk Tokenizer + chunk_embedding_model: + anyOf: + - type: string + - type: 'null' + title: Chunk Embedding Model + chunk_embedding_dimension: + anyOf: + - type: integer + - type: 'null' + title: Chunk Embedding Dimension + content_token_count: + anyOf: + - type: integer + - type: 'null' + title: Content Token Count + metadata_token_count: + anyOf: + - type: integer + - type: 'null' + title: Metadata Token Count + title: ChunkMetadata + type: object + ImageContentItem: + description: >- + A image content item + + + :param type: Discriminator type of the content item. Always "image" + + :param image: Image as a base64 encoded string or an URL + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/$defs/_URLOrData' + required: + - image + title: ImageContentItem + type: object + TextContentItem: + description: >- + A text content item + + + :param type: Discriminator type of the content item. Always "text" + + :param text: Text content + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + URL: + description: >- + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + _URLOrData: + description: >- + A URL or a base64 encoded string + + + :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. + Note that URL could have length limits. + + :param data: base64 encoded image data as string + properties: + url: + anyOf: + - $ref: '#/$defs/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data + title: _URLOrData + type: object + description: >- + Response from querying chunks in a vector database. + + + :param chunks: List of content chunks returned from the query + + :param scores: Relevance scores corresponding to each returned chunk properties: chunks: - type: array items: - $ref: '#/components/schemas/Chunk' - description: >- - List of content chunks returned from the query - scores: + $ref: '#/$defs/Chunk' + title: Chunks type: array + scores: items: type: number - description: >- - Relevance scores corresponding to each returned chunk - additionalProperties: false + title: Scores + type: array required: - chunks - scores title: QueryChunksResponse - description: >- - Response from querying chunks in a vector database. - VectorStoreFileCounts: type: object - properties: - completed: - type: integer - description: >- - Number of files that have been successfully processed - cancelled: - type: integer - description: >- - Number of files that had their processing cancelled - failed: - type: integer - description: Number of files that failed to process - in_progress: - type: integer + VectorStoreListResponse: + $defs: + VectorStoreFileCounts: description: >- - Number of files currently being processed - total: - type: integer + File processing status counts for a vector store. + + + :param completed: Number of files that have been successfully processed + + :param cancelled: Number of files that had their processing cancelled + + :param failed: Number of files that failed to process + + :param in_progress: Number of files currently being processed + + :param total: Total number of files in the vector store + properties: + completed: + title: Completed + type: integer + cancelled: + title: Cancelled + type: integer + failed: + title: Failed + type: integer + in_progress: + title: In Progress + type: integer + total: + title: Total + type: integer + required: + - completed + - cancelled + - failed + - in_progress + - total + title: VectorStoreFileCounts + type: object + VectorStoreObject: description: >- - Total number of files in the vector store - additionalProperties: false - required: - - completed - - cancelled - - failed - - in_progress - - total - title: VectorStoreFileCounts - description: >- - File processing status counts for a vector store. - VectorStoreListResponse: - type: object + OpenAI Vector Store object. + + + :param id: Unique identifier for the vector store + + :param object: Object type identifier, always "vector_store" + + :param created_at: Timestamp when the vector store was created + + :param name: (Optional) Name of the vector store + + :param usage_bytes: Storage space used by the vector store in bytes + + :param file_counts: File processing status counts for the vector store + + :param status: Current status of the vector store + + :param expires_after: (Optional) Expiration policy for the vector store + + :param expires_at: (Optional) Timestamp when the vector store will expire + + :param last_active_at: (Optional) Timestamp of last activity on the vector + store + + :param metadata: Set of key-value pairs that can be attached to the vector + store + properties: + id: + title: Id + type: string + object: + default: vector_store + title: Object + type: string + created_at: + title: Created At + type: integer + name: + anyOf: + - type: string + - type: 'null' + title: Name + usage_bytes: + default: 0 + title: Usage Bytes + type: integer + file_counts: + $ref: '#/$defs/VectorStoreFileCounts' + status: + default: completed + title: Status + type: string + expires_after: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After + expires_at: + anyOf: + - type: integer + - type: 'null' + title: Expires At + last_active_at: + anyOf: + - type: integer + - type: 'null' + title: Last Active At + metadata: + additionalProperties: true + title: Metadata + type: object + required: + - id + - created_at + - file_counts + title: VectorStoreObject + type: object + description: >- + Response from listing vector stores. + + + :param object: Object type identifier, always "list" + + :param data: List of vector store objects + + :param first_id: (Optional) ID of the first vector store in the list for pagination + + :param last_id: (Optional) ID of the last vector store in the list for pagination + + :param has_more: Whether there are more vector stores available beyond this + page properties: object: - type: string default: list - description: Object type identifier, always "list" + title: Object + type: string data: - type: array items: - $ref: '#/components/schemas/VectorStoreObject' - description: List of vector store objects + $ref: '#/$defs/VectorStoreObject' + title: Data + type: array first_id: - type: string - description: >- - (Optional) ID of the first vector store in the list for pagination + anyOf: + - type: string + - type: 'null' + title: First Id last_id: - type: string - description: >- - (Optional) ID of the last vector store in the list for pagination + anyOf: + - type: string + - type: 'null' + title: Last Id has_more: - type: boolean default: false - description: >- - Whether there are more vector stores available beyond this page - additionalProperties: false + title: Has More + type: boolean required: - - object - data - - has_more title: VectorStoreListResponse - description: Response from listing vector stores. - VectorStoreObject: type: object + VectorStoreObject: + $defs: + VectorStoreFileCounts: + description: >- + File processing status counts for a vector store. + + + :param completed: Number of files that have been successfully processed + + :param cancelled: Number of files that had their processing cancelled + + :param failed: Number of files that failed to process + + :param in_progress: Number of files currently being processed + + :param total: Total number of files in the vector store + properties: + completed: + title: Completed + type: integer + cancelled: + title: Cancelled + type: integer + failed: + title: Failed + type: integer + in_progress: + title: In Progress + type: integer + total: + title: Total + type: integer + required: + - completed + - cancelled + - failed + - in_progress + - total + title: VectorStoreFileCounts + type: object + description: >- + OpenAI Vector Store object. + + + :param id: Unique identifier for the vector store + + :param object: Object type identifier, always "vector_store" + + :param created_at: Timestamp when the vector store was created + + :param name: (Optional) Name of the vector store + + :param usage_bytes: Storage space used by the vector store in bytes + + :param file_counts: File processing status counts for the vector store + + :param status: Current status of the vector store + + :param expires_after: (Optional) Expiration policy for the vector store + + :param expires_at: (Optional) Timestamp when the vector store will expire + + :param last_active_at: (Optional) Timestamp of last activity on the vector + store + + :param metadata: Set of key-value pairs that can be attached to the vector + store properties: id: + title: Id type: string - description: Unique identifier for the vector store object: - type: string default: vector_store - description: >- - Object type identifier, always "vector_store" + title: Object + type: string created_at: + title: Created At type: integer - description: >- - Timestamp when the vector store was created name: - type: string - description: (Optional) Name of the vector store + anyOf: + - type: string + - type: 'null' + title: Name usage_bytes: - type: integer default: 0 - description: >- - Storage space used by the vector store in bytes + title: Usage Bytes + type: integer file_counts: - $ref: '#/components/schemas/VectorStoreFileCounts' - description: >- - File processing status counts for the vector store + $ref: '#/$defs/VectorStoreFileCounts' status: - type: string default: completed - description: Current status of the vector store + title: Status + type: string expires_after: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Expiration policy for the vector store + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After expires_at: - type: integer - description: >- - (Optional) Timestamp when the vector store will expire + anyOf: + - type: integer + - type: 'null' + title: Expires At last_active_at: - type: integer - description: >- - (Optional) Timestamp of last activity on the vector store + anyOf: + - type: integer + - type: 'null' + title: Last Active At metadata: + additionalProperties: true + title: Metadata type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Set of key-value pairs that can be attached to the vector store - additionalProperties: false required: - id - - object - created_at - - usage_bytes - file_counts - - status - - metadata title: VectorStoreObject - description: OpenAI Vector Store object. - "OpenAICreateVectorStoreRequestWithExtraBody": type: object - properties: - name: - type: string - description: (Optional) A name for the vector store - file_ids: - type: array - items: - type: string - description: >- - List of file IDs to include in the vector store - expires_after: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Expiration policy for the vector store - chunking_strategy: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Strategy for splitting files into chunks - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Set of key-value pairs that can be attached to the vector store - additionalProperties: false - title: >- - OpenAICreateVectorStoreRequestWithExtraBody - description: >- - Request to create a vector store with extra_body support. OpenaiUpdateVectorStoreRequest: type: object - properties: - name: - type: string - description: The name of the vector store. - expires_after: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The expiration policy for a vector store. - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Set of 16 key-value pairs that can be attached to an object. - additionalProperties: false - title: OpenaiUpdateVectorStoreRequest VectorStoreDeleteResponse: - type: object + description: >- + Response from deleting a vector store. + + + :param id: Unique identifier of the deleted vector store + + :param object: Object type identifier for the deletion response + + :param deleted: Whether the deletion operation was successful properties: id: + title: Id type: string - description: >- - Unique identifier of the deleted vector store object: - type: string default: vector_store.deleted - description: >- - Object type identifier for the deletion response + title: Object + type: string deleted: - type: boolean default: true - description: >- - Whether the deletion operation was successful - additionalProperties: false - required: - - id - - object - - deleted - title: VectorStoreDeleteResponse - description: Response from deleting a vector store. - VectorStoreChunkingStrategy: - oneOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' - discriminator: - propertyName: type - mapping: - auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' - static: '#/components/schemas/VectorStoreChunkingStrategyStatic' - VectorStoreChunkingStrategyAuto: - type: object - properties: - type: - type: string - const: auto - default: auto - description: >- - Strategy type, always "auto" for automatic chunking - additionalProperties: false - required: - - type - title: VectorStoreChunkingStrategyAuto - description: >- - Automatic chunking strategy for vector store files. - VectorStoreChunkingStrategyStatic: - type: object - properties: - type: - type: string - const: static - default: static - description: >- - Strategy type, always "static" for static chunking - static: - $ref: '#/components/schemas/VectorStoreChunkingStrategyStaticConfig' - description: >- - Configuration parameters for the static chunking strategy - additionalProperties: false - required: - - type - - static - title: VectorStoreChunkingStrategyStatic - description: >- - Static chunking strategy with configurable parameters. - VectorStoreChunkingStrategyStaticConfig: - type: object - properties: - chunk_overlap_tokens: - type: integer - default: 400 - description: >- - Number of tokens to overlap between adjacent chunks - max_chunk_size_tokens: - type: integer - default: 800 - description: >- - Maximum number of tokens per chunk, must be between 100 and 4096 - additionalProperties: false - required: - - chunk_overlap_tokens - - max_chunk_size_tokens - title: VectorStoreChunkingStrategyStaticConfig - description: >- - Configuration for static chunking strategy. - "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": - type: object - properties: - file_ids: - type: array - items: - type: string - description: >- - A list of File IDs that the vector store should use - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Key-value attributes to store with the files - chunking_strategy: - $ref: '#/components/schemas/VectorStoreChunkingStrategy' - description: >- - (Optional) The chunking strategy used to chunk the file(s). Defaults to - auto - additionalProperties: false + title: Deleted + type: boolean required: - - file_ids - title: >- - OpenAICreateVectorStoreFileBatchRequestWithExtraBody - description: >- - Request to create a vector store file batch with extra_body support. - VectorStoreFileBatchObject: + - id + title: VectorStoreDeleteResponse type: object + VectorStoreFileBatchObject: + $defs: + VectorStoreFileCounts: + description: >- + File processing status counts for a vector store. + + + :param completed: Number of files that have been successfully processed + + :param cancelled: Number of files that had their processing cancelled + + :param failed: Number of files that failed to process + + :param in_progress: Number of files currently being processed + + :param total: Total number of files in the vector store + properties: + completed: + title: Completed + type: integer + cancelled: + title: Cancelled + type: integer + failed: + title: Failed + type: integer + in_progress: + title: In Progress + type: integer + total: + title: Total + type: integer + required: + - completed + - cancelled + - failed + - in_progress + - total + title: VectorStoreFileCounts + type: object + description: >- + OpenAI Vector Store File Batch object. + + + :param id: Unique identifier for the file batch + + :param object: Object type identifier, always "vector_store.file_batch" + + :param created_at: Timestamp when the file batch was created + + :param vector_store_id: ID of the vector store containing the file batch + + :param status: Current processing status of the file batch + + :param file_counts: File processing status counts for the batch properties: id: + title: Id type: string - description: Unique identifier for the file batch object: - type: string default: vector_store.file_batch - description: >- - Object type identifier, always "vector_store.file_batch" + title: Object + type: string created_at: + title: Created At type: integer - description: >- - Timestamp when the file batch was created vector_store_id: + title: Vector Store Id type: string - description: >- - ID of the vector store containing the file batch status: - $ref: '#/components/schemas/VectorStoreFileStatus' - description: >- - Current processing status of the file batch + anyOf: + - const: completed + type: string + - const: in_progress + type: string + - const: cancelled + type: string + - const: failed + type: string + title: Status file_counts: - $ref: '#/components/schemas/VectorStoreFileCounts' - description: >- - File processing status counts for the batch - additionalProperties: false + $ref: '#/$defs/VectorStoreFileCounts' required: - id - - object - created_at - vector_store_id - status - file_counts title: VectorStoreFileBatchObject - description: OpenAI Vector Store File Batch object. - VectorStoreFileStatus: - oneOf: - - type: string - const: completed - - type: string - const: in_progress - - type: string - const: cancelled - - type: string - const: failed - VectorStoreFileLastError: type: object + VectorStoreFilesListInBatchResponse: + $defs: + VectorStoreChunkingStrategyAuto: + description: >- + Automatic chunking strategy for vector store files. + + + :param type: Strategy type, always "auto" for automatic chunking + properties: + type: + const: auto + default: auto + title: Type + type: string + title: VectorStoreChunkingStrategyAuto + type: object + VectorStoreChunkingStrategyStatic: + description: >- + Static chunking strategy with configurable parameters. + + + :param type: Strategy type, always "static" for static chunking + + :param static: Configuration parameters for the static chunking strategy + properties: + type: + const: static + default: static + title: Type + type: string + static: + $ref: >- + #/$defs/VectorStoreChunkingStrategyStaticConfig + required: + - static + title: VectorStoreChunkingStrategyStatic + type: object + VectorStoreChunkingStrategyStaticConfig: + description: >- + Configuration for static chunking strategy. + + + :param chunk_overlap_tokens: Number of tokens to overlap between adjacent + chunks + + :param max_chunk_size_tokens: Maximum number of tokens per chunk, must + be between 100 and 4096 + properties: + chunk_overlap_tokens: + default: 400 + title: Chunk Overlap Tokens + type: integer + max_chunk_size_tokens: + default: 800 + maximum: 4096 + minimum: 100 + title: Max Chunk Size Tokens + type: integer + title: VectorStoreChunkingStrategyStaticConfig + type: object + VectorStoreFileLastError: + description: >- + Error information for failed vector store file processing. + + + :param code: Error code indicating the type of failure + + :param message: Human-readable error message describing the failure + properties: + code: + anyOf: + - const: server_error + type: string + - const: rate_limit_exceeded + type: string + title: Code + message: + title: Message + type: string + required: + - code + - message + title: VectorStoreFileLastError + type: object + VectorStoreFileObject: + description: >- + OpenAI Vector Store File object. + + + :param id: Unique identifier for the file + + :param object: Object type identifier, always "vector_store.file" + + :param attributes: Key-value attributes associated with the file + + :param chunking_strategy: Strategy used for splitting the file into chunks + + :param created_at: Timestamp when the file was added to the vector store + + :param last_error: (Optional) Error information if file processing failed + + :param status: Current processing status of the file + + :param usage_bytes: Storage space used by this file in bytes + + :param vector_store_id: ID of the vector store containing this file + properties: + id: + title: Id + type: string + object: + default: vector_store.file + title: Object + type: string + attributes: + additionalProperties: true + title: Attributes + type: object + chunking_strategy: + discriminator: + mapping: + auto: '#/$defs/VectorStoreChunkingStrategyAuto' + static: >- + #/$defs/VectorStoreChunkingStrategyStatic + propertyName: type + oneOf: + - $ref: '#/$defs/VectorStoreChunkingStrategyAuto' + - $ref: >- + #/$defs/VectorStoreChunkingStrategyStatic + title: Chunking Strategy + created_at: + title: Created At + type: integer + last_error: + anyOf: + - $ref: '#/$defs/VectorStoreFileLastError' + - type: 'null' + status: + anyOf: + - const: completed + type: string + - const: in_progress + type: string + - const: cancelled + type: string + - const: failed + type: string + title: Status + usage_bytes: + default: 0 + title: Usage Bytes + type: integer + vector_store_id: + title: Vector Store Id + type: string + required: + - id + - chunking_strategy + - created_at + - status + - vector_store_id + title: VectorStoreFileObject + type: object + description: >- + Response from listing files in a vector store file batch. + + + :param object: Object type identifier, always "list" + + :param data: List of vector store file objects in the batch + + :param first_id: (Optional) ID of the first file in the list for pagination + + :param last_id: (Optional) ID of the last file in the list for pagination + + :param has_more: Whether there are more files available beyond this page properties: - code: - oneOf: + object: + default: list + title: Object + type: string + data: + items: + $ref: '#/$defs/VectorStoreFileObject' + title: Data + type: array + first_id: + anyOf: - type: string - const: server_error + - type: 'null' + title: First Id + last_id: + anyOf: - type: string - const: rate_limit_exceeded + - type: 'null' + title: Last Id + has_more: + default: false + title: Has More + type: boolean + required: + - data + title: VectorStoreFilesListInBatchResponse + type: object + Union: + type: object + nullable: true + VectorStoreListFilesResponse: + $defs: + VectorStoreChunkingStrategyAuto: description: >- - Error code indicating the type of failure - message: + Automatic chunking strategy for vector store files. + + + :param type: Strategy type, always "auto" for automatic chunking + properties: + type: + const: auto + default: auto + title: Type + type: string + title: VectorStoreChunkingStrategyAuto + type: object + VectorStoreChunkingStrategyStatic: + description: >- + Static chunking strategy with configurable parameters. + + + :param type: Strategy type, always "static" for static chunking + + :param static: Configuration parameters for the static chunking strategy + properties: + type: + const: static + default: static + title: Type + type: string + static: + $ref: >- + #/$defs/VectorStoreChunkingStrategyStaticConfig + required: + - static + title: VectorStoreChunkingStrategyStatic + type: object + VectorStoreChunkingStrategyStaticConfig: + description: >- + Configuration for static chunking strategy. + + + :param chunk_overlap_tokens: Number of tokens to overlap between adjacent + chunks + + :param max_chunk_size_tokens: Maximum number of tokens per chunk, must + be between 100 and 4096 + properties: + chunk_overlap_tokens: + default: 400 + title: Chunk Overlap Tokens + type: integer + max_chunk_size_tokens: + default: 800 + maximum: 4096 + minimum: 100 + title: Max Chunk Size Tokens + type: integer + title: VectorStoreChunkingStrategyStaticConfig + type: object + VectorStoreFileLastError: + description: >- + Error information for failed vector store file processing. + + + :param code: Error code indicating the type of failure + + :param message: Human-readable error message describing the failure + properties: + code: + anyOf: + - const: server_error + type: string + - const: rate_limit_exceeded + type: string + title: Code + message: + title: Message + type: string + required: + - code + - message + title: VectorStoreFileLastError + type: object + VectorStoreFileObject: + description: >- + OpenAI Vector Store File object. + + + :param id: Unique identifier for the file + + :param object: Object type identifier, always "vector_store.file" + + :param attributes: Key-value attributes associated with the file + + :param chunking_strategy: Strategy used for splitting the file into chunks + + :param created_at: Timestamp when the file was added to the vector store + + :param last_error: (Optional) Error information if file processing failed + + :param status: Current processing status of the file + + :param usage_bytes: Storage space used by this file in bytes + + :param vector_store_id: ID of the vector store containing this file + properties: + id: + title: Id + type: string + object: + default: vector_store.file + title: Object + type: string + attributes: + additionalProperties: true + title: Attributes + type: object + chunking_strategy: + discriminator: + mapping: + auto: '#/$defs/VectorStoreChunkingStrategyAuto' + static: >- + #/$defs/VectorStoreChunkingStrategyStatic + propertyName: type + oneOf: + - $ref: '#/$defs/VectorStoreChunkingStrategyAuto' + - $ref: >- + #/$defs/VectorStoreChunkingStrategyStatic + title: Chunking Strategy + created_at: + title: Created At + type: integer + last_error: + anyOf: + - $ref: '#/$defs/VectorStoreFileLastError' + - type: 'null' + status: + anyOf: + - const: completed + type: string + - const: in_progress + type: string + - const: cancelled + type: string + - const: failed + type: string + title: Status + usage_bytes: + default: 0 + title: Usage Bytes + type: integer + vector_store_id: + title: Vector Store Id + type: string + required: + - id + - chunking_strategy + - created_at + - status + - vector_store_id + title: VectorStoreFileObject + type: object + description: >- + Response from listing files in a vector store. + + + :param object: Object type identifier, always "list" + + :param data: List of vector store file objects + + :param first_id: (Optional) ID of the first file in the list for pagination + + :param last_id: (Optional) ID of the last file in the list for pagination + + :param has_more: Whether there are more files available beyond this page + properties: + object: + default: list + title: Object type: string + data: + items: + $ref: '#/$defs/VectorStoreFileObject' + title: Data + type: array + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + has_more: + default: false + title: Has More + type: boolean + required: + - data + title: VectorStoreListFilesResponse + type: object + OpenaiAttachFileToVectorStoreRequest: + type: object + VectorStoreFileObject: + $defs: + VectorStoreChunkingStrategyAuto: + description: >- + Automatic chunking strategy for vector store files. + + + :param type: Strategy type, always "auto" for automatic chunking + properties: + type: + const: auto + default: auto + title: Type + type: string + title: VectorStoreChunkingStrategyAuto + type: object + VectorStoreChunkingStrategyStatic: + description: >- + Static chunking strategy with configurable parameters. + + + :param type: Strategy type, always "static" for static chunking + + :param static: Configuration parameters for the static chunking strategy + properties: + type: + const: static + default: static + title: Type + type: string + static: + $ref: >- + #/$defs/VectorStoreChunkingStrategyStaticConfig + required: + - static + title: VectorStoreChunkingStrategyStatic + type: object + VectorStoreChunkingStrategyStaticConfig: + description: >- + Configuration for static chunking strategy. + + + :param chunk_overlap_tokens: Number of tokens to overlap between adjacent + chunks + + :param max_chunk_size_tokens: Maximum number of tokens per chunk, must + be between 100 and 4096 + properties: + chunk_overlap_tokens: + default: 400 + title: Chunk Overlap Tokens + type: integer + max_chunk_size_tokens: + default: 800 + maximum: 4096 + minimum: 100 + title: Max Chunk Size Tokens + type: integer + title: VectorStoreChunkingStrategyStaticConfig + type: object + VectorStoreFileLastError: description: >- - Human-readable error message describing the failure - additionalProperties: false - required: - - code - - message - title: VectorStoreFileLastError + Error information for failed vector store file processing. + + + :param code: Error code indicating the type of failure + + :param message: Human-readable error message describing the failure + properties: + code: + anyOf: + - const: server_error + type: string + - const: rate_limit_exceeded + type: string + title: Code + message: + title: Message + type: string + required: + - code + - message + title: VectorStoreFileLastError + type: object description: >- - Error information for failed vector store file processing. - VectorStoreFileObject: - type: object + OpenAI Vector Store File object. + + + :param id: Unique identifier for the file + + :param object: Object type identifier, always "vector_store.file" + + :param attributes: Key-value attributes associated with the file + + :param chunking_strategy: Strategy used for splitting the file into chunks + + :param created_at: Timestamp when the file was added to the vector store + + :param last_error: (Optional) Error information if file processing failed + + :param status: Current processing status of the file + + :param usage_bytes: Storage space used by this file in bytes + + :param vector_store_id: ID of the vector store containing this file properties: id: + title: Id type: string - description: Unique identifier for the file object: - type: string default: vector_store.file - description: >- - Object type identifier, always "vector_store.file" + title: Object + type: string attributes: + additionalProperties: true + title: Attributes type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Key-value attributes associated with the file chunking_strategy: - oneOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' discriminator: - propertyName: type mapping: - auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' - static: '#/components/schemas/VectorStoreChunkingStrategyStatic' - description: >- - Strategy used for splitting the file into chunks + auto: '#/$defs/VectorStoreChunkingStrategyAuto' + static: >- + #/$defs/VectorStoreChunkingStrategyStatic + propertyName: type + oneOf: + - $ref: '#/$defs/VectorStoreChunkingStrategyAuto' + - $ref: >- + #/$defs/VectorStoreChunkingStrategyStatic + title: Chunking Strategy created_at: + title: Created At type: integer - description: >- - Timestamp when the file was added to the vector store last_error: - $ref: '#/components/schemas/VectorStoreFileLastError' - description: >- - (Optional) Error information if file processing failed + anyOf: + - $ref: '#/$defs/VectorStoreFileLastError' + - type: 'null' status: - $ref: '#/components/schemas/VectorStoreFileStatus' - description: Current processing status of the file + anyOf: + - const: completed + type: string + - const: in_progress + type: string + - const: cancelled + type: string + - const: failed + type: string + title: Status usage_bytes: - type: integer default: 0 - description: Storage space used by this file in bytes + title: Usage Bytes + type: integer vector_store_id: + title: Vector Store Id type: string - description: >- - ID of the vector store containing this file - additionalProperties: false required: - id - - object - - attributes - chunking_strategy - created_at - status - - usage_bytes - vector_store_id title: VectorStoreFileObject - description: OpenAI Vector Store File object. - VectorStoreFilesListInBatchResponse: - type: object - properties: - object: - type: string - default: list - description: Object type identifier, always "list" - data: - type: array - items: - $ref: '#/components/schemas/VectorStoreFileObject' - description: >- - List of vector store file objects in the batch - first_id: - type: string - description: >- - (Optional) ID of the first file in the list for pagination - last_id: - type: string - description: >- - (Optional) ID of the last file in the list for pagination - has_more: - type: boolean - default: false - description: >- - Whether there are more files available beyond this page - additionalProperties: false - required: - - object - - data - - has_more - title: VectorStoreFilesListInBatchResponse - description: >- - Response from listing files in a vector store file batch. - VectorStoreListFilesResponse: - type: object - properties: - object: - type: string - default: list - description: Object type identifier, always "list" - data: - type: array - items: - $ref: '#/components/schemas/VectorStoreFileObject' - description: List of vector store file objects - first_id: - type: string - description: >- - (Optional) ID of the first file in the list for pagination - last_id: - type: string - description: >- - (Optional) ID of the last file in the list for pagination - has_more: - type: boolean - default: false - description: >- - Whether there are more files available beyond this page - additionalProperties: false - required: - - object - - data - - has_more - title: VectorStoreListFilesResponse - description: >- - Response from listing files in a vector store. - OpenaiAttachFileToVectorStoreRequest: type: object - properties: - file_id: - type: string - description: >- - The ID of the file to attach to the vector store. - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The key-value attributes stored with the file, which can be used for filtering. - chunking_strategy: - $ref: '#/components/schemas/VectorStoreChunkingStrategy' - description: >- - The chunking strategy to use for the file. - additionalProperties: false - required: - - file_id - title: OpenaiAttachFileToVectorStoreRequest OpenaiUpdateVectorStoreFileRequest: type: object - properties: - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The updated key-value attributes to store with the file. - additionalProperties: false - required: - - attributes - title: OpenaiUpdateVectorStoreFileRequest VectorStoreFileDeleteResponse: - type: object + description: >- + Response from deleting a vector store file. + + + :param id: Unique identifier of the deleted file + + :param object: Object type identifier for the deletion response + + :param deleted: Whether the deletion operation was successful properties: id: + title: Id type: string - description: Unique identifier of the deleted file object: - type: string default: vector_store.file.deleted - description: >- - Object type identifier for the deletion response + title: Object + type: string deleted: - type: boolean default: true - description: >- - Whether the deletion operation was successful - additionalProperties: false + title: Deleted + type: boolean required: - id - - object - - deleted title: VectorStoreFileDeleteResponse - description: >- - Response from deleting a vector store file. - VectorStoreContent: type: object - properties: - type: - type: string - const: text - description: >- - Content type, currently only "text" is supported - text: - type: string - description: The actual text content - additionalProperties: false - required: - - type - - text - title: VectorStoreContent - description: >- - Content item from a vector store file or search result. VectorStoreFileContentsResponse: - type: object - properties: - file_id: - type: string - description: Unique identifier for the file - filename: - type: string - description: Name of the file - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Key-value attributes associated with the file - content: - type: array - items: - $ref: '#/components/schemas/VectorStoreContent' - description: List of content items from the file - additionalProperties: false - required: - - file_id - - filename - - attributes - - content - title: VectorStoreFileContentsResponse - description: >- - Response from retrieving the contents of a vector store file. - OpenaiSearchVectorStoreRequest: - type: object - properties: - query: - oneOf: - - type: string - - type: array - items: - type: string - description: >- - The query string or array for performing the search. - filters: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + $defs: + VectorStoreContent: description: >- - Filters based on file attributes to narrow the search results. - max_num_results: - type: integer - description: >- - Maximum number of results to return (1 to 50 inclusive, default 10). - ranking_options: - type: object + Content item from a vector store file or search result. + + + :param type: Content type, currently only "text" is supported + + :param text: The actual text content properties: - ranker: + type: + const: text + title: Type type: string - description: >- - (Optional) Name of the ranking algorithm to use - score_threshold: - type: number - default: 0.0 - description: >- - (Optional) Minimum relevance score threshold for results - additionalProperties: false - description: >- - Ranking options for fine-tuning the search results. - rewrite_query: - type: boolean - description: >- - Whether to rewrite the natural language query for vector search (default - false) - search_mode: - type: string - description: >- - The search mode to use - "keyword", "vector", or "hybrid" (default "vector") - additionalProperties: false - required: - - query - title: OpenaiSearchVectorStoreRequest - VectorStoreSearchResponse: - type: object + text: + title: Text + type: string + required: + - type + - text + title: VectorStoreContent + type: object + description: >- + Response from retrieving the contents of a vector store file. + + + :param file_id: Unique identifier for the file + + :param filename: Name of the file + + :param attributes: Key-value attributes associated with the file + + :param content: List of content items from the file properties: file_id: + title: File Id type: string - description: >- - Unique identifier of the file containing the result filename: + title: Filename type: string - description: Name of the file containing the result - score: - type: number - description: Relevance score for this search result attributes: + additionalProperties: true + title: Attributes type: object - additionalProperties: - oneOf: - - type: string - - type: number - - type: boolean - description: >- - (Optional) Key-value attributes associated with the file content: - type: array items: - $ref: '#/components/schemas/VectorStoreContent' - description: >- - List of content items matching the search query - additionalProperties: false + $ref: '#/$defs/VectorStoreContent' + title: Content + type: array required: - file_id - filename - - score + - attributes - content - title: VectorStoreSearchResponse - description: Response from searching a vector store. - VectorStoreSearchResponsePage: + title: VectorStoreFileContentsResponse type: object + OpenaiSearchVectorStoreRequest: + type: object + VectorStoreSearchResponsePage: + $defs: + VectorStoreContent: + description: >- + Content item from a vector store file or search result. + + + :param type: Content type, currently only "text" is supported + + :param text: The actual text content + properties: + type: + const: text + title: Type + type: string + text: + title: Text + type: string + required: + - type + - text + title: VectorStoreContent + type: object + VectorStoreSearchResponse: + description: >- + Response from searching a vector store. + + + :param file_id: Unique identifier of the file containing the result + + :param filename: Name of the file containing the result + + :param score: Relevance score for this search result + + :param attributes: (Optional) Key-value attributes associated with the + file + + :param content: List of content items matching the search query + properties: + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + score: + title: Score + type: number + attributes: + anyOf: + - additionalProperties: + anyOf: + - type: string + - type: number + - type: boolean + type: object + - type: 'null' + title: Attributes + content: + items: + $ref: '#/$defs/VectorStoreContent' + title: Content + type: array + required: + - file_id + - filename + - score + - content + title: VectorStoreSearchResponse + type: object + description: >- + Paginated response from searching a vector store. + + + :param object: Object type identifier for the search results page + + :param search_query: The original search query that was executed + + :param data: List of search result objects + + :param has_more: Whether there are more results available beyond this page + + :param next_page: (Optional) Token for retrieving the next page of results properties: object: - type: string default: vector_store.search_results.page - description: >- - Object type identifier for the search results page + title: Object + type: string search_query: + title: Search Query type: string - description: >- - The original search query that was executed data: - type: array items: - $ref: '#/components/schemas/VectorStoreSearchResponse' - description: List of search result objects + $ref: '#/$defs/VectorStoreSearchResponse' + title: Data + type: array has_more: - type: boolean default: false - description: >- - Whether there are more results available beyond this page + title: Has More + type: boolean next_page: - type: string - description: >- - (Optional) Token for retrieving the next page of results - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: Next Page required: - - object - search_query - data - - has_more title: VectorStoreSearchResponsePage - description: >- - Paginated response from searching a vector store. - VersionInfo: type: object + VersionInfo: + description: >- + Version information for the service. + + + :param version: Version number of the service properties: version: + title: Version type: string - description: Version number of the service - additionalProperties: false required: - version title: VersionInfo - description: Version information for the service. + type: object AppendRowsRequest: type: object - properties: - rows: - type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The rows to append to the dataset. - additionalProperties: false - required: - - rows - title: AppendRowsRequest PaginatedResponse: - type: object + description: >- + A generic paginated response that follows a simple format. + + + :param data: The list of items for the current page + + :param has_more: Whether there are more items available after this set + + :param url: The URL for accessing this list properties: data: - type: array items: + additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The list of items for the current page + title: Data + type: array has_more: + title: Has More type: boolean - description: >- - Whether there are more items available after this set url: - type: string - description: The URL for accessing this list - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: Url required: - data - has_more title: PaginatedResponse - description: >- - A generic paginated response that follows a simple format. - Dataset: type: object - properties: - identifier: - type: string - provider_resource_id: - type: string - provider_id: - type: string - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: dataset - default: dataset + ListDatasetsResponse: + $defs: + Dataset: description: >- - Type of resource, always 'dataset' for datasets - purpose: - type: string + Dataset resource for storing and accessing training or evaluation data. + + + :param type: Type of resource, always 'dataset' for datasets + properties: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: dataset + default: dataset + title: Type + type: string + purpose: + $ref: '#/$defs/DatasetPurpose' + source: + discriminator: + mapping: + rows: '#/$defs/RowsDataSource' + uri: '#/$defs/URIDataSource' + propertyName: type + oneOf: + - $ref: '#/$defs/URIDataSource' + - $ref: '#/$defs/RowsDataSource' + title: Source + metadata: + additionalProperties: true + description: Any additional metadata for this dataset + title: Metadata + type: object + required: + - identifier + - provider_id + - purpose + - source + title: Dataset + type: object + DatasetPurpose: + description: >- + Purpose of the dataset. Each purpose has a required input data schema. + + + :cvar post-training/messages: The dataset contains messages used for post-training. + { + "messages": [ + {"role": "user", "content": "Hello, world!"}, + {"role": "assistant", "content": "Hello, world!"}, + ] + } + :cvar eval/question-answer: The dataset contains a question column and + an answer column. + { + "question": "What is the capital of France?", + "answer": "Paris" + } + :cvar eval/messages-answer: The dataset contains a messages column with + list of messages and an answer column. + { + "messages": [ + {"role": "user", "content": "Hello, my name is John Doe."}, + {"role": "assistant", "content": "Hello, John Doe. How can + I help you today?"}, + {"role": "user", "content": "What's my name?"}, + ], + "answer": "John Doe" + } enum: - post-training/messages - eval/question-answer - eval/messages-answer - description: >- - Purpose of the dataset indicating its intended use - source: - oneOf: - - $ref: '#/components/schemas/URIDataSource' - - $ref: '#/components/schemas/RowsDataSource' - discriminator: - propertyName: type - mapping: - uri: '#/components/schemas/URIDataSource' - rows: '#/components/schemas/RowsDataSource' - description: >- - Data source configuration for the dataset - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Additional metadata for the dataset - additionalProperties: false - required: - - identifier - - provider_id - - type - - purpose - - source - - metadata - title: Dataset - description: >- - Dataset resource for storing and accessing training or evaluation data. - RowsDataSource: - type: object - properties: - type: + title: DatasetPurpose type: string - const: rows - default: rows - rows: - type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + RowsDataSource: description: >- - The dataset is stored in rows. E.g. - [ {"messages": [{"role": "user", - "content": "Hello, world!"}, {"role": "assistant", "content": "Hello, - world!"}]} ] - additionalProperties: false - required: - - type - - rows - title: RowsDataSource - description: A dataset stored in rows. - URIDataSource: - type: object - properties: - type: - type: string - const: uri - default: uri - uri: - type: string + A dataset stored in rows. + + :param rows: The dataset is stored in rows. E.g. + - [ + {"messages": [{"role": "user", "content": "Hello, world!"}, {"role": + "assistant", "content": "Hello, world!"}]} + ] + properties: + type: + const: rows + default: rows + title: Type + type: string + rows: + items: + additionalProperties: true + type: object + title: Rows + type: array + required: + - rows + title: RowsDataSource + type: object + URIDataSource: description: >- - The dataset can be obtained from a URI. E.g. - "https://mywebsite.com/mydata.jsonl" - - "lsfs://mydata.jsonl" - "data:csv;base64,{base64_content}" - additionalProperties: false - required: - - type - - uri - title: URIDataSource + A dataset that can be obtained from a URI. + + :param uri: The dataset can be obtained from a URI. E.g. + - "https://mywebsite.com/mydata.jsonl" + - "lsfs://mydata.jsonl" + - "data:csv;base64,{base64_content}" + properties: + type: + const: uri + default: uri + title: Type + type: string + uri: + title: Uri + type: string + required: + - uri + title: URIDataSource + type: object description: >- - A dataset that can be obtained from a URI. - ListDatasetsResponse: - type: object + Response from listing datasets. + + + :param data: List of datasets properties: data: - type: array items: - $ref: '#/components/schemas/Dataset' - description: List of datasets - additionalProperties: false + $ref: '#/$defs/Dataset' + title: Data + type: array required: - data title: ListDatasetsResponse - description: Response from listing datasets. - DataSource: - oneOf: - - $ref: '#/components/schemas/URIDataSource' - - $ref: '#/components/schemas/RowsDataSource' - discriminator: - propertyName: type - mapping: - uri: '#/components/schemas/URIDataSource' - rows: '#/components/schemas/RowsDataSource' + type: object RegisterDatasetRequest: type: object + Dataset: + $defs: + DatasetPurpose: + description: >- + Purpose of the dataset. Each purpose has a required input data schema. + + + :cvar post-training/messages: The dataset contains messages used for post-training. + { + "messages": [ + {"role": "user", "content": "Hello, world!"}, + {"role": "assistant", "content": "Hello, world!"}, + ] + } + :cvar eval/question-answer: The dataset contains a question column and + an answer column. + { + "question": "What is the capital of France?", + "answer": "Paris" + } + :cvar eval/messages-answer: The dataset contains a messages column with + list of messages and an answer column. + { + "messages": [ + {"role": "user", "content": "Hello, my name is John Doe."}, + {"role": "assistant", "content": "Hello, John Doe. How can + I help you today?"}, + {"role": "user", "content": "What's my name?"}, + ], + "answer": "John Doe" + } + enum: + - post-training/messages + - eval/question-answer + - eval/messages-answer + title: DatasetPurpose + type: string + RowsDataSource: + description: >- + A dataset stored in rows. + + :param rows: The dataset is stored in rows. E.g. + - [ + {"messages": [{"role": "user", "content": "Hello, world!"}, {"role": + "assistant", "content": "Hello, world!"}]} + ] + properties: + type: + const: rows + default: rows + title: Type + type: string + rows: + items: + additionalProperties: true + type: object + title: Rows + type: array + required: + - rows + title: RowsDataSource + type: object + URIDataSource: + description: >- + A dataset that can be obtained from a URI. + + :param uri: The dataset can be obtained from a URI. E.g. + - "https://mywebsite.com/mydata.jsonl" + - "lsfs://mydata.jsonl" + - "data:csv;base64,{base64_content}" + properties: + type: + const: uri + default: uri + title: Type + type: string + uri: + title: Uri + type: string + required: + - uri + title: URIDataSource + type: object + description: >- + Dataset resource for storing and accessing training or evaluation data. + + + :param type: Type of resource, always 'dataset' for datasets properties: - purpose: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier type: string - enum: - - post-training/messages - - eval/question-answer - - eval/messages-answer + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: description: >- - The purpose of the dataset. One of: - "post-training/messages": The dataset - contains a messages column with list of messages for post-training. { - "messages": [ {"role": "user", "content": "Hello, world!"}, {"role": "assistant", - "content": "Hello, world!"}, ] } - "eval/question-answer": The dataset - contains a question column and an answer column for evaluation. { "question": - "What is the capital of France?", "answer": "Paris" } - "eval/messages-answer": - The dataset contains a messages column with list of messages and an answer - column for evaluation. { "messages": [ {"role": "user", "content": "Hello, - my name is John Doe."}, {"role": "assistant", "content": "Hello, John - Doe. How can I help you today?"}, {"role": "user", "content": "What's - my name?"}, ], "answer": "John Doe" } + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: dataset + default: dataset + title: Type + type: string + purpose: + $ref: '#/$defs/DatasetPurpose' source: - $ref: '#/components/schemas/DataSource' - description: >- - The data source of the dataset. Ensure that the data source schema is - compatible with the purpose of the dataset. Examples: - { "type": "uri", - "uri": "https://mywebsite.com/mydata.jsonl" } - { "type": "uri", "uri": - "lsfs://mydata.jsonl" } - { "type": "uri", "uri": "data:csv;base64,{base64_content}" - } - { "type": "uri", "uri": "huggingface://llamastack/simpleqa?split=train" - } - { "type": "rows", "rows": [ { "messages": [ {"role": "user", "content": - "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}, ] - } ] } + discriminator: + mapping: + rows: '#/$defs/RowsDataSource' + uri: '#/$defs/URIDataSource' + propertyName: type + oneOf: + - $ref: '#/$defs/URIDataSource' + - $ref: '#/$defs/RowsDataSource' + title: Source metadata: + additionalProperties: true + description: Any additional metadata for this dataset + title: Metadata type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The metadata for the dataset. - E.g. {"description": "My dataset"}. - dataset_id: - type: string - description: >- - The ID of the dataset. If not provided, an ID will be generated. - additionalProperties: false required: + - identifier + - provider_id - purpose - source - title: RegisterDatasetRequest - AgentConfig: + title: Dataset type: object + CreateAgentRequest: + type: object + AgentCreateResponse: + description: >- + Response returned when creating a new agent. + + + :param agent_id: Unique identifier for the created agent properties: - sampling_params: - $ref: '#/components/schemas/SamplingParams' - input_shields: - type: array - items: - type: string - output_shields: - type: array - items: - type: string - toolgroups: - type: array - items: - $ref: '#/components/schemas/AgentTool' - client_tools: - type: array - items: - $ref: '#/components/schemas/ToolDef' - tool_choice: - type: string - enum: - - auto - - required - - none - title: ToolChoice - description: >- - Whether tool use is required or automatic. This is a hint to the model - which may not be followed. It depends on the Instruction Following capabilities - of the model. - deprecated: true - tool_prompt_format: - type: string - enum: - - json - - function_tag - - python_list - title: ToolPromptFormat - description: >- - Prompt format for calling custom / zero shot tools. - deprecated: true - tool_config: - $ref: '#/components/schemas/ToolConfig' - max_infer_iters: - type: integer - default: 10 - model: - type: string - description: >- - The model identifier to use for the agent - instructions: - type: string - description: The system instructions for the agent - name: + agent_id: + title: Agent Id type: string - description: >- - Optional name for the agent, used in telemetry and identification - enable_session_persistence: - type: boolean - default: false - description: >- - Optional flag indicating whether session data has to be persisted - response_format: - $ref: '#/components/schemas/ResponseFormat' - description: Optional response format configuration - additionalProperties: false required: - - model - - instructions - title: AgentConfig - description: Configuration for an agent. - AgentTool: - oneOf: - - type: string - - type: object + - agent_id + title: AgentCreateResponse + type: object + Agent: + $defs: + AgentConfig: + description: >- + Configuration for an agent. + + + :param model: The model identifier to use for the agent + + :param instructions: The system instructions for the agent + + :param name: Optional name for the agent, used in telemetry and identification + + :param enable_session_persistence: Optional flag indicating whether session + data has to be persisted + + :param response_format: Optional response format configuration + properties: + sampling_params: + anyOf: + - $ref: '#/$defs/SamplingParams' + - type: 'null' + input_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Input Shields + output_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields + toolgroups: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/$defs/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups + client_tools: + anyOf: + - items: + $ref: '#/$defs/ToolDef' + type: array + - type: 'null' + title: Client Tools + tool_choice: + anyOf: + - $ref: '#/$defs/ToolChoice' + - type: 'null' + deprecated: true + tool_prompt_format: + anyOf: + - $ref: '#/$defs/ToolPromptFormat' + - type: 'null' + deprecated: true + tool_config: + anyOf: + - $ref: '#/$defs/ToolConfig' + - type: 'null' + max_infer_iters: + anyOf: + - type: integer + - type: 'null' + default: 10 + title: Max Infer Iters + model: + title: Model + type: string + instructions: + title: Instructions + type: string + name: + anyOf: + - type: string + - type: 'null' + title: Name + enable_session_persistence: + anyOf: + - type: boolean + - type: 'null' + default: false + title: Enable Session Persistence + response_format: + anyOf: + - discriminator: + mapping: + grammar: '#/$defs/GrammarResponseFormat' + json_schema: '#/$defs/JsonSchemaResponseFormat' + propertyName: type + oneOf: + - $ref: '#/$defs/JsonSchemaResponseFormat' + - $ref: '#/$defs/GrammarResponseFormat' + - type: 'null' + title: Response Format + required: + - model + - instructions + title: AgentConfig + type: object + AgentToolGroupWithArgs: properties: name: + title: Name type: string args: + additionalProperties: true + title: Args type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - additionalProperties: false required: - name - args title: AgentToolGroupWithArgs - GrammarResponseFormat: - type: object - properties: - type: - type: string - enum: - - json_schema - - grammar - description: >- - Must be "grammar" to identify this format type - const: grammar - default: grammar - bnf: type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The BNF grammar specification the response should conform to - additionalProperties: false - required: - - type - - bnf - title: GrammarResponseFormat - description: >- - Configuration for grammar-guided response generation. - GreedySamplingStrategy: - type: object - properties: - type: - type: string - const: greedy - default: greedy - description: >- - Must be "greedy" to identify this sampling strategy - additionalProperties: false - required: - - type - title: GreedySamplingStrategy - description: >- - Greedy sampling strategy that selects the highest probability token at each - step. - JsonSchemaResponseFormat: - type: object - properties: - type: - type: string - enum: - - json_schema - - grammar + GrammarResponseFormat: description: >- - Must be "json_schema" to identify this format type - const: json_schema - default: json_schema - json_schema: + Configuration for grammar-guided response generation. + + + :param type: Must be "grammar" to identify this format type + + :param bnf: The BNF grammar specification the response should conform + to + properties: + type: + const: grammar + default: grammar + title: Type + type: string + bnf: + additionalProperties: true + title: Bnf + type: object + required: + - bnf + title: GrammarResponseFormat type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The JSON schema the response should conform to. In a Python SDK, this - is often a `pydantic` model. - additionalProperties: false - required: - - type - - json_schema - title: JsonSchemaResponseFormat - description: >- - Configuration for JSON schema-guided response generation. - ResponseFormat: - oneOf: - - $ref: '#/components/schemas/JsonSchemaResponseFormat' - - $ref: '#/components/schemas/GrammarResponseFormat' - discriminator: - propertyName: type - mapping: - json_schema: '#/components/schemas/JsonSchemaResponseFormat' - grammar: '#/components/schemas/GrammarResponseFormat' - SamplingParams: - type: object - properties: - strategy: - oneOf: - - $ref: '#/components/schemas/GreedySamplingStrategy' - - $ref: '#/components/schemas/TopPSamplingStrategy' - - $ref: '#/components/schemas/TopKSamplingStrategy' - discriminator: - propertyName: type - mapping: - greedy: '#/components/schemas/GreedySamplingStrategy' - top_p: '#/components/schemas/TopPSamplingStrategy' - top_k: '#/components/schemas/TopKSamplingStrategy' - description: The sampling strategy. - max_tokens: - type: integer - description: >- - The maximum number of tokens that can be generated in the completion. - The token count of your prompt plus max_tokens cannot exceed the model's - context length. - repetition_penalty: - type: number - default: 1.0 + GreedySamplingStrategy: description: >- - Number between -2.0 and 2.0. Positive values penalize new tokens based - on whether they appear in the text so far, increasing the model's likelihood - to talk about new topics. - stop: - type: array - items: - type: string + Greedy sampling strategy that selects the highest probability token at + each step. + + + :param type: Must be "greedy" to identify this sampling strategy + properties: + type: + const: greedy + default: greedy + title: Type + type: string + title: GreedySamplingStrategy + type: object + JsonSchemaResponseFormat: description: >- - Up to 4 sequences where the API will stop generating further tokens. The - returned text will not contain the stop sequence. - additionalProperties: false - required: - - strategy - title: SamplingParams - description: Sampling parameters. - ToolConfig: - type: object - properties: - tool_choice: - oneOf: - - type: string - enum: - - auto - - required - - none - title: ToolChoice - description: >- - Whether tool use is required or automatic. This is a hint to the model - which may not be followed. It depends on the Instruction Following - capabilities of the model. - - type: string - default: auto + Configuration for JSON schema-guided response generation. + + + :param type: Must be "json_schema" to identify this format type + + :param json_schema: The JSON schema the response should conform to. In + a Python SDK, this is often a `pydantic` model. + properties: + type: + const: json_schema + default: json_schema + title: Type + type: string + json_schema: + additionalProperties: true + title: Json Schema + type: object + required: + - json_schema + title: JsonSchemaResponseFormat + type: object + SamplingParams: description: >- - (Optional) Whether tool use is automatic, required, or none. Can also - specify a tool name to use a specific tool. Defaults to ToolChoice.auto. - tool_prompt_format: - type: string - enum: - - json - - function_tag - - python_list + Sampling parameters. + + + :param strategy: The sampling strategy. + + :param max_tokens: The maximum number of tokens that can be generated + in the completion. The token count of + your prompt plus max_tokens cannot exceed the model's context length. + :param repetition_penalty: Number between -2.0 and 2.0. Positive values + penalize new tokens + based on whether they appear in the text so far, increasing the model's + likelihood to talk about new topics. + :param stop: Up to 4 sequences where the API will stop generating further + tokens. + The returned text will not contain the stop sequence. + properties: + strategy: + discriminator: + mapping: + greedy: '#/$defs/GreedySamplingStrategy' + top_k: '#/$defs/TopKSamplingStrategy' + top_p: '#/$defs/TopPSamplingStrategy' + propertyName: type + oneOf: + - $ref: '#/$defs/GreedySamplingStrategy' + - $ref: '#/$defs/TopPSamplingStrategy' + - $ref: '#/$defs/TopKSamplingStrategy' + title: Strategy + max_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Tokens + repetition_penalty: + anyOf: + - type: number + - type: 'null' + default: 1.0 + title: Repetition Penalty + stop: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Stop + title: SamplingParams + type: object + SystemMessageBehavior: description: >- - (Optional) Instructs the model how to format tool calls. By default, Llama - Stack will attempt to use a format that is best adapted to the model. - - `ToolPromptFormat.json`: The tool calls are formatted as a JSON object. - - `ToolPromptFormat.function_tag`: The tool calls are enclosed in a - tag. - `ToolPromptFormat.python_list`: The tool calls are output as Python - syntax -- a list of function calls. - system_message_behavior: - type: string + Config for how to override the default system prompt. + + + :cvar append: Appends the provided system message to the default system + prompt: + https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt- + :cvar replace: Replaces the default system prompt with the provided system + message. The system message can include the string + '{{function_definitions}}' to indicate where the function definitions + should be inserted. enum: - append - replace - description: >- - (Optional) Config for how to override the default system prompt. - `SystemMessageBehavior.append`: - Appends the provided system message to the default system prompt. - `SystemMessageBehavior.replace`: - Replaces the default system prompt with the provided system message. The - system message can include the string '{{function_definitions}}' to indicate - where the function definitions should be inserted. - default: append - additionalProperties: false - title: ToolConfig - description: Configuration for tool use. - TopKSamplingStrategy: - type: object - properties: - type: + title: SystemMessageBehavior type: string - const: top_k - default: top_k + ToolChoice: description: >- - Must be "top_k" to identify this sampling strategy - top_k: - type: integer - description: >- - Number of top tokens to consider for sampling. Must be at least 1 - additionalProperties: false - required: - - type - - top_k - title: TopKSamplingStrategy - description: >- - Top-k sampling strategy that restricts sampling to the k most likely tokens. - TopPSamplingStrategy: - type: object - properties: - type: + Whether tool use is required or automatic. This is a hint to the model + which may not be followed. It depends on the Instruction Following capabilities + of the model. + + + :cvar auto: The model may use tools if it determines that is appropriate. + + :cvar required: The model must use tools. + + :cvar none: The model must not use tools. + enum: + - auto + - required + - none + title: ToolChoice type: string - const: top_p - default: top_p + ToolConfig: description: >- - Must be "top_p" to identify this sampling strategy - temperature: - type: number + Configuration for tool use. + + + :param tool_choice: (Optional) Whether tool use is automatic, required, + or none. Can also specify a tool name to use a specific tool. Defaults + to ToolChoice.auto. + + :param tool_prompt_format: (Optional) Instructs the model how to format + tool calls. By default, Llama Stack will attempt to use a format that + is best adapted to the model. + - `ToolPromptFormat.json`: The tool calls are formatted as a JSON + object. + - `ToolPromptFormat.function_tag`: The tool calls are enclosed in + a tag. + - `ToolPromptFormat.python_list`: The tool calls are output as Python + syntax -- a list of function calls. + :param system_message_behavior: (Optional) Config for how to override + the default system prompt. + - `SystemMessageBehavior.append`: Appends the provided system message + to the default system prompt. + - `SystemMessageBehavior.replace`: Replaces the default system prompt + with the provided system message. The system message can include the string + '{{function_definitions}}' to indicate where the function definitions + should be inserted. + properties: + tool_choice: + anyOf: + - $ref: '#/$defs/ToolChoice' + - type: string + - type: 'null' + default: auto + title: Tool Choice + tool_prompt_format: + anyOf: + - $ref: '#/$defs/ToolPromptFormat' + - type: 'null' + system_message_behavior: + anyOf: + - $ref: '#/$defs/SystemMessageBehavior' + - type: 'null' + default: append + title: ToolConfig + type: object + ToolDef: description: >- - Controls randomness in sampling. Higher values increase randomness - top_p: - type: number - default: 0.95 + Tool definition used in runtime contexts. + + + :param name: Name of the tool + + :param description: (Optional) Human-readable description of what the + tool does + + :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) + + :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) + + :param metadata: (Optional) Additional metadata about the tool + + :param toolgroup_id: (Optional) ID of the tool group this tool belongs + to + properties: + toolgroup_id: + anyOf: + - type: string + - type: 'null' + title: Toolgroup Id + name: + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + input_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Input Schema + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Output Schema + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + required: + - name + title: ToolDef + type: object + ToolPromptFormat: description: >- - Cumulative probability threshold for nucleus sampling. Defaults to 0.95 - additionalProperties: false - required: - - type - title: TopPSamplingStrategy - description: >- - Top-p (nucleus) sampling strategy that samples from the smallest set of tokens - with cumulative probability >= p. - CreateAgentRequest: - type: object - properties: - agent_config: - $ref: '#/components/schemas/AgentConfig' - description: The configuration for the agent. - additionalProperties: false - required: - - agent_config - title: CreateAgentRequest - AgentCreateResponse: - type: object - properties: - agent_id: + Prompt format for calling custom / zero shot tools. + + + :cvar json: JSON format for calling tools. It takes the form: + { + "type": "function", + "function" : { + "name": "function_name", + "description": "function_description", + "parameters": {...} + } + } + :cvar function_tag: Function tag format, pseudo-XML. This looks like: + (parameters) + + :cvar python_list: Python list. The output is a valid Python expression + that can be + evaluated to a list. Each element in the list is a function call. + Example: + ["function_name(param1, param2)", "function_name(param1, param2)"] + enum: + - json + - function_tag + - python_list + title: ToolPromptFormat type: string - description: Unique identifier for the created agent - additionalProperties: false - required: - - agent_id - title: AgentCreateResponse + TopKSamplingStrategy: + description: >- + Top-k sampling strategy that restricts sampling to the k most likely tokens. + + + :param type: Must be "top_k" to identify this sampling strategy + + :param top_k: Number of top tokens to consider for sampling. Must be at + least 1 + properties: + type: + const: top_k + default: top_k + title: Type + type: string + top_k: + minimum: 1 + title: Top K + type: integer + required: + - top_k + title: TopKSamplingStrategy + type: object + TopPSamplingStrategy: + description: >- + Top-p (nucleus) sampling strategy that samples from the smallest set of + tokens with cumulative probability >= p. + + + :param type: Must be "top_p" to identify this sampling strategy + + :param temperature: Controls randomness in sampling. Higher values increase + randomness + + :param top_p: Cumulative probability threshold for nucleus sampling. Defaults + to 0.95 + properties: + type: + const: top_p + default: top_p + title: Type + type: string + temperature: + anyOf: + - exclusiveMinimum: 0.0 + type: number + - type: 'null' + title: Temperature + top_p: + anyOf: + - type: number + - type: 'null' + default: 0.95 + title: Top P + required: + - temperature + title: TopPSamplingStrategy + type: object description: >- - Response returned when creating a new agent. - Agent: - type: object + An agent instance with configuration and metadata. + + + :param agent_id: Unique identifier for the agent + + :param agent_config: Configuration settings for the agent + + :param created_at: Timestamp when the agent was created properties: agent_id: + title: Agent Id type: string - description: Unique identifier for the agent agent_config: - $ref: '#/components/schemas/AgentConfig' - description: Configuration settings for the agent + $ref: '#/$defs/AgentConfig' created_at: - type: string format: date-time - description: Timestamp when the agent was created - additionalProperties: false + title: Created At + type: string required: - agent_id - agent_config - created_at title: Agent - description: >- - An agent instance with configuration and metadata. + type: object CreateAgentSessionRequest: type: object + AgentSessionCreateResponse: + description: >- + Response returned when creating a new agent session. + + + :param session_id: Unique identifier for the created session properties: - session_name: + session_id: + title: Session Id type: string - description: The name of the session to create. - additionalProperties: false required: - - session_name - title: CreateAgentSessionRequest - AgentSessionCreateResponse: + - session_id + title: AgentSessionCreateResponse + description: >- + Response returned when creating a new agent session. + CompletionMessage: type: object properties: - session_id: + role: + type: string + const: assistant + default: assistant + description: >- + Must be "assistant" to identify this as the model's response + content: + $ref: '#/components/schemas/InterleavedContent' + description: The content of the model's response + stop_reason: + type: string + enum: + - end_of_turn + - end_of_message + - out_of_tokens + description: >- + Reason why the model stopped generating. Options are: - `StopReason.end_of_turn`: + The model finished generating the entire response. - `StopReason.end_of_message`: + The model finished generating but generated a partial response -- usually, + a tool call. The user may call the tool and continue the conversation + with the tool's response. - `StopReason.out_of_tokens`: The model ran + out of token budget. + tool_calls: + type: array + items: + $ref: '#/components/schemas/ToolCall' + description: >- + List of tool calls. Each tool call is a ToolCall object. + additionalProperties: false + required: + - role + - content + - stop_reason + title: CompletionMessage + description: >- + A message containing the model's (assistant) response in a chat conversation. + InferenceStep: + type: object + Session: + $defs: + Attachment: + description: >- + An attachment to an agent turn. + + + :param content: The content of the attachment. + + :param mime_type: The MIME type of the attachment. + properties: + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + - $ref: '#/$defs/URL' + title: Content + mime_type: + title: Mime Type + type: string + required: + - content + - mime_type + title: Attachment + type: object + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool type: string + CompletionMessage: + description: >- + A message containing the model's (assistant) response in a chat conversation. + + + :param role: Must be "assistant" to identify this as the model's response + + :param content: The content of the model's response + + :param stop_reason: Reason why the model stopped generating. Options are: + - `StopReason.end_of_turn`: The model finished generating the entire + response. + - `StopReason.end_of_message`: The model finished generating but generated + a partial response -- usually, a tool call. The user may call the tool + and continue the conversation with the tool's response. + - `StopReason.out_of_tokens`: The model ran out of token budget. + :param tool_calls: List of tool calls. Each tool call is a ToolCall object. + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/$defs/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/$defs/ToolCall' + type: array + - type: 'null' + title: Tool Calls + required: + - content + - stop_reason + title: CompletionMessage + type: object + ImageContentItem: + description: >- + A image content item + + + :param type: Discriminator type of the content item. Always "image" + + :param image: Image as a base64 encoded string or an URL + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/$defs/_URLOrData' + required: + - image + title: ImageContentItem + type: object + InferenceStep: + description: >- + An inference step in an agent turn. + + + :param model_response: The response from the LLM. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: inference + default: inference + title: Step Type + type: string + model_response: + $ref: '#/$defs/CompletionMessage' + required: + - turn_id + - step_id + - model_response + title: InferenceStep + type: object + MemoryRetrievalStep: description: >- - Unique identifier for the created session - additionalProperties: false - required: - - session_id - title: AgentSessionCreateResponse - description: >- - Response returned when creating a new agent session. - CompletionMessage: - type: object - properties: - role: - type: string - const: assistant - default: assistant + A memory retrieval step in an agent turn. + + + :param vector_store_ids: The IDs of the vector databases to retrieve context + from. + + :param inserted_context: The context retrieved from the vector databases. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: memory_retrieval + default: memory_retrieval + title: Step Type + type: string + vector_store_ids: + title: Vector Store Ids + type: string + inserted_context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Inserted Context + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + type: object + SafetyViolation: description: >- - Must be "assistant" to identify this as the model's response - content: - $ref: '#/components/schemas/InterleavedContent' - description: The content of the model's response - stop_reason: - type: string + Details of a safety violation detected by content moderation. + + + :param violation_level: Severity level of the violation + + :param user_message: (Optional) Message to convey to the user about the + violation + + :param metadata: Additional metadata including specific violation codes + for debugging and telemetry + properties: + violation_level: + $ref: '#/$defs/ViolationLevel' + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + metadata: + additionalProperties: true + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + type: object + ShieldCallStep: + description: >- + A shield call step in an agent turn. + + + :param violation: The violation from the shield call. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: shield_call + default: shield_call + title: Step Type + type: string + violation: + anyOf: + - $ref: '#/$defs/SafetyViolation' + - type: 'null' + required: + - turn_id + - step_id + - violation + title: ShieldCallStep + type: object + StopReason: enum: - end_of_turn - end_of_message - out_of_tokens + title: StopReason + type: string + TextContentItem: description: >- - Reason why the model stopped generating. Options are: - `StopReason.end_of_turn`: - The model finished generating the entire response. - `StopReason.end_of_message`: - The model finished generating but generated a partial response -- usually, - a tool call. The user may call the tool and continue the conversation - with the tool's response. - `StopReason.out_of_tokens`: The model ran - out of token budget. - tool_calls: - type: array - items: - $ref: '#/components/schemas/ToolCall' + A text content item + + + :param type: Discriminator type of the content item. Always "text" + + :param text: Text content + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/$defs/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolExecutionStep: description: >- - List of tool calls. Each tool call is a ToolCall object. - additionalProperties: false - required: - - role - - content - - stop_reason - title: CompletionMessage - description: >- - A message containing the model's (assistant) response in a chat conversation. - InferenceStep: - type: object - properties: - turn_id: - type: string - description: The ID of the turn. - step_id: - type: string - description: The ID of the step. - started_at: - type: string - format: date-time - description: The time the step started. - completed_at: - type: string - format: date-time - description: The time the step completed. - step_type: - type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - title: StepType - description: Type of the step in an agent turn. - const: inference - default: inference - model_response: - $ref: '#/components/schemas/CompletionMessage' - description: The response from the LLM. - additionalProperties: false - required: - - turn_id - - step_id - - step_type - - model_response - title: InferenceStep - description: An inference step in an agent turn. - MemoryRetrievalStep: - type: object - properties: - turn_id: - type: string - description: The ID of the turn. - step_id: - type: string - description: The ID of the step. - started_at: - type: string - format: date-time - description: The time the step started. - completed_at: - type: string - format: date-time - description: The time the step completed. - step_type: - type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - title: StepType - description: Type of the step in an agent turn. - const: memory_retrieval - default: memory_retrieval - vector_store_ids: - type: string + A tool execution step in an agent turn. + + + :param tool_calls: The tool calls to execute. + + :param tool_responses: The tool responses from the tool calls. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: tool_execution + default: tool_execution + title: Step Type + type: string + tool_calls: + items: + $ref: '#/$defs/ToolCall' + title: Tool Calls + type: array + tool_responses: + items: + $ref: '#/$defs/ToolResponse' + title: Tool Responses + type: array + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + type: object + ToolResponse: description: >- - The IDs of the vector databases to retrieve context from. - inserted_context: - $ref: '#/components/schemas/InterleavedContent' + Response from a tool invocation. + + + :param call_id: Unique identifier for the tool call this response is for + + :param tool_name: Name of the tool that was invoked + + :param content: The response content from the tool + + :param metadata: (Optional) Additional metadata about the tool response + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/$defs/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + required: + - call_id + - tool_name + - content + title: ToolResponse + type: object + ToolResponseMessage: description: >- - The context retrieved from the vector databases. - additionalProperties: false - required: - - turn_id - - step_id - - step_type - - vector_store_ids - - inserted_context - title: MemoryRetrievalStep + A message representing the result of a tool invocation. + + + :param role: Must be "tool" to identify this as a tool response + + :param call_id: Unique identifier for the tool call this response is for + + :param content: The response content from the tool + properties: + role: + const: tool + default: tool + title: Role + type: string + call_id: + title: Call Id + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + required: + - call_id + - content + title: ToolResponseMessage + type: object + Turn: + description: >- + A single turn in an interaction with an Agentic System. + + + :param turn_id: Unique identifier for the turn within a session + + :param session_id: Unique identifier for the conversation session + + :param input_messages: List of messages that initiated this turn + + :param steps: Ordered list of processing steps executed during this turn + + :param output_message: The model's generated response containing content + and metadata + + :param output_attachments: (Optional) Files or media attached to the agent's + response + + :param started_at: Timestamp when the turn began + + :param completed_at: (Optional) Timestamp when the turn finished, if completed + properties: + turn_id: + title: Turn Id + type: string + session_id: + title: Session Id + type: string + input_messages: + items: + anyOf: + - $ref: '#/$defs/UserMessage' + - $ref: '#/$defs/ToolResponseMessage' + title: Input Messages + type: array + steps: + items: + discriminator: + mapping: + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/$defs/InferenceStep' + - $ref: '#/$defs/ToolExecutionStep' + - $ref: '#/$defs/ShieldCallStep' + - $ref: '#/$defs/MemoryRetrievalStep' + title: Steps + type: array + output_message: + $ref: '#/$defs/CompletionMessage' + output_attachments: + anyOf: + - items: + $ref: '#/$defs/Attachment' + type: array + - type: 'null' + title: Output Attachments + started_at: + format: date-time + title: Started At + type: string + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + required: + - turn_id + - session_id + - input_messages + - steps + - output_message + - started_at + title: Turn + type: object + URL: + description: >- + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + UserMessage: + description: >- + A message from the user in a chat conversation. + + + :param role: Must be "user" to identify this as a user message + + :param content: The content of the message, which can include text and + other media + + :param context: (Optional) This field is used internally by Llama Stack + to pass RAG context. This field may be removed in the API in the future. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + - type: 'null' + title: Context + required: + - content + title: UserMessage + type: object + ViolationLevel: + description: >- + Severity level of a safety violation. + + + :cvar INFO: Informational level violation that does not require action + + :cvar WARN: Warning level violation that suggests caution but allows continuation + + :cvar ERROR: Error level violation that requires blocking or intervention + enum: + - info + - warn + - error + title: ViolationLevel + type: string + _URLOrData: + description: >- + A URL or a base64 encoded string + + + :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. + Note that URL could have length limits. + + :param data: base64 encoded image data as string + properties: + url: + anyOf: + - $ref: '#/$defs/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data + title: _URLOrData + type: object description: >- - A memory retrieval step in an agent turn. - Session: - type: object + A single session of an interaction with an Agentic System. + + + :param session_id: Unique identifier for the conversation session + + :param session_name: Human-readable name for the session + + :param turns: List of all turns that have occurred in this session + + :param started_at: Timestamp when the session was created properties: session_id: + title: Session Id type: string - description: >- - Unique identifier for the conversation session session_name: + title: Session Name type: string - description: Human-readable name for the session turns: - type: array items: - $ref: '#/components/schemas/Turn' - description: >- - List of all turns that have occurred in this session + $ref: '#/$defs/Turn' + title: Turns + type: array started_at: - type: string format: date-time - description: Timestamp when the session was created - additionalProperties: false + title: Started At + type: string required: - session_id - session_name - turns - started_at title: Session - description: >- - A single session of an interaction with an Agentic System. - ShieldCallStep: type: object properties: turn_id: @@ -12394,122 +17907,733 @@ components: description: The response content from the tool metadata: type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool response - additionalProperties: false - required: - - call_id - - tool_name - - content - title: ToolResponse - description: Response from a tool invocation. - ToolResponseMessage: - type: object - properties: - role: - type: string - const: tool - default: tool + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + (Optional) Additional metadata about the tool response + additionalProperties: false + required: + - call_id + - tool_name + - content + title: ToolResponse + description: Response from a tool invocation. + ToolResponseMessage: + type: object + properties: + role: + type: string + const: tool + default: tool + description: >- + Must be "tool" to identify this as a tool response + call_id: + type: string + description: >- + Unique identifier for the tool call this response is for + content: + $ref: '#/components/schemas/InterleavedContent' + description: The response content from the tool + additionalProperties: false + required: + - role + - call_id + - content + title: ToolResponseMessage + description: >- + A message representing the result of a tool invocation. + Turn: + $defs: + Attachment: + description: >- + An attachment to an agent turn. + + + :param content: The content of the attachment. + + :param mime_type: The MIME type of the attachment. + properties: + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + - $ref: '#/$defs/URL' + title: Content + mime_type: + title: Mime Type + type: string + required: + - content + - mime_type + title: Attachment + type: object + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + CompletionMessage: + description: >- + A message containing the model's (assistant) response in a chat conversation. + + + :param role: Must be "assistant" to identify this as the model's response + + :param content: The content of the model's response + + :param stop_reason: Reason why the model stopped generating. Options are: + - `StopReason.end_of_turn`: The model finished generating the entire + response. + - `StopReason.end_of_message`: The model finished generating but generated + a partial response -- usually, a tool call. The user may call the tool + and continue the conversation with the tool's response. + - `StopReason.out_of_tokens`: The model ran out of token budget. + :param tool_calls: List of tool calls. Each tool call is a ToolCall object. + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/$defs/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/$defs/ToolCall' + type: array + - type: 'null' + title: Tool Calls + required: + - content + - stop_reason + title: CompletionMessage + type: object + ImageContentItem: + description: >- + A image content item + + + :param type: Discriminator type of the content item. Always "image" + + :param image: Image as a base64 encoded string or an URL + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/$defs/_URLOrData' + required: + - image + title: ImageContentItem + type: object + InferenceStep: + description: >- + An inference step in an agent turn. + + + :param model_response: The response from the LLM. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: inference + default: inference + title: Step Type + type: string + model_response: + $ref: '#/$defs/CompletionMessage' + required: + - turn_id + - step_id + - model_response + title: InferenceStep + type: object + MemoryRetrievalStep: + description: >- + A memory retrieval step in an agent turn. + + + :param vector_store_ids: The IDs of the vector databases to retrieve context + from. + + :param inserted_context: The context retrieved from the vector databases. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: memory_retrieval + default: memory_retrieval + title: Step Type + type: string + vector_store_ids: + title: Vector Store Ids + type: string + inserted_context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Inserted Context + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + type: object + SafetyViolation: + description: >- + Details of a safety violation detected by content moderation. + + + :param violation_level: Severity level of the violation + + :param user_message: (Optional) Message to convey to the user about the + violation + + :param metadata: Additional metadata including specific violation codes + for debugging and telemetry + properties: + violation_level: + $ref: '#/$defs/ViolationLevel' + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + metadata: + additionalProperties: true + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + type: object + ShieldCallStep: + description: >- + A shield call step in an agent turn. + + + :param violation: The violation from the shield call. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: shield_call + default: shield_call + title: Step Type + type: string + violation: + anyOf: + - $ref: '#/$defs/SafetyViolation' + - type: 'null' + required: + - turn_id + - step_id + - violation + title: ShieldCallStep + type: object + StopReason: + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + type: string + TextContentItem: + description: >- + A text content item + + + :param type: Discriminator type of the content item. Always "text" + + :param text: Text content + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/$defs/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolExecutionStep: + description: >- + A tool execution step in an agent turn. + + + :param tool_calls: The tool calls to execute. + + :param tool_responses: The tool responses from the tool calls. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: tool_execution + default: tool_execution + title: Step Type + type: string + tool_calls: + items: + $ref: '#/$defs/ToolCall' + title: Tool Calls + type: array + tool_responses: + items: + $ref: '#/$defs/ToolResponse' + title: Tool Responses + type: array + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + type: object + ToolResponse: + description: >- + Response from a tool invocation. + + + :param call_id: Unique identifier for the tool call this response is for + + :param tool_name: Name of the tool that was invoked + + :param content: The response content from the tool + + :param metadata: (Optional) Additional metadata about the tool response + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/$defs/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + required: + - call_id + - tool_name + - content + title: ToolResponse + type: object + ToolResponseMessage: + description: >- + A message representing the result of a tool invocation. + + + :param role: Must be "tool" to identify this as a tool response + + :param call_id: Unique identifier for the tool call this response is for + + :param content: The response content from the tool + properties: + role: + const: tool + default: tool + title: Role + type: string + call_id: + title: Call Id + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + required: + - call_id + - content + title: ToolResponseMessage + type: object + URL: + description: >- + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + UserMessage: + description: >- + A message from the user in a chat conversation. + + + :param role: Must be "user" to identify this as a user message + + :param content: The content of the message, which can include text and + other media + + :param context: (Optional) This field is used internally by Llama Stack + to pass RAG context. This field may be removed in the API in the future. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + - type: 'null' + title: Context + required: + - content + title: UserMessage + type: object + ViolationLevel: description: >- - Must be "tool" to identify this as a tool response - call_id: + Severity level of a safety violation. + + + :cvar INFO: Informational level violation that does not require action + + :cvar WARN: Warning level violation that suggests caution but allows continuation + + :cvar ERROR: Error level violation that requires blocking or intervention + enum: + - info + - warn + - error + title: ViolationLevel type: string + _URLOrData: description: >- - Unique identifier for the tool call this response is for - content: - $ref: '#/components/schemas/InterleavedContent' - description: The response content from the tool - additionalProperties: false - required: - - role - - call_id - - content - title: ToolResponseMessage + A URL or a base64 encoded string + + + :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. + Note that URL could have length limits. + + :param data: base64 encoded image data as string + properties: + url: + anyOf: + - $ref: '#/$defs/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data + title: _URLOrData + type: object description: >- - A message representing the result of a tool invocation. - Turn: - type: object + A single turn in an interaction with an Agentic System. + + + :param turn_id: Unique identifier for the turn within a session + + :param session_id: Unique identifier for the conversation session + + :param input_messages: List of messages that initiated this turn + + :param steps: Ordered list of processing steps executed during this turn + + :param output_message: The model's generated response containing content and + metadata + + :param output_attachments: (Optional) Files or media attached to the agent's + response + + :param started_at: Timestamp when the turn began + + :param completed_at: (Optional) Timestamp when the turn finished, if completed properties: turn_id: + title: Turn Id type: string - description: >- - Unique identifier for the turn within a session session_id: + title: Session Id type: string - description: >- - Unique identifier for the conversation session input_messages: - type: array items: - oneOf: - - $ref: '#/components/schemas/UserMessage' - - $ref: '#/components/schemas/ToolResponseMessage' - description: >- - List of messages that initiated this turn - steps: + anyOf: + - $ref: '#/$defs/UserMessage' + - $ref: '#/$defs/ToolResponseMessage' + title: Input Messages type: array + steps: items: - oneOf: - - $ref: '#/components/schemas/InferenceStep' - - $ref: '#/components/schemas/ToolExecutionStep' - - $ref: '#/components/schemas/ShieldCallStep' - - $ref: '#/components/schemas/MemoryRetrievalStep' discriminator: - propertyName: step_type mapping: - inference: '#/components/schemas/InferenceStep' - tool_execution: '#/components/schemas/ToolExecutionStep' - shield_call: '#/components/schemas/ShieldCallStep' - memory_retrieval: '#/components/schemas/MemoryRetrievalStep' - description: >- - Ordered list of processing steps executed during this turn + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/$defs/InferenceStep' + - $ref: '#/$defs/ToolExecutionStep' + - $ref: '#/$defs/ShieldCallStep' + - $ref: '#/$defs/MemoryRetrievalStep' + title: Steps + type: array output_message: - $ref: '#/components/schemas/CompletionMessage' - description: >- - The model's generated response containing content and metadata + $ref: '#/$defs/CompletionMessage' output_attachments: - type: array - items: - type: object - properties: - content: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - - $ref: '#/components/schemas/URL' - description: The content of the attachment. - mime_type: - type: string - description: The MIME type of the attachment. - additionalProperties: false - required: - - content - - mime_type - title: Attachment - description: An attachment to an agent turn. - description: >- - (Optional) Files or media attached to the agent's response + anyOf: + - items: + $ref: '#/$defs/Attachment' + type: array + - type: 'null' + title: Output Attachments started_at: - type: string format: date-time - description: Timestamp when the turn began - completed_at: + title: Started At type: string - format: date-time - description: >- - (Optional) Timestamp when the turn finished, if completed - additionalProperties: false + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At required: - turn_id - session_id @@ -12547,544 +18671,621 @@ components: A message from the user in a chat conversation. CreateAgentTurnRequest: type: object - properties: - messages: - type: array - items: - oneOf: - - $ref: '#/components/schemas/UserMessage' - - $ref: '#/components/schemas/ToolResponseMessage' - description: List of messages to start the turn with. - stream: - type: boolean - description: >- - (Optional) If True, generate an SSE event stream of the response. Defaults - to False. - documents: - type: array - items: - type: object - properties: - content: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - - $ref: '#/components/schemas/URL' - description: The content of the document. - mime_type: - type: string - description: The MIME type of the document. - additionalProperties: false - required: - - content - - mime_type - title: Document - description: A document to be used by an agent. - description: >- - (Optional) List of documents to create the turn with. - toolgroups: - type: array - items: - $ref: '#/components/schemas/AgentTool' - description: >- - (Optional) List of toolgroups to create the turn with, will be used in - addition to the agent's config toolgroups for the request. - tool_config: - $ref: '#/components/schemas/ToolConfig' - description: >- - (Optional) The tool configuration to create the turn with, will be used - to override the agent's tool_config. - additionalProperties: false - required: - - messages - title: CreateAgentTurnRequest - AgentTurnResponseEvent: - type: object - properties: - payload: - oneOf: - - $ref: '#/components/schemas/AgentTurnResponseStepStartPayload' - - $ref: '#/components/schemas/AgentTurnResponseStepProgressPayload' - - $ref: '#/components/schemas/AgentTurnResponseStepCompletePayload' - - $ref: '#/components/schemas/AgentTurnResponseTurnStartPayload' - - $ref: '#/components/schemas/AgentTurnResponseTurnCompletePayload' - - $ref: '#/components/schemas/AgentTurnResponseTurnAwaitingInputPayload' - discriminator: - propertyName: event_type - mapping: - step_start: '#/components/schemas/AgentTurnResponseStepStartPayload' - step_progress: '#/components/schemas/AgentTurnResponseStepProgressPayload' - step_complete: '#/components/schemas/AgentTurnResponseStepCompletePayload' - turn_start: '#/components/schemas/AgentTurnResponseTurnStartPayload' - turn_complete: '#/components/schemas/AgentTurnResponseTurnCompletePayload' - turn_awaiting_input: '#/components/schemas/AgentTurnResponseTurnAwaitingInputPayload' - description: >- - Event-specific payload containing event data - additionalProperties: false - required: - - payload - title: AgentTurnResponseEvent - description: >- - An event in an agent turn response stream. - AgentTurnResponseStepCompletePayload: + ResumeAgentTurnRequest: type: object - properties: - event_type: - type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: step_complete - default: step_complete - description: Type of event being reported - step_type: - type: string + AgentStepResponse: + $defs: + BuiltinTool: enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - description: Type of step being executed - step_id: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool type: string + CompletionMessage: description: >- - Unique identifier for the step within a turn - step_details: - oneOf: - - $ref: '#/components/schemas/InferenceStep' - - $ref: '#/components/schemas/ToolExecutionStep' - - $ref: '#/components/schemas/ShieldCallStep' - - $ref: '#/components/schemas/MemoryRetrievalStep' - discriminator: - propertyName: step_type - mapping: - inference: '#/components/schemas/InferenceStep' - tool_execution: '#/components/schemas/ToolExecutionStep' - shield_call: '#/components/schemas/ShieldCallStep' - memory_retrieval: '#/components/schemas/MemoryRetrievalStep' - description: Complete details of the executed step - additionalProperties: false - required: - - event_type - - step_type - - step_id - - step_details - title: AgentTurnResponseStepCompletePayload - description: >- - Payload for step completion events in agent turn responses. - AgentTurnResponseStepProgressPayload: - type: object - properties: - event_type: - type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: step_progress - default: step_progress - description: Type of event being reported - step_type: - type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - description: Type of step being executed - step_id: - type: string + A message containing the model's (assistant) response in a chat conversation. + + + :param role: Must be "assistant" to identify this as the model's response + + :param content: The content of the model's response + + :param stop_reason: Reason why the model stopped generating. Options are: + - `StopReason.end_of_turn`: The model finished generating the entire + response. + - `StopReason.end_of_message`: The model finished generating but generated + a partial response -- usually, a tool call. The user may call the tool + and continue the conversation with the tool's response. + - `StopReason.out_of_tokens`: The model ran out of token budget. + :param tool_calls: List of tool calls. Each tool call is a ToolCall object. + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/$defs/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/$defs/ToolCall' + type: array + - type: 'null' + title: Tool Calls + required: + - content + - stop_reason + title: CompletionMessage + type: object + ImageContentItem: description: >- - Unique identifier for the step within a turn - delta: - oneOf: - - $ref: '#/components/schemas/TextDelta' - - $ref: '#/components/schemas/ImageDelta' - - $ref: '#/components/schemas/ToolCallDelta' - discriminator: - propertyName: type - mapping: - text: '#/components/schemas/TextDelta' - image: '#/components/schemas/ImageDelta' - tool_call: '#/components/schemas/ToolCallDelta' + A image content item + + + :param type: Discriminator type of the content item. Always "image" + + :param image: Image as a base64 encoded string or an URL + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/$defs/_URLOrData' + required: + - image + title: ImageContentItem + type: object + InferenceStep: description: >- - Incremental content changes during step execution - additionalProperties: false - required: - - event_type - - step_type - - step_id - - delta - title: AgentTurnResponseStepProgressPayload - description: >- - Payload for step progress events in agent turn responses. - AgentTurnResponseStepStartPayload: - type: object - properties: - event_type: - type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: step_start - default: step_start - description: Type of event being reported - step_type: - type: string + An inference step in an agent turn. + + + :param model_response: The response from the LLM. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: inference + default: inference + title: Step Type + type: string + model_response: + $ref: '#/$defs/CompletionMessage' + required: + - turn_id + - step_id + - model_response + title: InferenceStep + type: object + MemoryRetrievalStep: + description: >- + A memory retrieval step in an agent turn. + + + :param vector_store_ids: The IDs of the vector databases to retrieve context + from. + + :param inserted_context: The context retrieved from the vector databases. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: memory_retrieval + default: memory_retrieval + title: Step Type + type: string + vector_store_ids: + title: Vector Store Ids + type: string + inserted_context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Inserted Context + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + type: object + SafetyViolation: + description: >- + Details of a safety violation detected by content moderation. + + + :param violation_level: Severity level of the violation + + :param user_message: (Optional) Message to convey to the user about the + violation + + :param metadata: Additional metadata including specific violation codes + for debugging and telemetry + properties: + violation_level: + $ref: '#/$defs/ViolationLevel' + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + metadata: + additionalProperties: true + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + type: object + ShieldCallStep: + description: >- + A shield call step in an agent turn. + + + :param violation: The violation from the shield call. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: shield_call + default: shield_call + title: Step Type + type: string + violation: + anyOf: + - $ref: '#/$defs/SafetyViolation' + - type: 'null' + required: + - turn_id + - step_id + - violation + title: ShieldCallStep + type: object + StopReason: enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - description: Type of step being executed - step_id: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason type: string + TextContentItem: description: >- - Unique identifier for the step within a turn - metadata: + A text content item + + + :param type: Discriminator type of the content item. Always "text" + + :param text: Text content + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata for the step - additionalProperties: false - required: - - event_type - - step_type - - step_id - title: AgentTurnResponseStepStartPayload - description: >- - Payload for step start events in agent turn responses. - AgentTurnResponseStreamChunk: - type: object - properties: - event: - $ref: '#/components/schemas/AgentTurnResponseEvent' + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/$defs/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolExecutionStep: description: >- - Individual event in the agent turn response stream - additionalProperties: false - required: - - event - title: AgentTurnResponseStreamChunk - description: Streamed agent turn completion response. - "AgentTurnResponseTurnAwaitingInputPayload": - type: object - properties: - event_type: - type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: turn_awaiting_input - default: turn_awaiting_input - description: Type of event being reported - turn: - $ref: '#/components/schemas/Turn' - description: >- - Turn data when waiting for external tool responses - additionalProperties: false - required: - - event_type - - turn - title: >- - AgentTurnResponseTurnAwaitingInputPayload - description: >- - Payload for turn awaiting input events in agent turn responses. - AgentTurnResponseTurnCompletePayload: - type: object - properties: - event_type: - type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: turn_complete - default: turn_complete - description: Type of event being reported - turn: - $ref: '#/components/schemas/Turn' - description: >- - Complete turn data including all steps and results - additionalProperties: false - required: - - event_type - - turn - title: AgentTurnResponseTurnCompletePayload - description: >- - Payload for turn completion events in agent turn responses. - AgentTurnResponseTurnStartPayload: - type: object - properties: - event_type: - type: string - enum: - - step_start - - step_complete - - step_progress - - turn_start - - turn_complete - - turn_awaiting_input - const: turn_start - default: turn_start - description: Type of event being reported - turn_id: - type: string + A tool execution step in an agent turn. + + + :param tool_calls: The tool calls to execute. + + :param tool_responses: The tool responses from the tool calls. + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + step_type: + const: tool_execution + default: tool_execution + title: Step Type + type: string + tool_calls: + items: + $ref: '#/$defs/ToolCall' + title: Tool Calls + type: array + tool_responses: + items: + $ref: '#/$defs/ToolResponse' + title: Tool Responses + type: array + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + type: object + ToolResponse: description: >- - Unique identifier for the turn within a session - additionalProperties: false - required: - - event_type - - turn_id - title: AgentTurnResponseTurnStartPayload - description: >- - Payload for turn start events in agent turn responses. - ImageDelta: - type: object - properties: - type: - type: string - const: image - default: image + Response from a tool invocation. + + + :param call_id: Unique identifier for the tool call this response is for + + :param tool_name: Name of the tool that was invoked + + :param content: The response content from the tool + + :param metadata: (Optional) Additional metadata about the tool response + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/$defs/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + required: + - call_id + - tool_name + - content + title: ToolResponse + type: object + URL: description: >- - Discriminator type of the delta. Always "image" - image: - type: string - contentEncoding: base64 - description: The incremental image data as bytes - additionalProperties: false - required: - - type - - image - title: ImageDelta - description: >- - An image content delta for streaming responses. - TextDelta: - type: object - properties: - type: - type: string - const: text - default: text + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + ViolationLevel: description: >- - Discriminator type of the delta. Always "text" - text: - type: string - description: The incremental text content - additionalProperties: false - required: - - type - - text - title: TextDelta - description: >- - A text content delta for streaming responses. - ToolCallDelta: - type: object - properties: - type: + Severity level of a safety violation. + + + :cvar INFO: Informational level violation that does not require action + + :cvar WARN: Warning level violation that suggests caution but allows continuation + + :cvar ERROR: Error level violation that requires blocking or intervention + enum: + - info + - warn + - error + title: ViolationLevel type: string - const: tool_call - default: tool_call - description: >- - Discriminator type of the delta. Always "tool_call" - tool_call: - oneOf: - - type: string - - $ref: '#/components/schemas/ToolCall' + _URLOrData: description: >- - Either an in-progress tool call string or the final parsed tool call - parse_status: - type: string - enum: - - started - - in_progress - - failed - - succeeded - description: Current parsing status of the tool call - additionalProperties: false - required: - - type - - tool_call - - parse_status - title: ToolCallDelta + A URL or a base64 encoded string + + + :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. + Note that URL could have length limits. + + :param data: base64 encoded image data as string + properties: + url: + anyOf: + - $ref: '#/$defs/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data + title: _URLOrData + type: object description: >- - A tool call content delta for streaming responses. - ResumeAgentTurnRequest: - type: object - properties: - tool_responses: - type: array - items: - $ref: '#/components/schemas/ToolResponse' - description: >- - The tool call responses to resume the turn with. - stream: - type: boolean - description: Whether to stream the response. - additionalProperties: false - required: - - tool_responses - title: ResumeAgentTurnRequest - AgentStepResponse: - type: object + Response containing details of a specific agent step. + + + :param step: The complete step data and execution details properties: step: - oneOf: - - $ref: '#/components/schemas/InferenceStep' - - $ref: '#/components/schemas/ToolExecutionStep' - - $ref: '#/components/schemas/ShieldCallStep' - - $ref: '#/components/schemas/MemoryRetrievalStep' discriminator: - propertyName: step_type mapping: - inference: '#/components/schemas/InferenceStep' - tool_execution: '#/components/schemas/ToolExecutionStep' - shield_call: '#/components/schemas/ShieldCallStep' - memory_retrieval: '#/components/schemas/MemoryRetrievalStep' - description: >- - The complete step data and execution details - additionalProperties: false + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/$defs/InferenceStep' + - $ref: '#/$defs/ToolExecutionStep' + - $ref: '#/$defs/ShieldCallStep' + - $ref: '#/$defs/MemoryRetrievalStep' + title: Step required: - step title: AgentStepResponse - description: >- - Response containing details of a specific agent step. - Benchmark: type: object - properties: - identifier: - type: string - provider_resource_id: - type: string - provider_id: - type: string - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: benchmark - default: benchmark - description: The resource type, always benchmark - dataset_id: - type: string - description: >- - Identifier of the dataset to use for the benchmark evaluation - scoring_functions: - type: array - items: - type: string - description: >- - List of scoring function identifiers to apply during evaluation - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Metadata for this evaluation task - additionalProperties: false - required: - - identifier - - provider_id - - type - - dataset_id - - scoring_functions - - metadata - title: Benchmark - description: >- - A benchmark resource for evaluating model performance. ListBenchmarksResponse: - type: object + $defs: + Benchmark: + description: >- + A benchmark resource for evaluating model performance. + + + :param dataset_id: Identifier of the dataset to use for the benchmark + evaluation + + :param scoring_functions: List of scoring function identifiers to apply + during evaluation + + :param metadata: Metadata for this evaluation task + + :param type: The resource type, always benchmark + properties: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: benchmark + default: benchmark + title: Type + type: string + dataset_id: + title: Dataset Id + type: string + scoring_functions: + items: + type: string + title: Scoring Functions + type: array + metadata: + additionalProperties: true + description: Metadata for this evaluation task + title: Metadata + type: object + required: + - identifier + - provider_id + - dataset_id + - scoring_functions + title: Benchmark + type: object properties: data: - type: array items: - $ref: '#/components/schemas/Benchmark' - additionalProperties: false + $ref: '#/$defs/Benchmark' + title: Data + type: array required: - data title: ListBenchmarksResponse + type: object RegisterBenchmarkRequest: type: object + Benchmark: + description: >- + A benchmark resource for evaluating model performance. + + + :param dataset_id: Identifier of the dataset to use for the benchmark evaluation + + :param scoring_functions: List of scoring function identifiers to apply during + evaluation + + :param metadata: Metadata for this evaluation task + + :param type: The resource type, always benchmark properties: - benchmark_id: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: benchmark + default: benchmark + title: Type type: string - description: The ID of the benchmark to register. dataset_id: + title: Dataset Id type: string - description: >- - The ID of the dataset to use for the benchmark. scoring_functions: - type: array items: type: string - description: >- - The scoring functions to use for the benchmark. - provider_benchmark_id: - type: string - description: >- - The ID of the provider benchmark to use for the benchmark. - provider_id: - type: string - description: >- - The ID of the provider to use for the benchmark. + title: Scoring Functions + type: array metadata: + additionalProperties: true + description: Metadata for this evaluation task + title: Metadata type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The metadata to use for the benchmark. - additionalProperties: false required: - - benchmark_id + - identifier + - provider_id - dataset_id - scoring_functions - title: RegisterBenchmarkRequest - AgentCandidate: + title: Benchmark type: object properties: type: @@ -13182,692 +19383,437 @@ components: A system message providing instructions or context to the model. EvaluateRowsRequest: type: object - properties: - input_rows: - type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The rows to evaluate. - scoring_functions: - type: array - items: - type: string - description: >- - The scoring functions to use for the evaluation. - benchmark_config: - $ref: '#/components/schemas/BenchmarkConfig' - description: The configuration for the benchmark. - additionalProperties: false - required: - - input_rows - - scoring_functions - - benchmark_config - title: EvaluateRowsRequest EvaluateResponse: - type: object + $defs: + ScoringResult: + description: >- + A scoring result for a single row. + + + :param score_rows: The scoring result for each row. Each row is a map + of column name to value. + + :param aggregated_results: Map of metric name to aggregated value + properties: + score_rows: + items: + additionalProperties: true + type: object + title: Score Rows + type: array + aggregated_results: + additionalProperties: true + title: Aggregated Results + type: object + required: + - score_rows + - aggregated_results + title: ScoringResult + type: object + description: >- + The response from an evaluation. + + + :param generations: The generations from the evaluation. + + :param scores: The scores from the evaluation. properties: generations: - type: array items: + additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The generations from the evaluation. + title: Generations + type: array scores: - type: object additionalProperties: - $ref: '#/components/schemas/ScoringResult' - description: The scores from the evaluation. - additionalProperties: false + $ref: '#/$defs/ScoringResult' + title: Scores + type: object required: - generations - scores title: EvaluateResponse - description: The response from an evaluation. + type: object RunEvalRequest: type: object - properties: - benchmark_config: - $ref: '#/components/schemas/BenchmarkConfig' - description: The configuration for the benchmark. - additionalProperties: false - required: - - benchmark_config - title: RunEvalRequest Job: - type: object - properties: - job_id: - type: string - description: Unique identifier for the job - status: - type: string + $defs: + JobStatus: + description: >- + Status of a job execution. + + :cvar completed: Job has finished successfully + + :cvar in_progress: Job is currently running + + :cvar failed: Job has failed during execution + + :cvar scheduled: Job is scheduled but not yet started + + :cvar cancelled: Job was cancelled before completion enum: - completed - in_progress - failed - scheduled - cancelled - description: Current execution status of the job - additionalProperties: false - required: - - job_id - - status - title: Job + title: JobStatus + type: string description: >- A job execution instance with status tracking. - RerankRequest: - type: object + + + :param job_id: Unique identifier for the job + + :param status: Current execution status of the job properties: - model: + job_id: + title: Job Id type: string - description: >- - The identifier of the reranking model to use. - query: - oneOf: - - type: string - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - description: >- - The search query to rank items against. Can be a string, text content - part, or image content part. The input must not exceed the model's max - input token length. - items: - type: array - items: - oneOf: - - type: string - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - description: >- - List of items to rerank. Each item can be a string, text content part, - or image content part. Each input must not exceed the model's max input - token length. - max_num_results: - type: integer - description: >- - (Optional) Maximum number of results to return. Default: returns all. - additionalProperties: false + status: + $ref: '#/$defs/JobStatus' required: - - model - - query - - items - title: RerankRequest - RerankData: + - job_id + - status + title: Job type: object - properties: - index: - type: integer - description: >- - The original index of the document in the input list - relevance_score: - type: number + RerankRequest: + type: object + RerankResponse: + $defs: + RerankData: description: >- - The relevance score from the model output. Values are inverted when applicable - so that higher scores indicate greater relevance. - additionalProperties: false - required: - - index - - relevance_score - title: RerankData + A single rerank result from a reranking response. + + + :param index: The original index of the document in the input list + + :param relevance_score: The relevance score from the model output. Values + are inverted when applicable so that higher scores indicate greater relevance. + properties: + index: + title: Index + type: integer + relevance_score: + title: Relevance Score + type: number + required: + - index + - relevance_score + title: RerankData + type: object description: >- - A single rerank result from a reranking response. - RerankResponse: - type: object + Response from a reranking request. + + + :param data: List of rerank result objects, sorted by relevance score (descending) properties: data: - type: array items: - $ref: '#/components/schemas/RerankData' - description: >- - List of rerank result objects, sorted by relevance score (descending) - additionalProperties: false + $ref: '#/$defs/RerankData' + title: Data + type: array required: - data title: RerankResponse - description: Response from a reranking request. - Checkpoint: type: object - properties: - identifier: - type: string - description: Unique identifier for the checkpoint - created_at: - type: string - format: date-time - description: >- - Timestamp when the checkpoint was created - epoch: - type: integer - description: >- - Training epoch when the checkpoint was saved - post_training_job_id: - type: string - description: >- - Identifier of the training job that created this checkpoint - path: - type: string + PostTrainingJobArtifactsResponse: + $defs: + Checkpoint: description: >- - File system path where the checkpoint is stored - training_metrics: - $ref: '#/components/schemas/PostTrainingMetric' + Checkpoint created during training runs. + + + :param identifier: Unique identifier for the checkpoint + + :param created_at: Timestamp when the checkpoint was created + + :param epoch: Training epoch when the checkpoint was saved + + :param post_training_job_id: Identifier of the training job that created + this checkpoint + + :param path: File system path where the checkpoint is stored + + :param training_metrics: (Optional) Training metrics associated with this + checkpoint + properties: + identifier: + title: Identifier + type: string + created_at: + format: date-time + title: Created At + type: string + epoch: + title: Epoch + type: integer + post_training_job_id: + title: Post Training Job Id + type: string + path: + title: Path + type: string + training_metrics: + anyOf: + - $ref: '#/$defs/PostTrainingMetric' + - type: 'null' + required: + - identifier + - created_at + - epoch + - post_training_job_id + - path + title: Checkpoint + type: object + PostTrainingMetric: description: >- - (Optional) Training metrics associated with this checkpoint - additionalProperties: false - required: - - identifier - - created_at - - epoch - - post_training_job_id - - path - title: Checkpoint - description: Checkpoint created during training runs. - PostTrainingJobArtifactsResponse: - type: object + Training metrics captured during post-training jobs. + + + :param epoch: Training epoch number + + :param train_loss: Loss value on the training dataset + + :param validation_loss: Loss value on the validation dataset + + :param perplexity: Perplexity metric indicating model confidence + properties: + epoch: + title: Epoch + type: integer + train_loss: + title: Train Loss + type: number + validation_loss: + title: Validation Loss + type: number + perplexity: + title: Perplexity + type: number + required: + - epoch + - train_loss + - validation_loss + - perplexity + title: PostTrainingMetric + type: object + description: >- + Artifacts of a finetuning job. + + + :param job_uuid: Unique identifier for the training job + + :param checkpoints: List of model checkpoints created during training properties: job_uuid: + title: Job Uuid type: string - description: Unique identifier for the training job checkpoints: - type: array items: - $ref: '#/components/schemas/Checkpoint' - description: >- - List of model checkpoints created during training - additionalProperties: false + $ref: '#/$defs/Checkpoint' + title: Checkpoints + type: array required: - job_uuid - - checkpoints title: PostTrainingJobArtifactsResponse - description: Artifacts of a finetuning job. - PostTrainingMetric: type: object - properties: - epoch: - type: integer - description: Training epoch number - train_loss: - type: number - description: Loss value on the training dataset - validation_loss: - type: number - description: Loss value on the validation dataset - perplexity: - type: number - description: >- - Perplexity metric indicating model confidence - additionalProperties: false - required: - - epoch - - train_loss - - validation_loss - - perplexity - title: PostTrainingMetric - description: >- - Training metrics captured during post-training jobs. CancelTrainingJobRequest: type: object - properties: - job_uuid: - type: string - description: The UUID of the job to cancel. - additionalProperties: false - required: - - job_uuid - title: CancelTrainingJobRequest PostTrainingJobStatusResponse: - type: object - properties: - job_uuid: - type: string - description: Unique identifier for the training job - status: - type: string + $defs: + Checkpoint: + description: >- + Checkpoint created during training runs. + + + :param identifier: Unique identifier for the checkpoint + + :param created_at: Timestamp when the checkpoint was created + + :param epoch: Training epoch when the checkpoint was saved + + :param post_training_job_id: Identifier of the training job that created + this checkpoint + + :param path: File system path where the checkpoint is stored + + :param training_metrics: (Optional) Training metrics associated with this + checkpoint + properties: + identifier: + title: Identifier + type: string + created_at: + format: date-time + title: Created At + type: string + epoch: + title: Epoch + type: integer + post_training_job_id: + title: Post Training Job Id + type: string + path: + title: Path + type: string + training_metrics: + anyOf: + - $ref: '#/$defs/PostTrainingMetric' + - type: 'null' + required: + - identifier + - created_at + - epoch + - post_training_job_id + - path + title: Checkpoint + type: object + JobStatus: + description: >- + Status of a job execution. + + :cvar completed: Job has finished successfully + + :cvar in_progress: Job is currently running + + :cvar failed: Job has failed during execution + + :cvar scheduled: Job is scheduled but not yet started + + :cvar cancelled: Job was cancelled before completion enum: - completed - in_progress - failed - scheduled - cancelled - description: Current status of the training job - scheduled_at: + title: JobStatus type: string - format: date-time + PostTrainingMetric: description: >- - (Optional) Timestamp when the job was scheduled - started_at: + Training metrics captured during post-training jobs. + + + :param epoch: Training epoch number + + :param train_loss: Loss value on the training dataset + + :param validation_loss: Loss value on the validation dataset + + :param perplexity: Perplexity metric indicating model confidence + properties: + epoch: + title: Epoch + type: integer + train_loss: + title: Train Loss + type: number + validation_loss: + title: Validation Loss + type: number + perplexity: + title: Perplexity + type: number + required: + - epoch + - train_loss + - validation_loss + - perplexity + title: PostTrainingMetric + type: object + description: >- + Status of a finetuning job. + + + :param job_uuid: Unique identifier for the training job + + :param status: Current status of the training job + + :param scheduled_at: (Optional) Timestamp when the job was scheduled + + :param started_at: (Optional) Timestamp when the job execution began + + :param completed_at: (Optional) Timestamp when the job finished, if completed + + :param resources_allocated: (Optional) Information about computational resources + allocated to the job + + :param checkpoints: List of model checkpoints created during training + properties: + job_uuid: + title: Job Uuid type: string - format: date-time - description: >- - (Optional) Timestamp when the job execution began + status: + $ref: '#/$defs/JobStatus' + scheduled_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Scheduled At + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Started At completed_at: - type: string - format: date-time - description: >- - (Optional) Timestamp when the job finished, if completed + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At resources_allocated: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Information about computational resources allocated to the - job + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Resources Allocated checkpoints: - type: array items: - $ref: '#/components/schemas/Checkpoint' - description: >- - List of model checkpoints created during training - additionalProperties: false + $ref: '#/$defs/Checkpoint' + title: Checkpoints + type: array required: - job_uuid - status - - checkpoints title: PostTrainingJobStatusResponse - description: Status of a finetuning job. - ListPostTrainingJobsResponse: type: object + ListPostTrainingJobsResponse: + $defs: + PostTrainingJob: + properties: + job_uuid: + title: Job Uuid + type: string + required: + - job_uuid + title: PostTrainingJob + type: object properties: data: - type: array items: - type: object - properties: - job_uuid: - type: string - additionalProperties: false - required: - - job_uuid - title: PostTrainingJob - additionalProperties: false + $ref: '#/$defs/PostTrainingJob' + title: Data + type: array required: - data title: ListPostTrainingJobsResponse - DPOAlignmentConfig: - type: object - properties: - beta: - type: number - description: Temperature parameter for the DPO loss - loss_type: - $ref: '#/components/schemas/DPOLossType' - default: sigmoid - description: The type of loss function to use for DPO - additionalProperties: false - required: - - beta - - loss_type - title: DPOAlignmentConfig - description: >- - Configuration for Direct Preference Optimization (DPO) alignment. - DPOLossType: - type: string - enum: - - sigmoid - - hinge - - ipo - - kto_pair - title: DPOLossType - DataConfig: - type: object - properties: - dataset_id: - type: string - description: >- - Unique identifier for the training dataset - batch_size: - type: integer - description: Number of samples per training batch - shuffle: - type: boolean - description: >- - Whether to shuffle the dataset during training - data_format: - $ref: '#/components/schemas/DatasetFormat' - description: >- - Format of the dataset (instruct or dialog) - validation_dataset_id: - type: string - description: >- - (Optional) Unique identifier for the validation dataset - packed: - type: boolean - default: false - description: >- - (Optional) Whether to pack multiple samples into a single sequence for - efficiency - train_on_input: - type: boolean - default: false - description: >- - (Optional) Whether to compute loss on input tokens as well as output tokens - additionalProperties: false - required: - - dataset_id - - batch_size - - shuffle - - data_format - title: DataConfig - description: >- - Configuration for training data and data loading. - DatasetFormat: - type: string - enum: - - instruct - - dialog - title: DatasetFormat - description: Format of the training dataset. - EfficiencyConfig: - type: object - properties: - enable_activation_checkpointing: - type: boolean - default: false - description: >- - (Optional) Whether to use activation checkpointing to reduce memory usage - enable_activation_offloading: - type: boolean - default: false - description: >- - (Optional) Whether to offload activations to CPU to save GPU memory - memory_efficient_fsdp_wrap: - type: boolean - default: false - description: >- - (Optional) Whether to use memory-efficient FSDP wrapping - fsdp_cpu_offload: - type: boolean - default: false - description: >- - (Optional) Whether to offload FSDP parameters to CPU - additionalProperties: false - title: EfficiencyConfig - description: >- - Configuration for memory and compute efficiency optimizations. - OptimizerConfig: - type: object - properties: - optimizer_type: - $ref: '#/components/schemas/OptimizerType' - description: >- - Type of optimizer to use (adam, adamw, or sgd) - lr: - type: number - description: Learning rate for the optimizer - weight_decay: - type: number - description: >- - Weight decay coefficient for regularization - num_warmup_steps: - type: integer - description: Number of steps for learning rate warmup - additionalProperties: false - required: - - optimizer_type - - lr - - weight_decay - - num_warmup_steps - title: OptimizerConfig - description: >- - Configuration parameters for the optimization algorithm. - OptimizerType: - type: string - enum: - - adam - - adamw - - sgd - title: OptimizerType - description: >- - Available optimizer algorithms for training. - TrainingConfig: type: object - properties: - n_epochs: - type: integer - description: Number of training epochs to run - max_steps_per_epoch: - type: integer - default: 1 - description: Maximum number of steps to run per epoch - gradient_accumulation_steps: - type: integer - default: 1 - description: >- - Number of steps to accumulate gradients before updating - max_validation_steps: - type: integer - default: 1 - description: >- - (Optional) Maximum number of validation steps per epoch - data_config: - $ref: '#/components/schemas/DataConfig' - description: >- - (Optional) Configuration for data loading and formatting - optimizer_config: - $ref: '#/components/schemas/OptimizerConfig' - description: >- - (Optional) Configuration for the optimization algorithm - efficiency_config: - $ref: '#/components/schemas/EfficiencyConfig' - description: >- - (Optional) Configuration for memory and compute optimizations - dtype: - type: string - default: bf16 - description: >- - (Optional) Data type for model parameters (bf16, fp16, fp32) - additionalProperties: false - required: - - n_epochs - - max_steps_per_epoch - - gradient_accumulation_steps - title: TrainingConfig - description: >- - Comprehensive configuration for the training process. PreferenceOptimizeRequest: type: object - properties: - job_uuid: - type: string - description: The UUID of the job to create. - finetuned_model: - type: string - description: The model to fine-tune. - algorithm_config: - $ref: '#/components/schemas/DPOAlignmentConfig' - description: The algorithm configuration. - training_config: - $ref: '#/components/schemas/TrainingConfig' - description: The training configuration. - hyperparam_search_config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The hyperparam search configuration. - logger_config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The logger configuration. - additionalProperties: false - required: - - job_uuid - - finetuned_model - - algorithm_config - - training_config - - hyperparam_search_config - - logger_config - title: PreferenceOptimizeRequest PostTrainingJob: - type: object properties: job_uuid: + title: Job Uuid type: string - additionalProperties: false required: - job_uuid title: PostTrainingJob - AlgorithmConfig: - oneOf: - - $ref: '#/components/schemas/LoraFinetuningConfig' - - $ref: '#/components/schemas/QATFinetuningConfig' - discriminator: - propertyName: type - mapping: - LoRA: '#/components/schemas/LoraFinetuningConfig' - QAT: '#/components/schemas/QATFinetuningConfig' - LoraFinetuningConfig: - type: object - properties: - type: - type: string - const: LoRA - default: LoRA - description: Algorithm type identifier, always "LoRA" - lora_attn_modules: - type: array - items: - type: string - description: >- - List of attention module names to apply LoRA to - apply_lora_to_mlp: - type: boolean - description: Whether to apply LoRA to MLP layers - apply_lora_to_output: - type: boolean - description: >- - Whether to apply LoRA to output projection layers - rank: - type: integer - description: >- - Rank of the LoRA adaptation (lower rank = fewer parameters) - alpha: - type: integer - description: >- - LoRA scaling parameter that controls adaptation strength - use_dora: - type: boolean - default: false - description: >- - (Optional) Whether to use DoRA (Weight-Decomposed Low-Rank Adaptation) - quantize_base: - type: boolean - default: false - description: >- - (Optional) Whether to quantize the base model weights - additionalProperties: false - required: - - type - - lora_attn_modules - - apply_lora_to_mlp - - apply_lora_to_output - - rank - - alpha - title: LoraFinetuningConfig - description: >- - Configuration for Low-Rank Adaptation (LoRA) fine-tuning. - QATFinetuningConfig: type: object - properties: - type: - type: string - const: QAT - default: QAT - description: Algorithm type identifier, always "QAT" - quantizer_name: - type: string - description: >- - Name of the quantization algorithm to use - group_size: - type: integer - description: Size of groups for grouped quantization - additionalProperties: false - required: - - type - - quantizer_name - - group_size - title: QATFinetuningConfig - description: >- - Configuration for Quantization-Aware Training (QAT) fine-tuning. SupervisedFineTuneRequest: type: object - properties: - job_uuid: - type: string - description: The UUID of the job to create. - training_config: - $ref: '#/components/schemas/TrainingConfig' - description: The training configuration. - hyperparam_search_config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The hyperparam search configuration. - logger_config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The logger configuration. - model: - type: string - description: The model to fine-tune. - checkpoint_dir: - type: string - description: The directory to save checkpoint(s) to. - algorithm_config: - $ref: '#/components/schemas/AlgorithmConfig' - description: The algorithm configuration. - additionalProperties: false - required: - - job_uuid - - training_config - - hyperparam_search_config - - logger_config - title: SupervisedFineTuneRequest responses: BadRequest400: description: The request was invalid or malformed @@ -13957,16 +19903,12 @@ tags: Llama Stack Inference API for generating completions, chat completions, and embeddings. - - This API provides the raw interface to the underlying models. Three kinds of - models are supported: - - - LLM models: these models generate "raw" and "chat" (conversational) completions. - - - Embedding models: these models generate embeddings to be used for semantic + This API provides the raw interface to the underlying models. Three kinds + of models are supported: + - LLM models: these models generate "raw" and "chat" (conversational) completions. + - Embedding models: these models generate embeddings to be used for semantic search. - - - Rerank models: these models reorder the documents based on their relevance + - Rerank models: these models reorder the documents based on their relevance to a query. x-displayName: Inference - name: Inspect diff --git a/pyproject.toml b/pyproject.toml index 8f07f9cbdd..6a01d7843b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,6 +49,7 @@ dependencies = [ "aiosqlite>=0.21.0", # server - for metadata store "asyncpg", # for metadata store "sqlalchemy[asyncio]>=2.0.41", # server - for conversations + "pyyaml>=6.0.2", ] [project.optional-dependencies] @@ -67,13 +68,13 @@ dev = [ "pytest-cov", "pytest-html", "pytest-json-report", - "pytest-socket", # For blocking network access in unit tests - "nbval", # For notebook testing + "pytest-socket", # For blocking network access in unit tests + "nbval", # For notebook testing "black", "ruff", "mypy", "pre-commit", - "ruamel.yaml", # needed for openapi generator + "ruamel.yaml", # needed for openapi generator ] # Type checking dependencies - includes type stubs and optional runtime dependencies # needed for complete mypy coverage across all optional features @@ -248,7 +249,9 @@ unfixable = [ # Ignore the following errors for the following files [tool.ruff.lint.per-file-ignores] "tests/**/*.py" = ["DTZ"] # Ignore datetime rules for tests -"src/llama_stack/providers/inline/scoring/basic/utils/ifeval_utils.py" = ["RUF001"] +"src/llama_stack/providers/inline/scoring/basic/utils/ifeval_utils.py" = [ + "RUF001", +] "src/llama_stack/providers/inline/scoring/basic/scoring_fn/fn_defs/regex_parser_multiple_choice_answer.py" = [ "RUF001", "PLE2515", @@ -338,7 +341,6 @@ exclude = [ "^src/llama_stack/providers/utils/telemetry/dataset_mixin\\.py$", "^src/llama_stack/providers/utils/telemetry/trace_protocol\\.py$", "^src/llama_stack/providers/utils/telemetry/tracing\\.py$", - "^src/llama_stack/strong_typing/auxiliary\\.py$", "^src/llama_stack/distributions/template\\.py$", ] diff --git a/scripts/fastapi_generator.py b/scripts/fastapi_generator.py new file mode 100755 index 0000000000..5a0dbd00aa --- /dev/null +++ b/scripts/fastapi_generator.py @@ -0,0 +1,1002 @@ +#!/usr/bin/env python3 +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +""" +FastAPI-based OpenAPI generator for Llama Stack. +""" + +import inspect +import json +from pathlib import Path +from typing import Annotated, Any, Literal, get_args, get_origin + +import yaml +from fastapi import FastAPI +from fastapi.openapi.utils import get_openapi + +from llama_stack.apis.datatypes import Api +from llama_stack.core.resolver import api_protocol_map + +# Import the existing route discovery system +from llama_stack.core.server.routes import get_all_api_routes + + +def _get_all_api_routes_with_functions(): + """ + Get all API routes with their actual function references. + This is a modified version of get_all_api_routes that includes the function. + """ + from aiohttp import hdrs + from starlette.routing import Route + + from llama_stack.apis.tools import RAGToolRuntime, SpecialToolGroup + + apis = {} + protocols = api_protocol_map() + toolgroup_protocols = { + SpecialToolGroup.rag_tool: RAGToolRuntime, + } + + for api, protocol in protocols.items(): + routes = [] + protocol_methods = inspect.getmembers(protocol, predicate=inspect.isfunction) + + # HACK ALERT + if api == Api.tool_runtime: + for tool_group in SpecialToolGroup: + sub_protocol = toolgroup_protocols[tool_group] + sub_protocol_methods = inspect.getmembers(sub_protocol, predicate=inspect.isfunction) + for name, method in sub_protocol_methods: + if not hasattr(method, "__webmethod__"): + continue + protocol_methods.append((f"{tool_group.value}.{name}", method)) + + for name, method in protocol_methods: + # Get all webmethods for this method (supports multiple decorators) + webmethods = getattr(method, "__webmethods__", []) + if not webmethods: + continue + + # Create routes for each webmethod decorator + for webmethod in webmethods: + path = f"/{webmethod.level}/{webmethod.route.lstrip('/')}" + if webmethod.method == hdrs.METH_GET: + http_method = hdrs.METH_GET + elif webmethod.method == hdrs.METH_DELETE: + http_method = hdrs.METH_DELETE + else: + http_method = hdrs.METH_POST + + # Store the function reference in the webmethod + webmethod.func = method + + routes.append((Route(path=path, methods=[http_method], name=name, endpoint=None), webmethod)) + + apis[api] = routes + + return apis + + +def create_llama_stack_app() -> FastAPI: + """ + Create a FastAPI app that represents the Llama Stack API. + This uses the existing route discovery system to automatically find all routes. + """ + app = FastAPI( + title="Llama Stack API", + description="A comprehensive API for building and deploying AI applications", + version="1.0.0", + servers=[ + {"url": "https://api.llamastack.com", "description": "Production server"}, + {"url": "https://staging-api.llamastack.com", "description": "Staging server"}, + ], + ) + + # Get all API routes using the modified system that includes functions + api_routes = _get_all_api_routes_with_functions() + + # Create FastAPI routes from the discovered routes + for _, routes in api_routes.items(): + for route, webmethod in routes: + # Convert the route to a FastAPI endpoint + _create_fastapi_endpoint(app, route, webmethod) + + return app + + +def _create_fastapi_endpoint(app: FastAPI, route, webmethod): + """ + Create a FastAPI endpoint from a discovered route and webmethod. + This creates endpoints with actual Pydantic models for proper schema generation. + """ + # Extract route information + path = route.path + methods = route.methods + name = route.name + + # Convert path parameters from {param} to {param:path} format for FastAPI + fastapi_path = path.replace("{", "{").replace("}", "}") + + # Try to find actual models for this endpoint + request_model, response_model, query_parameters = _find_models_for_endpoint(webmethod) + + # Extract response description from webmethod docstring (always try this first) + response_description = _extract_response_description_from_docstring(webmethod, response_model) + + # Create endpoint function with proper typing + if request_model and response_model: + # POST/PUT request with request body + async def typed_endpoint(request: request_model) -> response_model: + """Typed endpoint for proper schema generation.""" + return response_model() + + endpoint_func = typed_endpoint + elif response_model and query_parameters: + # Request with individual parameters (could be GET with query params or POST with individual params) + # Create a function with the actual query parameters + def create_query_endpoint_func(): + # Build the function signature dynamically + import inspect + + # Create parameter annotations + param_annotations = {} + param_defaults = {} + + for param_name, param_type, default_value in query_parameters: + # Handle problematic type annotations that cause FastAPI issues + safe_type = _make_type_safe_for_fastapi(param_type) + param_annotations[param_name] = safe_type + if default_value is not None: + param_defaults[param_name] = default_value + + # Create the function signature + sig = inspect.Signature( + [ + inspect.Parameter( + name=param_name, + kind=inspect.Parameter.POSITIONAL_OR_KEYWORD, + default=default_value, + annotation=param_annotations[param_name], + ) + for param_name, param_type, default_value in query_parameters + ] + ) + + async def query_endpoint(**kwargs) -> response_model: + """Query endpoint for proper schema generation.""" + return response_model() + + # Set the signature + query_endpoint.__signature__ = sig + query_endpoint.__annotations__ = param_annotations + return query_endpoint + + endpoint_func = create_query_endpoint_func() + elif response_model: + # Response-only endpoint (no parameters) + async def response_only_endpoint() -> response_model: + """Response-only endpoint for proper schema generation.""" + return response_model() + + endpoint_func = response_only_endpoint + else: + # Fallback to generic endpoint + async def generic_endpoint(*args, **kwargs): + """Generic endpoint - this would be replaced with actual implementation.""" + return {"message": f"Endpoint {name} not implemented in OpenAPI generator"} + + endpoint_func = generic_endpoint + + # Add the endpoint to the FastAPI app + is_deprecated = webmethod.deprecated or False + route_kwargs = { + "name": name, + "tags": [_get_tag_from_api(webmethod)], + "deprecated": is_deprecated, + "responses": { + 200: { + "description": response_description, + "content": { + "application/json": { + "schema": {"$ref": f"#/components/schemas/{response_model.__name__}"} if response_model else {} + } + }, + }, + 400: {"$ref": "#/components/responses/BadRequest400"}, + 429: {"$ref": "#/components/responses/TooManyRequests429"}, + 500: {"$ref": "#/components/responses/InternalServerError500"}, + "default": {"$ref": "#/components/responses/DefaultError"}, + }, + } + + for method in methods: + if method.upper() == "GET": + app.get(fastapi_path, **route_kwargs)(endpoint_func) + elif method.upper() == "POST": + app.post(fastapi_path, **route_kwargs)(endpoint_func) + elif method.upper() == "PUT": + app.put(fastapi_path, **route_kwargs)(endpoint_func) + elif method.upper() == "DELETE": + app.delete(fastapi_path, **route_kwargs)(endpoint_func) + elif method.upper() == "PATCH": + app.patch(fastapi_path, **route_kwargs)(endpoint_func) + + +def _extract_response_description_from_docstring(webmethod, response_model) -> str: + """ + Extract response description from the actual function docstring. + Looks for :returns: in the docstring and uses that as the description. + """ + # Try to get the actual function from the webmethod + # The webmethod should have a reference to the original function + func = getattr(webmethod, "func", None) + if not func: + # If we can't get the function, return a generic description + return "Successful Response" + + # Get the function's docstring + docstring = func.__doc__ or "" + + # Look for :returns: line in the docstring + lines = docstring.split("\n") + for line in lines: + line = line.strip() + if line.startswith(":returns:"): + # Extract the description after :returns: + description = line[9:].strip() # Remove ':returns:' prefix + if description: + return description + + # If no :returns: found, return a generic description + return "Successful Response" + + +def _get_tag_from_api(webmethod) -> str: + """Extract a tag name from the webmethod for API grouping.""" + # Extract API name from the route path + if webmethod.level: + return webmethod.level.replace("/", "").title() + return "API" + + +def _find_models_for_endpoint(webmethod) -> tuple[type | None, type | None, list[tuple[str, type, Any]]]: + """ + Find appropriate request and response models for an endpoint by analyzing the actual function signature. + This uses the webmethod's function to determine the correct models dynamically. + + Returns: + tuple: (request_model, response_model, query_parameters) + where query_parameters is a list of (name, type, default_value) tuples + """ + try: + # Get the actual function from the webmethod + func = getattr(webmethod, "func", None) + if not func: + return None, None, [] + + # Analyze the function signature + sig = inspect.signature(func) + + # Find request model (first parameter that's not 'self') + request_model = None + query_parameters = [] + + for param_name, param in sig.parameters.items(): + if param_name == "self": + continue + + # Check if it's a Pydantic model (for POST/PUT requests) + param_type = param.annotation + if hasattr(param_type, "model_json_schema"): + request_model = param_type + break + elif get_origin(param_type) is Annotated: + # Handle Annotated types - get the base type + args = get_args(param_type) + if args and hasattr(args[0], "model_json_schema"): + request_model = args[0] + break + else: + # This is likely a query parameter for GET requests + # Store the parameter info for later use + default_value = param.default if param.default != inspect.Parameter.empty else None + + # Extract the base type from union types (e.g., str | None -> str) + # Also make it safe for FastAPI to avoid forward reference issues + base_type = _make_type_safe_for_fastapi(param_type) + query_parameters.append((param_name, base_type, default_value)) + + # Find response model from return annotation + response_model = None + return_annotation = sig.return_annotation + if return_annotation != inspect.Signature.empty: + if hasattr(return_annotation, "model_json_schema"): + response_model = return_annotation + elif get_origin(return_annotation) is Annotated: + # Handle Annotated return types + args = get_args(return_annotation) + if args and hasattr(args[0], "model_json_schema"): + response_model = args[0] + elif get_origin(return_annotation) is type(return_annotation): # Union type + # Handle union types - try to find the first Pydantic model + args = get_args(return_annotation) + for arg in args: + if hasattr(arg, "model_json_schema"): + response_model = arg + break + + return request_model, response_model, query_parameters + + except Exception: + # If we can't analyze the function signature, return None + return None, None, [] + + +def _make_type_safe_for_fastapi(type_hint) -> type: + """ + Make a type hint safe for FastAPI by converting problematic types to their base types. + This handles cases like Literal["24h"] that cause forward reference errors. + """ + # Handle Literal types that might cause issues + if hasattr(type_hint, "__origin__") and type_hint.__origin__ is Literal: + args = get_args(type_hint) + if args: + # Get the type of the first literal value + first_arg = args[0] + if isinstance(first_arg, str): + return str + elif isinstance(first_arg, int): + return int + elif isinstance(first_arg, float): + return float + elif isinstance(first_arg, bool): + return bool + else: + return type(first_arg) + + # Handle Union types (Python 3.10+ uses | syntax) + origin = get_origin(type_hint) + + if origin is type(None) or (origin is type and type_hint is type(None)): + # This is just None, return None + return type_hint + + # Handle Union types (both old Union and new | syntax) + if origin is type(type_hint) or (hasattr(type_hint, "__args__") and type_hint.__args__): + # This is a union type, find the non-None type + args = get_args(type_hint) + for arg in args: + if arg is not type(None) and arg is not None: + return arg + # If all args are None, return the first one + return args[0] if args else type_hint + + # Not a union type, return as-is + return type_hint + + +def _generate_schema_for_type(type_hint) -> dict[str, Any]: + """ + Generate a JSON schema for a given type hint. + This is a simplified version that handles basic types. + """ + # Handle Union types (e.g., str | None) + if get_origin(type_hint) is type(None) or (get_origin(type_hint) is type and type_hint is type(None)): + return {"type": "null"} + + # Handle list types + if get_origin(type_hint) is list: + args = get_args(type_hint) + if args: + item_type = args[0] + return {"type": "array", "items": _generate_schema_for_type(item_type)} + return {"type": "array"} + + # Handle basic types + if type_hint is str: + return {"type": "string"} + elif type_hint is int: + return {"type": "integer"} + elif type_hint is float: + return {"type": "number"} + elif type_hint is bool: + return {"type": "boolean"} + elif type_hint is dict: + return {"type": "object"} + elif type_hint is list: + return {"type": "array"} + + # For complex types, try to get the schema from Pydantic + try: + if hasattr(type_hint, "model_json_schema"): + return type_hint.model_json_schema() + elif hasattr(type_hint, "__name__"): + return {"$ref": f"#/components/schemas/{type_hint.__name__}"} + except Exception: + pass + + # Fallback + return {"type": "object"} + + +def _add_llama_stack_extensions(openapi_schema: dict[str, Any], app: FastAPI) -> dict[str, Any]: + """ + Add Llama Stack specific extensions to the OpenAPI schema. + This includes x-llama-stack-extra-body-params for ExtraBodyField parameters. + """ + # Get all API routes to find functions with ExtraBodyField parameters + api_routes = get_all_api_routes() + + for api_name, routes in api_routes.items(): + for route, webmethod in routes: + # Extract path and method + path = route.path + methods = route.methods + + for method in methods: + method_lower = method.lower() + if method_lower in openapi_schema.get("paths", {}).get(path, {}): + operation = openapi_schema["paths"][path][method_lower] + + # Try to find the actual function that implements this route + # and extract its ExtraBodyField parameters + extra_body_params = _find_extra_body_params_for_route(api_name, route, webmethod) + + if extra_body_params: + operation["x-llama-stack-extra-body-params"] = extra_body_params + + return openapi_schema + + +def _find_extra_body_params_for_route(api_name: str, route, webmethod) -> list[dict[str, Any]]: + """ + Find the actual function that implements a route and extract its ExtraBodyField parameters. + """ + try: + # Try to get the actual function from the API protocol map + from llama_stack.core.resolver import api_protocol_map + + # Look up the API implementation + if api_name in api_protocol_map: + _ = api_protocol_map[api_name] + + # Try to find the method that matches this route + # This is a simplified approach - we'd need to map the route to the actual method + # For now, we'll return an empty list to avoid hardcoding + return [] + + return [] + except Exception: + # If we can't find the function, return empty list + return [] + + +def _add_error_responses(openapi_schema: dict[str, Any]) -> dict[str, Any]: + """ + Add standard error response definitions to the OpenAPI schema. + Uses the actual Error model from the codebase for consistency. + """ + if "components" not in openapi_schema: + openapi_schema["components"] = {} + + if "responses" not in openapi_schema["components"]: + openapi_schema["components"]["responses"] = {} + + # Import the actual Error model + try: + from llama_stack.apis.datatypes import Error + + # Generate the Error schema using Pydantic + error_schema = Error.model_json_schema() + + # Ensure the Error schema is in the components/schemas + if "schemas" not in openapi_schema["components"]: + openapi_schema["components"]["schemas"] = {} + + # Only add Error schema if it doesn't already exist + if "Error" not in openapi_schema["components"]["schemas"]: + openapi_schema["components"]["schemas"]["Error"] = error_schema + + except ImportError: + # Fallback if we can't import the Error model + error_schema = {"$ref": "#/components/schemas/Error"} + + # Define standard HTTP error responses + error_responses = { + 400: { + "name": "BadRequest400", + "description": "The request was invalid or malformed", + "example": {"status": 400, "title": "Bad Request", "detail": "The request was invalid or malformed"}, + }, + 429: { + "name": "TooManyRequests429", + "description": "The client has sent too many requests in a given amount of time", + "example": { + "status": 429, + "title": "Too Many Requests", + "detail": "You have exceeded the rate limit. Please try again later.", + }, + }, + 500: { + "name": "InternalServerError500", + "description": "The server encountered an unexpected error", + "example": {"status": 500, "title": "Internal Server Error", "detail": "An unexpected error occurred"}, + }, + } + + # Add each error response to the schema + for _, error_info in error_responses.items(): + response_name = error_info["name"] + openapi_schema["components"]["responses"][response_name] = { + "description": error_info["description"], + "content": { + "application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": error_info["example"]} + }, + } + + # Add a default error response + openapi_schema["components"]["responses"]["DefaultError"] = { + "description": "An error occurred", + "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}, + } + + return openapi_schema + + +def _fix_schema_issues(openapi_schema: dict[str, Any]) -> dict[str, Any]: + """ + Fix common schema issues that cause OpenAPI validation problems. + This includes converting exclusiveMinimum numbers to minimum values. + """ + if "components" not in openapi_schema or "schemas" not in openapi_schema["components"]: + return openapi_schema + + schemas = openapi_schema["components"]["schemas"] + + # Fix exclusiveMinimum issues + for _, schema_def in schemas.items(): + _fix_exclusive_minimum_in_schema(schema_def) + + return openapi_schema + + +def _fix_exclusive_minimum_in_schema(obj: Any) -> None: + """ + Recursively fix exclusiveMinimum issues in a schema object. + Converts exclusiveMinimum numbers to minimum values. + """ + if isinstance(obj, dict): + # Check if this is a schema with exclusiveMinimum + if "exclusiveMinimum" in obj and isinstance(obj["exclusiveMinimum"], int | float): + # Convert exclusiveMinimum number to minimum + obj["minimum"] = obj["exclusiveMinimum"] + del obj["exclusiveMinimum"] + + # Recursively process all values + for value in obj.values(): + _fix_exclusive_minimum_in_schema(value) + + elif isinstance(obj, list): + # Recursively process all items + for item in obj: + _fix_exclusive_minimum_in_schema(item) + + +def _sort_paths_alphabetically(openapi_schema: dict[str, Any]) -> dict[str, Any]: + """ + Sort the paths in the OpenAPI schema by version prefix first, then alphabetically. + Also sort HTTP methods alphabetically within each path. + Version order: v1beta, v1alpha, v1 + """ + if "paths" not in openapi_schema: + return openapi_schema + + def path_sort_key(path: str) -> tuple: + """ + Create a sort key that groups paths by version prefix first. + Returns (version_priority, path) where version_priority: + - 0 for v1beta + - 1 for v1alpha + - 2 for v1 + - 3 for others + """ + if path.startswith("/v1beta/"): + version_priority = 0 + elif path.startswith("/v1alpha/"): + version_priority = 1 + elif path.startswith("/v1/"): + version_priority = 2 + else: + version_priority = 3 + + return (version_priority, path) + + def sort_path_item(path_item: dict[str, Any]) -> dict[str, Any]: + """Sort HTTP methods alphabetically within a path item.""" + if not isinstance(path_item, dict): + return path_item + + # Define the order of HTTP methods + method_order = ["delete", "get", "head", "options", "patch", "post", "put", "trace"] + + # Create a new ordered dict with methods in alphabetical order + sorted_path_item = {} + + # First add methods in the defined order + for method in method_order: + if method in path_item: + sorted_path_item[method] = path_item[method] + + # Then add any other keys that aren't HTTP methods + for key, value in path_item.items(): + if key not in method_order: + sorted_path_item[key] = value + + return sorted_path_item + + # Sort paths by version prefix first, then alphabetically + # Also sort HTTP methods within each path + sorted_paths = {} + for path, path_item in sorted(openapi_schema["paths"].items(), key=lambda x: path_sort_key(x[0])): + sorted_paths[path] = sort_path_item(path_item) + + openapi_schema["paths"] = sorted_paths + + return openapi_schema + + +def _filter_schema_by_version( + openapi_schema: dict[str, Any], stable_only: bool = True, exclude_deprecated: bool = True +) -> dict[str, Any]: + """ + Filter OpenAPI schema by API version. + + Args: + openapi_schema: The full OpenAPI schema + stable_only: If True, return only /v1/ paths (stable). If False, return only /v1alpha/ and /v1beta/ paths (experimental). + exclude_deprecated: If True, exclude deprecated endpoints from the result. + + Returns: + Filtered OpenAPI schema + """ + filtered_schema = openapi_schema.copy() + + if "paths" not in filtered_schema: + return filtered_schema + + # Filter paths based on version prefix and deprecated status + filtered_paths = {} + for path, path_item in filtered_schema["paths"].items(): + # Check if path has any deprecated operations + is_deprecated = _is_path_deprecated(path_item) + + # Skip deprecated endpoints if exclude_deprecated is True + if exclude_deprecated and is_deprecated: + continue + + if stable_only: + # Only include /v1/ paths, exclude /v1alpha/ and /v1beta/ + if path.startswith("/v1/") and not path.startswith("/v1alpha/") and not path.startswith("/v1beta/"): + filtered_paths[path] = path_item + else: + # Only include /v1alpha/ and /v1beta/ paths, exclude /v1/ + if path.startswith("/v1alpha/") or path.startswith("/v1beta/"): + filtered_paths[path] = path_item + + filtered_schema["paths"] = filtered_paths + + # Filter schemas/components to only include ones referenced by filtered paths + if "components" in filtered_schema and "schemas" in filtered_schema["components"]: + # Find all schemas that are actually referenced by the filtered paths + # Use the original schema to find all references, not the filtered one + referenced_schemas = _find_schemas_referenced_by_paths(filtered_paths, openapi_schema) + + # Only keep schemas that are referenced by the filtered paths + filtered_schemas = {} + for schema_name, schema_def in filtered_schema["components"]["schemas"].items(): + if schema_name in referenced_schemas: + filtered_schemas[schema_name] = schema_def + + filtered_schema["components"]["schemas"] = filtered_schemas + + return filtered_schema + + +def _find_schemas_referenced_by_paths(filtered_paths: dict[str, Any], openapi_schema: dict[str, Any]) -> set[str]: + """ + Find all schemas that are referenced by the filtered paths. + This recursively traverses the path definitions to find all $ref references. + """ + referenced_schemas = set() + + # Traverse all filtered paths + for _, path_item in filtered_paths.items(): + if not isinstance(path_item, dict): + continue + + # Check each HTTP method in the path + for method in ["get", "post", "put", "delete", "patch", "head", "options"]: + if method in path_item: + operation = path_item[method] + if isinstance(operation, dict): + # Find all schema references in this operation + referenced_schemas.update(_find_schema_refs_in_object(operation)) + + # Also check the responses section for schema references + if "components" in openapi_schema and "responses" in openapi_schema["components"]: + referenced_schemas.update(_find_schema_refs_in_object(openapi_schema["components"]["responses"])) + + # Also include schemas that are referenced by other schemas (transitive references) + # This ensures we include all dependencies + all_schemas = openapi_schema.get("components", {}).get("schemas", {}) + additional_schemas = set() + + for schema_name in referenced_schemas: + if schema_name in all_schemas: + additional_schemas.update(_find_schema_refs_in_object(all_schemas[schema_name])) + + # Keep adding transitive references until no new ones are found + while additional_schemas: + new_schemas = additional_schemas - referenced_schemas + if not new_schemas: + break + referenced_schemas.update(new_schemas) + additional_schemas = set() + for schema_name in new_schemas: + if schema_name in all_schemas: + additional_schemas.update(_find_schema_refs_in_object(all_schemas[schema_name])) + + return referenced_schemas + + +def _find_schema_refs_in_object(obj: Any) -> set[str]: + """ + Recursively find all schema references ($ref) in an object. + """ + refs = set() + + if isinstance(obj, dict): + for key, value in obj.items(): + if key == "$ref" and isinstance(value, str) and value.startswith("#/components/schemas/"): + schema_name = value.split("/")[-1] + refs.add(schema_name) + else: + refs.update(_find_schema_refs_in_object(value)) + elif isinstance(obj, list): + for item in obj: + refs.update(_find_schema_refs_in_object(item)) + + return refs + + +def _is_path_deprecated(path_item: dict[str, Any]) -> bool: + """ + Check if a path item has any deprecated operations. + """ + if not isinstance(path_item, dict): + return False + + # Check each HTTP method in the path item + for method in ["get", "post", "put", "delete", "patch", "head", "options"]: + if method in path_item: + operation = path_item[method] + if isinstance(operation, dict) and operation.get("deprecated", False): + return True + + return False + + +def _filter_deprecated_schema(openapi_schema: dict[str, Any]) -> dict[str, Any]: + """ + Filter OpenAPI schema to include only deprecated endpoints. + Includes all deprecated endpoints regardless of version (v1, v1alpha, v1beta). + """ + filtered_schema = openapi_schema.copy() + + if "paths" not in filtered_schema: + return filtered_schema + + # Filter paths to only include deprecated ones + filtered_paths = {} + for path, path_item in filtered_schema["paths"].items(): + if _is_path_deprecated(path_item): + filtered_paths[path] = path_item + + filtered_schema["paths"] = filtered_paths + + return filtered_schema + + +def generate_openapi_spec(output_dir: str, format: str = "yaml", include_examples: bool = True) -> dict[str, Any]: + """ + Generate OpenAPI specification using FastAPI's built-in method. + + Args: + output_dir: Directory to save the generated files + format: Output format ("yaml", "json", or "both") + include_examples: Whether to include examples in the spec + + Returns: + The generated OpenAPI specification as a dictionary + """ + # Create the FastAPI app + app = create_llama_stack_app() + + # Generate the OpenAPI schema + openapi_schema = get_openapi( + title=app.title, + version=app.version, + description=app.description, + routes=app.routes, + servers=app.servers, + ) + + # Add Llama Stack specific extensions + openapi_schema = _add_llama_stack_extensions(openapi_schema, app) + + # Add standard error responses + openapi_schema = _add_error_responses(openapi_schema) + + # Ensure all referenced schemas are included + # DISABLED: This was using hardcoded schema generation. FastAPI should handle this automatically. + # openapi_schema = _ensure_referenced_schemas(openapi_schema) + + # Control schema registration based on @json_schema_type decorator + # Temporarily disabled to fix missing schema issues + # openapi_schema = _control_schema_registration(openapi_schema) + + # Fix malformed schemas after all other processing + # DISABLED: This was a hardcoded workaround. Using Pydantic's TypeAdapter instead. + # _fix_malformed_schemas(openapi_schema) + + # Split into stable (v1 only), experimental (v1alpha + v1beta), and deprecated specs + # Each spec needs its own deep copy of the full schema to avoid cross-contamination + import copy + + stable_schema = _filter_schema_by_version(copy.deepcopy(openapi_schema), stable_only=True, exclude_deprecated=True) + experimental_schema = _filter_schema_by_version( + copy.deepcopy(openapi_schema), stable_only=False, exclude_deprecated=True + ) + deprecated_schema = _filter_deprecated_schema(copy.deepcopy(openapi_schema)) + + # Sort paths alphabetically for stable (v1 only) + stable_schema = _sort_paths_alphabetically(stable_schema) + # Sort paths by version prefix for experimental (v1beta, v1alpha) + experimental_schema = _sort_paths_alphabetically(experimental_schema) + # Sort paths by version prefix for deprecated + deprecated_schema = _sort_paths_alphabetically(deprecated_schema) + + # Fix schema issues (like exclusiveMinimum -> minimum) for each spec + stable_schema = _fix_schema_issues(stable_schema) + experimental_schema = _fix_schema_issues(experimental_schema) + deprecated_schema = _fix_schema_issues(deprecated_schema) + + # Add any custom modifications here if needed + if include_examples: + # Add examples to the schema if needed + pass + + # Ensure output directory exists + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Save the stable specification + if format in ["yaml", "both"]: + yaml_path = output_path / "llama-stack-spec.yaml" + with open(yaml_path, "w") as f: + yaml.dump(stable_schema, f, default_flow_style=False, sort_keys=False) + print(f"✅ Generated YAML (stable): {yaml_path}") + + experimental_yaml_path = output_path / "experimental-llama-stack-spec.yaml" + with open(experimental_yaml_path, "w") as f: + yaml.dump(experimental_schema, f, default_flow_style=False, sort_keys=False) + print(f"✅ Generated YAML (experimental): {experimental_yaml_path}") + + deprecated_yaml_path = output_path / "deprecated-llama-stack-spec.yaml" + with open(deprecated_yaml_path, "w") as f: + yaml.dump(deprecated_schema, f, default_flow_style=False, sort_keys=False) + print(f"✅ Generated YAML (deprecated): {deprecated_yaml_path}") + + if format in ["json", "both"]: + json_path = output_path / "llama-stack-spec.json" + with open(json_path, "w") as f: + json.dump(stable_schema, f, indent=2) + print(f"✅ Generated JSON (stable): {json_path}") + + experimental_json_path = output_path / "experimental-llama-stack-spec.json" + with open(experimental_json_path, "w") as f: + json.dump(experimental_schema, f, indent=2) + print(f"✅ Generated JSON (experimental): {experimental_json_path}") + + deprecated_json_path = output_path / "deprecated-llama-stack-spec.json" + with open(deprecated_json_path, "w") as f: + json.dump(deprecated_schema, f, indent=2) + print(f"✅ Generated JSON (deprecated): {deprecated_json_path}") + + # Generate HTML documentation + html_path = output_path / "llama-stack-spec.html" + generate_html_docs(stable_schema, html_path) + print(f"✅ Generated HTML: {html_path}") + + experimental_html_path = output_path / "experimental-llama-stack-spec.html" + generate_html_docs(experimental_schema, experimental_html_path, spec_file="experimental-llama-stack-spec.yaml") + print(f"✅ Generated HTML (experimental): {experimental_html_path}") + + deprecated_html_path = output_path / "deprecated-llama-stack-spec.html" + generate_html_docs(deprecated_schema, deprecated_html_path, spec_file="deprecated-llama-stack-spec.yaml") + print(f"✅ Generated HTML (deprecated): {deprecated_html_path}") + + return stable_schema + + +def generate_html_docs( + openapi_schema: dict[str, Any], output_path: Path, spec_file: str = "llama-stack-spec.yaml" +) -> None: + """Generate HTML documentation using ReDoc.""" + html_template = f""" + + + + Llama Stack API Documentation + + + + + + + + + + + """.strip() + + with open(output_path, "w") as f: + f.write(html_template + "\n") + + +def main(): + """Main entry point for the FastAPI OpenAPI generator.""" + import argparse + + parser = argparse.ArgumentParser(description="Generate OpenAPI specification using FastAPI") + parser.add_argument("output_dir", help="Output directory for generated files") + parser.add_argument("--format", choices=["yaml", "json", "both"], default="yaml", help="Output format") + parser.add_argument("--no-examples", action="store_true", help="Exclude examples from the specification") + + args = parser.parse_args() + + print("🚀 Generating OpenAPI specification using FastAPI...") + print(f"📁 Output directory: {args.output_dir}") + print(f"📄 Format: {args.format}") + + try: + openapi_schema = generate_openapi_spec( + output_dir=args.output_dir, format=args.format, include_examples=not args.no_examples + ) + + print("\n✅ OpenAPI specification generated successfully!") + print(f"📊 Schemas: {len(openapi_schema.get('components', {}).get('schemas', {}))}") + print(f"🛣️ Paths: {len(openapi_schema.get('paths', {}))}") + + # Count operations + operation_count = 0 + for path_info in openapi_schema.get("paths", {}).values(): + for method in ["get", "post", "put", "delete", "patch"]: + if method in path_info: + operation_count += 1 + + print(f"🔧 Operations: {operation_count}") + + except Exception as e: + print(f"❌ Error generating OpenAPI specification: {e}") + raise + + +if __name__ == "__main__": + main() diff --git a/src/llama_stack/apis/vector_io/vector_io.py b/src/llama_stack/apis/vector_io/vector_io.py index cbb16287b8..892dc07113 100644 --- a/src/llama_stack/apis/vector_io/vector_io.py +++ b/src/llama_stack/apis/vector_io/vector_io.py @@ -17,8 +17,7 @@ from llama_stack.apis.vector_stores import VectorStore from llama_stack.apis.version import LLAMA_STACK_API_V1 from llama_stack.core.telemetry.trace_protocol import trace_protocol -from llama_stack.schema_utils import json_schema_type, webmethod -from llama_stack.strong_typing.schema import register_schema +from llama_stack.schema_utils import json_schema_type, register_schema, webmethod @json_schema_type diff --git a/src/llama_stack/core/library_client.py b/src/llama_stack/core/library_client.py index 6203b529e7..7bde7312d4 100644 --- a/src/llama_stack/core/library_client.py +++ b/src/llama_stack/core/library_client.py @@ -33,24 +33,17 @@ from llama_stack.core.build import print_pip_install_help from llama_stack.core.configure import parse_and_maybe_upgrade_config from llama_stack.core.datatypes import BuildConfig, BuildProvider, DistributionSpec -from llama_stack.core.request_headers import ( - PROVIDER_DATA_VAR, - request_provider_data_context, -) +from llama_stack.core.request_headers import PROVIDER_DATA_VAR, request_provider_data_context from llama_stack.core.resolver import ProviderRegistry from llama_stack.core.server.routes import RouteImpls, find_matching_route, initialize_route_impls -from llama_stack.core.stack import ( - Stack, - get_stack_run_config_from_distro, - replace_env_vars, -) +from llama_stack.core.stack import Stack, get_stack_run_config_from_distro, replace_env_vars from llama_stack.core.telemetry import Telemetry from llama_stack.core.telemetry.tracing import CURRENT_TRACE_CONTEXT, end_trace, setup_logger, start_trace from llama_stack.core.utils.config import redact_sensitive_fields from llama_stack.core.utils.context import preserve_contexts_async_generator from llama_stack.core.utils.exec import in_notebook +from llama_stack.core.utils.type_inspection import is_unwrapped_body_param from llama_stack.log import get_logger, setup_logging -from llama_stack.strong_typing.inspection import is_unwrapped_body_param logger = get_logger(name=__name__, category="core") diff --git a/src/llama_stack/core/utils/type_inspection.py b/src/llama_stack/core/utils/type_inspection.py new file mode 100644 index 0000000000..31e7f23289 --- /dev/null +++ b/src/llama_stack/core/utils/type_inspection.py @@ -0,0 +1,45 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +""" +Utility functions for type inspection and parameter handling. +""" + +import inspect +import typing +from typing import Any, get_args, get_origin + +from pydantic import BaseModel +from pydantic.fields import FieldInfo + + +def is_unwrapped_body_param(param_type: Any) -> bool: + """ + Check if a parameter type represents an unwrapped body parameter. + An unwrapped body parameter is an Annotated type with Body(embed=False) + + This is used to determine whether request parameters should be flattened + in OpenAPI specs and client libraries (matching FastAPI's embed=False behavior). + + Args: + param_type: The parameter type annotation to check + + Returns: + True if the parameter should be treated as an unwrapped body parameter + """ + # Check if it's Annotated with Body(embed=False) + if get_origin(param_type) is typing.Annotated: + args = get_args(param_type) + base_type = args[0] + metadata = args[1:] + + # Look for Body annotation with embed=False + # Body() returns a FieldInfo object, so we check for that type and the embed attribute + for item in metadata: + if isinstance(item, FieldInfo) and hasattr(item, "embed") and not item.embed: + return inspect.isclass(base_type) and issubclass(base_type, BaseModel) + + return False diff --git a/src/llama_stack/schema_utils.py b/src/llama_stack/schema_utils.py index 8444d2a340..8760988d40 100644 --- a/src/llama_stack/schema_utils.py +++ b/src/llama_stack/schema_utils.py @@ -8,8 +8,6 @@ from dataclasses import dataclass from typing import Any, TypeVar -from .strong_typing.schema import json_schema_type, register_schema # noqa: F401 - class ExtraBodyField[T]: """ @@ -48,6 +46,47 @@ def __init__(self, description: str | None = None): self.description = description +def json_schema_type(cls): + """ + Decorator to mark a Pydantic model for top-level component registration. + + Models marked with this decorator will be registered as top-level components + in the OpenAPI schema, while unmarked models will be inlined. + + This provides control over schema registration to avoid unnecessary indirection + for simple one-off types while keeping complex reusable types as components. + """ + cls._llama_stack_schema_type = True + return cls + + +# Global registry for registered schemas +_registered_schemas = {} + + +def register_schema(schema_type, name: str | None = None): + """ + Register a schema type for top-level component registration. + + This replicates the behavior of strong_typing's register_schema function. + It's used for union types and other complex types that should appear as + top-level components in the OpenAPI schema. + + Args: + schema_type: The type to register (e.g., union types, Annotated types) + name: Optional name for the schema in the OpenAPI spec. If not provided, + uses the type's __name__ or a generated name. + """ + if name is None: + name = getattr(schema_type, "__name__", f"Anonymous_{id(schema_type)}") + + # Store the registration information in a global registry + # since union types don't allow setting attributes + _registered_schemas[schema_type] = {"name": name, "type": schema_type} + + return schema_type + + @dataclass class WebMethod: level: str | None = None diff --git a/src/llama_stack/strong_typing/__init__.py b/src/llama_stack/strong_typing/__init__.py deleted file mode 100644 index d832dcf6f8..0000000000 --- a/src/llama_stack/strong_typing/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -""" -Type-safe data interchange for Python data classes. - -Provides auxiliary services for working with Python type annotations, converting typed data to and from JSON, -and generating a JSON schema for a complex type. -""" - -__version__ = "0.3.4" -__author__ = "Levente Hunyadi" -__copyright__ = "Copyright 2021-2024, Levente Hunyadi" -__license__ = "MIT" -__maintainer__ = "Levente Hunyadi" -__status__ = "Production" diff --git a/src/llama_stack/strong_typing/auxiliary.py b/src/llama_stack/strong_typing/auxiliary.py deleted file mode 100644 index eb067b38b3..0000000000 --- a/src/llama_stack/strong_typing/auxiliary.py +++ /dev/null @@ -1,229 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -""" -Type-safe data interchange for Python data classes. - -:see: https://github.com/hunyadi/strong_typing -""" - -import dataclasses -import sys -from collections.abc import Callable -from dataclasses import is_dataclass -from typing import TypeVar, overload - -if sys.version_info >= (3, 9): - from typing import Annotated as Annotated -else: - from typing import Annotated as Annotated - -if sys.version_info >= (3, 10): - from typing import TypeAlias as TypeAlias -else: - from typing import TypeAlias as TypeAlias - -if sys.version_info >= (3, 11): - from typing import dataclass_transform as dataclass_transform -else: - from typing import dataclass_transform as dataclass_transform - -T = TypeVar("T") - - -def _compact_dataclass_repr(obj: object) -> str: - """ - Compact data-class representation where positional arguments are used instead of keyword arguments. - - :param obj: A data-class object. - :returns: A string that matches the pattern `Class(arg1, arg2, ...)`. - """ - - if is_dataclass(obj): - arglist = ", ".join(repr(getattr(obj, field.name)) for field in dataclasses.fields(obj)) - return f"{obj.__class__.__name__}({arglist})" - else: - return obj.__class__.__name__ - - -class CompactDataClass: - "A data class whose repr() uses positional rather than keyword arguments." - - def __repr__(self) -> str: - return _compact_dataclass_repr(self) - - -@overload -def typeannotation(cls: type[T], /) -> type[T]: ... - - -@overload -def typeannotation(cls: None, *, eq: bool = True, order: bool = False) -> Callable[[type[T]], type[T]]: ... - - -@dataclass_transform(eq_default=True, order_default=False) -def typeannotation( - cls: type[T] | None = None, *, eq: bool = True, order: bool = False -) -> type[T] | Callable[[type[T]], type[T]]: - """ - Returns the same class as was passed in, with dunder methods added based on the fields defined in the class. - - :param cls: The data-class type to transform into a type annotation. - :param eq: Whether to generate functions to support equality comparison. - :param order: Whether to generate functions to support ordering. - :returns: A data-class type, or a wrapper for data-class types. - """ - - def wrap(cls: type[T]) -> type[T]: - # mypy fails to equate bound-y functions (first argument interpreted as - # the bound object) with class methods, hence the `ignore` directive. - cls.__repr__ = _compact_dataclass_repr # type: ignore[method-assign] - if not dataclasses.is_dataclass(cls): - cls = dataclasses.dataclass( # type: ignore[call-overload] - cls, - init=True, - repr=False, - eq=eq, - order=order, - unsafe_hash=False, - frozen=True, - ) - return cls - - # see if decorator is used as @typeannotation or @typeannotation() - if cls is None: - # called with parentheses - return wrap - else: - # called without parentheses - return wrap(cls) - - -@typeannotation -class Alias: - "Alternative name of a property, typically used in JSON serialization." - - name: str - - -@typeannotation -class Signed: - "Signedness of an integer type." - - is_signed: bool - - -@typeannotation -class Storage: - "Number of bytes the binary representation of an integer type takes, e.g. 4 bytes for an int32." - - bytes: int - - -@typeannotation -class IntegerRange: - "Minimum and maximum value of an integer. The range is inclusive." - - minimum: int - maximum: int - - -@typeannotation -class Precision: - "Precision of a floating-point value." - - significant_digits: int - decimal_digits: int = 0 - - @property - def integer_digits(self) -> int: - return self.significant_digits - self.decimal_digits - - -@typeannotation -class TimePrecision: - """ - Precision of a timestamp or time interval. - - :param decimal_digits: Number of fractional digits retained in the sub-seconds field for a timestamp. - """ - - decimal_digits: int = 0 - - -@typeannotation -class Length: - "Exact length of a string." - - value: int - - -@typeannotation -class MinLength: - "Minimum length of a string." - - value: int - - -@typeannotation -class MaxLength: - "Maximum length of a string." - - value: int - - -@typeannotation -class SpecialConversion: - "Indicates that the annotated type is subject to custom conversion rules." - - -int8: TypeAlias = Annotated[int, Signed(True), Storage(1), IntegerRange(-128, 127)] -int16: TypeAlias = Annotated[int, Signed(True), Storage(2), IntegerRange(-32768, 32767)] -int32: TypeAlias = Annotated[ - int, - Signed(True), - Storage(4), - IntegerRange(-2147483648, 2147483647), -] -int64: TypeAlias = Annotated[ - int, - Signed(True), - Storage(8), - IntegerRange(-9223372036854775808, 9223372036854775807), -] - -uint8: TypeAlias = Annotated[int, Signed(False), Storage(1), IntegerRange(0, 255)] -uint16: TypeAlias = Annotated[int, Signed(False), Storage(2), IntegerRange(0, 65535)] -uint32: TypeAlias = Annotated[ - int, - Signed(False), - Storage(4), - IntegerRange(0, 4294967295), -] -uint64: TypeAlias = Annotated[ - int, - Signed(False), - Storage(8), - IntegerRange(0, 18446744073709551615), -] - -float32: TypeAlias = Annotated[float, Storage(4)] -float64: TypeAlias = Annotated[float, Storage(8)] - -# maps globals of type Annotated[T, ...] defined in this module to their string names -_auxiliary_types: dict[object, str] = {} -module = sys.modules[__name__] -for var in dir(module): - typ = getattr(module, var) - if getattr(typ, "__metadata__", None) is not None: - # type is Annotated[T, ...] - _auxiliary_types[typ] = var - - -def get_auxiliary_format(data_type: object) -> str | None: - "Returns the JSON format string corresponding to an auxiliary type." - - return _auxiliary_types.get(data_type) diff --git a/src/llama_stack/strong_typing/classdef.py b/src/llama_stack/strong_typing/classdef.py deleted file mode 100644 index e54e3a9d68..0000000000 --- a/src/llama_stack/strong_typing/classdef.py +++ /dev/null @@ -1,440 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -import copy -import dataclasses -import datetime -import decimal -import enum -import ipaddress -import math -import re -import sys -import types -import typing -import uuid -from dataclasses import dataclass -from typing import Any, Literal, TypeVar, Union - -from .auxiliary import ( - Alias, - Annotated, - MaxLength, - Precision, - float32, - float64, - int16, - int32, - int64, -) -from .core import JsonType, Schema -from .docstring import Docstring, DocstringParam -from .inspection import TypeLike -from .serialization import json_to_object, object_to_json - -T = TypeVar("T") - - -@dataclass -class JsonSchemaNode: - title: str | None - description: str | None - - -@dataclass -class JsonSchemaType(JsonSchemaNode): - type: str - format: str | None - - -@dataclass -class JsonSchemaBoolean(JsonSchemaType): - type: Literal["boolean"] - const: bool | None - default: bool | None - examples: list[bool] | None - - -@dataclass -class JsonSchemaInteger(JsonSchemaType): - type: Literal["integer"] - const: int | None - default: int | None - examples: list[int] | None - enum: list[int] | None - minimum: int | None - maximum: int | None - - -@dataclass -class JsonSchemaNumber(JsonSchemaType): - type: Literal["number"] - const: float | None - default: float | None - examples: list[float] | None - minimum: float | None - maximum: float | None - exclusiveMinimum: float | None - exclusiveMaximum: float | None - multipleOf: float | None - - -@dataclass -class JsonSchemaString(JsonSchemaType): - type: Literal["string"] - const: str | None - default: str | None - examples: list[str] | None - enum: list[str] | None - minLength: int | None - maxLength: int | None - - -@dataclass -class JsonSchemaArray(JsonSchemaType): - type: Literal["array"] - items: "JsonSchemaAny" - - -@dataclass -class JsonSchemaObject(JsonSchemaType): - type: Literal["object"] - properties: dict[str, "JsonSchemaAny"] | None - additionalProperties: bool | None - required: list[str] | None - - -@dataclass -class JsonSchemaRef(JsonSchemaNode): - ref: Annotated[str, Alias("$ref")] - - -@dataclass -class JsonSchemaAllOf(JsonSchemaNode): - allOf: list["JsonSchemaAny"] - - -@dataclass -class JsonSchemaAnyOf(JsonSchemaNode): - anyOf: list["JsonSchemaAny"] - - -@dataclass -class Discriminator: - propertyName: str - mapping: dict[str, str] - - -@dataclass -class JsonSchemaOneOf(JsonSchemaNode): - oneOf: list["JsonSchemaAny"] - discriminator: Discriminator | None - - -JsonSchemaAny = Union[ - JsonSchemaRef, - JsonSchemaBoolean, - JsonSchemaInteger, - JsonSchemaNumber, - JsonSchemaString, - JsonSchemaArray, - JsonSchemaObject, - JsonSchemaOneOf, -] - - -@dataclass -class JsonSchemaTopLevelObject(JsonSchemaObject): - schema: Annotated[str, Alias("$schema")] - definitions: dict[str, JsonSchemaAny] | None - - -def integer_range_to_type(min_value: float, max_value: float) -> type: - if min_value >= -(2**15) and max_value < 2**15: - return int16 - elif min_value >= -(2**31) and max_value < 2**31: - return int32 - else: - return int64 - - -def enum_safe_name(name: str) -> str: - name = re.sub(r"\W", "_", name) - is_dunder = name.startswith("__") - is_sunder = name.startswith("_") and name.endswith("_") - if is_dunder or is_sunder: # provide an alternative for dunder and sunder names - name = f"v{name}" - return name - - -def enum_values_to_type( - module: types.ModuleType, - name: str, - values: dict[str, Any], - title: str | None = None, - description: str | None = None, -) -> type[enum.Enum]: - enum_class: type[enum.Enum] = enum.Enum(name, values) # type: ignore - - # assign the newly created type to the same module where the defining class is - enum_class.__module__ = module.__name__ - enum_class.__doc__ = str(Docstring(short_description=title, long_description=description)) - setattr(module, name, enum_class) - - return enum.unique(enum_class) - - -def schema_to_type(schema: Schema, *, module: types.ModuleType, class_name: str) -> TypeLike: - """ - Creates a Python type from a JSON schema. - - :param schema: The JSON schema that the types would correspond to. - :param module: The module in which to create the new types. - :param class_name: The name assigned to the top-level class. - """ - - top_node = typing.cast(JsonSchemaTopLevelObject, json_to_object(JsonSchemaTopLevelObject, schema)) - if top_node.definitions is not None: - for type_name, type_node in top_node.definitions.items(): - type_def = node_to_typedef(module, type_name, type_node) - if type_def.default is not dataclasses.MISSING: - raise TypeError("disallowed: `default` for top-level type definitions") - - type_def.type.__module__ = module.__name__ - setattr(module, type_name, type_def.type) - - return node_to_typedef(module, class_name, top_node).type - - -@dataclass -class TypeDef: - type: TypeLike - default: Any = dataclasses.MISSING - - -def json_to_value(target_type: TypeLike, data: JsonType) -> Any: - if data is not None: - return json_to_object(target_type, data) - else: - return dataclasses.MISSING - - -def node_to_typedef(module: types.ModuleType, context: str, node: JsonSchemaNode) -> TypeDef: - if isinstance(node, JsonSchemaRef): - match_obj = re.match(r"^#/definitions/(\w+)$", node.ref) - if not match_obj: - raise ValueError(f"invalid reference: {node.ref}") - - type_name = match_obj.group(1) - return TypeDef(getattr(module, type_name), dataclasses.MISSING) - - elif isinstance(node, JsonSchemaBoolean): - if node.const is not None: - return TypeDef(Literal[node.const], dataclasses.MISSING) - - default = json_to_value(bool, node.default) - return TypeDef(bool, default) - - elif isinstance(node, JsonSchemaInteger): - if node.const is not None: - return TypeDef(Literal[node.const], dataclasses.MISSING) - - integer_type: TypeLike - if node.format == "int16": - integer_type = int16 - elif node.format == "int32": - integer_type = int32 - elif node.format == "int64": - integer_type = int64 - else: - if node.enum is not None: - integer_type = integer_range_to_type(min(node.enum), max(node.enum)) - elif node.minimum is not None and node.maximum is not None: - integer_type = integer_range_to_type(node.minimum, node.maximum) - else: - integer_type = int - - default = json_to_value(integer_type, node.default) - return TypeDef(integer_type, default) - - elif isinstance(node, JsonSchemaNumber): - if node.const is not None: - return TypeDef(Literal[node.const], dataclasses.MISSING) - - number_type: TypeLike - if node.format == "float32": - number_type = float32 - elif node.format == "float64": - number_type = float64 - else: - if ( - node.exclusiveMinimum is not None - and node.exclusiveMaximum is not None - and node.exclusiveMinimum == -node.exclusiveMaximum - ): - integer_digits = round(math.log10(node.exclusiveMaximum)) - else: - integer_digits = None - - if node.multipleOf is not None: - decimal_digits = -round(math.log10(node.multipleOf)) - else: - decimal_digits = None - - if integer_digits is not None and decimal_digits is not None: - number_type = Annotated[ - decimal.Decimal, - Precision(integer_digits + decimal_digits, decimal_digits), - ] - else: - number_type = float - - default = json_to_value(number_type, node.default) - return TypeDef(number_type, default) - - elif isinstance(node, JsonSchemaString): - if node.const is not None: - return TypeDef(Literal[node.const], dataclasses.MISSING) - - string_type: TypeLike - if node.format == "date-time": - string_type = datetime.datetime - elif node.format == "uuid": - string_type = uuid.UUID - elif node.format == "ipv4": - string_type = ipaddress.IPv4Address - elif node.format == "ipv6": - string_type = ipaddress.IPv6Address - - elif node.enum is not None: - string_type = enum_values_to_type( - module, - context, - {enum_safe_name(e): e for e in node.enum}, - title=node.title, - description=node.description, - ) - - elif node.maxLength is not None: - string_type = Annotated[str, MaxLength(node.maxLength)] - else: - string_type = str - - default = json_to_value(string_type, node.default) - return TypeDef(string_type, default) - - elif isinstance(node, JsonSchemaArray): - type_def = node_to_typedef(module, context, node.items) - if type_def.default is not dataclasses.MISSING: - raise TypeError("disallowed: `default` for array element type") - list_type = list[(type_def.type,)] # type: ignore - return TypeDef(list_type, dataclasses.MISSING) - - elif isinstance(node, JsonSchemaObject): - if node.properties is None: - return TypeDef(JsonType, dataclasses.MISSING) - - if node.additionalProperties is None or node.additionalProperties is not False: - raise TypeError("expected: `additionalProperties` equals `false`") - - required = node.required if node.required is not None else [] - - class_name = context - - fields: list[tuple[str, Any, dataclasses.Field]] = [] - params: dict[str, DocstringParam] = {} - for prop_name, prop_node in node.properties.items(): - type_def = node_to_typedef(module, f"{class_name}__{prop_name}", prop_node) - if prop_name in required: - prop_type = type_def.type - else: - prop_type = Union[(None, type_def.type)] - fields.append((prop_name, prop_type, dataclasses.field(default=type_def.default))) - prop_desc = prop_node.title or prop_node.description - if prop_desc is not None: - params[prop_name] = DocstringParam(prop_name, prop_desc) - - fields.sort(key=lambda t: t[2].default is not dataclasses.MISSING) - if sys.version_info >= (3, 12): - class_type = dataclasses.make_dataclass(class_name, fields, module=module.__name__) - else: - class_type = dataclasses.make_dataclass(class_name, fields, namespace={"__module__": module.__name__}) - class_type.__doc__ = str( - Docstring( - short_description=node.title, - long_description=node.description, - params=params, - ) - ) - setattr(module, class_name, class_type) - return TypeDef(class_type, dataclasses.MISSING) - - elif isinstance(node, JsonSchemaOneOf): - union_defs = tuple(node_to_typedef(module, context, n) for n in node.oneOf) - if any(d.default is not dataclasses.MISSING for d in union_defs): - raise TypeError("disallowed: `default` for union member type") - union_types = tuple(d.type for d in union_defs) - return TypeDef(Union[union_types], dataclasses.MISSING) - - raise NotImplementedError() - - -@dataclass -class SchemaFlatteningOptions: - qualified_names: bool = False - recursive: bool = False - - -def flatten_schema(schema: Schema, *, options: SchemaFlatteningOptions | None = None) -> Schema: - top_node = typing.cast(JsonSchemaTopLevelObject, json_to_object(JsonSchemaTopLevelObject, schema)) - flattener = SchemaFlattener(options) - obj = flattener.flatten(top_node) - return typing.cast(Schema, object_to_json(obj)) - - -class SchemaFlattener: - options: SchemaFlatteningOptions - - def __init__(self, options: SchemaFlatteningOptions | None = None) -> None: - self.options = options or SchemaFlatteningOptions() - - def flatten(self, source_node: JsonSchemaObject) -> JsonSchemaObject: - if source_node.type != "object": - return source_node - - source_props = source_node.properties or {} - target_props: dict[str, JsonSchemaAny] = {} - - source_reqs = source_node.required or [] - target_reqs: list[str] = [] - - for name, prop in source_props.items(): - if not isinstance(prop, JsonSchemaObject): - target_props[name] = prop - if name in source_reqs: - target_reqs.append(name) - continue - - if self.options.recursive: - obj = self.flatten(prop) - else: - obj = prop - if obj.properties is not None: - if self.options.qualified_names: - target_props.update((f"{name}.{n}", p) for n, p in obj.properties.items()) - else: - target_props.update(obj.properties.items()) - if obj.required is not None: - if self.options.qualified_names: - target_reqs.extend(f"{name}.{n}" for n in obj.required) - else: - target_reqs.extend(obj.required) - - target_node = copy.copy(source_node) - target_node.properties = target_props or None - target_node.additionalProperties = False - target_node.required = target_reqs or None - return target_node diff --git a/src/llama_stack/strong_typing/core.py b/src/llama_stack/strong_typing/core.py deleted file mode 100644 index 5f3764aeb2..0000000000 --- a/src/llama_stack/strong_typing/core.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -""" -Type-safe data interchange for Python data classes. - -:see: https://github.com/hunyadi/strong_typing -""" - -from typing import Union - - -class JsonObject: - "Placeholder type for an unrestricted JSON object." - - -class JsonArray: - "Placeholder type for an unrestricted JSON array." - - -# a JSON type with possible `null` values -JsonType = Union[ - None, - bool, - int, - float, - str, - dict[str, "JsonType"], - list["JsonType"], -] - -# a JSON type that cannot contain `null` values -StrictJsonType = Union[ - bool, - int, - float, - str, - dict[str, "StrictJsonType"], - list["StrictJsonType"], -] - -# a meta-type that captures the object type in a JSON schema -Schema = dict[str, JsonType] diff --git a/src/llama_stack/strong_typing/deserializer.py b/src/llama_stack/strong_typing/deserializer.py deleted file mode 100644 index 58dfe53a46..0000000000 --- a/src/llama_stack/strong_typing/deserializer.py +++ /dev/null @@ -1,872 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -""" -Type-safe data interchange for Python data classes. - -:see: https://github.com/hunyadi/strong_typing -""" - -import abc -import base64 -import dataclasses -import datetime -import enum -import inspect -import ipaddress -import sys -import typing -import uuid -from collections.abc import Callable -from types import ModuleType -from typing import ( - Any, - Generic, - Literal, - NamedTuple, - Optional, - TypeVar, - Union, -) - -from .core import JsonType -from .exception import JsonKeyError, JsonTypeError, JsonValueError -from .inspection import ( - TypeLike, - create_object, - enum_value_types, - evaluate_type, - get_class_properties, - get_class_property, - get_resolved_hints, - is_dataclass_instance, - is_dataclass_type, - is_named_tuple_type, - is_type_annotated, - is_type_literal, - is_type_optional, - unwrap_annotated_type, - unwrap_literal_values, - unwrap_optional_type, -) -from .mapping import python_field_to_json_property -from .name import python_type_to_str - -E = TypeVar("E", bound=enum.Enum) -T = TypeVar("T") -R = TypeVar("R") -K = TypeVar("K") -V = TypeVar("V") - - -class Deserializer(abc.ABC, Generic[T]): - "Parses a JSON value into a Python type." - - def build(self, context: ModuleType | None) -> None: - """ - Creates auxiliary parsers that this parser is depending on. - - :param context: A module context for evaluating types specified as a string. - """ - - @abc.abstractmethod - def parse(self, data: JsonType) -> T: - """ - Parses a JSON value into a Python type. - - :param data: The JSON value to de-serialize. - :returns: The Python object that the JSON value de-serializes to. - """ - - -class NoneDeserializer(Deserializer[None]): - "Parses JSON `null` values into Python `None`." - - def parse(self, data: JsonType) -> None: - if data is not None: - raise JsonTypeError(f"`None` type expects JSON `null` but instead received: {data}") - return None - - -class BoolDeserializer(Deserializer[bool]): - "Parses JSON `boolean` values into Python `bool` type." - - def parse(self, data: JsonType) -> bool: - if not isinstance(data, bool): - raise JsonTypeError(f"`bool` type expects JSON `boolean` data but instead received: {data}") - return bool(data) - - -class IntDeserializer(Deserializer[int]): - "Parses JSON `number` values into Python `int` type." - - def parse(self, data: JsonType) -> int: - if not isinstance(data, int): - raise JsonTypeError(f"`int` type expects integer data as JSON `number` but instead received: {data}") - return int(data) - - -class FloatDeserializer(Deserializer[float]): - "Parses JSON `number` values into Python `float` type." - - def parse(self, data: JsonType) -> float: - if not isinstance(data, float) and not isinstance(data, int): - raise JsonTypeError(f"`int` type expects data as JSON `number` but instead received: {data}") - return float(data) - - -class StringDeserializer(Deserializer[str]): - "Parses JSON `string` values into Python `str` type." - - def parse(self, data: JsonType) -> str: - if not isinstance(data, str): - raise JsonTypeError(f"`str` type expects JSON `string` data but instead received: {data}") - return str(data) - - -class BytesDeserializer(Deserializer[bytes]): - "Parses JSON `string` values of Base64-encoded strings into Python `bytes` type." - - def parse(self, data: JsonType) -> bytes: - if not isinstance(data, str): - raise JsonTypeError(f"`bytes` type expects JSON `string` data but instead received: {data}") - return base64.b64decode(data, validate=True) - - -class DateTimeDeserializer(Deserializer[datetime.datetime]): - "Parses JSON `string` values representing timestamps in ISO 8601 format to Python `datetime` with time zone." - - def parse(self, data: JsonType) -> datetime.datetime: - if not isinstance(data, str): - raise JsonTypeError(f"`datetime` type expects JSON `string` data but instead received: {data}") - - if data.endswith("Z"): - data = f"{data[:-1]}+00:00" # Python's isoformat() does not support military time zones like "Zulu" for UTC - timestamp = datetime.datetime.fromisoformat(data) - if timestamp.tzinfo is None: - raise JsonValueError(f"timestamp lacks explicit time zone designator: {data}") - return timestamp - - -class DateDeserializer(Deserializer[datetime.date]): - "Parses JSON `string` values representing dates in ISO 8601 format to Python `date` type." - - def parse(self, data: JsonType) -> datetime.date: - if not isinstance(data, str): - raise JsonTypeError(f"`date` type expects JSON `string` data but instead received: {data}") - - return datetime.date.fromisoformat(data) - - -class TimeDeserializer(Deserializer[datetime.time]): - "Parses JSON `string` values representing time instances in ISO 8601 format to Python `time` type with time zone." - - def parse(self, data: JsonType) -> datetime.time: - if not isinstance(data, str): - raise JsonTypeError(f"`time` type expects JSON `string` data but instead received: {data}") - - return datetime.time.fromisoformat(data) - - -class UUIDDeserializer(Deserializer[uuid.UUID]): - "Parses JSON `string` values of UUID strings into Python `uuid.UUID` type." - - def parse(self, data: JsonType) -> uuid.UUID: - if not isinstance(data, str): - raise JsonTypeError(f"`UUID` type expects JSON `string` data but instead received: {data}") - return uuid.UUID(data) - - -class IPv4Deserializer(Deserializer[ipaddress.IPv4Address]): - "Parses JSON `string` values of IPv4 address strings into Python `ipaddress.IPv4Address` type." - - def parse(self, data: JsonType) -> ipaddress.IPv4Address: - if not isinstance(data, str): - raise JsonTypeError(f"`IPv4Address` type expects JSON `string` data but instead received: {data}") - return ipaddress.IPv4Address(data) - - -class IPv6Deserializer(Deserializer[ipaddress.IPv6Address]): - "Parses JSON `string` values of IPv6 address strings into Python `ipaddress.IPv6Address` type." - - def parse(self, data: JsonType) -> ipaddress.IPv6Address: - if not isinstance(data, str): - raise JsonTypeError(f"`IPv6Address` type expects JSON `string` data but instead received: {data}") - return ipaddress.IPv6Address(data) - - -class ListDeserializer(Deserializer[list[T]]): - "Recursively de-serializes a JSON array into a Python `list`." - - item_type: type[T] - item_parser: Deserializer - - def __init__(self, item_type: type[T]) -> None: - self.item_type = item_type - - def build(self, context: ModuleType | None) -> None: - self.item_parser = _get_deserializer(self.item_type, context) - - def parse(self, data: JsonType) -> list[T]: - if not isinstance(data, list): - type_name = python_type_to_str(self.item_type) - raise JsonTypeError(f"type `List[{type_name}]` expects JSON `array` data but instead received: {data}") - - return [self.item_parser.parse(item) for item in data] - - -class DictDeserializer(Deserializer[dict[K, V]]): - "Recursively de-serializes a JSON object into a Python `dict`." - - key_type: type[K] - value_type: type[V] - value_parser: Deserializer[V] - - def __init__(self, key_type: type[K], value_type: type[V]) -> None: - self.key_type = key_type - self.value_type = value_type - self._check_key_type() - - def build(self, context: ModuleType | None) -> None: - self.value_parser = _get_deserializer(self.value_type, context) - - def _check_key_type(self) -> None: - if self.key_type is str: - return - - if issubclass(self.key_type, enum.Enum): - value_types = enum_value_types(self.key_type) - if len(value_types) != 1: - raise JsonTypeError( - f"type `{self.container_type}` has invalid key type, " - f"enumerations must have a consistent member value type but several types found: {value_types}" - ) - value_type = value_types.pop() - if value_type is not str: - f"`type `{self.container_type}` has invalid enumeration key type, expected `enum.Enum` with string values" - return - - raise JsonTypeError( - f"`type `{self.container_type}` has invalid key type, expected `str` or `enum.Enum` with string values" - ) - - @property - def container_type(self) -> str: - key_type_name = python_type_to_str(self.key_type) - value_type_name = python_type_to_str(self.value_type) - return f"Dict[{key_type_name}, {value_type_name}]" - - def parse(self, data: JsonType) -> dict[K, V]: - if not isinstance(data, dict): - raise JsonTypeError( - f"`type `{self.container_type}` expects JSON `object` data but instead received: {data}" - ) - - return dict( - (self.key_type(key), self.value_parser.parse(value)) # type: ignore[call-arg] - for key, value in data.items() - ) - - -class SetDeserializer(Deserializer[set[T]]): - "Recursively de-serializes a JSON list into a Python `set`." - - member_type: type[T] - member_parser: Deserializer - - def __init__(self, member_type: type[T]) -> None: - self.member_type = member_type - - def build(self, context: ModuleType | None) -> None: - self.member_parser = _get_deserializer(self.member_type, context) - - def parse(self, data: JsonType) -> set[T]: - if not isinstance(data, list): - type_name = python_type_to_str(self.member_type) - raise JsonTypeError(f"type `Set[{type_name}]` expects JSON `array` data but instead received: {data}") - - return set(self.member_parser.parse(item) for item in data) - - -class TupleDeserializer(Deserializer[tuple[Any, ...]]): - "Recursively de-serializes a JSON list into a Python `tuple`." - - item_types: tuple[type[Any], ...] - item_parsers: tuple[Deserializer[Any], ...] - - def __init__(self, item_types: tuple[type[Any], ...]) -> None: - self.item_types = item_types - - def build(self, context: ModuleType | None) -> None: - self.item_parsers = tuple(_get_deserializer(item_type, context) for item_type in self.item_types) - - @property - def container_type(self) -> str: - type_names = ", ".join(python_type_to_str(item_type) for item_type in self.item_types) - return f"Tuple[{type_names}]" - - def parse(self, data: JsonType) -> tuple[Any, ...]: - if not isinstance(data, list) or len(data) != len(self.item_parsers): - if not isinstance(data, list): - raise JsonTypeError( - f"type `{self.container_type}` expects JSON `array` data but instead received: {data}" - ) - else: - count = len(self.item_parsers) - raise JsonValueError( - f"type `{self.container_type}` expects a JSON `array` of length {count} but received length {len(data)}" - ) - - return tuple(item_parser.parse(item) for item_parser, item in zip(self.item_parsers, data, strict=False)) - - -class UnionDeserializer(Deserializer): - "De-serializes a JSON value (of any type) into a Python union type." - - member_types: tuple[type, ...] - member_parsers: tuple[Deserializer, ...] - - def __init__(self, member_types: tuple[type, ...]) -> None: - self.member_types = member_types - - def build(self, context: ModuleType | None) -> None: - self.member_parsers = tuple(_get_deserializer(member_type, context) for member_type in self.member_types) - - def parse(self, data: JsonType) -> Any: - for member_parser in self.member_parsers: - # iterate over potential types of discriminated union - try: - return member_parser.parse(data) - except (JsonKeyError, JsonTypeError): - # indicates a required field is missing from JSON dict -OR- the data cannot be cast to the expected type, - # i.e. we don't have the type that we are looking for - continue - - type_names = ", ".join(python_type_to_str(member_type) for member_type in self.member_types) - raise JsonKeyError(f"type `Union[{type_names}]` could not be instantiated from: {data}") - - -def get_literal_properties(typ: type) -> set[str]: - "Returns the names of all properties in a class that are of a literal type." - - return set( - property_name for property_name, property_type in get_class_properties(typ) if is_type_literal(property_type) - ) - - -def get_discriminating_properties(types: tuple[type, ...]) -> set[str]: - "Returns a set of properties with literal type that are common across all specified classes." - - if not types or not all(isinstance(typ, type) for typ in types): - return set() - - props = get_literal_properties(types[0]) - for typ in types[1:]: - props = props & get_literal_properties(typ) - - return props - - -class TaggedUnionDeserializer(Deserializer): - "De-serializes a JSON value with one or more disambiguating properties into a Python union type." - - member_types: tuple[type, ...] - disambiguating_properties: set[str] - member_parsers: dict[tuple[str, Any], Deserializer] - - def __init__(self, member_types: tuple[type, ...]) -> None: - self.member_types = member_types - self.disambiguating_properties = get_discriminating_properties(member_types) - - def build(self, context: ModuleType | None) -> None: - self.member_parsers = {} - for member_type in self.member_types: - for property_name in self.disambiguating_properties: - literal_type = get_class_property(member_type, property_name) - if not literal_type: - continue - - for literal_value in unwrap_literal_values(literal_type): - tpl = (property_name, literal_value) - if tpl in self.member_parsers: - raise JsonTypeError( - f"disambiguating property `{property_name}` in type `{self.union_type}` has a duplicate value: {literal_value}" - ) - - self.member_parsers[tpl] = _get_deserializer(member_type, context) - - @property - def union_type(self) -> str: - type_names = ", ".join(python_type_to_str(member_type) for member_type in self.member_types) - return f"Union[{type_names}]" - - def parse(self, data: JsonType) -> Any: - if not isinstance(data, dict): - raise JsonTypeError( - f"tagged union type `{self.union_type}` expects JSON `object` data but instead received: {data}" - ) - - for property_name in self.disambiguating_properties: - disambiguating_value = data.get(property_name) - if disambiguating_value is None: - continue - - member_parser = self.member_parsers.get((property_name, disambiguating_value)) - if member_parser is None: - raise JsonTypeError( - f"disambiguating property value is invalid for tagged union type `{self.union_type}`: {data}" - ) - - return member_parser.parse(data) - - raise JsonTypeError( - f"disambiguating property value is missing for tagged union type `{self.union_type}`: {data}" - ) - - -class LiteralDeserializer(Deserializer): - "De-serializes a JSON value into a Python literal type." - - values: tuple[Any, ...] - parser: Deserializer - - def __init__(self, values: tuple[Any, ...]) -> None: - self.values = values - - def build(self, context: ModuleType | None) -> None: - literal_type_tuple = tuple(type(value) for value in self.values) - literal_type_set = set(literal_type_tuple) - if len(literal_type_set) != 1: - value_names = ", ".join(repr(value) for value in self.values) - raise TypeError( - f"type `Literal[{value_names}]` expects consistent literal value types but got: {literal_type_tuple}" - ) - - literal_type = literal_type_set.pop() - self.parser = _get_deserializer(literal_type, context) - - def parse(self, data: JsonType) -> Any: - value = self.parser.parse(data) - if value not in self.values: - value_names = ", ".join(repr(value) for value in self.values) - raise JsonTypeError(f"type `Literal[{value_names}]` could not be instantiated from: {data}") - return value - - -class EnumDeserializer(Deserializer[E]): - "Returns an enumeration instance based on the enumeration value read from a JSON value." - - enum_type: type[E] - - def __init__(self, enum_type: type[E]) -> None: - self.enum_type = enum_type - - def parse(self, data: JsonType) -> E: - return self.enum_type(data) - - -class CustomDeserializer(Deserializer[T]): - "Uses the `from_json` class method in class to de-serialize the object from JSON." - - converter: Callable[[JsonType], T] - - def __init__(self, converter: Callable[[JsonType], T]) -> None: - self.converter = converter - - def parse(self, data: JsonType) -> T: - return self.converter(data) - - -class FieldDeserializer(abc.ABC, Generic[T, R]): - """ - Deserializes a JSON property into a Python object field. - - :param property_name: The name of the JSON property to read from a JSON `object`. - :param field_name: The name of the field in a Python class to write data to. - :param parser: A compatible deserializer that can handle the field's type. - """ - - property_name: str - field_name: str - parser: Deserializer[T] - - def __init__(self, property_name: str, field_name: str, parser: Deserializer[T]) -> None: - self.property_name = property_name - self.field_name = field_name - self.parser = parser - - @abc.abstractmethod - def parse_field(self, data: dict[str, JsonType]) -> R: ... - - -class RequiredFieldDeserializer(FieldDeserializer[T, T]): - "Deserializes a JSON property into a mandatory Python object field." - - def parse_field(self, data: dict[str, JsonType]) -> T: - if self.property_name not in data: - raise JsonKeyError(f"missing required property `{self.property_name}` from JSON object: {data}") - - return self.parser.parse(data[self.property_name]) - - -class OptionalFieldDeserializer(FieldDeserializer[T, Optional[T]]): - "Deserializes a JSON property into an optional Python object field with a default value of `None`." - - def parse_field(self, data: dict[str, JsonType]) -> T | None: - value = data.get(self.property_name) - if value is not None: - return self.parser.parse(value) - else: - return None - - -class DefaultFieldDeserializer(FieldDeserializer[T, T]): - "Deserializes a JSON property into a Python object field with an explicit default value." - - default_value: T - - def __init__( - self, - property_name: str, - field_name: str, - parser: Deserializer, - default_value: T, - ) -> None: - super().__init__(property_name, field_name, parser) - self.default_value = default_value - - def parse_field(self, data: dict[str, JsonType]) -> T: - value = data.get(self.property_name) - if value is not None: - return self.parser.parse(value) - else: - return self.default_value - - -class DefaultFactoryFieldDeserializer(FieldDeserializer[T, T]): - "Deserializes a JSON property into an optional Python object field with an explicit default value factory." - - default_factory: Callable[[], T] - - def __init__( - self, - property_name: str, - field_name: str, - parser: Deserializer[T], - default_factory: Callable[[], T], - ) -> None: - super().__init__(property_name, field_name, parser) - self.default_factory = default_factory - - def parse_field(self, data: dict[str, JsonType]) -> T: - value = data.get(self.property_name) - if value is not None: - return self.parser.parse(value) - else: - return self.default_factory() - - -class ClassDeserializer(Deserializer[T]): - "Base class for de-serializing class-like types such as data classes, named tuples and regular classes." - - class_type: type - property_parsers: list[FieldDeserializer] - property_fields: set[str] - - def __init__(self, class_type: type[T]) -> None: - self.class_type = class_type - - def assign(self, property_parsers: list[FieldDeserializer]) -> None: - self.property_parsers = property_parsers - self.property_fields = set(property_parser.property_name for property_parser in property_parsers) - - def parse(self, data: JsonType) -> T: - if not isinstance(data, dict): - type_name = python_type_to_str(self.class_type) - raise JsonTypeError(f"`type `{type_name}` expects JSON `object` data but instead received: {data}") - - object_data: dict[str, JsonType] = typing.cast(dict[str, JsonType], data) - - field_values = {} - for property_parser in self.property_parsers: - field_values[property_parser.field_name] = property_parser.parse_field(object_data) - - if not self.property_fields.issuperset(object_data): - unassigned_names = [name for name in object_data if name not in self.property_fields] - raise JsonKeyError(f"unrecognized fields in JSON object: {unassigned_names}") - - return self.create(**field_values) - - def create(self, **field_values: Any) -> T: - "Instantiates an object with a collection of property values." - - obj: T = create_object(self.class_type) - - # use `setattr` on newly created object instance - for field_name, field_value in field_values.items(): - setattr(obj, field_name, field_value) - return obj - - -class NamedTupleDeserializer(ClassDeserializer[NamedTuple]): - "De-serializes a named tuple from a JSON `object`." - - def build(self, context: ModuleType | None) -> None: - property_parsers: list[FieldDeserializer] = [ - RequiredFieldDeserializer(field_name, field_name, _get_deserializer(field_type, context)) - for field_name, field_type in get_resolved_hints(self.class_type).items() - ] - super().assign(property_parsers) - - def create(self, **field_values: Any) -> NamedTuple: - # mypy fails to deduce that this class returns NamedTuples only, hence the `ignore` directive - return self.class_type(**field_values) # type: ignore[no-any-return] - - -class DataclassDeserializer(ClassDeserializer[T]): - "De-serializes a data class from a JSON `object`." - - def __init__(self, class_type: type[T]) -> None: - if not dataclasses.is_dataclass(class_type): - raise TypeError("expected: data-class type") - super().__init__(class_type) # type: ignore[arg-type] - - def build(self, context: ModuleType | None) -> None: - property_parsers: list[FieldDeserializer] = [] - resolved_hints = get_resolved_hints(self.class_type) - for field in dataclasses.fields(self.class_type): - field_type = resolved_hints[field.name] - property_name = python_field_to_json_property(field.name, field_type) - - is_optional = is_type_optional(field_type) - has_default = field.default is not dataclasses.MISSING - has_default_factory = field.default_factory is not dataclasses.MISSING - - if is_optional: - required_type: type[T] = unwrap_optional_type(field_type) - else: - required_type = field_type - - parser = _get_deserializer(required_type, context) - - if has_default: - field_parser: FieldDeserializer = DefaultFieldDeserializer( - property_name, field.name, parser, field.default - ) - elif has_default_factory: - default_factory = typing.cast(Callable[[], Any], field.default_factory) - field_parser = DefaultFactoryFieldDeserializer(property_name, field.name, parser, default_factory) - elif is_optional: - field_parser = OptionalFieldDeserializer(property_name, field.name, parser) - else: - field_parser = RequiredFieldDeserializer(property_name, field.name, parser) - - property_parsers.append(field_parser) - - super().assign(property_parsers) - - -class FrozenDataclassDeserializer(DataclassDeserializer[T]): - "De-serializes a frozen data class from a JSON `object`." - - def create(self, **field_values: Any) -> T: - "Instantiates an object with a collection of property values." - - # create object instance without calling `__init__` - obj: T = create_object(self.class_type) - - # can't use `setattr` on frozen dataclasses, pass member variable values to `__init__` - obj.__init__(**field_values) # type: ignore - return obj - - -class TypedClassDeserializer(ClassDeserializer[T]): - "De-serializes a class with type annotations from a JSON `object` by iterating over class properties." - - def build(self, context: ModuleType | None) -> None: - property_parsers: list[FieldDeserializer] = [] - for field_name, field_type in get_resolved_hints(self.class_type).items(): - property_name = python_field_to_json_property(field_name, field_type) - - is_optional = is_type_optional(field_type) - - if is_optional: - required_type: type[T] = unwrap_optional_type(field_type) - else: - required_type = field_type - - parser = _get_deserializer(required_type, context) - - if is_optional: - field_parser: FieldDeserializer = OptionalFieldDeserializer(property_name, field_name, parser) - else: - field_parser = RequiredFieldDeserializer(property_name, field_name, parser) - - property_parsers.append(field_parser) - - super().assign(property_parsers) - - -def create_deserializer(typ: TypeLike, context: ModuleType | None = None) -> Deserializer: - """ - Creates a de-serializer engine to produce a Python object from an object obtained from a JSON string. - - When de-serializing a JSON object into a Python object, the following transformations are applied: - - * Fundamental types are parsed as `bool`, `int`, `float` or `str`. - * Date and time types are parsed from the ISO 8601 format with time zone into the corresponding Python type - `datetime`, `date` or `time`. - * Byte arrays are read from a string with Base64 encoding into a `bytes` instance. - * UUIDs are extracted from a UUID string compliant with RFC 4122 into a `uuid.UUID` instance. - * Enumerations are instantiated with a lookup on enumeration value. - * Containers (e.g. `list`, `dict`, `set`, `tuple`) are parsed recursively. - * Complex objects with properties (including data class types) are populated from dictionaries of key-value pairs - using reflection (enumerating type annotations). - - :raises TypeError: A de-serializer engine cannot be constructed for the input type. - """ - - if context is None: - if isinstance(typ, type): - context = sys.modules[typ.__module__] - - return _get_deserializer(typ, context) - - -_CACHE: dict[tuple[str, str], Deserializer] = {} - - -def _get_deserializer(typ: TypeLike, context: ModuleType | None) -> Deserializer: - "Creates or re-uses a de-serializer engine to parse an object obtained from a JSON string." - - cache_key = None - - if isinstance(typ, (str, typing.ForwardRef)): - if context is None: - raise TypeError(f"missing context for evaluating type: {typ}") - - if isinstance(typ, str): - if hasattr(context, typ): - cache_key = (context.__name__, typ) - elif isinstance(typ, typing.ForwardRef): - if hasattr(context, typ.__forward_arg__): - cache_key = (context.__name__, typ.__forward_arg__) - - typ = evaluate_type(typ, context) - - typ = unwrap_annotated_type(typ) if is_type_annotated(typ) else typ - - if isinstance(typ, type) and typing.get_origin(typ) is None: - cache_key = (typ.__module__, typ.__name__) - - if cache_key is not None: - deserializer = _CACHE.get(cache_key) - if deserializer is None: - deserializer = _create_deserializer(typ) - - # store de-serializer immediately in cache to avoid stack overflow for recursive types - _CACHE[cache_key] = deserializer - - if isinstance(typ, type): - # use type's own module as context for evaluating member types - context = sys.modules[typ.__module__] - - # create any de-serializers this de-serializer is depending on - deserializer.build(context) - else: - # special forms are not always hashable, create a new de-serializer every time - deserializer = _create_deserializer(typ) - deserializer.build(context) - - return deserializer - - -def _create_deserializer(typ: TypeLike) -> Deserializer: - "Creates a de-serializer engine to parse an object obtained from a JSON string." - - # check for well-known types - if typ is type(None): - return NoneDeserializer() - elif typ is bool: - return BoolDeserializer() - elif typ is int: - return IntDeserializer() - elif typ is float: - return FloatDeserializer() - elif typ is str: - return StringDeserializer() - elif typ is bytes: - return BytesDeserializer() - elif typ is datetime.datetime: - return DateTimeDeserializer() - elif typ is datetime.date: - return DateDeserializer() - elif typ is datetime.time: - return TimeDeserializer() - elif typ is uuid.UUID: - return UUIDDeserializer() - elif typ is ipaddress.IPv4Address: - return IPv4Deserializer() - elif typ is ipaddress.IPv6Address: - return IPv6Deserializer() - - # dynamically-typed collection types - if typ is list: - raise TypeError("explicit item type required: use `List[T]` instead of `list`") - if typ is dict: - raise TypeError("explicit key and value types required: use `Dict[K, V]` instead of `dict`") - if typ is set: - raise TypeError("explicit member type required: use `Set[T]` instead of `set`") - if typ is tuple: - raise TypeError("explicit item type list required: use `Tuple[T, ...]` instead of `tuple`") - - # generic types (e.g. list, dict, set, etc.) - origin_type = typing.get_origin(typ) - if origin_type is list: - (list_item_type,) = typing.get_args(typ) # unpack single tuple element - return ListDeserializer(list_item_type) - elif origin_type is dict: - key_type, value_type = typing.get_args(typ) - return DictDeserializer(key_type, value_type) - elif origin_type is set: - (set_member_type,) = typing.get_args(typ) # unpack single tuple element - return SetDeserializer(set_member_type) - elif origin_type is tuple: - return TupleDeserializer(typing.get_args(typ)) - elif origin_type is Union: - union_args = typing.get_args(typ) - if get_discriminating_properties(union_args): - return TaggedUnionDeserializer(union_args) - else: - return UnionDeserializer(union_args) - elif origin_type is Literal: - return LiteralDeserializer(typing.get_args(typ)) - - if not inspect.isclass(typ): - if is_dataclass_instance(typ): - raise TypeError(f"dataclass type expected but got instance: {typ}") - else: - raise TypeError(f"unable to de-serialize unrecognized type: {typ}") - - if issubclass(typ, enum.Enum): - return EnumDeserializer(typ) - - if is_named_tuple_type(typ): - return NamedTupleDeserializer(typ) - - # check if object has custom serialization method - convert_func = getattr(typ, "from_json", None) - if callable(convert_func): - return CustomDeserializer(convert_func) - - if is_dataclass_type(typ): - dataclass_params = getattr(typ, "__dataclass_params__", None) - if dataclass_params is not None and dataclass_params.frozen: - return FrozenDataclassDeserializer(typ) - else: - return DataclassDeserializer(typ) - - return TypedClassDeserializer(typ) diff --git a/src/llama_stack/strong_typing/docstring.py b/src/llama_stack/strong_typing/docstring.py deleted file mode 100644 index 4c9ea49e50..0000000000 --- a/src/llama_stack/strong_typing/docstring.py +++ /dev/null @@ -1,410 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -""" -Type-safe data interchange for Python data classes. - -:see: https://github.com/hunyadi/strong_typing -""" - -import builtins -import collections.abc -import dataclasses -import inspect -import re -import sys -import types -import typing -from collections.abc import Callable -from dataclasses import dataclass -from io import StringIO -from typing import Any, Protocol, TypeVar - -if sys.version_info >= (3, 10): - from typing import TypeGuard -else: - from typing import TypeGuard - -from .inspection import ( - DataclassInstance, - get_class_properties, - get_signature, - is_dataclass_type, - is_type_enum, -) - -T = TypeVar("T") - - -@dataclass -class DocstringParam: - """ - A parameter declaration in a parameter block. - - :param name: The name of the parameter. - :param description: The description text for the parameter. - """ - - name: str - description: str - param_type: type | str = inspect.Signature.empty - - def __str__(self) -> str: - return f":param {self.name}: {self.description}" - - -@dataclass -class DocstringReturns: - """ - A `returns` declaration extracted from a docstring. - - :param description: The description text for the return value. - """ - - description: str - return_type: type = inspect.Signature.empty - - def __str__(self) -> str: - return f":returns: {self.description}" - - -@dataclass -class DocstringRaises: - """ - A `raises` declaration extracted from a docstring. - - :param typename: The type name of the exception raised. - :param description: The description associated with the exception raised. - """ - - typename: str - description: str - raise_type: type = inspect.Signature.empty - - def __str__(self) -> str: - return f":raises {self.typename}: {self.description}" - - -@dataclass -class Docstring: - """ - Represents the documentation string (a.k.a. docstring) for a type such as a (data) class or function. - - A docstring is broken down into the following components: - * A short description, which is the first block of text in the documentation string, and ends with a double - newline or a parameter block. - * A long description, which is the optional block of text following the short description, and ends with - a parameter block. - * A parameter block of named parameter and description string pairs in ReST-style. - * A `returns` declaration, which adds explanation to the return value. - * A `raises` declaration, which adds explanation to the exception type raised by the function on error. - - When the docstring is attached to a data class, it is understood as the documentation string of the class - `__init__` method. - - :param short_description: The short description text parsed from a docstring. - :param long_description: The long description text parsed from a docstring. - :param params: The parameter block extracted from a docstring. - :param returns: The returns declaration extracted from a docstring. - """ - - short_description: str | None = None - long_description: str | None = None - params: dict[str, DocstringParam] = dataclasses.field(default_factory=dict) - returns: DocstringReturns | None = None - raises: dict[str, DocstringRaises] = dataclasses.field(default_factory=dict) - - @property - def full_description(self) -> str | None: - if self.short_description and self.long_description: - return f"{self.short_description}\n\n{self.long_description}" - elif self.short_description: - return self.short_description - else: - return None - - def __str__(self) -> str: - output = StringIO() - - has_description = self.short_description or self.long_description - has_blocks = self.params or self.returns or self.raises - - if has_description: - if self.short_description and self.long_description: - output.write(self.short_description) - output.write("\n\n") - output.write(self.long_description) - elif self.short_description: - output.write(self.short_description) - - if has_blocks: - if has_description: - output.write("\n") - - for param in self.params.values(): - output.write("\n") - output.write(str(param)) - if self.returns: - output.write("\n") - output.write(str(self.returns)) - for raises in self.raises.values(): - output.write("\n") - output.write(str(raises)) - - s = output.getvalue() - output.close() - return s - - -def is_exception(member: object) -> TypeGuard[type[BaseException]]: - return isinstance(member, type) and issubclass(member, BaseException) - - -def get_exceptions(module: types.ModuleType) -> dict[str, type[BaseException]]: - "Returns all exception classes declared in a module." - - return {name: class_type for name, class_type in inspect.getmembers(module, is_exception)} - - -class SupportsDoc(Protocol): - __doc__: str | None - - -def _maybe_unwrap_async_iterator(t): - origin_type = typing.get_origin(t) - if origin_type is collections.abc.AsyncIterator: - return typing.get_args(t)[0] - return t - - -def parse_type(typ: SupportsDoc) -> Docstring: - """ - Parse the docstring of a type into its components. - - :param typ: The type whose documentation string to parse. - :returns: Components of the documentation string. - """ - # Use docstring from the iterator origin type for streaming apis - typ = _maybe_unwrap_async_iterator(typ) - - doc = get_docstring(typ) - if doc is None: - return Docstring() - - docstring = parse_text(doc) - check_docstring(typ, docstring) - - # assign parameter and return types - if is_dataclass_type(typ): - properties = dict(get_class_properties(typing.cast(type, typ))) - - for name, param in docstring.params.items(): - param.param_type = properties[name] - - elif inspect.isfunction(typ): - signature = get_signature(typ) - for name, param in docstring.params.items(): - param.param_type = signature.parameters[name].annotation - if docstring.returns: - docstring.returns.return_type = signature.return_annotation - - # assign exception types - defining_module = inspect.getmodule(typ) - if defining_module: - context: dict[str, type] = {} - context.update(get_exceptions(builtins)) - context.update(get_exceptions(defining_module)) - for exc_name, exc in docstring.raises.items(): - raise_type = context.get(exc_name) - if raise_type is None: - type_name = getattr(typ, "__qualname__", None) or getattr(typ, "__name__", None) or None - raise TypeError( - f"doc-string exception type `{exc_name}` is not an exception defined in the context of `{type_name}`" - ) - - exc.raise_type = raise_type - - return docstring - - -def parse_text(text: str) -> Docstring: - """ - Parse a ReST-style docstring into its components. - - :param text: The documentation string to parse, typically acquired as `type.__doc__`. - :returns: Components of the documentation string. - """ - - if not text: - return Docstring() - - # find block that starts object metadata block (e.g. `:param p:` or `:returns:`) - text = inspect.cleandoc(text) - match = re.search("^:", text, flags=re.MULTILINE) - if match: - desc_chunk = text[: match.start()] - meta_chunk = text[match.start() :] # noqa: E203 - else: - desc_chunk = text - meta_chunk = "" - - # split description text into short and long description - parts = desc_chunk.split("\n\n", 1) - - # ensure short description has no newlines - short_description = parts[0].strip().replace("\n", " ") or None - - # ensure long description preserves its structure (e.g. preformatted text) - if len(parts) > 1: - long_description = parts[1].strip() or None - else: - long_description = None - - params: dict[str, DocstringParam] = {} - raises: dict[str, DocstringRaises] = {} - returns = None - for match in re.finditer(r"(^:.*?)(?=^:|\Z)", meta_chunk, flags=re.DOTALL | re.MULTILINE): - chunk = match.group(0) - if not chunk: - continue - - args_chunk, desc_chunk = chunk.lstrip(":").split(":", 1) - args = args_chunk.split() - desc = re.sub(r"\s+", " ", desc_chunk.strip()) - - if len(args) > 0: - kw = args[0] - if len(args) == 2: - if kw == "param": - params[args[1]] = DocstringParam( - name=args[1], - description=desc, - ) - elif kw == "raise" or kw == "raises": - raises[args[1]] = DocstringRaises( - typename=args[1], - description=desc, - ) - - elif len(args) == 1: - if kw == "return" or kw == "returns": - returns = DocstringReturns(description=desc) - - return Docstring( - long_description=long_description, - short_description=short_description, - params=params, - returns=returns, - raises=raises, - ) - - -def has_default_docstring(typ: SupportsDoc) -> bool: - "Check if class has the auto-generated string assigned by @dataclass." - - if not isinstance(typ, type): - return False - - if is_dataclass_type(typ): - return typ.__doc__ is not None and re.match(f"^{re.escape(typ.__name__)}[(].*[)]$", typ.__doc__) is not None - - if is_type_enum(typ): - return typ.__doc__ is not None and typ.__doc__ == "An enumeration." - - return False - - -def has_docstring(typ: SupportsDoc) -> bool: - "Check if class has a documentation string other than the auto-generated string assigned by @dataclass." - - if has_default_docstring(typ): - return False - - return bool(typ.__doc__) - - -def get_docstring(typ: SupportsDoc) -> str | None: - if typ.__doc__ is None: - return None - - if has_default_docstring(typ): - return None - - return typ.__doc__ - - -def check_docstring(typ: SupportsDoc, docstring: Docstring, strict: bool = False) -> None: - """ - Verifies the doc-string of a type. - - :raises TypeError: Raised on a mismatch between doc-string parameters, and function or type signature. - """ - - if is_dataclass_type(typ): - check_dataclass_docstring(typ, docstring, strict) - elif inspect.isfunction(typ): - check_function_docstring(typ, docstring, strict) - - -def check_dataclass_docstring(typ: type[DataclassInstance], docstring: Docstring, strict: bool = False) -> None: - """ - Verifies the doc-string of a data-class type. - - :param strict: Whether to check if all data-class members have doc-strings. - :raises TypeError: Raised on a mismatch between doc-string parameters and data-class members. - """ - - if not is_dataclass_type(typ): - raise TypeError("not a data-class type") - - properties = dict(get_class_properties(typ)) - class_name = typ.__name__ - - for name in docstring.params: - if name not in properties: - raise TypeError(f"doc-string parameter `{name}` is not a member of the data-class `{class_name}`") - - if not strict: - return - - for name in properties: - if name not in docstring.params: - raise TypeError(f"member `{name}` in data-class `{class_name}` is missing its doc-string") - - -def check_function_docstring(fn: Callable[..., Any], docstring: Docstring, strict: bool = False) -> None: - """ - Verifies the doc-string of a function or member function. - - :param strict: Whether to check if all function parameters and the return type have doc-strings. - :raises TypeError: Raised on a mismatch between doc-string parameters and function signature. - """ - - signature = get_signature(fn) - func_name = fn.__qualname__ - - for name in docstring.params: - if name not in signature.parameters: - raise TypeError(f"doc-string parameter `{name}` is absent from signature of function `{func_name}`") - - if docstring.returns is not None and signature.return_annotation is inspect.Signature.empty: - raise TypeError(f"doc-string has returns description in function `{func_name}` with no return type annotation") - - if not strict: - return - - for name, param in signature.parameters.items(): - # ignore `self` in member function signatures - if name == "self" and ( - param.kind is inspect.Parameter.POSITIONAL_ONLY or param.kind is inspect.Parameter.POSITIONAL_OR_KEYWORD - ): - continue - - if name not in docstring.params: - raise TypeError(f"function parameter `{name}` in `{func_name}` is missing its doc-string") - - if signature.return_annotation is not inspect.Signature.empty and docstring.returns is None: - raise TypeError(f"function `{func_name}` has no returns description in its doc-string") diff --git a/src/llama_stack/strong_typing/exception.py b/src/llama_stack/strong_typing/exception.py deleted file mode 100644 index af037cc3c8..0000000000 --- a/src/llama_stack/strong_typing/exception.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -""" -Type-safe data interchange for Python data classes. - -:see: https://github.com/hunyadi/strong_typing -""" - - -class JsonKeyError(Exception): - "Raised when deserialization for a class or union type has failed because a matching member was not found." - - -class JsonValueError(Exception): - "Raised when (de)serialization of data has failed due to invalid value." - - -class JsonTypeError(Exception): - "Raised when deserialization of data has failed due to a type mismatch." diff --git a/src/llama_stack/strong_typing/inspection.py b/src/llama_stack/strong_typing/inspection.py deleted file mode 100644 index 319d126577..0000000000 --- a/src/llama_stack/strong_typing/inspection.py +++ /dev/null @@ -1,1104 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -""" -Type-safe data interchange for Python data classes. - -:see: https://github.com/hunyadi/strong_typing -""" - -import dataclasses -import datetime -import enum -import importlib -import importlib.machinery -import importlib.util -import inspect -import re -import sys -import types -import typing -import uuid -from collections.abc import Callable, Iterable -from typing import ( - Any, - Literal, - NamedTuple, - Protocol, - TypeVar, - Union, - runtime_checkable, -) - -if sys.version_info >= (3, 9): - from typing import Annotated -else: - from typing import Annotated - -if sys.version_info >= (3, 10): - from typing import TypeGuard -else: - from typing import TypeGuard - - -from pydantic import BaseModel -from pydantic.fields import FieldInfo - -S = TypeVar("S") -T = TypeVar("T") -K = TypeVar("K") -V = TypeVar("V") - - -def _is_type_like(data_type: object) -> bool: - """ - Checks if the object is a type or type-like object (e.g. generic type). - - :param data_type: The object to validate. - :returns: True if the object is a type or type-like object. - """ - - if isinstance(data_type, type): - # a standard type - return True - elif typing.get_origin(data_type) is not None: - # a generic type such as `list`, `dict` or `set` - return True - elif hasattr(data_type, "__forward_arg__"): - # an instance of `ForwardRef` - return True - elif data_type is Any: - # the special form `Any` - return True - else: - return False - - -if sys.version_info >= (3, 9): - TypeLike = Union[type, types.GenericAlias, typing.ForwardRef, Any] - - def is_type_like( - data_type: object, - ) -> TypeGuard[TypeLike]: - """ - Checks if the object is a type or type-like object (e.g. generic type). - - :param data_type: The object to validate. - :returns: True if the object is a type or type-like object. - """ - - return _is_type_like(data_type) - -else: - TypeLike = object - - def is_type_like( - data_type: object, - ) -> bool: - return _is_type_like(data_type) - - -def evaluate_member_type(typ: Any, cls: type) -> Any: - """ - Evaluates a forward reference type in a dataclass member. - - :param typ: The dataclass member type to convert. - :param cls: The dataclass in which the member is defined. - :returns: The evaluated type. - """ - - return evaluate_type(typ, sys.modules[cls.__module__]) - - -def evaluate_type(typ: Any, module: types.ModuleType) -> Any: - """ - Evaluates a forward reference type. - - :param typ: The type to convert, typically a dataclass member type. - :param module: The context for the type, i.e. the module in which the member is defined. - :returns: The evaluated type. - """ - - if isinstance(typ, str): - # evaluate data-class field whose type annotation is a string - return eval(typ, module.__dict__, locals()) - if isinstance(typ, typing.ForwardRef): - if sys.version_info >= (3, 9): - return typ._evaluate(module.__dict__, locals(), recursive_guard=frozenset()) - else: - return typ._evaluate(module.__dict__, locals()) - else: - return typ - - -@runtime_checkable -class DataclassInstance(Protocol): - __dataclass_fields__: typing.ClassVar[dict[str, dataclasses.Field]] - - -def is_dataclass_type(typ: Any) -> TypeGuard[type[DataclassInstance]]: - "True if the argument corresponds to a data class type (but not an instance)." - - typ = unwrap_annotated_type(typ) - return isinstance(typ, type) and dataclasses.is_dataclass(typ) - - -def is_dataclass_instance(obj: Any) -> TypeGuard[DataclassInstance]: - "True if the argument corresponds to a data class instance (but not a type)." - - return not isinstance(obj, type) and dataclasses.is_dataclass(obj) - - -@dataclasses.dataclass -class DataclassField: - name: str - type: Any - default: Any - - def __init__(self, name: str, type: Any, default: Any = dataclasses.MISSING) -> None: - self.name = name - self.type = type - self.default = default - - -def dataclass_fields(cls: type[DataclassInstance]) -> Iterable[DataclassField]: - "Generates the fields of a data-class resolving forward references." - - for field in dataclasses.fields(cls): - yield DataclassField(field.name, evaluate_member_type(field.type, cls), field.default) - - -def dataclass_field_by_name(cls: type[DataclassInstance], name: str) -> DataclassField: - "Looks up a field in a data-class by its field name." - - for field in dataclasses.fields(cls): - if field.name == name: - return DataclassField(field.name, evaluate_member_type(field.type, cls)) - - raise LookupError(f"field `{name}` missing from class `{cls.__name__}`") - - -def is_named_tuple_instance(obj: Any) -> TypeGuard[NamedTuple]: - "True if the argument corresponds to a named tuple instance." - - return is_named_tuple_type(type(obj)) - - -def is_named_tuple_type(typ: Any) -> TypeGuard[type[NamedTuple]]: - """ - True if the argument corresponds to a named tuple type. - - Calling the function `collections.namedtuple` gives a new type that is a subclass of `tuple` (and no other classes) - with a member named `_fields` that is a tuple whose items are all strings. - """ - - if not isinstance(typ, type): - return False - - typ = unwrap_annotated_type(typ) - - b = getattr(typ, "__bases__", None) - if b is None: - return False - - if len(b) != 1 or b[0] != tuple: - return False - - f = getattr(typ, "_fields", None) - if not isinstance(f, tuple): - return False - - return all(isinstance(n, str) for n in f) - - -if sys.version_info >= (3, 11): - - def is_type_enum(typ: object) -> TypeGuard[type[enum.Enum]]: - "True if the specified type is an enumeration type." - - typ = unwrap_annotated_type(typ) - return isinstance(typ, enum.EnumType) - -else: - - def is_type_enum(typ: object) -> TypeGuard[type[enum.Enum]]: - "True if the specified type is an enumeration type." - - typ = unwrap_annotated_type(typ) - - # use an explicit isinstance(..., type) check to filter out special forms like generics - return isinstance(typ, type) and issubclass(typ, enum.Enum) - - -def enum_value_types(enum_type: type[enum.Enum]) -> list[type]: - """ - Returns all unique value types of the `enum.Enum` type in definition order. - """ - - # filter unique enumeration value types by keeping definition order - return list(dict.fromkeys(type(e.value) for e in enum_type)) - - -def extend_enum( - source: type[enum.Enum], -) -> Callable[[type[enum.Enum]], type[enum.Enum]]: - """ - Creates a new enumeration type extending the set of values in an existing type. - - :param source: The existing enumeration type to be extended with new values. - :returns: A new enumeration type with the extended set of values. - """ - - def wrap(extend: type[enum.Enum]) -> type[enum.Enum]: - # create new enumeration type combining the values from both types - values: dict[str, Any] = {} - values.update((e.name, e.value) for e in source) - values.update((e.name, e.value) for e in extend) - # mypy fails to determine that __name__ is always a string; hence the `ignore` directive. - enum_class: type[enum.Enum] = enum.Enum(extend.__name__, values) # type: ignore[misc] - - # assign the newly created type to the same module where the extending class is defined - enum_class.__module__ = extend.__module__ - enum_class.__doc__ = extend.__doc__ - setattr(sys.modules[extend.__module__], extend.__name__, enum_class) - - return enum.unique(enum_class) - - return wrap - - -if sys.version_info >= (3, 10): - - def _is_union_like(typ: object) -> bool: - "True if type is a union such as `Union[T1, T2, ...]` or a union type `T1 | T2`." - - return typing.get_origin(typ) is Union or isinstance(typ, types.UnionType) - -else: - - def _is_union_like(typ: object) -> bool: - "True if type is a union such as `Union[T1, T2, ...]` or a union type `T1 | T2`." - - return typing.get_origin(typ) is Union - - -def is_type_optional(typ: object, strict: bool = False) -> TypeGuard[type[Any | None]]: - """ - True if the type annotation corresponds to an optional type (e.g. `Optional[T]` or `Union[T1,T2,None]`). - - `Optional[T]` is represented as `Union[T, None]` is classic style, and is equivalent to `T | None` in new style. - - :param strict: True if only `Optional[T]` qualifies as an optional type but `Union[T1, T2, None]` does not. - """ - - typ = unwrap_annotated_type(typ) - - if _is_union_like(typ): - args = typing.get_args(typ) - if strict and len(args) != 2: - return False - - return type(None) in args - - return False - - -def unwrap_optional_type(typ: type[T | None]) -> type[T]: - """ - Extracts the inner type of an optional type. - - :param typ: The optional type `Optional[T]`. - :returns: The inner type `T`. - """ - - return rewrap_annotated_type(_unwrap_optional_type, typ) - - -def _unwrap_optional_type(typ: type[T | None]) -> type[T]: - "Extracts the type qualified as optional (e.g. returns `T` for `Optional[T]`)." - - # Optional[T] is represented internally as Union[T, None] - if not _is_union_like(typ): - raise TypeError("optional type must have un-subscripted type of Union") - - # will automatically unwrap Union[T] into T - return Union[tuple(filter(lambda item: item is not type(None), typing.get_args(typ)))] # type: ignore[return-value] - - -def is_type_union(typ: object) -> bool: - "True if the type annotation corresponds to a union type (e.g. `Union[T1,T2,T3]`)." - - typ = unwrap_annotated_type(typ) - if _is_union_like(typ): - args = typing.get_args(typ) - return len(args) > 2 or type(None) not in args - - return False - - -def unwrap_union_types(typ: object) -> tuple[object, ...]: - """ - Extracts the inner types of a union type. - - :param typ: The union type `Union[T1, T2, ...]`. - :returns: The inner types `T1`, `T2`, etc. - """ - - typ = unwrap_annotated_type(typ) - return _unwrap_union_types(typ) - - -def _unwrap_union_types(typ: object) -> tuple[object, ...]: - "Extracts the types in a union (e.g. returns a tuple of types `T1` and `T2` for `Union[T1, T2]`)." - - if not _is_union_like(typ): - raise TypeError("union type must have un-subscripted type of Union") - - return typing.get_args(typ) - - -def is_type_literal(typ: object) -> bool: - "True if the specified type is a literal of one or more constant values, e.g. `Literal['string']` or `Literal[42]`." - - typ = unwrap_annotated_type(typ) - return typing.get_origin(typ) is Literal - - -def unwrap_literal_value(typ: object) -> Any: - """ - Extracts the single constant value captured by a literal type. - - :param typ: The literal type `Literal[value]`. - :returns: The values captured by the literal type. - """ - - args = unwrap_literal_values(typ) - if len(args) != 1: - raise TypeError("too many values in literal type") - - return args[0] - - -def unwrap_literal_values(typ: object) -> tuple[Any, ...]: - """ - Extracts the constant values captured by a literal type. - - :param typ: The literal type `Literal[value, ...]`. - :returns: A tuple of values captured by the literal type. - """ - - typ = unwrap_annotated_type(typ) - return typing.get_args(typ) - - -def unwrap_literal_types(typ: object) -> tuple[type, ...]: - """ - Extracts the types of the constant values captured by a literal type. - - :param typ: The literal type `Literal[value, ...]`. - :returns: A tuple of item types `T` such that `type(value) == T`. - """ - - return tuple(type(t) for t in unwrap_literal_values(typ)) - - -def is_generic_list(typ: object) -> TypeGuard[type[list]]: - "True if the specified type is a generic list, i.e. `List[T]`." - - typ = unwrap_annotated_type(typ) - return typing.get_origin(typ) is list - - -def unwrap_generic_list(typ: type[list[T]]) -> type[T]: - """ - Extracts the item type of a list type. - - :param typ: The list type `List[T]`. - :returns: The item type `T`. - """ - - return rewrap_annotated_type(_unwrap_generic_list, typ) - - -def _unwrap_generic_list(typ: type[list[T]]) -> type[T]: - "Extracts the item type of a list type (e.g. returns `T` for `List[T]`)." - - (list_type,) = typing.get_args(typ) # unpack single tuple element - return list_type # type: ignore[no-any-return] - - -def is_generic_sequence(typ: object) -> bool: - "True if the specified type is a generic Sequence, i.e. `Sequence[T]`." - import collections.abc - - typ = unwrap_annotated_type(typ) - return typing.get_origin(typ) is collections.abc.Sequence - - -def unwrap_generic_sequence(typ: object) -> type: - """ - Extracts the item type of a Sequence type. - - :param typ: The Sequence type `Sequence[T]`. - :returns: The item type `T`. - """ - - return rewrap_annotated_type(_unwrap_generic_sequence, typ) # type: ignore[arg-type] - - -def _unwrap_generic_sequence(typ: object) -> type: - "Extracts the item type of a Sequence type (e.g. returns `T` for `Sequence[T]`)." - - (sequence_type,) = typing.get_args(typ) # unpack single tuple element - return sequence_type # type: ignore[no-any-return] - - -def is_generic_set(typ: object) -> TypeGuard[type[set]]: - "True if the specified type is a generic set, i.e. `Set[T]`." - - typ = unwrap_annotated_type(typ) - return typing.get_origin(typ) is set - - -def unwrap_generic_set(typ: type[set[T]]) -> type[T]: - """ - Extracts the item type of a set type. - - :param typ: The set type `Set[T]`. - :returns: The item type `T`. - """ - - return rewrap_annotated_type(_unwrap_generic_set, typ) - - -def _unwrap_generic_set(typ: type[set[T]]) -> type[T]: - "Extracts the item type of a set type (e.g. returns `T` for `Set[T]`)." - - (set_type,) = typing.get_args(typ) # unpack single tuple element - return set_type # type: ignore[no-any-return] - - -def is_generic_dict(typ: object) -> TypeGuard[type[dict]]: - "True if the specified type is a generic dictionary, i.e. `Dict[KeyType, ValueType]`." - - typ = unwrap_annotated_type(typ) - return typing.get_origin(typ) is dict - - -def unwrap_generic_dict(typ: type[dict[K, V]]) -> tuple[type[K], type[V]]: - """ - Extracts the key and value types of a dictionary type as a tuple. - - :param typ: The dictionary type `Dict[K, V]`. - :returns: The key and value types `K` and `V`. - """ - - return _unwrap_generic_dict(unwrap_annotated_type(typ)) - - -def _unwrap_generic_dict(typ: type[dict[K, V]]) -> tuple[type[K], type[V]]: - "Extracts the key and value types of a dict type (e.g. returns (`K`, `V`) for `Dict[K, V]`)." - - key_type, value_type = typing.get_args(typ) - return key_type, value_type - - -def is_type_annotated(typ: TypeLike) -> bool: - "True if the type annotation corresponds to an annotated type (i.e. `Annotated[T, ...]`)." - - return getattr(typ, "__metadata__", None) is not None - - -def get_annotation(data_type: TypeLike, annotation_type: type[T]) -> T | None: - """ - Returns the first annotation on a data type that matches the expected annotation type. - - :param data_type: The annotated type from which to extract the annotation. - :param annotation_type: The annotation class to look for. - :returns: The annotation class instance found (if any). - """ - - metadata = getattr(data_type, "__metadata__", None) - if metadata is not None: - for annotation in metadata: - if isinstance(annotation, annotation_type): - return annotation - - return None - - -def unwrap_annotated_type(typ: T) -> T: - "Extracts the wrapped type from an annotated type (e.g. returns `T` for `Annotated[T, ...]`)." - - if is_type_annotated(typ): - # type is Annotated[T, ...] - return typing.get_args(typ)[0] # type: ignore[no-any-return] - else: - # type is a regular type - return typ - - -def rewrap_annotated_type(transform: Callable[[type[S]], type[T]], typ: type[S]) -> type[T]: - """ - Un-boxes, transforms and re-boxes an optionally annotated type. - - :param transform: A function that maps an un-annotated type to another type. - :param typ: A type to un-box (if necessary), transform, and re-box (if necessary). - """ - - metadata = getattr(typ, "__metadata__", None) - if metadata is not None: - # type is Annotated[T, ...] - inner_type = typing.get_args(typ)[0] - else: - # type is a regular type - inner_type = typ - - transformed_type = transform(inner_type) - - if metadata is not None: - return Annotated[(transformed_type, *metadata)] # type: ignore[return-value] - else: - return transformed_type - - -def get_module_classes(module: types.ModuleType) -> list[type]: - "Returns all classes declared directly in a module." - - def is_class_member(member: object) -> TypeGuard[type]: - return inspect.isclass(member) and member.__module__ == module.__name__ - - return [class_type for _, class_type in inspect.getmembers(module, is_class_member)] - - -if sys.version_info >= (3, 9): - - def get_resolved_hints(typ: type) -> dict[str, type]: - return typing.get_type_hints(typ, include_extras=True) - -else: - - def get_resolved_hints(typ: type) -> dict[str, type]: - return typing.get_type_hints(typ) - - -def get_class_properties(typ: type) -> Iterable[tuple[str, type | str]]: - "Returns all properties of a class." - - if is_dataclass_type(typ): - return ((field.name, field.type) for field in dataclasses.fields(typ)) - elif hasattr(typ, "model_fields"): - # Pydantic BaseModel - use model_fields to exclude ClassVar and other non-field attributes - # Reconstruct Annotated type if discriminator exists to preserve metadata - from typing import Annotated, Any - - from pydantic.fields import FieldInfo - - def get_field_type(name: str, field: Any) -> type | str: - # If field has discriminator, wrap in Annotated to preserve it for schema generation - if field.discriminator: - field_info = FieldInfo(annotation=None, discriminator=field.discriminator) - # Annotated returns _AnnotatedAlias which isn't a type but is valid here - return Annotated[field.annotation, field_info] # type: ignore[return-value] - # field.annotation can be Union types, Annotated, etc. which aren't type but are valid - return field.annotation # type: ignore[return-value,no-any-return] - - return ((name, get_field_type(name, field)) for name, field in typ.model_fields.items()) - else: - resolved_hints = get_resolved_hints(typ) - return resolved_hints.items() - - -def get_class_property(typ: type, name: str) -> type | str | None: - "Looks up the annotated type of a property in a class by its property name." - - for property_name, property_type in get_class_properties(typ): - if name == property_name: - return property_type - return None - - -@dataclasses.dataclass -class _ROOT: - pass - - -def get_referenced_types(typ: TypeLike, module: types.ModuleType | None = None) -> set[type]: - """ - Extracts types directly or indirectly referenced by this type. - - For example, extract `T` from `List[T]`, `Optional[T]` or `Annotated[T, ...]`, `K` and `V` from `Dict[K,V]`, - `A` and `B` from `Union[A,B]`. - - :param typ: A type or special form. - :param module: The context in which types are evaluated. - :returns: Types referenced by the given type or special form. - """ - - collector = TypeCollector() - collector.run(typ, _ROOT, module) - return collector.references - - -class TypeCollector: - """ - Collects types directly or indirectly referenced by a type. - - :param graph: The type dependency graph, linking types to types they depend on. - """ - - graph: dict[type, set[type]] - - @property - def references(self) -> set[type]: - "Types collected by the type collector." - - dependencies = set() - for edges in self.graph.values(): - dependencies.update(edges) - return dependencies - - def __init__(self) -> None: - self.graph = {_ROOT: set()} - - def traverse(self, typ: type) -> None: - "Finds all dependent types of a type." - - self.run(typ, _ROOT, sys.modules[typ.__module__]) - - def traverse_all(self, types: Iterable[type]) -> None: - "Finds all dependent types of a list of types." - - for typ in types: - self.traverse(typ) - - def run( - self, - typ: TypeLike, - cls: type[DataclassInstance], - module: types.ModuleType | None, - ) -> None: - """ - Extracts types indirectly referenced by this type. - - For example, extract `T` from `List[T]`, `Optional[T]` or `Annotated[T, ...]`, `K` and `V` from `Dict[K,V]`, - `A` and `B` from `Union[A,B]`. - - :param typ: A type or special form. - :param cls: A dataclass type being expanded for dependent types. - :param module: The context in which types are evaluated. - :returns: Types referenced by the given type or special form. - """ - - if typ is type(None) or typ is Any: - return - - if isinstance(typ, type): - self.graph[cls].add(typ) - - if typ in self.graph: - return - - self.graph[typ] = set() - - metadata = getattr(typ, "__metadata__", None) - if metadata is not None: - # type is Annotated[T, ...] - arg = typing.get_args(typ)[0] - return self.run(arg, cls, module) - - # type is a forward reference - if isinstance(typ, str) or isinstance(typ, typing.ForwardRef): - if module is None: - raise ValueError("missing context for evaluating types") - - evaluated_type = evaluate_type(typ, module) - return self.run(evaluated_type, cls, module) - - # type is a special form - origin = typing.get_origin(typ) - if origin in [list, dict, frozenset, set, tuple, Union]: - for arg in typing.get_args(typ): - self.run(arg, cls, module) - return - elif origin is Literal: - return - - # type is optional or a union type - if is_type_optional(typ): - return self.run(unwrap_optional_type(typ), cls, module) - if is_type_union(typ): - for union_type in unwrap_union_types(typ): - self.run(union_type, cls, module) - return - - # type is a regular type - elif is_dataclass_type(typ) or is_type_enum(typ) or isinstance(typ, type): - context = sys.modules[typ.__module__] - if is_dataclass_type(typ): - for field in dataclass_fields(typ): - self.run(field.type, typ, context) - else: - for field_name, field_type in get_resolved_hints(typ).items(): - self.run(field_type, typ, context) - return - - raise TypeError(f"expected: type-like; got: {typ}") - - -if sys.version_info >= (3, 10): - - def get_signature(fn: Callable[..., Any]) -> inspect.Signature: - "Extracts the signature of a function." - - return inspect.signature(fn, eval_str=True) - -else: - - def get_signature(fn: Callable[..., Any]) -> inspect.Signature: - "Extracts the signature of a function." - - return inspect.signature(fn) - - -def is_reserved_property(name: str) -> bool: - "True if the name stands for an internal property." - - # filter built-in and special properties - if re.match(r"^__.+__$", name): - return True - - # filter built-in special names - if name in ["_abc_impl"]: - return True - - return False - - -def create_module(name: str) -> types.ModuleType: - """ - Creates a new module dynamically at run-time. - - :param name: Fully qualified name of the new module (with dot notation). - """ - - if name in sys.modules: - raise KeyError(f"{name!r} already in sys.modules") - - spec = importlib.machinery.ModuleSpec(name, None) - module = importlib.util.module_from_spec(spec) - sys.modules[name] = module - if spec.loader is not None: - spec.loader.exec_module(module) - return module - - -if sys.version_info >= (3, 10): - - def create_data_type(class_name: str, fields: list[tuple[str, type]]) -> type: - """ - Creates a new data-class type dynamically. - - :param class_name: The name of new data-class type. - :param fields: A list of fields (and their type) that the new data-class type is expected to have. - :returns: The newly created data-class type. - """ - - # has the `slots` parameter - return dataclasses.make_dataclass(class_name, fields, slots=True) - -else: - - def create_data_type(class_name: str, fields: list[tuple[str, type]]) -> type: - """ - Creates a new data-class type dynamically. - - :param class_name: The name of new data-class type. - :param fields: A list of fields (and their type) that the new data-class type is expected to have. - :returns: The newly created data-class type. - """ - - cls = dataclasses.make_dataclass(class_name, fields) - - cls_dict = dict(cls.__dict__) - field_names = tuple(field.name for field in dataclasses.fields(cls)) - - cls_dict["__slots__"] = field_names - - for field_name in field_names: - cls_dict.pop(field_name, None) - cls_dict.pop("__dict__", None) - - qualname = getattr(cls, "__qualname__", None) - cls = type(cls)(cls.__name__, (), cls_dict) - if qualname is not None: - cls.__qualname__ = qualname - - return cls - - -def create_object(typ: type[T]) -> T: - "Creates an instance of a type." - - if issubclass(typ, Exception): - # exception types need special treatment - e = typ.__new__(typ) - return typing.cast(T, e) - else: - return object.__new__(typ) - - -if sys.version_info >= (3, 9): - TypeOrGeneric = Union[type, types.GenericAlias] - -else: - TypeOrGeneric = object - - -def is_generic_instance(obj: Any, typ: TypeLike) -> bool: - """ - Returns whether an object is an instance of a generic class, a standard class or of a subclass thereof. - - This function checks the following items recursively: - * items of a list - * keys and values of a dictionary - * members of a set - * items of a tuple - * members of a union type - - :param obj: The (possibly generic container) object to check recursively. - :param typ: The expected type of the object. - """ - - if isinstance(typ, typing.ForwardRef): - fwd: typing.ForwardRef = typ - identifier = fwd.__forward_arg__ - typ = eval(identifier) - if isinstance(typ, type): - return isinstance(obj, typ) - else: - return False - - # generic types (e.g. list, dict, set, etc.) - origin_type = typing.get_origin(typ) - if origin_type is list: - if not isinstance(obj, list): - return False - (list_item_type,) = typing.get_args(typ) # unpack single tuple element - list_obj: list = obj - return all(is_generic_instance(item, list_item_type) for item in list_obj) - elif origin_type is dict: - if not isinstance(obj, dict): - return False - key_type, value_type = typing.get_args(typ) - dict_obj: dict = obj - return all( - is_generic_instance(key, key_type) and is_generic_instance(value, value_type) - for key, value in dict_obj.items() - ) - elif origin_type is set: - if not isinstance(obj, set): - return False - (set_member_type,) = typing.get_args(typ) # unpack single tuple element - set_obj: set = obj - return all(is_generic_instance(item, set_member_type) for item in set_obj) - elif origin_type is tuple: - if not isinstance(obj, tuple): - return False - return all( - is_generic_instance(item, tuple_item_type) - for tuple_item_type, item in zip( - (tuple_item_type for tuple_item_type in typing.get_args(typ)), - (item for item in obj), - strict=False, - ) - ) - elif origin_type is Union: - return any(is_generic_instance(obj, member_type) for member_type in typing.get_args(typ)) - elif isinstance(typ, type): - return isinstance(obj, typ) - else: - raise TypeError(f"expected `type` but got: {typ}") - - -class RecursiveChecker: - _pred: Callable[[type, Any], bool] | None - - def __init__(self, pred: Callable[[type, Any], bool]) -> None: - """ - Creates a checker to verify if a predicate applies to all nested member properties of an object recursively. - - :param pred: The predicate to test on member properties. Takes a property type and a property value. - """ - - self._pred = pred - - def pred(self, typ: type, obj: Any) -> bool: - "Acts as a workaround for the type checker mypy." - - assert self._pred is not None - return self._pred(typ, obj) - - def check(self, typ: TypeLike, obj: Any) -> bool: - """ - Checks if a predicate applies to all nested member properties of an object recursively. - - :param typ: The type to recurse into. - :param obj: The object to inspect recursively. Must be an instance of the given type. - :returns: True if all member properties pass the filter predicate. - """ - - # check for well-known types - if ( - typ is type(None) - or typ is bool - or typ is int - or typ is float - or typ is str - or typ is bytes - or typ is datetime.datetime - or typ is datetime.date - or typ is datetime.time - or typ is uuid.UUID - ): - return self.pred(typing.cast(type, typ), obj) - - # generic types (e.g. list, dict, set, etc.) - origin_type = typing.get_origin(typ) - if origin_type is list: - if not isinstance(obj, list): - raise TypeError(f"expected `list` but got: {obj}") - (list_item_type,) = typing.get_args(typ) # unpack single tuple element - list_obj: list = obj - return all(self.check(list_item_type, item) for item in list_obj) - elif origin_type is dict: - if not isinstance(obj, dict): - raise TypeError(f"expected `dict` but got: {obj}") - key_type, value_type = typing.get_args(typ) - dict_obj: dict = obj - return all(self.check(value_type, item) for item in dict_obj.values()) - elif origin_type is set: - if not isinstance(obj, set): - raise TypeError(f"expected `set` but got: {obj}") - (set_member_type,) = typing.get_args(typ) # unpack single tuple element - set_obj: set = obj - return all(self.check(set_member_type, item) for item in set_obj) - elif origin_type is tuple: - if not isinstance(obj, tuple): - raise TypeError(f"expected `tuple` but got: {obj}") - return all( - self.check(tuple_item_type, item) - for tuple_item_type, item in zip( - (tuple_item_type for tuple_item_type in typing.get_args(typ)), - (item for item in obj), - strict=False, - ) - ) - elif origin_type is Union: - return self.pred(typ, obj) # type: ignore[arg-type] - - if not inspect.isclass(typ): - raise TypeError(f"expected `type` but got: {typ}") - - # enumeration type - if issubclass(typ, enum.Enum): - if not isinstance(obj, enum.Enum): - raise TypeError(f"expected `{typ}` but got: {obj}") - return self.pred(typ, obj) - - # class types with properties - if is_named_tuple_type(typ): - if not isinstance(obj, tuple): - raise TypeError(f"expected `NamedTuple` but got: {obj}") - return all( - self.check(field_type, getattr(obj, field_name)) - for field_name, field_type in typing.get_type_hints(typ).items() - ) - elif is_dataclass_type(typ): - if not isinstance(obj, typ): - raise TypeError(f"expected `{typ}` but got: {obj}") - resolved_hints = get_resolved_hints(typ) - return all( - self.check(resolved_hints[field.name], getattr(obj, field.name)) for field in dataclasses.fields(typ) - ) - else: - if not isinstance(obj, typ): - raise TypeError(f"expected `{typ}` but got: {obj}") - return all( - self.check(property_type, getattr(obj, property_name)) - for property_name, property_type in get_class_properties(typ) - ) - - -def check_recursive( - obj: object, - /, - *, - pred: Callable[[type, Any], bool] | None = None, - type_pred: Callable[[type], bool] | None = None, - value_pred: Callable[[Any], bool] | None = None, -) -> bool: - """ - Checks if a predicate applies to all nested member properties of an object recursively. - - :param obj: The object to inspect recursively. - :param pred: The predicate to test on member properties. Takes a property type and a property value. - :param type_pred: Constrains the check to properties of an expected type. Properties of other types pass automatically. - :param value_pred: Verifies a condition on member property values (of an expected type). - :returns: True if all member properties pass the filter predicate(s). - """ - - if type_pred is not None and value_pred is not None: - if pred is not None: - raise TypeError("filter predicate not permitted when type and value predicates are present") - - type_p: Callable[[type[T]], bool] = type_pred - value_p: Callable[[T], bool] = value_pred - pred = lambda typ, obj: not type_p(typ) or value_p(obj) # noqa: E731 - - elif value_pred is not None: - if pred is not None: - raise TypeError("filter predicate not permitted when value predicate is present") - - value_only_p: Callable[[T], bool] = value_pred - pred = lambda typ, obj: value_only_p(obj) # noqa: E731 - - elif type_pred is not None: - raise TypeError("value predicate required when type predicate is present") - - elif pred is None: - pred = lambda typ, obj: True # noqa: E731 - - return RecursiveChecker(pred).check(type(obj), obj) - - -def is_unwrapped_body_param(param_type: Any) -> bool: - """ - Check if a parameter type represents an unwrapped body parameter. - An unwrapped body parameter is an Annotated type with Body(embed=False) - - This is used to determine whether request parameters should be flattened - in OpenAPI specs and client libraries (matching FastAPI's embed=False behavior). - - Args: - param_type: The parameter type annotation to check - - Returns: - True if the parameter should be treated as an unwrapped body parameter - """ - # Check if it's Annotated with Body(embed=False) - if typing.get_origin(param_type) is Annotated: - args = typing.get_args(param_type) - base_type = args[0] - metadata = args[1:] - - # Look for Body annotation with embed=False - # Body() returns a FieldInfo object, so we check for that type and the embed attribute - for item in metadata: - if isinstance(item, FieldInfo) and hasattr(item, "embed") and not item.embed: - return inspect.isclass(base_type) and issubclass(base_type, BaseModel) - - return False diff --git a/src/llama_stack/strong_typing/mapping.py b/src/llama_stack/strong_typing/mapping.py deleted file mode 100644 index d6c1a3172a..0000000000 --- a/src/llama_stack/strong_typing/mapping.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -""" -Type-safe data interchange for Python data classes. - -:see: https://github.com/hunyadi/strong_typing -""" - -import keyword - -from .auxiliary import Alias -from .inspection import get_annotation - - -def python_field_to_json_property(python_id: str, python_type: object | None = None) -> str: - """ - Map a Python field identifier to a JSON property name. - - Authors may use an underscore appended at the end of a Python identifier as per PEP 8 if it clashes with a Python - keyword: e.g. `in` would become `in_` and `from` would become `from_`. Remove these suffixes when exporting to JSON. - - Authors may supply an explicit alias with the type annotation `Alias`, e.g. `Annotated[MyType, Alias("alias")]`. - """ - - if python_type is not None: - alias = get_annotation(python_type, Alias) - if alias: - return alias.name - - if python_id.endswith("_"): - id = python_id[:-1] - if keyword.iskeyword(id): - return id - - return python_id diff --git a/src/llama_stack/strong_typing/name.py b/src/llama_stack/strong_typing/name.py deleted file mode 100644 index 60501ac431..0000000000 --- a/src/llama_stack/strong_typing/name.py +++ /dev/null @@ -1,188 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -""" -Type-safe data interchange for Python data classes. - -:see: https://github.com/hunyadi/strong_typing -""" - -import typing -from typing import Any, Literal, Union - -from .auxiliary import _auxiliary_types -from .inspection import ( - TypeLike, - is_generic_dict, - is_generic_list, - is_generic_sequence, - is_type_optional, - is_type_union, - unwrap_generic_dict, - unwrap_generic_list, - unwrap_generic_sequence, - unwrap_optional_type, - unwrap_union_types, -) - - -class TypeFormatter: - """ - Type formatter. - - :param use_union_operator: Whether to emit union types as `X | Y` as per PEP 604. - """ - - use_union_operator: bool - - def __init__(self, use_union_operator: bool = False) -> None: - self.use_union_operator = use_union_operator - - def union_to_str(self, data_type_args: tuple[TypeLike, ...]) -> str: - if self.use_union_operator: - return " | ".join(self.python_type_to_str(t) for t in data_type_args) - else: - if len(data_type_args) == 2 and type(None) in data_type_args: - # Optional[T] is represented as Union[T, None] - origin_name = "Optional" - data_type_args = tuple(t for t in data_type_args if t is not type(None)) - else: - origin_name = "Union" - - args = ", ".join(self.python_type_to_str(t) for t in data_type_args) - return f"{origin_name}[{args}]" - - def plain_type_to_str(self, data_type: TypeLike) -> str: - "Returns the string representation of a Python type without metadata." - - # return forward references as the annotation string - if isinstance(data_type, typing.ForwardRef): - fwd: typing.ForwardRef = data_type - return fwd.__forward_arg__ - elif isinstance(data_type, str): - return data_type - - origin = typing.get_origin(data_type) - if origin is not None: - data_type_args = typing.get_args(data_type) - - if origin is dict: # Dict[T] - origin_name = "Dict" - elif origin is list: # List[T] - origin_name = "List" - elif origin is set: # Set[T] - origin_name = "Set" - elif origin is Union: - return self.union_to_str(data_type_args) - elif origin is Literal: - args = ", ".join(repr(arg) for arg in data_type_args) - return f"Literal[{args}]" - else: - origin_name = origin.__name__ - - args = ", ".join(self.python_type_to_str(t) for t in data_type_args) - return f"{origin_name}[{args}]" - - return data_type.__name__ - - def python_type_to_str(self, data_type: TypeLike) -> str: - "Returns the string representation of a Python type." - - if data_type is type(None): - return "None" - - # use compact name for alias types - name = _auxiliary_types.get(data_type) - if name is not None: - return name - - metadata = getattr(data_type, "__metadata__", None) - if metadata is not None: - # type is Annotated[T, ...] - metatuple: tuple[Any, ...] = metadata - arg = typing.get_args(data_type)[0] - - # check for auxiliary types with user-defined annotations - metaset = set(metatuple) - for auxiliary_type, auxiliary_name in _auxiliary_types.items(): - auxiliary_arg = typing.get_args(auxiliary_type)[0] - if arg is not auxiliary_arg: - continue - - auxiliary_metatuple: tuple[Any, ...] | None = getattr(auxiliary_type, "__metadata__", None) - if auxiliary_metatuple is None: - continue - - if metaset.issuperset(auxiliary_metatuple): - # type is an auxiliary type with extra annotations - auxiliary_args = ", ".join(repr(m) for m in metatuple if m not in auxiliary_metatuple) - return f"Annotated[{auxiliary_name}, {auxiliary_args}]" - - # type is an annotated type - args = ", ".join(repr(m) for m in metatuple) - return f"Annotated[{self.plain_type_to_str(arg)}, {args}]" - else: - # type is a regular type - return self.plain_type_to_str(data_type) - - -def python_type_to_str(data_type: TypeLike, use_union_operator: bool = False) -> str: - """ - Returns the string representation of a Python type. - - :param use_union_operator: Whether to emit union types as `X | Y` as per PEP 604. - """ - - fmt = TypeFormatter(use_union_operator) - return fmt.python_type_to_str(data_type) - - -def python_type_to_name(data_type: TypeLike, force: bool = False) -> str: - """ - Returns the short name of a Python type. - - :param force: Whether to produce a name for composite types such as generics. - """ - - # use compact name for alias types - name = _auxiliary_types.get(data_type) - if name is not None: - return name - - # unwrap annotated types - metadata = getattr(data_type, "__metadata__", None) - if metadata is not None: - # type is Annotated[T, ...] - arg = typing.get_args(data_type)[0] - return python_type_to_name(arg, force=force) - - if force: - # generic types - if is_type_optional(data_type, strict=True): - inner_name = python_type_to_name(unwrap_optional_type(data_type), force=True) - return f"Optional__{inner_name}" - elif is_generic_list(data_type): - item_name = python_type_to_name(unwrap_generic_list(data_type), force=True) - return f"List__{item_name}" - elif is_generic_sequence(data_type): - # Treat Sequence the same as List for schema generation purposes - item_name = python_type_to_name(unwrap_generic_sequence(data_type), force=True) - return f"List__{item_name}" - elif is_generic_dict(data_type): - key_type, value_type = unwrap_generic_dict(data_type) - key_name = python_type_to_name(key_type, force=True) - value_name = python_type_to_name(value_type, force=True) - return f"Dict__{key_name}__{value_name}" - elif is_type_union(data_type): - member_types = unwrap_union_types(data_type) - member_names = "__".join(python_type_to_name(member_type, force=True) for member_type in member_types) - return f"Union__{member_names}" - - # named system or user-defined type - if hasattr(data_type, "__name__") and not typing.get_args(data_type): - return data_type.__name__ - - raise TypeError(f"cannot assign a simple name to type: {data_type}") diff --git a/src/llama_stack/strong_typing/py.typed b/src/llama_stack/strong_typing/py.typed deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/llama_stack/strong_typing/schema.py b/src/llama_stack/strong_typing/schema.py deleted file mode 100644 index 916690e414..0000000000 --- a/src/llama_stack/strong_typing/schema.py +++ /dev/null @@ -1,791 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -""" -Type-safe data interchange for Python data classes. - -:see: https://github.com/hunyadi/strong_typing -""" - -import collections.abc -import dataclasses -import datetime -import decimal -import enum -import functools -import inspect -import json -import types -import typing -import uuid -from collections.abc import Callable -from copy import deepcopy -from typing import ( - Annotated, - Any, - ClassVar, - Literal, - TypeVar, - Union, - overload, -) - -import jsonschema - -from . import docstring -from .auxiliary import ( - Alias, - IntegerRange, - MaxLength, - MinLength, - Precision, - get_auxiliary_format, -) -from .core import JsonArray, JsonObject, JsonType, Schema, StrictJsonType -from .inspection import ( - TypeLike, - enum_value_types, - get_annotation, - get_class_properties, - is_type_enum, - is_type_like, - is_type_optional, - unwrap_optional_type, -) -from .name import python_type_to_name -from .serialization import object_to_json - -# determines the maximum number of distinct enum members up to which a Dict[EnumType, Any] is converted into a JSON -# schema with explicitly listed properties (rather than employing a pattern constraint on property names) -OBJECT_ENUM_EXPANSION_LIMIT = 4 - - -T = TypeVar("T") - - -def get_class_docstrings(data_type: type) -> tuple[str | None, str | None]: - docstr = docstring.parse_type(data_type) - - # check if class has a doc-string other than the auto-generated string assigned by @dataclass - if docstring.has_default_docstring(data_type): - return None, None - - return docstr.short_description, docstr.long_description - - -def get_class_property_docstrings( - data_type: type, transform_fun: Callable[[type, str, str], str] | None = None -) -> dict[str, str]: - """ - Extracts the documentation strings associated with the properties of a composite type. - - :param data_type: The object whose properties to iterate over. - :param transform_fun: An optional function that maps a property documentation string to a custom tailored string. - :returns: A dictionary mapping property names to descriptions. - """ - - result: dict[str, str] = {} - # Only try to get MRO if data_type is actually a class - # Special types like Literal, Union, etc. don't have MRO - if not inspect.isclass(data_type): - return result - - for base in inspect.getmro(data_type): - docstr = docstring.parse_type(base) - for param in docstr.params.values(): - if param.name in result: - continue - - if transform_fun: - description = transform_fun(data_type, param.name, param.description) - else: - description = param.description - - result[param.name] = description - return result - - -def docstring_to_schema(data_type: type) -> Schema: - short_description, long_description = get_class_docstrings(data_type) - schema: Schema = { - "title": python_type_to_name(data_type, force=True), - } - - description = "\n".join(filter(None, [short_description, long_description])) - if description: - schema["description"] = description - return schema - - -def id_from_ref(data_type: typing.ForwardRef | str | type) -> str: - "Extracts the name of a possibly forward-referenced type." - - if isinstance(data_type, typing.ForwardRef): - forward_type: typing.ForwardRef = data_type - return forward_type.__forward_arg__ - elif isinstance(data_type, str): - return data_type - else: - return data_type.__name__ - - -def type_from_ref(data_type: typing.ForwardRef | str | type) -> tuple[str, type]: - "Creates a type from a forward reference." - - if isinstance(data_type, typing.ForwardRef): - forward_type: typing.ForwardRef = data_type - true_type = eval(forward_type.__forward_code__) - return forward_type.__forward_arg__, true_type - elif isinstance(data_type, str): - true_type = eval(data_type) - return data_type, true_type - else: - return data_type.__name__, data_type - - -@dataclasses.dataclass -class TypeCatalogEntry: - schema: Schema | None - identifier: str - examples: JsonType | None = None - - -class TypeCatalog: - "Maintains an association of well-known Python types to their JSON schema." - - _by_type: dict[TypeLike, TypeCatalogEntry] - _by_name: dict[str, TypeCatalogEntry] - - def __init__(self) -> None: - self._by_type = {} - self._by_name = {} - - def __contains__(self, data_type: TypeLike) -> bool: - if isinstance(data_type, typing.ForwardRef): - fwd: typing.ForwardRef = data_type - name = fwd.__forward_arg__ - return name in self._by_name - else: - return data_type in self._by_type - - def add( - self, - data_type: TypeLike, - schema: Schema | None, - identifier: str, - examples: list[JsonType] | None = None, - ) -> None: - if isinstance(data_type, typing.ForwardRef): - raise TypeError("forward references cannot be used to register a type") - - if data_type in self._by_type: - raise ValueError(f"type {data_type} is already registered in the catalog") - - entry = TypeCatalogEntry(schema, identifier, examples) - self._by_type[data_type] = entry - self._by_name[identifier] = entry - - def get(self, data_type: TypeLike) -> TypeCatalogEntry: - if isinstance(data_type, typing.ForwardRef): - fwd: typing.ForwardRef = data_type - name = fwd.__forward_arg__ - return self._by_name[name] - else: - return self._by_type[data_type] - - -@dataclasses.dataclass -class SchemaOptions: - definitions_path: str = "#/definitions/" - use_descriptions: bool = True - use_examples: bool = True - property_description_fun: Callable[[type, str, str], str] | None = None - - -class JsonSchemaGenerator: - "Creates a JSON schema with user-defined type definitions." - - type_catalog: ClassVar[TypeCatalog] = TypeCatalog() - types_used: dict[str, TypeLike] - options: SchemaOptions - - def __init__(self, options: SchemaOptions | None = None): - if options is None: - self.options = SchemaOptions() - else: - self.options = options - self.types_used = {} - - @functools.singledispatchmethod - def _metadata_to_schema(self, arg: object) -> Schema: - # unrecognized annotation - return {} - - @_metadata_to_schema.register - def _(self, arg: IntegerRange) -> Schema: - return {"minimum": arg.minimum, "maximum": arg.maximum} - - @_metadata_to_schema.register - def _(self, arg: Precision) -> Schema: - return { - "multipleOf": 10 ** (-arg.decimal_digits), - "exclusiveMinimum": -(10**arg.integer_digits), - "exclusiveMaximum": (10**arg.integer_digits), - } - - @_metadata_to_schema.register - def _(self, arg: MinLength) -> Schema: - return {"minLength": arg.value} - - @_metadata_to_schema.register - def _(self, arg: MaxLength) -> Schema: - return {"maxLength": arg.value} - - def _with_metadata(self, type_schema: Schema, metadata: tuple[Any, ...] | None) -> Schema: - if metadata: - for m in metadata: - type_schema.update(self._metadata_to_schema(m)) - return type_schema - - def _simple_type_to_schema(self, typ: TypeLike, json_schema_extra: dict | None = None) -> Schema | None: - """ - Returns the JSON schema associated with a simple, unrestricted type. - - :returns: The schema for a simple type, or `None`. - """ - - if typ is type(None): - return {"type": "null"} - elif typ is bool: - return {"type": "boolean"} - elif typ is int: - return {"type": "integer"} - elif typ is float: - return {"type": "number"} - elif typ is str: - if json_schema_extra and "contentEncoding" in json_schema_extra: - return { - "type": "string", - "contentEncoding": json_schema_extra["contentEncoding"], - } - return {"type": "string"} - elif typ is bytes: - return {"type": "string", "contentEncoding": "base64"} - elif typ is datetime.datetime: - # 2018-11-13T20:20:39+00:00 - return { - "type": "string", - "format": "date-time", - } - elif typ is datetime.date: - # 2018-11-13 - return {"type": "string", "format": "date"} - elif typ is datetime.time: - # 20:20:39+00:00 - return {"type": "string", "format": "time"} - elif typ is decimal.Decimal: - return {"type": "number"} - elif typ is uuid.UUID: - # f81d4fae-7dec-11d0-a765-00a0c91e6bf6 - return {"type": "string", "format": "uuid"} - elif typ is Any: - return { - "oneOf": [ - {"type": "null"}, - {"type": "boolean"}, - {"type": "number"}, - {"type": "string"}, - {"type": "array"}, - {"type": "object"}, - ] - } - elif typ is JsonObject: - return {"type": "object"} - elif typ is JsonArray: - return {"type": "array"} - else: - # not a simple type - return None - - def type_to_schema( - self, - data_type: TypeLike, - force_expand: bool = False, - json_schema_extra: dict | None = None, - ) -> Schema: - common_info = {} - if json_schema_extra and "deprecated" in json_schema_extra: - common_info["deprecated"] = json_schema_extra["deprecated"] - return self._type_to_schema(data_type, force_expand, json_schema_extra) | common_info - - def _type_to_schema( - self, - data_type: TypeLike, - force_expand: bool = False, - json_schema_extra: dict | None = None, - ) -> Schema: - """ - Returns the JSON schema associated with a type. - - :param data_type: The Python type whose JSON schema to return. - :param force_expand: Forces a JSON schema to be returned even if the type is registered in the catalog of known types. - :returns: The JSON schema associated with the type. - """ - - # short-circuit for common simple types - schema = self._simple_type_to_schema(data_type, json_schema_extra) - if schema is not None: - return schema - - # types registered in the type catalog of well-known types - type_catalog = JsonSchemaGenerator.type_catalog - if not force_expand and data_type in type_catalog: - # user-defined type - identifier = type_catalog.get(data_type).identifier - self.types_used.setdefault(identifier, data_type) - return {"$ref": f"{self.options.definitions_path}{identifier}"} - - # unwrap annotated types - metadata = getattr(data_type, "__metadata__", None) - if metadata is not None: - # type is Annotated[T, ...] - typ = typing.get_args(data_type)[0] - schema = self._simple_type_to_schema(typ) - if schema is not None: - # recognize well-known auxiliary types - fmt = get_auxiliary_format(data_type) - if fmt is not None: - schema.update({"format": fmt}) - return schema - else: - return self._with_metadata(schema, metadata) - - else: - # type is a regular type - typ = data_type - - if isinstance(typ, typing.ForwardRef) or isinstance(typ, str): - if force_expand: - identifier, true_type = type_from_ref(typ) - return self.type_to_schema(true_type, force_expand=True) - else: - try: - identifier, true_type = type_from_ref(typ) - self.types_used[identifier] = true_type - except NameError: - identifier = id_from_ref(typ) - - return {"$ref": f"{self.options.definitions_path}{identifier}"} - - if is_type_enum(typ): - enum_type: type[enum.Enum] = typ - value_types = enum_value_types(enum_type) - if len(value_types) != 1: - raise ValueError( - f"enumerations must have a consistent member value type but several types found: {value_types}" - ) - enum_value_type = value_types.pop() - - enum_schema: Schema - if enum_value_type is bool or enum_value_type is int or enum_value_type is float or enum_value_type is str: - if enum_value_type is bool: - enum_schema_type = "boolean" - elif enum_value_type is int: - enum_schema_type = "integer" - elif enum_value_type is float: - enum_schema_type = "number" - elif enum_value_type is str: - enum_schema_type = "string" - - enum_schema = { - "type": enum_schema_type, - "enum": [object_to_json(e.value) for e in enum_type], - } - if self.options.use_descriptions: - enum_schema.update(docstring_to_schema(typ)) - return enum_schema - else: - enum_schema = self.type_to_schema(enum_value_type) - if self.options.use_descriptions: - enum_schema.update(docstring_to_schema(typ)) - return enum_schema - - origin_type = typing.get_origin(typ) - if origin_type is list: - (list_type,) = typing.get_args(typ) # unpack single tuple element - return {"type": "array", "items": self.type_to_schema(list_type)} - elif origin_type is collections.abc.Sequence: - # Treat Sequence the same as list for JSON schema (both are arrays) - (sequence_type,) = typing.get_args(typ) # unpack single tuple element - return {"type": "array", "items": self.type_to_schema(sequence_type)} - elif origin_type is dict: - key_type, value_type = typing.get_args(typ) - if not (key_type is str or key_type is int or is_type_enum(key_type)): - raise ValueError("`dict` with key type not coercible to `str` is not supported") - - dict_schema: Schema - value_schema = self.type_to_schema(value_type) - if is_type_enum(key_type): - enum_values = [str(e.value) for e in key_type] - if len(enum_values) > OBJECT_ENUM_EXPANSION_LIMIT: - dict_schema = { - "propertyNames": {"pattern": "^(" + "|".join(enum_values) + ")$"}, - "additionalProperties": value_schema, - } - else: - dict_schema = { - "properties": dict.fromkeys(enum_values, value_schema), - "additionalProperties": False, - } - else: - dict_schema = {"additionalProperties": value_schema} - - schema = {"type": "object"} - schema.update(dict_schema) - return schema - elif origin_type is set: - (set_type,) = typing.get_args(typ) # unpack single tuple element - return { - "type": "array", - "items": self.type_to_schema(set_type), - "uniqueItems": True, - } - elif origin_type is tuple: - args = typing.get_args(typ) - return { - "type": "array", - "minItems": len(args), - "maxItems": len(args), - "prefixItems": [self.type_to_schema(member_type) for member_type in args], - } - elif origin_type in (Union, types.UnionType): - discriminator = None - if typing.get_origin(data_type) is Annotated: - discriminator = typing.get_args(data_type)[1].discriminator - ret: Schema = {"oneOf": [self.type_to_schema(union_type) for union_type in typing.get_args(typ)]} - if discriminator: - # for each union type, we need to read the value of the discriminator - mapping: dict[str, JsonType] = {} - for union_type in typing.get_args(typ): - props = self.type_to_schema(union_type, force_expand=True)["properties"] - # mypy is confused here because JsonType allows multiple types, some of them - # not indexable (bool?) or not indexable by string (list?). The correctness of - # types depends on correct model definitions. Hence multiple ignore statements below. - discriminator_value = props[discriminator]["default"] # type: ignore[index,call-overload] - mapping[discriminator_value] = self.type_to_schema(union_type)["$ref"] # type: ignore[index] - - ret["discriminator"] = { - "propertyName": discriminator, - "mapping": mapping, - } - return ret - elif origin_type is Literal: - literal_args = typing.get_args(typ) - if len(literal_args) == 1: - (literal_value,) = literal_args - schema = self.type_to_schema(type(literal_value)) - schema["const"] = literal_value - return schema - elif len(literal_args) > 1: - first_value = literal_args[0] - schema = self.type_to_schema(type(first_value)) - schema["enum"] = list(literal_args) - return schema - else: - return {"enum": []} - elif origin_type is type: - (concrete_type,) = typing.get_args(typ) # unpack single tuple element - return {"const": self.type_to_schema(concrete_type, force_expand=True)} - elif origin_type is collections.abc.AsyncIterator: - (concrete_type,) = typing.get_args(typ) - return self.type_to_schema(concrete_type) - - # dictionary of class attributes - members = dict(inspect.getmembers(typ, lambda a: not inspect.isroutine(a))) - - property_docstrings = get_class_property_docstrings(typ, self.options.property_description_fun) - properties: dict[str, Schema] = {} - required: list[str] = [] - for property_name, property_type in get_class_properties(typ): - # rename property if an alias name is specified - alias = get_annotation(property_type, Alias) - if alias: - output_name = alias.name - else: - output_name = property_name - - defaults = {} - json_schema_extra = None - if "model_fields" in members: - f = members["model_fields"] - defaults = {k: finfo.default for k, finfo in f.items()} - if output_name in f: - finfo = f[output_name] - json_schema_extra = finfo.json_schema_extra or {} - if finfo.deprecated: - json_schema_extra["deprecated"] = True - - if is_type_optional(property_type): - optional_type: type = unwrap_optional_type(property_type) - property_def = self.type_to_schema(optional_type, json_schema_extra=json_schema_extra) - else: - property_def = self.type_to_schema(property_type, json_schema_extra=json_schema_extra) - required.append(output_name) - - # check if attribute has a default value initializer - if defaults.get(property_name) is not None: - def_value = defaults[property_name] - # check if value can be directly represented in JSON - if isinstance( - def_value, - ( - bool, - int, - float, - str, - enum.Enum, - datetime.datetime, - datetime.date, - datetime.time, - ), - ): - property_def["default"] = object_to_json(def_value) - - # add property docstring if available - property_doc = property_docstrings.get(property_name) - if property_doc: - # print(output_name, property_doc) - property_def.pop("title", None) - property_def["description"] = property_doc - - properties[output_name] = property_def - - schema = {"type": "object"} - if len(properties) > 0: - schema["properties"] = typing.cast(JsonType, properties) - schema["additionalProperties"] = False - if len(required) > 0: - schema["required"] = typing.cast(JsonType, required) - if self.options.use_descriptions: - schema.update(docstring_to_schema(typ)) - return schema - - def _type_to_schema_with_lookup(self, data_type: TypeLike) -> Schema: - """ - Returns the JSON schema associated with a type that may be registered in the catalog of known types. - - :param data_type: The type whose JSON schema we seek. - :returns: The JSON schema associated with the type. - """ - - entry = JsonSchemaGenerator.type_catalog.get(data_type) - if entry.schema is None: - type_schema = self.type_to_schema(data_type, force_expand=True) - else: - type_schema = deepcopy(entry.schema) - - # add descriptive text (if present) - if self.options.use_descriptions: - if isinstance(data_type, type) and not isinstance(data_type, typing.ForwardRef): - type_schema.update(docstring_to_schema(data_type)) - - # add example (if present) - if self.options.use_examples and entry.examples: - type_schema["examples"] = entry.examples - - return type_schema - - def classdef_to_schema(self, data_type: TypeLike, force_expand: bool = False) -> tuple[Schema, dict[str, Schema]]: - """ - Returns the JSON schema associated with a type and any nested types. - - :param data_type: The type whose JSON schema to return. - :param force_expand: True if a full JSON schema is to be returned even for well-known types; false if a schema - reference is to be used for well-known types. - :returns: A tuple of the JSON schema, and a mapping between nested type names and their corresponding schema. - """ - - if not is_type_like(data_type): - raise TypeError(f"expected a type-like object but got: {data_type}") - - self.types_used = {} - try: - type_schema = self.type_to_schema(data_type, force_expand=force_expand) - - types_defined: dict[str, Schema] = {} - while len(self.types_used) > len(types_defined): - # make a snapshot copy; original collection is going to be modified - types_undefined = { - sub_name: sub_type - for sub_name, sub_type in self.types_used.items() - if sub_name not in types_defined - } - - # expand undefined types, which may lead to additional types to be defined - for sub_name, sub_type in types_undefined.items(): - types_defined[sub_name] = self._type_to_schema_with_lookup(sub_type) - - type_definitions = dict(sorted(types_defined.items())) - finally: - self.types_used = {} - - return type_schema, type_definitions - - -class Validator(enum.Enum): - "Defines constants for JSON schema standards." - - Draft7 = jsonschema.Draft7Validator - Draft201909 = jsonschema.Draft201909Validator - Draft202012 = jsonschema.Draft202012Validator - Latest = jsonschema.Draft202012Validator - - -def classdef_to_schema( - data_type: TypeLike, - options: SchemaOptions | None = None, - validator: Validator = Validator.Latest, -) -> Schema: - """ - Returns the JSON schema corresponding to the given type. - - :param data_type: The Python type used to generate the JSON schema - :returns: A JSON object that you can serialize to a JSON string with json.dump or json.dumps - :raises TypeError: Indicates that the generated JSON schema does not validate against the desired meta-schema. - """ - - # short-circuit with an error message when passing invalid data - if not is_type_like(data_type): - raise TypeError(f"expected a type-like object but got: {data_type}") - - generator = JsonSchemaGenerator(options) - type_schema, type_definitions = generator.classdef_to_schema(data_type) - - class_schema: Schema = {} - if type_definitions: - class_schema["definitions"] = typing.cast(JsonType, type_definitions) - class_schema.update(type_schema) - - validator_id = validator.value.META_SCHEMA["$id"] - try: - validator.value.check_schema(class_schema) - except jsonschema.exceptions.SchemaError: - raise TypeError(f"schema does not validate against meta-schema <{validator_id}>") - - schema = {"$schema": validator_id} - schema.update(class_schema) - return schema - - -def validate_object(data_type: TypeLike, json_dict: JsonType) -> None: - """ - Validates if the JSON dictionary object conforms to the expected type. - - :param data_type: The type to match against. - :param json_dict: A JSON object obtained with `json.load` or `json.loads`. - :raises jsonschema.exceptions.ValidationError: Indicates that the JSON object cannot represent the type. - """ - - schema_dict = classdef_to_schema(data_type) - jsonschema.validate(json_dict, schema_dict, format_checker=jsonschema.FormatChecker()) - - -def print_schema(data_type: type) -> None: - """Pretty-prints the JSON schema corresponding to the type.""" - - s = classdef_to_schema(data_type) - print(json.dumps(s, indent=4)) - - -def get_schema_identifier(data_type: type) -> str | None: - if data_type in JsonSchemaGenerator.type_catalog: - return JsonSchemaGenerator.type_catalog.get(data_type).identifier - else: - return None - - -def register_schema( - data_type: T, - schema: Schema | None = None, - name: str | None = None, - examples: list[JsonType] | None = None, -) -> T: - """ - Associates a type with a JSON schema definition. - - :param data_type: The type to associate with a JSON schema. - :param schema: The schema to associate the type with. Derived automatically if omitted. - :param name: The name used for looking uo the type. Determined automatically if omitted. - :returns: The input type. - """ - - JsonSchemaGenerator.type_catalog.add( - data_type, - schema, - name if name is not None else python_type_to_name(data_type), - examples, - ) - return data_type - - -@overload -def json_schema_type(cls: type[T], /) -> type[T]: ... - - -@overload -def json_schema_type(cls: None, *, schema: Schema | None = None) -> Callable[[type[T]], type[T]]: ... - - -def json_schema_type( - cls: type[T] | None = None, - *, - schema: Schema | None = None, - examples: list[JsonType] | None = None, -) -> type[T] | Callable[[type[T]], type[T]]: - """Decorator to add user-defined schema definition to a class.""" - - def wrap(cls: type[T]) -> type[T]: - return register_schema(cls, schema, examples=examples) - - # see if decorator is used as @json_schema_type or @json_schema_type() - if cls is None: - # called with parentheses - return wrap - else: - # called as @json_schema_type without parentheses - return wrap(cls) - - -register_schema(JsonObject, name="JsonObject") -register_schema(JsonArray, name="JsonArray") - -register_schema( - JsonType, - name="JsonType", - examples=[ - { - "property1": None, - "property2": True, - "property3": 64, - "property4": "string", - "property5": ["item"], - "property6": {"key": "value"}, - } - ], -) -register_schema( - StrictJsonType, - name="StrictJsonType", - examples=[ - { - "property1": True, - "property2": 64, - "property3": "string", - "property4": ["item"], - "property5": {"key": "value"}, - } - ], -) diff --git a/src/llama_stack/strong_typing/serialization.py b/src/llama_stack/strong_typing/serialization.py deleted file mode 100644 index 3e34945add..0000000000 --- a/src/llama_stack/strong_typing/serialization.py +++ /dev/null @@ -1,97 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -""" -Type-safe data interchange for Python data classes. - -:see: https://github.com/hunyadi/strong_typing -""" - -import inspect -import json -import sys -from types import ModuleType -from typing import Any, TextIO, TypeVar - -from .core import JsonType -from .deserializer import create_deserializer -from .inspection import TypeLike -from .serializer import create_serializer - -T = TypeVar("T") - - -def object_to_json(obj: Any) -> JsonType: - """ - Converts a Python object to a representation that can be exported to JSON. - - * Fundamental types (e.g. numeric types) are written as is. - * Date and time types are serialized in the ISO 8601 format with time zone. - * A byte array is written as a string with Base64 encoding. - * UUIDs are written as a UUID string. - * Enumerations are written as their value. - * Containers (e.g. `list`, `dict`, `set`, `tuple`) are exported recursively. - * Objects with properties (including data class types) are converted to a dictionaries of key-value pairs. - """ - - typ: type = type(obj) - generator = create_serializer(typ) - return generator.generate(obj) - - -def json_to_object(typ: TypeLike, data: JsonType, *, context: ModuleType | None = None) -> object: - """ - Creates an object from a representation that has been de-serialized from JSON. - - When de-serializing a JSON object into a Python object, the following transformations are applied: - - * Fundamental types are parsed as `bool`, `int`, `float` or `str`. - * Date and time types are parsed from the ISO 8601 format with time zone into the corresponding Python type - `datetime`, `date` or `time` - * A byte array is read from a string with Base64 encoding into a `bytes` instance. - * UUIDs are extracted from a UUID string into a `uuid.UUID` instance. - * Enumerations are instantiated with a lookup on enumeration value. - * Containers (e.g. `list`, `dict`, `set`, `tuple`) are parsed recursively. - * Complex objects with properties (including data class types) are populated from dictionaries of key-value pairs - using reflection (enumerating type annotations). - - :raises TypeError: A de-serializing engine cannot be constructed for the input type. - :raises JsonKeyError: Deserialization for a class or union type has failed because a matching member was not found. - :raises JsonTypeError: Deserialization for data has failed due to a type mismatch. - """ - - # use caller context for evaluating types if no context is supplied - if context is None: - this_frame = inspect.currentframe() - if this_frame is not None: - caller_frame = this_frame.f_back - del this_frame - - if caller_frame is not None: - try: - context = sys.modules[caller_frame.f_globals["__name__"]] - finally: - del caller_frame - - parser = create_deserializer(typ, context) - return parser.parse(data) - - -def json_dump_string(json_object: JsonType) -> str: - "Dump an object as a JSON string with a compact representation." - - return json.dumps(json_object, ensure_ascii=False, check_circular=False, separators=(",", ":")) - - -def json_dump(json_object: JsonType, file: TextIO) -> None: - json.dump( - json_object, - file, - ensure_ascii=False, - check_circular=False, - separators=(",", ":"), - ) - file.write("\n") diff --git a/src/llama_stack/strong_typing/serializer.py b/src/llama_stack/strong_typing/serializer.py deleted file mode 100644 index 4a12a1f4b3..0000000000 --- a/src/llama_stack/strong_typing/serializer.py +++ /dev/null @@ -1,494 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -""" -Type-safe data interchange for Python data classes. - -:see: https://github.com/hunyadi/strong_typing -""" - -import abc -import base64 -import datetime -import enum -import functools -import inspect -import ipaddress -import sys -import typing -import uuid -from collections.abc import Callable -from types import FunctionType, MethodType, ModuleType -from typing import ( - Any, - Generic, - Literal, - NamedTuple, - TypeVar, - Union, -) - -from .core import JsonType -from .exception import JsonTypeError, JsonValueError -from .inspection import ( - TypeLike, - enum_value_types, - evaluate_type, - get_class_properties, - get_resolved_hints, - is_dataclass_type, - is_named_tuple_type, - is_reserved_property, - is_type_annotated, - is_type_enum, - unwrap_annotated_type, -) -from .mapping import python_field_to_json_property - -T = TypeVar("T") - - -class Serializer(abc.ABC, Generic[T]): - @abc.abstractmethod - def generate(self, data: T) -> JsonType: ... - - -class NoneSerializer(Serializer[None]): - def generate(self, data: None) -> None: - # can be directly represented in JSON - return None - - -class BoolSerializer(Serializer[bool]): - def generate(self, data: bool) -> bool: - # can be directly represented in JSON - return data - - -class IntSerializer(Serializer[int]): - def generate(self, data: int) -> int: - # can be directly represented in JSON - return data - - -class FloatSerializer(Serializer[float]): - def generate(self, data: float) -> float: - # can be directly represented in JSON - return data - - -class StringSerializer(Serializer[str]): - def generate(self, data: str) -> str: - # can be directly represented in JSON - return data - - -class BytesSerializer(Serializer[bytes]): - def generate(self, data: bytes) -> str: - return base64.b64encode(data).decode("ascii") - - -class DateTimeSerializer(Serializer[datetime.datetime]): - def generate(self, obj: datetime.datetime) -> str: - if obj.tzinfo is None: - raise JsonValueError(f"timestamp lacks explicit time zone designator: {obj}") - fmt = obj.isoformat() - if fmt.endswith("+00:00"): - fmt = f"{fmt[:-6]}Z" # Python's isoformat() does not support military time zones like "Zulu" for UTC - return fmt - - -class DateSerializer(Serializer[datetime.date]): - def generate(self, obj: datetime.date) -> str: - return obj.isoformat() - - -class TimeSerializer(Serializer[datetime.time]): - def generate(self, obj: datetime.time) -> str: - return obj.isoformat() - - -class UUIDSerializer(Serializer[uuid.UUID]): - def generate(self, obj: uuid.UUID) -> str: - return str(obj) - - -class IPv4Serializer(Serializer[ipaddress.IPv4Address]): - def generate(self, obj: ipaddress.IPv4Address) -> str: - return str(obj) - - -class IPv6Serializer(Serializer[ipaddress.IPv6Address]): - def generate(self, obj: ipaddress.IPv6Address) -> str: - return str(obj) - - -class EnumSerializer(Serializer[enum.Enum]): - def generate(self, obj: enum.Enum) -> int | str: - value = obj.value - if isinstance(value, int): - return value - return str(value) - - -class UntypedListSerializer(Serializer[list]): - def generate(self, obj: list) -> list[JsonType]: - return [object_to_json(item) for item in obj] - - -class UntypedDictSerializer(Serializer[dict]): - def generate(self, obj: dict) -> dict[str, JsonType]: - if obj and isinstance(next(iter(obj.keys())), enum.Enum): - iterator = ((key.value, object_to_json(value)) for key, value in obj.items()) - else: - iterator = ((str(key), object_to_json(value)) for key, value in obj.items()) - return dict(iterator) - - -class UntypedSetSerializer(Serializer[set]): - def generate(self, obj: set) -> list[JsonType]: - return [object_to_json(item) for item in obj] - - -class UntypedTupleSerializer(Serializer[tuple]): - def generate(self, obj: tuple) -> list[JsonType]: - return [object_to_json(item) for item in obj] - - -class TypedCollectionSerializer(Serializer, Generic[T]): - generator: Serializer[T] - - def __init__(self, item_type: type[T], context: ModuleType | None) -> None: - self.generator = _get_serializer(item_type, context) - - -class TypedListSerializer(TypedCollectionSerializer[T]): - def generate(self, obj: list[T]) -> list[JsonType]: - return [self.generator.generate(item) for item in obj] - - -class TypedStringDictSerializer(TypedCollectionSerializer[T]): - def __init__(self, value_type: type[T], context: ModuleType | None) -> None: - super().__init__(value_type, context) - - def generate(self, obj: dict[str, T]) -> dict[str, JsonType]: - return {key: self.generator.generate(value) for key, value in obj.items()} - - -class TypedEnumDictSerializer(TypedCollectionSerializer[T]): - def __init__( - self, - key_type: type[enum.Enum], - value_type: type[T], - context: ModuleType | None, - ) -> None: - super().__init__(value_type, context) - - value_types = enum_value_types(key_type) - if len(value_types) != 1: - raise JsonTypeError( - f"invalid key type, enumerations must have a consistent member value type but several types found: {value_types}" - ) - - value_type = value_types.pop() - if value_type is not str: - raise JsonTypeError("invalid enumeration key type, expected `enum.Enum` with string values") - - def generate(self, obj: dict[enum.Enum, T]) -> dict[str, JsonType]: - return {key.value: self.generator.generate(value) for key, value in obj.items()} - - -class TypedSetSerializer(TypedCollectionSerializer[T]): - def generate(self, obj: set[T]) -> JsonType: - return [self.generator.generate(item) for item in obj] - - -class TypedTupleSerializer(Serializer[tuple]): - item_generators: tuple[Serializer, ...] - - def __init__(self, item_types: tuple[type, ...], context: ModuleType | None) -> None: - self.item_generators = tuple(_get_serializer(item_type, context) for item_type in item_types) - - def generate(self, obj: tuple) -> list[JsonType]: - return [item_generator.generate(item) for item_generator, item in zip(self.item_generators, obj, strict=False)] - - -class CustomSerializer(Serializer): - converter: Callable[[object], JsonType] - - def __init__(self, converter: Callable[[object], JsonType]) -> None: - self.converter = converter - - def generate(self, obj: object) -> JsonType: - return self.converter(obj) - - -class FieldSerializer(Generic[T]): - """ - Serializes a Python object field into a JSON property. - - :param field_name: The name of the field in a Python class to read data from. - :param property_name: The name of the JSON property to write to a JSON `object`. - :param generator: A compatible serializer that can handle the field's type. - """ - - field_name: str - property_name: str - generator: Serializer - - def __init__(self, field_name: str, property_name: str, generator: Serializer[T]) -> None: - self.field_name = field_name - self.property_name = property_name - self.generator = generator - - def generate_field(self, obj: object, object_dict: dict[str, JsonType]) -> None: - value = getattr(obj, self.field_name) - if value is not None: - object_dict[self.property_name] = self.generator.generate(value) - - -class TypedClassSerializer(Serializer[T]): - property_generators: list[FieldSerializer] - - def __init__(self, class_type: type[T], context: ModuleType | None) -> None: - self.property_generators = [ - FieldSerializer( - field_name, - python_field_to_json_property(field_name, field_type), - _get_serializer(field_type, context), - ) - for field_name, field_type in get_class_properties(class_type) - ] - - def generate(self, obj: T) -> dict[str, JsonType]: - object_dict: dict[str, JsonType] = {} - for property_generator in self.property_generators: - property_generator.generate_field(obj, object_dict) - - return object_dict - - -class TypedNamedTupleSerializer(TypedClassSerializer[NamedTuple]): - def __init__(self, class_type: type[NamedTuple], context: ModuleType | None) -> None: - super().__init__(class_type, context) - - -class DataclassSerializer(TypedClassSerializer[T]): - def __init__(self, class_type: type[T], context: ModuleType | None) -> None: - super().__init__(class_type, context) - - -class UnionSerializer(Serializer): - def generate(self, obj: Any) -> JsonType: - return object_to_json(obj) - - -class LiteralSerializer(Serializer): - generator: Serializer - - def __init__(self, values: tuple[Any, ...], context: ModuleType | None) -> None: - literal_type_tuple = tuple(type(value) for value in values) - literal_type_set = set(literal_type_tuple) - if len(literal_type_set) != 1: - value_names = ", ".join(repr(value) for value in values) - raise TypeError( - f"type `Literal[{value_names}]` expects consistent literal value types but got: {literal_type_tuple}" - ) - - literal_type = literal_type_set.pop() - self.generator = _get_serializer(literal_type, context) - - def generate(self, obj: Any) -> JsonType: - return self.generator.generate(obj) - - -class UntypedNamedTupleSerializer(Serializer): - fields: dict[str, str] - - def __init__(self, class_type: type[NamedTuple]) -> None: - # named tuples are also instances of tuple - self.fields = {} - field_names: tuple[str, ...] = class_type._fields - for field_name in field_names: - self.fields[field_name] = python_field_to_json_property(field_name) - - def generate(self, obj: NamedTuple) -> JsonType: - object_dict = {} - for field_name, property_name in self.fields.items(): - value = getattr(obj, field_name) - object_dict[property_name] = object_to_json(value) - - return object_dict - - -class UntypedClassSerializer(Serializer): - def generate(self, obj: object) -> JsonType: - # iterate over object attributes to get a standard representation - object_dict = {} - for name in dir(obj): - if is_reserved_property(name): - continue - - value = getattr(obj, name) - if value is None: - continue - - # filter instance methods - if inspect.ismethod(value): - continue - - object_dict[python_field_to_json_property(name)] = object_to_json(value) - - return object_dict - - -def create_serializer(typ: TypeLike, context: ModuleType | None = None) -> Serializer: - """ - Creates a serializer engine to produce an object that can be directly converted into a JSON string. - - When serializing a Python object into a JSON object, the following transformations are applied: - - * Fundamental types (`bool`, `int`, `float` or `str`) are returned as-is. - * Date and time types (`datetime`, `date` or `time`) produce an ISO 8601 format string with time zone - (ending with `Z` for UTC). - * Byte arrays (`bytes`) are written as a string with Base64 encoding. - * UUIDs (`uuid.UUID`) are written as a UUID string as per RFC 4122. - * Enumerations yield their enumeration value. - * Containers (e.g. `list`, `dict`, `set`, `tuple`) are processed recursively. - * Complex objects with properties (including data class types) generate dictionaries of key-value pairs. - - :raises TypeError: A serializer engine cannot be constructed for the input type. - """ - - if context is None: - if isinstance(typ, type): - context = sys.modules[typ.__module__] - - return _get_serializer(typ, context) - - -def _get_serializer(typ: TypeLike, context: ModuleType | None) -> Serializer: - if isinstance(typ, (str, typing.ForwardRef)): - if context is None: - raise TypeError(f"missing context for evaluating type: {typ}") - - typ = evaluate_type(typ, context) - - if isinstance(typ, type): - return _fetch_serializer(typ) - else: - # special forms are not always hashable - return _create_serializer(typ, context) - - -@functools.cache -def _fetch_serializer(typ: type) -> Serializer: - context = sys.modules[typ.__module__] - return _create_serializer(typ, context) - - -def _create_serializer(typ: TypeLike, context: ModuleType | None) -> Serializer: - # check for well-known types - if typ is type(None): - return NoneSerializer() - elif typ is bool: - return BoolSerializer() - elif typ is int: - return IntSerializer() - elif typ is float: - return FloatSerializer() - elif typ is str: - return StringSerializer() - elif typ is bytes: - return BytesSerializer() - elif typ is datetime.datetime: - return DateTimeSerializer() - elif typ is datetime.date: - return DateSerializer() - elif typ is datetime.time: - return TimeSerializer() - elif typ is uuid.UUID: - return UUIDSerializer() - elif typ is ipaddress.IPv4Address: - return IPv4Serializer() - elif typ is ipaddress.IPv6Address: - return IPv6Serializer() - - # dynamically-typed collection types - if typ is list: - return UntypedListSerializer() - elif typ is dict: - return UntypedDictSerializer() - elif typ is set: - return UntypedSetSerializer() - elif typ is tuple: - return UntypedTupleSerializer() - - # generic types (e.g. list, dict, set, etc.) - origin_type = typing.get_origin(typ) - if origin_type is list: - (list_item_type,) = typing.get_args(typ) # unpack single tuple element - return TypedListSerializer(list_item_type, context) - elif origin_type is dict: - key_type, value_type = typing.get_args(typ) - if key_type is str: - return TypedStringDictSerializer(value_type, context) - elif issubclass(key_type, enum.Enum): - return TypedEnumDictSerializer(key_type, value_type, context) - elif origin_type is set: - (set_member_type,) = typing.get_args(typ) # unpack single tuple element - return TypedSetSerializer(set_member_type, context) - elif origin_type is tuple: - return TypedTupleSerializer(typing.get_args(typ), context) - elif origin_type is Union: - return UnionSerializer() - elif origin_type is Literal: - return LiteralSerializer(typing.get_args(typ), context) - - if is_type_annotated(typ): - return create_serializer(unwrap_annotated_type(typ)) - - # check if object has custom serialization method - convert_func = getattr(typ, "to_json", None) - if callable(convert_func): - return CustomSerializer(convert_func) - - if is_type_enum(typ): - return EnumSerializer() - if is_dataclass_type(typ): - return DataclassSerializer(typ, context) - if is_named_tuple_type(typ): - if getattr(typ, "__annotations__", None): - return TypedNamedTupleSerializer(typ, context) - else: - return UntypedNamedTupleSerializer(typ) - - # fail early if caller passes an object with an exotic type - if not isinstance(typ, type) or typ is FunctionType or typ is MethodType or typ is type or typ is ModuleType: - raise TypeError(f"object of type {typ} cannot be represented in JSON") - - if get_resolved_hints(typ): - return TypedClassSerializer(typ, context) - else: - return UntypedClassSerializer() - - -def object_to_json(obj: Any) -> JsonType: - """ - Converts a Python object to a representation that can be exported to JSON. - - * Fundamental types (e.g. numeric types) are written as is. - * Date and time types are serialized in the ISO 8601 format with time zone. - * A byte array is written as a string with Base64 encoding. - * UUIDs are written as a UUID string. - * Enumerations are written as their value. - * Containers (e.g. `list`, `dict`, `set`, `tuple`) are exported recursively. - * Objects with properties (including data class types) are converted to a dictionaries of key-value pairs. - """ - - typ: type = type(obj) - generator = create_serializer(typ) - return generator.generate(obj) diff --git a/src/llama_stack/strong_typing/slots.py b/src/llama_stack/strong_typing/slots.py deleted file mode 100644 index 7728341405..0000000000 --- a/src/llama_stack/strong_typing/slots.py +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -from typing import Any, TypeVar - -T = TypeVar("T") - - -class SlotsMeta(type): - def __new__(cls: type[T], name: str, bases: tuple[type, ...], ns: dict[str, Any]) -> T: - # caller may have already provided slots, in which case just retain them and keep going - slots: tuple[str, ...] = ns.get("__slots__", ()) - - # add fields with type annotations to slots - annotations: dict[str, Any] = ns.get("__annotations__", {}) - members = tuple(member for member in annotations.keys() if member not in slots) - - # assign slots - ns["__slots__"] = slots + tuple(members) - return super().__new__(cls, name, bases, ns) # type: ignore - - -class Slots(metaclass=SlotsMeta): - pass diff --git a/src/llama_stack/strong_typing/topological.py b/src/llama_stack/strong_typing/topological.py deleted file mode 100644 index 9502a58879..0000000000 --- a/src/llama_stack/strong_typing/topological.py +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -""" -Type-safe data interchange for Python data classes. - -:see: https://github.com/hunyadi/strong_typing -""" - -from collections.abc import Callable, Iterable -from typing import TypeVar - -from .inspection import TypeCollector - -T = TypeVar("T") - - -def topological_sort(graph: dict[T, set[T]]) -> list[T]: - """ - Performs a topological sort of a graph. - - Nodes with no outgoing edges are first. Nodes with no incoming edges are last. - The topological ordering is not unique. - - :param graph: A dictionary of mappings from nodes to adjacent nodes. Keys and set members must be hashable. - :returns: The list of nodes in topological order. - """ - - # empty list that will contain the sorted nodes (in reverse order) - ordered: list[T] = [] - - seen: dict[T, bool] = {} - - def _visit(n: T) -> None: - status = seen.get(n) - if status is not None: - if status: # node has a permanent mark - return - else: # node has a temporary mark - raise RuntimeError(f"cycle detected in graph for node {n}") - - seen[n] = False # apply temporary mark - for m in graph[n]: # visit all adjacent nodes - if m != n: # ignore self-referencing nodes - _visit(m) - - seen[n] = True # apply permanent mark - ordered.append(n) - - for n in graph.keys(): - _visit(n) - - return ordered - - -def type_topological_sort( - types: Iterable[type], - dependency_fn: Callable[[type], Iterable[type]] | None = None, -) -> list[type]: - """ - Performs a topological sort of a list of types. - - Types that don't depend on other types (i.e. fundamental types) are first. Types on which no other types depend - are last. The topological ordering is not unique. - - :param types: A list of types (simple or composite). - :param dependency_fn: Returns a list of additional dependencies for a class (e.g. classes referenced by a foreign key). - :returns: The list of types in topological order. - """ - - if not all(isinstance(typ, type) for typ in types): - raise TypeError("expected a list of types") - - collector = TypeCollector() - collector.traverse_all(types) - graph = collector.graph - - if dependency_fn: - new_types: set[type] = set() - for source_type, references in graph.items(): - dependent_types = dependency_fn(source_type) - references.update(dependent_types) - new_types.update(dependent_types) - for new_type in new_types: - graph[new_type] = set() - - return topological_sort(graph) diff --git a/uv.lock b/uv.lock index de1c8879c9..32e2e42192 100644 --- a/uv.lock +++ b/uv.lock @@ -1955,6 +1955,7 @@ dependencies = [ { name = "pyjwt", extra = ["crypto"] }, { name = "python-dotenv" }, { name = "python-multipart" }, + { name = "pyyaml" }, { name = "rich" }, { name = "sqlalchemy", extra = ["asyncio"] }, { name = "starlette" }, @@ -2108,6 +2109,7 @@ requires-dist = [ { name = "pyjwt", extras = ["crypto"], specifier = ">=2.10.0" }, { name = "python-dotenv" }, { name = "python-multipart", specifier = ">=0.0.20" }, + { name = "pyyaml", specifier = ">=6.0.2" }, { name = "rich" }, { name = "sqlalchemy", extras = ["asyncio"], specifier = ">=2.0.41" }, { name = "starlette" }, @@ -4488,40 +4490,46 @@ wheels = [ [[package]] name = "ruamel-yaml" -version = "0.18.14" +version = "0.18.16" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "ruamel-yaml-clib", marker = "python_full_version < '3.14' and platform_python_implementation == 'CPython'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/39/87/6da0df742a4684263261c253f00edd5829e6aca970fff69e75028cccc547/ruamel.yaml-0.18.14.tar.gz", hash = "sha256:7227b76aaec364df15936730efbf7d72b30c0b79b1d578bbb8e3dcb2d81f52b7", size = 145511, upload-time = "2025-06-09T08:51:09.828Z" } +sdist = { url = "https://files.pythonhosted.org/packages/9f/c7/ee630b29e04a672ecfc9b63227c87fd7a37eb67c1bf30fe95376437f897c/ruamel.yaml-0.18.16.tar.gz", hash = "sha256:a6e587512f3c998b2225d68aa1f35111c29fad14aed561a26e73fab729ec5e5a", size = 147269, upload-time = "2025-10-22T17:54:02.346Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/af/6d/6fe4805235e193aad4aaf979160dd1f3c487c57d48b810c816e6e842171b/ruamel.yaml-0.18.14-py3-none-any.whl", hash = "sha256:710ff198bb53da66718c7db27eec4fbcc9aa6ca7204e4c1df2f282b6fe5eb6b2", size = 118570, upload-time = "2025-06-09T08:51:06.348Z" }, + { url = "https://files.pythonhosted.org/packages/0f/73/bb1bc2529f852e7bf64a2dec885e89ff9f5cc7bbf6c9340eed30ff2c69c5/ruamel.yaml-0.18.16-py3-none-any.whl", hash = "sha256:048f26d64245bae57a4f9ef6feb5b552a386830ef7a826f235ffb804c59efbba", size = 119858, upload-time = "2025-10-22T17:53:59.012Z" }, ] [[package]] name = "ruamel-yaml-clib" -version = "0.2.12" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/20/84/80203abff8ea4993a87d823a5f632e4d92831ef75d404c9fc78d0176d2b5/ruamel.yaml.clib-0.2.12.tar.gz", hash = "sha256:6c8fbb13ec503f99a91901ab46e0b07ae7941cd527393187039aec586fdfd36f", size = 225315, upload-time = "2024-10-20T10:10:56.22Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/48/41/e7a405afbdc26af961678474a55373e1b323605a4f5e2ddd4a80ea80f628/ruamel.yaml.clib-0.2.12-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:20b0f8dc160ba83b6dcc0e256846e1a02d044e13f7ea74a3d1d56ede4e48c632", size = 133433, upload-time = "2024-10-20T10:12:55.657Z" }, - { url = "https://files.pythonhosted.org/packages/ec/b0/b850385604334c2ce90e3ee1013bd911aedf058a934905863a6ea95e9eb4/ruamel.yaml.clib-0.2.12-cp312-cp312-manylinux2014_aarch64.whl", hash = "sha256:943f32bc9dedb3abff9879edc134901df92cfce2c3d5c9348f172f62eb2d771d", size = 647362, upload-time = "2024-10-20T10:12:57.155Z" }, - { url = "https://files.pythonhosted.org/packages/44/d0/3f68a86e006448fb6c005aee66565b9eb89014a70c491d70c08de597f8e4/ruamel.yaml.clib-0.2.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95c3829bb364fdb8e0332c9931ecf57d9be3519241323c5274bd82f709cebc0c", size = 754118, upload-time = "2024-10-20T10:12:58.501Z" }, - { url = "https://files.pythonhosted.org/packages/52/a9/d39f3c5ada0a3bb2870d7db41901125dbe2434fa4f12ca8c5b83a42d7c53/ruamel.yaml.clib-0.2.12-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:749c16fcc4a2b09f28843cda5a193e0283e47454b63ec4b81eaa2242f50e4ccd", size = 706497, upload-time = "2024-10-20T10:13:00.211Z" }, - { url = "https://files.pythonhosted.org/packages/b0/fa/097e38135dadd9ac25aecf2a54be17ddf6e4c23e43d538492a90ab3d71c6/ruamel.yaml.clib-0.2.12-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:bf165fef1f223beae7333275156ab2022cffe255dcc51c27f066b4370da81e31", size = 698042, upload-time = "2024-10-21T11:26:46.038Z" }, - { url = "https://files.pythonhosted.org/packages/ec/d5/a659ca6f503b9379b930f13bc6b130c9f176469b73b9834296822a83a132/ruamel.yaml.clib-0.2.12-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:32621c177bbf782ca5a18ba4d7af0f1082a3f6e517ac2a18b3974d4edf349680", size = 745831, upload-time = "2024-10-21T11:26:47.487Z" }, - { url = "https://files.pythonhosted.org/packages/db/5d/36619b61ffa2429eeaefaab4f3374666adf36ad8ac6330d855848d7d36fd/ruamel.yaml.clib-0.2.12-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b82a7c94a498853aa0b272fd5bc67f29008da798d4f93a2f9f289feb8426a58d", size = 715692, upload-time = "2024-12-11T19:58:17.252Z" }, - { url = "https://files.pythonhosted.org/packages/b1/82/85cb92f15a4231c89b95dfe08b09eb6adca929ef7df7e17ab59902b6f589/ruamel.yaml.clib-0.2.12-cp312-cp312-win32.whl", hash = "sha256:e8c4ebfcfd57177b572e2040777b8abc537cdef58a2120e830124946aa9b42c5", size = 98777, upload-time = "2024-10-20T10:13:01.395Z" }, - { url = "https://files.pythonhosted.org/packages/d7/8f/c3654f6f1ddb75daf3922c3d8fc6005b1ab56671ad56ffb874d908bfa668/ruamel.yaml.clib-0.2.12-cp312-cp312-win_amd64.whl", hash = "sha256:0467c5965282c62203273b838ae77c0d29d7638c8a4e3a1c8bdd3602c10904e4", size = 115523, upload-time = "2024-10-20T10:13:02.768Z" }, - { url = "https://files.pythonhosted.org/packages/29/00/4864119668d71a5fa45678f380b5923ff410701565821925c69780356ffa/ruamel.yaml.clib-0.2.12-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:4c8c5d82f50bb53986a5e02d1b3092b03622c02c2eb78e29bec33fd9593bae1a", size = 132011, upload-time = "2024-10-20T10:13:04.377Z" }, - { url = "https://files.pythonhosted.org/packages/7f/5e/212f473a93ae78c669ffa0cb051e3fee1139cb2d385d2ae1653d64281507/ruamel.yaml.clib-0.2.12-cp313-cp313-manylinux2014_aarch64.whl", hash = "sha256:e7e3736715fbf53e9be2a79eb4db68e4ed857017344d697e8b9749444ae57475", size = 642488, upload-time = "2024-10-20T10:13:05.906Z" }, - { url = "https://files.pythonhosted.org/packages/1f/8f/ecfbe2123ade605c49ef769788f79c38ddb1c8fa81e01f4dbf5cf1a44b16/ruamel.yaml.clib-0.2.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b7e75b4965e1d4690e93021adfcecccbca7d61c7bddd8e22406ef2ff20d74ef", size = 745066, upload-time = "2024-10-20T10:13:07.26Z" }, - { url = "https://files.pythonhosted.org/packages/e2/a9/28f60726d29dfc01b8decdb385de4ced2ced9faeb37a847bd5cf26836815/ruamel.yaml.clib-0.2.12-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:96777d473c05ee3e5e3c3e999f5d23c6f4ec5b0c38c098b3a5229085f74236c6", size = 701785, upload-time = "2024-10-20T10:13:08.504Z" }, - { url = "https://files.pythonhosted.org/packages/84/7e/8e7ec45920daa7f76046578e4f677a3215fe8f18ee30a9cb7627a19d9b4c/ruamel.yaml.clib-0.2.12-cp313-cp313-musllinux_1_1_i686.whl", hash = "sha256:3bc2a80e6420ca8b7d3590791e2dfc709c88ab9152c00eeb511c9875ce5778bf", size = 693017, upload-time = "2024-10-21T11:26:48.866Z" }, - { url = "https://files.pythonhosted.org/packages/c5/b3/d650eaade4ca225f02a648321e1ab835b9d361c60d51150bac49063b83fa/ruamel.yaml.clib-0.2.12-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:e188d2699864c11c36cdfdada94d781fd5d6b0071cd9c427bceb08ad3d7c70e1", size = 741270, upload-time = "2024-10-21T11:26:50.213Z" }, - { url = "https://files.pythonhosted.org/packages/87/b8/01c29b924dcbbed75cc45b30c30d565d763b9c4d540545a0eeecffb8f09c/ruamel.yaml.clib-0.2.12-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4f6f3eac23941b32afccc23081e1f50612bdbe4e982012ef4f5797986828cd01", size = 709059, upload-time = "2024-12-11T19:58:18.846Z" }, - { url = "https://files.pythonhosted.org/packages/30/8c/ed73f047a73638257aa9377ad356bea4d96125b305c34a28766f4445cc0f/ruamel.yaml.clib-0.2.12-cp313-cp313-win32.whl", hash = "sha256:6442cb36270b3afb1b4951f060eccca1ce49f3d087ca1ca4563a6eb479cb3de6", size = 98583, upload-time = "2024-10-20T10:13:09.658Z" }, - { url = "https://files.pythonhosted.org/packages/b0/85/e8e751d8791564dd333d5d9a4eab0a7a115f7e349595417fd50ecae3395c/ruamel.yaml.clib-0.2.12-cp313-cp313-win_amd64.whl", hash = "sha256:e5b8daf27af0b90da7bb903a876477a9e6d7270be6146906b276605997c7e9a3", size = 115190, upload-time = "2024-10-20T10:13:10.66Z" }, +version = "0.2.14" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/e9/39ec4d4b3f91188fad1842748f67d4e749c77c37e353c4e545052ee8e893/ruamel.yaml.clib-0.2.14.tar.gz", hash = "sha256:803f5044b13602d58ea378576dd75aa759f52116a0232608e8fdada4da33752e", size = 225394, upload-time = "2025-09-22T19:51:23.753Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b4/42/ccfb34a25289afbbc42017e4d3d4288e61d35b2e00cfc6b92974a6a1f94b/ruamel.yaml.clib-0.2.14-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:6aeadc170090ff1889f0d2c3057557f9cd71f975f17535c26a5d37af98f19c27", size = 271775, upload-time = "2025-09-23T14:24:12.771Z" }, + { url = "https://files.pythonhosted.org/packages/82/73/e628a92e80197ff6a79ab81ec3fa00d4cc082d58ab78d3337b7ba7043301/ruamel.yaml.clib-0.2.14-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:5e56ac47260c0eed992789fa0b8efe43404a9adb608608631a948cee4fc2b052", size = 138842, upload-time = "2025-09-22T19:50:49.156Z" }, + { url = "https://files.pythonhosted.org/packages/2b/c5/346c7094344a60419764b4b1334d9e0285031c961176ff88ffb652405b0c/ruamel.yaml.clib-0.2.14-cp312-cp312-manylinux2014_aarch64.whl", hash = "sha256:a911aa73588d9a8b08d662b9484bc0567949529824a55d3885b77e8dd62a127a", size = 647404, upload-time = "2025-09-22T19:50:52.921Z" }, + { url = "https://files.pythonhosted.org/packages/df/99/65080c863eb06d4498de3d6c86f3e90595e02e159fd8529f1565f56cfe2c/ruamel.yaml.clib-0.2.14-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a05ba88adf3d7189a974b2de7a9d56731548d35dc0a822ec3dc669caa7019b29", size = 753141, upload-time = "2025-09-22T19:50:50.294Z" }, + { url = "https://files.pythonhosted.org/packages/3d/e3/0de85f3e3333f8e29e4b10244374a202a87665d1131798946ee22cf05c7c/ruamel.yaml.clib-0.2.14-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fb04c5650de6668b853623eceadcdb1a9f2fee381f5d7b6bc842ee7c239eeec4", size = 703477, upload-time = "2025-09-22T19:50:51.508Z" }, + { url = "https://files.pythonhosted.org/packages/d9/25/0d2f09d8833c7fd77ab8efeff213093c16856479a9d293180a0d89f6bed9/ruamel.yaml.clib-0.2.14-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:df3ec9959241d07bc261f4983d25a1205ff37703faf42b474f15d54d88b4f8c9", size = 741157, upload-time = "2025-09-23T18:42:50.408Z" }, + { url = "https://files.pythonhosted.org/packages/d3/8c/959f10c2e2153cbdab834c46e6954b6dd9e3b109c8f8c0a3cf1618310985/ruamel.yaml.clib-0.2.14-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:fbc08c02e9b147a11dfcaa1ac8a83168b699863493e183f7c0c8b12850b7d259", size = 745859, upload-time = "2025-09-22T19:50:54.497Z" }, + { url = "https://files.pythonhosted.org/packages/ed/6b/e580a7c18b485e1a5f30a32cda96b20364b0ba649d9d2baaf72f8bd21f83/ruamel.yaml.clib-0.2.14-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c099cafc1834d3c5dac305865d04235f7c21c167c8dd31ebc3d6bbc357e2f023", size = 770200, upload-time = "2025-09-22T19:50:55.718Z" }, + { url = "https://files.pythonhosted.org/packages/ef/44/3455eebc761dc8e8fdced90f2b0a3fa61e32ba38b50de4130e2d57db0f21/ruamel.yaml.clib-0.2.14-cp312-cp312-win32.whl", hash = "sha256:b5b0f7e294700b615a3bcf6d28b26e6da94e8eba63b079f4ec92e9ba6c0d6b54", size = 98829, upload-time = "2025-09-22T19:50:58.895Z" }, + { url = "https://files.pythonhosted.org/packages/76/ab/5121f7f3b651db93de546f8c982c241397aad0a4765d793aca1dac5eadee/ruamel.yaml.clib-0.2.14-cp312-cp312-win_amd64.whl", hash = "sha256:a37f40a859b503304dd740686359fcf541d6fb3ff7fc10f539af7f7150917c68", size = 115570, upload-time = "2025-09-22T19:50:57.981Z" }, + { url = "https://files.pythonhosted.org/packages/d7/ae/e3811f05415594025e96000349d3400978adaed88d8f98d494352d9761ee/ruamel.yaml.clib-0.2.14-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:7e4f9da7e7549946e02a6122dcad00b7c1168513acb1f8a726b1aaf504a99d32", size = 269205, upload-time = "2025-09-23T14:24:15.06Z" }, + { url = "https://files.pythonhosted.org/packages/72/06/7d51f4688d6d72bb72fa74254e1593c4f5ebd0036be5b41fe39315b275e9/ruamel.yaml.clib-0.2.14-cp313-cp313-macosx_15_0_arm64.whl", hash = "sha256:dd7546c851e59c06197a7c651335755e74aa383a835878ca86d2c650c07a2f85", size = 137417, upload-time = "2025-09-22T19:50:59.82Z" }, + { url = "https://files.pythonhosted.org/packages/5a/08/b4499234a420ef42960eeb05585df5cc7eb25ccb8c980490b079e6367050/ruamel.yaml.clib-0.2.14-cp313-cp313-manylinux2014_aarch64.whl", hash = "sha256:1c1acc3a0209ea9042cc3cfc0790edd2eddd431a2ec3f8283d081e4d5018571e", size = 642558, upload-time = "2025-09-22T19:51:03.388Z" }, + { url = "https://files.pythonhosted.org/packages/b6/ba/1975a27dedf1c4c33306ee67c948121be8710b19387aada29e2f139c43ee/ruamel.yaml.clib-0.2.14-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2070bf0ad1540d5c77a664de07ebcc45eebd1ddcab71a7a06f26936920692beb", size = 744087, upload-time = "2025-09-22T19:51:00.897Z" }, + { url = "https://files.pythonhosted.org/packages/20/15/8a19a13d27f3bd09fa18813add8380a29115a47b553845f08802959acbce/ruamel.yaml.clib-0.2.14-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9bd8fe07f49c170e09d76773fb86ad9135e0beee44f36e1576a201b0676d3d1d", size = 699709, upload-time = "2025-09-22T19:51:02.075Z" }, + { url = "https://files.pythonhosted.org/packages/19/ee/8d6146a079ad21e534b5083c9ee4a4c8bec42f79cf87594b60978286b39a/ruamel.yaml.clib-0.2.14-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ff86876889ea478b1381089e55cf9e345707b312beda4986f823e1d95e8c0f59", size = 708926, upload-time = "2025-09-23T18:42:51.707Z" }, + { url = "https://files.pythonhosted.org/packages/a9/f5/426b714abdc222392e68f3b8ad323930d05a214a27c7e7a0f06c69126401/ruamel.yaml.clib-0.2.14-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:1f118b707eece8cf84ecbc3e3ec94d9db879d85ed608f95870d39b2d2efa5dca", size = 740202, upload-time = "2025-09-22T19:51:04.673Z" }, + { url = "https://files.pythonhosted.org/packages/3d/ac/3c5c2b27a183f4fda8a57c82211721c016bcb689a4a175865f7646db9f94/ruamel.yaml.clib-0.2.14-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:b30110b29484adc597df6bd92a37b90e63a8c152ca8136aad100a02f8ba6d1b6", size = 765196, upload-time = "2025-09-22T19:51:05.916Z" }, + { url = "https://files.pythonhosted.org/packages/92/2e/06f56a71fd55021c993ed6e848c9b2e5e9cfce180a42179f0ddd28253f7c/ruamel.yaml.clib-0.2.14-cp313-cp313-win32.whl", hash = "sha256:f4e97a1cf0b7a30af9e1d9dad10a5671157b9acee790d9e26996391f49b965a2", size = 98635, upload-time = "2025-09-22T19:51:08.183Z" }, + { url = "https://files.pythonhosted.org/packages/51/79/76aba16a1689b50528224b182f71097ece338e7a4ab55e84c2e73443b78a/ruamel.yaml.clib-0.2.14-cp313-cp313-win_amd64.whl", hash = "sha256:090782b5fb9d98df96509eecdbcaffd037d47389a89492320280d52f91330d78", size = 115238, upload-time = "2025-09-22T19:51:07.081Z" }, + { url = "https://files.pythonhosted.org/packages/21/e2/a59ff65c26aaf21a24eb38df777cb9af5d87ba8fc8107c163c2da9d1e85e/ruamel.yaml.clib-0.2.14-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:7df6f6e9d0e33c7b1d435defb185095386c469109de723d514142632a7b9d07f", size = 271441, upload-time = "2025-09-23T14:24:16.498Z" }, + { url = "https://files.pythonhosted.org/packages/6b/fa/3234f913fe9a6525a7b97c6dad1f51e72b917e6872e051a5e2ffd8b16fbb/ruamel.yaml.clib-0.2.14-cp314-cp314-macosx_15_0_arm64.whl", hash = "sha256:70eda7703b8126f5e52fcf276e6c0f40b0d314674f896fc58c47b0aef2b9ae83", size = 137970, upload-time = "2025-09-22T19:51:09.472Z" }, + { url = "https://files.pythonhosted.org/packages/ef/ec/4edbf17ac2c87fa0845dd366ef8d5852b96eb58fcd65fc1ecf5fe27b4641/ruamel.yaml.clib-0.2.14-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:a0cb71ccc6ef9ce36eecb6272c81afdc2f565950cdcec33ae8e6cd8f7fc86f27", size = 739639, upload-time = "2025-09-22T19:51:10.566Z" }, + { url = "https://files.pythonhosted.org/packages/15/18/b0e1fafe59051de9e79cdd431863b03593ecfa8341c110affad7c8121efc/ruamel.yaml.clib-0.2.14-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:e7cb9ad1d525d40f7d87b6df7c0ff916a66bc52cb61b66ac1b2a16d0c1b07640", size = 764456, upload-time = "2025-09-22T19:51:11.736Z" }, ] [[package]] From ec702ac3fba00e583875a3bb2cbef0117ee3e51a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 30 Oct 2025 17:56:42 +0100 Subject: [PATCH 2/6] wip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sébastien Han --- docs/static/stainless-llama-stack-spec.yaml | 46 --------------------- 1 file changed, 46 deletions(-) diff --git a/docs/static/stainless-llama-stack-spec.yaml b/docs/static/stainless-llama-stack-spec.yaml index 496fdbdf63..120c20b6ad 100644 --- a/docs/static/stainless-llama-stack-spec.yaml +++ b/docs/static/stainless-llama-stack-spec.yaml @@ -2187,52 +2187,6 @@ paths: type: string in: path deprecated: false -<<<<<<< HEAD -======= - /v1/synthetic-data-generation/generate: - post: - responses: - '200': - description: >- - Response containing filtered synthetic data samples and optional statistics - content: - application/json: - schema: - $ref: '#/components/schemas/SyntheticDataGenerationResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - SyntheticDataGeneration (Coming Soon) - summary: >- - Generate synthetic data based on input dialogs and apply filtering. - description: >- - Generate synthetic data based on input dialogs and apply filtering. - - :param dialogs: List of conversation messages to use as input for synthetic - data generation - :param filtering_function: Type of filtering to apply to generated - synthetic data samples - :param model: (Optional) The identifier of the model to use. The model - must be registered with Llama Stack and available via the /models endpoint - :returns: Response containing filtered synthetic data samples and - optional statistics - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SyntheticDataGenerateRequest' - required: true - deprecated: false ->>>>>>> 0e623067d (chore: use Pydantic to generate OpenAPI schema) /v1/tool-runtime/invoke: post: responses: From 38de8ea1f7ceb0d77ef55f2bd638d8f8ee402df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 30 Oct 2025 17:56:42 +0100 Subject: [PATCH 3/6] wip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sébastien Han --- .pre-commit-config.yaml | 11 +- client-sdks/stainless/openapi.yml | 26440 ++++++++-------- .../static/experimental-llama-stack-spec.yaml | 1951 +- docs/static/llama-stack-spec.yaml | 4814 ++- docs/static/stainless-llama-stack-spec.yaml | 26440 ++++++++-------- pyproject.toml | 7 +- scripts/fastapi_generator.py | 817 +- scripts/run_openapi_generator.sh | 19 + scripts/validate_openapi.py | 290 + .../apis/agents/openai_responses.py | 1 + src/llama_stack/apis/tools/tools.py | 1 + uv.lock | 99 + 12 files changed, 31542 insertions(+), 29348 deletions(-) create mode 100755 scripts/run_openapi_generator.sh create mode 100755 scripts/validate_openapi.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 279c5791e6..bf99560404 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -110,11 +110,20 @@ repos: name: API Spec Codegen additional_dependencies: - uv==0.7.8 - entry: sh -c './scripts/uv-run-with-index.sh run scripts/fastapi_generator.py docs/static' + entry: sh -c './scripts/uv-run-with-index.sh run scripts/run_openapi_generator.sh' language: python pass_filenames: false require_serial: true files: ^src/llama_stack/apis/ + - id: openapi-validate + name: OpenAPI Schema Validation + additional_dependencies: + - uv==0.7.8 + entry: uv run scripts/validate_openapi.py docs/static/ --quiet + language: python + pass_filenames: false + require_serial: true + files: ^docs/static/.*\.ya?ml$ - id: check-workflows-use-hashes name: Check GitHub Actions use SHA-pinned actions entry: ./scripts/check-workflows-use-hashes.sh diff --git a/client-sdks/stainless/openapi.yml b/client-sdks/stainless/openapi.yml index 120c20b6ad..118a887d6f 100644 --- a/client-sdks/stainless/openapi.yml +++ b/client-sdks/stainless/openapi.yml @@ -1,19 +1,13 @@ openapi: 3.1.0 info: - title: >- - Llama Stack Specification - Stable & Experimental APIs - version: v1 - description: >- - This is the specification of the Llama Stack that provides - a set of endpoints and their corresponding interfaces that are - tailored to - best leverage Llama Models. - - **🔗 COMBINED**: This specification includes both stable production-ready APIs - and experimental pre-release APIs. Use stable APIs for production deployments - and experimental APIs for testing new features. + title: Llama Stack API - Stable & Experimental APIs + description: "A comprehensive API for building and deploying AI applications\n\n**🔗 COMBINED**: This specification includes both stable production-ready APIs and experimental pre-release APIs. Use stable APIs for production deployments and experimental APIs for testing new features." + version: 1.0.0 servers: - - url: http://any-hosted-llama-stack.com +- url: https://api.llamastack.com + description: Production server +- url: https://staging-api.llamastack.com + description: Staging server paths: /v1/batches: get: @@ -3480,44 +3474,72 @@ paths: deprecated: false /v1beta/datasetio/append-rows/{dataset_id}: post: + tags: + - V1Beta + summary: Append Rows + description: Generic endpoint - this would be replaced with actual implementation. + operationId: append_rows_v1beta_datasetio_append_rows__dataset_id__post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: dataset_id + in: path + required: true + schema: + type: string + description: 'Path parameter: dataset_id' responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1beta/datasetio/iterrows/{dataset_id}: + get: tags: - - DatasetIO - summary: Append rows to a dataset. - description: >- - Append rows to a dataset. - - :param dataset_id: The ID of the dataset to append the rows to. - :param rows: The rows to append to the dataset. + - V1Beta + summary: Iterrows + description: Query endpoint for proper schema generation. + operationId: iterrows_v1beta_datasetio_iterrows__dataset_id__get parameters: - - name: dataset_id - description: >- - The ID of the dataset to append the rows to. - required: true - schema: - type: string - in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AppendRowsRequest' + - name: dataset_id + in: path required: true - deprecated: false - /v1beta/datasetio/iterrows/{dataset_id}: - get: + schema: + type: string + title: Dataset Id + - name: limit + in: query + required: true + schema: + type: integer + title: Limit + - name: start_index + in: query + required: true + schema: + type: integer + title: Start Index responses: '200': description: A PaginatedResponse. @@ -3527,59 +3549,23 @@ paths: $ref: '#/components/schemas/PaginatedResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - DatasetIO - summary: >- - Get a paginated list of rows from a dataset. - description: >- - Get a paginated list of rows from a dataset. - - Uses offset-based pagination where: - - start_index: The starting index (0-based). If None, starts from - beginning. - - limit: Number of items to return. If None or -1, returns all items. - - The response includes: - - data: List of items for the current page. - - has_more: Whether there are more items available after this set. - - :param dataset_id: The ID of the dataset to get the rows from. - :param start_index: Index into dataset for the first row to get. Get - all rows if None. - :param limit: The number of rows to get. - :returns: A PaginatedResponse. - parameters: - - name: dataset_id - description: >- - The ID of the dataset to get the rows from. - required: true - schema: - type: string - in: path - - name: start_index - description: >- - Index into dataset for the first row to get. Get all rows if None. - required: false - schema: - type: integer - in: query - - name: limit - description: The number of rows to get. - required: false - schema: - type: integer - in: query - deprecated: false + description: Default Response /v1beta/datasets: get: + tags: + - V1Beta + summary: List Datasets + description: Response-only endpoint for proper schema generation. + operationId: list_datasets_v1beta_datasets_get responses: '200': description: A ListDatasetsResponse. @@ -3588,120 +3574,29 @@ paths: schema: $ref: '#/components/schemas/ListDatasetsResponse' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - Datasets - summary: List all datasets. - description: >- - List all datasets. - - :returns: A ListDatasetsResponse. - parameters: [] - deprecated: false post: - responses: - '200': - description: A Dataset. - content: - application/json: - schema: - $ref: '#/components/schemas/Dataset' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' tags: - - Datasets - summary: Register a new dataset. - description: >- - Register a new dataset. - - :param purpose: The purpose of the dataset. - One of: - - "post-training/messages": The dataset contains a messages column - with list of messages for post-training. - { - "messages": [ - {"role": "user", "content": "Hello, world!"}, - {"role": "assistant", "content": "Hello, world!"}, - ] - } - - "eval/question-answer": The dataset contains a question column - and an answer column for evaluation. - { - "question": "What is the capital of France?", - "answer": "Paris" - } - - "eval/messages-answer": The dataset contains a messages column - with list of messages and an answer column for evaluation. - { - "messages": [ - {"role": "user", "content": "Hello, my name is John - Doe."}, - {"role": "assistant", "content": "Hello, John Doe. - How can I help you today?"}, - {"role": "user", "content": "What's my name?"}, - ], - "answer": "John Doe" - } - :param source: The data source of the dataset. Ensure that the data - source schema is compatible with the purpose of the dataset. Examples: - - { - "type": "uri", - "uri": "https://mywebsite.com/mydata.jsonl" - } - - { - "type": "uri", - "uri": "lsfs://mydata.jsonl" - } - - { - "type": "uri", - "uri": "data:csv;base64,{base64_content}" - } - - { - "type": "uri", - "uri": "huggingface://llamastack/simpleqa?split=train" - } - - { - "type": "rows", - "rows": [ - { - "messages": [ - {"role": "user", "content": "Hello, world!"}, - {"role": "assistant", "content": "Hello, world!"}, - ] - } - ] - } - :param metadata: The metadata for the dataset. - - E.g. {"description": "My dataset"}. - :param dataset_id: The ID of the dataset. If not provided, an ID will - be generated. - :returns: A Dataset. - parameters: [] + - V1Beta + summary: Register Dataset + description: Typed endpoint for proper schema generation. + operationId: register_dataset_v1beta_datasets_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/RegisterDatasetRequest' + $ref: '#/components/schemas/__main_____datasets_Request' required: true - deprecated: false - /v1beta/datasets/{dataset_id}: - get: responses: '200': description: A Dataset. @@ -3710,520 +3605,539 @@ paths: schema: $ref: '#/components/schemas/Dataset' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' + /v1beta/datasets/{dataset_id}: + delete: tags: - - Datasets - summary: Get a dataset by its ID. - description: >- - Get a dataset by its ID. - - :param dataset_id: The ID of the dataset to get. - :returns: A Dataset. + - V1Beta + summary: Unregister Dataset + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_dataset_v1beta_datasets__dataset_id__delete parameters: - - name: dataset_id - description: The ID of the dataset to get. - required: true - schema: - type: string - in: path - deprecated: false - delete: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: dataset_id + in: path + required: true + schema: + type: string + description: 'Path parameter: dataset_id' responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Datasets - summary: Unregister a dataset by its ID. - description: >- - Unregister a dataset by its ID. - - :param dataset_id: The ID of the dataset to unregister. + - V1Beta + summary: Get Dataset + description: Query endpoint for proper schema generation. + operationId: get_dataset_v1beta_datasets__dataset_id__get parameters: - - name: dataset_id - description: The ID of the dataset to unregister. - required: true - schema: - type: string - in: path - deprecated: false - /v1alpha/agents: - get: + - name: dataset_id + in: path + required: true + schema: + type: string + title: Dataset Id responses: '200': - description: A PaginatedResponse. + description: A Dataset. content: application/json: schema: - $ref: '#/components/schemas/PaginatedResponse' + $ref: '#/components/schemas/Dataset' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/agents: + get: tags: - - Agents - summary: List all agents. - description: >- - List all agents. - - :param start_index: The index to start the pagination from. - :param limit: The number of agents to return. - :returns: A PaginatedResponse. + - V1Alpha + summary: List Agents + description: Query endpoint for proper schema generation. + operationId: list_agents_v1alpha_agents_get parameters: - - name: start_index - description: The index to start the pagination from. - required: false - schema: - type: integer - in: query - - name: limit - description: The number of agents to return. - required: false - schema: - type: integer - in: query - deprecated: false - post: + - name: limit + in: query + required: true + schema: + type: integer + title: Limit + - name: start_index + in: query + required: true + schema: + type: integer + title: Start Index responses: '200': - description: >- - An AgentCreateResponse with the agent ID. + description: A PaginatedResponse. content: application/json: schema: - $ref: '#/components/schemas/AgentCreateResponse' + $ref: '#/components/schemas/PaginatedResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + post: tags: - - Agents - summary: >- - Create an agent with the given configuration. - description: >- - Create an agent with the given configuration. - - :param agent_config: The configuration for the agent. - :returns: An AgentCreateResponse with the agent ID. - parameters: [] + - V1Alpha + summary: Create Agent + description: Typed endpoint for proper schema generation. + operationId: create_agent_v1alpha_agents_post requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/CreateAgentRequest' - required: true - deprecated: false - /v1alpha/agents/{agent_id}: - get: + $ref: '#/components/schemas/AgentConfig' responses: '200': - description: An Agent of the agent. + description: An AgentCreateResponse with the agent ID. content: application/json: schema: - $ref: '#/components/schemas/Agent' + $ref: '#/components/schemas/AgentCreateResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/agents/{agent_id}: + delete: tags: - - Agents - summary: Describe an agent by its ID. - description: >- - Describe an agent by its ID. - - :param agent_id: ID of the agent. - :returns: An Agent of the agent. + - V1Alpha + summary: Delete Agent + description: Generic endpoint - this would be replaced with actual implementation. + operationId: delete_agent_v1alpha_agents__agent_id__delete parameters: - - name: agent_id - description: ID of the agent. - required: true - schema: - type: string - in: path - deprecated: false - delete: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: agent_id + in: path + required: true + schema: + type: string + description: 'Path parameter: agent_id' responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Agents - summary: >- - Delete an agent by its ID and its associated sessions and turns. - description: >- - Delete an agent by its ID and its associated sessions and turns. - - :param agent_id: The ID of the agent to delete. + - V1Alpha + summary: Get Agent + description: Query endpoint for proper schema generation. + operationId: get_agent_v1alpha_agents__agent_id__get parameters: - - name: agent_id - description: The ID of the agent to delete. - required: true - schema: - type: string - in: path - deprecated: false - /v1alpha/agents/{agent_id}/session: - post: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id responses: '200': - description: An AgentSessionCreateResponse. + description: An Agent of the agent. content: application/json: schema: - $ref: '#/components/schemas/AgentSessionCreateResponse' + $ref: '#/components/schemas/Agent' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/agents/{agent_id}/session: + post: tags: - - Agents - summary: Create a new session for an agent. - description: >- - Create a new session for an agent. - - :param agent_id: The ID of the agent to create the session for. - :param session_name: The name of the session to create. - :returns: An AgentSessionCreateResponse. - parameters: - - name: agent_id - description: >- - The ID of the agent to create the session for. - required: true - schema: - type: string - in: path + - V1Alpha + summary: Create Agent Session + description: Typed endpoint for proper schema generation. + operationId: create_agent_session_v1alpha_agents__agent_id__session_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/CreateAgentSessionRequest' + $ref: '#/components/schemas/__main_____agents_agent_id_session_Request' required: true - deprecated: false - /v1alpha/agents/{agent_id}/session/{session_id}: - get: responses: '200': - description: A Session. + description: An AgentSessionCreateResponse. content: application/json: schema: - $ref: '#/components/schemas/Session' + $ref: '#/components/schemas/AgentSessionCreateResponse' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: Retrieve an agent session by its ID. - description: >- - Retrieve an agent session by its ID. - - :param session_id: The ID of the session to get. - :param agent_id: The ID of the agent to get the session for. - :param turn_ids: (Optional) List of turn IDs to filter the session - by. - :returns: A Session. parameters: - - name: session_id - description: The ID of the session to get. - required: true - schema: - type: string - in: path - - name: agent_id - description: >- - The ID of the agent to get the session for. - required: true - schema: - type: string - in: path - - name: turn_ids - description: >- - (Optional) List of turn IDs to filter the session by. - required: false - schema: - $ref: '#/components/schemas/list' - in: query - deprecated: false + - name: agent_id + in: path + required: true + schema: + type: string + description: 'Path parameter: agent_id' + /v1alpha/agents/{agent_id}/session/{session_id}: delete: + tags: + - V1Alpha + summary: Delete Agents Session + description: Generic endpoint - this would be replaced with actual implementation. + operationId: delete_agents_session_v1alpha_agents__agent_id__session__session_id__delete + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: agent_id + in: path + required: true + schema: + type: string + description: 'Path parameter: agent_id' + - name: session_id + in: path + required: true + schema: + type: string + description: 'Path parameter: session_id' responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Agents - summary: >- - Delete an agent session by its ID and its associated turns. - description: >- - Delete an agent session by its ID and its associated turns. - - :param session_id: The ID of the session to delete. - :param agent_id: The ID of the agent to delete the session for. + - V1Alpha + summary: Get Agents Session + description: Query endpoint for proper schema generation. + operationId: get_agents_session_v1alpha_agents__agent_id__session__session_id__get parameters: - - name: session_id - description: The ID of the session to delete. - required: true - schema: - type: string - in: path - - name: agent_id - description: >- - The ID of the agent to delete the session for. - required: true - schema: - type: string - in: path - deprecated: false - /v1alpha/agents/{agent_id}/session/{session_id}/turn: - post: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + - name: session_id + in: path + required: true + schema: + type: string + title: Session Id + - name: turn_ids + in: query + required: true + schema: + type: string + title: Turn Ids responses: '200': - description: If stream=False, returns a Turn object. + description: A Session. content: application/json: schema: - $ref: '#/components/schemas/Turn' - text/event-stream: - schema: - $ref: '#/components/schemas/AsyncIterator' + $ref: '#/components/schemas/Session' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/agents/{agent_id}/session/{session_id}/turn: + post: tags: - - Agents - summary: Create a new turn for an agent. - description: >- - Create a new turn for an agent. - - :param agent_id: The ID of the agent to create the turn for. - :param session_id: The ID of the session to create the turn for. - :param messages: List of messages to start the turn with. - :param stream: (Optional) If True, generate an SSE event stream of - the response. Defaults to False. - :param documents: (Optional) List of documents to create the turn - with. - :param toolgroups: (Optional) List of toolgroups to create the turn - with, will be used in addition to the agent's config toolgroups for the request. - :param tool_config: (Optional) The tool configuration to create the - turn with, will be used to override the agent's tool_config. - :returns: If stream=False, returns a Turn object. - If stream=True, returns an SSE event stream of AgentTurnResponseStreamChunk. - parameters: - - name: agent_id - description: >- - The ID of the agent to create the turn for. - required: true - schema: - type: string - in: path - - name: session_id - description: >- - The ID of the session to create the turn for. - required: true - schema: - type: string - in: path + - V1Alpha + summary: Create Agent Turn + description: Typed endpoint for proper schema generation. + operationId: create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/CreateAgentTurnRequest' + $ref: '#/components/schemas/__main_____agents_agent_id_session_session_id_turn_Request' required: true - deprecated: false - /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}: - get: responses: '200': - description: A Turn. + description: If stream=False, returns a Turn object. content: application/json: schema: $ref: '#/components/schemas/Turn' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: 'Path parameter: agent_id' + - name: session_id + in: path + required: true + schema: + type: string + description: 'Path parameter: session_id' + /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}: + get: tags: - - Agents - summary: Retrieve an agent turn by its ID. - description: >- - Retrieve an agent turn by its ID. - - :param agent_id: The ID of the agent to get the turn for. - :param session_id: The ID of the session to get the turn for. - :param turn_id: The ID of the turn to get. - :returns: A Turn. + - V1Alpha + summary: Get Agents Turn + description: Query endpoint for proper schema generation. + operationId: get_agents_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__get parameters: - - name: agent_id - description: The ID of the agent to get the turn for. - required: true - schema: - type: string - in: path - - name: session_id - description: >- - The ID of the session to get the turn for. - required: true - schema: - type: string - in: path - - name: turn_id - description: The ID of the turn to get. - required: true - schema: - type: string - in: path - deprecated: false - /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume: - post: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + - name: session_id + in: path + required: true + schema: + type: string + title: Session Id + - name: turn_id + in: path + required: true + schema: + type: string + title: Turn Id responses: '200': - description: >- - A Turn object if stream is False, otherwise an AsyncIterator of AgentTurnResponseStreamChunk - objects. + description: A Turn. content: application/json: schema: $ref: '#/components/schemas/Turn' - text/event-stream: - schema: - $ref: '#/components/schemas/AsyncIterator' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume: + post: tags: - - Agents - summary: >- - Resume an agent turn with executed tool call responses. - description: >- - Resume an agent turn with executed tool call responses. - - When a Turn has the status `awaiting_input` due to pending input from client - side tool calls, this endpoint can be used to submit the outputs from the - tool calls once they are ready. - - :param agent_id: The ID of the agent to resume. - :param session_id: The ID of the session to resume. - :param turn_id: The ID of the turn to resume. - :param tool_responses: The tool call responses to resume the turn - with. - :param stream: Whether to stream the response. - :returns: A Turn object if stream is False, otherwise an AsyncIterator - of AgentTurnResponseStreamChunk objects. - parameters: - - name: agent_id - description: The ID of the agent to resume. - required: true - schema: - type: string - in: path - - name: session_id - description: The ID of the session to resume. - required: true - schema: - type: string - in: path - - name: turn_id - description: The ID of the turn to resume. - required: true - schema: - type: string - in: path + - V1Alpha + summary: Resume Agent Turn + description: Typed endpoint for proper schema generation. + operationId: resume_agent_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__resume_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/ResumeAgentTurnRequest' + $ref: '#/components/schemas/__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request' required: true - deprecated: false + responses: + '200': + description: A Turn object if stream is False, otherwise an AsyncIterator of AgentTurnResponseStreamChunk objects. + content: + application/json: + schema: + $ref: '#/components/schemas/Turn' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: 'Path parameter: agent_id' + - name: session_id + in: path + required: true + schema: + type: string + description: 'Path parameter: session_id' + - name: turn_id + in: path + required: true + schema: + type: string + description: 'Path parameter: turn_id' /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}: get: + tags: + - V1Alpha + summary: Get Agents Step + description: Query endpoint for proper schema generation. + operationId: get_agents_step_v1alpha_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + - name: session_id + in: path + required: true + schema: + type: string + title: Session Id + - name: step_id + in: path + required: true + schema: + type: string + title: Step Id + - name: turn_id + in: path + required: true + schema: + type: string + title: Turn Id responses: '200': description: An AgentStepResponse. @@ -4233,54 +4147,42 @@ paths: $ref: '#/components/schemas/AgentStepResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: Retrieve an agent step by its ID. - description: >- - Retrieve an agent step by its ID. - - :param agent_id: The ID of the agent to get the step for. - :param session_id: The ID of the session to get the step for. - :param turn_id: The ID of the turn to get the step for. - :param step_id: The ID of the step to get. - :returns: An AgentStepResponse. - parameters: - - name: agent_id - description: The ID of the agent to get the step for. - required: true - schema: - type: string - in: path - - name: session_id - description: >- - The ID of the session to get the step for. - required: true - schema: - type: string - in: path - - name: turn_id - description: The ID of the turn to get the step for. - required: true - schema: - type: string - in: path - - name: step_id - description: The ID of the step to get. - required: true - schema: - type: string - in: path - deprecated: false + description: Default Response /v1alpha/agents/{agent_id}/sessions: get: + tags: + - V1Alpha + summary: List Agent Sessions + description: Query endpoint for proper schema generation. + operationId: list_agent_sessions_v1alpha_agents__agent_id__sessions_get + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + - name: limit + in: query + required: true + schema: + type: integer + title: Limit + - name: start_index + in: query + required: true + schema: + type: integer + title: Start Index responses: '200': description: A PaginatedResponse. @@ -4290,47 +4192,23 @@ paths: $ref: '#/components/schemas/PaginatedResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: List all session(s) of a given agent. - description: >- - List all session(s) of a given agent. - - :param agent_id: The ID of the agent to list sessions for. - :param start_index: The index to start the pagination from. - :param limit: The number of sessions to return. - :returns: A PaginatedResponse. - parameters: - - name: agent_id - description: >- - The ID of the agent to list sessions for. - required: true - schema: - type: string - in: path - - name: start_index - description: The index to start the pagination from. - required: false - schema: - type: integer - in: query - - name: limit - description: The number of sessions to return. - required: false - schema: - type: integer - in: query - deprecated: false + description: Default Response /v1alpha/eval/benchmarks: get: + tags: + - V1Alpha + summary: List Benchmarks + description: Response-only endpoint for proper schema generation. + operationId: list_benchmarks_v1alpha_eval_benchmarks_get responses: '200': description: A ListBenchmarksResponse. @@ -4340,294 +4218,309 @@ paths: $ref: '#/components/schemas/ListBenchmarksResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + post: tags: - - Benchmarks - summary: List all benchmarks. - description: >- - List all benchmarks. - - :returns: A ListBenchmarksResponse. - parameters: [] - deprecated: false - post: + - V1Alpha + summary: Register Benchmark + description: Generic endpoint - this would be replaced with actual implementation. + operationId: register_benchmark_v1alpha_eval_benchmarks_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/eval/benchmarks/{benchmark_id}: + delete: tags: - - Benchmarks - summary: Register a benchmark. - description: >- - Register a benchmark. - - :param benchmark_id: The ID of the benchmark to register. - :param dataset_id: The ID of the dataset to use for the benchmark. - :param scoring_functions: The scoring functions to use for the benchmark. - :param provider_benchmark_id: The ID of the provider benchmark to - use for the benchmark. - :param provider_id: The ID of the provider to use for the benchmark. - :param metadata: The metadata to use for the benchmark. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterBenchmarkRequest' + - V1Alpha + summary: Unregister Benchmark + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_benchmark_v1alpha_eval_benchmarks__benchmark_id__delete + parameters: + - name: args + in: query required: true - deprecated: false - /v1alpha/eval/benchmarks/{benchmark_id}: - get: + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: benchmark_id + in: path + required: true + schema: + type: string + description: 'Path parameter: benchmark_id' responses: '200': - description: A Benchmark. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/Benchmark' + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Benchmarks - summary: Get a benchmark by its ID. - description: >- - Get a benchmark by its ID. - - :param benchmark_id: The ID of the benchmark to get. - :returns: A Benchmark. + - V1Alpha + summary: Get Benchmark + description: Query endpoint for proper schema generation. + operationId: get_benchmark_v1alpha_eval_benchmarks__benchmark_id__get parameters: - - name: benchmark_id - description: The ID of the benchmark to get. - required: true - schema: - type: string - in: path - deprecated: false - delete: + - name: benchmark_id + in: path + required: true + schema: + type: string + title: Benchmark Id responses: '200': - description: OK + description: A Benchmark. + content: + application/json: + schema: + $ref: '#/components/schemas/Benchmark' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Benchmarks - summary: Unregister a benchmark. - description: >- - Unregister a benchmark. - - :param benchmark_id: The ID of the benchmark to unregister. - parameters: - - name: benchmark_id - description: The ID of the benchmark to unregister. - required: true - schema: - type: string - in: path - deprecated: false + description: Default Response /v1alpha/eval/benchmarks/{benchmark_id}/evaluations: post: + tags: + - V1Alpha + summary: Evaluate Rows + description: Typed endpoint for proper schema generation. + operationId: evaluate_rows_v1alpha_eval_benchmarks__benchmark_id__evaluations_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BenchmarkConfig' + required: true responses: '200': - description: >- - EvaluateResponse object containing generations and scores. + description: EvaluateResponse object containing generations and scores. content: application/json: schema: $ref: '#/components/schemas/EvaluateResponse' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - Eval - summary: Evaluate a list of rows on a benchmark. - description: >- - Evaluate a list of rows on a benchmark. - - :param benchmark_id: The ID of the benchmark to run the evaluation on. - :param input_rows: The rows to evaluate. - :param scoring_functions: The scoring functions to use for the evaluation. - :param benchmark_config: The configuration for the benchmark. - :returns: EvaluateResponse object containing generations and scores. parameters: - - name: benchmark_id - description: >- - The ID of the benchmark to run the evaluation on. - required: true - schema: - type: string - in: path + - name: benchmark_id + in: path + required: true + schema: + type: string + description: 'Path parameter: benchmark_id' + /v1alpha/eval/benchmarks/{benchmark_id}/jobs: + post: + tags: + - V1Alpha + summary: Run Eval + description: Typed endpoint for proper schema generation. + operationId: run_eval_v1alpha_eval_benchmarks__benchmark_id__jobs_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/EvaluateRowsRequest' + $ref: '#/components/schemas/BenchmarkConfig' required: true - deprecated: false - /v1alpha/eval/benchmarks/{benchmark_id}/jobs: - post: responses: '200': - description: >- - The job that was created to run the evaluation. + description: The job that was created to run the evaluation. content: application/json: schema: $ref: '#/components/schemas/Job' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - Eval - summary: Run an evaluation on a benchmark. - description: >- - Run an evaluation on a benchmark. - - :param benchmark_id: The ID of the benchmark to run the evaluation on. - :param benchmark_config: The configuration for the benchmark. - :returns: The job that was created to run the evaluation. parameters: - - name: benchmark_id - description: >- - The ID of the benchmark to run the evaluation on. - required: true - schema: - type: string - in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RunEvalRequest' + - name: benchmark_id + in: path required: true - deprecated: false + schema: + type: string + description: 'Path parameter: benchmark_id' /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}: - get: + delete: + tags: + - V1Alpha + summary: Job Cancel + description: Generic endpoint - this would be replaced with actual implementation. + operationId: job_cancel_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__delete + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: benchmark_id + in: path + required: true + schema: + type: string + description: 'Path parameter: benchmark_id' + - name: job_id + in: path + required: true + schema: + type: string + description: 'Path parameter: job_id' responses: '200': - description: The status of the evaluation job. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/Job' + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Eval - summary: Get the status of a job. - description: >- - Get the status of a job. - - :param benchmark_id: The ID of the benchmark to run the evaluation on. - :param job_id: The ID of the job to get the status of. - :returns: The status of the evaluation job. + - V1Alpha + summary: Job Status + description: Query endpoint for proper schema generation. + operationId: job_status_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__get parameters: - - name: benchmark_id - description: >- - The ID of the benchmark to run the evaluation on. - required: true - schema: - type: string - in: path - - name: job_id - description: The ID of the job to get the status of. - required: true - schema: - type: string - in: path - deprecated: false - delete: + - name: benchmark_id + in: path + required: true + schema: + type: string + title: Benchmark Id + - name: job_id + in: path + required: true + schema: + type: string + title: Job Id responses: '200': - description: OK + description: The status of the evaluation job. + content: + application/json: + schema: + $ref: '#/components/schemas/Job' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Eval - summary: Cancel a job. - description: >- - Cancel a job. - - :param benchmark_id: The ID of the benchmark to run the evaluation on. - :param job_id: The ID of the job to cancel. - parameters: - - name: benchmark_id - description: >- - The ID of the benchmark to run the evaluation on. - required: true - schema: - type: string - in: path - - name: job_id - description: The ID of the job to cancel. - required: true - schema: - type: string - in: path - deprecated: false + description: Default Response /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result: get: + tags: + - V1Alpha + summary: Job Result + description: Query endpoint for proper schema generation. + operationId: job_result_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__result_get + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + title: Benchmark Id + - name: job_id + in: path + required: true + schema: + type: string + title: Job Id responses: '200': description: The result of the job. @@ -4637,85 +4530,62 @@ paths: $ref: '#/components/schemas/EvaluateResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Eval - summary: Get the result of a job. - description: >- - Get the result of a job. - - :param benchmark_id: The ID of the benchmark to run the evaluation on. - :param job_id: The ID of the job to get the result of. - :returns: The result of the job. - parameters: - - name: benchmark_id - description: >- - The ID of the benchmark to run the evaluation on. - required: true - schema: - type: string - in: path - - name: job_id - description: The ID of the job to get the result of. - required: true - schema: - type: string - in: path - deprecated: false + description: Default Response /v1alpha/inference/rerank: post: + tags: + - V1Alpha + summary: Rerank + description: Typed endpoint for proper schema generation. + operationId: rerank_v1alpha_inference_rerank_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_inference_rerank_Request' + required: true responses: '200': - description: >- - RerankResponse with indices sorted by relevance score (descending). + description: RerankResponse with indices sorted by relevance score (descending). content: application/json: schema: $ref: '#/components/schemas/RerankResponse' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - Inference - summary: >- - Rerank a list of documents based on their relevance to a query. - description: >- - Rerank a list of documents based on their relevance to a query. - - :param model: The identifier of the reranking model to use. - :param query: The search query to rank items against. Can be a string, - text content part, or image content part. The input must not exceed the model's - max input token length. - :param items: List of items to rerank. Each item can be a string, - text content part, or image content part. Each input must not exceed the model's - max input token length. - :param max_num_results: (Optional) Maximum number of results to return. - Default: returns all. - :returns: RerankResponse with indices sorted by relevance score (descending). - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RerankRequest' - required: true - deprecated: false /v1alpha/post-training/job/artifacts: get: + tags: + - V1Alpha + summary: Get Training Job Artifacts + description: Query endpoint for proper schema generation. + operationId: get_training_job_artifacts_v1alpha_post_training_job_artifacts_get + parameters: + - name: job_uuid + in: query + required: true + schema: + type: string + title: Job Uuid responses: '200': description: A PostTrainingJobArtifactsResponse. @@ -4725,63 +4595,66 @@ paths: $ref: '#/components/schemas/PostTrainingJobArtifactsResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - PostTraining (Coming Soon) - summary: Get the artifacts of a training job. - description: >- - Get the artifacts of a training job. - - :param job_uuid: The UUID of the job to get the artifacts of. - :returns: A PostTrainingJobArtifactsResponse. - parameters: - - name: job_uuid - description: >- - The UUID of the job to get the artifacts of. - required: true - schema: - type: string - in: query - deprecated: false + description: Default Response /v1alpha/post-training/job/cancel: post: + tags: + - V1Alpha + summary: Cancel Training Job + description: Generic endpoint - this would be replaced with actual implementation. + operationId: cancel_training_job_v1alpha_post_training_job_cancel_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/post-training/job/status: + get: tags: - - PostTraining (Coming Soon) - summary: Cancel a training job. - description: >- - Cancel a training job. - - :param job_uuid: The UUID of the job to cancel. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CancelTrainingJobRequest' + - V1Alpha + summary: Get Training Job Status + description: Query endpoint for proper schema generation. + operationId: get_training_job_status_v1alpha_post_training_job_status_get + parameters: + - name: job_uuid + in: query required: true - deprecated: false - /v1alpha/post-training/job/status: - get: + schema: + type: string + title: Job Uuid responses: '200': description: A PostTrainingJobStatusResponse. @@ -4791,33 +4664,23 @@ paths: $ref: '#/components/schemas/PostTrainingJobStatusResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - PostTraining (Coming Soon) - summary: Get the status of a training job. - description: >- - Get the status of a training job. - - :param job_uuid: The UUID of the job to get the status of. - :returns: A PostTrainingJobStatusResponse. - parameters: - - name: job_uuid - description: >- - The UUID of the job to get the status of. - required: true - schema: - type: string - in: query - deprecated: false + description: Default Response /v1alpha/post-training/jobs: get: + tags: + - V1Alpha + summary: Get Training Jobs + description: Response-only endpoint for proper schema generation. + operationId: get_training_jobs_v1alpha_post_training_jobs_get responses: '200': description: A ListPostTrainingJobsResponse. @@ -4826,26 +4689,30 @@ paths: schema: $ref: '#/components/schemas/ListPostTrainingJobsResponse' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - PostTraining (Coming Soon) - summary: Get all training jobs. - description: >- - Get all training jobs. - - :returns: A ListPostTrainingJobsResponse. - parameters: [] - deprecated: false /v1alpha/post-training/preference-optimize: post: + tags: + - V1Alpha + summary: Preference Optimize + description: Typed endpoint for proper schema generation. + operationId: preference_optimize_v1alpha_post_training_preference_optimize_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DPOAlignmentConfig' + required: true responses: '200': description: A PostTrainingJob. @@ -4854,38 +4721,30 @@ paths: schema: $ref: '#/components/schemas/PostTrainingJob' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' + /v1alpha/post-training/supervised-fine-tune: + post: tags: - - PostTraining (Coming Soon) - summary: Run preference optimization of a model. - description: >- - Run preference optimization of a model. - - :param job_uuid: The UUID of the job to create. - :param finetuned_model: The model to fine-tune. - :param algorithm_config: The algorithm configuration. - :param training_config: The training configuration. - :param hyperparam_search_config: The hyperparam search configuration. - :param logger_config: The logger configuration. - :returns: A PostTrainingJob. - parameters: [] + - V1Alpha + summary: Supervised Fine Tune + description: Typed endpoint for proper schema generation. + operationId: supervised_fine_tune_v1alpha_post_training_supervised_fine_tune_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/PreferenceOptimizeRequest' + $ref: '#/components/schemas/TrainingConfig' required: true - deprecated: false - /v1alpha/post-training/supervised-fine-tune: - post: responses: '200': description: A PostTrainingJob. @@ -4894,9725 +4753,9028 @@ paths: schema: $ref: '#/components/schemas/PostTrainingJob' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' + /v1/batches: + get: tags: - - PostTraining (Coming Soon) - summary: Run supervised fine-tuning of a model. - description: >- - Run supervised fine-tuning of a model. - - :param job_uuid: The UUID of the job to create. - :param training_config: The training configuration. - :param hyperparam_search_config: The hyperparam search configuration. - :param logger_config: The logger configuration. - :param model: The model to fine-tune. - :param checkpoint_dir: The directory to save checkpoint(s) to. - :param algorithm_config: The algorithm configuration. - :returns: A PostTrainingJob. - parameters: [] + - V1 + summary: List Batches + description: Query endpoint for proper schema generation. + operationId: list_batches_v1_batches_get + parameters: + - name: after + in: query + required: true + schema: + type: string + title: After + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit + responses: + '200': + description: A list of batch objects. + content: + application/json: + schema: + $ref: '#/components/schemas/ListBatchesResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Create Batch + description: Typed endpoint for proper schema generation. + operationId: create_batch_v1_batches_post requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/SupervisedFineTuneRequest' + $ref: '#/components/schemas/_batches_Request' + responses: + '200': + description: The created batch object. + content: + application/json: + schema: + $ref: '#/components/schemas/Batch' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/batches/{batch_id}: + get: + tags: + - V1 + summary: Retrieve Batch + description: Query endpoint for proper schema generation. + operationId: retrieve_batch_v1_batches__batch_id__get + parameters: + - name: batch_id + in: path required: true - deprecated: false -jsonSchemaDialect: >- - https://json-schema.org/draft/2020-12/schema -components: - schemas: - Error: - description: >- - Error response from the API. Roughly follows RFC 7807. - - - :param status: HTTP status code - - :param title: Error title, a short summary of the error which is invariant - for an error type - - :param detail: Error detail, a longer human-readable description of the error - - :param instance: (Optional) A URL which can be used to retrieve more information - about the specific occurrence of the error - properties: - status: - title: Status - type: integer - title: - title: Title - type: string - detail: - title: Detail - type: string - instance: - anyOf: - - type: string - - type: 'null' - title: Instance - required: - - status - - title - - detail - title: Error - description: >- - Error response from the API. Roughly follows RFC 7807. - ListBatchesResponse: - type: object - properties: - object: - type: string - const: list - default: list - data: - type: array - items: - type: object - properties: - id: - type: string - completion_window: - type: string - created_at: - type: integer - endpoint: - type: string - input_file_id: - type: string - object: - type: string - const: batch - status: - type: string - enum: - - validating - - failed - - in_progress - - finalizing - - completed - - expired - - cancelling - - cancelled - cancelled_at: - type: integer - cancelling_at: - type: integer - completed_at: - type: integer - error_file_id: - type: string - errors: - type: object - properties: - data: - type: array - items: - type: object - properties: - code: - type: string - line: - type: integer - message: - type: string - param: - type: string - additionalProperties: false - title: BatchError - object: - type: string - additionalProperties: false - title: Errors - expired_at: - type: integer - expires_at: - type: integer - failed_at: - type: integer - finalizing_at: - type: integer - in_progress_at: - type: integer - metadata: - type: object - additionalProperties: - type: string - model: - type: string - output_file_id: - type: string - request_counts: - type: object - properties: - completed: - type: integer - failed: - type: integer - total: - type: integer - additionalProperties: false - required: - - completed - - failed - - total - title: BatchRequestCounts - usage: - type: object - properties: - input_tokens: - type: integer - input_tokens_details: - type: object - properties: - cached_tokens: - type: integer - additionalProperties: false - required: - - cached_tokens - title: InputTokensDetails - output_tokens: - type: integer - output_tokens_details: - type: object - properties: - reasoning_tokens: - type: integer - additionalProperties: false - required: - - reasoning_tokens - title: OutputTokensDetails - total_tokens: - type: integer - additionalProperties: false - required: - - input_tokens - - input_tokens_details - - output_tokens - - output_tokens_details - - total_tokens - title: BatchUsage - additionalProperties: false - required: - - id - - completion_window - - created_at - - endpoint - - input_file_id - - object - - status - title: Batch - first_id: - type: string - last_id: - type: string - has_more: - type: boolean - default: false - additionalProperties: false - required: - - object - - data - - has_more - title: ListBatchesResponse - description: >- - Response containing a list of batch objects. - CreateBatchRequest: - type: object - properties: - input_file_id: - type: string - description: >- - The ID of an uploaded file containing requests for the batch. - endpoint: - type: string - description: >- - The endpoint to be used for all requests in the batch. - completion_window: - type: string - const: 24h - description: >- - The time window within which the batch should be processed. - metadata: - type: object - additionalProperties: - type: string - description: Optional metadata for the batch. - idempotency_key: - type: string - description: >- - Optional idempotency key. When provided, enables idempotent behavior. - additionalProperties: false - required: - - input_file_id - - endpoint - - completion_window - title: CreateBatchRequest - Batch: - type: object - properties: - id: - type: string - completion_window: - type: string - created_at: - type: integer - endpoint: + schema: type: string - input_file_id: + title: Batch Id + responses: + '200': + description: The batch object. + content: + application/json: + schema: + $ref: '#/components/schemas/Batch' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/batches/{batch_id}/cancel: + post: + tags: + - V1 + summary: Cancel Batch + description: Typed endpoint for proper schema generation. + operationId: cancel_batch_v1_batches__batch_id__cancel_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_batches_batch_id_cancel_Request' + required: true + responses: + '200': + description: The updated batch object. + content: + application/json: + schema: + $ref: '#/components/schemas/Batch' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: batch_id + in: path + required: true + schema: type: string - object: + description: 'Path parameter: batch_id' + /v1/chat/completions: + get: + tags: + - V1 + summary: List Chat Completions + description: Query endpoint for proper schema generation. + operationId: list_chat_completions_v1_chat_completions_get + parameters: + - name: after + in: query + required: true + schema: type: string - const: batch - status: + title: After + - name: model + in: query + required: true + schema: type: string - enum: - - validating - - failed - - in_progress - - finalizing - - completed - - expired - - cancelling - - cancelled - cancelled_at: + title: Model + - name: limit + in: query + required: false + schema: type: integer - cancelling_at: - type: integer - completed_at: - type: integer - error_file_id: + default: 20 + title: Limit + - name: order + in: query + required: false + schema: + $ref: '#/components/schemas/Order' + default: desc + responses: + '200': + description: A ListOpenAIChatCompletionResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/ListOpenAIChatCompletionResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Openai Chat Completion + description: Typed endpoint for proper schema generation. + operationId: openai_chat_completion_v1_chat_completions_post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIChatCompletionRequestWithExtraBody' + responses: + '200': + description: An OpenAIChatCompletion. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIChatCompletion' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/chat/completions/{completion_id}: + get: + tags: + - V1 + summary: Get Chat Completion + description: Query endpoint for proper schema generation. + operationId: get_chat_completion_v1_chat_completions__completion_id__get + parameters: + - name: completion_id + in: path + required: true + schema: type: string - errors: - type: object - properties: - data: - type: array - items: - type: object - properties: - code: - type: string - line: - type: integer - message: - type: string - param: - type: string - additionalProperties: false - title: BatchError - object: - type: string - additionalProperties: false - title: Errors - expired_at: - type: integer - expires_at: - type: integer - failed_at: - type: integer - finalizing_at: - type: integer - in_progress_at: + title: Completion Id + responses: + '200': + description: A OpenAICompletionWithInputMessages. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAICompletionWithInputMessages' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/completions: + post: + tags: + - V1 + summary: Openai Completion + description: Typed endpoint for proper schema generation. + operationId: openai_completion_v1_completions_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAICompletionRequestWithExtraBody' + required: true + responses: + '200': + description: An OpenAICompletion. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAICompletion' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/conversations: + post: + tags: + - V1 + summary: Create Conversation + description: Typed endpoint for proper schema generation. + operationId: create_conversation_v1_conversations_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_conversations_Request' + required: true + responses: + '200': + description: The created conversation object. + content: + application/json: + schema: + $ref: '#/components/schemas/Conversation' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/conversations/{conversation_id}: + delete: + tags: + - V1 + summary: Openai Delete Conversation + description: Query endpoint for proper schema generation. + operationId: openai_delete_conversation_v1_conversations__conversation_id__delete + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id + responses: + '200': + description: The deleted conversation resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationDeletedResource' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Get Conversation + description: Query endpoint for proper schema generation. + operationId: get_conversation_v1_conversations__conversation_id__get + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id + responses: + '200': + description: The conversation object. + content: + application/json: + schema: + $ref: '#/components/schemas/Conversation' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Update Conversation + description: Typed endpoint for proper schema generation. + operationId: update_conversation_v1_conversations__conversation_id__post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/_conversations_conversation_id_Request' + responses: + '200': + description: The updated conversation object. + content: + application/json: + schema: + $ref: '#/components/schemas/Conversation' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + description: 'Path parameter: conversation_id' + /v1/conversations/{conversation_id}/items: + get: + tags: + - V1 + summary: List Items + description: Query endpoint for proper schema generation. + operationId: list_items_v1_conversations__conversation_id__items_get + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id + - name: after + in: query + required: true + schema: + type: string + title: After + - name: include + in: query + required: true + schema: + $ref: '#/components/schemas/ConversationItemInclude' + - name: limit + in: query + required: true + schema: type: integer - metadata: - type: object - additionalProperties: - type: string - model: + title: Limit + - name: order + in: query + required: true + schema: type: string - output_file_id: + title: Order + responses: + '200': + description: List of conversation items. + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationItemList' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Add Items + description: Typed endpoint for proper schema generation. + operationId: add_items_v1_conversations__conversation_id__items_post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/_conversations_conversation_id_items_Request' + responses: + '200': + description: List of created items. + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationItemList' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + parameters: + - name: conversation_id + in: path + required: true + schema: type: string - request_counts: - type: object - properties: - completed: - type: integer - failed: - type: integer - total: - type: integer - additionalProperties: false - required: - - completed - - failed - - total - title: BatchRequestCounts - usage: - type: object - properties: - input_tokens: - type: integer - input_tokens_details: - type: object - properties: - cached_tokens: - type: integer - additionalProperties: false - required: - - cached_tokens - title: InputTokensDetails - output_tokens: - type: integer - output_tokens_details: - type: object - properties: - reasoning_tokens: - type: integer - additionalProperties: false - required: - - reasoning_tokens - title: OutputTokensDetails - total_tokens: - type: integer - additionalProperties: false - required: - - input_tokens - - input_tokens_details - - output_tokens - - output_tokens_details - - total_tokens - title: BatchUsage - additionalProperties: false - required: - - id - - completion_window - - created_at - - endpoint - - input_file_id - - object - - status - title: Batch - Order: - type: string - enum: - - asc - - desc - title: Order - description: Sort order for paginated responses. - ListOpenAIChatCompletionResponse: - type: object - Order: - type: object - ListOpenAIChatCompletionResponse: - $defs: - OpenAIAssistantMessageParam: - description: >- - A message containing the model's (assistant) response in an OpenAI-compatible - chat completion request. - - - :param role: Must be "assistant" to identify this as the model's response - - :param content: The content of the model's response - - :param name: (Optional) The name of the assistant message participant. - - :param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall - object. - properties: - role: - const: assistant - default: assistant - title: Role - type: string - content: - anyOf: - - type: string - - items: - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - type: array - - type: 'null' - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - tool_calls: - anyOf: - - items: - $ref: '#/$defs/OpenAIChatCompletionToolCall' - type: array - - type: 'null' - title: Tool Calls - title: OpenAIAssistantMessageParam - type: object - "OpenAIChatCompletionContentPartImageParam": - description: >- - Image content part for OpenAI-compatible chat completion messages. - - - :param type: Must be "image_url" to identify this as image content - - :param image_url: Image URL specification and processing details - properties: - type: - const: image_url - default: image_url - title: Type - type: string - image_url: - $ref: '#/$defs/OpenAIImageURL' - required: - - image_url - title: >- - OpenAIChatCompletionContentPartImageParam - type: object - OpenAIChatCompletionContentPartTextParam: - description: >- - Text content part for OpenAI-compatible chat completion messages. - - - :param type: Must be "text" to identify this as text content - - :param text: The text content of the message - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: OpenAIChatCompletionContentPartTextParam - type: object - OpenAIChatCompletionToolCall: - description: >- - Tool call specification for OpenAI-compatible chat completion responses. - - - :param index: (Optional) Index of the tool call in the list - - :param id: (Optional) Unique identifier for the tool call - - :param type: Must be "function" to identify this as a function call - - :param function: (Optional) Function call details - properties: - index: - anyOf: - - type: integer - - type: 'null' - title: Index - id: - anyOf: - - type: string - - type: 'null' - title: Id - type: - const: function - default: function - title: Type - type: string - function: - anyOf: - - $ref: >- - #/$defs/OpenAIChatCompletionToolCallFunction - - type: 'null' - title: OpenAIChatCompletionToolCall - type: object - OpenAIChatCompletionToolCallFunction: - description: >- - Function call details for OpenAI-compatible tool calls. - - - :param name: (Optional) Name of the function to call - - :param arguments: (Optional) Arguments to pass to the function as a JSON - string - properties: - name: - anyOf: - - type: string - - type: 'null' - title: Name - arguments: - anyOf: - - type: string - - type: 'null' - title: Arguments - title: OpenAIChatCompletionToolCallFunction - type: object - OpenAIChatCompletionUsage: - description: >- - Usage information for OpenAI chat completion. - - - :param prompt_tokens: Number of tokens in the prompt - - :param completion_tokens: Number of tokens in the completion - - :param total_tokens: Total tokens used (prompt + completion) - - :param input_tokens_details: Detailed breakdown of input token usage - - :param output_tokens_details: Detailed breakdown of output token usage - properties: - prompt_tokens: - title: Prompt Tokens - type: integer - completion_tokens: - title: Completion Tokens - type: integer - total_tokens: - title: Total Tokens - type: integer - prompt_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIChatCompletionUsagePromptTokensDetails - - type: 'null' - completion_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIChatCompletionUsageCompletionTokensDetails - - type: 'null' - required: - - prompt_tokens - - completion_tokens - - total_tokens - title: OpenAIChatCompletionUsage - type: object - "OpenAIChatCompletionUsageCompletionTokensDetails": - description: >- - Token details for output tokens in OpenAI chat completion usage. - - - :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) - properties: - reasoning_tokens: - anyOf: - - type: integer - - type: 'null' - title: Reasoning Tokens - title: >- - OpenAIChatCompletionUsageCompletionTokensDetails - type: object - "OpenAIChatCompletionUsagePromptTokensDetails": - description: >- - Token details for prompt tokens in OpenAI chat completion usage. - - - :param cached_tokens: Number of tokens retrieved from cache - properties: - cached_tokens: - anyOf: - - type: integer - - type: 'null' - title: Cached Tokens - title: >- - OpenAIChatCompletionUsagePromptTokensDetails - type: object - OpenAIChoice: - description: >- - A choice from an OpenAI-compatible chat completion response. - - - :param message: The message from the model - - :param finish_reason: The reason the model stopped generating - - :param index: The index of the choice - - :param logprobs: (Optional) The log probabilities for the tokens in the - message - properties: - message: - discriminator: - mapping: - assistant: '#/$defs/OpenAIAssistantMessageParam' - developer: '#/$defs/OpenAIDeveloperMessageParam' - system: '#/$defs/OpenAISystemMessageParam' - tool: '#/$defs/OpenAIToolMessageParam' - user: '#/$defs/OpenAIUserMessageParam' - propertyName: role - oneOf: - - $ref: '#/$defs/OpenAIUserMessageParam' - - $ref: '#/$defs/OpenAISystemMessageParam' - - $ref: '#/$defs/OpenAIAssistantMessageParam' - - $ref: '#/$defs/OpenAIToolMessageParam' - - $ref: '#/$defs/OpenAIDeveloperMessageParam' - title: Message - finish_reason: - title: Finish Reason - type: string - index: - title: Index - type: integer - logprobs: - anyOf: - - $ref: '#/$defs/OpenAIChoiceLogprobs' - - type: 'null' - required: - - message - - finish_reason - - index - title: OpenAIChoice - type: object - OpenAIChoiceLogprobs: - description: >- - The log probabilities for the tokens in the message from an OpenAI-compatible - chat completion response. - - - :param content: (Optional) The log probabilities for the tokens in the - message - - :param refusal: (Optional) The log probabilities for the tokens in the - message - properties: - content: - anyOf: - - items: - $ref: '#/$defs/OpenAITokenLogProb' - type: array - - type: 'null' - title: Content - refusal: - anyOf: - - items: - $ref: '#/$defs/OpenAITokenLogProb' - type: array - - type: 'null' - title: Refusal - title: OpenAIChoiceLogprobs - type: object - OpenAICompletionWithInputMessages: - properties: - id: - title: Id - type: string - choices: - items: - $ref: '#/$defs/OpenAIChoice' - title: Choices - type: array - object: - const: chat.completion - default: chat.completion - title: Object - type: string - created: - title: Created - type: integer - model: - title: Model - type: string - usage: - anyOf: - - $ref: '#/$defs/OpenAIChatCompletionUsage' - - type: 'null' - input_messages: - items: - discriminator: - mapping: - assistant: '#/$defs/OpenAIAssistantMessageParam' - developer: '#/$defs/OpenAIDeveloperMessageParam' - system: '#/$defs/OpenAISystemMessageParam' - tool: '#/$defs/OpenAIToolMessageParam' - user: '#/$defs/OpenAIUserMessageParam' - propertyName: role - oneOf: - - $ref: '#/$defs/OpenAIUserMessageParam' - - $ref: '#/$defs/OpenAISystemMessageParam' - - $ref: '#/$defs/OpenAIAssistantMessageParam' - - $ref: '#/$defs/OpenAIToolMessageParam' - - $ref: '#/$defs/OpenAIDeveloperMessageParam' - title: Input Messages - type: array - required: - - id - - choices - - created - - model - - input_messages - title: OpenAICompletionWithInputMessages - type: object - OpenAIDeveloperMessageParam: - description: >- - A message from the developer in an OpenAI-compatible chat completion request. - - - :param role: Must be "developer" to identify this as a developer message - - :param content: The content of the developer message - - :param name: (Optional) The name of the developer message participant. - properties: - role: - const: developer - default: developer - title: Role - type: string - content: - anyOf: - - type: string - - items: - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - type: array - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - required: - - content - title: OpenAIDeveloperMessageParam - type: object - OpenAIFile: - properties: - type: - const: file - default: file - title: Type - type: string - file: - $ref: '#/$defs/OpenAIFileFile' - required: - - file - title: OpenAIFile - type: object - OpenAIFileFile: - properties: - file_data: - anyOf: - - type: string - - type: 'null' - title: File Data - file_id: - anyOf: - - type: string - - type: 'null' - title: File Id - filename: - anyOf: - - type: string - - type: 'null' - title: Filename - title: OpenAIFileFile - type: object - OpenAIImageURL: - description: >- - Image URL specification for OpenAI-compatible chat completion messages. - - - :param url: URL of the image to include in the message - - :param detail: (Optional) Level of detail for image processing. Can be - "low", "high", or "auto" - properties: - url: - title: Url - type: string - detail: - anyOf: - - type: string - - type: 'null' - title: Detail - required: - - url - title: OpenAIImageURL - type: object - OpenAISystemMessageParam: - description: >- - A system message providing instructions or context to the model. - - - :param role: Must be "system" to identify this as a system message - - :param content: The content of the "system prompt". If multiple system - messages are provided, they are concatenated. The underlying Llama Stack - code may also add other system messages (for example, for formatting tool - definitions). - - :param name: (Optional) The name of the system message participant. - properties: - role: - const: system - default: system - title: Role - type: string - content: - anyOf: - - type: string - - items: - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - type: array - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - required: - - content - title: OpenAISystemMessageParam - type: object - OpenAITokenLogProb: - description: >- - The log probability for a token from an OpenAI-compatible chat completion - response. - - - :token: The token - - :bytes: (Optional) The bytes for the token - - :logprob: The log probability of the token - - :top_logprobs: The top log probabilities for the token - properties: - token: - title: Token - type: string - bytes: - anyOf: - - items: - type: integer - type: array - - type: 'null' - title: Bytes - logprob: - title: Logprob - type: number - top_logprobs: - items: - $ref: '#/$defs/OpenAITopLogProb' - title: Top Logprobs - type: array - required: - - token - - logprob - - top_logprobs - title: OpenAITokenLogProb - type: object - OpenAIToolMessageParam: - description: >- - A message representing the result of a tool invocation in an OpenAI-compatible - chat completion request. - - - :param role: Must be "tool" to identify this as a tool response - - :param tool_call_id: Unique identifier for the tool call this response - is for - - :param content: The response content from the tool - properties: - role: - const: tool - default: tool - title: Role - type: string - tool_call_id: - title: Tool Call Id - type: string - content: - anyOf: - - type: string - - items: - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - type: array - title: Content - required: - - tool_call_id - - content - title: OpenAIToolMessageParam - type: object - OpenAITopLogProb: - description: >- - The top log probability for a token from an OpenAI-compatible chat completion - response. - - - :token: The token - - :bytes: (Optional) The bytes for the token - - :logprob: The log probability of the token - properties: - token: - title: Token - type: string - bytes: - anyOf: - - items: - type: integer - type: array - - type: 'null' - title: Bytes - logprob: - title: Logprob - type: number - required: - - token - - logprob - title: OpenAITopLogProb - type: object - OpenAIUserMessageParam: - description: >- - A message from the user in an OpenAI-compatible chat completion request. - - - :param role: Must be "user" to identify this as a user message - - :param content: The content of the message, which can include text and - other media - - :param name: (Optional) The name of the user message participant. - properties: - role: - const: user - default: user - title: Role - type: string - content: - anyOf: - - type: string - - items: - discriminator: - mapping: - file: '#/$defs/OpenAIFile' - image_url: >- - #/$defs/OpenAIChatCompletionContentPartImageParam - text: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - - $ref: >- - #/$defs/OpenAIChatCompletionContentPartImageParam - - $ref: '#/$defs/OpenAIFile' - type: array - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - required: - - content - title: OpenAIUserMessageParam - type: object - description: >- - Response from listing OpenAI-compatible chat completions. - - - :param data: List of chat completion objects with their input messages - - :param has_more: Whether there are more completions available beyond this - list - - :param first_id: ID of the first completion in this list - - :param last_id: ID of the last completion in this list - - :param object: Must be "list" to identify this as a list response - properties: - data: - items: - $ref: >- - #/$defs/OpenAICompletionWithInputMessages - title: Data - type: array - has_more: - title: Has More - type: boolean - first_id: - title: First Id - type: string - last_id: - title: Last Id - type: string - object: - const: list - default: list - title: Object - type: string - required: - - data - - has_more - - first_id - - last_id - title: ListOpenAIChatCompletionResponse - type: object - Annotated: - type: object - ? >- - llama_stack.apis.inference.inference.OpenAIChatCompletion | collections.abc.AsyncIterator[llama_stack.apis.inference.inference.OpenAIChatCompletionChunk] - : type: object - OpenAICompletionWithInputMessages: - $defs: - OpenAIAssistantMessageParam: - description: >- - A message containing the model's (assistant) response in an OpenAI-compatible - chat completion request. - - - :param role: Must be "assistant" to identify this as the model's response - - :param content: The content of the model's response - - :param name: (Optional) The name of the assistant message participant. - - :param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall - object. - properties: - role: - const: assistant - default: assistant - title: Role - type: string - content: - anyOf: - - type: string - - items: - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - type: array - - type: 'null' - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - tool_calls: - anyOf: - - items: - $ref: '#/$defs/OpenAIChatCompletionToolCall' - type: array - - type: 'null' - title: Tool Calls - title: OpenAIAssistantMessageParam - type: object - "OpenAIChatCompletionContentPartImageParam": - description: >- - Image content part for OpenAI-compatible chat completion messages. - - - :param type: Must be "image_url" to identify this as image content - - :param image_url: Image URL specification and processing details - properties: - type: - const: image_url - default: image_url - title: Type - type: string - image_url: - $ref: '#/$defs/OpenAIImageURL' - required: - - image_url - title: >- - OpenAIChatCompletionContentPartImageParam - type: object - OpenAIChatCompletionContentPartTextParam: - description: >- - Text content part for OpenAI-compatible chat completion messages. - - - :param type: Must be "text" to identify this as text content - - :param text: The text content of the message - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: OpenAIChatCompletionContentPartTextParam - type: object - OpenAIChatCompletionToolCall: - description: >- - Tool call specification for OpenAI-compatible chat completion responses. - - - :param index: (Optional) Index of the tool call in the list - - :param id: (Optional) Unique identifier for the tool call - - :param type: Must be "function" to identify this as a function call - - :param function: (Optional) Function call details - properties: - index: - anyOf: - - type: integer - - type: 'null' - title: Index - id: - anyOf: - - type: string - - type: 'null' - title: Id - type: - const: function - default: function - title: Type - type: string - function: - anyOf: - - $ref: >- - #/$defs/OpenAIChatCompletionToolCallFunction - - type: 'null' - title: OpenAIChatCompletionToolCall - type: object - OpenAIChatCompletionToolCallFunction: - description: >- - Function call details for OpenAI-compatible tool calls. - - - :param name: (Optional) Name of the function to call - - :param arguments: (Optional) Arguments to pass to the function as a JSON - string - properties: - name: - anyOf: - - type: string - - type: 'null' - title: Name - arguments: - anyOf: - - type: string - - type: 'null' - title: Arguments - title: OpenAIChatCompletionToolCallFunction - type: object - OpenAIChatCompletionUsage: - description: >- - Usage information for OpenAI chat completion. - - - :param prompt_tokens: Number of tokens in the prompt - - :param completion_tokens: Number of tokens in the completion - - :param total_tokens: Total tokens used (prompt + completion) - - :param input_tokens_details: Detailed breakdown of input token usage - - :param output_tokens_details: Detailed breakdown of output token usage - properties: - prompt_tokens: - title: Prompt Tokens - type: integer - completion_tokens: - title: Completion Tokens - type: integer - total_tokens: - title: Total Tokens - type: integer - prompt_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIChatCompletionUsagePromptTokensDetails - - type: 'null' - completion_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIChatCompletionUsageCompletionTokensDetails - - type: 'null' - required: - - prompt_tokens - - completion_tokens - - total_tokens - title: OpenAIChatCompletionUsage - type: object - "OpenAIChatCompletionUsageCompletionTokensDetails": - description: >- - Token details for output tokens in OpenAI chat completion usage. - - - :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) - properties: - reasoning_tokens: - anyOf: - - type: integer - - type: 'null' - title: Reasoning Tokens - title: >- - OpenAIChatCompletionUsageCompletionTokensDetails - type: object - "OpenAIChatCompletionUsagePromptTokensDetails": - description: >- - Token details for prompt tokens in OpenAI chat completion usage. - - - :param cached_tokens: Number of tokens retrieved from cache - properties: - cached_tokens: - anyOf: - - type: integer - - type: 'null' - title: Cached Tokens - title: >- - OpenAIChatCompletionUsagePromptTokensDetails - type: object - OpenAIChoice: - description: >- - A choice from an OpenAI-compatible chat completion response. - - - :param message: The message from the model - - :param finish_reason: The reason the model stopped generating - - :param index: The index of the choice - - :param logprobs: (Optional) The log probabilities for the tokens in the - message - properties: - message: - discriminator: - mapping: - assistant: '#/$defs/OpenAIAssistantMessageParam' - developer: '#/$defs/OpenAIDeveloperMessageParam' - system: '#/$defs/OpenAISystemMessageParam' - tool: '#/$defs/OpenAIToolMessageParam' - user: '#/$defs/OpenAIUserMessageParam' - propertyName: role - oneOf: - - $ref: '#/$defs/OpenAIUserMessageParam' - - $ref: '#/$defs/OpenAISystemMessageParam' - - $ref: '#/$defs/OpenAIAssistantMessageParam' - - $ref: '#/$defs/OpenAIToolMessageParam' - - $ref: '#/$defs/OpenAIDeveloperMessageParam' - title: Message - finish_reason: - title: Finish Reason - type: string - index: - title: Index - type: integer - logprobs: - anyOf: - - $ref: '#/$defs/OpenAIChoiceLogprobs' - - type: 'null' - required: - - message - - finish_reason - - index - title: OpenAIChoice - type: object - OpenAIChoiceLogprobs: - description: >- - The log probabilities for the tokens in the message from an OpenAI-compatible - chat completion response. - - - :param content: (Optional) The log probabilities for the tokens in the - message - - :param refusal: (Optional) The log probabilities for the tokens in the - message - properties: - content: - anyOf: - - items: - $ref: '#/$defs/OpenAITokenLogProb' - type: array - - type: 'null' - title: Content - refusal: - anyOf: - - items: - $ref: '#/$defs/OpenAITokenLogProb' - type: array - - type: 'null' - title: Refusal - title: OpenAIChoiceLogprobs - type: object - OpenAIDeveloperMessageParam: - description: >- - A message from the developer in an OpenAI-compatible chat completion request. - - - :param role: Must be "developer" to identify this as a developer message - - :param content: The content of the developer message - - :param name: (Optional) The name of the developer message participant. - properties: - role: - const: developer - default: developer - title: Role - type: string - content: - anyOf: - - type: string - - items: - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - type: array - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - required: - - content - title: OpenAIDeveloperMessageParam - type: object - OpenAIFile: - properties: - type: - const: file - default: file - title: Type - type: string - file: - $ref: '#/$defs/OpenAIFileFile' - required: - - file - title: OpenAIFile - type: object - OpenAIFileFile: - properties: - file_data: - anyOf: - - type: string - - type: 'null' - title: File Data - file_id: - anyOf: - - type: string - - type: 'null' - title: File Id - filename: - anyOf: - - type: string - - type: 'null' - title: Filename - title: OpenAIFileFile - type: object - OpenAIImageURL: - description: >- - Image URL specification for OpenAI-compatible chat completion messages. - - - :param url: URL of the image to include in the message - - :param detail: (Optional) Level of detail for image processing. Can be - "low", "high", or "auto" - properties: - url: - title: Url - type: string - detail: - anyOf: - - type: string - - type: 'null' - title: Detail - required: - - url - title: OpenAIImageURL - type: object - OpenAISystemMessageParam: - description: >- - A system message providing instructions or context to the model. - - - :param role: Must be "system" to identify this as a system message - - :param content: The content of the "system prompt". If multiple system - messages are provided, they are concatenated. The underlying Llama Stack - code may also add other system messages (for example, for formatting tool - definitions). - - :param name: (Optional) The name of the system message participant. - properties: - role: - const: system - default: system - title: Role - type: string - content: - anyOf: - - type: string - - items: - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - type: array - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - required: - - content - title: OpenAISystemMessageParam - type: object - OpenAITokenLogProb: - description: >- - The log probability for a token from an OpenAI-compatible chat completion - response. - - - :token: The token - - :bytes: (Optional) The bytes for the token - - :logprob: The log probability of the token - - :top_logprobs: The top log probabilities for the token - properties: - token: - title: Token - type: string - bytes: - anyOf: - - items: - type: integer - type: array - - type: 'null' - title: Bytes - logprob: - title: Logprob - type: number - top_logprobs: - items: - $ref: '#/$defs/OpenAITopLogProb' - title: Top Logprobs - type: array - required: - - token - - logprob - - top_logprobs - title: OpenAITokenLogProb - type: object - OpenAIToolMessageParam: - description: >- - A message representing the result of a tool invocation in an OpenAI-compatible - chat completion request. - - - :param role: Must be "tool" to identify this as a tool response - - :param tool_call_id: Unique identifier for the tool call this response - is for - - :param content: The response content from the tool - properties: - role: - const: tool - default: tool - title: Role - type: string - tool_call_id: - title: Tool Call Id - type: string - content: - anyOf: - - type: string - - items: - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - type: array - title: Content - required: - - tool_call_id - - content - title: OpenAIToolMessageParam - type: object - OpenAITopLogProb: - description: >- - The top log probability for a token from an OpenAI-compatible chat completion - response. - - - :token: The token - - :bytes: (Optional) The bytes for the token - - :logprob: The log probability of the token - properties: - token: - title: Token - type: string - bytes: - anyOf: - - items: - type: integer - type: array - - type: 'null' - title: Bytes - logprob: - title: Logprob - type: number - required: - - token - - logprob - title: OpenAITopLogProb - type: object - OpenAIUserMessageParam: - description: >- - A message from the user in an OpenAI-compatible chat completion request. - - - :param role: Must be "user" to identify this as a user message - - :param content: The content of the message, which can include text and - other media - - :param name: (Optional) The name of the user message participant. - properties: - role: - const: user - default: user - title: Role - type: string - content: - anyOf: - - type: string - - items: - discriminator: - mapping: - file: '#/$defs/OpenAIFile' - image_url: >- - #/$defs/OpenAIChatCompletionContentPartImageParam - text: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - - $ref: >- - #/$defs/OpenAIChatCompletionContentPartImageParam - - $ref: '#/$defs/OpenAIFile' - type: array - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - required: - - content - title: OpenAIUserMessageParam - type: object - properties: - id: - title: Id - type: string - choices: - items: - $ref: '#/$defs/OpenAIChoice' - title: Choices - type: array - object: - const: chat.completion - default: chat.completion - title: Object - type: string - created: - title: Created - type: integer - model: - title: Model - type: string - usage: - anyOf: - - $ref: '#/$defs/OpenAIChatCompletionUsage' - - type: 'null' - input_messages: - items: - discriminator: - mapping: - assistant: '#/$defs/OpenAIAssistantMessageParam' - developer: '#/$defs/OpenAIDeveloperMessageParam' - system: '#/$defs/OpenAISystemMessageParam' - tool: '#/$defs/OpenAIToolMessageParam' - user: '#/$defs/OpenAIUserMessageParam' - propertyName: role - oneOf: - - $ref: '#/$defs/OpenAIUserMessageParam' - - $ref: '#/$defs/OpenAISystemMessageParam' - - $ref: '#/$defs/OpenAIAssistantMessageParam' - - $ref: '#/$defs/OpenAIToolMessageParam' - - $ref: '#/$defs/OpenAIDeveloperMessageParam' - title: Input Messages - type: array - required: - - id - - choices - - created - - model - - input_messages - title: OpenAICompletionWithInputMessages - type: object - OpenAICompletion: - $defs: - OpenAIChoiceLogprobs: - description: >- - The log probabilities for the tokens in the message from an OpenAI-compatible - chat completion response. - - - :param content: (Optional) The log probabilities for the tokens in the - message - - :param refusal: (Optional) The log probabilities for the tokens in the - message - properties: - content: - anyOf: - - items: - $ref: '#/$defs/OpenAITokenLogProb' - type: array - - type: 'null' - title: Content - refusal: - anyOf: - - items: - $ref: '#/$defs/OpenAITokenLogProb' - type: array - - type: 'null' - title: Refusal - title: OpenAIChoiceLogprobs - type: object - OpenAICompletionChoice: - description: >- - A choice from an OpenAI-compatible completion response. - - - :finish_reason: The reason the model stopped generating - - :text: The text of the choice - - :index: The index of the choice - - :logprobs: (Optional) The log probabilities for the tokens in the choice - properties: - finish_reason: - title: Finish Reason - type: string - text: - title: Text - type: string - index: - title: Index - type: integer - logprobs: - anyOf: - - $ref: '#/$defs/OpenAIChoiceLogprobs' - - type: 'null' - required: - - finish_reason - - text - - index - title: OpenAICompletionChoice - type: object - OpenAITokenLogProb: - description: >- - The log probability for a token from an OpenAI-compatible chat completion - response. - - - :token: The token - - :bytes: (Optional) The bytes for the token - - :logprob: The log probability of the token - - :top_logprobs: The top log probabilities for the token - properties: - token: - title: Token - type: string - bytes: - anyOf: - - items: - type: integer - type: array - - type: 'null' - title: Bytes - logprob: - title: Logprob - type: number - top_logprobs: - items: - $ref: '#/$defs/OpenAITopLogProb' - title: Top Logprobs - type: array - required: - - token - - logprob - - top_logprobs - title: OpenAITokenLogProb - type: object - OpenAITopLogProb: - description: >- - The top log probability for a token from an OpenAI-compatible chat completion - response. - - - :token: The token - - :bytes: (Optional) The bytes for the token - - :logprob: The log probability of the token - properties: - token: - title: Token - type: string - bytes: - anyOf: - - items: - type: integer - type: array - - type: 'null' - title: Bytes - logprob: - title: Logprob - type: number - required: - - token - - logprob - title: OpenAITopLogProb - type: object - description: >- - Response from an OpenAI-compatible completion request. - - - :id: The ID of the completion - - :choices: List of choices - - :created: The Unix timestamp in seconds when the completion was created - - :model: The model that was used to generate the completion - - :object: The object type, which will be "text_completion" - properties: - id: - title: Id - type: string - choices: - items: - $ref: '#/$defs/OpenAICompletionChoice' - title: Choices - type: array - created: - title: Created - type: integer - model: - title: Model - type: string - object: - const: text_completion - default: text_completion - title: Object - type: string - required: - - id - - choices - - created - - model - title: OpenAICompletion - type: object - properties: - finish_reason: - type: string - text: - type: string - index: - type: integer - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - additionalProperties: false - required: - - finish_reason - - text - - index - title: OpenAICompletionChoice - description: >- - A choice from an OpenAI-compatible completion response. - ConversationItem: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - OpenAIResponseAnnotationCitation: - type: object - properties: - type: - type: string - const: url_citation - default: url_citation - description: >- - Annotation type identifier, always "url_citation" - end_index: - type: integer - description: >- - End position of the citation span in the content - start_index: - type: integer - description: >- - Start position of the citation span in the content - title: - type: string - description: Title of the referenced web resource - url: - type: string - description: URL of the referenced web resource - additionalProperties: false - required: - - type - - end_index - - start_index - - title - - url - title: OpenAIResponseAnnotationCitation - description: >- - URL citation annotation for referencing external web resources. - "OpenAIResponseAnnotationContainerFileCitation": - type: object - properties: - type: - type: string - const: container_file_citation - default: container_file_citation - container_id: - type: string - end_index: - type: integer - file_id: - type: string - filename: - type: string - start_index: - type: integer - additionalProperties: false - required: - - type - - container_id - - end_index - - file_id - - filename - - start_index - title: >- - OpenAIResponseAnnotationContainerFileCitation - OpenAIResponseAnnotationFileCitation: - type: object - properties: - type: - type: string - const: file_citation - default: file_citation - description: >- - Annotation type identifier, always "file_citation" - file_id: - type: string - description: Unique identifier of the referenced file - filename: - type: string - description: Name of the referenced file - index: - type: integer - description: >- - Position index of the citation within the content - additionalProperties: false - required: - - type - - file_id - - filename - - index - title: OpenAIResponseAnnotationFileCitation - description: >- - File citation annotation for referencing specific files in response content. - OpenAIResponseAnnotationFilePath: - type: object - properties: - type: - type: string - const: file_path - default: file_path - file_id: - type: string - index: - type: integer - additionalProperties: false - required: - - type - - file_id - - index - title: OpenAIResponseAnnotationFilePath - OpenAIResponseAnnotations: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' - discriminator: - propertyName: type - mapping: - file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' - container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' - OpenAIResponseContentPartRefusal: - type: object - properties: - type: - type: string - const: refusal - default: refusal - description: >- - Content part type identifier, always "refusal" - refusal: - type: string - description: Refusal text supplied by the model - additionalProperties: false - required: - - type - - refusal - title: OpenAIResponseContentPartRefusal - description: >- - Refusal content within a streamed response part. - "OpenAIResponseInputFunctionToolCallOutput": - type: object - properties: - call_id: - type: string - output: - type: string - type: - type: string - const: function_call_output - default: function_call_output - id: - type: string - status: - type: string - additionalProperties: false - required: - - call_id - - output - - type - title: >- - OpenAIResponseInputFunctionToolCallOutput - description: >- - This represents the output of a function call that gets passed back to the - model. - OpenAIResponseInputMessageContent: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' - discriminator: - propertyName: type - mapping: - input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' - input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' - input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' - OpenAIResponseInputMessageContentFile: - type: object - properties: - type: - type: string - const: input_file - default: input_file - description: >- - The type of the input item. Always `input_file`. - file_data: - type: string - description: >- - The data of the file to be sent to the model. - file_id: - type: string - description: >- - (Optional) The ID of the file to be sent to the model. - file_url: - type: string - description: >- - The URL of the file to be sent to the model. - filename: - type: string - description: >- - The name of the file to be sent to the model. - additionalProperties: false - required: - - type - title: OpenAIResponseInputMessageContentFile - description: >- - File content for input messages in OpenAI response format. - OpenAIResponseInputMessageContentImage: - type: object - properties: - detail: - oneOf: - - type: string - const: low - - type: string - const: high - - type: string - const: auto - default: auto - description: >- - Level of detail for image processing, can be "low", "high", or "auto" - type: - type: string - const: input_image - default: input_image - description: >- - Content type identifier, always "input_image" - file_id: - type: string - description: >- - (Optional) The ID of the file to be sent to the model. - image_url: - type: string - description: (Optional) URL of the image content - additionalProperties: false - required: - - detail - - type - title: OpenAIResponseInputMessageContentImage - description: >- - Image content for input messages in OpenAI response format. - OpenAIResponseInputMessageContentText: - type: object - properties: - text: - type: string - description: The text content of the input message - type: - type: string - const: input_text - default: input_text - description: >- - Content type identifier, always "input_text" - additionalProperties: false - required: - - text - - type - title: OpenAIResponseInputMessageContentText - description: >- - Text content for input messages in OpenAI response format. - OpenAIResponseMCPApprovalRequest: - type: object - properties: - arguments: - type: string - id: - type: string - name: - type: string - server_label: - type: string - type: - type: string - const: mcp_approval_request - default: mcp_approval_request - additionalProperties: false - required: - - arguments - - id - - name - - server_label - - type - title: OpenAIResponseMCPApprovalRequest - description: >- - A request for human approval of a tool invocation. - OpenAIResponseMCPApprovalResponse: - type: object - properties: - approval_request_id: - type: string - approve: - type: boolean - type: - type: string - const: mcp_approval_response - default: mcp_approval_response - id: - type: string - reason: - type: string - additionalProperties: false - required: - - approval_request_id - - approve - - type - title: OpenAIResponseMCPApprovalResponse - description: A response to an MCP approval request. - OpenAIResponseMessage: - type: object - properties: - content: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInputMessageContent' - - type: array - items: - $ref: '#/components/schemas/OpenAIResponseOutputMessageContent' - role: - oneOf: - - type: string - const: system - - type: string - const: developer - - type: string - const: user - - type: string - const: assistant - type: - type: string - const: message - default: message - id: - type: string - status: - type: string - additionalProperties: false - required: - - content - - role - - type - title: OpenAIResponseMessage - description: >- - Corresponds to the various Message types in the Responses API. They are all - under one type because the Responses API gives them all the same "type" value, - and there is no way to tell them apart in certain scenarios. - OpenAIResponseOutputMessageContent: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' - discriminator: - propertyName: type - mapping: - output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' - "OpenAIResponseOutputMessageContentOutputText": - type: object - properties: - text: - type: string - type: - type: string - const: output_text - default: output_text - annotations: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseAnnotations' - additionalProperties: false - required: - - text - - type - - annotations - title: >- - OpenAIResponseOutputMessageContentOutputText - "OpenAIResponseOutputMessageFileSearchToolCall": - type: object - properties: - id: - type: string - description: Unique identifier for this tool call - queries: - type: array - items: - type: string - description: List of search queries executed - status: - type: string - description: >- - Current status of the file search operation - type: - type: string - const: file_search_call - default: file_search_call - description: >- - Tool call type identifier, always "file_search_call" - results: - type: array - items: - type: object - properties: - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Key-value attributes associated with the file - file_id: - type: string - description: >- - Unique identifier of the file containing the result - filename: - type: string - description: Name of the file containing the result - score: - type: number - description: >- - Relevance score for this search result (between 0 and 1) - text: - type: string - description: Text content of the search result - additionalProperties: false - required: - - attributes - - file_id - - filename - - score - - text - title: >- - OpenAIResponseOutputMessageFileSearchToolCallResults - description: >- - Search results returned by the file search operation. - description: >- - (Optional) Search results returned by the file search operation - additionalProperties: false - required: - - id - - queries - - status - - type - title: >- - OpenAIResponseOutputMessageFileSearchToolCall - description: >- - File search tool call output message for OpenAI responses. - "OpenAIResponseOutputMessageFunctionToolCall": - type: object - properties: - call_id: - type: string - description: Unique identifier for the function call - name: - type: string - description: Name of the function being called - arguments: - type: string - description: >- - JSON string containing the function arguments - type: - type: string - const: function_call - default: function_call - description: >- - Tool call type identifier, always "function_call" - id: - type: string - description: >- - (Optional) Additional identifier for the tool call - status: - type: string - description: >- - (Optional) Current status of the function call execution - additionalProperties: false - required: - - call_id - - name - - arguments - - type - title: >- - OpenAIResponseOutputMessageFunctionToolCall - description: >- - Function tool call output message for OpenAI responses. - OpenAIResponseOutputMessageMCPCall: - type: object - properties: - id: - type: string - description: Unique identifier for this MCP call - type: - type: string - const: mcp_call - default: mcp_call - description: >- - Tool call type identifier, always "mcp_call" - arguments: - type: string - description: >- - JSON string containing the MCP call arguments - name: - type: string - description: Name of the MCP method being called - server_label: - type: string - description: >- - Label identifying the MCP server handling the call - error: - type: string - description: >- - (Optional) Error message if the MCP call failed - output: - type: string - description: >- - (Optional) Output result from the successful MCP call - additionalProperties: false - required: - - id - - type - - arguments - - name - - server_label - title: OpenAIResponseOutputMessageMCPCall - description: >- - Model Context Protocol (MCP) call output message for OpenAI responses. - OpenAIResponseOutputMessageMCPListTools: - type: object - properties: - id: - type: string - description: >- - Unique identifier for this MCP list tools operation - type: - type: string - const: mcp_list_tools - default: mcp_list_tools - description: >- - Tool call type identifier, always "mcp_list_tools" - server_label: - type: string - description: >- - Label identifying the MCP server providing the tools - tools: - type: array - items: - type: object - properties: - input_schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - JSON schema defining the tool's input parameters - name: - type: string - description: Name of the tool - description: - type: string - description: >- - (Optional) Description of what the tool does - additionalProperties: false - required: - - input_schema - - name - title: MCPListToolsTool - description: >- - Tool definition returned by MCP list tools operation. - description: >- - List of available tools provided by the MCP server - additionalProperties: false - required: - - id - - type - - server_label - - tools - title: OpenAIResponseOutputMessageMCPListTools - description: >- - MCP list tools output message containing available tools from an MCP server. - "OpenAIResponseOutputMessageWebSearchToolCall": - type: object - properties: - id: - type: string - description: Unique identifier for this tool call - status: - type: string - description: >- - Current status of the web search operation - type: - type: string - const: web_search_call - default: web_search_call - description: >- - Tool call type identifier, always "web_search_call" - additionalProperties: false - required: - - id - - status - - type - title: >- - OpenAIResponseOutputMessageWebSearchToolCall - description: >- - Web search tool call output message for OpenAI responses. - CreateConversationRequest: - type: object - Conversation: - description: OpenAI-compatible conversation object. - properties: - id: - description: The unique ID of the conversation. - title: Id - type: string - object: - const: conversation - default: conversation - description: >- - The object type, which is always conversation. - title: Object - type: string - created_at: - description: >- - The time at which the conversation was created, measured in seconds since - the Unix epoch. - title: Created At - type: integer - metadata: - anyOf: - - additionalProperties: - type: string - type: object - - type: 'null' - description: >- - Set of 16 key-value pairs that can be attached to an object. This can - be useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - title: Metadata - items: - anyOf: - - items: - additionalProperties: true - type: object - type: array - - type: 'null' - description: >- - Initial items to include in the conversation context. You may add up to - 20 items at a time. - title: Items - required: - - id - - created_at - title: Conversation - type: object - UpdateConversationRequest: - type: object - ConversationDeletedResource: - description: Response for deleted conversation. - properties: - id: - description: The deleted conversation identifier - title: Id - type: string - object: - default: conversation.deleted - description: Object type - title: Object - type: string - deleted: - default: true - description: Whether the object was deleted - title: Deleted - type: boolean - required: - - id - title: ConversationDeletedResource - type: object - list: - type: object - Literal: - type: object - ConversationItemList: - $defs: - MCPListToolsTool: - description: >- - Tool definition returned by MCP list tools operation. - - - :param input_schema: JSON schema defining the tool's input parameters - - :param name: Name of the tool - - :param description: (Optional) Description of what the tool does - properties: - input_schema: - additionalProperties: true - title: Input Schema - type: object - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - required: - - input_schema - - name - title: MCPListToolsTool - type: object - OpenAIResponseAnnotationCitation: - description: >- - URL citation annotation for referencing external web resources. - - - :param type: Annotation type identifier, always "url_citation" - - :param end_index: End position of the citation span in the content - - :param start_index: Start position of the citation span in the content - - :param title: Title of the referenced web resource - - :param url: URL of the referenced web resource - properties: - type: - const: url_citation - default: url_citation - title: Type - type: string - end_index: - title: End Index - type: integer - start_index: - title: Start Index - type: integer - title: - title: Title - type: string - url: - title: Url - type: string - required: - - end_index - - start_index - - title - - url - title: OpenAIResponseAnnotationCitation - type: object - "OpenAIResponseAnnotationContainerFileCitation": - properties: - type: - const: container_file_citation - default: container_file_citation - title: Type - type: string - container_id: - title: Container Id - type: string - end_index: - title: End Index - type: integer - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - start_index: - title: Start Index - type: integer - required: - - container_id - - end_index - - file_id - - filename - - start_index - title: >- - OpenAIResponseAnnotationContainerFileCitation - type: object - OpenAIResponseAnnotationFileCitation: - description: >- - File citation annotation for referencing specific files in response content. - - - :param type: Annotation type identifier, always "file_citation" - - :param file_id: Unique identifier of the referenced file - - :param filename: Name of the referenced file - - :param index: Position index of the citation within the content - properties: - type: - const: file_citation - default: file_citation - title: Type - type: string - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - index: - title: Index - type: integer - required: - - file_id - - filename - - index - title: OpenAIResponseAnnotationFileCitation - type: object - OpenAIResponseAnnotationFilePath: - properties: - type: - const: file_path - default: file_path - title: Type - type: string - file_id: - title: File Id - type: string - index: - title: Index - type: integer - required: - - file_id - - index - title: OpenAIResponseAnnotationFilePath - type: object - OpenAIResponseContentPartRefusal: - description: >- - Refusal content within a streamed response part. - - - :param type: Content part type identifier, always "refusal" - - :param refusal: Refusal text supplied by the model - properties: - type: - const: refusal - default: refusal - title: Type - type: string - refusal: - title: Refusal - type: string - required: - - refusal - title: OpenAIResponseContentPartRefusal - type: object - "OpenAIResponseInputFunctionToolCallOutput": - description: >- - This represents the output of a function call that gets passed back to - the model. - properties: - call_id: - title: Call Id - type: string - output: - title: Output - type: string - type: - const: function_call_output - default: function_call_output - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - output - title: >- - OpenAIResponseInputFunctionToolCallOutput - type: object - OpenAIResponseInputMessageContentImage: - description: >- - Image content for input messages in OpenAI response format. - - - :param detail: Level of detail for image processing, can be "low", "high", - or "auto" - - :param type: Content type identifier, always "input_image" - - :param image_url: (Optional) URL of the image content - properties: - detail: - anyOf: - - const: low - type: string - - const: high - type: string - - const: auto - type: string - default: auto - title: Detail - type: - const: input_image - default: input_image - title: Type - type: string - image_url: - anyOf: - - type: string - - type: 'null' - title: Image Url - title: OpenAIResponseInputMessageContentImage - type: object - OpenAIResponseInputMessageContentText: - description: >- - Text content for input messages in OpenAI response format. - - - :param text: The text content of the input message - - :param type: Content type identifier, always "input_text" - properties: - text: - title: Text - type: string - type: - const: input_text - default: input_text - title: Type - type: string - required: - - text - title: OpenAIResponseInputMessageContentText - type: object - OpenAIResponseMCPApprovalRequest: - description: >- - A request for human approval of a tool invocation. - properties: - arguments: - title: Arguments - type: string - id: - title: Id - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - type: - const: mcp_approval_request - default: mcp_approval_request - title: Type - type: string - required: - - arguments - - id - - name - - server_label - title: OpenAIResponseMCPApprovalRequest - type: object - OpenAIResponseMCPApprovalResponse: - description: A response to an MCP approval request. - properties: - approval_request_id: - title: Approval Request Id - type: string - approve: - title: Approve - type: boolean - type: - const: mcp_approval_response - default: mcp_approval_response - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - reason: - anyOf: - - type: string - - type: 'null' - title: Reason - required: - - approval_request_id - - approve - title: OpenAIResponseMCPApprovalResponse - type: object - OpenAIResponseMessage: - description: >- - Corresponds to the various Message types in the Responses API. - - They are all under one type because the Responses API gives them all - - the same "type" value, and there is no way to tell them apart in certain - - scenarios. - properties: - content: - anyOf: - - type: string - - items: - discriminator: - mapping: - input_image: >- - #/$defs/OpenAIResponseInputMessageContentImage - input_text: >- - #/$defs/OpenAIResponseInputMessageContentText - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentText - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentImage - type: array - - items: - discriminator: - mapping: - output_text: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - refusal: '#/$defs/OpenAIResponseContentPartRefusal' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - - $ref: '#/$defs/OpenAIResponseContentPartRefusal' - type: array - title: Content - role: - anyOf: - - const: system - type: string - - const: developer - type: string - - const: user - type: string - - const: assistant - type: string - title: Role - type: - const: message - default: message - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - content - - role - title: OpenAIResponseMessage - type: object - "OpenAIResponseOutputMessageContentOutputText": - properties: - text: - title: Text - type: string - type: - const: output_text - default: output_text - title: Type - type: string - annotations: - items: - discriminator: - mapping: - container_file_citation: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - file_citation: >- - #/$defs/OpenAIResponseAnnotationFileCitation - file_path: '#/$defs/OpenAIResponseAnnotationFilePath' - url_citation: '#/$defs/OpenAIResponseAnnotationCitation' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseAnnotationFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationCitation' - - $ref: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' - title: Annotations - type: array - required: - - text - title: >- - OpenAIResponseOutputMessageContentOutputText - type: object - "OpenAIResponseOutputMessageFileSearchToolCall": - description: >- - File search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param queries: List of search queries executed - - :param status: Current status of the file search operation - - :param type: Tool call type identifier, always "file_search_call" - - :param results: (Optional) Search results returned by the file search - operation - properties: - id: - title: Id - type: string - queries: - items: - type: string - title: Queries - type: array - status: - title: Status - type: string - type: - const: file_search_call - default: file_search_call - title: Type - type: string - results: - anyOf: - - items: - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults - type: array - - type: 'null' - title: Results - required: - - id - - queries - - status - title: >- - OpenAIResponseOutputMessageFileSearchToolCall - type: object - "OpenAIResponseOutputMessageFileSearchToolCallResults": - description: >- - Search results returned by the file search operation. - - - :param attributes: (Optional) Key-value attributes associated with the - file - - :param file_id: Unique identifier of the file containing the result - - :param filename: Name of the file containing the result - - :param score: Relevance score for this search result (between 0 and 1) - - :param text: Text content of the search result - properties: - attributes: - additionalProperties: true - title: Attributes - type: object - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - score: - title: Score - type: number - text: - title: Text - type: string - required: - - attributes - - file_id - - filename - - score - - text - title: >- - OpenAIResponseOutputMessageFileSearchToolCallResults - type: object - "OpenAIResponseOutputMessageFunctionToolCall": - description: >- - Function tool call output message for OpenAI responses. - - - :param call_id: Unique identifier for the function call - - :param name: Name of the function being called - - :param arguments: JSON string containing the function arguments - - :param type: Tool call type identifier, always "function_call" - - :param id: (Optional) Additional identifier for the tool call - - :param status: (Optional) Current status of the function call execution - properties: - call_id: - title: Call Id - type: string - name: - title: Name - type: string - arguments: - title: Arguments - type: string - type: - const: function_call - default: function_call - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - name - - arguments - title: >- - OpenAIResponseOutputMessageFunctionToolCall - type: object - OpenAIResponseOutputMessageMCPCall: - description: >- - Model Context Protocol (MCP) call output message for OpenAI responses. - - - :param id: Unique identifier for this MCP call - - :param type: Tool call type identifier, always "mcp_call" - - :param arguments: JSON string containing the MCP call arguments - - :param name: Name of the MCP method being called - - :param server_label: Label identifying the MCP server handling the call - - :param error: (Optional) Error message if the MCP call failed - - :param output: (Optional) Output result from the successful MCP call - properties: - id: - title: Id - type: string - type: - const: mcp_call - default: mcp_call - title: Type - type: string - arguments: - title: Arguments - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - error: - anyOf: - - type: string - - type: 'null' - title: Error - output: - anyOf: - - type: string - - type: 'null' - title: Output - required: - - id - - arguments - - name - - server_label - title: OpenAIResponseOutputMessageMCPCall - type: object - OpenAIResponseOutputMessageMCPListTools: - description: >- - MCP list tools output message containing available tools from an MCP server. - - - :param id: Unique identifier for this MCP list tools operation - - :param type: Tool call type identifier, always "mcp_list_tools" - - :param server_label: Label identifying the MCP server providing the tools - - :param tools: List of available tools provided by the MCP server - properties: - id: - title: Id - type: string - type: - const: mcp_list_tools - default: mcp_list_tools - title: Type - type: string - server_label: - title: Server Label - type: string - tools: - items: - $ref: '#/$defs/MCPListToolsTool' - title: Tools - type: array - required: - - id - - server_label - - tools - title: OpenAIResponseOutputMessageMCPListTools - type: object - "OpenAIResponseOutputMessageWebSearchToolCall": - description: >- - Web search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param status: Current status of the web search operation - - :param type: Tool call type identifier, always "web_search_call" - properties: - id: - title: Id - type: string - status: - title: Status - type: string - type: - const: web_search_call - default: web_search_call - title: Type - type: string - required: - - id - - status - title: >- - OpenAIResponseOutputMessageWebSearchToolCall - type: object - description: >- - List of conversation items with pagination. - properties: - object: - default: list - description: Object type - title: Object - type: string - data: - description: List of conversation items - items: - discriminator: - mapping: - file_search_call: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - function_call: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - function_call_output: >- - #/$defs/OpenAIResponseInputFunctionToolCallOutput - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_approval_response: >- - #/$defs/OpenAIResponseMCPApprovalResponse - mcp_call: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - mcp_list_tools: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - message: '#/$defs/OpenAIResponseMessage' - web_search_call: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseMessage' - - $ref: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - - $ref: >- - #/$defs/OpenAIResponseInputFunctionToolCallOutput - - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' - - $ref: >- - #/$defs/OpenAIResponseMCPApprovalResponse - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - title: Data - type: array - first_id: - anyOf: - - type: string - - type: 'null' - description: The ID of the first item in the list - title: First Id - last_id: - anyOf: - - type: string - - type: 'null' - description: The ID of the last item in the list - title: Last Id - has_more: - default: false - description: Whether there are more items available - title: Has More - type: boolean - required: - - data - title: ConversationItemList - type: object - AddItemsRequest: - type: object - ConversationItemDeletedResource: - description: Response for deleted conversation item. - properties: - id: - description: The deleted item identifier - title: Id - type: string - object: - default: conversation.item.deleted - description: Object type - title: Object - type: string - deleted: - default: true - description: Whether the object was deleted - title: Deleted - type: boolean - required: - - id - title: ConversationItemDeletedResource - type: object - OpenAIEmbeddingsResponse: - $defs: - OpenAIEmbeddingData: - description: >- - A single embedding data object from an OpenAI-compatible embeddings response. - - - :param object: The object type, which will be "embedding" - - :param embedding: The embedding vector as a list of floats (when encoding_format="float") - or as a base64-encoded string (when encoding_format="base64") - - :param index: The index of the embedding in the input list - properties: - object: - const: embedding - default: embedding - title: Object - type: string - embedding: - anyOf: - - items: - type: number - type: array - - type: string - title: Embedding - index: - title: Index - type: integer - required: - - embedding - - index - title: OpenAIEmbeddingData - type: object - OpenAIEmbeddingUsage: - description: >- - Usage information for an OpenAI-compatible embeddings response. - - - :param prompt_tokens: The number of tokens in the input - - :param total_tokens: The total number of tokens used - properties: - prompt_tokens: - title: Prompt Tokens - type: integer - total_tokens: - title: Total Tokens - type: integer - required: - - prompt_tokens - - total_tokens - title: OpenAIEmbeddingUsage - type: object - description: >- - Response from an OpenAI-compatible embeddings request. - - - :param object: The object type, which will be "list" - - :param data: List of embedding data objects - - :param model: The model that was used to generate the embeddings - - :param usage: Usage information - properties: - object: - const: list - default: list - title: Object - type: string - data: - items: - $ref: '#/$defs/OpenAIEmbeddingData' - title: Data - type: array - model: - title: Model - type: string - usage: - $ref: '#/$defs/OpenAIEmbeddingUsage' - required: - - data - - model - - usage - title: OpenAIEmbeddingsResponse - type: object - OpenAIFilePurpose: - type: object - ListOpenAIFileResponse: - $defs: - OpenAIFileObject: - description: >- - OpenAI File object as defined in the OpenAI Files API. - - - :param object: The object type, which is always "file" - - :param id: The file identifier, which can be referenced in the API endpoints - - :param bytes: The size of the file, in bytes - - :param created_at: The Unix timestamp (in seconds) for when the file was - created - - :param expires_at: The Unix timestamp (in seconds) for when the file expires - - :param filename: The name of the file - - :param purpose: The intended purpose of the file - properties: - object: - const: file - default: file - title: Object - type: string - id: - title: Id - type: string - bytes: - title: Bytes - type: integer - created_at: - title: Created At - type: integer - expires_at: - title: Expires At - type: integer - filename: - title: Filename - type: string - purpose: - $ref: '#/$defs/OpenAIFilePurpose' - required: - - id - - bytes - - created_at - - expires_at - - filename - - purpose - title: OpenAIFileObject - type: object - OpenAIFilePurpose: - description: >- - Valid purpose values for OpenAI Files API. - enum: - - assistants - - batch - title: OpenAIFilePurpose - type: string - description: >- - Response for listing files in OpenAI Files API. - - - :param data: List of file objects - - :param has_more: Whether there are more files available beyond this page - - :param first_id: ID of the first file in the list for pagination - - :param last_id: ID of the last file in the list for pagination - - :param object: The object type, which is always "list" - properties: - data: - items: - $ref: '#/$defs/OpenAIFileObject' - title: Data - type: array - has_more: - title: Has More - type: boolean - first_id: - title: First Id - type: string - last_id: - title: Last Id - type: string - object: - const: list - default: list - title: Object - type: string - required: - - data - - has_more - - first_id - - last_id - title: ListOpenAIFileResponse - type: object - ExpiresAfter: - description: >- - Control expiration of uploaded files. - - - Params: - - anchor, must be "created_at" - - seconds, must be int between 3600 and 2592000 (1 hour to 30 days) - properties: - anchor: - const: created_at - title: Anchor - type: string - seconds: - maximum: 2592000 - minimum: 3600 - title: Seconds - type: integer - required: - - anchor - - seconds - title: ExpiresAfter - type: object - OpenAIFileObject: - $defs: - OpenAIFilePurpose: - description: >- - Valid purpose values for OpenAI Files API. - enum: - - assistants - - batch - title: OpenAIFilePurpose - type: string - description: >- - OpenAI File object as defined in the OpenAI Files API. - - - :param object: The object type, which is always "file" - - :param id: The file identifier, which can be referenced in the API endpoints - - :param bytes: The size of the file, in bytes - - :param created_at: The Unix timestamp (in seconds) for when the file was created - - :param expires_at: The Unix timestamp (in seconds) for when the file expires - - :param filename: The name of the file - - :param purpose: The intended purpose of the file - properties: - object: - const: file - default: file - title: Object - type: string - id: - title: Id - type: string - bytes: - title: Bytes - type: integer - created_at: - title: Created At - type: integer - expires_at: - title: Expires At - type: integer - filename: - title: Filename - type: string - purpose: - $ref: '#/$defs/OpenAIFilePurpose' - required: - - id - - bytes - - created_at - - expires_at - - filename - - purpose - title: OpenAIFileObject - type: object - OpenAIFileDeleteResponse: - description: >- - Response for deleting a file in OpenAI Files API. - - - :param id: The file identifier that was deleted - - :param object: The object type, which is always "file" - - :param deleted: Whether the file was successfully deleted - properties: - id: - title: Id - type: string - object: - const: file - default: file - title: Object - type: string - deleted: - title: Deleted - type: boolean - required: - - id - - deleted - title: OpenAIFileDeleteResponse - type: object - Response: - type: object - HealthInfo: - $defs: - HealthStatus: - enum: - - OK - - Error - - Not Implemented - title: HealthStatus - type: string - description: >- - Health status information for the service. - - - :param status: Current health status of the service - properties: - status: - $ref: '#/$defs/HealthStatus' - required: - - status - title: HealthInfo - type: object - ListRoutesResponse: - $defs: - RouteInfo: - description: >- - Information about an API route including its path, method, and implementing - providers. - - - :param route: The API endpoint path - - :param method: HTTP method for the route - - :param provider_types: List of provider types that implement this route - properties: - route: - title: Route - type: string - method: - title: Method - type: string - provider_types: - items: - type: string - title: Provider Types - type: array - required: - - route - - method - - provider_types - title: RouteInfo - type: object - description: >- - Response containing a list of all available API routes. - - - :param data: List of available route information objects - properties: - data: - items: - $ref: '#/$defs/RouteInfo' - title: Data - type: array - required: - - data - title: ListRoutesResponse - description: >- - Response containing a list of all available API routes. - OpenAIModel: - type: object - properties: - id: - type: string - object: - type: string - const: model - default: model - created: - type: integer - owned_by: - type: string - custom_metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - additionalProperties: false - required: - - id - - object - - created - - owned_by - title: OpenAIModel - description: A model from OpenAI. - OpenAIListModelsResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAIModel' - additionalProperties: false - required: - - data - title: OpenAIListModelsResponse - ModelType: - type: string - enum: - - llm - - embedding - - rerank - title: ModelType - description: >- - Enumeration of supported model types in Llama Stack. - RegisterModelRequest: - type: object - properties: - model_id: - type: string - description: The identifier of the model to register. - provider_model_id: - type: string - description: >- - The identifier of the model in the provider. - provider_id: - type: string - description: The identifier of the provider. - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Any additional metadata for this model. - model_type: - $ref: '#/components/schemas/ModelType' - description: The type of model to register. - additionalProperties: false - required: - - model_id - title: RegisterModelRequest - Model: - type: object - properties: - identifier: - type: string - description: >- - Unique identifier for this resource in llama stack - provider_resource_id: - type: string - description: >- - Unique identifier for this resource in the provider - provider_id: - type: string - description: >- - ID of the provider that owns this resource - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: model - default: model - description: >- - The resource type, always 'model' for model resources - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Any additional metadata for this model - model_type: - $ref: '#/components/schemas/ModelType' - default: llm - description: >- - The type of model (LLM or embedding model) - additionalProperties: false - required: - - identifier - - provider_id - - type - - metadata - - model_type - title: Model - description: >- - A model resource representing an AI model registered in Llama Stack. - RunModerationRequest: - type: object - ModerationObject: - $defs: - ModerationObjectResults: - description: >- - A moderation object. - - :param flagged: Whether any of the below categories are flagged. - - :param categories: A list of the categories, and whether they are flagged - or not. - - :param category_applied_input_types: A list of the categories along with - the input type(s) that the score applies to. - - :param category_scores: A list of the categories along with their scores - as predicted by model. - properties: - flagged: - title: Flagged - type: boolean - categories: - anyOf: - - additionalProperties: - type: boolean - type: object - - type: 'null' - title: Categories - category_applied_input_types: - anyOf: - - additionalProperties: - items: - type: string - type: array - type: object - - type: 'null' - title: Category Applied Input Types - category_scores: - anyOf: - - additionalProperties: - type: number - type: object - - type: 'null' - title: Category Scores - user_message: - anyOf: - - type: string - - type: 'null' - title: User Message - metadata: - additionalProperties: true - title: Metadata - type: object - required: - - flagged - title: ModerationObjectResults - type: object - description: >- - A moderation object. - - :param id: The unique identifier for the moderation request. - - :param model: The model used to generate the moderation results. - - :param results: A list of moderation objects - properties: - id: - title: Id - type: string - model: - title: Model - type: string - results: - items: - $ref: '#/$defs/ModerationObjectResults' - title: Results - type: array - required: - - id - - model - - results - title: ModerationObject - type: object - ListPromptsResponse: - $defs: - Prompt: - description: >- - A prompt resource representing a stored OpenAI Compatible prompt template - in Llama Stack. - - - :param prompt: The system prompt text with variable placeholders. Variables - are only supported when using the Responses API. - - :param version: Version (integer starting at 1, incremented on save) - - :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' - - :param variables: List of prompt variable names that can be used in the - prompt template - - :param is_default: Boolean indicating whether this version is the default - version for this prompt - properties: - prompt: - anyOf: - - type: string - - type: 'null' - description: >- - The system prompt with variable placeholders - title: Prompt - version: - description: >- - Version (integer starting at 1, incremented on save) - minimum: 1 - title: Version - type: integer - prompt_id: - description: >- - Unique identifier in format 'pmpt_<48-digit-hash>' - title: Prompt Id - type: string - variables: - description: >- - List of variable names that can be used in the prompt template - items: - type: string - title: Variables - type: array - is_default: - default: false - description: >- - Boolean indicating whether this version is the default version - title: Is Default - type: boolean - required: - - version - - prompt_id - title: Prompt - type: object - description: Response model to list prompts. - properties: - data: - items: - $ref: '#/$defs/Prompt' - title: Data - type: array - required: - - data - title: ListPromptsResponse - type: object - CreatePromptRequest: - type: object - Prompt: - description: >- - A prompt resource representing a stored OpenAI Compatible prompt template - in Llama Stack. - - - :param prompt: The system prompt text with variable placeholders. Variables - are only supported when using the Responses API. - - :param version: Version (integer starting at 1, incremented on save) - - :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' - - :param variables: List of prompt variable names that can be used in the prompt - template - - :param is_default: Boolean indicating whether this version is the default - version for this prompt - properties: - prompt: - anyOf: - - type: string - - type: 'null' - description: >- - The system prompt with variable placeholders - title: Prompt - version: - description: >- - Version (integer starting at 1, incremented on save) - minimum: 1 - title: Version - type: integer - prompt_id: - description: >- - Unique identifier in format 'pmpt_<48-digit-hash>' - title: Prompt Id - type: string - variables: - description: >- - List of variable names that can be used in the prompt template - items: - type: string - title: Variables - type: array - is_default: - default: false - description: >- - Boolean indicating whether this version is the default version - title: Is Default - type: boolean - required: - - version - - prompt_id - title: Prompt - type: object - UpdatePromptRequest: - type: object - SetDefaultVersionRequest: - type: object - ListProvidersResponse: - $defs: - ProviderInfo: - description: >- - Information about a registered provider including its configuration and - health status. - - - :param api: The API name this provider implements - - :param provider_id: Unique identifier for the provider - - :param provider_type: The type of provider implementation - - :param config: Configuration parameters for the provider - - :param health: Current health status of the provider - properties: - api: - title: Api - type: string - provider_id: - title: Provider Id - type: string - provider_type: - title: Provider Type - type: string - config: - additionalProperties: true - title: Config - type: object - health: - additionalProperties: true - title: Health - type: object - required: - - api - - provider_id - - provider_type - - config - - health - title: ProviderInfo - type: object - description: >- - Response containing a list of all available providers. - - - :param data: List of provider information objects - properties: - data: - items: - $ref: '#/$defs/ProviderInfo' - title: Data - type: array - required: - - data - title: ListProvidersResponse - type: object - ProviderInfo: - description: >- - Information about a registered provider including its configuration and health - status. - - - :param api: The API name this provider implements - - :param provider_id: Unique identifier for the provider - - :param provider_type: The type of provider implementation - - :param config: Configuration parameters for the provider - - :param health: Current health status of the provider - properties: - api: - title: Api - type: string - provider_id: - title: Provider Id - type: string - provider_type: - title: Provider Type - type: string - config: - additionalProperties: true - title: Config - type: object - health: - additionalProperties: true - title: Health - type: object - required: - - api - - provider_id - - provider_type - - config - - health - title: ProviderInfo - type: object - ListOpenAIResponseObject: - $defs: - AllowedToolsFilter: - description: >- - Filter configuration for restricting which MCP tools can be used. - - - :param tool_names: (Optional) List of specific tool names that are allowed - properties: - tool_names: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Tool Names - title: AllowedToolsFilter - type: object - MCPListToolsTool: - description: >- - Tool definition returned by MCP list tools operation. - - - :param input_schema: JSON schema defining the tool's input parameters - - :param name: Name of the tool - - :param description: (Optional) Description of what the tool does - properties: - input_schema: - additionalProperties: true - title: Input Schema - type: object - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - required: - - input_schema - - name - title: MCPListToolsTool - type: object - OpenAIResponseAnnotationCitation: - description: >- - URL citation annotation for referencing external web resources. - - - :param type: Annotation type identifier, always "url_citation" - - :param end_index: End position of the citation span in the content - - :param start_index: Start position of the citation span in the content - - :param title: Title of the referenced web resource - - :param url: URL of the referenced web resource - properties: - type: - const: url_citation - default: url_citation - title: Type - type: string - end_index: - title: End Index - type: integer - start_index: - title: Start Index - type: integer - title: - title: Title - type: string - url: - title: Url - type: string - required: - - end_index - - start_index - - title - - url - title: OpenAIResponseAnnotationCitation - type: object - "OpenAIResponseAnnotationContainerFileCitation": - properties: - type: - const: container_file_citation - default: container_file_citation - title: Type - type: string - container_id: - title: Container Id - type: string - end_index: - title: End Index - type: integer - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - start_index: - title: Start Index - type: integer - required: - - container_id - - end_index - - file_id - - filename - - start_index - title: >- - OpenAIResponseAnnotationContainerFileCitation - type: object - OpenAIResponseAnnotationFileCitation: - description: >- - File citation annotation for referencing specific files in response content. - - - :param type: Annotation type identifier, always "file_citation" - - :param file_id: Unique identifier of the referenced file - - :param filename: Name of the referenced file - - :param index: Position index of the citation within the content - properties: - type: - const: file_citation - default: file_citation - title: Type - type: string - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - index: - title: Index - type: integer - required: - - file_id - - filename - - index - title: OpenAIResponseAnnotationFileCitation - type: object - OpenAIResponseAnnotationFilePath: - properties: - type: - const: file_path - default: file_path - title: Type - type: string - file_id: - title: File Id - type: string - index: - title: Index - type: integer - required: - - file_id - - index - title: OpenAIResponseAnnotationFilePath - type: object - OpenAIResponseContentPartRefusal: - description: >- - Refusal content within a streamed response part. - - - :param type: Content part type identifier, always "refusal" - - :param refusal: Refusal text supplied by the model - properties: - type: - const: refusal - default: refusal - title: Type - type: string - refusal: - title: Refusal - type: string - required: - - refusal - title: OpenAIResponseContentPartRefusal - type: object - OpenAIResponseError: - description: >- - Error details for failed OpenAI response requests. - - - :param code: Error code identifying the type of failure - - :param message: Human-readable error message describing the failure - properties: - code: - title: Code - type: string - message: - title: Message - type: string - required: - - code - - message - title: OpenAIResponseError - type: object - "OpenAIResponseInputFunctionToolCallOutput": - description: >- - This represents the output of a function call that gets passed back to - the model. - properties: - call_id: - title: Call Id - type: string - output: - title: Output - type: string - type: - const: function_call_output - default: function_call_output - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - output - title: >- - OpenAIResponseInputFunctionToolCallOutput - type: object - OpenAIResponseInputMessageContentImage: - description: >- - Image content for input messages in OpenAI response format. - - - :param detail: Level of detail for image processing, can be "low", "high", - or "auto" - - :param type: Content type identifier, always "input_image" - - :param image_url: (Optional) URL of the image content - properties: - detail: - anyOf: - - const: low - type: string - - const: high - type: string - - const: auto - type: string - default: auto - title: Detail - type: - const: input_image - default: input_image - title: Type - type: string - image_url: - anyOf: - - type: string - - type: 'null' - title: Image Url - title: OpenAIResponseInputMessageContentImage - type: object - OpenAIResponseInputMessageContentText: - description: >- - Text content for input messages in OpenAI response format. - - - :param text: The text content of the input message - - :param type: Content type identifier, always "input_text" - properties: - text: - title: Text - type: string - type: - const: input_text - default: input_text - title: Type - type: string - required: - - text - title: OpenAIResponseInputMessageContentText - type: object - OpenAIResponseInputToolFileSearch: - description: >- - File search tool configuration for OpenAI response inputs. - - - :param type: Tool type identifier, always "file_search" - - :param vector_store_ids: List of vector store identifiers to search within - - :param filters: (Optional) Additional filters to apply to the search - - :param max_num_results: (Optional) Maximum number of search results to - return (1-50) - - :param ranking_options: (Optional) Options for ranking and scoring search - results - properties: - type: - const: file_search - default: file_search - title: Type - type: string - vector_store_ids: - items: - type: string - title: Vector Store Ids - type: array - filters: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Filters - max_num_results: - anyOf: - - maximum: 50 - minimum: 1 - type: integer - - type: 'null' - default: 10 - title: Max Num Results - ranking_options: - anyOf: - - $ref: '#/$defs/SearchRankingOptions' - - type: 'null' - required: - - vector_store_ids - title: OpenAIResponseInputToolFileSearch - type: object - OpenAIResponseInputToolFunction: - description: >- - Function tool configuration for OpenAI response inputs. - - - :param type: Tool type identifier, always "function" - - :param name: Name of the function that can be called - - :param description: (Optional) Description of what the function does - - :param parameters: (Optional) JSON schema defining the function's parameters - - :param strict: (Optional) Whether to enforce strict parameter validation - properties: - type: - const: function - default: function - title: Type - type: string - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - parameters: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Parameters - strict: - anyOf: - - type: boolean - - type: 'null' - title: Strict - required: - - name - - parameters - title: OpenAIResponseInputToolFunction - type: object - OpenAIResponseInputToolWebSearch: - description: >- - Web search tool configuration for OpenAI response inputs. - - - :param type: Web search tool type variant to use - - :param search_context_size: (Optional) Size of search context, must be - "low", "medium", or "high" - properties: - type: - anyOf: - - const: web_search - type: string - - const: web_search_preview - type: string - - const: web_search_preview_2025_03_11 - type: string - default: web_search - title: Type - search_context_size: - anyOf: - - pattern: ^low|medium|high$ - type: string - - type: 'null' - default: medium - title: Search Context Size - title: OpenAIResponseInputToolWebSearch - type: object - OpenAIResponseMCPApprovalRequest: - description: >- - A request for human approval of a tool invocation. - properties: - arguments: - title: Arguments - type: string - id: - title: Id - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - type: - const: mcp_approval_request - default: mcp_approval_request - title: Type - type: string - required: - - arguments - - id - - name - - server_label - title: OpenAIResponseMCPApprovalRequest - type: object - OpenAIResponseMCPApprovalResponse: - description: A response to an MCP approval request. - properties: - approval_request_id: - title: Approval Request Id - type: string - approve: - title: Approve - type: boolean - type: - const: mcp_approval_response - default: mcp_approval_response - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - reason: - anyOf: - - type: string - - type: 'null' - title: Reason - required: - - approval_request_id - - approve - title: OpenAIResponseMCPApprovalResponse - type: object - OpenAIResponseMessage: - description: >- - Corresponds to the various Message types in the Responses API. - - They are all under one type because the Responses API gives them all - - the same "type" value, and there is no way to tell them apart in certain - - scenarios. - properties: - content: - anyOf: - - type: string - - items: - discriminator: - mapping: - input_image: >- - #/$defs/OpenAIResponseInputMessageContentImage - input_text: >- - #/$defs/OpenAIResponseInputMessageContentText - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentText - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentImage - type: array - - items: - discriminator: - mapping: - output_text: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - refusal: '#/$defs/OpenAIResponseContentPartRefusal' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - - $ref: '#/$defs/OpenAIResponseContentPartRefusal' - type: array - title: Content - role: - anyOf: - - const: system - type: string - - const: developer - type: string - - const: user - type: string - - const: assistant - type: string - title: Role - type: - const: message - default: message - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - content - - role - title: OpenAIResponseMessage - type: object - OpenAIResponseObjectWithInput: - description: >- - OpenAI response object extended with input context information. - - - :param input: List of input items that led to this response - properties: - created_at: - title: Created At - type: integer - error: - anyOf: - - $ref: '#/$defs/OpenAIResponseError' - - type: 'null' - id: - title: Id - type: string - model: - title: Model - type: string - object: - const: response - default: response - title: Object - type: string - output: - items: - discriminator: - mapping: - file_search_call: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - function_call: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - mcp_list_tools: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - message: '#/$defs/OpenAIResponseMessage' - web_search_call: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseMessage' - - $ref: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' - title: Output - type: array - parallel_tool_calls: - default: false - title: Parallel Tool Calls - type: boolean - previous_response_id: - anyOf: - - type: string - - type: 'null' - title: Previous Response Id - status: - title: Status - type: string - temperature: - anyOf: - - type: number - - type: 'null' - title: Temperature - text: - $ref: '#/$defs/OpenAIResponseText' - default: - format: - type: text - top_p: - anyOf: - - type: number - - type: 'null' - title: Top P - tools: - anyOf: - - items: - discriminator: - mapping: - file_search: >- - #/$defs/OpenAIResponseInputToolFileSearch - function: '#/$defs/OpenAIResponseInputToolFunction' - mcp: '#/$defs/OpenAIResponseToolMCP' - web_search: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseInputToolWebSearch' - - $ref: >- - #/$defs/OpenAIResponseInputToolFileSearch - - $ref: '#/$defs/OpenAIResponseInputToolFunction' - - $ref: '#/$defs/OpenAIResponseToolMCP' - type: array - - type: 'null' - title: Tools - truncation: - anyOf: - - type: string - - type: 'null' - title: Truncation - usage: - anyOf: - - $ref: '#/$defs/OpenAIResponseUsage' - - type: 'null' - instructions: - anyOf: - - type: string - - type: 'null' - title: Instructions - input: - items: - anyOf: - - discriminator: - mapping: - file_search_call: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - function_call: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - mcp_list_tools: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - message: '#/$defs/OpenAIResponseMessage' - web_search_call: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseMessage' - - $ref: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' - - $ref: >- - #/$defs/OpenAIResponseInputFunctionToolCallOutput - - $ref: >- - #/$defs/OpenAIResponseMCPApprovalResponse - - $ref: '#/$defs/OpenAIResponseMessage' - title: Input - type: array - required: - - created_at - - id - - model - - output - - status - - input - title: OpenAIResponseObjectWithInput - type: object - "OpenAIResponseOutputMessageContentOutputText": - properties: - text: - title: Text - type: string - type: - const: output_text - default: output_text - title: Type - type: string - annotations: - items: - discriminator: - mapping: - container_file_citation: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - file_citation: >- - #/$defs/OpenAIResponseAnnotationFileCitation - file_path: '#/$defs/OpenAIResponseAnnotationFilePath' - url_citation: '#/$defs/OpenAIResponseAnnotationCitation' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseAnnotationFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationCitation' - - $ref: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' - title: Annotations - type: array - required: - - text - title: >- - OpenAIResponseOutputMessageContentOutputText - type: object - "OpenAIResponseOutputMessageFileSearchToolCall": - description: >- - File search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param queries: List of search queries executed - - :param status: Current status of the file search operation - - :param type: Tool call type identifier, always "file_search_call" - - :param results: (Optional) Search results returned by the file search - operation - properties: - id: - title: Id - type: string - queries: - items: - type: string - title: Queries - type: array - status: - title: Status - type: string - type: - const: file_search_call - default: file_search_call - title: Type - type: string - results: - anyOf: - - items: - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults - type: array - - type: 'null' - title: Results - required: - - id - - queries - - status - title: >- - OpenAIResponseOutputMessageFileSearchToolCall - type: object - "OpenAIResponseOutputMessageFileSearchToolCallResults": - description: >- - Search results returned by the file search operation. - - - :param attributes: (Optional) Key-value attributes associated with the - file - - :param file_id: Unique identifier of the file containing the result - - :param filename: Name of the file containing the result - - :param score: Relevance score for this search result (between 0 and 1) - - :param text: Text content of the search result - properties: - attributes: - additionalProperties: true - title: Attributes - type: object - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - score: - title: Score - type: number - text: - title: Text - type: string - required: - - attributes - - file_id - - filename - - score - - text - title: >- - OpenAIResponseOutputMessageFileSearchToolCallResults - type: object - "OpenAIResponseOutputMessageFunctionToolCall": - description: >- - Function tool call output message for OpenAI responses. - - - :param call_id: Unique identifier for the function call - - :param name: Name of the function being called - - :param arguments: JSON string containing the function arguments - - :param type: Tool call type identifier, always "function_call" - - :param id: (Optional) Additional identifier for the tool call - - :param status: (Optional) Current status of the function call execution - properties: - call_id: - title: Call Id - type: string - name: - title: Name - type: string - arguments: - title: Arguments - type: string - type: - const: function_call - default: function_call - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - name - - arguments - title: >- - OpenAIResponseOutputMessageFunctionToolCall - type: object - OpenAIResponseOutputMessageMCPCall: - description: >- - Model Context Protocol (MCP) call output message for OpenAI responses. - - - :param id: Unique identifier for this MCP call - - :param type: Tool call type identifier, always "mcp_call" - - :param arguments: JSON string containing the MCP call arguments - - :param name: Name of the MCP method being called - - :param server_label: Label identifying the MCP server handling the call - - :param error: (Optional) Error message if the MCP call failed - - :param output: (Optional) Output result from the successful MCP call - properties: - id: - title: Id - type: string - type: - const: mcp_call - default: mcp_call - title: Type - type: string - arguments: - title: Arguments - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - error: - anyOf: - - type: string - - type: 'null' - title: Error - output: - anyOf: - - type: string - - type: 'null' - title: Output - required: - - id - - arguments - - name - - server_label - title: OpenAIResponseOutputMessageMCPCall - type: object - OpenAIResponseOutputMessageMCPListTools: - description: >- - MCP list tools output message containing available tools from an MCP server. - - - :param id: Unique identifier for this MCP list tools operation - - :param type: Tool call type identifier, always "mcp_list_tools" - - :param server_label: Label identifying the MCP server providing the tools - - :param tools: List of available tools provided by the MCP server - properties: - id: - title: Id - type: string - type: - const: mcp_list_tools - default: mcp_list_tools - title: Type - type: string - server_label: - title: Server Label - type: string - tools: - items: - $ref: '#/$defs/MCPListToolsTool' - title: Tools - type: array - required: - - id - - server_label - - tools - title: OpenAIResponseOutputMessageMCPListTools - type: object - "OpenAIResponseOutputMessageWebSearchToolCall": - description: >- - Web search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param status: Current status of the web search operation - - :param type: Tool call type identifier, always "web_search_call" - properties: - id: - title: Id - type: string - status: - title: Status - type: string - type: - const: web_search_call - default: web_search_call - title: Type - type: string - required: - - id - - status - title: >- - OpenAIResponseOutputMessageWebSearchToolCall - type: object - OpenAIResponseText: - description: >- - Text response configuration for OpenAI responses. - - - :param format: (Optional) Text format configuration specifying output - format requirements - properties: - format: - anyOf: - - $ref: '#/$defs/OpenAIResponseTextFormat' - - type: 'null' - title: OpenAIResponseText - type: object - OpenAIResponseTextFormat: - description: >- - Configuration for Responses API text format. - - - :param type: Must be "text", "json_schema", or "json_object" to identify - the format type - - :param name: The name of the response format. Only used for json_schema. - - :param schema: The JSON schema the response should conform to. In a Python - SDK, this is often a `pydantic` model. Only used for json_schema. - - :param description: (Optional) A description of the response format. Only - used for json_schema. - - :param strict: (Optional) Whether to strictly enforce the JSON schema. - If true, the response must match the schema exactly. Only used for json_schema. - properties: - type: - anyOf: - - const: text - type: string - - const: json_schema - type: string - - const: json_object - type: string - title: Type - name: - anyOf: - - type: string - - type: 'null' - title: Name + description: 'Path parameter: conversation_id' + /v1/conversations/{conversation_id}/items/{item_id}: + delete: + tags: + - V1 + summary: Openai Delete Conversation Item + description: Query endpoint for proper schema generation. + operationId: openai_delete_conversation_item_v1_conversations__conversation_id__items__item_id__delete + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id + - name: item_id + in: path + required: true + schema: + type: string + title: Item Id + responses: + '200': + description: The deleted item resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationItemDeletedResource' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Retrieve + description: Query endpoint for proper schema generation. + operationId: retrieve_v1_conversations__conversation_id__items__item_id__get + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id + - name: item_id + in: path + required: true + schema: + type: string + title: Item Id + responses: + '200': + description: The conversation item. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIResponseMessage' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/embeddings: + post: + tags: + - V1 + summary: Openai Embeddings + description: Typed endpoint for proper schema generation. + operationId: openai_embeddings_v1_embeddings_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody' + required: true + responses: + '200': + description: An OpenAIEmbeddingsResponse containing the embeddings. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIEmbeddingsResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/files: + get: + tags: + - V1 + summary: Openai List Files + description: Query endpoint for proper schema generation. + operationId: openai_list_files_v1_files_get + parameters: + - name: after + in: query + required: true + schema: + type: string + title: After + - name: purpose + in: query + required: true + schema: + $ref: '#/components/schemas/OpenAIFilePurpose' + - name: limit + in: query + required: false + schema: + type: integer + default: 10000 + title: Limit + - name: order + in: query + required: false + schema: + $ref: '#/components/schemas/Order' + default: desc + responses: + '200': + description: An ListOpenAIFileResponse containing the list of files. + content: + application/json: + schema: + $ref: '#/components/schemas/ListOpenAIFileResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Openai Upload File + description: Response-only endpoint for proper schema generation. + operationId: openai_upload_file_v1_files_post + responses: + '200': + description: An OpenAIFileObject representing the uploaded file. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIFileObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/files/{file_id}: + delete: + tags: + - V1 + summary: Openai Delete File + description: Query endpoint for proper schema generation. + operationId: openai_delete_file_v1_files__file_id__delete + parameters: + - name: file_id + in: path + required: true + schema: + type: string + title: File Id + responses: + '200': + description: An OpenAIFileDeleteResponse indicating successful deletion. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIFileDeleteResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Openai Retrieve File + description: Query endpoint for proper schema generation. + operationId: openai_retrieve_file_v1_files__file_id__get + parameters: + - name: file_id + in: path + required: true + schema: + type: string + title: File Id + responses: + '200': + description: An OpenAIFileObject containing file information. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIFileObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/files/{file_id}/content: + get: + tags: + - V1 + summary: Openai Retrieve File Content + description: Generic endpoint - this would be replaced with actual implementation. + operationId: openai_retrieve_file_content_v1_files__file_id__content_get + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: file_id + in: path + required: true + schema: + type: string + description: 'Path parameter: file_id' + responses: + '200': + description: The raw file content as a binary response. + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/health: + get: + tags: + - V1 + summary: Health + description: Response-only endpoint for proper schema generation. + operationId: health_v1_health_get + responses: + '200': + description: Health information indicating if the service is operational. + content: + application/json: + schema: + $ref: '#/components/schemas/HealthInfo' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/inspect/routes: + get: + tags: + - V1 + summary: List Routes + description: Response-only endpoint for proper schema generation. + operationId: list_routes_v1_inspect_routes_get + responses: + '200': + description: Response containing information about all available routes. + content: + application/json: + schema: + $ref: '#/components/schemas/ListRoutesResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/models: + get: + tags: + - V1 + summary: List Models + description: Response-only endpoint for proper schema generation. + operationId: list_models_v1_models_get + responses: + '200': + description: A ListModelsResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/ListModelsResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + post: + tags: + - V1 + summary: Register Model + description: Typed endpoint for proper schema generation. + operationId: register_model_v1_models_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_models_Request' + required: true + responses: + '200': + description: A Model. + content: + application/json: + schema: + $ref: '#/components/schemas/Model' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/models/{model_id}: + delete: + tags: + - V1 + summary: Unregister Model + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_model_v1_models__model_id__delete + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: model_id + in: path + required: true + schema: + type: string + description: 'Path parameter: model_id' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Get Model + description: Query endpoint for proper schema generation. + operationId: get_model_v1_models__model_id__get + parameters: + - name: model_id + in: path + required: true + schema: + type: string + title: Model Id + responses: + '200': + description: A Model. + content: + application/json: + schema: + $ref: '#/components/schemas/Model' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/moderations: + post: + tags: + - V1 + summary: Run Moderation + description: Typed endpoint for proper schema generation. + operationId: run_moderation_v1_moderations_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_moderations_Request' + required: true + responses: + '200': + description: A moderation object. + content: + application/json: + schema: + $ref: '#/components/schemas/ModerationObject' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/prompts: + get: + tags: + - V1 + summary: List Prompts + description: Response-only endpoint for proper schema generation. + operationId: list_prompts_v1_prompts_get + responses: + '200': + description: A ListPromptsResponse containing all prompts. + content: + application/json: + schema: + $ref: '#/components/schemas/ListPromptsResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + post: + tags: + - V1 + summary: Create Prompt + description: Typed endpoint for proper schema generation. + operationId: create_prompt_v1_prompts_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_prompts_Request' + required: true + responses: + '200': + description: The created Prompt resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Prompt' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/prompts/{prompt_id}: + delete: + tags: + - V1 + summary: Delete Prompt + description: Generic endpoint - this would be replaced with actual implementation. + operationId: delete_prompt_v1_prompts__prompt_id__delete + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - &id001 + name: prompt_id + in: path + required: true + schema: + type: string + description: 'Path parameter: prompt_id' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Get Prompt + description: Query endpoint for proper schema generation. + operationId: get_prompt_v1_prompts__prompt_id__get + parameters: + - name: prompt_id + in: path + required: true + schema: + type: string + title: Prompt Id + - name: version + in: query + required: true + schema: + type: integer + title: Version + responses: + '200': + description: A Prompt resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Prompt' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Update Prompt + description: Typed endpoint for proper schema generation. + operationId: update_prompt_v1_prompts__prompt_id__post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/_prompts_prompt_id_Request' + responses: + '200': + description: The updated Prompt resource with incremented version. + content: + application/json: + schema: + $ref: '#/components/schemas/Prompt' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + parameters: + - *id001 + /v1/prompts/{prompt_id}/set-default-version: + post: + tags: + - V1 + summary: Set Default Version + description: Typed endpoint for proper schema generation. + operationId: set_default_version_v1_prompts__prompt_id__set_default_version_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_prompts_prompt_id_set_default_version_Request' + required: true + responses: + '200': + description: The prompt with the specified version now set as default. + content: + application/json: + schema: + $ref: '#/components/schemas/Prompt' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: prompt_id + in: path + required: true + schema: + type: string + description: 'Path parameter: prompt_id' + /v1/prompts/{prompt_id}/versions: + get: + tags: + - V1 + summary: List Prompt Versions + description: Query endpoint for proper schema generation. + operationId: list_prompt_versions_v1_prompts__prompt_id__versions_get + parameters: + - name: prompt_id + in: path + required: true + schema: + type: string + title: Prompt Id + responses: + '200': + description: A ListPromptsResponse containing all versions of the prompt. + content: + application/json: + schema: + $ref: '#/components/schemas/ListPromptsResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/providers: + get: + tags: + - V1 + summary: List Providers + description: Response-only endpoint for proper schema generation. + operationId: list_providers_v1_providers_get + responses: + '200': + description: A ListProvidersResponse containing information about all providers. + content: + application/json: + schema: + $ref: '#/components/schemas/ListProvidersResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/providers/{provider_id}: + get: + tags: + - V1 + summary: Inspect Provider + description: Query endpoint for proper schema generation. + operationId: inspect_provider_v1_providers__provider_id__get + parameters: + - name: provider_id + in: path + required: true + schema: + type: string + title: Provider Id + responses: + '200': + description: A ProviderInfo object containing the provider's details. + content: + application/json: + schema: + $ref: '#/components/schemas/ProviderInfo' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/responses: + get: + tags: + - V1 + summary: List Openai Responses + description: Query endpoint for proper schema generation. + operationId: list_openai_responses_v1_responses_get + parameters: + - name: after + in: query + required: true + schema: + type: string + title: After + - name: model + in: query + required: true + schema: + type: string + title: Model + - name: limit + in: query + required: false + schema: + type: integer + default: 50 + title: Limit + - name: order + in: query + required: false + schema: + $ref: '#/components/schemas/Order' + default: desc + responses: + '200': + description: A ListOpenAIResponseObject. + content: + application/json: + schema: + $ref: '#/components/schemas/ListOpenAIResponseObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Create Openai Response + description: Typed endpoint for proper schema generation. + operationId: create_openai_response_v1_responses_post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/_responses_Request' + responses: + '200': + description: An OpenAIResponseObject. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIResponseObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/responses/{response_id}: + delete: + tags: + - V1 + summary: Delete Openai Response + description: Query endpoint for proper schema generation. + operationId: delete_openai_response_v1_responses__response_id__delete + parameters: + - name: response_id + in: path + required: true + schema: + type: string + title: Response Id + responses: + '200': + description: An OpenAIDeleteResponseObject + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIDeleteResponseObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Get Openai Response + description: Query endpoint for proper schema generation. + operationId: get_openai_response_v1_responses__response_id__get + parameters: + - name: response_id + in: path + required: true + schema: + type: string + title: Response Id + responses: + '200': + description: An OpenAIResponseObject. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIResponseObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/responses/{response_id}/input_items: + get: + tags: + - V1 + summary: List Openai Response Input Items + description: Query endpoint for proper schema generation. + operationId: list_openai_response_input_items_v1_responses__response_id__input_items_get + parameters: + - name: response_id + in: path + required: true + schema: + type: string + title: Response Id + - name: after + in: query + required: true + schema: + type: string + title: After + - name: before + in: query + required: true + schema: + type: string + title: Before + - name: include + in: query + required: true + schema: + type: string + title: Include + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit + - name: order + in: query + required: false + schema: + $ref: '#/components/schemas/Order' + default: desc + responses: + '200': + description: An ListOpenAIResponseInputItem. + content: + application/json: + schema: + $ref: '#/components/schemas/ListOpenAIResponseInputItem' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/safety/run-shield: + post: + tags: + - V1 + summary: Run Shield + description: Typed endpoint for proper schema generation. + operationId: run_shield_v1_safety_run_shield_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_safety_run_shield_Request' + required: true + responses: + '200': + description: A RunShieldResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/RunShieldResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/scoring-functions: + get: + tags: + - V1 + summary: List Scoring Functions + description: Response-only endpoint for proper schema generation. + operationId: list_scoring_functions_v1_scoring_functions_get + responses: + '200': + description: A ListScoringFunctionsResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/ListScoringFunctionsResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Register Scoring Function + description: Generic endpoint - this would be replaced with actual implementation. + operationId: register_scoring_function_v1_scoring_functions_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/scoring-functions/{scoring_fn_id}: + delete: + tags: + - V1 + summary: Unregister Scoring Function + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_scoring_function_v1_scoring_functions__scoring_fn_id__delete + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: scoring_fn_id + in: path + required: true + schema: + type: string + description: 'Path parameter: scoring_fn_id' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Get Scoring Function + description: Query endpoint for proper schema generation. + operationId: get_scoring_function_v1_scoring_functions__scoring_fn_id__get + parameters: + - name: scoring_fn_id + in: path + required: true + schema: + type: string + title: Scoring Fn Id + responses: + '200': + description: A ScoringFn. + content: + application/json: + schema: + $ref: '#/components/schemas/ScoringFn' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/scoring/score: + post: + tags: + - V1 + summary: Score + description: Typed endpoint for proper schema generation. + operationId: score_v1_scoring_score_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_scoring_score_Request' + required: true + responses: + '200': + description: A ScoreResponse object containing rows and aggregated results. + content: + application/json: + schema: + $ref: '#/components/schemas/ScoreResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/scoring/score-batch: + post: + tags: + - V1 + summary: Score Batch + description: Typed endpoint for proper schema generation. + operationId: score_batch_v1_scoring_score_batch_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_scoring_score_batch_Request' + required: true + responses: + '200': + description: A ScoreBatchResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/ScoreBatchResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/shields: + get: + tags: + - V1 + summary: List Shields + description: Response-only endpoint for proper schema generation. + operationId: list_shields_v1_shields_get + responses: + '200': + description: A ListShieldsResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/ListShieldsResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + post: + tags: + - V1 + summary: Register Shield + description: Typed endpoint for proper schema generation. + operationId: register_shield_v1_shields_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_shields_Request' + required: true + responses: + '200': + description: A Shield. + content: + application/json: + schema: + $ref: '#/components/schemas/Shield' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/shields/{identifier}: + delete: + tags: + - V1 + summary: Unregister Shield + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_shield_v1_shields__identifier__delete + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: identifier + in: path + required: true + schema: + type: string + description: 'Path parameter: identifier' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Get Shield + description: Query endpoint for proper schema generation. + operationId: get_shield_v1_shields__identifier__get + parameters: + - name: identifier + in: path + required: true + schema: + type: string + title: Identifier + responses: + '200': + description: A Shield. + content: + application/json: + schema: + $ref: '#/components/schemas/Shield' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/tool-runtime/invoke: + post: + tags: + - V1 + summary: Invoke Tool + description: Typed endpoint for proper schema generation. + operationId: invoke_tool_v1_tool_runtime_invoke_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_tool_runtime_invoke_Request' + required: true + responses: + '200': + description: A ToolInvocationResult. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolInvocationResult' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/tool-runtime/list-tools: + get: + tags: + - V1 + summary: List Runtime Tools + description: Query endpoint for proper schema generation. + operationId: list_runtime_tools_v1_tool_runtime_list_tools_get + parameters: + - name: tool_group_id + in: query + required: true + schema: + type: string + title: Tool Group Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/URL' + responses: + '200': + description: A ListToolDefsResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/ListToolDefsResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/tool-runtime/rag-tool/insert: + post: + tags: + - V1 + summary: Rag Tool.Insert + description: Generic endpoint - this would be replaced with actual implementation. + operationId: rag_tool_insert_v1_tool_runtime_rag_tool_insert_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/tool-runtime/rag-tool/query: + post: + tags: + - V1 + summary: Rag Tool.Query + description: Typed endpoint for proper schema generation. + operationId: rag_tool_query_v1_tool_runtime_rag_tool_query_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_tool_runtime_rag_tool_query_Request' + required: true + responses: + '200': + description: RAGQueryResult containing the retrieved content and metadata + content: + application/json: + schema: + $ref: '#/components/schemas/RAGQueryResult' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/toolgroups: + get: + tags: + - V1 + summary: List Tool Groups + description: Response-only endpoint for proper schema generation. + operationId: list_tool_groups_v1_toolgroups_get + responses: + '200': + description: A ListToolGroupsResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/ListToolGroupsResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Register Tool Group + description: Generic endpoint - this would be replaced with actual implementation. + operationId: register_tool_group_v1_toolgroups_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/toolgroups/{toolgroup_id}: + delete: + tags: + - V1 + summary: Unregister Toolgroup + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_toolgroup_v1_toolgroups__toolgroup_id__delete + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: toolgroup_id + in: path + required: true + schema: + type: string + description: 'Path parameter: toolgroup_id' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Get Tool Group + description: Query endpoint for proper schema generation. + operationId: get_tool_group_v1_toolgroups__toolgroup_id__get + parameters: + - name: toolgroup_id + in: path + required: true + schema: + type: string + title: Toolgroup Id + responses: + '200': + description: A ToolGroup. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolGroup' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/tools: + get: + tags: + - V1 + summary: List Tools + description: Query endpoint for proper schema generation. + operationId: list_tools_v1_tools_get + parameters: + - name: toolgroup_id + in: query + required: true + schema: + type: string + title: Toolgroup Id + responses: + '200': + description: A ListToolDefsResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/ListToolDefsResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/tools/{tool_name}: + get: + tags: + - V1 + summary: Get Tool + description: Query endpoint for proper schema generation. + operationId: get_tool_v1_tools__tool_name__get + parameters: + - name: tool_name + in: path + required: true + schema: + type: string + title: Tool Name + responses: + '200': + description: A ToolDef. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDef' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector-io/insert: + post: + tags: + - V1 + summary: Insert Chunks + description: Generic endpoint - this would be replaced with actual implementation. + operationId: insert_chunks_v1_vector_io_insert_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector-io/query: + post: + tags: + - V1 + summary: Query Chunks + description: Typed endpoint for proper schema generation. + operationId: query_chunks_v1_vector_io_query_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_vector_io_query_Request' + required: true + responses: + '200': + description: A QueryChunksResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryChunksResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/vector_stores: + get: + tags: + - V1 + summary: Openai List Vector Stores + description: Query endpoint for proper schema generation. + operationId: openai_list_vector_stores_v1_vector_stores_get + parameters: + - name: after + in: query + required: true + schema: + type: string + title: After + - name: before + in: query + required: true + schema: + type: string + title: Before + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit + - name: order + in: query + required: false + schema: + type: string + default: desc + title: Order + responses: + '200': + description: A VectorStoreListResponse containing the list of vector stores. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreListResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Openai Create Vector Store + description: Typed endpoint for proper schema generation. + operationId: openai_create_vector_store_v1_vector_stores_post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody' + responses: + '200': + description: A VectorStoreObject representing the created vector store. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector_stores/{vector_store_id}: + delete: + tags: + - V1 + summary: Openai Delete Vector Store + description: Query endpoint for proper schema generation. + operationId: openai_delete_vector_store_v1_vector_stores__vector_store_id__delete + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + responses: + '200': + description: A VectorStoreDeleteResponse indicating the deletion status. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreDeleteResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Openai Retrieve Vector Store + description: Query endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_v1_vector_stores__vector_store_id__get + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + responses: + '200': + description: A VectorStoreObject representing the vector store. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Openai Update Vector Store + description: Typed endpoint for proper schema generation. + operationId: openai_update_vector_store_v1_vector_stores__vector_store_id__post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/_vector_stores_vector_store_id_Request' + responses: + '200': + description: A VectorStoreObject representing the updated vector store. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: 'Path parameter: vector_store_id' + /v1/vector_stores/{vector_store_id}/file_batches: + post: + tags: + - V1 + summary: Openai Create Vector Store File Batch + description: Typed endpoint for proper schema generation. + operationId: openai_create_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody' + required: true + responses: + '200': + description: A VectorStoreFileBatchObject representing the created file batch. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileBatchObject' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: 'Path parameter: vector_store_id' + /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: + get: + tags: + - V1 + summary: Openai Retrieve Vector Store File Batch + description: Query endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__get + parameters: + - name: batch_id + in: path + required: true + schema: + type: string + title: Batch Id + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + responses: + '200': + description: A VectorStoreFileBatchObject representing the file batch. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileBatchObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: + post: + tags: + - V1 + summary: Openai Cancel Vector Store File Batch + description: Typed endpoint for proper schema generation. + operationId: openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post + requestBody: + content: + application/json: schema: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Schema - description: - anyOf: - - type: string - - type: 'null' - title: Description - strict: - anyOf: - - type: boolean - - type: 'null' - title: Strict - title: OpenAIResponseTextFormat - type: object - OpenAIResponseToolMCP: - description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response object. - - - :param type: Tool type identifier, always "mcp" - - :param server_label: Label to identify this MCP server - - :param allowed_tools: (Optional) Restriction on which tools can be used - from this server - properties: - type: - const: mcp - default: mcp - title: Type - type: string - server_label: - title: Server Label - type: string - allowed_tools: - anyOf: - - items: - type: string - type: array - - $ref: '#/$defs/AllowedToolsFilter' - - type: 'null' - title: Allowed Tools - required: - - server_label - title: OpenAIResponseToolMCP - type: object - OpenAIResponseUsage: - description: >- - Usage information for OpenAI response. - - - :param input_tokens: Number of tokens in the input - - :param output_tokens: Number of tokens in the output - - :param total_tokens: Total tokens used (input + output) - - :param input_tokens_details: Detailed breakdown of input token usage - - :param output_tokens_details: Detailed breakdown of output token usage - properties: - input_tokens: - title: Input Tokens - type: integer - output_tokens: - title: Output Tokens - type: integer - total_tokens: - title: Total Tokens - type: integer - input_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIResponseUsageInputTokensDetails - - type: 'null' - output_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIResponseUsageOutputTokensDetails - - type: 'null' - required: - - input_tokens - - output_tokens - - total_tokens - title: OpenAIResponseUsage - type: object - OpenAIResponseUsageInputTokensDetails: - description: >- - Token details for input tokens in OpenAI response usage. - - - :param cached_tokens: Number of tokens retrieved from cache - properties: - cached_tokens: - anyOf: - - type: integer - - type: 'null' - title: Cached Tokens - title: OpenAIResponseUsageInputTokensDetails - type: object - OpenAIResponseUsageOutputTokensDetails: - description: >- - Token details for output tokens in OpenAI response usage. - - - :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) - properties: - reasoning_tokens: - anyOf: - - type: integer - - type: 'null' - title: Reasoning Tokens - title: OpenAIResponseUsageOutputTokensDetails - type: object - SearchRankingOptions: - description: >- - Options for ranking and filtering search results. - - - :param ranker: (Optional) Name of the ranking algorithm to use - - :param score_threshold: (Optional) Minimum relevance score threshold for - results - properties: - ranker: - anyOf: - - type: string - - type: 'null' - title: Ranker - score_threshold: - anyOf: - - type: number - - type: 'null' - default: 0.0 - title: Score Threshold - title: SearchRankingOptions - type: object - description: >- - Paginated list of OpenAI response objects with navigation metadata. - - - :param data: List of response objects with their input context - - :param has_more: Whether there are more results available beyond this page - - :param first_id: Identifier of the first item in this page - - :param last_id: Identifier of the last item in this page - - :param object: Object type identifier, always "list" - properties: - data: - items: - $ref: '#/$defs/OpenAIResponseObjectWithInput' - title: Data - type: array - has_more: - title: Has More - type: boolean - first_id: - title: First Id + $ref: '#/components/schemas/_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request' + required: true + responses: + '200': + description: A VectorStoreFileBatchObject representing the cancelled file batch. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileBatchObject' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: vector_store_id + in: path + required: true + schema: type: string - last_id: - title: Last Id + description: 'Path parameter: vector_store_id' + - name: batch_id + in: path + required: true + schema: type: string - object: - const: list - default: list - title: Object + description: 'Path parameter: batch_id' + /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: + get: + tags: + - V1 + summary: Openai List Files In Vector Store File Batch + description: Query endpoint for proper schema generation. + operationId: openai_list_files_in_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get + parameters: + - name: batch_id + in: path + required: true + schema: + type: string + title: Batch Id + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + - name: after + in: query + required: true + schema: + type: string + title: After + - name: before + in: query + required: true + schema: + type: string + title: Before + - name: filter + in: query + required: true + schema: + type: string + title: Filter + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit + - name: order + in: query + required: false + schema: + type: string + default: desc + title: Order + responses: + '200': + description: A VectorStoreFilesListInBatchResponse containing the list of files in the batch. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFilesListInBatchResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector_stores/{vector_store_id}/files: + get: + tags: + - V1 + summary: Openai List Files In Vector Store + description: Query endpoint for proper schema generation. + operationId: openai_list_files_in_vector_store_v1_vector_stores__vector_store_id__files_get + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + - name: after + in: query + required: true + schema: + type: string + title: After + - name: before + in: query + required: true + schema: + type: string + title: Before + - name: filter + in: query + required: true + schema: + type: string + title: Filter + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit + - name: order + in: query + required: false + schema: + type: string + default: desc + title: Order + responses: + '200': + description: A VectorStoreListFilesResponse containing the list of files. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreListFilesResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Openai Attach File To Vector Store + description: Typed endpoint for proper schema generation. + operationId: openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/_vector_stores_vector_store_id_files_Request' + responses: + '200': + description: A VectorStoreFileObject representing the attached file. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + parameters: + - name: vector_store_id + in: path + required: true + schema: type: string - required: - - data - - has_more - - first_id - - last_id - title: ListOpenAIResponseObject - type: object - properties: - code: + description: 'Path parameter: vector_store_id' + /v1/vector_stores/{vector_store_id}/files/{file_id}: + delete: + tags: + - V1 + summary: Openai Delete Vector Store File + description: Query endpoint for proper schema generation. + operationId: openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete + parameters: + - name: file_id + in: path + required: true + schema: type: string - description: >- - Error code identifying the type of failure - message: + title: File Id + - name: vector_store_id + in: path + required: true + schema: type: string - description: >- - Human-readable error message describing the failure - additionalProperties: false - required: - - code - - message - title: OpenAIResponseError - description: >- - Error details for failed OpenAI response requests. - OpenAIResponseInput: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutput' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseMessage' - OpenAIResponseInputToolFileSearch: - type: object - properties: - type: + title: Vector Store Id + responses: + '200': + description: A VectorStoreFileDeleteResponse indicating the deletion status. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileDeleteResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Openai Retrieve Vector Store File + description: Query endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get + parameters: + - name: file_id + in: path + required: true + schema: type: string - const: file_search - default: file_search - description: >- - Tool type identifier, always "file_search" - vector_store_ids: - type: array - items: - type: string - description: >- - List of vector store identifiers to search within - filters: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional filters to apply to the search - max_num_results: - type: integer - default: 10 - description: >- - (Optional) Maximum number of search results to return (1-50) - ranking_options: - type: object - properties: - ranker: - type: string - description: >- - (Optional) Name of the ranking algorithm to use - score_threshold: - type: number - default: 0.0 - description: >- - (Optional) Minimum relevance score threshold for results - additionalProperties: false - description: >- - (Optional) Options for ranking and scoring search results - additionalProperties: false - required: - - type - - vector_store_ids - title: OpenAIResponseInputToolFileSearch - description: >- - File search tool configuration for OpenAI response inputs. - OpenAIResponseInputToolFunction: - type: object - properties: - type: + title: File Id + - name: vector_store_id + in: path + required: true + schema: type: string - const: function - default: function - description: Tool type identifier, always "function" - name: + title: Vector Store Id + responses: + '200': + description: A VectorStoreFileObject representing the file. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Openai Update Vector Store File + description: Typed endpoint for proper schema generation. + operationId: openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/_vector_stores_vector_store_id_files_file_id_Request' + responses: + '200': + description: A VectorStoreFileObject representing the updated file. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + parameters: + - name: vector_store_id + in: path + required: true + schema: type: string - description: Name of the function that can be called - description: + description: 'Path parameter: vector_store_id' + - name: file_id + in: path + required: true + schema: type: string - description: >- - (Optional) Description of what the function does - parameters: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON schema defining the function's parameters - strict: - type: boolean - description: >- - (Optional) Whether to enforce strict parameter validation - additionalProperties: false - required: - - type - - name - title: OpenAIResponseInputToolFunction - description: >- - Function tool configuration for OpenAI response inputs. - OpenAIResponseInputToolWebSearch: - type: object - properties: - type: - oneOf: - - type: string - const: web_search - - type: string - const: web_search_preview - - type: string - const: web_search_preview_2025_03_11 - default: web_search - description: Web search tool type variant to use - search_context_size: + description: 'Path parameter: file_id' + /v1/vector_stores/{vector_store_id}/files/{file_id}/content: + get: + tags: + - V1 + summary: Openai Retrieve Vector Store File Contents + description: Query endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get + parameters: + - name: file_id + in: path + required: true + schema: type: string - default: medium - description: >- - (Optional) Size of search context, must be "low", "medium", or "high" - additionalProperties: false - required: - - type - title: OpenAIResponseInputToolWebSearch - description: >- - Web search tool configuration for OpenAI response inputs. - OpenAIResponseObjectWithInput: - type: object - properties: - created_at: - type: integer - description: >- - Unix timestamp when the response was created - error: - $ref: '#/components/schemas/OpenAIResponseError' - description: >- - (Optional) Error details if the response generation failed - id: + title: File Id + - name: vector_store_id + in: path + required: true + schema: type: string - description: Unique identifier for this response - model: + title: Vector Store Id + responses: + '200': + description: A list of InterleavedContent representing the file contents. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileContentsResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector_stores/{vector_store_id}/search: + post: + tags: + - V1 + summary: Openai Search Vector Store + description: Typed endpoint for proper schema generation. + operationId: openai_search_vector_store_v1_vector_stores__vector_store_id__search_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_vector_stores_vector_store_id_search_Request' + required: true + responses: + '200': + description: A VectorStoreSearchResponse containing the search results. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreSearchResponsePage' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: vector_store_id + in: path + required: true + schema: type: string - description: Model identifier used for generation - object: + description: 'Path parameter: vector_store_id' + /v1/version: + get: + tags: + - V1 + summary: Version + description: Response-only endpoint for proper schema generation. + operationId: version_v1_version_get + responses: + '200': + description: Version information containing the service version number. + content: + application/json: + schema: + $ref: '#/components/schemas/VersionInfo' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' +components: + schemas: + AgentCandidate: + properties: + type: type: string - const: response - default: response - description: >- - Object type identifier, always "response" - output: + const: agent + title: Type + default: agent + config: + $ref: '#/components/schemas/AgentConfig' + type: object + required: + - config + title: AgentCandidate + description: "An agent candidate for evaluation.\n\n:param config: The configuration for the agent candidate." + AgentConfig: + properties: + sampling_params: + $ref: '#/components/schemas/SamplingParams' + input_shields: + title: Input Shields + items: + type: string type: array + output_shields: + title: Output Shields items: - $ref: '#/components/schemas/OpenAIResponseOutput' - description: >- - List of generated output items (messages, tool calls, etc.) - parallel_tool_calls: - type: boolean - default: false - description: >- - Whether tool calls can be executed in parallel - previous_response_id: - type: string - description: >- - (Optional) ID of the previous response in a conversation - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - description: >- - (Optional) Reference to a prompt template and its variables. - status: - type: string - description: >- - Current status of the response generation - temperature: - type: number - description: >- - (Optional) Sampling temperature used for generation - text: - $ref: '#/components/schemas/OpenAIResponseText' - description: >- - Text formatting configuration for the response - top_p: - type: number - description: >- - (Optional) Nucleus sampling parameter used for generation - tools: + type: string type: array + toolgroups: + title: Toolgroups items: - $ref: '#/components/schemas/OpenAIResponseTool' - description: >- - (Optional) An array of tools the model may call while generating a response. - truncation: - type: string - description: >- - (Optional) Truncation strategy applied to the response - usage: - $ref: '#/components/schemas/OpenAIResponseUsage' - description: >- - (Optional) Token usage information for the response - instructions: - type: string - description: >- - (Optional) System message inserted into the model's context - input: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' type: array + client_tools: + title: Client Tools items: - $ref: '#/components/schemas/OpenAIResponseInput' - description: >- - List of input items that led to this response - additionalProperties: false - required: - - created_at - - id - - model - - object - - output - - parallel_tool_calls - - status - - text - - input - title: OpenAIResponseObjectWithInput - description: >- - OpenAI response object extended with input context information. - OpenAIResponseOutput: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - OpenAIResponsePrompt: - type: object - properties: - id: - type: string - description: Unique identifier of the prompt template - variables: - type: object - additionalProperties: - $ref: '#/components/schemas/OpenAIResponseInputMessageContent' - description: >- - Dictionary of variable names to OpenAIResponseInputMessageContent structure - for template substitution. The substitution values can either be strings, - or other Response input types like images or files. - version: + $ref: '#/components/schemas/ToolDef' + type: array + tool_choice: + deprecated: true + $ref: '#/components/schemas/ToolChoice' + tool_prompt_format: + deprecated: true + $ref: '#/components/schemas/ToolPromptFormat' + tool_config: + $ref: '#/components/schemas/ToolConfig' + max_infer_iters: + title: Max Infer Iters + default: 10 + type: integer + model: type: string - description: >- - Version number of the prompt to use (defaults to latest if not specified) - additionalProperties: false - required: - - id - title: OpenAIResponsePrompt - description: >- - OpenAI compatible Prompt object that is used in OpenAI responses. - OpenAIResponseText: - type: object - properties: - format: - type: object - properties: - type: - oneOf: - - type: string - const: text - - type: string - const: json_schema - - type: string - const: json_object - description: >- - Must be "text", "json_schema", or "json_object" to identify the format - type - name: - type: string - description: >- - The name of the response format. Only used for json_schema. - schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The JSON schema the response should conform to. In a Python SDK, this - is often a `pydantic` model. Only used for json_schema. - description: - type: string - description: >- - (Optional) A description of the response format. Only used for json_schema. - strict: - type: boolean - description: >- - (Optional) Whether to strictly enforce the JSON schema. If true, the - response must match the schema exactly. Only used for json_schema. - additionalProperties: false - required: - - type - description: >- - (Optional) Text format configuration specifying output format requirements - additionalProperties: false - title: OpenAIResponseText - description: >- - Text response configuration for OpenAI responses. - OpenAIResponseTool: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseToolMCP' - discriminator: - propertyName: type - mapping: - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseToolMCP' - OpenAIResponseToolMCP: - type: object - properties: - type: + title: Model + instructions: type: string - const: mcp - default: mcp - description: Tool type identifier, always "mcp" - server_label: + title: Instructions + name: + title: Name type: string - description: Label to identify this MCP server - allowed_tools: + enable_session_persistence: + title: Enable Session Persistence + default: false + type: boolean + response_format: + title: Response Format oneOf: - - type: array - items: - type: string - - type: object - properties: - tool_names: - type: array - items: - type: string - description: >- - (Optional) List of specific tool names that are allowed - additionalProperties: false - title: AllowedToolsFilter - description: >- - Filter configuration for restricting which MCP tools can be used. - description: >- - (Optional) Restriction on which tools can be used from this server - additionalProperties: false - required: - - type - - server_label - title: OpenAIResponseToolMCP - description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response object. - OpenAIResponseUsage: + - $ref: '#/components/schemas/JsonSchemaResponseFormat' + - $ref: '#/components/schemas/GrammarResponseFormat' + discriminator: + propertyName: type + mapping: + grammar: '#/components/schemas/GrammarResponseFormat' + json_schema: '#/components/schemas/JsonSchemaResponseFormat' type: object - properties: - input_tokens: - type: integer - description: Number of tokens in the input - output_tokens: - type: integer - description: Number of tokens in the output - total_tokens: - type: integer - description: Total tokens used (input + output) - input_tokens_details: - type: object - properties: - cached_tokens: - type: integer - description: Number of tokens retrieved from cache - additionalProperties: false - description: Detailed breakdown of input token usage - output_tokens_details: - type: object - properties: - reasoning_tokens: - type: integer - description: >- - Number of tokens used for reasoning (o1/o3 models) - additionalProperties: false - description: Detailed breakdown of output token usage - additionalProperties: false required: - - input_tokens - - output_tokens - - total_tokens - title: OpenAIResponseUsage - description: Usage information for OpenAI response. - ResponseGuardrailSpec: - type: object + - model + - instructions + title: AgentConfig + description: "Configuration for an agent.\n\n:param model: The model identifier to use for the agent\n:param instructions: The system instructions for the agent\n:param name: Optional name for the agent, used in telemetry and identification\n:param enable_session_persistence: Optional flag indicating whether session data has to be persisted\n:param response_format: Optional response format configuration" + AgentCreateResponse: properties: - type: + agent_id: type: string - description: The type/identifier of the guardrail. - additionalProperties: false - required: - - type - title: ResponseGuardrailSpec - description: >- - Specification for a guardrail to apply during response generation. - OpenAIResponseInputTool: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' - discriminator: - propertyName: type - mapping: - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseInputToolMCP' - OpenAIResponseInputToolMCP: + title: Agent Id type: object - properties: - type: - type: string - const: mcp - default: mcp - description: Tool type identifier, always "mcp" - server_label: - type: string - description: Label to identify this MCP server - server_url: - type: string - description: URL endpoint of the MCP server - headers: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) HTTP headers to include when connecting to the server - require_approval: - oneOf: - - type: string - const: always - - type: string - const: never - - type: object - properties: - always: - type: array - items: - type: string - description: >- - (Optional) List of tool names that always require approval - never: - type: array - items: - type: string - description: >- - (Optional) List of tool names that never require approval - additionalProperties: false - title: ApprovalFilter - description: >- - Filter configuration for MCP tool approval requirements. - default: never - description: >- - Approval requirement for tool calls ("always", "never", or filter) - allowed_tools: - oneOf: - - type: array - items: - type: string - - type: object - properties: - tool_names: - type: array - items: - type: string - description: >- - (Optional) List of specific tool names that are allowed - additionalProperties: false - title: AllowedToolsFilter - description: >- - Filter configuration for restricting which MCP tools can be used. - description: >- - (Optional) Restriction on which tools can be used from this server - additionalProperties: false required: - - type - - server_label - - server_url - - require_approval - title: OpenAIResponseInputToolMCP - description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response inputs. - CreateOpenaiResponseRequest: - type: object - properties: - input: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInput' - description: Input message(s) to create the response. - model: - type: string - description: The underlying LLM used for completions. - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - description: >- - (Optional) Prompt object with ID, version, and variables. - instructions: + - agent_id + title: AgentCreateResponse + description: "Response returned when creating a new agent.\n\n:param agent_id: Unique identifier for the created agent" + AgentSessionCreateResponse: + properties: + session_id: type: string - previous_response_id: + title: Session Id + type: object + required: + - session_id + title: AgentSessionCreateResponse + description: "Response returned when creating a new agent session.\n\n:param session_id: Unique identifier for the created session" + AgentToolGroupWithArgs: + properties: + name: type: string - description: >- - (Optional) if specified, the new response will be a continuation of the - previous response. This can be used to easily fork-off new responses from - existing responses. - conversation: + title: Name + args: + additionalProperties: true + type: object + title: Args + type: object + required: + - name + - args + title: AgentToolGroupWithArgs + AgentTurnInputType: + properties: + type: type: string - description: >- - (Optional) The ID of a conversation to add the response to. Must begin - with 'conv_'. Input and output messages will be automatically added to - the conversation. - store: - type: boolean - stream: - type: boolean - temperature: - type: number - text: - $ref: '#/components/schemas/OpenAIResponseText' - tools: + const: agent_turn_input + title: Type + default: agent_turn_input + type: object + title: AgentTurnInputType + description: "Parameter type for agent turn input.\n\n:param type: Discriminator type. Always \"agent_turn_input\"" + AggregationFunctionType: + type: string + enum: + - average + - weighted_average + - median + - categorical_count + - accuracy + title: AggregationFunctionType + description: "Types of aggregation functions for scoring results.\n:cvar average: Calculate the arithmetic mean of scores\n:cvar weighted_average: Calculate a weighted average of scores\n:cvar median: Calculate the median value of scores\n:cvar categorical_count: Count occurrences of categorical values\n:cvar accuracy: Calculate accuracy as the proportion of correct answers" + AllowedToolsFilter: + properties: + tool_names: + title: Tool Names + items: + type: string type: array + type: object + title: AllowedToolsFilter + description: "Filter configuration for restricting which MCP tools can be used.\n\n:param tool_names: (Optional) List of specific tool names that are allowed" + ApprovalFilter: + properties: + always: + title: Always items: - $ref: '#/components/schemas/OpenAIResponseInputTool' - include: + type: string type: array + never: + title: Never items: type: string - description: >- - (Optional) Additional fields to include in the response. - max_infer_iters: - type: integer - additionalProperties: false + type: array + type: object + title: ApprovalFilter + description: "Filter configuration for MCP tool approval requirements.\n\n:param always: (Optional) List of tool names that always require approval\n:param never: (Optional) List of tool names that never require approval" + ArrayType: + properties: + type: + type: string + const: array + title: Type + default: array + type: object + title: ArrayType + description: "Parameter type for array values.\n\n:param type: Discriminator type. Always \"array\"" + Attachment-Output: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + title: Content + mime_type: + type: string + title: Mime Type + type: object required: - - input - - model - title: CreateOpenaiResponseRequest - OpenAIResponseObject: - $defs: - AllowedToolsFilter: - description: >- - Filter configuration for restricting which MCP tools can be used. - - - :param tool_names: (Optional) List of specific tool names that are allowed - properties: - tool_names: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Tool Names - title: AllowedToolsFilter - type: object - MCPListToolsTool: - description: >- - Tool definition returned by MCP list tools operation. - - - :param input_schema: JSON schema defining the tool's input parameters - - :param name: Name of the tool - - :param description: (Optional) Description of what the tool does - properties: - input_schema: - additionalProperties: true - title: Input Schema - type: object - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - required: - - input_schema - - name - title: MCPListToolsTool - type: object - OpenAIResponseAnnotationCitation: - description: >- - URL citation annotation for referencing external web resources. - - - :param type: Annotation type identifier, always "url_citation" - - :param end_index: End position of the citation span in the content - - :param start_index: Start position of the citation span in the content - - :param title: Title of the referenced web resource - - :param url: URL of the referenced web resource - properties: - type: - const: url_citation - default: url_citation - title: Type - type: string - end_index: - title: End Index - type: integer - start_index: - title: Start Index - type: integer - title: - title: Title - type: string - url: - title: Url - type: string - required: - - end_index - - start_index - - title - - url - title: OpenAIResponseAnnotationCitation - type: object - "OpenAIResponseAnnotationContainerFileCitation": - properties: - type: - const: container_file_citation - default: container_file_citation - title: Type - type: string - container_id: - title: Container Id - type: string - end_index: - title: End Index - type: integer - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - start_index: - title: Start Index - type: integer - required: - - container_id - - end_index - - file_id - - filename - - start_index - title: >- - OpenAIResponseAnnotationContainerFileCitation - type: object - OpenAIResponseAnnotationFileCitation: - description: >- - File citation annotation for referencing specific files in response content. - - - :param type: Annotation type identifier, always "file_citation" - - :param file_id: Unique identifier of the referenced file - - :param filename: Name of the referenced file - - :param index: Position index of the citation within the content - properties: - type: - const: file_citation - default: file_citation - title: Type - type: string - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - index: - title: Index - type: integer - required: - - file_id - - filename - - index - title: OpenAIResponseAnnotationFileCitation - type: object - OpenAIResponseAnnotationFilePath: - properties: - type: - const: file_path - default: file_path - title: Type - type: string - file_id: - title: File Id - type: string - index: - title: Index - type: integer - required: - - file_id - - index - title: OpenAIResponseAnnotationFilePath + - content + - mime_type + title: Attachment + description: "An attachment to an agent turn.\n\n:param content: The content of the attachment.\n:param mime_type: The MIME type of the attachment." + BasicScoringFnParams: + properties: + type: + type: string + const: basic + title: Type + default: basic + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row + type: object + title: BasicScoringFnParams + description: "Parameters for basic scoring function configuration.\n:param type: The type of scoring function parameters, always basic\n:param aggregation_functions: Aggregation functions to apply to the scores of each row" + Batch: + properties: + id: + type: string + title: Id + completion_window: + type: string + title: Completion Window + created_at: + type: integer + title: Created At + endpoint: + type: string + title: Endpoint + input_file_id: + type: string + title: Input File Id + object: + type: string + const: batch + title: Object + status: + type: string + enum: + - validating + - failed + - in_progress + - finalizing + - completed + - expired + - cancelling + - cancelled + title: Status + cancelled_at: + title: Cancelled At + type: integer + cancelling_at: + title: Cancelling At + type: integer + completed_at: + title: Completed At + type: integer + error_file_id: + title: Error File Id + type: string + errors: + $ref: '#/components/schemas/Errors' + expired_at: + title: Expired At + type: integer + expires_at: + title: Expires At + type: integer + failed_at: + title: Failed At + type: integer + finalizing_at: + title: Finalizing At + type: integer + in_progress_at: + title: In Progress At + type: integer + metadata: + title: Metadata + additionalProperties: + type: string type: object - OpenAIResponseContentPartRefusal: - description: >- - Refusal content within a streamed response part. - - - :param type: Content part type identifier, always "refusal" - - :param refusal: Refusal text supplied by the model - properties: - type: - const: refusal - default: refusal - title: Type - type: string - refusal: - title: Refusal - type: string - required: - - refusal - title: OpenAIResponseContentPartRefusal + model: + title: Model + type: string + output_file_id: + title: Output File Id + type: string + request_counts: + $ref: '#/components/schemas/BatchRequestCounts' + usage: + $ref: '#/components/schemas/BatchUsage' + additionalProperties: true + type: object + required: + - id + - completion_window + - created_at + - endpoint + - input_file_id + - object + - status + title: Batch + BatchError: + properties: + code: + title: Code + type: string + line: + title: Line + type: integer + message: + title: Message + type: string + param: + title: Param + type: string + additionalProperties: true + type: object + title: BatchError + BatchRequestCounts: + properties: + completed: + type: integer + title: Completed + failed: + type: integer + title: Failed + total: + type: integer + title: Total + additionalProperties: true + type: object + required: + - completed + - failed + - total + title: BatchRequestCounts + BatchUsage: + properties: + input_tokens: + type: integer + title: Input Tokens + input_tokens_details: + $ref: '#/components/schemas/InputTokensDetails' + output_tokens: + type: integer + title: Output Tokens + output_tokens_details: + $ref: '#/components/schemas/OutputTokensDetails' + total_tokens: + type: integer + title: Total Tokens + additionalProperties: true + type: object + required: + - input_tokens + - input_tokens_details + - output_tokens + - output_tokens_details + - total_tokens + title: BatchUsage + Benchmark: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + title: Provider Resource Id + description: Unique identifier for this resource in the provider + type: string + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: benchmark + title: Type + default: benchmark + dataset_id: + type: string + title: Dataset Id + scoring_functions: + items: + type: string + type: array + title: Scoring Functions + metadata: + additionalProperties: true type: object - OpenAIResponseError: - description: >- - Error details for failed OpenAI response requests. - - - :param code: Error code identifying the type of failure - - :param message: Human-readable error message describing the failure - properties: - code: - title: Code - type: string - message: - title: Message - type: string - required: - - code - - message - title: OpenAIResponseError + title: Metadata + description: Metadata for this evaluation task + type: object + required: + - identifier + - provider_id + - dataset_id + - scoring_functions + title: Benchmark + description: "A benchmark resource for evaluating model performance.\n\n:param dataset_id: Identifier of the dataset to use for the benchmark evaluation\n:param scoring_functions: List of scoring function identifiers to apply during evaluation\n:param metadata: Metadata for this evaluation task\n:param type: The resource type, always benchmark" + BenchmarkConfig: + properties: + eval_candidate: + oneOf: + - $ref: '#/components/schemas/ModelCandidate' + - $ref: '#/components/schemas/AgentCandidate' + title: Eval Candidate + discriminator: + propertyName: type + mapping: + agent: '#/components/schemas/AgentCandidate' + model: '#/components/schemas/ModelCandidate' + scoring_params: + additionalProperties: + oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' type: object - OpenAIResponseInputMessageContentImage: - description: >- - Image content for input messages in OpenAI response format. - - - :param detail: Level of detail for image processing, can be "low", "high", - or "auto" - - :param type: Content type identifier, always "input_image" - - :param image_url: (Optional) URL of the image content - properties: - detail: - anyOf: - - const: low - type: string - - const: high - type: string - - const: auto - type: string - default: auto - title: Detail - type: - const: input_image - default: input_image - title: Type - type: string - image_url: - anyOf: - - type: string - - type: 'null' - title: Image Url - title: OpenAIResponseInputMessageContentImage + title: Scoring Params + description: Map between scoring function id and parameters for each scoring function you want to run + num_examples: + title: Num Examples + description: Number of examples to evaluate (useful for testing), if not provided, all examples in the dataset will be evaluated + type: integer + type: object + required: + - eval_candidate + title: BenchmarkConfig + description: "A benchmark configuration for evaluation.\n\n:param eval_candidate: The candidate to evaluate.\n:param scoring_params: Map between scoring function id and parameters for each scoring function you want to run\n:param num_examples: (Optional) The number of examples to evaluate. If not provided, all examples in the dataset will be evaluated" + BooleanType: + properties: + type: + type: string + const: boolean + title: Type + default: boolean + type: object + title: BooleanType + description: "Parameter type for boolean values.\n\n:param type: Discriminator type. Always \"boolean\"" + BuiltinTool: + type: string + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + ChatCompletionInputType: + properties: + type: + type: string + const: chat_completion_input + title: Type + default: chat_completion_input + type: object + title: ChatCompletionInputType + description: "Parameter type for chat completion input.\n\n:param type: Discriminator type. Always \"chat_completion_input\"" + Chunk-Output: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + chunk_id: + type: string + title: Chunk Id + metadata: + additionalProperties: true type: object - OpenAIResponseInputMessageContentText: - description: >- - Text content for input messages in OpenAI response format. - - - :param text: The text content of the input message - - :param type: Content type identifier, always "input_text" - properties: - text: - title: Text - type: string - type: - const: input_text - default: input_text - title: Type - type: string - required: - - text - title: OpenAIResponseInputMessageContentText + title: Metadata + embedding: + title: Embedding + items: + type: number + type: array + chunk_metadata: + $ref: '#/components/schemas/ChunkMetadata' + type: object + required: + - content + - chunk_id + title: Chunk + description: "A chunk of content that can be inserted into a vector database.\n:param content: The content of the chunk, which can be interleaved text, images, or other types.\n:param chunk_id: Unique identifier for the chunk. Must be provided explicitly.\n:param metadata: Metadata associated with the chunk that will be used in the model context during inference.\n:param embedding: Optional embedding for the chunk. If not provided, it will be computed later.\n:param chunk_metadata: Metadata for the chunk that will NOT be used in the context during inference.\n The `chunk_metadata` is required backend functionality." + ChunkMetadata: + properties: + chunk_id: + title: Chunk Id + type: string + document_id: + title: Document Id + type: string + source: + title: Source + type: string + created_timestamp: + title: Created Timestamp + type: integer + updated_timestamp: + title: Updated Timestamp + type: integer + chunk_window: + title: Chunk Window + type: string + chunk_tokenizer: + title: Chunk Tokenizer + type: string + chunk_embedding_model: + title: Chunk Embedding Model + type: string + chunk_embedding_dimension: + title: Chunk Embedding Dimension + type: integer + content_token_count: + title: Content Token Count + type: integer + metadata_token_count: + title: Metadata Token Count + type: integer + type: object + title: ChunkMetadata + description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference.\n:param chunk_id: The ID of the chunk. If not set, it will be generated based on the document ID and content.\n:param document_id: The ID of the document this chunk belongs to.\n:param source: The source of the content, such as a URL, file path, or other identifier.\n:param created_timestamp: An optional timestamp indicating when the chunk was created.\n:param updated_timestamp: An optional timestamp indicating when the chunk was last updated.\n:param chunk_window: The window of the chunk, which can be used to group related chunks together.\n:param chunk_tokenizer: The tokenizer used to create the chunk. Default is Tiktoken.\n:param chunk_embedding_model: The embedding model used to create the chunk's embedding.\n:param chunk_embedding_dimension: The dimension of the embedding vector for the chunk.\n:param content_token_count: The number of tokens in the content of the chunk.\n:param metadata_token_count: The number of tokens in the metadata of the chunk." + CompletionInputType: + properties: + type: + type: string + const: completion_input + title: Type + default: completion_input + type: object + title: CompletionInputType + description: "Parameter type for completion input.\n\n:param type: Discriminator type. Always \"completion_input\"" + CompletionMessage-Output: + properties: + role: + type: string + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + title: Tool Calls + items: + $ref: '#/components/schemas/ToolCall' + type: array + type: object + required: + - content + - stop_reason + title: CompletionMessage + description: "A message containing the model's (assistant) response in a chat conversation.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param stop_reason: Reason why the model stopped generating. Options are:\n - `StopReason.end_of_turn`: The model finished generating the entire response.\n - `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n - `StopReason.out_of_tokens`: The model ran out of token budget.\n:param tool_calls: List of tool calls. Each tool call is a ToolCall object." + Conversation: + properties: + id: + type: string + title: Id + description: The unique ID of the conversation. + object: + type: string + const: conversation + title: Object + description: The object type, which is always conversation. + default: conversation + created_at: + type: integer + title: Created At + description: The time at which the conversation was created, measured in seconds since the Unix epoch. + metadata: + title: Metadata + description: Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. + additionalProperties: + type: string type: object - OpenAIResponseInputToolFileSearch: - description: >- - File search tool configuration for OpenAI response inputs. - - - :param type: Tool type identifier, always "file_search" - - :param vector_store_ids: List of vector store identifiers to search within - - :param filters: (Optional) Additional filters to apply to the search - - :param max_num_results: (Optional) Maximum number of search results to - return (1-50) - - :param ranking_options: (Optional) Options for ranking and scoring search - results - properties: - type: - const: file_search - default: file_search - title: Type - type: string - vector_store_ids: - items: - type: string - title: Vector Store Ids - type: array - filters: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Filters - max_num_results: - anyOf: - - maximum: 50 - minimum: 1 - type: integer - - type: 'null' - default: 10 - title: Max Num Results - ranking_options: - anyOf: - - $ref: '#/$defs/SearchRankingOptions' - - type: 'null' - required: - - vector_store_ids - title: OpenAIResponseInputToolFileSearch + items: + title: Items + description: Initial items to include in the conversation context. You may add up to 20 items at a time. + items: + additionalProperties: true + type: object + type: array + type: object + required: + - id + - created_at + title: Conversation + description: OpenAI-compatible conversation object. + ConversationItemInclude: + type: string + enum: + - web_search_call.action.sources + - code_interpreter_call.outputs + - computer_call_output.output.image_url + - file_search_call.results + - message.input_image.image_url + - message.output_text.logprobs + - reasoning.encrypted_content + title: ConversationItemInclude + description: Specify additional output data to include in the model response. + ConversationItemList: + properties: + object: + type: string + title: Object + description: Object type + default: list + data: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + title: Data + description: List of conversation items + first_id: + title: First Id + description: The ID of the first item in the list + type: string + last_id: + title: Last Id + description: The ID of the last item in the list + type: string + has_more: + type: boolean + title: Has More + description: Whether there are more items available + default: false + type: object + required: + - data + title: ConversationItemList + description: List of conversation items with pagination. + DPOAlignmentConfig: + properties: + beta: + type: number + title: Beta + loss_type: + $ref: '#/components/schemas/DPOLossType' + default: sigmoid + type: object + required: + - beta + title: DPOAlignmentConfig + description: "Configuration for Direct Preference Optimization (DPO) alignment.\n\n:param beta: Temperature parameter for the DPO loss\n:param loss_type: The type of loss function to use for DPO" + DPOLossType: + type: string + enum: + - sigmoid + - hinge + - ipo + - kto_pair + title: DPOLossType + DataConfig: + properties: + dataset_id: + type: string + title: Dataset Id + batch_size: + type: integer + title: Batch Size + shuffle: + type: boolean + title: Shuffle + data_format: + $ref: '#/components/schemas/DatasetFormat' + validation_dataset_id: + title: Validation Dataset Id + type: string + packed: + title: Packed + default: false + type: boolean + train_on_input: + title: Train On Input + default: false + type: boolean + type: object + required: + - dataset_id + - batch_size + - shuffle + - data_format + title: DataConfig + description: "Configuration for training data and data loading.\n\n:param dataset_id: Unique identifier for the training dataset\n:param batch_size: Number of samples per training batch\n:param shuffle: Whether to shuffle the dataset during training\n:param data_format: Format of the dataset (instruct or dialog)\n:param validation_dataset_id: (Optional) Unique identifier for the validation dataset\n:param packed: (Optional) Whether to pack multiple samples into a single sequence for efficiency\n:param train_on_input: (Optional) Whether to compute loss on input tokens as well as output tokens" + Dataset: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + title: Provider Resource Id + description: Unique identifier for this resource in the provider + type: string + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: dataset + title: Type + default: dataset + purpose: + $ref: '#/components/schemas/DatasetPurpose' + source: + oneOf: + - $ref: '#/components/schemas/URIDataSource' + - $ref: '#/components/schemas/RowsDataSource' + title: Source + discriminator: + propertyName: type + mapping: + rows: '#/components/schemas/RowsDataSource' + uri: '#/components/schemas/URIDataSource' + metadata: + additionalProperties: true type: object - OpenAIResponseInputToolFunction: - description: >- - Function tool configuration for OpenAI response inputs. - - - :param type: Tool type identifier, always "function" - - :param name: Name of the function that can be called - - :param description: (Optional) Description of what the function does - - :param parameters: (Optional) JSON schema defining the function's parameters - - :param strict: (Optional) Whether to enforce strict parameter validation - properties: - type: - const: function - default: function - title: Type - type: string - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - parameters: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Parameters - strict: - anyOf: - - type: boolean - - type: 'null' - title: Strict - required: - - name - - parameters - title: OpenAIResponseInputToolFunction + title: Metadata + description: Any additional metadata for this dataset + type: object + required: + - identifier + - provider_id + - purpose + - source + title: Dataset + description: "Dataset resource for storing and accessing training or evaluation data.\n\n:param type: Type of resource, always 'dataset' for datasets" + DatasetFormat: + type: string + enum: + - instruct + - dialog + title: DatasetFormat + description: "Format of the training dataset.\n:cvar instruct: Instruction-following format with prompt and completion\n:cvar dialog: Multi-turn conversation format with messages" + DatasetPurpose: + type: string + enum: + - post-training/messages + - eval/question-answer + - eval/messages-answer + title: DatasetPurpose + description: "Purpose of the dataset. Each purpose has a required input data schema.\n\n:cvar post-training/messages: The dataset contains messages used for post-training.\n {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello, world!\"},\n {\"role\": \"assistant\", \"content\": \"Hello, world!\"},\n ]\n }\n:cvar eval/question-answer: The dataset contains a question column and an answer column.\n {\n \"question\": \"What is the capital of France?\",\n \"answer\": \"Paris\"\n }\n:cvar eval/messages-answer: The dataset contains a messages column with list of messages and an answer column.\n {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello, my name is John Doe.\"},\n {\"role\": \"assistant\", \"content\": \"Hello, John Doe. How can I help you today?\"},\n {\"role\": \"user\", \"content\": \"What's my name?\"},\n ],\n \"answer\": \"John Doe\"\n }" + DefaultRAGQueryGeneratorConfig: + properties: + type: + type: string + const: default + title: Type + default: default + separator: + type: string + title: Separator + default: ' ' + type: object + title: DefaultRAGQueryGeneratorConfig + description: "Configuration for the default RAG query generator.\n\n:param type: Type of query generator, always 'default'\n:param separator: String separator used to join query terms" + Document: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + title: Content + mime_type: + type: string + title: Mime Type + type: object + required: + - content + - mime_type + title: Document + description: "A document to be used by an agent.\n\n:param content: The content of the document.\n:param mime_type: The MIME type of the document." + EfficiencyConfig: + properties: + enable_activation_checkpointing: + title: Enable Activation Checkpointing + default: false + type: boolean + enable_activation_offloading: + title: Enable Activation Offloading + default: false + type: boolean + memory_efficient_fsdp_wrap: + title: Memory Efficient Fsdp Wrap + default: false + type: boolean + fsdp_cpu_offload: + title: Fsdp Cpu Offload + default: false + type: boolean + type: object + title: EfficiencyConfig + description: "Configuration for memory and compute efficiency optimizations.\n\n:param enable_activation_checkpointing: (Optional) Whether to use activation checkpointing to reduce memory usage\n:param enable_activation_offloading: (Optional) Whether to offload activations to CPU to save GPU memory\n:param memory_efficient_fsdp_wrap: (Optional) Whether to use memory-efficient FSDP wrapping\n:param fsdp_cpu_offload: (Optional) Whether to offload FSDP parameters to CPU" + Errors: + properties: + data: + title: Data + items: + $ref: '#/components/schemas/BatchError' + type: array + object: + title: Object + type: string + additionalProperties: true + type: object + title: Errors + EvaluateResponse: + properties: + generations: + items: + additionalProperties: true + type: object + type: array + title: Generations + scores: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' type: object - OpenAIResponseInputToolWebSearch: - description: >- - Web search tool configuration for OpenAI response inputs. - - - :param type: Web search tool type variant to use - - :param search_context_size: (Optional) Size of search context, must be - "low", "medium", or "high" - properties: - type: - anyOf: - - const: web_search - type: string - - const: web_search_preview - type: string - - const: web_search_preview_2025_03_11 - type: string - default: web_search - title: Type - search_context_size: - anyOf: - - pattern: ^low|medium|high$ - type: string - - type: 'null' - default: medium - title: Search Context Size - title: OpenAIResponseInputToolWebSearch + title: Scores + type: object + required: + - generations + - scores + title: EvaluateResponse + description: "The response from an evaluation.\n\n:param generations: The generations from the evaluation.\n:param scores: The scores from the evaluation." + GrammarResponseFormat: + properties: + type: + type: string + const: grammar + title: Type + default: grammar + bnf: + additionalProperties: true type: object - OpenAIResponseMCPApprovalRequest: - description: >- - A request for human approval of a tool invocation. - properties: - arguments: - title: Arguments - type: string - id: - title: Id - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - type: - const: mcp_approval_request - default: mcp_approval_request - title: Type - type: string - required: - - arguments - - id - - name - - server_label - title: OpenAIResponseMCPApprovalRequest + title: Bnf + type: object + required: + - bnf + title: GrammarResponseFormat + description: "Configuration for grammar-guided response generation.\n\n:param type: Must be \"grammar\" to identify this format type\n:param bnf: The BNF grammar specification the response should conform to" + GreedySamplingStrategy: + properties: + type: + type: string + const: greedy + title: Type + default: greedy + type: object + title: GreedySamplingStrategy + description: "Greedy sampling strategy that selects the highest probability token at each step.\n\n:param type: Must be \"greedy\" to identify this sampling strategy" + HealthInfo: + properties: + status: + $ref: '#/components/schemas/HealthStatus' + type: object + required: + - status + title: HealthInfo + description: "Health status information for the service.\n\n:param status: Current health status of the service" + HealthStatus: + type: string + enum: + - OK + - Error + - Not Implemented + title: HealthStatus + ImageContentItem-Input: + properties: + type: + type: string + const: image + title: Type + default: image + image: + $ref: '#/components/schemas/_URLOrData' + type: object + required: + - image + title: ImageContentItem + description: "A image content item\n\n:param type: Discriminator type of the content item. Always \"image\"\n:param image: Image as a base64 encoded string or an URL" + ImageContentItem-Output: + properties: + type: + type: string + const: image + title: Type + default: image + image: + $ref: '#/components/schemas/_URLOrData' + type: object + required: + - image + title: ImageContentItem + description: "A image content item\n\n:param type: Discriminator type of the content item. Always \"image\"\n:param image: Image as a base64 encoded string or an URL" + InferenceStep-Output: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + started_at: + title: Started At + type: string + format: date-time + completed_at: + title: Completed At + type: string + format: date-time + step_type: + type: string + const: inference + title: Step Type + default: inference + model_response: + $ref: '#/components/schemas/CompletionMessage-Output' + type: object + required: + - turn_id + - step_id + - model_response + title: InferenceStep + description: "An inference step in an agent turn.\n\n:param model_response: The response from the LLM." + InputTokensDetails: + properties: + cached_tokens: + type: integer + title: Cached Tokens + additionalProperties: true + type: object + required: + - cached_tokens + title: InputTokensDetails + Job: + properties: + job_id: + type: string + title: Job Id + status: + $ref: '#/components/schemas/JobStatus' + type: object + required: + - job_id + - status + title: Job + description: "A job execution instance with status tracking.\n\n:param job_id: Unique identifier for the job\n:param status: Current execution status of the job" + JobStatus: + type: string + enum: + - completed + - in_progress + - failed + - scheduled + - cancelled + title: JobStatus + description: "Status of a job execution.\n:cvar completed: Job has finished successfully\n:cvar in_progress: Job is currently running\n:cvar failed: Job has failed during execution\n:cvar scheduled: Job is scheduled but not yet started\n:cvar cancelled: Job was cancelled before completion" + JsonSchemaResponseFormat: + properties: + type: + type: string + const: json_schema + title: Type + default: json_schema + json_schema: + additionalProperties: true type: object - OpenAIResponseMessage: - description: >- - Corresponds to the various Message types in the Responses API. - - They are all under one type because the Responses API gives them all - - the same "type" value, and there is no way to tell them apart in certain - - scenarios. - properties: - content: - anyOf: - - type: string - - items: - discriminator: - mapping: - input_image: >- - #/$defs/OpenAIResponseInputMessageContentImage - input_text: >- - #/$defs/OpenAIResponseInputMessageContentText - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentText - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentImage - type: array - - items: - discriminator: - mapping: - output_text: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - refusal: '#/$defs/OpenAIResponseContentPartRefusal' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - - $ref: '#/$defs/OpenAIResponseContentPartRefusal' - type: array - title: Content - role: - anyOf: - - const: system - type: string - - const: developer - type: string - - const: user - type: string - - const: assistant - type: string - title: Role - type: - const: message - default: message - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - content - - role - title: OpenAIResponseMessage + title: Json Schema + type: object + required: + - json_schema + title: JsonSchemaResponseFormat + description: "Configuration for JSON schema-guided response generation.\n\n:param type: Must be \"json_schema\" to identify this format type\n:param json_schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model." + JsonType: + properties: + type: + type: string + const: json + title: Type + default: json + type: object + title: JsonType + description: "Parameter type for JSON values.\n\n:param type: Discriminator type. Always \"json\"" + LLMAsJudgeScoringFnParams: + properties: + type: + type: string + const: llm_as_judge + title: Type + default: llm_as_judge + judge_model: + type: string + title: Judge Model + prompt_template: + title: Prompt Template + type: string + judge_score_regexes: + items: + type: string + type: array + title: Judge Score Regexes + description: Regexes to extract the answer from generated response + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row + type: object + required: + - judge_model + title: LLMAsJudgeScoringFnParams + description: "Parameters for LLM-as-judge scoring function configuration.\n:param type: The type of scoring function parameters, always llm_as_judge\n:param judge_model: Identifier of the LLM model to use as a judge for scoring\n:param prompt_template: (Optional) Custom prompt template for the judge model\n:param judge_score_regexes: Regexes to extract the answer from generated response\n:param aggregation_functions: Aggregation functions to apply to the scores of each row" + LLMRAGQueryGeneratorConfig: + properties: + type: + type: string + const: llm + title: Type + default: llm + model: + type: string + title: Model + template: + type: string + title: Template + type: object + required: + - model + - template + title: LLMRAGQueryGeneratorConfig + description: "Configuration for the LLM-based RAG query generator.\n\n:param type: Type of query generator, always 'llm'\n:param model: Name of the language model to use for query generation\n:param template: Template string for formatting the query generation prompt" + ListBenchmarksResponse: + properties: + data: + items: + $ref: '#/components/schemas/Benchmark' + type: array + title: Data + type: object + required: + - data + title: ListBenchmarksResponse + ListDatasetsResponse: + properties: + data: + items: + $ref: '#/components/schemas/Dataset' + type: array + title: Data + type: object + required: + - data + title: ListDatasetsResponse + description: "Response from listing datasets.\n\n:param data: List of datasets" + ListModelsResponse: + properties: + data: + items: + $ref: '#/components/schemas/Model' + type: array + title: Data + type: object + required: + - data + title: ListModelsResponse + ListPostTrainingJobsResponse: + properties: + data: + items: + $ref: '#/components/schemas/PostTrainingJob' + type: array + title: Data + type: object + required: + - data + title: ListPostTrainingJobsResponse + ListPromptsResponse: + properties: + data: + items: + $ref: '#/components/schemas/Prompt' + type: array + title: Data + type: object + required: + - data + title: ListPromptsResponse + description: Response model to list prompts. + ListProvidersResponse: + properties: + data: + items: + $ref: '#/components/schemas/ProviderInfo' + type: array + title: Data + type: object + required: + - data + title: ListProvidersResponse + description: "Response containing a list of all available providers.\n\n:param data: List of provider information objects" + ListRoutesResponse: + properties: + data: + items: + $ref: '#/components/schemas/RouteInfo' + type: array + title: Data + type: object + required: + - data + title: ListRoutesResponse + description: "Response containing a list of all available API routes.\n\n:param data: List of available route information objects" + ListScoringFunctionsResponse: + properties: + data: + items: + $ref: '#/components/schemas/ScoringFn-Output' + type: array + title: Data + type: object + required: + - data + title: ListScoringFunctionsResponse + ListShieldsResponse: + properties: + data: + items: + $ref: '#/components/schemas/Shield' + type: array + title: Data + type: object + required: + - data + title: ListShieldsResponse + ListToolGroupsResponse: + properties: + data: + items: + $ref: '#/components/schemas/ToolGroup' + type: array + title: Data + type: object + required: + - data + title: ListToolGroupsResponse + description: "Response containing a list of tool groups.\n\n:param data: List of tool groups" + MCPListToolsTool: + properties: + input_schema: + additionalProperties: true type: object - "OpenAIResponseOutputMessageContentOutputText": - properties: - text: - title: Text - type: string - type: - const: output_text - default: output_text - title: Type - type: string - annotations: - items: - discriminator: - mapping: - container_file_citation: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - file_citation: >- - #/$defs/OpenAIResponseAnnotationFileCitation - file_path: '#/$defs/OpenAIResponseAnnotationFilePath' - url_citation: '#/$defs/OpenAIResponseAnnotationCitation' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseAnnotationFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationCitation' - - $ref: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' - title: Annotations - type: array - required: - - text - title: >- - OpenAIResponseOutputMessageContentOutputText + title: Input Schema + name: + type: string + title: Name + description: + title: Description + type: string + type: object + required: + - input_schema + - name + title: MCPListToolsTool + description: "Tool definition returned by MCP list tools operation.\n\n:param input_schema: JSON schema defining the tool's input parameters\n:param name: Name of the tool\n:param description: (Optional) Description of what the tool does" + MemoryRetrievalStep-Output: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + started_at: + title: Started At + type: string + format: date-time + completed_at: + title: Completed At + type: string + format: date-time + step_type: + type: string + const: memory_retrieval + title: Step Type + default: memory_retrieval + vector_store_ids: + type: string + title: Vector Store Ids + inserted_context: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Inserted Context + type: object + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + description: "A memory retrieval step in an agent turn.\n\n:param vector_store_ids: The IDs of the vector databases to retrieve context from.\n:param inserted_context: The context retrieved from the vector databases." + Model: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + title: Provider Resource Id + description: Unique identifier for this resource in the provider + type: string + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: model + title: Type + default: model + metadata: + additionalProperties: true type: object - "OpenAIResponseOutputMessageFileSearchToolCall": - description: >- - File search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param queries: List of search queries executed - - :param status: Current status of the file search operation - - :param type: Tool call type identifier, always "file_search_call" - - :param results: (Optional) Search results returned by the file search - operation - properties: - id: - title: Id - type: string - queries: - items: - type: string - title: Queries - type: array - status: - title: Status - type: string - type: - const: file_search_call - default: file_search_call - title: Type - type: string - results: - anyOf: - - items: - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults - type: array - - type: 'null' - title: Results - required: - - id - - queries - - status - title: >- - OpenAIResponseOutputMessageFileSearchToolCall + title: Metadata + description: Any additional metadata for this model + model_type: + $ref: '#/components/schemas/ModelType' + default: llm + type: object + required: + - identifier + - provider_id + title: Model + description: "A model resource representing an AI model registered in Llama Stack.\n\n:param type: The resource type, always 'model' for model resources\n:param model_type: The type of model (LLM or embedding model)\n:param metadata: Any additional metadata for this model\n:param identifier: Unique identifier for this resource in llama stack\n:param provider_resource_id: Unique identifier for this resource in the provider\n:param provider_id: ID of the provider that owns this resource" + ModelCandidate: + properties: + type: + type: string + const: model + title: Type + default: model + model: + type: string + title: Model + sampling_params: + $ref: '#/components/schemas/SamplingParams' + system_message: + $ref: '#/components/schemas/SystemMessage' + type: object + required: + - model + - sampling_params + title: ModelCandidate + description: "A model candidate for evaluation.\n\n:param model: The model ID to evaluate.\n:param sampling_params: The sampling parameters for the model.\n:param system_message: (Optional) The system message providing instructions or context to the model." + ModelType: + type: string + enum: + - llm + - embedding + - rerank + title: ModelType + description: "Enumeration of supported model types in Llama Stack.\n:cvar llm: Large language model for text generation and completion\n:cvar embedding: Embedding model for converting text to vector representations\n:cvar rerank: Reranking model for reordering documents based on their relevance to a query" + ModerationObject: + properties: + id: + type: string + title: Id + model: + type: string + title: Model + results: + items: + $ref: '#/components/schemas/ModerationObjectResults' + type: array + title: Results + type: object + required: + - id + - model + - results + title: ModerationObject + description: "A moderation object.\n:param id: The unique identifier for the moderation request.\n:param model: The model used to generate the moderation results.\n:param results: A list of moderation objects" + ModerationObjectResults: + properties: + flagged: + type: boolean + title: Flagged + categories: + title: Categories + additionalProperties: + type: boolean type: object - "OpenAIResponseOutputMessageFileSearchToolCallResults": - description: >- - Search results returned by the file search operation. - - - :param attributes: (Optional) Key-value attributes associated with the - file - - :param file_id: Unique identifier of the file containing the result - - :param filename: Name of the file containing the result - - :param score: Relevance score for this search result (between 0 and 1) - - :param text: Text content of the search result - properties: - attributes: - additionalProperties: true - title: Attributes - type: object - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - score: - title: Score - type: number - text: - title: Text + category_applied_input_types: + title: Category Applied Input Types + additionalProperties: + items: type: string - required: - - attributes - - file_id - - filename - - score - - text - title: >- - OpenAIResponseOutputMessageFileSearchToolCallResults + type: array type: object - "OpenAIResponseOutputMessageFunctionToolCall": - description: >- - Function tool call output message for OpenAI responses. - - - :param call_id: Unique identifier for the function call - - :param name: Name of the function being called - - :param arguments: JSON string containing the function arguments - - :param type: Tool call type identifier, always "function_call" - - :param id: (Optional) Additional identifier for the tool call - - :param status: (Optional) Current status of the function call execution - properties: - call_id: - title: Call Id - type: string - name: - title: Name - type: string - arguments: - title: Arguments - type: string - type: - const: function_call - default: function_call - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - name - - arguments - title: >- - OpenAIResponseOutputMessageFunctionToolCall + category_scores: + title: Category Scores + additionalProperties: + type: number type: object - OpenAIResponseOutputMessageMCPCall: - description: >- - Model Context Protocol (MCP) call output message for OpenAI responses. - - - :param id: Unique identifier for this MCP call - - :param type: Tool call type identifier, always "mcp_call" - - :param arguments: JSON string containing the MCP call arguments - - :param name: Name of the MCP method being called - - :param server_label: Label identifying the MCP server handling the call - - :param error: (Optional) Error message if the MCP call failed - - :param output: (Optional) Output result from the successful MCP call - properties: - id: - title: Id - type: string - type: - const: mcp_call - default: mcp_call - title: Type - type: string - arguments: - title: Arguments - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - error: - anyOf: - - type: string - - type: 'null' - title: Error - output: - anyOf: - - type: string - - type: 'null' - title: Output - required: - - id - - arguments - - name - - server_label - title: OpenAIResponseOutputMessageMCPCall + user_message: + title: User Message + type: string + metadata: + additionalProperties: true type: object - OpenAIResponseOutputMessageMCPListTools: - description: >- - MCP list tools output message containing available tools from an MCP server. - - - :param id: Unique identifier for this MCP list tools operation - - :param type: Tool call type identifier, always "mcp_list_tools" - - :param server_label: Label identifying the MCP server providing the tools - - :param tools: List of available tools provided by the MCP server - properties: - id: - title: Id - type: string - type: - const: mcp_list_tools - default: mcp_list_tools - title: Type - type: string - server_label: - title: Server Label - type: string - tools: - items: - $ref: '#/$defs/MCPListToolsTool' - title: Tools - type: array - required: - - id - - server_label - - tools - title: OpenAIResponseOutputMessageMCPListTools + title: Metadata + type: object + required: + - flagged + title: ModerationObjectResults + description: "A moderation object.\n:param flagged: Whether any of the below categories are flagged.\n:param categories: A list of the categories, and whether they are flagged or not.\n:param category_applied_input_types: A list of the categories along with the input type(s) that the score applies to.\n:param category_scores: A list of the categories along with their scores as predicted by model." + NumberType: + properties: + type: + type: string + const: number + title: Type + default: number + type: object + title: NumberType + description: "Parameter type for numeric values.\n\n:param type: Discriminator type. Always \"number\"" + ObjectType: + properties: + type: + type: string + const: object + title: Type + default: object + type: object + title: ObjectType + description: "Parameter type for object values.\n\n:param type: Discriminator type. Always \"object\"" + OpenAIAssistantMessageParam-Input: + properties: + role: + type: string + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + title: Name + type: string + tool_calls: + title: Tool Calls + items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + type: object + title: OpenAIAssistantMessageParam + description: "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param name: (Optional) The name of the assistant message participant.\n:param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object." + OpenAIAssistantMessageParam-Output: + properties: + role: + type: string + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + title: Name + type: string + tool_calls: + title: Tool Calls + items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + type: object + title: OpenAIAssistantMessageParam + description: "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param name: (Optional) The name of the assistant message participant.\n:param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object." + OpenAIChatCompletion: + properties: + id: + type: string + title: Id + choices: + items: + $ref: '#/components/schemas/OpenAIChoice-Output' + type: array + title: Choices + object: + type: string + const: chat.completion + title: Object + default: chat.completion + created: + type: integer + title: Created + model: + type: string + title: Model + usage: + $ref: '#/components/schemas/OpenAIChatCompletionUsage' + type: object + required: + - id + - choices + - created + - model + title: OpenAIChatCompletion + description: "Response from an OpenAI-compatible chat completion request.\n\n:param id: The ID of the chat completion\n:param choices: List of choices\n:param object: The object type, which will be \"chat.completion\"\n:param created: The Unix timestamp in seconds when the chat completion was created\n:param model: The model that was used to generate the chat completion\n:param usage: Token usage information for the completion" + OpenAIChatCompletionContentPartImageParam: + properties: + type: + type: string + const: image_url + title: Type + default: image_url + image_url: + $ref: '#/components/schemas/OpenAIImageURL' + type: object + required: + - image_url + title: OpenAIChatCompletionContentPartImageParam + description: "Image content part for OpenAI-compatible chat completion messages.\n\n:param type: Must be \"image_url\" to identify this as image content\n:param image_url: Image URL specification and processing details" + OpenAIChatCompletionContentPartTextParam: + properties: + type: + type: string + const: text + title: Type + default: text + text: + type: string + title: Text + type: object + required: + - text + title: OpenAIChatCompletionContentPartTextParam + description: "Text content part for OpenAI-compatible chat completion messages.\n\n:param type: Must be \"text\" to identify this as text content\n:param text: The text content of the message" + OpenAIChatCompletionRequestWithExtraBody: + properties: + model: + type: string + title: Model + messages: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Input' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Input' + type: array + minItems: 1 + title: Messages + frequency_penalty: + title: Frequency Penalty + type: number + function_call: + anyOf: + - type: string + - additionalProperties: true + type: object + title: Function Call + functions: + title: Functions + items: + additionalProperties: true + type: object + type: array + logit_bias: + title: Logit Bias + additionalProperties: + type: number type: object - "OpenAIResponseOutputMessageWebSearchToolCall": - description: >- - Web search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param status: Current status of the web search operation - - :param type: Tool call type identifier, always "web_search_call" - properties: - id: - title: Id - type: string - status: - title: Status - type: string - type: - const: web_search_call - default: web_search_call - title: Type + logprobs: + title: Logprobs + type: boolean + max_completion_tokens: + title: Max Completion Tokens + type: integer + max_tokens: + title: Max Tokens + type: integer + n: + title: N + type: integer + parallel_tool_calls: + title: Parallel Tool Calls + type: boolean + presence_penalty: + title: Presence Penalty + type: number + response_format: + title: Response Format + oneOf: + - $ref: '#/components/schemas/OpenAIResponseFormatText' + - $ref: '#/components/schemas/OpenAIResponseFormatJSONSchema' + - $ref: '#/components/schemas/OpenAIResponseFormatJSONObject' + discriminator: + propertyName: type + mapping: + json_object: '#/components/schemas/OpenAIResponseFormatJSONObject' + json_schema: '#/components/schemas/OpenAIResponseFormatJSONSchema' + text: '#/components/schemas/OpenAIResponseFormatText' + seed: + title: Seed + type: integer + stop: + anyOf: + - type: string + - items: type: string - required: - - id - - status - title: >- - OpenAIResponseOutputMessageWebSearchToolCall - type: object - OpenAIResponseText: - description: >- - Text response configuration for OpenAI responses. - - - :param format: (Optional) Text format configuration specifying output - format requirements - properties: - format: - anyOf: - - $ref: '#/$defs/OpenAIResponseTextFormat' - - type: 'null' - title: OpenAIResponseText - type: object - OpenAIResponseTextFormat: - description: >- - Configuration for Responses API text format. - - - :param type: Must be "text", "json_schema", or "json_object" to identify - the format type - - :param name: The name of the response format. Only used for json_schema. - - :param schema: The JSON schema the response should conform to. In a Python - SDK, this is often a `pydantic` model. Only used for json_schema. - - :param description: (Optional) A description of the response format. Only - used for json_schema. - - :param strict: (Optional) Whether to strictly enforce the JSON schema. - If true, the response must match the schema exactly. Only used for json_schema. - properties: - type: - anyOf: - - const: text - type: string - - const: json_schema - type: string - - const: json_object - type: string - title: Type - name: - anyOf: - - type: string - - type: 'null' - title: Name - schema: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Schema - description: - anyOf: - - type: string - - type: 'null' - title: Description - strict: - anyOf: - - type: boolean - - type: 'null' - title: Strict - title: OpenAIResponseTextFormat + type: array + title: Stop + stream: + title: Stream + type: boolean + stream_options: + title: Stream Options + additionalProperties: true type: object - OpenAIResponseToolMCP: - description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response object. - - - :param type: Tool type identifier, always "mcp" - - :param server_label: Label to identify this MCP server - - :param allowed_tools: (Optional) Restriction on which tools can be used - from this server - properties: - type: - const: mcp - default: mcp - title: Type + temperature: + title: Temperature + type: number + tool_choice: + anyOf: + - type: string + - additionalProperties: true + type: object + title: Tool Choice + tools: + title: Tools + items: + additionalProperties: true + type: object + type: array + top_logprobs: + title: Top Logprobs + type: integer + top_p: + title: Top P + type: number + user: + title: User + type: string + additionalProperties: true + type: object + required: + - model + - messages + title: OpenAIChatCompletionRequestWithExtraBody + description: "Request parameters for OpenAI-compatible chat completion endpoint.\n\n:param model: The identifier of the model to use. The model must be registered with Llama Stack and available via the /models endpoint.\n:param messages: List of messages in the conversation.\n:param frequency_penalty: (Optional) The penalty for repeated tokens.\n:param function_call: (Optional) The function call to use.\n:param functions: (Optional) List of functions to use.\n:param logit_bias: (Optional) The logit bias to use.\n:param logprobs: (Optional) The log probabilities to use.\n:param max_completion_tokens: (Optional) The maximum number of tokens to generate.\n:param max_tokens: (Optional) The maximum number of tokens to generate.\n:param n: (Optional) The number of completions to generate.\n:param parallel_tool_calls: (Optional) Whether to parallelize tool calls.\n:param presence_penalty: (Optional) The penalty for repeated tokens.\n:param response_format: (Optional) The response format to use.\n:param seed: (Optional) The seed to use.\n:param stop: (Optional) The stop tokens to use.\n:param stream: (Optional) Whether to stream the response.\n:param stream_options: (Optional) The stream options to use.\n:param temperature: (Optional) The temperature to use.\n:param tool_choice: (Optional) The tool choice to use.\n:param tools: (Optional) The tools to use.\n:param top_logprobs: (Optional) The top log probabilities to use.\n:param top_p: (Optional) The top p to use.\n:param user: (Optional) The user to use." + OpenAIChatCompletionToolCall: + properties: + index: + title: Index + type: integer + id: + title: Id + type: string + type: + type: string + const: function + title: Type + default: function + function: + $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' + type: object + title: OpenAIChatCompletionToolCall + description: "Tool call specification for OpenAI-compatible chat completion responses.\n\n:param index: (Optional) Index of the tool call in the list\n:param id: (Optional) Unique identifier for the tool call\n:param type: Must be \"function\" to identify this as a function call\n:param function: (Optional) Function call details" + OpenAIChatCompletionToolCallFunction: + properties: + name: + title: Name + type: string + arguments: + title: Arguments + type: string + type: object + title: OpenAIChatCompletionToolCallFunction + description: "Function call details for OpenAI-compatible tool calls.\n\n:param name: (Optional) Name of the function to call\n:param arguments: (Optional) Arguments to pass to the function as a JSON string" + OpenAIChatCompletionUsage: + properties: + prompt_tokens: + type: integer + title: Prompt Tokens + completion_tokens: + type: integer + title: Completion Tokens + total_tokens: + type: integer + title: Total Tokens + prompt_tokens_details: + $ref: '#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails' + completion_tokens_details: + $ref: '#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails' + type: object + required: + - prompt_tokens + - completion_tokens + - total_tokens + title: OpenAIChatCompletionUsage + description: "Usage information for OpenAI chat completion.\n\n:param prompt_tokens: Number of tokens in the prompt\n:param completion_tokens: Number of tokens in the completion\n:param total_tokens: Total tokens used (prompt + completion)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + OpenAIChatCompletionUsageCompletionTokensDetails: + properties: + reasoning_tokens: + title: Reasoning Tokens + type: integer + type: object + title: OpenAIChatCompletionUsageCompletionTokensDetails + description: "Token details for output tokens in OpenAI chat completion usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + OpenAIChatCompletionUsagePromptTokensDetails: + properties: + cached_tokens: + title: Cached Tokens + type: integer + type: object + title: OpenAIChatCompletionUsagePromptTokensDetails + description: "Token details for prompt tokens in OpenAI chat completion usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + OpenAIChoice-Output: + properties: + message: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Output' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Output' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Message + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Output' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Output' + finish_reason: + type: string + title: Finish Reason + index: + type: integer + title: Index + logprobs: + $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + type: object + required: + - message + - finish_reason + - index + title: OpenAIChoice + description: "A choice from an OpenAI-compatible chat completion response.\n\n:param message: The message from the model\n:param finish_reason: The reason the model stopped generating\n:param index: The index of the choice\n:param logprobs: (Optional) The log probabilities for the tokens in the message" + OpenAIChoiceLogprobs-Output: + properties: + content: + title: Content + items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + refusal: + title: Refusal + items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + type: object + title: OpenAIChoiceLogprobs + description: "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response.\n\n:param content: (Optional) The log probabilities for the tokens in the message\n:param refusal: (Optional) The log probabilities for the tokens in the message" + OpenAICompletion: + properties: + id: + type: string + title: Id + choices: + items: + $ref: '#/components/schemas/OpenAICompletionChoice-Output' + type: array + title: Choices + created: + type: integer + title: Created + model: + type: string + title: Model + object: + type: string + const: text_completion + title: Object + default: text_completion + type: object + required: + - id + - choices + - created + - model + title: OpenAICompletion + description: "Response from an OpenAI-compatible completion request.\n\n:id: The ID of the completion\n:choices: List of choices\n:created: The Unix timestamp in seconds when the completion was created\n:model: The model that was used to generate the completion\n:object: The object type, which will be \"text_completion\"" + OpenAICompletionChoice-Output: + properties: + finish_reason: + type: string + title: Finish Reason + text: + type: string + title: Text + index: + type: integer + title: Index + logprobs: + $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + type: object + required: + - finish_reason + - text + - index + title: OpenAICompletionChoice + description: "A choice from an OpenAI-compatible completion response.\n\n:finish_reason: The reason the model stopped generating\n:text: The text of the choice\n:index: The index of the choice\n:logprobs: (Optional) The log probabilities for the tokens in the choice" + OpenAICompletionRequestWithExtraBody: + properties: + model: + type: string + title: Model + prompt: + anyOf: + - type: string + - items: type: string - server_label: - title: Server Label + type: array + - items: + type: integer + type: array + - items: + items: + type: integer + type: array + type: array + title: Prompt + best_of: + title: Best Of + type: integer + echo: + title: Echo + type: boolean + frequency_penalty: + title: Frequency Penalty + type: number + logit_bias: + title: Logit Bias + additionalProperties: + type: number + type: object + logprobs: + title: Logprobs + type: boolean + max_tokens: + title: Max Tokens + type: integer + n: + title: N + type: integer + presence_penalty: + title: Presence Penalty + type: number + seed: + title: Seed + type: integer + stop: + anyOf: + - type: string + - items: type: string - allowed_tools: - anyOf: - - items: - type: string - type: array - - $ref: '#/$defs/AllowedToolsFilter' - - type: 'null' - title: Allowed Tools - required: - - server_label - title: OpenAIResponseToolMCP + type: array + title: Stop + stream: + title: Stream + type: boolean + stream_options: + title: Stream Options + additionalProperties: true type: object - OpenAIResponseUsage: - description: >- - Usage information for OpenAI response. - - - :param input_tokens: Number of tokens in the input - - :param output_tokens: Number of tokens in the output - - :param total_tokens: Total tokens used (input + output) - - :param input_tokens_details: Detailed breakdown of input token usage - - :param output_tokens_details: Detailed breakdown of output token usage - properties: - input_tokens: - title: Input Tokens - type: integer - output_tokens: - title: Output Tokens - type: integer - total_tokens: - title: Total Tokens - type: integer - input_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIResponseUsageInputTokensDetails - - type: 'null' - output_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIResponseUsageOutputTokensDetails - - type: 'null' - required: - - input_tokens - - output_tokens - - total_tokens - title: OpenAIResponseUsage + temperature: + title: Temperature + type: number + top_p: + title: Top P + type: number + user: + title: User + type: string + suffix: + title: Suffix + type: string + additionalProperties: true + type: object + required: + - model + - prompt + title: OpenAICompletionRequestWithExtraBody + description: "Request parameters for OpenAI-compatible completion endpoint.\n\n:param model: The identifier of the model to use. The model must be registered with Llama Stack and available via the /models endpoint.\n:param prompt: The prompt to generate a completion for.\n:param best_of: (Optional) The number of completions to generate.\n:param echo: (Optional) Whether to echo the prompt.\n:param frequency_penalty: (Optional) The penalty for repeated tokens.\n:param logit_bias: (Optional) The logit bias to use.\n:param logprobs: (Optional) The log probabilities to use.\n:param max_tokens: (Optional) The maximum number of tokens to generate.\n:param n: (Optional) The number of completions to generate.\n:param presence_penalty: (Optional) The penalty for repeated tokens.\n:param seed: (Optional) The seed to use.\n:param stop: (Optional) The stop tokens to use.\n:param stream: (Optional) Whether to stream the response.\n:param stream_options: (Optional) The stream options to use.\n:param temperature: (Optional) The temperature to use.\n:param top_p: (Optional) The top p to use.\n:param user: (Optional) The user to use.\n:param suffix: (Optional) The suffix that should be appended to the completion." + OpenAICreateVectorStoreFileBatchRequestWithExtraBody: + properties: + file_ids: + items: + type: string + type: array + title: File Ids + attributes: + title: Attributes + additionalProperties: true type: object - OpenAIResponseUsageInputTokensDetails: - description: >- - Token details for input tokens in OpenAI response usage. - - - :param cached_tokens: Number of tokens retrieved from cache - properties: - cached_tokens: - anyOf: - - type: integer - - type: 'null' - title: Cached Tokens - title: OpenAIResponseUsageInputTokensDetails + chunking_strategy: + title: Chunking Strategy + oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + additionalProperties: true + type: object + required: + - file_ids + title: OpenAICreateVectorStoreFileBatchRequestWithExtraBody + description: "Request to create a vector store file batch with extra_body support.\n\n:param file_ids: A list of File IDs that the vector store should use\n:param attributes: (Optional) Key-value attributes to store with the files\n:param chunking_strategy: (Optional) The chunking strategy used to chunk the file(s). Defaults to auto" + OpenAICreateVectorStoreRequestWithExtraBody: + properties: + name: + title: Name + type: string + file_ids: + title: File Ids + items: + type: string + type: array + expires_after: + title: Expires After + additionalProperties: true type: object - OpenAIResponseUsageOutputTokensDetails: - description: >- - Token details for output tokens in OpenAI response usage. - - - :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) - properties: - reasoning_tokens: - anyOf: - - type: integer - - type: 'null' - title: Reasoning Tokens - title: OpenAIResponseUsageOutputTokensDetails + chunking_strategy: + title: Chunking Strategy + additionalProperties: true type: object - SearchRankingOptions: - description: >- - Options for ranking and filtering search results. - - - :param ranker: (Optional) Name of the ranking algorithm to use - - :param score_threshold: (Optional) Minimum relevance score threshold for - results - properties: - ranker: - anyOf: - - type: string - - type: 'null' - title: Ranker - score_threshold: - anyOf: - - type: number - - type: 'null' - default: 0.0 - title: Score Threshold - title: SearchRankingOptions + metadata: + title: Metadata + additionalProperties: true type: object - description: >- - Complete OpenAI response object containing generation results and metadata. - - - :param created_at: Unix timestamp when the response was created - - :param error: (Optional) Error details if the response generation failed - - :param id: Unique identifier for this response - - :param model: Model identifier used for generation - - :param object: Object type identifier, always "response" - - :param output: List of generated output items (messages, tool calls, etc.) - - :param parallel_tool_calls: Whether tool calls can be executed in parallel - - :param previous_response_id: (Optional) ID of the previous response in a conversation - - :param status: Current status of the response generation - - :param temperature: (Optional) Sampling temperature used for generation - - :param text: Text formatting configuration for the response - - :param top_p: (Optional) Nucleus sampling parameter used for generation - - :param tools: (Optional) An array of tools the model may call while generating - a response. - - :param truncation: (Optional) Truncation strategy applied to the response - - :param usage: (Optional) Token usage information for the response - - :param instructions: (Optional) System message inserted into the model's context + additionalProperties: true + type: object + title: OpenAICreateVectorStoreRequestWithExtraBody + description: "Request to create a vector store with extra_body support.\n\n:param name: (Optional) A name for the vector store\n:param file_ids: List of file IDs to include in the vector store\n:param expires_after: (Optional) Expiration policy for the vector store\n:param chunking_strategy: (Optional) Strategy for splitting files into chunks\n:param metadata: Set of key-value pairs that can be attached to the vector store" + OpenAIDeveloperMessageParam: properties: - created_at: - title: Created At + role: + type: string + const: developer + title: Role + default: developer + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + title: Name + type: string + type: object + required: + - content + title: OpenAIDeveloperMessageParam + description: "A message from the developer in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"developer\" to identify this as a developer message\n:param content: The content of the developer message\n:param name: (Optional) The name of the developer message participant." + OpenAIEmbeddingData: + properties: + object: + type: string + const: embedding + title: Object + default: embedding + embedding: + anyOf: + - items: + type: number + type: array + - type: string + title: Embedding + index: type: integer - error: + title: Index + type: object + required: + - embedding + - index + title: OpenAIEmbeddingData + description: "A single embedding data object from an OpenAI-compatible embeddings response.\n\n:param object: The object type, which will be \"embedding\"\n:param embedding: The embedding vector as a list of floats (when encoding_format=\"float\") or as a base64-encoded string (when encoding_format=\"base64\")\n:param index: The index of the embedding in the input list" + OpenAIEmbeddingUsage: + properties: + prompt_tokens: + type: integer + title: Prompt Tokens + total_tokens: + type: integer + title: Total Tokens + type: object + required: + - prompt_tokens + - total_tokens + title: OpenAIEmbeddingUsage + description: "Usage information for an OpenAI-compatible embeddings response.\n\n:param prompt_tokens: The number of tokens in the input\n:param total_tokens: The total number of tokens used" + OpenAIEmbeddingsRequestWithExtraBody: + properties: + model: + type: string + title: Model + input: anyOf: - - $ref: '#/$defs/OpenAIResponseError' - - type: 'null' - id: - title: Id + - type: string + - items: + type: string + type: array + title: Input + encoding_format: + title: Encoding Format + default: float + type: string + dimensions: + title: Dimensions + type: integer + user: + title: User + type: string + additionalProperties: true + type: object + required: + - model + - input + title: OpenAIEmbeddingsRequestWithExtraBody + description: "Request parameters for OpenAI-compatible embeddings endpoint.\n\n:param model: The identifier of the model to use. The model must be an embedding model registered with Llama Stack and available via the /models endpoint.\n:param input: Input text to embed, encoded as a string or array of strings. To embed multiple inputs in a single request, pass an array of strings.\n:param encoding_format: (Optional) The format to return the embeddings in. Can be either \"float\" or \"base64\". Defaults to \"float\".\n:param dimensions: (Optional) The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.\n:param user: (Optional) A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse." + OpenAIEmbeddingsResponse: + properties: + object: type: string + const: list + title: Object + default: list + data: + items: + $ref: '#/components/schemas/OpenAIEmbeddingData' + type: array + title: Data model: + type: string title: Model + usage: + $ref: '#/components/schemas/OpenAIEmbeddingUsage' + type: object + required: + - data + - model + - usage + title: OpenAIEmbeddingsResponse + description: "Response from an OpenAI-compatible embeddings request.\n\n:param object: The object type, which will be \"list\"\n:param data: List of embedding data objects\n:param model: The model that was used to generate the embeddings\n:param usage: Usage information" + OpenAIFile: + properties: + type: type: string + const: file + title: Type + default: file + file: + $ref: '#/components/schemas/OpenAIFileFile' + type: object + required: + - file + title: OpenAIFile + OpenAIFileFile: + properties: + file_data: + title: File Data + type: string + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + type: object + title: OpenAIFileFile + OpenAIFileObject: + properties: object: - const: response - default: response + type: string + const: file title: Object + default: file + id: type: string - output: - items: - discriminator: - mapping: - file_search_call: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - function_call: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - mcp_list_tools: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - message: '#/$defs/OpenAIResponseMessage' - web_search_call: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseMessage' - - $ref: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' - title: Output - type: array - parallel_tool_calls: - default: false - title: Parallel Tool Calls + title: Id + bytes: + type: integer + title: Bytes + created_at: + type: integer + title: Created At + expires_at: + type: integer + title: Expires At + filename: + type: string + title: Filename + purpose: + $ref: '#/components/schemas/OpenAIFilePurpose' + type: object + required: + - id + - bytes + - created_at + - expires_at + - filename + - purpose + title: OpenAIFileObject + description: "OpenAI File object as defined in the OpenAI Files API.\n\n:param object: The object type, which is always \"file\"\n:param id: The file identifier, which can be referenced in the API endpoints\n:param bytes: The size of the file, in bytes\n:param created_at: The Unix timestamp (in seconds) for when the file was created\n:param expires_at: The Unix timestamp (in seconds) for when the file expires\n:param filename: The name of the file\n:param purpose: The intended purpose of the file" + OpenAIFilePurpose: + type: string + enum: + - assistants + - batch + title: OpenAIFilePurpose + description: Valid purpose values for OpenAI Files API. + OpenAIImageURL: + properties: + url: + type: string + title: Url + detail: + title: Detail + type: string + type: object + required: + - url + title: OpenAIImageURL + description: "Image URL specification for OpenAI-compatible chat completion messages.\n\n:param url: URL of the image to include in the message\n:param detail: (Optional) Level of detail for image processing. Can be \"low\", \"high\", or \"auto\"" + OpenAIJSONSchema: + properties: + name: + type: string + title: Name + description: + title: Description + type: string + strict: + title: Strict type: boolean - previous_response_id: + schema: + title: Schema + additionalProperties: true + type: object + type: object + title: OpenAIJSONSchema + description: "JSON schema specification for OpenAI-compatible structured response format.\n\n:param name: Name of the schema\n:param description: (Optional) Description of the schema\n:param strict: (Optional) Whether to enforce strict adherence to the schema\n:param schema: (Optional) The JSON schema definition" + OpenAIResponseAnnotationCitation: + properties: + type: type: string - description: >- - (Optional) ID of the previous response in a conversation - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - description: >- - (Optional) Reference to a prompt template and its variables. - status: - title: Status + const: url_citation + title: Type + default: url_citation + end_index: + type: integer + title: End Index + start_index: + type: integer + title: Start Index + title: type: string - temperature: - anyOf: - - type: number - - type: 'null' - title: Temperature - text: - $ref: '#/$defs/OpenAIResponseText' - default: - format: - type: text - top_p: - anyOf: - - type: number - - type: 'null' - title: Top P - tools: - anyOf: - - items: - discriminator: - mapping: - file_search: >- - #/$defs/OpenAIResponseInputToolFileSearch - function: '#/$defs/OpenAIResponseInputToolFunction' - mcp: '#/$defs/OpenAIResponseToolMCP' - web_search: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseInputToolWebSearch' - - $ref: >- - #/$defs/OpenAIResponseInputToolFileSearch - - $ref: '#/$defs/OpenAIResponseInputToolFunction' - - $ref: '#/$defs/OpenAIResponseToolMCP' - type: array - - type: 'null' - title: Tools - truncation: - anyOf: - - type: string - - type: 'null' - title: Truncation - usage: - anyOf: - - $ref: '#/$defs/OpenAIResponseUsage' - - type: 'null' - instructions: - anyOf: - - type: string - - type: 'null' - title: Instructions + title: Title + url: + type: string + title: Url + type: object required: - - created_at - - id - - model - - output - - status - title: OpenAIResponseObject + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + type: string + const: container_file_citation + title: Type + default: container_file_citation + container_id: + type: string + title: Container Id + end_index: + type: integer + title: End Index + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + start_index: + type: integer + title: Start Index + type: object + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + OpenAIResponseAnnotationFileCitation: + properties: + type: + type: string + const: file_citation + title: Type + default: file_citation + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + index: + type: integer + title: Index + type: object + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + OpenAIResponseAnnotationFilePath: + properties: + type: + type: string + const: file_path + title: Type + default: file_path + file_id: + type: string + title: File Id + index: + type: integer + title: Index + type: object + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + OpenAIResponseContentPartRefusal: + properties: + type: + type: string + const: refusal + title: Type + default: refusal + refusal: + type: string + title: Refusal + type: object + required: + - refusal + title: OpenAIResponseContentPartRefusal + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + OpenAIResponseError: + properties: + code: + type: string + title: Code + message: + type: string + title: Message + type: object + required: + - code + - message + title: OpenAIResponseError + description: "Error details for failed OpenAI response requests.\n\n:param code: Error code identifying the type of failure\n:param message: Human-readable error message describing the failure" + OpenAIResponseFormatJSONObject: + properties: + type: + type: string + const: json_object + title: Type + default: json_object + type: object + title: OpenAIResponseFormatJSONObject + description: "JSON object response format for OpenAI-compatible chat completion requests.\n\n:param type: Must be \"json_object\" to indicate generic JSON object response format" + OpenAIResponseFormatJSONSchema: + properties: + type: + type: string + const: json_schema + title: Type + default: json_schema + json_schema: + $ref: '#/components/schemas/OpenAIJSONSchema' type: object - AsyncIterator: + required: + - json_schema + title: OpenAIResponseFormatJSONSchema + description: "JSON schema response format for OpenAI-compatible chat completion requests.\n\n:param type: Must be \"json_schema\" to indicate structured JSON response format\n:param json_schema: The JSON schema specification for the response" + OpenAIResponseFormatText: + properties: + type: + type: string + const: text + title: Type + default: text type: object - OpenAIDeleteResponseObject: - description: >- - Response object confirming deletion of an OpenAI response. - - - :param id: Unique identifier of the deleted response - - :param object: Object type identifier, always "response" - - :param deleted: Deletion confirmation flag, always True + title: OpenAIResponseFormatText + description: "Text response format for OpenAI-compatible chat completion requests.\n\n:param type: Must be \"text\" to indicate plain text response format" + OpenAIResponseInputFunctionToolCallOutput: properties: + call_id: + type: string + title: Call Id + output: + type: string + title: Output + type: + type: string + const: function_call_output + title: Type + default: function_call_output id: title: Id type: string - object: - const: response - default: response - title: Object + status: + title: Status type: string - deleted: - default: true - title: Deleted - type: boolean - required: - - id - title: OpenAIDeleteResponseObject type: object - ListOpenAIResponseInputItem: - $defs: - MCPListToolsTool: - description: >- - Tool definition returned by MCP list tools operation. - - - :param input_schema: JSON schema defining the tool's input parameters - - :param name: Name of the tool - - :param description: (Optional) Description of what the tool does - properties: - input_schema: - additionalProperties: true - title: Input Schema - type: object - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - required: - - input_schema - - name - title: MCPListToolsTool - type: object - OpenAIResponseAnnotationCitation: - description: >- - URL citation annotation for referencing external web resources. - - - :param type: Annotation type identifier, always "url_citation" - - :param end_index: End position of the citation span in the content - - :param start_index: Start position of the citation span in the content - - :param title: Title of the referenced web resource - - :param url: URL of the referenced web resource - properties: - type: - const: url_citation - default: url_citation - title: Type - type: string - end_index: - title: End Index - type: integer - start_index: - title: Start Index - type: integer - title: - title: Title - type: string - url: - title: Url - type: string - required: - - end_index - - start_index - - title - - url - title: OpenAIResponseAnnotationCitation - type: object - "OpenAIResponseAnnotationContainerFileCitation": - properties: - type: - const: container_file_citation - default: container_file_citation - title: Type - type: string - container_id: - title: Container Id - type: string - end_index: - title: End Index - type: integer - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - start_index: - title: Start Index - type: integer - required: - - container_id - - end_index - - file_id - - filename - - start_index - title: >- - OpenAIResponseAnnotationContainerFileCitation - type: object - OpenAIResponseAnnotationFileCitation: - description: >- - File citation annotation for referencing specific files in response content. - - - :param type: Annotation type identifier, always "file_citation" - - :param file_id: Unique identifier of the referenced file - - :param filename: Name of the referenced file - - :param index: Position index of the citation within the content - properties: - type: - const: file_citation - default: file_citation - title: Type - type: string - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - index: - title: Index - type: integer - required: - - file_id - - filename - - index - title: OpenAIResponseAnnotationFileCitation - type: object - OpenAIResponseAnnotationFilePath: - properties: - type: - const: file_path - default: file_path - title: Type - type: string - file_id: - title: File Id - type: string - index: - title: Index - type: integer - required: - - file_id - - index - title: OpenAIResponseAnnotationFilePath - type: object - OpenAIResponseContentPartRefusal: - description: >- - Refusal content within a streamed response part. - - - :param type: Content part type identifier, always "refusal" - - :param refusal: Refusal text supplied by the model - properties: - type: - const: refusal - default: refusal - title: Type - type: string - refusal: - title: Refusal - type: string - required: - - refusal - title: OpenAIResponseContentPartRefusal - type: object - "OpenAIResponseInputFunctionToolCallOutput": - description: >- - This represents the output of a function call that gets passed back to - the model. - properties: - call_id: - title: Call Id - type: string - output: - title: Output - type: string - type: - const: function_call_output - default: function_call_output - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - output - title: >- - OpenAIResponseInputFunctionToolCallOutput + required: + - call_id + - output + title: OpenAIResponseInputFunctionToolCallOutput + description: This represents the output of a function call that gets passed back to the model. + OpenAIResponseInputMessageContentFile: + properties: + type: + type: string + const: input_file + title: Type + default: input_file + file_data: + title: File Data + type: string + file_id: + title: File Id + type: string + file_url: + title: File Url + type: string + filename: + title: Filename + type: string + type: object + title: OpenAIResponseInputMessageContentFile + description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + OpenAIResponseInputMessageContentImage: + properties: + detail: + anyOf: + - type: string + const: low + - type: string + const: high + - type: string + const: auto + title: Detail + default: auto + type: + type: string + const: input_image + title: Type + default: input_image + file_id: + title: File Id + type: string + image_url: + title: Image Url + type: string + type: object + title: OpenAIResponseInputMessageContentImage + description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + OpenAIResponseInputMessageContentText: + properties: + text: + type: string + title: Text + type: + type: string + const: input_text + title: Type + default: input_text + type: object + required: + - text + title: OpenAIResponseInputMessageContentText + description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + OpenAIResponseInputToolFileSearch: + properties: + type: + type: string + const: file_search + title: Type + default: file_search + vector_store_ids: + items: + type: string + type: array + title: Vector Store Ids + filters: + title: Filters + additionalProperties: true type: object - OpenAIResponseInputMessageContentImage: - description: >- - Image content for input messages in OpenAI response format. - - - :param detail: Level of detail for image processing, can be "low", "high", - or "auto" - - :param type: Content type identifier, always "input_image" - - :param image_url: (Optional) URL of the image content - properties: - detail: - anyOf: - - const: low - type: string - - const: high - type: string - - const: auto - type: string - default: auto - title: Detail - type: - const: input_image - default: input_image - title: Type - type: string - image_url: - anyOf: - - type: string - - type: 'null' - title: Image Url - title: OpenAIResponseInputMessageContentImage + max_num_results: + title: Max Num Results + default: 10 + type: integer + maximum: 50.0 + minimum: 1.0 + ranking_options: + $ref: '#/components/schemas/SearchRankingOptions' + type: object + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + description: "File search tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"file_search\"\n:param vector_store_ids: List of vector store identifiers to search within\n:param filters: (Optional) Additional filters to apply to the search\n:param max_num_results: (Optional) Maximum number of search results to return (1-50)\n:param ranking_options: (Optional) Options for ranking and scoring search results" + OpenAIResponseInputToolFunction: + properties: + type: + type: string + const: function + title: Type + default: function + name: + type: string + title: Name + description: + title: Description + type: string + parameters: + title: Parameters + additionalProperties: true type: object - OpenAIResponseInputMessageContentText: - description: >- - Text content for input messages in OpenAI response format. - - - :param text: The text content of the input message - - :param type: Content type identifier, always "input_text" - properties: - text: - title: Text - type: string - type: - const: input_text - default: input_text - title: Type - type: string - required: - - text - title: OpenAIResponseInputMessageContentText + strict: + title: Strict + type: boolean + type: object + required: + - name + - parameters + title: OpenAIResponseInputToolFunction + description: "Function tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"function\"\n:param name: Name of the function that can be called\n:param description: (Optional) Description of what the function does\n:param parameters: (Optional) JSON schema defining the function's parameters\n:param strict: (Optional) Whether to enforce strict parameter validation" + OpenAIResponseInputToolMCP: + properties: + type: + type: string + const: mcp + title: Type + default: mcp + server_label: + type: string + title: Server Label + server_url: + type: string + title: Server Url + headers: + title: Headers + additionalProperties: true type: object - OpenAIResponseMCPApprovalRequest: - description: >- - A request for human approval of a tool invocation. - properties: - arguments: - title: Arguments - type: string - id: - title: Id - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - type: - const: mcp_approval_request - default: mcp_approval_request - title: Type + require_approval: + anyOf: + - type: string + const: always + - type: string + const: never + - $ref: '#/components/schemas/ApprovalFilter' + title: Require Approval + default: never + allowed_tools: + anyOf: + - items: type: string - required: - - arguments - - id - - name - - server_label - title: OpenAIResponseMCPApprovalRequest + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + title: Allowed Tools + type: object + required: + - server_label + - server_url + title: OpenAIResponseInputToolMCP + description: "Model Context Protocol (MCP) tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param server_url: URL endpoint of the MCP server\n:param headers: (Optional) HTTP headers to include when connecting to the server\n:param require_approval: Approval requirement for tool calls (\"always\", \"never\", or filter)\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + OpenAIResponseInputToolWebSearch: + properties: + type: + anyOf: + - type: string + const: web_search + - type: string + const: web_search_preview + - type: string + const: web_search_preview_2025_03_11 + title: Type + default: web_search + search_context_size: + title: Search Context Size + default: medium + type: string + pattern: ^low|medium|high$ + type: object + title: OpenAIResponseInputToolWebSearch + description: "Web search tool configuration for OpenAI response inputs.\n\n:param type: Web search tool type variant to use\n:param search_context_size: (Optional) Size of search context, must be \"low\", \"medium\", or \"high\"" + OpenAIResponseMCPApprovalRequest: + properties: + arguments: + type: string + title: Arguments + id: + type: string + title: Id + name: + type: string + title: Name + server_label: + type: string + title: Server Label + type: + type: string + const: mcp_approval_request + title: Type + default: mcp_approval_request + type: object + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + description: A request for human approval of a tool invocation. + OpenAIResponseMCPApprovalResponse: + properties: + approval_request_id: + type: string + title: Approval Request Id + approve: + type: boolean + title: Approve + type: + type: string + const: mcp_approval_response + title: Type + default: mcp_approval_response + id: + title: Id + type: string + reason: + title: Reason + type: string + type: object + required: + - approval_request_id + - approve + title: OpenAIResponseMCPApprovalResponse + description: A response to an MCP approval request. + OpenAIResponseMessage-Input: + properties: + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - type: string + const: system + - type: string + const: developer + - type: string + const: user + - type: string + const: assistant + title: Role + type: + type: string + const: message + title: Type + default: message + id: + title: Id + type: string + status: + title: Status + type: string + type: object + required: + - content + - role + title: OpenAIResponseMessage + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + OpenAIResponseMessage-Output: + properties: + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - type: string + const: system + - type: string + const: developer + - type: string + const: user + - type: string + const: assistant + title: Role + type: + type: string + const: message + title: Type + default: message + id: + title: Id + type: string + status: + title: Status + type: string + type: object + required: + - content + - role + title: OpenAIResponseMessage + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + OpenAIResponseObject: + properties: + created_at: + type: integer + title: Created At + error: + $ref: '#/components/schemas/OpenAIResponseError' + id: + type: string + title: Id + model: + type: string + title: Model + object: + type: string + const: response + title: Object + default: response + output: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + title: Output + parallel_tool_calls: + type: boolean + title: Parallel Tool Calls + default: false + previous_response_id: + title: Previous Response Id + type: string + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' + status: + type: string + title: Status + temperature: + title: Temperature + type: number + text: + $ref: '#/components/schemas/OpenAIResponseText' + default: + format: + type: text + top_p: + title: Top P + type: number + tools: + title: Tools + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + type: array + truncation: + title: Truncation + type: string + usage: + $ref: '#/components/schemas/OpenAIResponseUsage' + instructions: + title: Instructions + type: string + type: object + required: + - created_at + - id + - model + - output + - status + title: OpenAIResponseObject + description: "Complete OpenAI response object containing generation results and metadata.\n\n:param created_at: Unix timestamp when the response was created\n:param error: (Optional) Error details if the response generation failed\n:param id: Unique identifier for this response\n:param model: Model identifier used for generation\n:param object: Object type identifier, always \"response\"\n:param output: List of generated output items (messages, tool calls, etc.)\n:param parallel_tool_calls: Whether tool calls can be executed in parallel\n:param previous_response_id: (Optional) ID of the previous response in a conversation\n:param prompt: (Optional) Reference to a prompt template and its variables.\n:param status: Current status of the response generation\n:param temperature: (Optional) Sampling temperature used for generation\n:param text: Text formatting configuration for the response\n:param top_p: (Optional) Nucleus sampling parameter used for generation\n:param tools: (Optional) An array of tools the model may call while generating a response.\n:param truncation: (Optional) Truncation strategy applied to the response\n:param usage: (Optional) Token usage information for the response\n:param instructions: (Optional) System message inserted into the model's context" + OpenAIResponseOutputMessageContentOutputText: + properties: + text: + type: string + title: Text + type: + type: string + const: output_text + title: Type + default: output_text + annotations: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + discriminator: + propertyName: type + mapping: + container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' + url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' + type: array + title: Annotations + type: object + required: + - text + title: OpenAIResponseOutputMessageContentOutputText + OpenAIResponseOutputMessageFileSearchToolCall: + properties: + id: + type: string + title: Id + queries: + items: + type: string + type: array + title: Queries + status: + type: string + title: Status + type: + type: string + const: file_search_call + title: Type + default: file_search_call + results: + title: Results + items: + $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' + type: array + type: object + required: + - id + - queries + - status + title: OpenAIResponseOutputMessageFileSearchToolCall + description: "File search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param queries: List of search queries executed\n:param status: Current status of the file search operation\n:param type: Tool call type identifier, always \"file_search_call\"\n:param results: (Optional) Search results returned by the file search operation" + OpenAIResponseOutputMessageFileSearchToolCallResults: + properties: + attributes: + additionalProperties: true type: object - OpenAIResponseMCPApprovalResponse: - description: A response to an MCP approval request. - properties: - approval_request_id: - title: Approval Request Id - type: string - approve: - title: Approve - type: boolean - type: - const: mcp_approval_response - default: mcp_approval_response - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - reason: - anyOf: - - type: string - - type: 'null' - title: Reason - required: - - approval_request_id - - approve - title: OpenAIResponseMCPApprovalResponse + title: Attributes + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + score: + type: number + title: Score + text: + type: string + title: Text + type: object + required: + - attributes + - file_id + - filename + - score + - text + title: OpenAIResponseOutputMessageFileSearchToolCallResults + description: "Search results returned by the file search operation.\n\n:param attributes: (Optional) Key-value attributes associated with the file\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result (between 0 and 1)\n:param text: Text content of the search result" + OpenAIResponseOutputMessageFunctionToolCall: + properties: + call_id: + type: string + title: Call Id + name: + type: string + title: Name + arguments: + type: string + title: Arguments + type: + type: string + const: function_call + title: Type + default: function_call + id: + title: Id + type: string + status: + title: Status + type: string + type: object + required: + - call_id + - name + - arguments + title: OpenAIResponseOutputMessageFunctionToolCall + description: "Function tool call output message for OpenAI responses.\n\n:param call_id: Unique identifier for the function call\n:param name: Name of the function being called\n:param arguments: JSON string containing the function arguments\n:param type: Tool call type identifier, always \"function_call\"\n:param id: (Optional) Additional identifier for the tool call\n:param status: (Optional) Current status of the function call execution" + OpenAIResponseOutputMessageMCPCall: + properties: + id: + type: string + title: Id + type: + type: string + const: mcp_call + title: Type + default: mcp_call + arguments: + type: string + title: Arguments + name: + type: string + title: Name + server_label: + type: string + title: Server Label + error: + title: Error + type: string + output: + title: Output + type: string + type: object + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + description: "Model Context Protocol (MCP) call output message for OpenAI responses.\n\n:param id: Unique identifier for this MCP call\n:param type: Tool call type identifier, always \"mcp_call\"\n:param arguments: JSON string containing the MCP call arguments\n:param name: Name of the MCP method being called\n:param server_label: Label identifying the MCP server handling the call\n:param error: (Optional) Error message if the MCP call failed\n:param output: (Optional) Output result from the successful MCP call" + OpenAIResponseOutputMessageMCPListTools: + properties: + id: + type: string + title: Id + type: + type: string + const: mcp_list_tools + title: Type + default: mcp_list_tools + server_label: + type: string + title: Server Label + tools: + items: + $ref: '#/components/schemas/MCPListToolsTool' + type: array + title: Tools + type: object + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + description: "MCP list tools output message containing available tools from an MCP server.\n\n:param id: Unique identifier for this MCP list tools operation\n:param type: Tool call type identifier, always \"mcp_list_tools\"\n:param server_label: Label identifying the MCP server providing the tools\n:param tools: List of available tools provided by the MCP server" + OpenAIResponseOutputMessageWebSearchToolCall: + properties: + id: + type: string + title: Id + status: + type: string + title: Status + type: + type: string + const: web_search_call + title: Type + default: web_search_call + type: object + required: + - id + - status + title: OpenAIResponseOutputMessageWebSearchToolCall + description: "Web search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param status: Current status of the web search operation\n:param type: Tool call type identifier, always \"web_search_call\"" + OpenAIResponsePrompt: + properties: + id: + type: string + title: Id + variables: + title: Variables + additionalProperties: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' type: object - OpenAIResponseMessage: - description: >- - Corresponds to the various Message types in the Responses API. - - They are all under one type because the Responses API gives them all - - the same "type" value, and there is no way to tell them apart in certain - - scenarios. - properties: - content: - anyOf: - - type: string - - items: - discriminator: - mapping: - input_image: >- - #/$defs/OpenAIResponseInputMessageContentImage - input_text: >- - #/$defs/OpenAIResponseInputMessageContentText - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentText - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentImage - type: array - - items: - discriminator: - mapping: - output_text: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - refusal: '#/$defs/OpenAIResponseContentPartRefusal' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - - $ref: '#/$defs/OpenAIResponseContentPartRefusal' - type: array - title: Content - role: - anyOf: - - const: system - type: string - - const: developer - type: string - - const: user - type: string - - const: assistant - type: string - title: Role - type: - const: message - default: message - title: Type + version: + title: Version + type: string + type: object + required: + - id + title: OpenAIResponsePrompt + description: "OpenAI compatible Prompt object that is used in OpenAI responses.\n\n:param id: Unique identifier of the prompt template\n:param variables: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types\nlike images or files.\n:param version: Version number of the prompt to use (defaults to latest if not specified)" + OpenAIResponseText: + properties: + format: + $ref: '#/components/schemas/OpenAIResponseTextFormat' + type: object + title: OpenAIResponseText + description: "Text response configuration for OpenAI responses.\n\n:param format: (Optional) Text format configuration specifying output format requirements" + OpenAIResponseTextFormat: + properties: + type: + anyOf: + - type: string + const: text + - type: string + const: json_schema + - type: string + const: json_object + title: Type + name: + title: Name + type: string + schema: + title: Schema + additionalProperties: true + type: object + description: + title: Description + type: string + strict: + title: Strict + type: boolean + type: object + title: OpenAIResponseTextFormat + description: "Configuration for Responses API text format.\n\n:param type: Must be \"text\", \"json_schema\", or \"json_object\" to identify the format type\n:param name: The name of the response format. Only used for json_schema.\n:param schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model. Only used for json_schema.\n:param description: (Optional) A description of the response format. Only used for json_schema.\n:param strict: (Optional) Whether to strictly enforce the JSON schema. If true, the response must match the schema exactly. Only used for json_schema." + OpenAIResponseToolMCP: + properties: + type: + type: string + const: mcp + title: Type + default: mcp + server_label: + type: string + title: Server Label + allowed_tools: + anyOf: + - items: type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - content - - role - title: OpenAIResponseMessage + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + title: Allowed Tools + type: object + required: + - server_label + title: OpenAIResponseToolMCP + description: "Model Context Protocol (MCP) tool configuration for OpenAI response object.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + OpenAIResponseUsage: + properties: + input_tokens: + type: integer + title: Input Tokens + output_tokens: + type: integer + title: Output Tokens + total_tokens: + type: integer + title: Total Tokens + input_tokens_details: + $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' + output_tokens_details: + $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + type: object + required: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + description: "Usage information for OpenAI response.\n\n:param input_tokens: Number of tokens in the input\n:param output_tokens: Number of tokens in the output\n:param total_tokens: Total tokens used (input + output)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + OpenAIResponseUsageInputTokensDetails: + properties: + cached_tokens: + title: Cached Tokens + type: integer + type: object + title: OpenAIResponseUsageInputTokensDetails + description: "Token details for input tokens in OpenAI response usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + OpenAIResponseUsageOutputTokensDetails: + properties: + reasoning_tokens: + title: Reasoning Tokens + type: integer + type: object + title: OpenAIResponseUsageOutputTokensDetails + description: "Token details for output tokens in OpenAI response usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + OpenAISystemMessageParam: + properties: + role: + type: string + const: system + title: Role + default: system + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + title: Name + type: string + type: object + required: + - content + title: OpenAISystemMessageParam + description: "A system message providing instructions or context to the model.\n\n:param role: Must be \"system\" to identify this as a system message\n:param content: The content of the \"system prompt\". If multiple system messages are provided, they are concatenated. The underlying Llama Stack code may also add other system messages (for example, for formatting tool definitions).\n:param name: (Optional) The name of the system message participant." + OpenAITokenLogProb: + properties: + token: + type: string + title: Token + bytes: + title: Bytes + items: + type: integer + type: array + logprob: + type: number + title: Logprob + top_logprobs: + items: + $ref: '#/components/schemas/OpenAITopLogProb' + type: array + title: Top Logprobs + type: object + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + description: "The log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token\n:top_logprobs: The top log probabilities for the token" + OpenAIToolMessageParam: + properties: + role: + type: string + const: tool + title: Role + default: tool + tool_call_id: + type: string + title: Tool Call Id + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + type: object + required: + - tool_call_id + - content + title: OpenAIToolMessageParam + description: "A message representing the result of a tool invocation in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"tool\" to identify this as a tool response\n:param tool_call_id: Unique identifier for the tool call this response is for\n:param content: The response content from the tool" + OpenAITopLogProb: + properties: + token: + type: string + title: Token + bytes: + title: Bytes + items: + type: integer + type: array + logprob: + type: number + title: Logprob + type: object + required: + - token + - logprob + title: OpenAITopLogProb + description: "The top log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token" + OpenAIUserMessageParam-Input: + properties: + role: + type: string + const: user + title: Role + default: user + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/OpenAIFile' + image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + title: Name + type: string + type: object + required: + - content + title: OpenAIUserMessageParam + description: "A message from the user in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param name: (Optional) The name of the user message participant." + OpenAIUserMessageParam-Output: + properties: + role: + type: string + const: user + title: Role + default: user + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/OpenAIFile' + image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + title: Name + type: string + type: object + required: + - content + title: OpenAIUserMessageParam + description: "A message from the user in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param name: (Optional) The name of the user message participant." + OptimizerConfig: + properties: + optimizer_type: + $ref: '#/components/schemas/OptimizerType' + lr: + type: number + title: Lr + weight_decay: + type: number + title: Weight Decay + num_warmup_steps: + type: integer + title: Num Warmup Steps + type: object + required: + - optimizer_type + - lr + - weight_decay + - num_warmup_steps + title: OptimizerConfig + description: "Configuration parameters for the optimization algorithm.\n\n:param optimizer_type: Type of optimizer to use (adam, adamw, or sgd)\n:param lr: Learning rate for the optimizer\n:param weight_decay: Weight decay coefficient for regularization\n:param num_warmup_steps: Number of steps for learning rate warmup" + OptimizerType: + type: string + enum: + - adam + - adamw + - sgd + title: OptimizerType + description: "Available optimizer algorithms for training.\n:cvar adam: Adaptive Moment Estimation optimizer\n:cvar adamw: AdamW optimizer with weight decay\n:cvar sgd: Stochastic Gradient Descent optimizer" + Order: + type: string + enum: + - asc + - desc + title: Order + description: "Sort order for paginated responses.\n:cvar asc: Ascending order\n:cvar desc: Descending order" + OutputTokensDetails: + properties: + reasoning_tokens: + type: integer + title: Reasoning Tokens + additionalProperties: true + type: object + required: + - reasoning_tokens + title: OutputTokensDetails + PostTrainingJob: + properties: + job_uuid: + type: string + title: Job Uuid + type: object + required: + - job_uuid + title: PostTrainingJob + Prompt: + properties: + prompt: + title: Prompt + description: The system prompt with variable placeholders + type: string + version: + type: integer + minimum: 1.0 + title: Version + description: Version (integer starting at 1, incremented on save) + prompt_id: + type: string + title: Prompt Id + description: Unique identifier in format 'pmpt_<48-digit-hash>' + variables: + items: + type: string + type: array + title: Variables + description: List of variable names that can be used in the prompt template + is_default: + type: boolean + title: Is Default + description: Boolean indicating whether this version is the default version + default: false + type: object + required: + - version + - prompt_id + title: Prompt + description: "A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack.\n\n:param prompt: The system prompt text with variable placeholders. Variables are only supported when using the Responses API.\n:param version: Version (integer starting at 1, incremented on save)\n:param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>'\n:param variables: List of prompt variable names that can be used in the prompt template\n:param is_default: Boolean indicating whether this version is the default version for this prompt" + ProviderInfo: + properties: + api: + type: string + title: Api + provider_id: + type: string + title: Provider Id + provider_type: + type: string + title: Provider Type + config: + additionalProperties: true type: object - "OpenAIResponseOutputMessageContentOutputText": - properties: - text: - title: Text - type: string - type: - const: output_text - default: output_text - title: Type - type: string - annotations: - items: - discriminator: - mapping: - container_file_citation: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - file_citation: >- - #/$defs/OpenAIResponseAnnotationFileCitation - file_path: '#/$defs/OpenAIResponseAnnotationFilePath' - url_citation: '#/$defs/OpenAIResponseAnnotationCitation' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseAnnotationFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationCitation' - - $ref: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' - title: Annotations - type: array - required: - - text - title: >- - OpenAIResponseOutputMessageContentOutputText + title: Config + health: + additionalProperties: true type: object - "OpenAIResponseOutputMessageFileSearchToolCall": - description: >- - File search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param queries: List of search queries executed - - :param status: Current status of the file search operation - - :param type: Tool call type identifier, always "file_search_call" - - :param results: (Optional) Search results returned by the file search - operation - properties: - id: - title: Id - type: string - queries: - items: - type: string - title: Queries - type: array - status: - title: Status - type: string - type: - const: file_search_call - default: file_search_call - title: Type - type: string - results: - anyOf: - - items: - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults - type: array - - type: 'null' - title: Results - required: - - id - - queries - - status - title: >- - OpenAIResponseOutputMessageFileSearchToolCall + title: Health + type: object + required: + - api + - provider_id + - provider_type + - config + - health + title: ProviderInfo + description: "Information about a registered provider including its configuration and health status.\n\n:param api: The API name this provider implements\n:param provider_id: Unique identifier for the provider\n:param provider_type: The type of provider implementation\n:param config: Configuration parameters for the provider\n:param health: Current health status of the provider" + QueryChunksResponse: + properties: + chunks: + items: + $ref: '#/components/schemas/Chunk-Output' + type: array + title: Chunks + scores: + items: + type: number + type: array + title: Scores + type: object + required: + - chunks + - scores + title: QueryChunksResponse + description: "Response from querying chunks in a vector database.\n\n:param chunks: List of content chunks returned from the query\n:param scores: Relevance scores corresponding to each returned chunk" + RAGQueryConfig: + properties: + query_generator_config: + oneOf: + - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' + title: Query Generator Config + default: + type: default + separator: ' ' + discriminator: + propertyName: type + mapping: + default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' + max_tokens_in_context: + type: integer + title: Max Tokens In Context + default: 4096 + max_chunks: + type: integer + title: Max Chunks + default: 5 + chunk_template: + type: string + title: Chunk Template + default: "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n" + mode: + default: vector + $ref: '#/components/schemas/RAGSearchMode' + ranker: + title: Ranker + oneOf: + - $ref: '#/components/schemas/RRFRanker' + - $ref: '#/components/schemas/WeightedRanker' + discriminator: + propertyName: type + mapping: + rrf: '#/components/schemas/RRFRanker' + weighted: '#/components/schemas/WeightedRanker' + type: object + title: RAGQueryConfig + description: "Configuration for the RAG query generation.\n\n:param query_generator_config: Configuration for the query generator.\n:param max_tokens_in_context: Maximum number of tokens in the context.\n:param max_chunks: Maximum number of chunks to retrieve.\n:param chunk_template: Template for formatting each retrieved chunk in the context.\n Available placeholders: {index} (1-based chunk ordinal), {chunk.content} (chunk content string), {metadata} (chunk metadata dict).\n Default: \"Result {index}\\nContent: {chunk.content}\\nMetadata: {metadata}\\n\"\n:param mode: Search mode for retrieval—either \"vector\", \"keyword\", or \"hybrid\". Default \"vector\".\n:param ranker: Configuration for the ranker to use in hybrid search. Defaults to RRF ranker." + RAGQueryResult: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + additionalProperties: true type: object - "OpenAIResponseOutputMessageFileSearchToolCallResults": - description: >- - Search results returned by the file search operation. - - - :param attributes: (Optional) Key-value attributes associated with the - file - - :param file_id: Unique identifier of the file containing the result - - :param filename: Name of the file containing the result - - :param score: Relevance score for this search result (between 0 and 1) - - :param text: Text content of the search result - properties: - attributes: - additionalProperties: true - title: Attributes - type: object - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - score: - title: Score - type: number - text: - title: Text - type: string - required: - - attributes - - file_id - - filename - - score - - text - title: >- - OpenAIResponseOutputMessageFileSearchToolCallResults + title: Metadata + type: object + title: RAGQueryResult + description: "Result of a RAG query containing retrieved content and metadata.\n\n:param content: (Optional) The retrieved content from the query\n:param metadata: Additional metadata about the query result" + RAGSearchMode: + type: string + enum: + - vector + - keyword + - hybrid + title: RAGSearchMode + description: "Search modes for RAG query retrieval:\n- VECTOR: Uses vector similarity search for semantic matching\n- KEYWORD: Uses keyword-based search for exact matching\n- HYBRID: Combines both vector and keyword search for better results" + RRFRanker: + properties: + type: + type: string + const: rrf + title: Type + default: rrf + impact_factor: + type: number + title: Impact Factor + default: 60.0 + minimum: 0.0 + type: object + title: RRFRanker + description: "Reciprocal Rank Fusion (RRF) ranker configuration.\n\n:param type: The type of ranker, always \"rrf\"\n:param impact_factor: The impact factor for RRF scoring. Higher values give more weight to higher-ranked results.\n Must be greater than 0" + RegexParserScoringFnParams: + properties: + type: + type: string + const: regex_parser + title: Type + default: regex_parser + parsing_regexes: + items: + type: string + type: array + title: Parsing Regexes + description: Regex to extract the answer from generated response + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row + type: object + title: RegexParserScoringFnParams + description: "Parameters for regex parser scoring function configuration.\n:param type: The type of scoring function parameters, always regex_parser\n:param parsing_regexes: Regex to extract the answer from generated response\n:param aggregation_functions: Aggregation functions to apply to the scores of each row" + RerankData: + properties: + index: + type: integer + title: Index + relevance_score: + type: number + title: Relevance Score + type: object + required: + - index + - relevance_score + title: RerankData + description: "A single rerank result from a reranking response.\n\n:param index: The original index of the document in the input list\n:param relevance_score: The relevance score from the model output. Values are inverted when applicable so that higher scores indicate greater relevance." + RerankResponse: + properties: + data: + items: + $ref: '#/components/schemas/RerankData' + type: array + title: Data + type: object + required: + - data + title: RerankResponse + description: "Response from a reranking request.\n\n:param data: List of rerank result objects, sorted by relevance score (descending)" + RouteInfo: + properties: + route: + type: string + title: Route + method: + type: string + title: Method + provider_types: + items: + type: string + type: array + title: Provider Types + type: object + required: + - route + - method + - provider_types + title: RouteInfo + description: "Information about an API route including its path, method, and implementing providers.\n\n:param route: The API endpoint path\n:param method: HTTP method for the route\n:param provider_types: List of provider types that implement this route" + RowsDataSource: + properties: + type: + type: string + const: rows + title: Type + default: rows + rows: + items: + additionalProperties: true + type: object + type: array + title: Rows + type: object + required: + - rows + title: RowsDataSource + description: "A dataset stored in rows.\n:param rows: The dataset is stored in rows. E.g.\n - [\n {\"messages\": [{\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}]}\n ]" + RunShieldResponse: + properties: + violation: + $ref: '#/components/schemas/SafetyViolation' + type: object + title: RunShieldResponse + description: "Response from running a safety shield.\n\n:param violation: (Optional) Safety violation detected by the shield, if any" + SafetyViolation: + properties: + violation_level: + $ref: '#/components/schemas/ViolationLevel' + user_message: + title: User Message + type: string + metadata: + additionalProperties: true type: object - "OpenAIResponseOutputMessageFunctionToolCall": - description: >- - Function tool call output message for OpenAI responses. - - - :param call_id: Unique identifier for the function call - - :param name: Name of the function being called - - :param arguments: JSON string containing the function arguments - - :param type: Tool call type identifier, always "function_call" - - :param id: (Optional) Additional identifier for the tool call - - :param status: (Optional) Current status of the function call execution - properties: - call_id: - title: Call Id - type: string - name: - title: Name - type: string - arguments: - title: Arguments - type: string - type: - const: function_call - default: function_call - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - name - - arguments - title: >- - OpenAIResponseOutputMessageFunctionToolCall + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + description: "Details of a safety violation detected by content moderation.\n\n:param violation_level: Severity level of the violation\n:param user_message: (Optional) Message to convey to the user about the violation\n:param metadata: Additional metadata including specific violation codes for debugging and telemetry" + SamplingParams: + properties: + strategy: + oneOf: + - $ref: '#/components/schemas/GreedySamplingStrategy' + - $ref: '#/components/schemas/TopPSamplingStrategy' + - $ref: '#/components/schemas/TopKSamplingStrategy' + title: Strategy + discriminator: + propertyName: type + mapping: + greedy: '#/components/schemas/GreedySamplingStrategy' + top_k: '#/components/schemas/TopKSamplingStrategy' + top_p: '#/components/schemas/TopPSamplingStrategy' + max_tokens: + title: Max Tokens + type: integer + repetition_penalty: + title: Repetition Penalty + default: 1.0 + type: number + stop: + title: Stop + items: + type: string + type: array + type: object + title: SamplingParams + description: "Sampling parameters.\n\n:param strategy: The sampling strategy.\n:param max_tokens: The maximum number of tokens that can be generated in the completion. The token count of\n your prompt plus max_tokens cannot exceed the model's context length.\n:param repetition_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens\n based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\n:param stop: Up to 4 sequences where the API will stop generating further tokens.\n The returned text will not contain the stop sequence." + ScoreBatchResponse: + properties: + dataset_id: + title: Dataset Id + type: string + results: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' type: object - OpenAIResponseOutputMessageMCPCall: - description: >- - Model Context Protocol (MCP) call output message for OpenAI responses. - - - :param id: Unique identifier for this MCP call - - :param type: Tool call type identifier, always "mcp_call" - - :param arguments: JSON string containing the MCP call arguments - - :param name: Name of the MCP method being called - - :param server_label: Label identifying the MCP server handling the call - - :param error: (Optional) Error message if the MCP call failed - - :param output: (Optional) Output result from the successful MCP call - properties: - id: - title: Id - type: string - type: - const: mcp_call - default: mcp_call - title: Type - type: string - arguments: - title: Arguments - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - error: - anyOf: - - type: string - - type: 'null' - title: Error - output: - anyOf: - - type: string - - type: 'null' - title: Output - required: - - id - - arguments - - name - - server_label - title: OpenAIResponseOutputMessageMCPCall + title: Results + type: object + required: + - results + title: ScoreBatchResponse + description: "Response from batch scoring operations on datasets.\n\n:param dataset_id: (Optional) The identifier of the dataset that was scored\n:param results: A map of scoring function name to ScoringResult" + ScoreResponse: + properties: + results: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' type: object - OpenAIResponseOutputMessageMCPListTools: - description: >- - MCP list tools output message containing available tools from an MCP server. - - - :param id: Unique identifier for this MCP list tools operation - - :param type: Tool call type identifier, always "mcp_list_tools" - - :param server_label: Label identifying the MCP server providing the tools - - :param tools: List of available tools provided by the MCP server - properties: - id: - title: Id - type: string - type: - const: mcp_list_tools - default: mcp_list_tools - title: Type - type: string - server_label: - title: Server Label - type: string - tools: - items: - $ref: '#/$defs/MCPListToolsTool' - title: Tools - type: array - required: - - id - - server_label - - tools - title: OpenAIResponseOutputMessageMCPListTools + title: Results + type: object + required: + - results + title: ScoreResponse + description: "The response from scoring.\n\n:param results: A map of scoring function name to ScoringResult." + ScoringFn-Output: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + title: Provider Resource Id + description: Unique identifier for this resource in the provider + type: string + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: scoring_function + title: Type + default: scoring_function + description: + title: Description + type: string + metadata: + additionalProperties: true type: object - "OpenAIResponseOutputMessageWebSearchToolCall": - description: >- - Web search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param status: Current status of the web search operation - - :param type: Tool call type identifier, always "web_search_call" - properties: - id: - title: Id - type: string - status: - title: Status - type: string - type: - const: web_search_call - default: web_search_call - title: Type - type: string - required: - - id - - status - title: >- - OpenAIResponseOutputMessageWebSearchToolCall + title: Metadata + description: Any additional metadata for this definition + return_type: + oneOf: + - $ref: '#/components/schemas/StringType' + - $ref: '#/components/schemas/NumberType' + - $ref: '#/components/schemas/BooleanType' + - $ref: '#/components/schemas/ArrayType' + - $ref: '#/components/schemas/ObjectType' + - $ref: '#/components/schemas/JsonType' + - $ref: '#/components/schemas/UnionType' + - $ref: '#/components/schemas/ChatCompletionInputType' + - $ref: '#/components/schemas/CompletionInputType' + - $ref: '#/components/schemas/AgentTurnInputType' + title: Return Type + description: The return type of the deterministic function + discriminator: + propertyName: type + mapping: + agent_turn_input: '#/components/schemas/AgentTurnInputType' + array: '#/components/schemas/ArrayType' + boolean: '#/components/schemas/BooleanType' + chat_completion_input: '#/components/schemas/ChatCompletionInputType' + completion_input: '#/components/schemas/CompletionInputType' + json: '#/components/schemas/JsonType' + number: '#/components/schemas/NumberType' + object: '#/components/schemas/ObjectType' + string: '#/components/schemas/StringType' + union: '#/components/schemas/UnionType' + params: + title: Params + description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval + oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + type: object + required: + - identifier + - provider_id + - return_type + title: ScoringFn + description: "A scoring function resource for evaluating model outputs.\n:param type: The resource type, always scoring_function" + ScoringResult: + properties: + score_rows: + items: + additionalProperties: true + type: object + type: array + title: Score Rows + aggregated_results: + additionalProperties: true + type: object + title: Aggregated Results + type: object + required: + - score_rows + - aggregated_results + title: ScoringResult + description: "A scoring result for a single row.\n\n:param score_rows: The scoring result for each row. Each row is a map of column name to value.\n:param aggregated_results: Map of metric name to aggregated value" + SearchRankingOptions: + properties: + ranker: + title: Ranker + type: string + score_threshold: + title: Score Threshold + default: 0.0 + type: number + type: object + title: SearchRankingOptions + description: "Options for ranking and filtering search results.\n\n:param ranker: (Optional) Name of the ranking algorithm to use\n:param score_threshold: (Optional) Minimum relevance score threshold for results" + Shield: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + title: Provider Resource Id + description: Unique identifier for this resource in the provider + type: string + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: shield + title: Type + default: shield + params: + title: Params + additionalProperties: true type: object - description: >- - List container for OpenAI response input items. - - - :param data: List of input items - - :param object: Object type identifier, always "list" + type: object + required: + - identifier + - provider_id + title: Shield + description: "A safety shield resource that can be used to check content.\n\n:param params: (Optional) Configuration parameters for the shield\n:param type: The resource type, always shield" + ShieldCallStep-Output: properties: - data: - items: - anyOf: - - discriminator: - mapping: - file_search_call: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - function_call: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - mcp_list_tools: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - message: '#/$defs/OpenAIResponseMessage' - web_search_call: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseMessage' - - $ref: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' - - $ref: >- - #/$defs/OpenAIResponseInputFunctionToolCallOutput - - $ref: >- - #/$defs/OpenAIResponseMCPApprovalResponse - - $ref: '#/$defs/OpenAIResponseMessage' - title: Data - type: array - object: - const: list - default: list - title: Object + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + started_at: + title: Started At + type: string + format: date-time + completed_at: + title: Completed At type: string + format: date-time + step_type: + type: string + const: shield_call + title: Step Type + default: shield_call + violation: + $ref: '#/components/schemas/SafetyViolation' + type: object required: - - data - title: ListOpenAIResponseInputItem + - turn_id + - step_id + - violation + title: ShieldCallStep + description: "A shield call step in an agent turn.\n\n:param violation: The violation from the shield call." + StopReason: + type: string + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + StringType: + properties: + type: + type: string + const: string + title: Type + default: string type: object - RunShieldRequest: + title: StringType + description: "Parameter type for string values.\n\n:param type: Discriminator type. Always \"string\"" + SystemMessage: + properties: + role: + type: string + const: system + title: Role + default: system + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content type: object - RunShieldResponse: - $defs: - SafetyViolation: - description: >- - Details of a safety violation detected by content moderation. - - - :param violation_level: Severity level of the violation - - :param user_message: (Optional) Message to convey to the user about the - violation - - :param metadata: Additional metadata including specific violation codes - for debugging and telemetry - properties: - violation_level: - $ref: '#/$defs/ViolationLevel' - user_message: - anyOf: - - type: string - - type: 'null' - title: User Message - metadata: - additionalProperties: true - title: Metadata - type: object - required: - - violation_level - title: SafetyViolation - type: object - ViolationLevel: - description: >- - Severity level of a safety violation. - - - :cvar INFO: Informational level violation that does not require action - - :cvar WARN: Warning level violation that suggests caution but allows continuation - - :cvar ERROR: Error level violation that requires blocking or intervention - enum: - - info - - warn - - error - title: ViolationLevel + required: + - content + title: SystemMessage + description: "A system message providing instructions or context to the model.\n\n:param role: Must be \"system\" to identify this as a system message\n:param content: The content of the \"system prompt\". If multiple system messages are provided, they are concatenated. The underlying Llama Stack code may also add other system messages (for example, for formatting tool definitions)." + SystemMessageBehavior: + type: string + enum: + - append + - replace + title: SystemMessageBehavior + description: "Config for how to override the default system prompt.\n\n:cvar append: Appends the provided system message to the default system prompt:\n https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt-\n:cvar replace: Replaces the default system prompt with the provided system message. The system message can include the string\n '{{function_definitions}}' to indicate where the function definitions should be inserted." + TextContentItem: + properties: + type: type: string - description: >- - Response from running a safety shield. - - - :param violation: (Optional) Safety violation detected by the shield, if any + const: text + title: Type + default: text + text: + type: string + title: Text + type: object + required: + - text + title: TextContentItem + description: "A text content item\n\n:param type: Discriminator type of the content item. Always \"text\"\n:param text: Text content" + ToolCall: properties: - violation: + call_id: + type: string + title: Call Id + tool_name: anyOf: - - $ref: '#/$defs/SafetyViolation' - - type: 'null' - title: RunShieldResponse + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + type: string + title: Arguments type: object - ListScoringFunctionsResponse: - $defs: - AgentTurnInputType: - description: >- - Parameter type for agent turn input. - - - :param type: Discriminator type. Always "agent_turn_input" - properties: - type: - const: agent_turn_input - default: agent_turn_input - title: Type - type: string - title: AgentTurnInputType - type: object - AggregationFunctionType: - description: >- - Types of aggregation functions for scoring results. - - :cvar average: Calculate the arithmetic mean of scores - - :cvar weighted_average: Calculate a weighted average of scores - - :cvar median: Calculate the median value of scores - - :cvar categorical_count: Count occurrences of categorical values - - :cvar accuracy: Calculate accuracy as the proportion of correct answers - enum: - - average - - weighted_average - - median - - categorical_count - - accuracy - title: AggregationFunctionType - type: string - ArrayType: - description: >- - Parameter type for array values. - - - :param type: Discriminator type. Always "array" - properties: - type: - const: array - default: array - title: Type - type: string - title: ArrayType - type: object - BasicScoringFnParams: - description: >- - Parameters for basic scoring function configuration. - - :param type: The type of scoring function parameters, always basic - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row - properties: - type: - const: basic - default: basic - title: Type - type: string - aggregation_functions: - description: >- - Aggregation functions to apply to the scores of each row - items: - $ref: '#/$defs/AggregationFunctionType' - title: Aggregation Functions - type: array - title: BasicScoringFnParams - type: object - BooleanType: - description: >- - Parameter type for boolean values. - - - :param type: Discriminator type. Always "boolean" - properties: - type: - const: boolean - default: boolean - title: Type - type: string - title: BooleanType - type: object - ChatCompletionInputType: - description: >- - Parameter type for chat completion input. - - - :param type: Discriminator type. Always "chat_completion_input" - properties: - type: - const: chat_completion_input - default: chat_completion_input - title: Type - type: string - title: ChatCompletionInputType - type: object - CompletionInputType: - description: >- - Parameter type for completion input. - - - :param type: Discriminator type. Always "completion_input" - properties: - type: - const: completion_input - default: completion_input - title: Type - type: string - title: CompletionInputType - type: object - JsonType: - description: >- - Parameter type for JSON values. - - - :param type: Discriminator type. Always "json" - properties: - type: - const: json - default: json - title: Type - type: string - title: JsonType + required: + - call_id + - tool_name + - arguments + title: ToolCall + ToolChoice: + type: string + enum: + - auto + - required + - none + title: ToolChoice + description: "Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model.\n\n:cvar auto: The model may use tools if it determines that is appropriate.\n:cvar required: The model must use tools.\n:cvar none: The model must not use tools." + ToolConfig: + properties: + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: string + title: Tool Choice + default: auto + tool_prompt_format: + $ref: '#/components/schemas/ToolPromptFormat' + system_message_behavior: + default: append + $ref: '#/components/schemas/SystemMessageBehavior' + type: object + title: ToolConfig + description: "Configuration for tool use.\n\n:param tool_choice: (Optional) Whether tool use is automatic, required, or none. Can also specify a tool name to use a specific tool. Defaults to ToolChoice.auto.\n:param tool_prompt_format: (Optional) Instructs the model how to format tool calls. By default, Llama Stack will attempt to use a format that is best adapted to the model.\n - `ToolPromptFormat.json`: The tool calls are formatted as a JSON object.\n - `ToolPromptFormat.function_tag`: The tool calls are enclosed in a tag.\n - `ToolPromptFormat.python_list`: The tool calls are output as Python syntax -- a list of function calls.\n:param system_message_behavior: (Optional) Config for how to override the default system prompt.\n - `SystemMessageBehavior.append`: Appends the provided system message to the default system prompt.\n - `SystemMessageBehavior.replace`: Replaces the default system prompt with the provided system message. The system message can include the string\n '{{function_definitions}}' to indicate where the function definitions should be inserted." + ToolDef: + properties: + toolgroup_id: + title: Toolgroup Id + type: string + name: + type: string + title: Name + description: + title: Description + type: string + input_schema: + title: Input Schema + additionalProperties: true type: object - LLMAsJudgeScoringFnParams: - description: >- - Parameters for LLM-as-judge scoring function configuration. - - :param type: The type of scoring function parameters, always llm_as_judge - - :param judge_model: Identifier of the LLM model to use as a judge for - scoring - - :param prompt_template: (Optional) Custom prompt template for the judge - model - - :param judge_score_regexes: Regexes to extract the answer from generated - response - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row - properties: - type: - const: llm_as_judge - default: llm_as_judge - title: Type - type: string - judge_model: - title: Judge Model - type: string - prompt_template: - anyOf: - - type: string - - type: 'null' - title: Prompt Template - judge_score_regexes: - description: >- - Regexes to extract the answer from generated response - items: - type: string - title: Judge Score Regexes - type: array - aggregation_functions: - description: >- - Aggregation functions to apply to the scores of each row - items: - $ref: '#/$defs/AggregationFunctionType' - title: Aggregation Functions - type: array - required: - - judge_model - title: LLMAsJudgeScoringFnParams + output_schema: + title: Output Schema + additionalProperties: true type: object - NumberType: - description: >- - Parameter type for numeric values. - - - :param type: Discriminator type. Always "number" - properties: - type: - const: number - default: number - title: Type - type: string - title: NumberType + metadata: + title: Metadata + additionalProperties: true type: object - ObjectType: - description: >- - Parameter type for object values. - - - :param type: Discriminator type. Always "object" - properties: - type: - const: object - default: object - title: Type - type: string - title: ObjectType + type: object + required: + - name + title: ToolDef + description: "Tool definition used in runtime contexts.\n\n:param name: Name of the tool\n:param description: (Optional) Human-readable description of what the tool does\n:param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema)\n:param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema)\n:param metadata: (Optional) Additional metadata about the tool\n:param toolgroup_id: (Optional) ID of the tool group this tool belongs to" + ToolExecutionStep-Output: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + started_at: + title: Started At + type: string + format: date-time + completed_at: + title: Completed At + type: string + format: date-time + step_type: + type: string + const: tool_execution + title: Step Type + default: tool_execution + tool_calls: + items: + $ref: '#/components/schemas/ToolCall' + type: array + title: Tool Calls + tool_responses: + items: + $ref: '#/components/schemas/ToolResponse-Output' + type: array + title: Tool Responses + type: object + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + description: "A tool execution step in an agent turn.\n\n:param tool_calls: The tool calls to execute.\n:param tool_responses: The tool responses from the tool calls." + ToolGroup: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + title: Provider Resource Id + description: Unique identifier for this resource in the provider + type: string + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: tool_group + title: Type + default: tool_group + mcp_endpoint: + $ref: '#/components/schemas/URL' + args: + title: Args + additionalProperties: true type: object - RegexParserScoringFnParams: - description: >- - Parameters for regex parser scoring function configuration. - - :param type: The type of scoring function parameters, always regex_parser - - :param parsing_regexes: Regex to extract the answer from generated response - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row - properties: - type: - const: regex_parser - default: regex_parser - title: Type - type: string - parsing_regexes: - description: >- - Regex to extract the answer from generated response - items: - type: string - title: Parsing Regexes - type: array - aggregation_functions: - description: >- - Aggregation functions to apply to the scores of each row - items: - $ref: '#/$defs/AggregationFunctionType' - title: Aggregation Functions - type: array - title: RegexParserScoringFnParams + type: object + required: + - identifier + - provider_id + title: ToolGroup + description: "A group of related tools managed together.\n\n:param type: Type of resource, always 'tool_group'\n:param mcp_endpoint: (Optional) Model Context Protocol endpoint for remote tools\n:param args: (Optional) Additional arguments for the tool group" + ToolInvocationResult: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + error_message: + title: Error Message + type: string + error_code: + title: Error Code + type: integer + metadata: + title: Metadata + additionalProperties: true type: object - ScoringFn: - description: >- - A scoring function resource for evaluating model outputs. - - :param type: The resource type, always scoring_function - properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier - type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: scoring_function - default: scoring_function - title: Type - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - metadata: - additionalProperties: true - description: >- - Any additional metadata for this definition - title: Metadata - type: object - return_type: - description: >- - The return type of the deterministic function + type: object + title: ToolInvocationResult + description: "Result of a tool invocation.\n\n:param content: (Optional) The output content from the tool execution\n:param error_message: (Optional) Error message if the tool execution failed\n:param error_code: (Optional) Numeric error code if the tool execution failed\n:param metadata: (Optional) Additional metadata about the tool execution" + ToolPromptFormat: + type: string + enum: + - json + - function_tag + - python_list + title: ToolPromptFormat + description: "Prompt format for calling custom / zero shot tools.\n\n:cvar json: JSON format for calling tools. It takes the form:\n {\n \"type\": \"function\",\n \"function\" : {\n \"name\": \"function_name\",\n \"description\": \"function_description\",\n \"parameters\": {...}\n }\n }\n:cvar function_tag: Function tag format, pseudo-XML. This looks like:\n (parameters)\n\n:cvar python_list: Python list. The output is a valid Python expression that can be\n evaluated to a list. Each element in the list is a function call. Example:\n [\"function_name(param1, param2)\", \"function_name(param1, param2)\"]" + ToolResponse-Input: + properties: + call_id: + type: string + title: Call Id + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + title: Metadata + additionalProperties: true + type: object + type: object + required: + - call_id + - tool_name + - content + title: ToolResponse + description: "Response from a tool invocation.\n\n:param call_id: Unique identifier for the tool call this response is for\n:param tool_name: Name of the tool that was invoked\n:param content: The response content from the tool\n:param metadata: (Optional) Additional metadata about the tool response" + ToolResponse-Output: + properties: + call_id: + type: string + title: Call Id + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + title: Metadata + additionalProperties: true + type: object + type: object + required: + - call_id + - tool_name + - content + title: ToolResponse + description: "Response from a tool invocation.\n\n:param call_id: Unique identifier for the tool call this response is for\n:param tool_name: Name of the tool that was invoked\n:param content: The response content from the tool\n:param metadata: (Optional) Additional metadata about the tool response" + ToolResponseMessage-Output: + properties: + role: + type: string + const: tool + title: Role + default: tool + call_id: + type: string + title: Call Id + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + type: object + required: + - call_id + - content + title: ToolResponseMessage + description: "A message representing the result of a tool invocation.\n\n:param role: Must be \"tool\" to identify this as a tool response\n:param call_id: Unique identifier for the tool call this response is for\n:param content: The response content from the tool" + TopKSamplingStrategy: + properties: + type: + type: string + const: top_k + title: Type + default: top_k + top_k: + type: integer + minimum: 1.0 + title: Top K + type: object + required: + - top_k + title: TopKSamplingStrategy + description: "Top-k sampling strategy that restricts sampling to the k most likely tokens.\n\n:param type: Must be \"top_k\" to identify this sampling strategy\n:param top_k: Number of top tokens to consider for sampling. Must be at least 1" + TopPSamplingStrategy: + properties: + type: + type: string + const: top_p + title: Type + default: top_p + temperature: + title: Temperature + type: number + minimum: 0.0 + top_p: + title: Top P + default: 0.95 + type: number + type: object + required: + - temperature + title: TopPSamplingStrategy + description: "Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p.\n\n:param type: Must be \"top_p\" to identify this sampling strategy\n:param temperature: Controls randomness in sampling. Higher values increase randomness\n:param top_p: Cumulative probability threshold for nucleus sampling. Defaults to 0.95" + TrainingConfig: + properties: + n_epochs: + type: integer + title: N Epochs + max_steps_per_epoch: + type: integer + title: Max Steps Per Epoch + default: 1 + gradient_accumulation_steps: + type: integer + title: Gradient Accumulation Steps + default: 1 + max_validation_steps: + title: Max Validation Steps + default: 1 + type: integer + data_config: + $ref: '#/components/schemas/DataConfig' + optimizer_config: + $ref: '#/components/schemas/OptimizerConfig' + efficiency_config: + $ref: '#/components/schemas/EfficiencyConfig' + dtype: + title: Dtype + default: bf16 + type: string + type: object + required: + - n_epochs + title: TrainingConfig + description: "Comprehensive configuration for the training process.\n\n:param n_epochs: Number of training epochs to run\n:param max_steps_per_epoch: Maximum number of steps to run per epoch\n:param gradient_accumulation_steps: Number of steps to accumulate gradients before updating\n:param max_validation_steps: (Optional) Maximum number of validation steps per epoch\n:param data_config: (Optional) Configuration for data loading and formatting\n:param optimizer_config: (Optional) Configuration for the optimization algorithm\n:param efficiency_config: (Optional) Configuration for memory and compute optimizations\n:param dtype: (Optional) Data type for model parameters (bf16, fp16, fp32)" + Turn: + properties: + turn_id: + type: string + title: Turn Id + session_id: + type: string + title: Session Id + input_messages: + items: + anyOf: + - $ref: '#/components/schemas/UserMessage-Output' + - $ref: '#/components/schemas/ToolResponseMessage-Output' + type: array + title: Input Messages + steps: + items: + oneOf: + - $ref: '#/components/schemas/InferenceStep-Output' + - $ref: '#/components/schemas/ToolExecutionStep-Output' + - $ref: '#/components/schemas/ShieldCallStep-Output' + - $ref: '#/components/schemas/MemoryRetrievalStep-Output' + discriminator: + propertyName: step_type + mapping: + inference: '#/components/schemas/InferenceStep-Output' + memory_retrieval: '#/components/schemas/MemoryRetrievalStep-Output' + shield_call: '#/components/schemas/ShieldCallStep-Output' + tool_execution: '#/components/schemas/ToolExecutionStep-Output' + type: array + title: Steps + output_message: + $ref: '#/components/schemas/CompletionMessage-Output' + output_attachments: + title: Output Attachments + items: + $ref: '#/components/schemas/Attachment-Output' + type: array + started_at: + type: string + format: date-time + title: Started At + completed_at: + title: Completed At + type: string + format: date-time + type: object + required: + - turn_id + - session_id + - input_messages + - steps + - output_message + - started_at + title: Turn + description: "A single turn in an interaction with an Agentic System.\n\n:param turn_id: Unique identifier for the turn within a session\n:param session_id: Unique identifier for the conversation session\n:param input_messages: List of messages that initiated this turn\n:param steps: Ordered list of processing steps executed during this turn\n:param output_message: The model's generated response containing content and metadata\n:param output_attachments: (Optional) Files or media attached to the agent's response\n:param started_at: Timestamp when the turn began\n:param completed_at: (Optional) Timestamp when the turn finished, if completed" + URIDataSource: + properties: + type: + type: string + const: uri + title: Type + default: uri + uri: + type: string + title: Uri + type: object + required: + - uri + title: URIDataSource + description: "A dataset that can be obtained from a URI.\n:param uri: The dataset can be obtained from a URI. E.g.\n - \"https://mywebsite.com/mydata.jsonl\"\n - \"lsfs://mydata.jsonl\"\n - \"data:csv;base64,{base64_content}\"" + URL: + properties: + uri: + type: string + title: Uri + type: object + required: + - uri + title: URL + description: "A URL reference to external content.\n\n:param uri: The URL string pointing to the resource" + UnionType: + properties: + type: + type: string + const: union + title: Type + default: union + type: object + title: UnionType + description: "Parameter type for union values.\n\n:param type: Discriminator type. Always \"union\"" + UserMessage-Input: + properties: + role: + type: string + const: user + title: Role + default: user + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' discriminator: + propertyName: type mapping: - agent_turn_input: '#/$defs/AgentTurnInputType' - array: '#/$defs/ArrayType' - boolean: '#/$defs/BooleanType' - chat_completion_input: '#/$defs/ChatCompletionInputType' - completion_input: '#/$defs/CompletionInputType' - json: '#/$defs/JsonType' - number: '#/$defs/NumberType' - object: '#/$defs/ObjectType' - string: '#/$defs/StringType' - union: '#/$defs/UnionType' + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Context + type: object + required: + - content + title: UserMessage + description: "A message from the user in a chat conversation.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param context: (Optional) This field is used internally by Llama Stack to pass RAG context. This field may be removed in the API in the future." + UserMessage-Output: + properties: + role: + type: string + const: user + title: Role + default: user + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: oneOf: - - $ref: '#/$defs/StringType' - - $ref: '#/$defs/NumberType' - - $ref: '#/$defs/BooleanType' - - $ref: '#/$defs/ArrayType' - - $ref: '#/$defs/ObjectType' - - $ref: '#/$defs/JsonType' - - $ref: '#/$defs/UnionType' - - $ref: '#/$defs/ChatCompletionInputType' - - $ref: '#/$defs/CompletionInputType' - - $ref: '#/$defs/AgentTurnInputType' - title: Return Type - params: - anyOf: - - discriminator: - mapping: - basic: '#/$defs/BasicScoringFnParams' - llm_as_judge: '#/$defs/LLMAsJudgeScoringFnParams' - regex_parser: '#/$defs/RegexParserScoringFnParams' - propertyName: type - oneOf: - - $ref: '#/$defs/LLMAsJudgeScoringFnParams' - - $ref: '#/$defs/RegexParserScoringFnParams' - - $ref: '#/$defs/BasicScoringFnParams' - - type: 'null' - description: >- - The parameters for the scoring function for benchmark eval, these - can be overridden for app eval - title: Params - required: - - identifier - - provider_id - - return_type - title: ScoringFn + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Context + type: object + required: + - content + title: UserMessage + description: "A message from the user in a chat conversation.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param context: (Optional) This field is used internally by Llama Stack to pass RAG context. This field may be removed in the API in the future." + VectorStoreChunkingStrategyAuto: + properties: + type: + type: string + const: auto + title: Type + default: auto + type: object + title: VectorStoreChunkingStrategyAuto + description: "Automatic chunking strategy for vector store files.\n\n:param type: Strategy type, always \"auto\" for automatic chunking" + VectorStoreChunkingStrategyStatic: + properties: + type: + type: string + const: static + title: Type + default: static + static: + $ref: '#/components/schemas/VectorStoreChunkingStrategyStaticConfig' + type: object + required: + - static + title: VectorStoreChunkingStrategyStatic + description: "Static chunking strategy with configurable parameters.\n\n:param type: Strategy type, always \"static\" for static chunking\n:param static: Configuration parameters for the static chunking strategy" + VectorStoreChunkingStrategyStaticConfig: + properties: + chunk_overlap_tokens: + type: integer + title: Chunk Overlap Tokens + default: 400 + max_chunk_size_tokens: + type: integer + maximum: 4096.0 + minimum: 100.0 + title: Max Chunk Size Tokens + default: 800 + type: object + title: VectorStoreChunkingStrategyStaticConfig + description: "Configuration for static chunking strategy.\n\n:param chunk_overlap_tokens: Number of tokens to overlap between adjacent chunks\n:param max_chunk_size_tokens: Maximum number of tokens per chunk, must be between 100 and 4096" + VectorStoreContent: + properties: + type: + type: string + const: text + title: Type + text: + type: string + title: Text + type: object + required: + - type + - text + title: VectorStoreContent + description: "Content item from a vector store file or search result.\n\n:param type: Content type, currently only \"text\" is supported\n:param text: The actual text content" + VectorStoreFileBatchObject: + properties: + id: + type: string + title: Id + object: + type: string + title: Object + default: vector_store.file_batch + created_at: + type: integer + title: Created At + vector_store_id: + type: string + title: Vector Store Id + status: + anyOf: + - type: string + const: completed + - type: string + const: in_progress + - type: string + const: cancelled + - type: string + const: failed + title: Status + file_counts: + $ref: '#/components/schemas/VectorStoreFileCounts' + type: object + required: + - id + - created_at + - vector_store_id + - status + - file_counts + title: VectorStoreFileBatchObject + description: "OpenAI Vector Store File Batch object.\n\n:param id: Unique identifier for the file batch\n:param object: Object type identifier, always \"vector_store.file_batch\"\n:param created_at: Timestamp when the file batch was created\n:param vector_store_id: ID of the vector store containing the file batch\n:param status: Current processing status of the file batch\n:param file_counts: File processing status counts for the batch" + VectorStoreFileCounts: + properties: + completed: + type: integer + title: Completed + cancelled: + type: integer + title: Cancelled + failed: + type: integer + title: Failed + in_progress: + type: integer + title: In Progress + total: + type: integer + title: Total + type: object + required: + - completed + - cancelled + - failed + - in_progress + - total + title: VectorStoreFileCounts + description: "File processing status counts for a vector store.\n\n:param completed: Number of files that have been successfully processed\n:param cancelled: Number of files that had their processing cancelled\n:param failed: Number of files that failed to process\n:param in_progress: Number of files currently being processed\n:param total: Total number of files in the vector store" + VectorStoreFileLastError: + properties: + code: + anyOf: + - type: string + const: server_error + - type: string + const: rate_limit_exceeded + title: Code + message: + type: string + title: Message + type: object + required: + - code + - message + title: VectorStoreFileLastError + description: "Error information for failed vector store file processing.\n\n:param code: Error code indicating the type of failure\n:param message: Human-readable error message describing the failure" + VectorStoreFileObject: + properties: + id: + type: string + title: Id + object: + type: string + title: Object + default: vector_store.file + attributes: + additionalProperties: true type: object - StringType: - description: >- - Parameter type for string values. - - - :param type: Discriminator type. Always "string" - properties: - type: - const: string - default: string - title: Type - type: string - title: StringType + title: Attributes + chunking_strategy: + oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + title: Chunking Strategy + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + created_at: + type: integer + title: Created At + last_error: + $ref: '#/components/schemas/VectorStoreFileLastError' + status: + anyOf: + - type: string + const: completed + - type: string + const: in_progress + - type: string + const: cancelled + - type: string + const: failed + title: Status + usage_bytes: + type: integer + title: Usage Bytes + default: 0 + vector_store_id: + type: string + title: Vector Store Id + type: object + required: + - id + - chunking_strategy + - created_at + - status + - vector_store_id + title: VectorStoreFileObject + description: "OpenAI Vector Store File object.\n\n:param id: Unique identifier for the file\n:param object: Object type identifier, always \"vector_store.file\"\n:param attributes: Key-value attributes associated with the file\n:param chunking_strategy: Strategy used for splitting the file into chunks\n:param created_at: Timestamp when the file was added to the vector store\n:param last_error: (Optional) Error information if file processing failed\n:param status: Current processing status of the file\n:param usage_bytes: Storage space used by this file in bytes\n:param vector_store_id: ID of the vector store containing this file" + VectorStoreObject: + properties: + id: + type: string + title: Id + object: + type: string + title: Object + default: vector_store + created_at: + type: integer + title: Created At + name: + title: Name + type: string + usage_bytes: + type: integer + title: Usage Bytes + default: 0 + file_counts: + $ref: '#/components/schemas/VectorStoreFileCounts' + status: + type: string + title: Status + default: completed + expires_after: + title: Expires After + additionalProperties: true type: object - UnionType: - description: >- - Parameter type for union values. - - - :param type: Discriminator type. Always "union" - properties: - type: - const: union - default: union - title: Type - type: string - title: UnionType + expires_at: + title: Expires At + type: integer + last_active_at: + title: Last Active At + type: integer + metadata: + additionalProperties: true + type: object + title: Metadata + type: object + required: + - id + - created_at + - file_counts + title: VectorStoreObject + description: "OpenAI Vector Store object.\n\n:param id: Unique identifier for the vector store\n:param object: Object type identifier, always \"vector_store\"\n:param created_at: Timestamp when the vector store was created\n:param name: (Optional) Name of the vector store\n:param usage_bytes: Storage space used by the vector store in bytes\n:param file_counts: File processing status counts for the vector store\n:param status: Current status of the vector store\n:param expires_after: (Optional) Expiration policy for the vector store\n:param expires_at: (Optional) Timestamp when the vector store will expire\n:param last_active_at: (Optional) Timestamp of last activity on the vector store\n:param metadata: Set of key-value pairs that can be attached to the vector store" + VectorStoreSearchResponse: + properties: + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + score: + type: number + title: Score + attributes: + title: Attributes + additionalProperties: + anyOf: + - type: string + - type: number + - type: boolean type: object + content: + items: + $ref: '#/components/schemas/VectorStoreContent' + type: array + title: Content + type: object + required: + - file_id + - filename + - score + - content + title: VectorStoreSearchResponse + description: "Response from searching a vector store.\n\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result\n:param attributes: (Optional) Key-value attributes associated with the file\n:param content: List of content items matching the search query" + VectorStoreSearchResponsePage: properties: + object: + type: string + title: Object + default: vector_store.search_results.page + search_query: + type: string + title: Search Query data: items: - $ref: '#/$defs/ScoringFn' - title: Data + $ref: '#/components/schemas/VectorStoreSearchResponse' type: array + title: Data + has_more: + type: boolean + title: Has More + default: false + next_page: + title: Next Page + type: string + type: object required: - - data - title: ListScoringFunctionsResponse + - search_query + - data + title: VectorStoreSearchResponsePage + description: "Paginated response from searching a vector store.\n\n:param object: Object type identifier for the search results page\n:param search_query: The original search query that was executed\n:param data: List of search result objects\n:param has_more: Whether there are more results available beyond this page\n:param next_page: (Optional) Token for retrieving the next page of results" + VersionInfo: + properties: + version: + type: string + title: Version type: object - RegisterScoringFunctionRequest: + required: + - version + title: VersionInfo + description: "Version information for the service.\n\n:param version: Version number of the service" + ViolationLevel: + type: string + enum: + - info + - warn + - error + title: ViolationLevel + description: "Severity level of a safety violation.\n\n:cvar INFO: Informational level violation that does not require action\n:cvar WARN: Warning level violation that suggests caution but allows continuation\n:cvar ERROR: Error level violation that requires blocking or intervention" + WeightedRanker: + properties: + type: + type: string + const: weighted + title: Type + default: weighted + alpha: + type: number + maximum: 1.0 + minimum: 0.0 + title: Alpha + description: Weight factor between 0 and 1. 0 means only keyword scores, 1 means only vector scores. + default: 0.5 type: object - ScoringFn: - $defs: - AgentTurnInputType: - description: >- - Parameter type for agent turn input. - - - :param type: Discriminator type. Always "agent_turn_input" - properties: - type: - const: agent_turn_input - default: agent_turn_input - title: Type - type: string - title: AgentTurnInputType - type: object - AggregationFunctionType: - description: >- - Types of aggregation functions for scoring results. - - :cvar average: Calculate the arithmetic mean of scores - - :cvar weighted_average: Calculate a weighted average of scores - - :cvar median: Calculate the median value of scores - - :cvar categorical_count: Count occurrences of categorical values - - :cvar accuracy: Calculate accuracy as the proportion of correct answers - enum: - - average - - weighted_average - - median - - categorical_count - - accuracy - title: AggregationFunctionType - type: string - ArrayType: - description: >- - Parameter type for array values. - - - :param type: Discriminator type. Always "array" - properties: - type: - const: array - default: array - title: Type - type: string - title: ArrayType - type: object - BasicScoringFnParams: - description: >- - Parameters for basic scoring function configuration. - - :param type: The type of scoring function parameters, always basic - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row - properties: - type: - const: basic - default: basic - title: Type - type: string - aggregation_functions: - description: >- - Aggregation functions to apply to the scores of each row - items: - $ref: '#/$defs/AggregationFunctionType' - title: Aggregation Functions - type: array - title: BasicScoringFnParams - type: object - BooleanType: - description: >- - Parameter type for boolean values. - - - :param type: Discriminator type. Always "boolean" - properties: - type: - const: boolean - default: boolean - title: Type - type: string - title: BooleanType - type: object - ChatCompletionInputType: - description: >- - Parameter type for chat completion input. - - - :param type: Discriminator type. Always "chat_completion_input" - properties: - type: - const: chat_completion_input - default: chat_completion_input - title: Type - type: string - title: ChatCompletionInputType - type: object - CompletionInputType: - description: >- - Parameter type for completion input. - - - :param type: Discriminator type. Always "completion_input" - properties: - type: - const: completion_input - default: completion_input - title: Type - type: string - title: CompletionInputType - type: object - JsonType: - description: >- - Parameter type for JSON values. - - - :param type: Discriminator type. Always "json" - properties: - type: - const: json - default: json - title: Type - type: string - title: JsonType - type: object - LLMAsJudgeScoringFnParams: - description: >- - Parameters for LLM-as-judge scoring function configuration. - - :param type: The type of scoring function parameters, always llm_as_judge - - :param judge_model: Identifier of the LLM model to use as a judge for - scoring - - :param prompt_template: (Optional) Custom prompt template for the judge - model - - :param judge_score_regexes: Regexes to extract the answer from generated - response - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row - properties: - type: - const: llm_as_judge - default: llm_as_judge - title: Type - type: string - judge_model: - title: Judge Model - type: string - prompt_template: - anyOf: - - type: string - - type: 'null' - title: Prompt Template - judge_score_regexes: - description: >- - Regexes to extract the answer from generated response - items: - type: string - title: Judge Score Regexes - type: array - aggregation_functions: - description: >- - Aggregation functions to apply to the scores of each row - items: - $ref: '#/$defs/AggregationFunctionType' - title: Aggregation Functions - type: array - required: - - judge_model - title: LLMAsJudgeScoringFnParams - type: object - NumberType: - description: >- - Parameter type for numeric values. - - - :param type: Discriminator type. Always "number" - properties: - type: - const: number - default: number - title: Type - type: string - title: NumberType - type: object - ObjectType: - description: >- - Parameter type for object values. - - - :param type: Discriminator type. Always "object" - properties: - type: - const: object - default: object - title: Type - type: string - title: ObjectType - type: object - RegexParserScoringFnParams: - description: >- - Parameters for regex parser scoring function configuration. - - :param type: The type of scoring function parameters, always regex_parser - - :param parsing_regexes: Regex to extract the answer from generated response - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row - properties: - type: - const: regex_parser - default: regex_parser - title: Type - type: string - parsing_regexes: - description: >- - Regex to extract the answer from generated response - items: - type: string - title: Parsing Regexes - type: array - aggregation_functions: - description: >- - Aggregation functions to apply to the scores of each row - items: - $ref: '#/$defs/AggregationFunctionType' - title: Aggregation Functions - type: array - title: RegexParserScoringFnParams - type: object - StringType: - description: >- - Parameter type for string values. - - - :param type: Discriminator type. Always "string" - properties: - type: - const: string - default: string - title: Type - type: string - title: StringType - type: object - UnionType: - description: >- - Parameter type for union values. - - - :param type: Discriminator type. Always "union" - properties: - type: - const: union - default: union - title: Type - type: string - title: UnionType - type: object - description: >- - A scoring function resource for evaluating model outputs. - - :param type: The resource type, always scoring_function + title: WeightedRanker + description: "Weighted ranker configuration that combines vector and keyword scores.\n\n:param type: The type of ranker, always \"weighted\"\n:param alpha: Weight factor between 0 and 1.\n 0 means only use keyword scores,\n 1 means only use vector scores,\n values in between blend both scores." + _URLOrData: + properties: + url: + $ref: '#/components/schemas/URL' + data: + contentEncoding: base64 + title: Data + type: string + type: object + title: _URLOrData + description: "A URL or a base64 encoded string\n\n:param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. Note that URL could have length limits.\n:param data: base64 encoded image data as string" + __main_____agents_agent_id_session_Request: + properties: + agent_id: + type: string + title: Agent Id + session_name: + type: string + title: Session Name + type: object + required: + - agent_id + - session_name + title: _agents_agent_id_session_Request + __main_____agents_agent_id_session_session_id_turn_Request: + properties: + agent_id: + type: string + title: Agent Id + session_id: + type: string + title: Session Id + messages: + $ref: '#/components/schemas/UserMessage-Input' + stream: + type: boolean + title: Stream + default: false + documents: + $ref: '#/components/schemas/Document' + toolgroups: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + title: Toolgroups + tool_config: + $ref: '#/components/schemas/ToolConfig' + type: object + required: + - agent_id + - session_id + - messages + - documents + - toolgroups + - tool_config + title: _agents_agent_id_session_session_id_turn_Request + __main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request: + properties: + agent_id: + type: string + title: Agent Id + session_id: + type: string + title: Session Id + turn_id: + type: string + title: Turn Id + tool_responses: + $ref: '#/components/schemas/ToolResponse-Input' + stream: + type: boolean + title: Stream + default: false + type: object + required: + - agent_id + - session_id + - turn_id + - tool_responses + title: _agents_agent_id_session_session_id_turn_turn_id_resume_Request + __main_____datasets_Request: properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier + purpose: + $ref: '#/components/schemas/DatasetPurpose' + metadata: type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id + title: Metadata + dataset_id: type: string - type: - const: scoring_function - default: scoring_function - title: Type + title: Dataset Id + type: object + required: + - purpose + - metadata + - dataset_id + title: _datasets_Request + _batches_Request: + properties: + input_file_id: type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description + title: Input File Id + endpoint: + type: string + title: Endpoint + completion_window: + type: string + title: Completion Window metadata: - additionalProperties: true - description: >- - Any additional metadata for this definition + type: string title: Metadata - type: object - return_type: - description: >- - The return type of the deterministic function + idempotency_key: + type: string + title: Idempotency Key + type: object + required: + - input_file_id + - endpoint + - completion_window + - metadata + - idempotency_key + title: _batches_Request + _batches_batch_id_cancel_Request: + properties: + batch_id: + type: string + title: Batch Id + type: object + required: + - batch_id + title: _batches_batch_id_cancel_Request + _conversations_Request: + properties: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + title: Items discriminator: - mapping: - agent_turn_input: '#/$defs/AgentTurnInputType' - array: '#/$defs/ArrayType' - boolean: '#/$defs/BooleanType' - chat_completion_input: '#/$defs/ChatCompletionInputType' - completion_input: '#/$defs/CompletionInputType' - json: '#/$defs/JsonType' - number: '#/$defs/NumberType' - object: '#/$defs/ObjectType' - string: '#/$defs/StringType' - union: '#/$defs/UnionType' propertyName: type - oneOf: - - $ref: '#/$defs/StringType' - - $ref: '#/$defs/NumberType' - - $ref: '#/$defs/BooleanType' - - $ref: '#/$defs/ArrayType' - - $ref: '#/$defs/ObjectType' - - $ref: '#/$defs/JsonType' - - $ref: '#/$defs/UnionType' - - $ref: '#/$defs/ChatCompletionInputType' - - $ref: '#/$defs/CompletionInputType' - - $ref: '#/$defs/AgentTurnInputType' - title: Return Type - params: + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Input' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + metadata: + type: string + title: Metadata + type: object + required: + - items + - metadata + title: _conversations_Request + _conversations_conversation_id_Request: + properties: + conversation_id: + type: string + title: Conversation Id + metadata: + type: string + title: Metadata + type: object + required: + - conversation_id + - metadata + title: _conversations_conversation_id_Request + _conversations_conversation_id_items_Request: + properties: + conversation_id: + type: string + title: Conversation Id + items: anyOf: - - discriminator: - mapping: - basic: '#/$defs/BasicScoringFnParams' - llm_as_judge: '#/$defs/LLMAsJudgeScoringFnParams' - regex_parser: '#/$defs/RegexParserScoringFnParams' - propertyName: type - oneOf: - - $ref: '#/$defs/LLMAsJudgeScoringFnParams' - - $ref: '#/$defs/RegexParserScoringFnParams' - - $ref: '#/$defs/BasicScoringFnParams' - - type: 'null' - description: >- - The parameters for the scoring function for benchmark eval, these can - be overridden for app eval - title: Params + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + title: Items + type: object required: - - identifier - - provider_id - - return_type - title: ScoringFn + - conversation_id + - items + title: _conversations_conversation_id_items_Request + _inference_rerank_Request: + properties: + model: + type: string + title: Model + query: + type: string + title: Query + items: + type: string + title: Items + max_num_results: + type: integer + title: Max Num Results type: object - ScoreRequest: + required: + - model + - query + - items + - max_num_results + title: _inference_rerank_Request + _models_Request: + properties: + model_id: + type: string + title: Model Id + provider_model_id: + type: string + title: Provider Model Id + provider_id: + type: string + title: Provider Id + metadata: + type: string + title: Metadata + model_type: + $ref: '#/components/schemas/ModelType' type: object - ScoreResponse: - $defs: - ScoringResult: - description: >- - A scoring result for a single row. - - - :param score_rows: The scoring result for each row. Each row is a map - of column name to value. - - :param aggregated_results: Map of metric name to aggregated value - properties: - score_rows: - items: - additionalProperties: true - type: object - title: Score Rows - type: array - aggregated_results: - additionalProperties: true - title: Aggregated Results - type: object - required: - - score_rows - - aggregated_results - title: ScoringResult - type: object - description: >- - The response from scoring. - - - :param results: A map of scoring function name to ScoringResult. + required: + - model_id + - provider_model_id + - provider_id + - metadata + - model_type + title: _models_Request + _moderations_Request: properties: - results: - additionalProperties: - $ref: '#/$defs/ScoringResult' - title: Results - type: object + input: + type: string + title: Input + model: + type: string + title: Model + type: object required: - - results - title: ScoreResponse + - input + - model + title: _moderations_Request + _prompts_Request: + properties: + prompt: + type: string + title: Prompt + variables: + type: string + title: Variables type: object - ScoreBatchRequest: + required: + - prompt + - variables + title: _prompts_Request + _prompts_prompt_id_Request: + properties: + prompt_id: + type: string + title: Prompt Id + prompt: + type: string + title: Prompt + version: + type: integer + title: Version + variables: + type: string + title: Variables + set_as_default: + type: boolean + title: Set As Default + default: true + type: object + required: + - prompt_id + - prompt + - version + - variables + title: _prompts_prompt_id_Request + _prompts_prompt_id_set_default_version_Request: + properties: + prompt_id: + type: string + title: Prompt Id + version: + type: integer + title: Version + type: object + required: + - prompt_id + - version + title: _prompts_prompt_id_set_default_version_Request + _responses_Request: + properties: + input: + type: string + title: Input + model: + type: string + title: Model + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' + instructions: + type: string + title: Instructions + previous_response_id: + type: string + title: Previous Response Id + conversation: + type: string + title: Conversation + store: + type: boolean + title: Store + default: true + stream: + type: boolean + title: Stream + default: false + temperature: + type: number + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + tools: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' + title: Tools + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseInputToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + include: + type: string + title: Include + max_infer_iters: + type: integer + title: Max Infer Iters + default: 10 + type: object + required: + - input + - model + - prompt + - instructions + - previous_response_id + - conversation + - temperature + - text + - tools + - include + title: _responses_Request + _scoring_score_Request: + properties: + input_rows: + type: string + title: Input Rows + scoring_functions: + type: string + title: Scoring Functions type: object - ScoreBatchResponse: - $defs: - ScoringResult: - description: >- - A scoring result for a single row. - - - :param score_rows: The scoring result for each row. Each row is a map - of column name to value. - - :param aggregated_results: Map of metric name to aggregated value - properties: - score_rows: - items: - additionalProperties: true - type: object - title: Score Rows - type: array - aggregated_results: - additionalProperties: true - title: Aggregated Results - type: object - required: - - score_rows - - aggregated_results - title: ScoringResult - type: object - description: >- - Response from batch scoring operations on datasets. - - - :param dataset_id: (Optional) The identifier of the dataset that was scored - - :param results: A map of scoring function name to ScoringResult + required: + - input_rows + - scoring_functions + title: _scoring_score_Request + _scoring_score_batch_Request: properties: dataset_id: - anyOf: - - type: string - - type: 'null' + type: string title: Dataset Id - results: - additionalProperties: - $ref: '#/$defs/ScoringResult' - title: Results - type: object - required: - - results - title: ScoreBatchResponse + scoring_functions: + type: string + title: Scoring Functions + save_results_dataset: + type: boolean + title: Save Results Dataset + default: false type: object - ListShieldsResponse: - $defs: - Shield: - description: >- - A safety shield resource that can be used to check content. - - - :param params: (Optional) Configuration parameters for the shield - - :param type: The resource type, always shield - properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier - type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: shield - default: shield - title: Type - type: string - params: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Params - required: - - identifier - - provider_id - title: Shield - type: object - properties: - data: - items: - $ref: '#/$defs/Shield' - title: Data - type: array required: - - data - title: ListShieldsResponse - type: object - RegisterShieldRequest: - type: object + - dataset_id + - scoring_functions + title: _scoring_score_batch_Request + _shields_Request: properties: shield_id: type: string - description: >- - The identifier of the shield to register. + title: Shield Id provider_shield_id: type: string - description: >- - The identifier of the shield in the provider. + title: Provider Shield Id provider_id: type: string - description: The identifier of the provider. + title: Provider Id params: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The parameters of the shield. - additionalProperties: false - required: - - shield_id - title: RegisterShieldRequest - InvokeToolRequest: + type: string + title: Params type: object + required: + - shield_id + - provider_shield_id + - provider_id + - params + title: _shields_Request + _tool_runtime_invoke_Request: properties: tool_name: type: string - description: The name of the tool to invoke. + title: Tool Name kwargs: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - A dictionary of arguments to pass to the tool. - additionalProperties: false - required: - - tool_name - - kwargs - title: InvokeToolRequest - ImageContentItem: - type: object - properties: - type: type: string - const: image - default: image - description: >- - Discriminator type of the content item. Always "image" - image: - type: object - properties: - url: - $ref: '#/components/schemas/URL' - description: >- - A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - data: - type: string - contentEncoding: base64 - description: base64 encoded image data as string - additionalProperties: false - description: >- - Image as a base64 encoded string or an URL - additionalProperties: false - required: - - type - - image - title: ImageContentItem - description: A image content item - InterleavedContent: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - InterleavedContentItem: - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem' - text: '#/components/schemas/TextContentItem' - TextContentItem: + title: Kwargs type: object - properties: - type: - type: string - const: text - default: text - description: >- - Discriminator type of the content item. Always "text" - text: - type: string - description: Text content - additionalProperties: false required: - - type - - text - title: TextContentItem - description: A text content item - ToolInvocationResult: - type: object + - tool_name + - kwargs + title: _tool_runtime_invoke_Request + _tool_runtime_rag_tool_query_Request: properties: content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - (Optional) The output content from the tool execution - error_message: type: string - description: >- - (Optional) Error message if the tool execution failed - error_code: - type: integer - description: >- - (Optional) Numeric error code if the tool execution failed - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool execution - additionalProperties: false - title: ToolInvocationResult - description: Result of a tool invocation. - URL: + title: Content + vector_store_ids: + type: string + title: Vector Store Ids + query_config: + $ref: '#/components/schemas/RAGQueryConfig' type: object + required: + - content + - vector_store_ids + - query_config + title: _tool_runtime_rag_tool_query_Request + _vector_io_query_Request: properties: - uri: + vector_store_id: type: string - description: The URL string pointing to the resource - additionalProperties: false - required: - - uri - title: URL - description: A URL reference to external content. - ToolDef: + title: Vector Store Id + query: + type: string + title: Query + params: + type: string + title: Params type: object + required: + - vector_store_id + - query + - params + title: _vector_io_query_Request + _vector_stores_vector_store_id_Request: properties: - toolgroup_id: + vector_store_id: type: string - description: >- - (Optional) ID of the tool group this tool belongs to + title: Vector Store Id name: type: string - description: Name of the tool - description: + title: Name + expires_after: type: string - description: >- - (Optional) Human-readable description of what the tool does - input_schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON Schema for tool inputs (MCP inputSchema) - output_schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON Schema for tool outputs (MCP outputSchema) + title: Expires After metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool - additionalProperties: false - required: - - name - title: ToolDef - description: >- - Tool definition used in runtime contexts. - ListToolDefsResponse: + type: string + title: Metadata type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/ToolDef' - description: List of tool definitions - additionalProperties: false required: - - data - title: ListToolDefsResponse - description: >- - Response containing a list of tool definitions. - RAGDocument: - type: object + - vector_store_id + - name + - expires_after + - metadata + title: _vector_stores_vector_store_id_Request + _vector_stores_vector_store_id_file_batches_batch_id_cancel_Request: properties: - document_id: + batch_id: type: string - description: The unique identifier for the document. - content: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - - $ref: '#/components/schemas/URL' - description: The content of the document. - mime_type: + title: Batch Id + vector_store_id: type: string - description: The MIME type of the document. - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Additional metadata for the document. - additionalProperties: false - required: - - document_id - - content - - metadata - title: RAGDocument - description: >- - A document to be used for document ingestion in the RAG Tool. - InsertRequest: + title: Vector Store Id type: object + required: + - batch_id + - vector_store_id + title: _vector_stores_vector_store_id_file_batches_batch_id_cancel_Request + _vector_stores_vector_store_id_files_Request: properties: - documents: - type: array - items: - $ref: '#/components/schemas/RAGDocument' - description: >- - List of documents to index in the RAG system vector_store_id: type: string - description: >- - ID of the vector database to store the document embeddings - chunk_size_in_tokens: - type: integer - description: >- - (Optional) Size in tokens for document chunking during indexing - additionalProperties: false - required: - - documents - - vector_store_id - - chunk_size_in_tokens - title: InsertRequest - DefaultRAGQueryGeneratorConfig: + title: Vector Store Id + file_id: + type: string + title: File Id + attributes: + type: string + title: Attributes + chunking_strategy: + anyOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + title: Chunking Strategy type: object + required: + - vector_store_id + - file_id + - attributes + - chunking_strategy + title: _vector_stores_vector_store_id_files_Request + _vector_stores_vector_store_id_files_file_id_Request: properties: - type: + vector_store_id: type: string - const: default - default: default - description: >- - Type of query generator, always 'default' - separator: + title: Vector Store Id + file_id: type: string - default: ' ' - description: >- - String separator used to join query terms - additionalProperties: false - required: - - type - - separator - title: DefaultRAGQueryGeneratorConfig - description: >- - Configuration for the default RAG query generator. - LLMRAGQueryGeneratorConfig: + title: File Id + attributes: + type: string + title: Attributes type: object + required: + - vector_store_id + - file_id + - attributes + title: _vector_stores_vector_store_id_files_file_id_Request + _vector_stores_vector_store_id_search_Request: properties: - type: + vector_store_id: type: string - const: llm - default: llm - description: Type of query generator, always 'llm' - model: + title: Vector Store Id + query: type: string - description: >- - Name of the language model to use for query generation - template: + title: Query + filters: type: string - description: >- - Template string for formatting the query generation prompt - additionalProperties: false - required: - - type - - model - - template - title: LLMRAGQueryGeneratorConfig - description: >- - Configuration for the LLM-based RAG query generator. - RAGQueryConfig: + title: Filters + max_num_results: + type: integer + title: Max Num Results + default: 10 + ranking_options: + $ref: '#/components/schemas/SearchRankingOptions' + rewrite_query: + type: boolean + title: Rewrite Query + default: false + search_mode: + type: string + title: Search Mode + default: vector type: object + required: + - vector_store_id + - query + - filters + - ranking_options + title: _vector_stores_vector_store_id_search_Request + Error: + description: "Error response from the API. Roughly follows RFC 7807.\n\n:param status: HTTP status code\n:param title: Error title, a short summary of the error which is invariant for an error type\n:param detail: Error detail, a longer human-readable description of the error\n:param instance: (Optional) A URL which can be used to retrieve more information about the specific occurrence of the error" properties: - query_generator_config: - oneOf: - - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' - - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' - discriminator: - propertyName: type - mapping: - default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' - llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' - description: Configuration for the query generator. - max_tokens_in_context: - type: integer - default: 4096 - description: Maximum number of tokens in the context. - max_chunks: + status: + title: Status type: integer - default: 5 - description: Maximum number of chunks to retrieve. - chunk_template: + title: + title: Title type: string - default: > - Result {index} - - - :param params: (Optional) Configuration parameters for the shield - - :param type: The resource type, always shield - properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier + detail: + title: Detail type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id + instance: + title: Instance type: string - type: - const: shield - default: shield - title: Type + nullable: true + required: + - status + - title + - detail + title: Error + type: object + Agent: + description: "An agent instance with configuration and metadata.\n\n:param agent_id: Unique identifier for the agent\n:param agent_config: Configuration settings for the agent\n:param created_at: Timestamp when the agent was created" + properties: + agent_id: + title: Agent Id + type: string + agent_config: + $ref: '#/components/schemas/AgentConfig' + created_at: + format: date-time + title: Created At type: string - params: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Params required: - - identifier - - provider_id - title: Shield - type: object - SyntheticDataGenerateRequest: + - agent_id + - agent_config + - created_at + title: Agent type: object - SyntheticDataGenerationResponse: - description: >- - Response from the synthetic data generation. Batch of (prompt, response, score) - tuples that pass the threshold. - - - :param synthetic_data: List of generated synthetic data samples that passed - the filtering criteria - - :param statistics: (Optional) Statistical information about the generation - process and filtering results + AgentStepResponse: + description: "Response containing details of a specific agent step.\n\n:param step: The complete step data and execution details" properties: - synthetic_data: - items: - additionalProperties: true - type: object - title: Synthetic Data - type: array - statistics: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Statistics + step: + discriminator: + mapping: + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/components/schemas/InferenceStep' + - $ref: '#/components/schemas/ToolExecutionStep' + - $ref: '#/components/schemas/ShieldCallStep' + - $ref: '#/components/schemas/MemoryRetrievalStep' + title: Step required: - - synthetic_data - title: SyntheticDataGenerationResponse - type: object - InvokeToolRequest: + - step + title: AgentStepResponse type: object - ToolInvocationResult: - $defs: - ImageContentItem: - description: >- - A image content item - - - :param type: Discriminator type of the content item. Always "image" - - :param image: Image as a base64 encoded string or an URL - properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/$defs/_URLOrData' - required: - - image - title: ImageContentItem - type: object - TextContentItem: - description: >- - A text content item - - - :param type: Discriminator type of the content item. Always "text" - - :param text: Text content - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: TextContentItem - type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL - type: object - _URLOrData: - description: >- - A URL or a base64 encoded string - - - :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - - :param data: base64 encoded image data as string - properties: - url: - anyOf: - - $ref: '#/$defs/URL' - - type: 'null' - data: - anyOf: - - type: string - - type: 'null' - contentEncoding: base64 - title: Data - title: _URLOrData - type: object - description: >- - Result of a tool invocation. - - - :param content: (Optional) The output content from the tool execution - - :param error_message: (Optional) Error message if the tool execution failed - - :param error_code: (Optional) Numeric error code if the tool execution failed - - :param metadata: (Optional) Additional metadata about the tool execution + CompletionMessage: + description: "A message containing the model's (assistant) response in a chat conversation.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param stop_reason: Reason why the model stopped generating. Options are:\n - `StopReason.end_of_turn`: The model finished generating the entire response.\n - `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n - `StopReason.out_of_tokens`: The model ran out of token budget.\n:param tool_calls: List of tool calls. Each tool call is a ToolCall object." properties: + role: + const: assistant + default: assistant + title: Role + type: string content: anyOf: - - type: string - - discriminator: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: mapping: image: '#/$defs/ImageContentItem' text: '#/$defs/TextContentItem' propertyName: type oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - type: 'null' + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array title: Content - error_message: - anyOf: - - type: string - - type: 'null' - title: Error Message - error_code: - anyOf: - - type: integer - - type: 'null' - title: Error Code - metadata: + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + title: Tool Calls + items: + $ref: '#/components/schemas/ToolCall' + type: array + required: + - content + - stop_reason + title: CompletionMessage + type: object + InferenceStep: + description: "An inference step in an agent turn.\n\n:param model_response: The response from the LLM." + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + title: Started At + format: date-time + type: string + nullable: true + completed_at: + title: Completed At + format: date-time + type: string + nullable: true + step_type: + const: inference + default: inference + title: Step Type + type: string + model_response: + $ref: '#/components/schemas/CompletionMessage' + required: + - turn_id + - step_id + - model_response + title: InferenceStep + type: object + ListOpenAIResponseInputItem: + description: "List container for OpenAI response input items.\n\n:param data: List of input items\n:param object: Object type identifier, always \"list\"" + properties: + data: + items: + anyOf: + - discriminator: + mapping: + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage' + title: Data + type: array + object: + const: list + default: list + title: Object + type: string + required: + - data + title: ListOpenAIResponseInputItem + type: object + ListOpenAIResponseObject: + description: "Paginated list of OpenAI response objects with navigation metadata.\n\n:param data: List of response objects with their input context\n:param has_more: Whether there are more results available beyond this page\n:param first_id: Identifier of the first item in this page\n:param last_id: Identifier of the last item in this page\n:param object: Object type identifier, always \"list\"" + properties: + data: + items: + $ref: '#/components/schemas/OpenAIResponseObjectWithInput' + title: Data + type: array + has_more: + title: Has More + type: boolean + first_id: + title: First Id + type: string + last_id: + title: Last Id + type: string + object: + const: list + default: list + title: Object + type: string + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIResponseObject + type: object + MemoryRetrievalStep: + description: "A memory retrieval step in an agent turn.\n\n:param vector_store_ids: The IDs of the vector databases to retrieve context from.\n:param inserted_context: The context retrieved from the vector databases." + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + title: Started At + format: date-time + type: string + nullable: true + completed_at: + title: Completed At + format: date-time + type: string + nullable: true + step_type: + const: memory_retrieval + default: memory_retrieval + title: Step Type + type: string + vector_store_ids: + title: Vector Store Ids + type: string + inserted_context: anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Metadata - title: ToolInvocationResult + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Inserted Context + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource + OpenAIDeleteResponseObject: + description: "Response object confirming deletion of an OpenAI response.\n\n:param id: Unique identifier of the deleted response\n:param object: Object type identifier, always \"response\"\n:param deleted: Deletion confirmation flag, always True" properties: - uri: - title: Uri + id: + title: Id + type: string + object: + const: response + default: response + title: Object type: string + deleted: + default: true + title: Deleted + type: boolean required: - - uri - title: URL + - id + title: OpenAIDeleteResponseObject type: object - ListToolDefsResponse: - $defs: - ToolDef: - description: >- - Tool definition used in runtime contexts. - - - :param name: Name of the tool - - :param description: (Optional) Human-readable description of what the - tool does - - :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) - - :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) - - :param metadata: (Optional) Additional metadata about the tool - - :param toolgroup_id: (Optional) ID of the tool group this tool belongs - to - properties: - toolgroup_id: - anyOf: - - type: string - - type: 'null' - title: Toolgroup Id - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - input_schema: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Input Schema - output_schema: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Output Schema - metadata: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Metadata - required: - - name - title: ToolDef - type: object - description: >- - Response containing a list of tool definitions. - - - :param data: List of tool definitions + PaginatedResponse: + description: "A generic paginated response that follows a simple format.\n\n:param data: The list of items for the current page\n:param has_more: Whether there are more items available after this set\n:param url: The URL for accessing this list" properties: data: items: - $ref: '#/$defs/ToolDef' + additionalProperties: true + type: object title: Data type: array + has_more: + title: Has More + type: boolean + url: + title: Url + type: string + nullable: true required: - - data - title: ListToolDefsResponse + - data + - has_more + title: PaginatedResponse type: object - InsertRequest: + Session: + description: "A single session of an interaction with an Agentic System.\n\n:param session_id: Unique identifier for the conversation session\n:param session_name: Human-readable name for the session\n:param turns: List of all turns that have occurred in this session\n:param started_at: Timestamp when the session was created" + properties: + session_id: + title: Session Id + type: string + session_name: + title: Session Name + type: string + turns: + items: + $ref: '#/components/schemas/Turn' + title: Turns + type: array + started_at: + format: date-time + title: Started At + type: string + required: + - session_id + - session_name + - turns + - started_at + title: Session type: object - QueryRequest: + ShieldCallStep: + description: "A shield call step in an agent turn.\n\n:param violation: The violation from the shield call." + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + title: Started At + format: date-time + type: string + nullable: true + completed_at: + title: Completed At + format: date-time + type: string + nullable: true + step_type: + const: shield_call + default: shield_call + title: Step Type + type: string + violation: + $ref: '#/components/schemas/SafetyViolation' + required: + - turn_id + - step_id + - violation + title: ShieldCallStep type: object - RAGQueryResult: - $defs: - ImageContentItem: - description: >- - A image content item - - - :param type: Discriminator type of the content item. Always "image" - - :param image: Image as a base64 encoded string or an URL - properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/$defs/_URLOrData' - required: - - image - title: ImageContentItem - type: object - TextContentItem: - description: >- - A text content item - - - :param type: Discriminator type of the content item. Always "text" - - :param text: Text content - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: TextContentItem - type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL - type: object - _URLOrData: - description: >- - A URL or a base64 encoded string - - - :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - - :param data: base64 encoded image data as string - properties: - url: - anyOf: - - $ref: '#/$defs/URL' - - type: 'null' - data: - anyOf: - - type: string - - type: 'null' - contentEncoding: base64 - title: Data - title: _URLOrData - type: object - description: >- - Result of a RAG query containing retrieved content and metadata. - - - :param content: (Optional) The retrieved content from the query - - :param metadata: Additional metadata about the query result + ToolExecutionStep: + description: "A tool execution step in an agent turn.\n\n:param tool_calls: The tool calls to execute.\n:param tool_responses: The tool responses from the tool calls." + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + title: Started At + format: date-time + type: string + nullable: true + completed_at: + title: Completed At + format: date-time + type: string + nullable: true + step_type: + const: tool_execution + default: tool_execution + title: Step Type + type: string + tool_calls: + items: + $ref: '#/components/schemas/ToolCall' + title: Tool Calls + type: array + tool_responses: + items: + $ref: '#/components/schemas/ToolResponse' + title: Tool Responses + type: array + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + type: object + ToolResponse: + description: "Response from a tool invocation.\n\n:param call_id: Unique identifier for the tool call this response is for\n:param tool_name: Name of the tool that was invoked\n:param content: The response content from the tool\n:param metadata: (Optional) Additional metadata about the tool response" properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name content: anyOf: - - type: string - - discriminator: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: mapping: image: '#/$defs/ImageContentItem' text: '#/$defs/TextContentItem' propertyName: type oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - type: 'null' + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array title: Content metadata: - additionalProperties: true title: Metadata + additionalProperties: true type: object - title: RAGQueryResult + nullable: true + required: + - call_id + - tool_name + - content + title: ToolResponse type: object - ListToolGroupsResponse: - $defs: - ToolGroup: - description: >- - A group of related tools managed together. - - - :param type: Type of resource, always 'tool_group' - - :param mcp_endpoint: (Optional) Model Context Protocol endpoint for remote - tools - - :param args: (Optional) Additional arguments for the tool group - properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier - type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: tool_group - default: tool_group - title: Type - type: string - mcp_endpoint: - anyOf: - - $ref: '#/$defs/URL' - - type: 'null' - args: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Args - required: - - identifier - - provider_id - title: ToolGroup - type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL - type: object - description: >- - Response containing a list of tool groups. - - - :param data: List of tool groups + ListBatchesResponse: + description: Response containing a list of batch objects. properties: + object: + const: list + default: list + title: Object + type: string data: + description: List of batch objects items: - $ref: '#/$defs/ToolGroup' + $ref: '#/components/schemas/Batch' title: Data type: array + first_id: + description: ID of the first batch in the list + title: First Id + type: string + nullable: true + last_id: + description: ID of the last batch in the list + title: Last Id + type: string + nullable: true + has_more: + default: false + description: Whether there are more batches available + title: Has More + type: boolean required: - - data - title: ListToolGroupsResponse + - data + title: ListBatchesResponse type: object - RegisterToolGroupRequest: + ConversationDeletedResource: + description: Response for deleted conversation. + properties: + id: + description: The deleted conversation identifier + title: Id + type: string + object: + default: conversation.deleted + description: Object type + title: Object + type: string + deleted: + default: true + description: Whether the object was deleted + title: Deleted + type: boolean + required: + - id + title: ConversationDeletedResource type: object - ToolGroup: - $defs: - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL - type: object - description: >- - A group of related tools managed together. - - - :param type: Type of resource, always 'tool_group' - - :param mcp_endpoint: (Optional) Model Context Protocol endpoint for remote - tools - - :param args: (Optional) Additional arguments for the tool group + ConversationItemDeletedResource: + description: Response for deleted conversation item. properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier + id: + description: The deleted item identifier + title: Id type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id + object: + default: conversation.item.deleted + description: Object type + title: Object type: string - type: - const: tool_group - default: tool_group - title: Type + deleted: + default: true + description: Whether the object was deleted + title: Deleted + type: boolean + required: + - id + title: ConversationItemDeletedResource + type: object + ListOpenAIFileResponse: + description: "Response for listing files in OpenAI Files API.\n\n:param data: List of file objects\n:param has_more: Whether there are more files available beyond this page\n:param first_id: ID of the first file in the list for pagination\n:param last_id: ID of the last file in the list for pagination\n:param object: The object type, which is always \"list\"" + properties: + data: + items: + $ref: '#/components/schemas/OpenAIFileObject' + title: Data + type: array + has_more: + title: Has More + type: boolean + first_id: + title: First Id + type: string + last_id: + title: Last Id + type: string + object: + const: list + default: list + title: Object type: string - mcp_endpoint: - anyOf: - - $ref: '#/$defs/URL' - - type: 'null' - args: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Args required: - - identifier - - provider_id - title: ToolGroup + - data + - has_more + - first_id + - last_id + title: ListOpenAIFileResponse type: object - ToolDef: - description: >- - Tool definition used in runtime contexts. - - - :param name: Name of the tool - - :param description: (Optional) Human-readable description of what the tool - does - - :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) - - :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) - - :param metadata: (Optional) Additional metadata about the tool - - :param toolgroup_id: (Optional) ID of the tool group this tool belongs to + OpenAIFileDeleteResponse: + description: "Response for deleting a file in OpenAI Files API.\n\n:param id: The file identifier that was deleted\n:param object: The object type, which is always \"file\"\n:param deleted: Whether the file was successfully deleted" properties: - toolgroup_id: - anyOf: - - type: string - - type: 'null' - title: Toolgroup Id - name: - title: Name + id: + title: Id + type: string + object: + const: file + default: file + title: Object + type: string + deleted: + title: Deleted + type: boolean + required: + - id + - deleted + title: OpenAIFileDeleteResponse + type: object + ListOpenAIChatCompletionResponse: + description: "Response from listing OpenAI-compatible chat completions.\n\n:param data: List of chat completion objects with their input messages\n:param has_more: Whether there are more completions available beyond this list\n:param first_id: ID of the first completion in this list\n:param last_id: ID of the last completion in this list\n:param object: Must be \"list\" to identify this as a list response" + properties: + data: + items: + $ref: '#/$defs/RouteInfo' + title: Data + type: array + required: + - data + title: ListRoutesResponse + description: >- + Response containing a list of all available API routes. + OpenAIModel: + type: object + properties: + id: type: string - description: The ID of the tool group to register. - provider_id: + object: type: string - description: >- - The ID of the provider to use for the tool group. - mcp_endpoint: - $ref: '#/components/schemas/URL' - description: >- - The MCP endpoint to use for the tool group. - args: + const: model + default: model + created: + type: integer + owned_by: + type: string + custom_metadata: type: object additionalProperties: oneOf: @@ -14622,25 +13784,47 @@ components: - type: string - type: array - type: object - description: >- - A dictionary of arguments to pass to the tool group. additionalProperties: false required: - - toolgroup_id - - provider_id - title: RegisterToolGroupRequest - Chunk: + - id + - object + - created + - owned_by + title: OpenAIModel + description: A model from OpenAI. + OpenAIListModelsResponse: type: object properties: - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - The content of the chunk, which can be interleaved text, images, or other - types. - chunk_id: + data: + type: array + items: + $ref: '#/components/schemas/OpenAIModel' + additionalProperties: false + required: + - data + title: OpenAIListModelsResponse + ModelType: + type: string + enum: + - llm + - embedding + - rerank + title: ModelType + description: >- + Enumeration of supported model types in Llama Stack. + RegisterModelRequest: + type: object + properties: + model_id: + type: string + description: The identifier of the model to register. + provider_model_id: type: string description: >- - Unique identifier for the chunk. Must be provided explicitly. + The identifier of the model in the provider. + provider_id: + type: string + description: The identifier of the provider. metadata: type: object additionalProperties: @@ -14651,2933 +13835,2550 @@ components: - type: string - type: array - type: object - description: >- - Metadata associated with the chunk that will be used in the model context - during inference. - embedding: - type: array - items: - type: number - description: >- - Optional embedding for the chunk. If not provided, it will be computed - later. - chunk_metadata: - $ref: '#/components/schemas/ChunkMetadata' - description: >- - Metadata for the chunk that will NOT be used in the context during inference. - The `chunk_metadata` is required backend functionality. + description: Any additional metadata for this model. + model_type: + $ref: '#/components/schemas/ModelType' + description: The type of model to register. additionalProperties: false required: - - content - - chunk_id - - metadata - title: Chunk - description: >- - A chunk of content that can be inserted into a vector database. - ChunkMetadata: - type: object - InsertChunksRequest: - type: object - QueryChunksRequest: + - model_id + title: RegisterModelRequest + Model: type: object - QueryChunksResponse: - $defs: - Chunk: - description: >- - A chunk of content that can be inserted into a vector database. - - :param content: The content of the chunk, which can be interleaved text, - images, or other types. - - :param embedding: Optional embedding for the chunk. If not provided, it - will be computed later. - - :param metadata: Metadata associated with the chunk that will be used - in the model context during inference. - - :param stored_chunk_id: The chunk ID that is stored in the vector database. - Used for backend functionality. - - :param chunk_metadata: Metadata for the chunk that will NOT be used in - the context during inference. - The `chunk_metadata` is required backend functionality. - properties: - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - metadata: - additionalProperties: true - title: Metadata - type: object - embedding: - anyOf: - - items: - type: number - type: array - - type: 'null' - title: Embedding - chunk_id: - anyOf: - - type: string - - type: 'null' - title: Chunk Id - chunk_metadata: - anyOf: - - $ref: '#/$defs/ChunkMetadata' - - type: 'null' - required: - - content - title: Chunk - type: object - ChunkMetadata: + properties: + identifier: + type: string description: >- - `ChunkMetadata` is backend metadata for a `Chunk` that is used to store - additional information about the chunk that - will not be used in the context during inference, but is required - for backend functionality. The `ChunkMetadata` - is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and - is not expected to change after. - Use `Chunk.metadata` for metadata that will be used in the context - during inference. - :param chunk_id: The ID of the chunk. If not set, it will be generated - based on the document ID and content. - - :param document_id: The ID of the document this chunk belongs to. - - :param source: The source of the content, such as a URL, file path, or - other identifier. - - :param created_timestamp: An optional timestamp indicating when the chunk - was created. - - :param updated_timestamp: An optional timestamp indicating when the chunk - was last updated. - - :param chunk_window: The window of the chunk, which can be used to group - related chunks together. - - :param chunk_tokenizer: The tokenizer used to create the chunk. Default - is Tiktoken. - - :param chunk_embedding_model: The embedding model used to create the chunk's - embedding. - - :param chunk_embedding_dimension: The dimension of the embedding vector - for the chunk. - - :param content_token_count: The number of tokens in the content of the - chunk. - - :param metadata_token_count: The number of tokens in the metadata of the - chunk. - properties: - chunk_id: - anyOf: - - type: string - - type: 'null' - title: Chunk Id - document_id: - anyOf: - - type: string - - type: 'null' - title: Document Id - source: - anyOf: - - type: string - - type: 'null' - title: Source - created_timestamp: - anyOf: - - type: integer - - type: 'null' - title: Created Timestamp - updated_timestamp: - anyOf: - - type: integer - - type: 'null' - title: Updated Timestamp - chunk_window: - anyOf: - - type: string - - type: 'null' - title: Chunk Window - chunk_tokenizer: - anyOf: - - type: string - - type: 'null' - title: Chunk Tokenizer - chunk_embedding_model: - anyOf: - - type: string - - type: 'null' - title: Chunk Embedding Model - chunk_embedding_dimension: - anyOf: - - type: integer - - type: 'null' - title: Chunk Embedding Dimension - content_token_count: - anyOf: - - type: integer - - type: 'null' - title: Content Token Count - metadata_token_count: - anyOf: - - type: integer - - type: 'null' - title: Metadata Token Count - title: ChunkMetadata - type: object - ImageContentItem: + Unique identifier for this resource in llama stack + provider_resource_id: + type: string description: >- - A image content item - - - :param type: Discriminator type of the content item. Always "image" - - :param image: Image as a base64 encoded string or an URL - properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/$defs/_URLOrData' - required: - - image - title: ImageContentItem - type: object - TextContentItem: + Unique identifier for this resource in the provider + provider_id: + type: string description: >- - A text content item - - - :param type: Discriminator type of the content item. Always "text" - - :param text: Text content - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: TextContentItem - type: object - URL: + ID of the provider that owns this resource + type: + type: string + enum: + - model + - shield + - vector_store + - dataset + - scoring_function + - benchmark + - tool + - tool_group + - prompt + const: model + default: model description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL + The resource type, always 'model' for model resources + metadata: type: object - _URLOrData: + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: Any additional metadata for this model + model_type: + $ref: '#/components/schemas/ModelType' + default: llm description: >- - A URL or a base64 encoded string - - - :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - - :param data: base64 encoded image data as string - properties: - url: - anyOf: - - $ref: '#/$defs/URL' - - type: 'null' - data: - anyOf: - - type: string - - type: 'null' - contentEncoding: base64 - title: Data - title: _URLOrData - type: object - description: >- - Response from querying chunks in a vector database. - - - :param chunks: List of content chunks returned from the query - - :param scores: Relevance scores corresponding to each returned chunk - properties: - chunks: - items: - $ref: '#/$defs/Chunk' - title: Chunks - type: array - scores: - items: - type: number - title: Scores - type: array + The type of model (LLM or embedding model) + additionalProperties: false required: - - chunks - - scores - title: QueryChunksResponse + - identifier + - provider_id + - type + - metadata + - model_type + title: Model + description: >- + A model resource representing an AI model registered in Llama Stack. + RunModerationRequest: type: object - VectorStoreListResponse: + ModerationObject: $defs: - VectorStoreFileCounts: - description: >- - File processing status counts for a vector store. - - - :param completed: Number of files that have been successfully processed - - :param cancelled: Number of files that had their processing cancelled - - :param failed: Number of files that failed to process - - :param in_progress: Number of files currently being processed - - :param total: Total number of files in the vector store - properties: - completed: - title: Completed - type: integer - cancelled: - title: Cancelled - type: integer - failed: - title: Failed - type: integer - in_progress: - title: In Progress - type: integer - total: - title: Total - type: integer - required: - - completed - - cancelled - - failed - - in_progress - - total - title: VectorStoreFileCounts - type: object - VectorStoreObject: + ModerationObjectResults: description: >- - OpenAI Vector Store object. - - - :param id: Unique identifier for the vector store - - :param object: Object type identifier, always "vector_store" - - :param created_at: Timestamp when the vector store was created - - :param name: (Optional) Name of the vector store - - :param usage_bytes: Storage space used by the vector store in bytes - - :param file_counts: File processing status counts for the vector store - - :param status: Current status of the vector store + A moderation object. - :param expires_after: (Optional) Expiration policy for the vector store + :param flagged: Whether any of the below categories are flagged. - :param expires_at: (Optional) Timestamp when the vector store will expire + :param categories: A list of the categories, and whether they are flagged + or not. - :param last_active_at: (Optional) Timestamp of last activity on the vector - store + :param category_applied_input_types: A list of the categories along with + the input type(s) that the score applies to. - :param metadata: Set of key-value pairs that can be attached to the vector - store + :param category_scores: A list of the categories along with their scores + as predicted by model. properties: - id: - title: Id - type: string - object: - default: vector_store - title: Object - type: string - created_at: - title: Created At - type: integer - name: + flagged: + title: Flagged + type: boolean + categories: anyOf: - - type: string + - additionalProperties: + type: boolean + type: object - type: 'null' - title: Name - usage_bytes: - default: 0 - title: Usage Bytes - type: integer - file_counts: - $ref: '#/$defs/VectorStoreFileCounts' - status: - default: completed - title: Status - type: string - expires_after: + title: Categories + category_applied_input_types: anyOf: - - additionalProperties: true + - additionalProperties: + items: + type: string + type: array type: object - type: 'null' - title: Expires After - expires_at: + title: Category Applied Input Types + category_scores: anyOf: - - type: integer + - additionalProperties: + type: number + type: object - type: 'null' - title: Expires At - last_active_at: + title: Category Scores + user_message: anyOf: - - type: integer + - type: string - type: 'null' - title: Last Active At + title: User Message metadata: additionalProperties: true title: Metadata type: object required: - - id - - created_at - - file_counts - title: VectorStoreObject - type: object - description: >- - Response from listing vector stores. - - - :param object: Object type identifier, always "list" - - :param data: List of vector store objects - - :param first_id: (Optional) ID of the first vector store in the list for pagination - - :param last_id: (Optional) ID of the last vector store in the list for pagination - - :param has_more: Whether there are more vector stores available beyond this - page - properties: - object: - default: list - title: Object - type: string - data: - items: - $ref: '#/$defs/VectorStoreObject' - title: Data - type: array - first_id: - anyOf: - - type: string - - type: 'null' - title: First Id - last_id: - anyOf: - - type: string - - type: 'null' - title: Last Id - has_more: - default: false - title: Has More - type: boolean - required: - - data - title: VectorStoreListResponse - type: object - VectorStoreObject: - $defs: - VectorStoreFileCounts: - description: >- - File processing status counts for a vector store. - - - :param completed: Number of files that have been successfully processed - - :param cancelled: Number of files that had their processing cancelled - - :param failed: Number of files that failed to process - - :param in_progress: Number of files currently being processed - - :param total: Total number of files in the vector store - properties: - completed: - title: Completed - type: integer - cancelled: - title: Cancelled - type: integer - failed: - title: Failed - type: integer - in_progress: - title: In Progress - type: integer - total: - title: Total - type: integer - required: - - completed - - cancelled - - failed - - in_progress - - total - title: VectorStoreFileCounts - type: object - description: >- - OpenAI Vector Store object. - - - :param id: Unique identifier for the vector store - - :param object: Object type identifier, always "vector_store" - - :param created_at: Timestamp when the vector store was created - - :param name: (Optional) Name of the vector store - - :param usage_bytes: Storage space used by the vector store in bytes - - :param file_counts: File processing status counts for the vector store - - :param status: Current status of the vector store - - :param expires_after: (Optional) Expiration policy for the vector store - - :param expires_at: (Optional) Timestamp when the vector store will expire - - :param last_active_at: (Optional) Timestamp of last activity on the vector - store - - :param metadata: Set of key-value pairs that can be attached to the vector - store - properties: - id: - title: Id - type: string - object: - default: vector_store - title: Object - type: string - created_at: - title: Created At - type: integer - name: - anyOf: - - type: string - - type: 'null' - title: Name - usage_bytes: - default: 0 - title: Usage Bytes - type: integer - file_counts: - $ref: '#/$defs/VectorStoreFileCounts' - status: - default: completed - title: Status - type: string - expires_after: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Expires After - expires_at: - anyOf: - - type: integer - - type: 'null' - title: Expires At - last_active_at: - anyOf: - - type: integer - - type: 'null' - title: Last Active At - metadata: - additionalProperties: true - title: Metadata + - flagged + title: ModerationObjectResults type: object - required: - - id - - created_at - - file_counts - title: VectorStoreObject - type: object - OpenaiUpdateVectorStoreRequest: - type: object - VectorStoreDeleteResponse: description: >- - Response from deleting a vector store. - + A moderation object. - :param id: Unique identifier of the deleted vector store + :param id: The unique identifier for the moderation request. - :param object: Object type identifier for the deletion response + :param model: The model used to generate the moderation results. - :param deleted: Whether the deletion operation was successful + :param results: A list of moderation objects properties: id: title: Id type: string - object: - default: vector_store.deleted - title: Object + model: + title: Model type: string - deleted: - default: true - title: Deleted - type: boolean + results: + items: + $ref: '#/$defs/ModerationObjectResults' + title: Results + type: array required: - id - title: VectorStoreDeleteResponse + - model + - results + title: ModerationObject type: object - VectorStoreFileBatchObject: + ListPromptsResponse: $defs: - VectorStoreFileCounts: + Prompt: description: >- - File processing status counts for a vector store. + A prompt resource representing a stored OpenAI Compatible prompt template + in Llama Stack. - :param completed: Number of files that have been successfully processed + :param prompt: The system prompt text with variable placeholders. Variables + are only supported when using the Responses API. - :param cancelled: Number of files that had their processing cancelled + :param version: Version (integer starting at 1, incremented on save) - :param failed: Number of files that failed to process + :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' - :param in_progress: Number of files currently being processed + :param variables: List of prompt variable names that can be used in the + prompt template - :param total: Total number of files in the vector store + :param is_default: Boolean indicating whether this version is the default + version for this prompt properties: - completed: - title: Completed - type: integer - cancelled: - title: Cancelled - type: integer - failed: - title: Failed - type: integer - in_progress: - title: In Progress - type: integer - total: - title: Total + prompt: + anyOf: + - type: string + - type: 'null' + description: >- + The system prompt with variable placeholders + title: Prompt + version: + description: >- + Version (integer starting at 1, incremented on save) + minimum: 1 + title: Version type: integer + prompt_id: + description: >- + Unique identifier in format 'pmpt_<48-digit-hash>' + title: Prompt Id + type: string + variables: + description: >- + List of variable names that can be used in the prompt template + items: + type: string + title: Variables + type: array + is_default: + default: false + description: >- + Boolean indicating whether this version is the default version + title: Is Default + type: boolean required: - - completed - - cancelled - - failed - - in_progress - - total - title: VectorStoreFileCounts + - version + - prompt_id + title: Prompt type: object + description: Response model to list prompts. + properties: + data: + items: + $ref: '#/$defs/Prompt' + title: Data + type: array + required: + - data + title: ListPromptsResponse + type: object + CreatePromptRequest: + type: object + Prompt: description: >- - OpenAI Vector Store File Batch object. - + A prompt resource representing a stored OpenAI Compatible prompt template + in Llama Stack. - :param id: Unique identifier for the file batch - :param object: Object type identifier, always "vector_store.file_batch" + :param prompt: The system prompt text with variable placeholders. Variables + are only supported when using the Responses API. - :param created_at: Timestamp when the file batch was created + :param version: Version (integer starting at 1, incremented on save) - :param vector_store_id: ID of the vector store containing the file batch + :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' - :param status: Current processing status of the file batch + :param variables: List of prompt variable names that can be used in the prompt + template - :param file_counts: File processing status counts for the batch + :param is_default: Boolean indicating whether this version is the default + version for this prompt properties: - id: - title: Id - type: string - object: - default: vector_store.file_batch - title: Object - type: string - created_at: - title: Created At + prompt: + anyOf: + - type: string + - type: 'null' + description: >- + The system prompt with variable placeholders + title: Prompt + version: + description: >- + Version (integer starting at 1, incremented on save) + minimum: 1 + title: Version type: integer - vector_store_id: - title: Vector Store Id + prompt_id: + description: >- + Unique identifier in format 'pmpt_<48-digit-hash>' + title: Prompt Id type: string - status: - anyOf: - - const: completed - type: string - - const: in_progress - type: string - - const: cancelled - type: string - - const: failed - type: string - title: Status - file_counts: - $ref: '#/$defs/VectorStoreFileCounts' + variables: + description: >- + List of variable names that can be used in the prompt template + items: + type: string + title: Variables + type: array + is_default: + default: false + description: >- + Boolean indicating whether this version is the default version + title: Is Default + type: boolean required: - - id - - created_at - - vector_store_id - - status - - file_counts - title: VectorStoreFileBatchObject + - version + - prompt_id + title: Prompt type: object - VectorStoreFilesListInBatchResponse: + UpdatePromptRequest: + type: object + SetDefaultVersionRequest: + type: object + ListProvidersResponse: $defs: - VectorStoreChunkingStrategyAuto: - description: >- - Automatic chunking strategy for vector store files. - - - :param type: Strategy type, always "auto" for automatic chunking - properties: - type: - const: auto - default: auto - title: Type - type: string - title: VectorStoreChunkingStrategyAuto - type: object - VectorStoreChunkingStrategyStatic: - description: >- - Static chunking strategy with configurable parameters. - - - :param type: Strategy type, always "static" for static chunking - - :param static: Configuration parameters for the static chunking strategy - properties: - type: - const: static - default: static - title: Type - type: string - static: - $ref: >- - #/$defs/VectorStoreChunkingStrategyStaticConfig - required: - - static - title: VectorStoreChunkingStrategyStatic - type: object - VectorStoreChunkingStrategyStaticConfig: + ProviderInfo: description: >- - Configuration for static chunking strategy. + Information about a registered provider including its configuration and + health status. - :param chunk_overlap_tokens: Number of tokens to overlap between adjacent - chunks + :param api: The API name this provider implements - :param max_chunk_size_tokens: Maximum number of tokens per chunk, must - be between 100 and 4096 - properties: - chunk_overlap_tokens: - default: 400 - title: Chunk Overlap Tokens - type: integer - max_chunk_size_tokens: - default: 800 - maximum: 4096 - minimum: 100 - title: Max Chunk Size Tokens - type: integer - title: VectorStoreChunkingStrategyStaticConfig - type: object - VectorStoreFileLastError: - description: >- - Error information for failed vector store file processing. + :param provider_id: Unique identifier for the provider + :param provider_type: The type of provider implementation - :param code: Error code indicating the type of failure + :param config: Configuration parameters for the provider - :param message: Human-readable error message describing the failure + :param health: Current health status of the provider properties: - code: - anyOf: - - const: server_error - type: string - - const: rate_limit_exceeded - type: string - title: Code - message: - title: Message + api: + title: Api type: string - required: - - code - - message - title: VectorStoreFileLastError - type: object - VectorStoreFileObject: - description: >- - OpenAI Vector Store File object. - - - :param id: Unique identifier for the file - - :param object: Object type identifier, always "vector_store.file" - - :param attributes: Key-value attributes associated with the file - - :param chunking_strategy: Strategy used for splitting the file into chunks - - :param created_at: Timestamp when the file was added to the vector store - - :param last_error: (Optional) Error information if file processing failed - - :param status: Current processing status of the file - - :param usage_bytes: Storage space used by this file in bytes - - :param vector_store_id: ID of the vector store containing this file - properties: - id: - title: Id + provider_id: + title: Provider Id type: string - object: - default: vector_store.file - title: Object + provider_type: + title: Provider Type type: string - attributes: + config: additionalProperties: true - title: Attributes + title: Config + type: object + health: + additionalProperties: true + title: Health type: object - chunking_strategy: - discriminator: - mapping: - auto: '#/$defs/VectorStoreChunkingStrategyAuto' - static: >- - #/$defs/VectorStoreChunkingStrategyStatic - propertyName: type - oneOf: - - $ref: '#/$defs/VectorStoreChunkingStrategyAuto' - - $ref: >- - #/$defs/VectorStoreChunkingStrategyStatic - title: Chunking Strategy - created_at: - title: Created At - type: integer - last_error: - anyOf: - - $ref: '#/$defs/VectorStoreFileLastError' - - type: 'null' - status: - anyOf: - - const: completed - type: string - - const: in_progress - type: string - - const: cancelled - type: string - - const: failed - type: string - title: Status - usage_bytes: - default: 0 - title: Usage Bytes - type: integer - vector_store_id: - title: Vector Store Id - type: string required: - - id - - chunking_strategy - - created_at - - status - - vector_store_id - title: VectorStoreFileObject + - api + - provider_id + - provider_type + - config + - health + title: ProviderInfo type: object description: >- - Response from listing files in a vector store file batch. - - - :param object: Object type identifier, always "list" - - :param data: List of vector store file objects in the batch - - :param first_id: (Optional) ID of the first file in the list for pagination + Response containing a list of all available providers. - :param last_id: (Optional) ID of the last file in the list for pagination - :param has_more: Whether there are more files available beyond this page + :param data: List of provider information objects properties: - object: - default: list - title: Object - type: string data: items: - $ref: '#/$defs/VectorStoreFileObject' + $ref: '#/$defs/ProviderInfo' title: Data type: array - first_id: - anyOf: - - type: string - - type: 'null' - title: First Id - last_id: - anyOf: - - type: string - - type: 'null' - title: Last Id - has_more: - default: false - title: Has More - type: boolean required: - data - title: VectorStoreFilesListInBatchResponse - type: object - Union: + title: ListProvidersResponse type: object - nullable: true - VectorStoreListFilesResponse: - $defs: - VectorStoreChunkingStrategyAuto: - description: >- - Automatic chunking strategy for vector store files. + ProviderInfo: + description: >- + Information about a registered provider including its configuration and health + status. - :param type: Strategy type, always "auto" for automatic chunking - properties: - type: - const: auto - default: auto - title: Type - type: string - title: VectorStoreChunkingStrategyAuto - type: object - VectorStoreChunkingStrategyStatic: - description: >- - Static chunking strategy with configurable parameters. + :param api: The API name this provider implements + + :param provider_id: Unique identifier for the provider + :param provider_type: The type of provider implementation - :param type: Strategy type, always "static" for static chunking + :param config: Configuration parameters for the provider - :param static: Configuration parameters for the static chunking strategy - properties: - type: - const: static - default: static - title: Type - type: string - static: - $ref: >- - #/$defs/VectorStoreChunkingStrategyStaticConfig - required: - - static - title: VectorStoreChunkingStrategyStatic + :param health: Current health status of the provider + properties: + api: + title: Api + type: string + provider_id: + title: Provider Id + type: string + provider_type: + title: Provider Type + type: string + config: + additionalProperties: true + title: Config + type: object + health: + additionalProperties: true + title: Health type: object - VectorStoreChunkingStrategyStaticConfig: + required: + - api + - provider_id + - provider_type + - config + - health + title: ProviderInfo + type: object + ListOpenAIResponseObject: + $defs: + AllowedToolsFilter: description: >- - Configuration for static chunking strategy. - + Filter configuration for restricting which MCP tools can be used. - :param chunk_overlap_tokens: Number of tokens to overlap between adjacent - chunks - :param max_chunk_size_tokens: Maximum number of tokens per chunk, must - be between 100 and 4096 + :param tool_names: (Optional) List of specific tool names that are allowed properties: - chunk_overlap_tokens: - default: 400 - title: Chunk Overlap Tokens - type: integer - max_chunk_size_tokens: - default: 800 - maximum: 4096 - minimum: 100 - title: Max Chunk Size Tokens - type: integer - title: VectorStoreChunkingStrategyStaticConfig + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Tool Names + title: AllowedToolsFilter type: object - VectorStoreFileLastError: + MCPListToolsTool: description: >- - Error information for failed vector store file processing. + Tool definition returned by MCP list tools operation. + + :param input_schema: JSON schema defining the tool's input parameters - :param code: Error code indicating the type of failure + :param name: Name of the tool - :param message: Human-readable error message describing the failure + :param description: (Optional) Description of what the tool does properties: - code: - anyOf: - - const: server_error - type: string - - const: rate_limit_exceeded - type: string - title: Code - message: - title: Message + input_schema: + additionalProperties: true + title: Input Schema + type: object + name: + title: Name type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description required: - - code - - message - title: VectorStoreFileLastError + - input_schema + - name + title: MCPListToolsTool type: object - VectorStoreFileObject: + OpenAIResponseAnnotationCitation: description: >- - OpenAI Vector Store File object. - - - :param id: Unique identifier for the file - - :param object: Object type identifier, always "vector_store.file" - - :param attributes: Key-value attributes associated with the file + URL citation annotation for referencing external web resources. - :param chunking_strategy: Strategy used for splitting the file into chunks - :param created_at: Timestamp when the file was added to the vector store + :param type: Annotation type identifier, always "url_citation" - :param last_error: (Optional) Error information if file processing failed + :param end_index: End position of the citation span in the content - :param status: Current processing status of the file + :param start_index: Start position of the citation span in the content - :param usage_bytes: Storage space used by this file in bytes + :param title: Title of the referenced web resource - :param vector_store_id: ID of the vector store containing this file + :param url: URL of the referenced web resource properties: - id: - title: Id - type: string - object: - default: vector_store.file - title: Object + type: + const: url_citation + default: url_citation + title: Type type: string - attributes: - additionalProperties: true - title: Attributes - type: object - chunking_strategy: - discriminator: - mapping: - auto: '#/$defs/VectorStoreChunkingStrategyAuto' - static: >- - #/$defs/VectorStoreChunkingStrategyStatic - propertyName: type - oneOf: - - $ref: '#/$defs/VectorStoreChunkingStrategyAuto' - - $ref: >- - #/$defs/VectorStoreChunkingStrategyStatic - title: Chunking Strategy - created_at: - title: Created At + end_index: + title: End Index type: integer - last_error: - anyOf: - - $ref: '#/$defs/VectorStoreFileLastError' - - type: 'null' - status: - anyOf: - - const: completed - type: string - - const: in_progress - type: string - - const: cancelled - type: string - - const: failed - type: string - title: Status - usage_bytes: - default: 0 - title: Usage Bytes + start_index: + title: Start Index type: integer - vector_store_id: - title: Vector Store Id + title: + title: Title + type: string + url: + title: Url type: string required: - - id - - chunking_strategy - - created_at - - status - - vector_store_id - title: VectorStoreFileObject + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation type: object - description: >- - Response from listing files in a vector store. - - - :param object: Object type identifier, always "list" - - :param data: List of vector store file objects - - :param first_id: (Optional) ID of the first file in the list for pagination + "OpenAIResponseAnnotationContainerFileCitation": + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: >- + OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: + description: >- + File citation annotation for referencing specific files in response content. - :param last_id: (Optional) ID of the last file in the list for pagination - :param has_more: Whether there are more files available beyond this page - properties: - object: - default: list - title: Object - type: string - data: - items: - $ref: '#/$defs/VectorStoreFileObject' - title: Data - type: array - first_id: - anyOf: - - type: string - - type: 'null' - title: First Id - last_id: - anyOf: - - type: string - - type: 'null' - title: Last Id - has_more: - default: false - title: Has More - type: boolean - required: - - data - title: VectorStoreListFilesResponse - type: object - OpenaiAttachFileToVectorStoreRequest: - type: object - VectorStoreFileObject: - $defs: - VectorStoreChunkingStrategyAuto: - description: >- - Automatic chunking strategy for vector store files. + :param type: Annotation type identifier, always "file_citation" + :param file_id: Unique identifier of the referenced file + + :param filename: Name of the referenced file - :param type: Strategy type, always "auto" for automatic chunking + :param index: Position index of the citation within the content properties: type: - const: auto - default: auto + const: file_citation + default: file_citation title: Type type: string - title: VectorStoreChunkingStrategyAuto + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + index: + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation type: object - VectorStoreChunkingStrategyStatic: - description: >- - Static chunking strategy with configurable parameters. - - - :param type: Strategy type, always "static" for static chunking - - :param static: Configuration parameters for the static chunking strategy + OpenAIResponseAnnotationFilePath: properties: type: - const: static - default: static + const: file_path + default: file_path title: Type type: string - static: - $ref: >- - #/$defs/VectorStoreChunkingStrategyStaticConfig + file_id: + title: File Id + type: string + index: + title: Index + type: integer required: - - static - title: VectorStoreChunkingStrategyStatic + - file_id + - index + title: OpenAIResponseAnnotationFilePath type: object - VectorStoreChunkingStrategyStaticConfig: + OpenAIResponseContentPartRefusal: description: >- - Configuration for static chunking strategy. + Refusal content within a streamed response part. - :param chunk_overlap_tokens: Number of tokens to overlap between adjacent - chunks + :param type: Content part type identifier, always "refusal" - :param max_chunk_size_tokens: Maximum number of tokens per chunk, must - be between 100 and 4096 + :param refusal: Refusal text supplied by the model properties: - chunk_overlap_tokens: - default: 400 - title: Chunk Overlap Tokens - type: integer - max_chunk_size_tokens: - default: 800 - maximum: 4096 - minimum: 100 - title: Max Chunk Size Tokens - type: integer - title: VectorStoreChunkingStrategyStaticConfig + type: + const: refusal + default: refusal + title: Type + type: string + refusal: + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal type: object - VectorStoreFileLastError: + OpenAIResponseError: description: >- - Error information for failed vector store file processing. + Error details for failed OpenAI response requests. - :param code: Error code indicating the type of failure + :param code: Error code identifying the type of failure :param message: Human-readable error message describing the failure properties: code: - anyOf: - - const: server_error - type: string - - const: rate_limit_exceeded - type: string title: Code + type: string message: title: Message type: string required: - code - message - title: VectorStoreFileLastError - type: object - description: >- - OpenAI Vector Store File object. - - - :param id: Unique identifier for the file - - :param object: Object type identifier, always "vector_store.file" - - :param attributes: Key-value attributes associated with the file - - :param chunking_strategy: Strategy used for splitting the file into chunks - - :param created_at: Timestamp when the file was added to the vector store - - :param last_error: (Optional) Error information if file processing failed - - :param status: Current processing status of the file - - :param usage_bytes: Storage space used by this file in bytes - - :param vector_store_id: ID of the vector store containing this file - properties: - id: - title: Id - type: string - object: - default: vector_store.file - title: Object - type: string - attributes: - additionalProperties: true - title: Attributes + title: OpenAIResponseError type: object - chunking_strategy: - discriminator: - mapping: - auto: '#/$defs/VectorStoreChunkingStrategyAuto' - static: >- - #/$defs/VectorStoreChunkingStrategyStatic - propertyName: type - oneOf: - - $ref: '#/$defs/VectorStoreChunkingStrategyAuto' - - $ref: >- - #/$defs/VectorStoreChunkingStrategyStatic - title: Chunking Strategy - created_at: - title: Created At - type: integer - last_error: - anyOf: - - $ref: '#/$defs/VectorStoreFileLastError' - - type: 'null' - status: - anyOf: - - const: completed - type: string - - const: in_progress + "OpenAIResponseInputFunctionToolCallOutput": + description: >- + This represents the output of a function call that gets passed back to + the model. + properties: + call_id: + title: Call Id type: string - - const: cancelled + output: + title: Output type: string - - const: failed + type: + const: function_call_output + default: function_call_output + title: Type type: string - title: Status - usage_bytes: - default: 0 - title: Usage Bytes - type: integer - vector_store_id: - title: Vector Store Id - type: string - required: - - id - - chunking_strategy - - created_at - - status - - vector_store_id - title: VectorStoreFileObject - type: object - OpenaiUpdateVectorStoreFileRequest: - type: object - VectorStoreFileDeleteResponse: - description: >- - Response from deleting a vector store file. + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - call_id + - output + title: >- + OpenAIResponseInputFunctionToolCallOutput + type: object + OpenAIResponseInputMessageContentImage: + description: >- + Image content for input messages in OpenAI response format. - :param id: Unique identifier of the deleted file + :param detail: Level of detail for image processing, can be "low", "high", + or "auto" - :param object: Object type identifier for the deletion response + :param type: Content type identifier, always "input_image" - :param deleted: Whether the deletion operation was successful - properties: - id: - title: Id - type: string - object: - default: vector_store.file.deleted - title: Object - type: string - deleted: - default: true - title: Deleted - type: boolean - required: - - id - title: VectorStoreFileDeleteResponse - type: object - VectorStoreFileContentsResponse: - $defs: - VectorStoreContent: + :param image_url: (Optional) URL of the image content + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + title: Detail + type: + const: input_image + default: input_image + title: Type + type: string + image_url: + anyOf: + - type: string + - type: 'null' + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: description: >- - Content item from a vector store file or search result. + Text content for input messages in OpenAI response format. - :param type: Content type, currently only "text" is supported + :param text: The text content of the input message - :param text: The actual text content + :param type: Content type identifier, always "input_text" properties: - type: - const: text - title: Type - type: string text: title: Text type: string + type: + const: input_text + default: input_text + title: Type + type: string required: - - type - text - title: VectorStoreContent + title: OpenAIResponseInputMessageContentText type: object - description: >- - Response from retrieving the contents of a vector store file. + OpenAIResponseInputToolFileSearch: + description: >- + File search tool configuration for OpenAI response inputs. - :param file_id: Unique identifier for the file + :param type: Tool type identifier, always "file_search" - :param filename: Name of the file + :param vector_store_ids: List of vector store identifiers to search within - :param attributes: Key-value attributes associated with the file + :param filters: (Optional) Additional filters to apply to the search - :param content: List of content items from the file - properties: - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - attributes: - additionalProperties: true - title: Attributes + :param max_num_results: (Optional) Maximum number of search results to + return (1-50) + + :param ranking_options: (Optional) Options for ranking and scoring search + results + properties: + type: + const: file_search + default: file_search + title: Type + type: string + vector_store_ids: + items: + type: string + title: Vector Store Ids + type: array + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Filters + max_num_results: + anyOf: + - maximum: 50 + minimum: 1 + type: integer + - type: 'null' + default: 10 + title: Max Num Results + ranking_options: + anyOf: + - $ref: '#/$defs/SearchRankingOptions' + - type: 'null' + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch type: object - content: - items: - $ref: '#/$defs/VectorStoreContent' - title: Content - type: array - required: - - file_id - - filename - - attributes - - content - title: VectorStoreFileContentsResponse - type: object - OpenaiSearchVectorStoreRequest: - type: object - VectorStoreSearchResponsePage: - $defs: - VectorStoreContent: + OpenAIResponseInputToolFunction: description: >- - Content item from a vector store file or search result. + Function tool configuration for OpenAI response inputs. + + + :param type: Tool type identifier, always "function" + + :param name: Name of the function that can be called + :param description: (Optional) Description of what the function does - :param type: Content type, currently only "text" is supported + :param parameters: (Optional) JSON schema defining the function's parameters - :param text: The actual text content + :param strict: (Optional) Whether to enforce strict parameter validation properties: type: - const: text + const: function + default: function title: Type type: string - text: - title: Text + name: + title: Name type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Parameters + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict required: - - type - - text - title: VectorStoreContent + - name + - parameters + title: OpenAIResponseInputToolFunction type: object - VectorStoreSearchResponse: + OpenAIResponseInputToolWebSearch: description: >- - Response from searching a vector store. - - - :param file_id: Unique identifier of the file containing the result - - :param filename: Name of the file containing the result + Web search tool configuration for OpenAI response inputs. - :param score: Relevance score for this search result - :param attributes: (Optional) Key-value attributes associated with the - file + :param type: Web search tool type variant to use - :param content: List of content items matching the search query + :param search_context_size: (Optional) Size of search context, must be + "low", "medium", or "high" properties: - file_id: - title: File Id + type: + anyOf: + - const: web_search + type: string + - const: web_search_preview + type: string + - const: web_search_preview_2025_03_11 + type: string + default: web_search + title: Type + search_context_size: + anyOf: + - pattern: ^low|medium|high$ + type: string + - type: 'null' + default: medium + title: Search Context Size + title: OpenAIResponseInputToolWebSearch + type: object + OpenAIResponseMCPApprovalRequest: + description: >- + A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments type: string - filename: - title: Filename + id: + title: Id type: string - score: - title: Score - type: number - attributes: + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMCPApprovalResponse: + description: A response to an MCP approval request. + properties: + approval_request_id: + title: Approval Request Id + type: string + approve: + title: Approve + type: boolean + type: + const: mcp_approval_response + default: mcp_approval_response + title: Type + type: string + id: anyOf: - - additionalProperties: - anyOf: - - type: string - - type: number - - type: boolean - type: object + - type: string - type: 'null' - title: Attributes - content: - items: - $ref: '#/$defs/VectorStoreContent' - title: Content - type: array + title: Id + reason: + anyOf: + - type: string + - type: 'null' + title: Reason required: - - file_id - - filename - - score - - content - title: VectorStoreSearchResponse + - approval_request_id + - approve + title: OpenAIResponseMCPApprovalResponse type: object - description: >- - Paginated response from searching a vector store. - - - :param object: Object type identifier for the search results page - - :param search_query: The original search query that was executed - - :param data: List of search result objects - - :param has_more: Whether there are more results available beyond this page - - :param next_page: (Optional) Token for retrieving the next page of results - properties: - object: - default: vector_store.search_results.page - title: Object - type: string - search_query: - title: Search Query - type: string - data: - items: - $ref: '#/$defs/VectorStoreSearchResponse' - title: Data - type: array - has_more: - default: false - title: Has More - type: boolean - next_page: - anyOf: - - type: string - - type: 'null' - title: Next Page - required: - - search_query - - data - title: VectorStoreSearchResponsePage - type: object - VersionInfo: - description: >- - Version information for the service. - - - :param version: Version number of the service - properties: - version: - title: Version - type: string - required: - - version - title: VersionInfo - type: object - AppendRowsRequest: - type: object - PaginatedResponse: - description: >- - A generic paginated response that follows a simple format. - + OpenAIResponseMessage: + description: >- + Corresponds to the various Message types in the Responses API. - :param data: The list of items for the current page + They are all under one type because the Responses API gives them all - :param has_more: Whether there are more items available after this set + the same "type" value, and there is no way to tell them apart in certain - :param url: The URL for accessing this list - properties: - data: - items: - additionalProperties: true - type: object - title: Data - type: array - has_more: - title: Has More - type: boolean - url: - anyOf: - - type: string - - type: 'null' - title: Url - required: - - data - - has_more - title: PaginatedResponse - type: object - ListDatasetsResponse: - $defs: - Dataset: + scenarios. + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_image: >- + #/$defs/OpenAIResponseInputMessageContentImage + input_text: >- + #/$defs/OpenAIResponseInputMessageContentText + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentText + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentImage + type: array + - items: + discriminator: + mapping: + output_text: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + - $ref: '#/$defs/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + OpenAIResponseObjectWithInput: description: >- - Dataset resource for storing and accessing training or evaluation data. + OpenAI response object extended with input context information. - :param type: Type of resource, always 'dataset' for datasets + :param input: List of input items that led to this response properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier + created_at: + title: Created At + type: integer + error: + anyOf: + - $ref: '#/$defs/OpenAIResponseError' + - type: 'null' + id: + title: Id type: string - provider_resource_id: + model: + title: Model + type: string + object: + const: response + default: response + title: Object + type: string + output: + items: + discriminator: + mapping: + file_search_call: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + function_call: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + mcp_list_tools: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + message: '#/$defs/OpenAIResponseMessage' + web_search_call: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseMessage' + - $ref: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' + title: Output + type: array + parallel_tool_calls: + default: false + title: Parallel Tool Calls + type: boolean + previous_response_id: anyOf: - type: string - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id + title: Previous Response Id + status: + title: Status + type: string + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + text: + $ref: '#/$defs/OpenAIResponseText' + default: + format: + type: text + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + tools: + anyOf: + - items: + discriminator: + mapping: + file_search: >- + #/$defs/OpenAIResponseInputToolFileSearch + function: '#/$defs/OpenAIResponseInputToolFunction' + mcp: '#/$defs/OpenAIResponseToolMCP' + web_search: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseInputToolWebSearch' + - $ref: >- + #/$defs/OpenAIResponseInputToolFileSearch + - $ref: '#/$defs/OpenAIResponseInputToolFunction' + - $ref: '#/$defs/OpenAIResponseToolMCP' + type: array + - type: 'null' + title: Tools + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + usage: + anyOf: + - $ref: '#/$defs/OpenAIResponseUsage' + - type: 'null' + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + input: + items: + anyOf: + - discriminator: + mapping: + file_search_call: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + function_call: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + mcp_list_tools: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + message: '#/$defs/OpenAIResponseMessage' + web_search_call: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseMessage' + - $ref: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' + - $ref: >- + #/$defs/OpenAIResponseInputFunctionToolCallOutput + - $ref: >- + #/$defs/OpenAIResponseMCPApprovalResponse + - $ref: '#/$defs/OpenAIResponseMessage' + title: Input + type: array + required: + - created_at + - id + - model + - output + - status + - input + title: OpenAIResponseObjectWithInput + type: object + "OpenAIResponseOutputMessageContentOutputText": + properties: + text: + title: Text type: string type: - const: dataset - default: dataset + const: output_text + default: output_text title: Type type: string - purpose: - $ref: '#/$defs/DatasetPurpose' - source: - discriminator: - mapping: - rows: '#/$defs/RowsDataSource' - uri: '#/$defs/URIDataSource' - propertyName: type - oneOf: - - $ref: '#/$defs/URIDataSource' - - $ref: '#/$defs/RowsDataSource' - title: Source - metadata: - additionalProperties: true - description: Any additional metadata for this dataset - title: Metadata - type: object + annotations: + items: + discriminator: + mapping: + container_file_citation: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + file_citation: >- + #/$defs/OpenAIResponseAnnotationFileCitation + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseAnnotationFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationCitation' + - $ref: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array required: - - identifier - - provider_id - - purpose - - source - title: Dataset + - text + title: >- + OpenAIResponseOutputMessageContentOutputText type: object - DatasetPurpose: - description: >- - Purpose of the dataset. Each purpose has a required input data schema. - - - :cvar post-training/messages: The dataset contains messages used for post-training. - { - "messages": [ - {"role": "user", "content": "Hello, world!"}, - {"role": "assistant", "content": "Hello, world!"}, - ] - } - :cvar eval/question-answer: The dataset contains a question column and - an answer column. - { - "question": "What is the capital of France?", - "answer": "Paris" - } - :cvar eval/messages-answer: The dataset contains a messages column with - list of messages and an answer column. - { - "messages": [ - {"role": "user", "content": "Hello, my name is John Doe."}, - {"role": "assistant", "content": "Hello, John Doe. How can - I help you today?"}, - {"role": "user", "content": "What's my name?"}, - ], - "answer": "John Doe" - } - enum: - - post-training/messages - - eval/question-answer - - eval/messages-answer - title: DatasetPurpose - type: string - RowsDataSource: + "OpenAIResponseOutputMessageFileSearchToolCall": description: >- - A dataset stored in rows. + File search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param queries: List of search queries executed - :param rows: The dataset is stored in rows. E.g. - - [ - {"messages": [{"role": "user", "content": "Hello, world!"}, {"role": - "assistant", "content": "Hello, world!"}]} - ] + :param status: Current status of the file search operation + + :param type: Tool call type identifier, always "file_search_call" + + :param results: (Optional) Search results returned by the file search + operation properties: - type: - const: rows - default: rows - title: Type + id: + title: Id type: string - rows: + queries: items: - additionalProperties: true - type: object - title: Rows + type: string + title: Queries type: array - required: - - rows - title: RowsDataSource - type: object - URIDataSource: - description: >- - A dataset that can be obtained from a URI. - - :param uri: The dataset can be obtained from a URI. E.g. - - "https://mywebsite.com/mydata.jsonl" - - "lsfs://mydata.jsonl" - - "data:csv;base64,{base64_content}" - properties: + status: + title: Status + type: string type: - const: uri - default: uri + const: file_search_call + default: file_search_call title: Type type: string - uri: - title: Uri - type: string + results: + anyOf: + - items: + $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults + type: array + - type: 'null' + title: Results required: - - uri - title: URIDataSource + - id + - queries + - status + title: >- + OpenAIResponseOutputMessageFileSearchToolCall type: object - description: >- - Response from listing datasets. + "OpenAIResponseOutputMessageFileSearchToolCallResults": + description: >- + Search results returned by the file search operation. - :param data: List of datasets - properties: - data: - items: - $ref: '#/$defs/Dataset' - title: Data - type: array - required: - - data - title: ListDatasetsResponse - type: object - RegisterDatasetRequest: - type: object - Dataset: - $defs: - DatasetPurpose: - description: >- - Purpose of the dataset. Each purpose has a required input data schema. - - - :cvar post-training/messages: The dataset contains messages used for post-training. - { - "messages": [ - {"role": "user", "content": "Hello, world!"}, - {"role": "assistant", "content": "Hello, world!"}, - ] - } - :cvar eval/question-answer: The dataset contains a question column and - an answer column. - { - "question": "What is the capital of France?", - "answer": "Paris" - } - :cvar eval/messages-answer: The dataset contains a messages column with - list of messages and an answer column. - { - "messages": [ - {"role": "user", "content": "Hello, my name is John Doe."}, - {"role": "assistant", "content": "Hello, John Doe. How can - I help you today?"}, - {"role": "user", "content": "What's my name?"}, - ], - "answer": "John Doe" - } - enum: - - post-training/messages - - eval/question-answer - - eval/messages-answer - title: DatasetPurpose - type: string - RowsDataSource: - description: >- - A dataset stored in rows. + :param attributes: (Optional) Key-value attributes associated with the + file - :param rows: The dataset is stored in rows. E.g. - - [ - {"messages": [{"role": "user", "content": "Hello, world!"}, {"role": - "assistant", "content": "Hello, world!"}]} - ] + :param file_id: Unique identifier of the file containing the result + + :param filename: Name of the file containing the result + + :param score: Relevance score for this search result (between 0 and 1) + + :param text: Text content of the search result properties: - type: - const: rows - default: rows - title: Type + attributes: + additionalProperties: true + title: Attributes + type: object + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + score: + title: Score + type: number + text: + title: Text type: string - rows: - items: - additionalProperties: true - type: object - title: Rows - type: array required: - - rows - title: RowsDataSource + - attributes + - file_id + - filename + - score + - text + title: >- + OpenAIResponseOutputMessageFileSearchToolCallResults type: object - URIDataSource: + "OpenAIResponseOutputMessageFunctionToolCall": description: >- - A dataset that can be obtained from a URI. + Function tool call output message for OpenAI responses. + + + :param call_id: Unique identifier for the function call + + :param name: Name of the function being called + + :param arguments: JSON string containing the function arguments + + :param type: Tool call type identifier, always "function_call" + + :param id: (Optional) Additional identifier for the tool call - :param uri: The dataset can be obtained from a URI. E.g. - - "https://mywebsite.com/mydata.jsonl" - - "lsfs://mydata.jsonl" - - "data:csv;base64,{base64_content}" + :param status: (Optional) Current status of the function call execution properties: + call_id: + title: Call Id + type: string + name: + title: Name + type: string + arguments: + title: Arguments + type: string type: - const: uri - default: uri + const: function_call + default: function_call title: Type type: string - uri: - title: Uri - type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status required: - - uri - title: URIDataSource + - call_id + - name + - arguments + title: >- + OpenAIResponseOutputMessageFunctionToolCall type: object - description: >- - Dataset resource for storing and accessing training or evaluation data. - - - :param type: Type of resource, always 'dataset' for datasets - properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier - type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: + OpenAIResponseOutputMessageMCPCall: description: >- - ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: dataset - default: dataset - title: Type - type: string - purpose: - $ref: '#/$defs/DatasetPurpose' - source: - discriminator: - mapping: - rows: '#/$defs/RowsDataSource' - uri: '#/$defs/URIDataSource' - propertyName: type - oneOf: - - $ref: '#/$defs/URIDataSource' - - $ref: '#/$defs/RowsDataSource' - title: Source - metadata: - additionalProperties: true - description: Any additional metadata for this dataset - title: Metadata - type: object - required: - - identifier - - provider_id - - purpose - - source - title: Dataset - type: object - CreateAgentRequest: - type: object - AgentCreateResponse: - description: >- - Response returned when creating a new agent. + Model Context Protocol (MCP) call output message for OpenAI responses. - :param agent_id: Unique identifier for the created agent - properties: - agent_id: - title: Agent Id - type: string - required: - - agent_id - title: AgentCreateResponse - type: object - Agent: - $defs: - AgentConfig: - description: >- - Configuration for an agent. + :param id: Unique identifier for this MCP call + :param type: Tool call type identifier, always "mcp_call" - :param model: The model identifier to use for the agent + :param arguments: JSON string containing the MCP call arguments - :param instructions: The system instructions for the agent + :param name: Name of the MCP method being called - :param name: Optional name for the agent, used in telemetry and identification + :param server_label: Label identifying the MCP server handling the call - :param enable_session_persistence: Optional flag indicating whether session - data has to be persisted + :param error: (Optional) Error message if the MCP call failed - :param response_format: Optional response format configuration + :param output: (Optional) Output result from the successful MCP call properties: - sampling_params: - anyOf: - - $ref: '#/$defs/SamplingParams' - - type: 'null' - input_shields: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Input Shields - output_shields: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Output Shields - toolgroups: - anyOf: - - items: - anyOf: - - type: string - - $ref: '#/$defs/AgentToolGroupWithArgs' - type: array - - type: 'null' - title: Toolgroups - client_tools: - anyOf: - - items: - $ref: '#/$defs/ToolDef' - type: array - - type: 'null' - title: Client Tools - tool_choice: - anyOf: - - $ref: '#/$defs/ToolChoice' - - type: 'null' - deprecated: true - tool_prompt_format: - anyOf: - - $ref: '#/$defs/ToolPromptFormat' - - type: 'null' - deprecated: true - tool_config: - anyOf: - - $ref: '#/$defs/ToolConfig' - - type: 'null' - max_infer_iters: - anyOf: - - type: integer - - type: 'null' - default: 10 - title: Max Infer Iters - model: - title: Model + id: + title: Id type: string - instructions: - title: Instructions + type: + const: mcp_call + default: mcp_call + title: Type + type: string + arguments: + title: Arguments type: string name: + title: Name + type: string + server_label: + title: Server Label + type: string + error: anyOf: - type: string - type: 'null' - title: Name - enable_session_persistence: - anyOf: - - type: boolean - - type: 'null' - default: false - title: Enable Session Persistence - response_format: + title: Error + output: anyOf: - - discriminator: - mapping: - grammar: '#/$defs/GrammarResponseFormat' - json_schema: '#/$defs/JsonSchemaResponseFormat' - propertyName: type - oneOf: - - $ref: '#/$defs/JsonSchemaResponseFormat' - - $ref: '#/$defs/GrammarResponseFormat' + - type: string - type: 'null' - title: Response Format - required: - - model - - instructions - title: AgentConfig - type: object - AgentToolGroupWithArgs: - properties: - name: - title: Name - type: string - args: - additionalProperties: true - title: Args - type: object + title: Output required: + - id + - arguments - name - - args - title: AgentToolGroupWithArgs + - server_label + title: OpenAIResponseOutputMessageMCPCall type: object - GrammarResponseFormat: + OpenAIResponseOutputMessageMCPListTools: description: >- - Configuration for grammar-guided response generation. + MCP list tools output message containing available tools from an MCP server. - :param type: Must be "grammar" to identify this format type + :param id: Unique identifier for this MCP list tools operation - :param bnf: The BNF grammar specification the response should conform - to - properties: - type: - const: grammar - default: grammar - title: Type - type: string - bnf: - additionalProperties: true - title: Bnf - type: object - required: - - bnf - title: GrammarResponseFormat - type: object - GreedySamplingStrategy: - description: >- - Greedy sampling strategy that selects the highest probability token at - each step. + :param type: Tool call type identifier, always "mcp_list_tools" + :param server_label: Label identifying the MCP server providing the tools - :param type: Must be "greedy" to identify this sampling strategy + :param tools: List of available tools provided by the MCP server properties: + id: + title: Id + type: string type: - const: greedy - default: greedy + const: mcp_list_tools + default: mcp_list_tools title: Type type: string - title: GreedySamplingStrategy + server_label: + title: Server Label + type: string + tools: + items: + $ref: '#/$defs/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools type: object - JsonSchemaResponseFormat: + "OpenAIResponseOutputMessageWebSearchToolCall": description: >- - Configuration for JSON schema-guided response generation. + Web search tool call output message for OpenAI responses. + + :param id: Unique identifier for this tool call - :param type: Must be "json_schema" to identify this format type + :param status: Current status of the web search operation - :param json_schema: The JSON schema the response should conform to. In - a Python SDK, this is often a `pydantic` model. + :param type: Tool call type identifier, always "web_search_call" properties: + id: + title: Id + type: string + status: + title: Status + type: string type: - const: json_schema - default: json_schema + const: web_search_call + default: web_search_call title: Type type: string - json_schema: - additionalProperties: true - title: Json Schema - type: object required: - - json_schema - title: JsonSchemaResponseFormat + - id + - status + title: >- + OpenAIResponseOutputMessageWebSearchToolCall type: object - SamplingParams: + OpenAIResponseText: description: >- - Sampling parameters. - + Text response configuration for OpenAI responses. - :param strategy: The sampling strategy. - :param max_tokens: The maximum number of tokens that can be generated - in the completion. The token count of - your prompt plus max_tokens cannot exceed the model's context length. - :param repetition_penalty: Number between -2.0 and 2.0. Positive values - penalize new tokens - based on whether they appear in the text so far, increasing the model's - likelihood to talk about new topics. - :param stop: Up to 4 sequences where the API will stop generating further - tokens. - The returned text will not contain the stop sequence. + :param format: (Optional) Text format configuration specifying output + format requirements properties: - strategy: - discriminator: - mapping: - greedy: '#/$defs/GreedySamplingStrategy' - top_k: '#/$defs/TopKSamplingStrategy' - top_p: '#/$defs/TopPSamplingStrategy' - propertyName: type - oneOf: - - $ref: '#/$defs/GreedySamplingStrategy' - - $ref: '#/$defs/TopPSamplingStrategy' - - $ref: '#/$defs/TopKSamplingStrategy' - title: Strategy - max_tokens: - anyOf: - - type: integer - - type: 'null' - title: Max Tokens - repetition_penalty: - anyOf: - - type: number - - type: 'null' - default: 1.0 - title: Repetition Penalty - stop: + format: anyOf: - - items: - type: string - type: array + - $ref: '#/$defs/OpenAIResponseTextFormat' - type: 'null' - title: Stop - title: SamplingParams + title: OpenAIResponseText type: object - SystemMessageBehavior: + OpenAIResponseTextFormat: description: >- - Config for how to override the default system prompt. + Configuration for Responses API text format. - :cvar append: Appends the provided system message to the default system - prompt: - https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt- - :cvar replace: Replaces the default system prompt with the provided system - message. The system message can include the string - '{{function_definitions}}' to indicate where the function definitions - should be inserted. - enum: - - append - - replace - title: SystemMessageBehavior - type: string - ToolChoice: - description: >- - Whether tool use is required or automatic. This is a hint to the model - which may not be followed. It depends on the Instruction Following capabilities - of the model. + :param type: Must be "text", "json_schema", or "json_object" to identify + the format type + :param name: The name of the response format. Only used for json_schema. - :cvar auto: The model may use tools if it determines that is appropriate. + :param schema: The JSON schema the response should conform to. In a Python + SDK, this is often a `pydantic` model. Only used for json_schema. - :cvar required: The model must use tools. + :param description: (Optional) A description of the response format. Only + used for json_schema. - :cvar none: The model must not use tools. - enum: - - auto - - required - - none - title: ToolChoice - type: string - ToolConfig: - description: >- - Configuration for tool use. - - - :param tool_choice: (Optional) Whether tool use is automatic, required, - or none. Can also specify a tool name to use a specific tool. Defaults - to ToolChoice.auto. - - :param tool_prompt_format: (Optional) Instructs the model how to format - tool calls. By default, Llama Stack will attempt to use a format that - is best adapted to the model. - - `ToolPromptFormat.json`: The tool calls are formatted as a JSON - object. - - `ToolPromptFormat.function_tag`: The tool calls are enclosed in - a tag. - - `ToolPromptFormat.python_list`: The tool calls are output as Python - syntax -- a list of function calls. - :param system_message_behavior: (Optional) Config for how to override - the default system prompt. - - `SystemMessageBehavior.append`: Appends the provided system message - to the default system prompt. - - `SystemMessageBehavior.replace`: Replaces the default system prompt - with the provided system message. The system message can include the string - '{{function_definitions}}' to indicate where the function definitions - should be inserted. + :param strict: (Optional) Whether to strictly enforce the JSON schema. + If true, the response must match the schema exactly. Only used for json_schema. properties: - tool_choice: + type: + anyOf: + - const: text + type: string + - const: json_schema + type: string + - const: json_object + type: string + title: Type + name: anyOf: - - $ref: '#/$defs/ToolChoice' - type: string - type: 'null' - default: auto - title: Tool Choice - tool_prompt_format: + title: Name + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: anyOf: - - $ref: '#/$defs/ToolPromptFormat' + - type: string - type: 'null' - system_message_behavior: + title: Description + strict: anyOf: - - $ref: '#/$defs/SystemMessageBehavior' + - type: boolean - type: 'null' - default: append - title: ToolConfig + title: Strict + title: OpenAIResponseTextFormat type: object - ToolDef: + OpenAIResponseToolMCP: description: >- - Tool definition used in runtime contexts. - - - :param name: Name of the tool - - :param description: (Optional) Human-readable description of what the - tool does + Model Context Protocol (MCP) tool configuration for OpenAI response object. - :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) - :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) + :param type: Tool type identifier, always "mcp" - :param metadata: (Optional) Additional metadata about the tool + :param server_label: Label to identify this MCP server - :param toolgroup_id: (Optional) ID of the tool group this tool belongs - to + :param allowed_tools: (Optional) Restriction on which tools can be used + from this server properties: - toolgroup_id: - anyOf: - - type: string - - type: 'null' - title: Toolgroup Id - name: - title: Name + type: + const: mcp + default: mcp + title: Type type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - input_schema: + server_label: + title: Server Label + type: string + allowed_tools: anyOf: - - additionalProperties: true - type: object + - items: + type: string + type: array + - $ref: '#/$defs/AllowedToolsFilter' - type: 'null' - title: Input Schema - output_schema: + title: Allowed Tools + required: + - server_label + title: OpenAIResponseToolMCP + type: object + OpenAIResponseUsage: + description: >- + Usage information for OpenAI response. + + + :param input_tokens: Number of tokens in the input + + :param output_tokens: Number of tokens in the output + + :param total_tokens: Total tokens used (input + output) + + :param input_tokens_details: Detailed breakdown of input token usage + + :param output_tokens_details: Detailed breakdown of output token usage + properties: + input_tokens: + title: Input Tokens + type: integer + output_tokens: + title: Output Tokens + type: integer + total_tokens: + title: Total Tokens + type: integer + input_tokens_details: anyOf: - - additionalProperties: true - type: object + - $ref: >- + #/$defs/OpenAIResponseUsageInputTokensDetails - type: 'null' - title: Output Schema - metadata: + output_tokens_details: anyOf: - - additionalProperties: true - type: object + - $ref: >- + #/$defs/OpenAIResponseUsageOutputTokensDetails - type: 'null' - title: Metadata required: - - name - title: ToolDef + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage type: object - ToolPromptFormat: - description: >- - Prompt format for calling custom / zero shot tools. - - - :cvar json: JSON format for calling tools. It takes the form: - { - "type": "function", - "function" : { - "name": "function_name", - "description": "function_description", - "parameters": {...} - } - } - :cvar function_tag: Function tag format, pseudo-XML. This looks like: - (parameters) - - :cvar python_list: Python list. The output is a valid Python expression - that can be - evaluated to a list. Each element in the list is a function call. - Example: - ["function_name(param1, param2)", "function_name(param1, param2)"] - enum: - - json - - function_tag - - python_list - title: ToolPromptFormat - type: string - TopKSamplingStrategy: + OpenAIResponseUsageInputTokensDetails: description: >- - Top-k sampling strategy that restricts sampling to the k most likely tokens. + Token details for input tokens in OpenAI response usage. - :param type: Must be "top_k" to identify this sampling strategy + :param cached_tokens: Number of tokens retrieved from cache + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens + title: OpenAIResponseUsageInputTokensDetails + type: object + OpenAIResponseUsageOutputTokensDetails: + description: >- + Token details for output tokens in OpenAI response usage. + - :param top_k: Number of top tokens to consider for sampling. Must be at - least 1 + :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) properties: - type: - const: top_k - default: top_k - title: Type - type: string - top_k: - minimum: 1 - title: Top K - type: integer - required: - - top_k - title: TopKSamplingStrategy + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens + title: OpenAIResponseUsageOutputTokensDetails type: object - TopPSamplingStrategy: + SearchRankingOptions: description: >- - Top-p (nucleus) sampling strategy that samples from the smallest set of - tokens with cumulative probability >= p. - + Options for ranking and filtering search results. - :param type: Must be "top_p" to identify this sampling strategy - :param temperature: Controls randomness in sampling. Higher values increase - randomness + :param ranker: (Optional) Name of the ranking algorithm to use - :param top_p: Cumulative probability threshold for nucleus sampling. Defaults - to 0.95 + :param score_threshold: (Optional) Minimum relevance score threshold for + results properties: - type: - const: top_p - default: top_p - title: Type - type: string - temperature: + ranker: anyOf: - - exclusiveMinimum: 0.0 - type: number + - type: string - type: 'null' - title: Temperature - top_p: + title: Ranker + score_threshold: anyOf: - type: number - type: 'null' - default: 0.95 - title: Top P - required: - - temperature - title: TopPSamplingStrategy + default: 0.0 + title: Score Threshold + title: SearchRankingOptions type: object description: >- - An agent instance with configuration and metadata. + Paginated list of OpenAI response objects with navigation metadata. + + + :param data: List of response objects with their input context + :param has_more: Whether there are more results available beyond this page - :param agent_id: Unique identifier for the agent + :param first_id: Identifier of the first item in this page - :param agent_config: Configuration settings for the agent + :param last_id: Identifier of the last item in this page - :param created_at: Timestamp when the agent was created + :param object: Object type identifier, always "list" properties: - agent_id: - title: Agent Id + data: + items: + $ref: '#/$defs/OpenAIResponseObjectWithInput' + title: Data + type: array + has_more: + title: Has More + type: boolean + first_id: + title: First Id type: string - agent_config: - $ref: '#/$defs/AgentConfig' - created_at: - format: date-time - title: Created At + last_id: + title: Last Id + type: string + object: + const: list + default: list + title: Object type: string required: - - agent_id - - agent_config - - created_at - title: Agent + - data + - has_more + - first_id + - last_id + title: ListOpenAIChatCompletionResponse type: object - CreateAgentSessionRequest: + OpenAIAssistantMessageParam: + description: "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param name: (Optional) The name of the assistant message participant.\n:param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object." + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + nullable: true + name: + title: Name + type: string + nullable: true + tool_calls: + title: Tool Calls + items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + nullable: true + title: OpenAIAssistantMessageParam type: object - AgentSessionCreateResponse: - description: >- - Response returned when creating a new agent session. - - - :param session_id: Unique identifier for the created session + OpenAIChoice: + description: "A choice from an OpenAI-compatible chat completion response.\n\n:param message: The message from the model\n:param finish_reason: The reason the model stopped generating\n:param index: The index of the choice\n:param logprobs: (Optional) The log probabilities for the tokens in the message" properties: - session_id: - title: Session Id + message: + discriminator: + mapping: + assistant: '#/$defs/OpenAIAssistantMessageParam' + developer: '#/$defs/OpenAIDeveloperMessageParam' + system: '#/$defs/OpenAISystemMessageParam' + tool: '#/$defs/OpenAIToolMessageParam' + user: '#/$defs/OpenAIUserMessageParam' + propertyName: role + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Message + finish_reason: + title: Finish Reason type: string + index: + title: Index + type: integer + logprobs: + $ref: '#/components/schemas/OpenAIChoiceLogprobs' + nullable: true required: - - session_id - title: AgentSessionCreateResponse - description: >- - Response returned when creating a new agent session. - CompletionMessage: + - message + - finish_reason + - index + title: OpenAIChoice + type: object + OpenAIChoiceLogprobs: + description: "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response.\n\n:param content: (Optional) The log probabilities for the tokens in the message\n:param refusal: (Optional) The log probabilities for the tokens in the message" + properties: + content: + title: Content + items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + nullable: true + refusal: + title: Refusal + items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + nullable: true + title: OpenAIChoiceLogprobs + type: object + OpenAICompletionWithInputMessages: + properties: + id: + title: Id + type: string + choices: + items: + $ref: '#/components/schemas/OpenAIChoice' + title: Choices + type: array + object: + const: chat.completion + default: chat.completion + title: Object + type: string + created: + title: Created + type: integer + model: + title: Model + type: string + usage: + $ref: '#/components/schemas/OpenAIChatCompletionUsage' + nullable: true + input_messages: + items: + discriminator: + mapping: + assistant: '#/$defs/OpenAIAssistantMessageParam' + developer: '#/$defs/OpenAIDeveloperMessageParam' + system: '#/$defs/OpenAISystemMessageParam' + tool: '#/$defs/OpenAIToolMessageParam' + user: '#/$defs/OpenAIUserMessageParam' + propertyName: role + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Input Messages + type: array + required: + - id + - choices + - created + - model + - input_messages + title: OpenAICompletionWithInputMessages type: object + OpenAIUserMessageParam: + description: "A message from the user in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param name: (Optional) The name of the user message participant." properties: role: + const: user + default: user + title: Role type: string - const: assistant - default: assistant - description: >- - Must be "assistant" to identify this as the model's response content: - $ref: '#/components/schemas/InterleavedContent' - description: The content of the model's response - stop_reason: + anyOf: + - type: string + - items: + discriminator: + mapping: + file: '#/$defs/OpenAIFile' + image_url: '#/$defs/OpenAIChatCompletionContentPartImageParam' + text: '#/$defs/OpenAIChatCompletionContentPartTextParam' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' + type: array + title: Content + name: + title: Name type: string - enum: - - end_of_turn - - end_of_message - - out_of_tokens - description: >- - Reason why the model stopped generating. Options are: - `StopReason.end_of_turn`: - The model finished generating the entire response. - `StopReason.end_of_message`: - The model finished generating but generated a partial response -- usually, - a tool call. The user may call the tool and continue the conversation - with the tool's response. - `StopReason.out_of_tokens`: The model ran - out of token budget. - tool_calls: + nullable: true + required: + - content + title: OpenAIUserMessageParam + type: object + Checkpoint: + description: "Checkpoint created during training runs.\n\n:param identifier: Unique identifier for the checkpoint\n:param created_at: Timestamp when the checkpoint was created\n:param epoch: Training epoch when the checkpoint was saved\n:param post_training_job_id: Identifier of the training job that created this checkpoint\n:param path: File system path where the checkpoint is stored\n:param training_metrics: (Optional) Training metrics associated with this checkpoint" + properties: + identifier: + title: Identifier + type: string + created_at: + format: date-time + title: Created At + type: string + epoch: + title: Epoch + type: integer + post_training_job_id: + title: Post Training Job Id + type: string + path: + title: Path + type: string + training_metrics: + $ref: '#/components/schemas/PostTrainingMetric' + nullable: true + required: + - identifier + - created_at + - epoch + - post_training_job_id + - path + title: Checkpoint + type: object + PostTrainingJobArtifactsResponse: + description: "Artifacts of a finetuning job.\n\n:param job_uuid: Unique identifier for the training job\n:param checkpoints: List of model checkpoints created during training" + properties: + job_uuid: + title: Job Uuid + type: string + checkpoints: + items: + $ref: '#/components/schemas/Checkpoint' + title: Checkpoints type: array + required: + - job_uuid + title: PostTrainingJobArtifactsResponse + type: object + PostTrainingJobStatusResponse: + description: "Status of a finetuning job.\n\n:param job_uuid: Unique identifier for the training job\n:param status: Current status of the training job\n:param scheduled_at: (Optional) Timestamp when the job was scheduled\n:param started_at: (Optional) Timestamp when the job execution began\n:param completed_at: (Optional) Timestamp when the job finished, if completed\n:param resources_allocated: (Optional) Information about computational resources allocated to the job\n:param checkpoints: List of model checkpoints created during training" + properties: + job_uuid: + title: Job Uuid + type: string + status: + $ref: '#/components/schemas/JobStatus' + scheduled_at: + title: Scheduled At + format: date-time + type: string + nullable: true + started_at: + title: Started At + format: date-time + type: string + nullable: true + completed_at: + title: Completed At + format: date-time + type: string + nullable: true + resources_allocated: + title: Resources Allocated + additionalProperties: true + type: object + nullable: true + checkpoints: items: - $ref: '#/components/schemas/ToolCall' - description: >- - List of tool calls. Each tool call is a ToolCall object. - additionalProperties: false + $ref: '#/components/schemas/Checkpoint' + title: Checkpoints + type: array + required: + - job_uuid + - status + title: PostTrainingJobStatusResponse + type: object + ScoringFn: + description: "A scoring function resource for evaluating model outputs.\n:param type: The resource type, always scoring_function" + properties: + identifier: + description: Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + description: Unique identifier for this resource in the provider + title: Provider Resource Id + type: string + nullable: true + provider_id: + description: ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: scoring_function + default: scoring_function + title: Type + type: string + description: + title: Description + type: string + nullable: true + metadata: + additionalProperties: true + description: Any additional metadata for this definition + title: Metadata + type: object + return_type: + description: The return type of the deterministic function + discriminator: + mapping: + agent_turn_input: '#/$defs/AgentTurnInputType' + array: '#/$defs/ArrayType' + boolean: '#/$defs/BooleanType' + chat_completion_input: '#/$defs/ChatCompletionInputType' + completion_input: '#/$defs/CompletionInputType' + json: '#/$defs/JsonType' + number: '#/$defs/NumberType' + object: '#/$defs/ObjectType' + string: '#/$defs/StringType' + union: '#/$defs/UnionType' + propertyName: type + oneOf: + - $ref: '#/components/schemas/StringType' + - $ref: '#/components/schemas/NumberType' + - $ref: '#/components/schemas/BooleanType' + - $ref: '#/components/schemas/ArrayType' + - $ref: '#/components/schemas/ObjectType' + - $ref: '#/components/schemas/JsonType' + - $ref: '#/components/schemas/UnionType' + - $ref: '#/components/schemas/ChatCompletionInputType' + - $ref: '#/components/schemas/CompletionInputType' + - $ref: '#/components/schemas/AgentTurnInputType' + title: Return Type + params: + description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval + title: Params + discriminator: + mapping: + basic: '#/$defs/BasicScoringFnParams' + llm_as_judge: '#/$defs/LLMAsJudgeScoringFnParams' + regex_parser: '#/$defs/RegexParserScoringFnParams' + propertyName: type + oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + nullable: true required: - - role - - content - - stop_reason - title: CompletionMessage - description: >- - A message containing the model's (assistant) response in a chat conversation. - InferenceStep: + - identifier + - provider_id + - return_type + title: ScoringFn type: object - Session: + ScoreRequest: + type: object + ScoreResponse: $defs: - Attachment: + ScoringResult: description: >- - An attachment to an agent turn. + A scoring result for a single row. - :param content: The content of the attachment. + :param score_rows: The scoring result for each row. Each row is a map + of column name to value. - :param mime_type: The MIME type of the attachment. + :param aggregated_results: Map of metric name to aggregated value properties: - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - $ref: '#/$defs/URL' - title: Content - mime_type: - title: Mime Type - type: string + score_rows: + items: + additionalProperties: true + type: object + title: Score Rows + type: array + aggregated_results: + additionalProperties: true + title: Aggregated Results + type: object required: - - content - - mime_type - title: Attachment + - score_rows + - aggregated_results + title: ScoringResult type: object - BuiltinTool: - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - type: string - CompletionMessage: - description: >- - A message containing the model's (assistant) response in a chat conversation. - - - :param role: Must be "assistant" to identify this as the model's response + description: >- + The response from scoring. - :param content: The content of the model's response - :param stop_reason: Reason why the model stopped generating. Options are: - - `StopReason.end_of_turn`: The model finished generating the entire - response. - - `StopReason.end_of_message`: The model finished generating but generated - a partial response -- usually, a tool call. The user may call the tool - and continue the conversation with the tool's response. - - `StopReason.out_of_tokens`: The model ran out of token budget. - :param tool_calls: List of tool calls. Each tool call is a ToolCall object. - properties: - role: - const: assistant - default: assistant - title: Role - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - stop_reason: - $ref: '#/$defs/StopReason' - tool_calls: - anyOf: - - items: - $ref: '#/$defs/ToolCall' - type: array - - type: 'null' - title: Tool Calls - required: - - content - - stop_reason - title: CompletionMessage + :param results: A map of scoring function name to ScoringResult. + properties: + results: + additionalProperties: + $ref: '#/$defs/ScoringResult' + title: Results type: object - ImageContentItem: + required: + - results + title: ScoreResponse + type: object + ScoreBatchRequest: + type: object + ScoreBatchResponse: + $defs: + ScoringResult: description: >- - A image content item + A scoring result for a single row. - :param type: Discriminator type of the content item. Always "image" + :param score_rows: The scoring result for each row. Each row is a map + of column name to value. - :param image: Image as a base64 encoded string or an URL + :param aggregated_results: Map of metric name to aggregated value properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/$defs/_URLOrData' + score_rows: + items: + additionalProperties: true + type: object + title: Score Rows + type: array + aggregated_results: + additionalProperties: true + title: Aggregated Results + type: object required: - - image - title: ImageContentItem + - score_rows + - aggregated_results + title: ScoringResult type: object - InferenceStep: - description: >- - An inference step in an agent turn. + description: >- + Response from batch scoring operations on datasets. - :param model_response: The response from the LLM. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: inference - default: inference - title: Step Type - type: string - model_response: - $ref: '#/$defs/CompletionMessage' - required: - - turn_id - - step_id - - model_response - title: InferenceStep + :param dataset_id: (Optional) The identifier of the dataset that was scored + + :param results: A map of scoring function name to ScoringResult + properties: + dataset_id: + anyOf: + - type: string + - type: 'null' + title: Dataset Id + results: + additionalProperties: + $ref: '#/$defs/ScoringResult' + title: Results type: object - MemoryRetrievalStep: + required: + - results + title: ScoreBatchResponse + type: object + ListShieldsResponse: + $defs: + Shield: description: >- - A memory retrieval step in an agent turn. + A safety shield resource that can be used to check content. - :param vector_store_ids: The IDs of the vector databases to retrieve context - from. + :param params: (Optional) Configuration parameters for the shield - :param inserted_context: The context retrieved from the vector databases. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id + :param type: The resource type, always shield + properties: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: + provider_resource_id: anyOf: - - format: date-time - type: string + - type: string - type: 'null' - title: Completed At - step_type: - const: memory_retrieval - default: memory_retrieval - title: Step Type + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id type: string - vector_store_ids: - title: Vector Store Ids + type: + const: shield + default: shield + title: Type type: string - inserted_context: + params: anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Inserted Context + - additionalProperties: true + type: object + - type: 'null' + title: Params required: - - turn_id - - step_id - - vector_store_ids - - inserted_context - title: MemoryRetrievalStep + - identifier + - provider_id + title: Shield + type: object + properties: + data: + items: + $ref: '#/$defs/Shield' + title: Data + type: array + required: + - data + title: ListShieldsResponse + type: object + RegisterShieldRequest: + type: object + properties: + shield_id: + type: string + description: >- + The identifier of the shield to register. + provider_shield_id: + type: string + description: >- + The identifier of the shield in the provider. + provider_id: + type: string + description: The identifier of the provider. + params: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: The parameters of the shield. + additionalProperties: false + required: + - shield_id + title: RegisterShieldRequest + InvokeToolRequest: + type: object + properties: + tool_name: + type: string + description: The name of the tool to invoke. + kwargs: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + A dictionary of arguments to pass to the tool. + additionalProperties: false + required: + - tool_name + - kwargs + title: InvokeToolRequest + ImageContentItem: + type: object + properties: + type: + type: string + const: image + default: image + description: >- + Discriminator type of the content item. Always "image" + image: + type: object + properties: + url: + $ref: '#/components/schemas/URL' + description: >- + A URL of the image or data URL in the format of data:image/{type};base64,{data}. + Note that URL could have length limits. + data: + type: string + contentEncoding: base64 + description: base64 encoded image data as string + additionalProperties: false + description: >- + Image as a base64 encoded string or an URL + additionalProperties: false + required: + - type + - image + title: ImageContentItem + description: A image content item + InterleavedContent: + oneOf: + - type: string + - $ref: '#/components/schemas/InterleavedContentItem' + - type: array + items: + $ref: '#/components/schemas/InterleavedContentItem' + InterleavedContentItem: + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem' + text: '#/components/schemas/TextContentItem' + TextContentItem: + type: object + properties: + type: + type: string + const: text + default: text + description: >- + Discriminator type of the content item. Always "text" + text: + type: string + description: Text content + additionalProperties: false + required: + - type + - text + title: TextContentItem + description: A text content item + ToolInvocationResult: + type: object + properties: + content: + $ref: '#/components/schemas/InterleavedContent' + description: >- + (Optional) The output content from the tool execution + error_message: + type: string + description: >- + (Optional) Error message if the tool execution failed + error_code: + type: integer + description: >- + (Optional) Numeric error code if the tool execution failed + metadata: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + (Optional) Additional metadata about the tool execution + additionalProperties: false + title: ToolInvocationResult + description: Result of a tool invocation. + URL: + type: object + properties: + uri: + type: string + description: The URL string pointing to the resource + additionalProperties: false + required: + - uri + title: URL + description: A URL reference to external content. + ToolDef: + type: object + properties: + toolgroup_id: + type: string + description: >- + (Optional) ID of the tool group this tool belongs to + name: + type: string + description: Name of the tool + description: + type: string + description: >- + (Optional) Human-readable description of what the tool does + input_schema: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + (Optional) JSON Schema for tool inputs (MCP inputSchema) + output_schema: type: object - SafetyViolation: + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object description: >- - Details of a safety violation detected by content moderation. - - - :param violation_level: Severity level of the violation - - :param user_message: (Optional) Message to convey to the user about the - violation - - :param metadata: Additional metadata including specific violation codes - for debugging and telemetry - properties: - violation_level: - $ref: '#/$defs/ViolationLevel' - user_message: - anyOf: - - type: string - - type: 'null' - title: User Message - metadata: - additionalProperties: true - title: Metadata - type: object - required: - - violation_level - title: SafetyViolation + (Optional) JSON Schema for tool outputs (MCP outputSchema) + metadata: type: object - ShieldCallStep: + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object description: >- - A shield call step in an agent turn. - - - :param violation: The violation from the shield call. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: shield_call - default: shield_call - title: Step Type - type: string - violation: - anyOf: - - $ref: '#/$defs/SafetyViolation' - - type: 'null' - required: - - turn_id - - step_id - - violation - title: ShieldCallStep + (Optional) Additional metadata about the tool + additionalProperties: false + required: + - name + title: ToolDef + description: >- + Tool definition used in runtime contexts. + ListToolDefsResponse: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/ToolDef' + description: List of tool definitions + additionalProperties: false + required: + - data + title: ListToolDefsResponse + description: >- + Response containing a list of tool definitions. + RAGDocument: + type: object + properties: + document_id: + type: string + description: The unique identifier for the document. + content: + oneOf: + - type: string + - $ref: '#/components/schemas/InterleavedContentItem' + - type: array + items: + $ref: '#/components/schemas/InterleavedContentItem' + - $ref: '#/components/schemas/URL' + description: The content of the document. + mime_type: + type: string + description: The MIME type of the document. + metadata: type: object - StopReason: - enum: - - end_of_turn - - end_of_message - - out_of_tokens - title: StopReason + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: Additional metadata for the document. + additionalProperties: false + required: + - document_id + - content + - metadata + title: RAGDocument + description: >- + A document to be used for document ingestion in the RAG Tool. + InsertRequest: + type: object + properties: + documents: + type: array + items: + $ref: '#/components/schemas/RAGDocument' + description: >- + List of documents to index in the RAG system + vector_store_id: type: string - TextContentItem: description: >- - A text content item - - - :param type: Discriminator type of the content item. Always "text" - - :param text: Text content - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: TextContentItem - type: object - ToolCall: - properties: - call_id: - title: Call Id - type: string - tool_name: - anyOf: - - $ref: '#/$defs/BuiltinTool' - - type: string - title: Tool Name - arguments: - title: Arguments - type: string - required: - - call_id - - tool_name - - arguments - title: ToolCall - type: object - ToolExecutionStep: + ID of the vector database to store the document embeddings + chunk_size_in_tokens: + type: integer description: >- - A tool execution step in an agent turn. + (Optional) Size in tokens for document chunking during indexing + additionalProperties: false + required: + - documents + - vector_store_id + - chunk_size_in_tokens + title: InsertRequest + DefaultRAGQueryGeneratorConfig: + type: object + properties: + type: + type: string + const: default + default: default + description: >- + Type of query generator, always 'default' + separator: + type: string + default: ' ' + description: >- + String separator used to join query terms + additionalProperties: false + required: + - type + - separator + title: DefaultRAGQueryGeneratorConfig + description: >- + Configuration for the default RAG query generator. + LLMRAGQueryGeneratorConfig: + type: object + properties: + type: + type: string + const: llm + default: llm + description: Type of query generator, always 'llm' + model: + type: string + description: >- + Name of the language model to use for query generation + template: + type: string + description: >- + Template string for formatting the query generation prompt + additionalProperties: false + required: + - type + - model + - template + title: LLMRAGQueryGeneratorConfig + description: >- + Configuration for the LLM-based RAG query generator. + RAGQueryConfig: + type: object + properties: + query_generator_config: + oneOf: + - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' + discriminator: + propertyName: type + mapping: + default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' + description: Configuration for the query generator. + max_tokens_in_context: + type: integer + default: 4096 + description: Maximum number of tokens in the context. + max_chunks: + type: integer + default: 5 + description: Maximum number of chunks to retrieve. + chunk_template: + type: string + default: > + Result {index} - :param tool_calls: The tool calls to execute. + :param params: (Optional) Configuration parameters for the shield - :param tool_responses: The tool responses from the tool calls. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: tool_execution - default: tool_execution - title: Step Type - type: string - tool_calls: - items: - $ref: '#/$defs/ToolCall' - title: Tool Calls - type: array - tool_responses: - items: - $ref: '#/$defs/ToolResponse' - title: Tool Responses - type: array - required: - - turn_id - - step_id - - tool_calls - - tool_responses - title: ToolExecutionStep - type: object - ToolResponse: + :param type: The resource type, always shield + properties: + identifier: description: >- - Response from a tool invocation. - - - :param call_id: Unique identifier for the tool call this response is for + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: shield + default: shield + title: Type + type: string + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + required: + - identifier + - provider_id + title: Shield + type: object + SyntheticDataGenerateRequest: + type: object + SyntheticDataGenerationResponse: + description: >- + Response from the synthetic data generation. Batch of (prompt, response, score) + tuples that pass the threshold. - :param tool_name: Name of the tool that was invoked - :param content: The response content from the tool + :param synthetic_data: List of generated synthetic data samples that passed + the filtering criteria - :param metadata: (Optional) Additional metadata about the tool response - properties: - call_id: - title: Call Id - type: string - tool_name: - anyOf: - - $ref: '#/$defs/BuiltinTool' - - type: string - title: Tool Name - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - metadata: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Metadata - required: - - call_id - - tool_name - - content - title: ToolResponse - type: object - ToolResponseMessage: + :param statistics: (Optional) Statistical information about the generation + process and filtering results + properties: + synthetic_data: + items: + additionalProperties: true + type: object + title: Synthetic Data + type: array + statistics: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Statistics + required: + - synthetic_data + title: SyntheticDataGenerationResponse + type: object + InvokeToolRequest: + type: object + ToolInvocationResult: + $defs: + ImageContentItem: description: >- - A message representing the result of a tool invocation. - + A image content item - :param role: Must be "tool" to identify this as a tool response - :param call_id: Unique identifier for the tool call this response is for + :param type: Discriminator type of the content item. Always "image" - :param content: The response content from the tool + :param image: Image as a base64 encoded string or an URL properties: - role: - const: tool - default: tool - title: Role - type: string - call_id: - title: Call Id + type: + const: image + default: image + title: Type type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content + image: + $ref: '#/$defs/_URLOrData' required: - - call_id - - content - title: ToolResponseMessage + - image + title: ImageContentItem type: object - Turn: + TextContentItem: description: >- - A single turn in an interaction with an Agentic System. - - - :param turn_id: Unique identifier for the turn within a session - - :param session_id: Unique identifier for the conversation session - - :param input_messages: List of messages that initiated this turn - - :param steps: Ordered list of processing steps executed during this turn - - :param output_message: The model's generated response containing content - and metadata - - :param output_attachments: (Optional) Files or media attached to the agent's - response + A text content item - :param started_at: Timestamp when the turn began - :param completed_at: (Optional) Timestamp when the turn finished, if completed + :param type: Discriminator type of the content item. Always "text" + + :param text: Text content properties: - turn_id: - title: Turn Id - type: string - session_id: - title: Session Id + type: + const: text + default: text + title: Type type: string - input_messages: - items: - anyOf: - - $ref: '#/$defs/UserMessage' - - $ref: '#/$defs/ToolResponseMessage' - title: Input Messages - type: array - steps: - items: - discriminator: - mapping: - inference: '#/$defs/InferenceStep' - memory_retrieval: '#/$defs/MemoryRetrievalStep' - shield_call: '#/$defs/ShieldCallStep' - tool_execution: '#/$defs/ToolExecutionStep' - propertyName: step_type - oneOf: - - $ref: '#/$defs/InferenceStep' - - $ref: '#/$defs/ToolExecutionStep' - - $ref: '#/$defs/ShieldCallStep' - - $ref: '#/$defs/MemoryRetrievalStep' - title: Steps - type: array - output_message: - $ref: '#/$defs/CompletionMessage' - output_attachments: - anyOf: - - items: - $ref: '#/$defs/Attachment' - type: array - - type: 'null' - title: Output Attachments - started_at: - format: date-time - title: Started At + text: + title: Text type: string - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At required: - - turn_id - - session_id - - input_messages - - steps - - output_message - - started_at - title: Turn + - text + title: TextContentItem type: object URL: description: >- @@ -17593,89 +16394,6 @@ components: - uri title: URL type: object - UserMessage: - description: >- - A message from the user in a chat conversation. - - - :param role: Must be "user" to identify this as a user message - - :param content: The content of the message, which can include text and - other media - - :param context: (Optional) This field is used internally by Llama Stack - to pass RAG context. This field may be removed in the API in the future. - properties: - role: - const: user - default: user - title: Role - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - context: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - type: 'null' - title: Context - required: - - content - title: UserMessage - type: object - ViolationLevel: - description: >- - Severity level of a safety violation. - - - :cvar INFO: Informational level violation that does not require action - - :cvar WARN: Warning level violation that suggests caution but allows continuation - - :cvar ERROR: Error level violation that requires blocking or intervention - enum: - - info - - warn - - error - title: ViolationLevel - type: string _URLOrData: description: >- A URL or a base64 encoded string @@ -17699,210 +16417,349 @@ components: title: _URLOrData type: object description: >- - A single session of an interaction with an Agentic System. + Result of a tool invocation. - :param session_id: Unique identifier for the conversation session + :param content: (Optional) The output content from the tool execution - :param session_name: Human-readable name for the session + :param error_message: (Optional) Error message if the tool execution failed - :param turns: List of all turns that have occurred in this session + :param error_code: (Optional) Numeric error code if the tool execution failed - :param started_at: Timestamp when the session was created + :param metadata: (Optional) Additional metadata about the tool execution properties: - session_id: - title: Session Id + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + - type: 'null' + title: Content + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + error_code: + anyOf: + - type: integer + - type: 'null' + title: Error Code + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + title: ToolInvocationResult + type: object + URL: + description: >- + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri type: string - session_name: - title: Session Name + required: + - uri + title: URL + type: object + ListToolDefsResponse: + description: "Response containing a list of tool definitions.\n\n:param data: List of tool definitions" + properties: + data: + items: + $ref: '#/components/schemas/ToolDef' + title: Data + type: array + required: + - data + title: ListToolDefsResponse + type: object + VectorStoreDeleteResponse: + description: "Response from deleting a vector store.\n\n:param id: Unique identifier of the deleted vector store\n:param object: Object type identifier for the deletion response\n:param deleted: Whether the deletion operation was successful" + properties: + id: + title: Id type: string - turns: + object: + default: vector_store.deleted + title: Object + type: string + deleted: + default: true + title: Deleted + type: boolean + required: + - id + title: VectorStoreDeleteResponse + type: object + VectorStoreFileContentsResponse: + description: "Response from retrieving the contents of a vector store file.\n\n:param file_id: Unique identifier for the file\n:param filename: Name of the file\n:param attributes: Key-value attributes associated with the file\n:param content: List of content items from the file" + properties: + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + attributes: + additionalProperties: true + title: Attributes + type: object + content: items: - $ref: '#/$defs/Turn' - title: Turns + $ref: '#/components/schemas/VectorStoreContent' + title: Content type: array - started_at: - format: date-time - title: Started At - type: string required: - - session_id - - session_name - - turns - - started_at - title: Session + - file_id + - filename + - attributes + - content + title: VectorStoreFileContentsResponse type: object + VectorStoreFileDeleteResponse: + description: "Response from deleting a vector store file.\n\n:param id: Unique identifier of the deleted file\n:param object: Object type identifier for the deletion response\n:param deleted: Whether the deletion operation was successful" properties: - turn_id: - type: string - description: The ID of the turn. - step_id: - type: string - description: The ID of the step. - started_at: - type: string - format: date-time - description: The time the step started. - completed_at: + id: + title: Id type: string - format: date-time - description: The time the step completed. - step_type: + object: + default: vector_store.file.deleted + title: Object type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - title: StepType - description: Type of the step in an agent turn. - const: shield_call - default: shield_call - violation: - $ref: '#/components/schemas/SafetyViolation' - description: The violation from the shield call. - additionalProperties: false + deleted: + default: true + title: Deleted + type: boolean required: - - turn_id - - step_id - - step_type - title: ShieldCallStep - description: A shield call step in an agent turn. - ToolCall: + - id + title: VectorStoreFileDeleteResponse type: object + VectorStoreFilesListInBatchResponse: + description: "Response from listing files in a vector store file batch.\n\n:param object: Object type identifier, always \"list\"\n:param data: List of vector store file objects in the batch\n:param first_id: (Optional) ID of the first file in the list for pagination\n:param last_id: (Optional) ID of the last file in the list for pagination\n:param has_more: Whether there are more files available beyond this page" properties: - call_id: + object: + default: list + title: Object type: string - tool_name: - oneOf: - - type: string - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - - type: string - arguments: + data: + items: + $ref: '#/components/schemas/VectorStoreFileObject' + title: Data + type: array + first_id: + title: First Id type: string - additionalProperties: false + nullable: true + last_id: + title: Last Id + type: string + nullable: true + has_more: + default: false + title: Has More + type: boolean required: - - call_id - - tool_name - - arguments - title: ToolCall - ToolExecutionStep: + - data + title: VectorStoreFilesListInBatchResponse type: object + VectorStoreListFilesResponse: + description: "Response from listing files in a vector store.\n\n:param object: Object type identifier, always \"list\"\n:param data: List of vector store file objects\n:param first_id: (Optional) ID of the first file in the list for pagination\n:param last_id: (Optional) ID of the last file in the list for pagination\n:param has_more: Whether there are more files available beyond this page" properties: - turn_id: - type: string - description: The ID of the turn. - step_id: + object: + default: list + title: Object type: string - description: The ID of the step. - started_at: + data: + items: + $ref: '#/components/schemas/VectorStoreFileObject' + title: Data + type: array + first_id: + title: First Id type: string - format: date-time - description: The time the step started. - completed_at: + nullable: true + last_id: + title: Last Id type: string - format: date-time - description: The time the step completed. - step_type: + nullable: true + has_more: + default: false + title: Has More + type: boolean + required: + - data + title: VectorStoreListFilesResponse + type: object + VectorStoreListResponse: + description: "Response from listing vector stores.\n\n:param object: Object type identifier, always \"list\"\n:param data: List of vector store objects\n:param first_id: (Optional) ID of the first vector store in the list for pagination\n:param last_id: (Optional) ID of the last vector store in the list for pagination\n:param has_more: Whether there are more vector stores available beyond this page" + properties: + object: + default: list + title: Object type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - title: StepType - description: Type of the step in an agent turn. - const: tool_execution - default: tool_execution - tool_calls: - type: array + data: items: - $ref: '#/components/schemas/ToolCall' - description: The tool calls to execute. - tool_responses: + $ref: '#/components/schemas/VectorStoreObject' + title: Data type: array - items: - $ref: '#/components/schemas/ToolResponse' - description: The tool responses from the tool calls. - additionalProperties: false + first_id: + title: First Id + type: string + nullable: true + last_id: + title: Last Id + type: string + nullable: true + has_more: + default: false + title: Has More + type: boolean required: - - turn_id - - step_id - - step_type - - tool_calls - - tool_responses - title: ToolExecutionStep - description: A tool execution step in an agent turn. - ToolResponse: + - data + title: VectorStoreListResponse type: object + OpenAIResponseMessage: + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." properties: - call_id: - type: string - description: >- - Unique identifier for the tool call this response is for - tool_name: - oneOf: - - type: string - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - - type: string - description: Name of the tool that was invoked content: - $ref: '#/components/schemas/InterleavedContent' - description: The response content from the tool - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool response - additionalProperties: false + anyOf: + - type: string + - items: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: array + - items: + discriminator: + mapping: + output_text: '#/$defs/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + title: Id + type: string + nullable: true + status: + title: Status + type: string + nullable: true required: - - call_id - - tool_name - - content - title: ToolResponse - description: Response from a tool invocation. - ToolResponseMessage: + - content + - role + title: OpenAIResponseMessage type: object + OpenAIResponseObjectWithInput: + description: "OpenAI response object extended with input context information.\n\n:param input: List of input items that led to this response" properties: - role: + created_at: + title: Created At + type: integer + error: + $ref: '#/components/schemas/OpenAIResponseError' + nullable: true + id: + title: Id type: string - const: tool - default: tool - description: >- - Must be "tool" to identify this as a tool response - call_id: + model: + title: Model + type: string + required: + - session_id + title: AgentSessionCreateResponse + description: >- + Response returned when creating a new agent session. + CompletionMessage: + type: object + properties: + role: type: string + const: assistant + default: assistant description: >- - Unique identifier for the tool call this response is for + Must be "assistant" to identify this as the model's response content: $ref: '#/components/schemas/InterleavedContent' - description: The response content from the tool + description: The content of the model's response + stop_reason: + type: string + enum: + - end_of_turn + - end_of_message + - out_of_tokens + description: >- + Reason why the model stopped generating. Options are: - `StopReason.end_of_turn`: + The model finished generating the entire response. - `StopReason.end_of_message`: + The model finished generating but generated a partial response -- usually, + a tool call. The user may call the tool and continue the conversation + with the tool's response. - `StopReason.out_of_tokens`: The model ran + out of token budget. + tool_calls: + type: array + items: + $ref: '#/components/schemas/ToolCall' + description: >- + List of tool calls. Each tool call is a ToolCall object. additionalProperties: false required: - role - - call_id - content - title: ToolResponseMessage + - stop_reason + title: CompletionMessage description: >- - A message representing the result of a tool invocation. - Turn: + A message containing the model's (assistant) response in a chat conversation. + InferenceStep: + type: object + Session: $defs: Attachment: description: >- @@ -18399,6 +17256,86 @@ components: - content title: ToolResponseMessage type: object + Turn: + description: >- + A single turn in an interaction with an Agentic System. + + + :param turn_id: Unique identifier for the turn within a session + + :param session_id: Unique identifier for the conversation session + + :param input_messages: List of messages that initiated this turn + + :param steps: Ordered list of processing steps executed during this turn + + :param output_message: The model's generated response containing content + and metadata + + :param output_attachments: (Optional) Files or media attached to the agent's + response + + :param started_at: Timestamp when the turn began + + :param completed_at: (Optional) Timestamp when the turn finished, if completed + properties: + turn_id: + title: Turn Id + type: string + session_id: + title: Session Id + type: string + input_messages: + items: + anyOf: + - $ref: '#/$defs/UserMessage' + - $ref: '#/$defs/ToolResponseMessage' + title: Input Messages + type: array + steps: + items: + discriminator: + mapping: + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/$defs/InferenceStep' + - $ref: '#/$defs/ToolExecutionStep' + - $ref: '#/$defs/ShieldCallStep' + - $ref: '#/$defs/MemoryRetrievalStep' + title: Steps + type: array + output_message: + $ref: '#/$defs/CompletionMessage' + output_attachments: + anyOf: + - items: + $ref: '#/$defs/Attachment' + type: array + - type: 'null' + title: Output Attachments + started_at: + format: date-time + title: Started At + type: string + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + required: + - turn_id + - session_id + - input_messages + - steps + - output_message + - started_at + title: Turn + type: object URL: description: >- A URL reference to external content. @@ -18519,116 +17456,251 @@ components: title: _URLOrData type: object description: >- - A single turn in an interaction with an Agentic System. - + A single session of an interaction with an Agentic System. - :param turn_id: Unique identifier for the turn within a session :param session_id: Unique identifier for the conversation session - :param input_messages: List of messages that initiated this turn - - :param steps: Ordered list of processing steps executed during this turn - - :param output_message: The model's generated response containing content and - metadata - - :param output_attachments: (Optional) Files or media attached to the agent's - response + :param session_name: Human-readable name for the session - :param started_at: Timestamp when the turn began + :param turns: List of all turns that have occurred in this session - :param completed_at: (Optional) Timestamp when the turn finished, if completed + :param started_at: Timestamp when the session was created properties: - turn_id: - title: Turn Id - type: string session_id: title: Session Id type: string - input_messages: + session_name: + title: Session Name + type: string + turns: items: - anyOf: - - $ref: '#/$defs/UserMessage' - - $ref: '#/$defs/ToolResponseMessage' - title: Input Messages + $ref: '#/$defs/Turn' + title: Turns + type: array + started_at: + format: date-time + title: Started At + type: string + required: + - session_id + - session_name + - turns + - started_at + title: Session + type: object + properties: + turn_id: + type: string + description: The ID of the turn. + step_id: + type: string + description: The ID of the step. + started_at: + type: string + format: date-time + description: The time the step started. + completed_at: + type: string + format: date-time + description: The time the step completed. + step_type: + type: string + enum: + - inference + - tool_execution + - shield_call + - memory_retrieval + title: StepType + description: Type of the step in an agent turn. + const: shield_call + default: shield_call + violation: + $ref: '#/components/schemas/SafetyViolation' + description: The violation from the shield call. + additionalProperties: false + required: + - turn_id + - step_id + - step_type + title: ShieldCallStep + description: A shield call step in an agent turn. + ToolCall: + type: object + properties: + call_id: + type: string + tool_name: + oneOf: + - type: string + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + - type: string + arguments: + type: string + additionalProperties: false + required: + - call_id + - tool_name + - arguments + title: ToolCall + ToolExecutionStep: + type: object + properties: + turn_id: + type: string + description: The ID of the turn. + step_id: + type: string + description: The ID of the step. + started_at: + type: string + format: date-time + description: The time the step started. + completed_at: + type: string + format: date-time + description: The time the step completed. + step_type: + type: string + enum: + - inference + - tool_execution + - shield_call + - memory_retrieval + title: StepType + description: Type of the step in an agent turn. + const: tool_execution + default: tool_execution + tool_calls: type: array - steps: items: - discriminator: - mapping: - inference: '#/$defs/InferenceStep' - memory_retrieval: '#/$defs/MemoryRetrievalStep' - shield_call: '#/$defs/ShieldCallStep' - tool_execution: '#/$defs/ToolExecutionStep' - propertyName: step_type - oneOf: - - $ref: '#/$defs/InferenceStep' - - $ref: '#/$defs/ToolExecutionStep' - - $ref: '#/$defs/ShieldCallStep' - - $ref: '#/$defs/MemoryRetrievalStep' - title: Steps + $ref: '#/components/schemas/ToolCall' + description: The tool calls to execute. + tool_responses: type: array - output_message: - $ref: '#/$defs/CompletionMessage' - output_attachments: - anyOf: - - items: - $ref: '#/$defs/Attachment' - type: array - - type: 'null' - title: Output Attachments - started_at: - format: date-time - title: Started At - type: string - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At + items: + $ref: '#/components/schemas/ToolResponse' + description: The tool responses from the tool calls. + additionalProperties: false required: - turn_id - - session_id - - input_messages - - steps - - output_message - - started_at - title: Turn - description: >- - A single turn in an interaction with an Agentic System. - UserMessage: + - step_id + - step_type + - tool_calls + - tool_responses + title: ToolExecutionStep + description: A tool execution step in an agent turn. + ToolResponse: type: object properties: - role: + call_id: type: string - const: user - default: user description: >- - Must be "user" to identify this as a user message + Unique identifier for the tool call this response is for + tool_name: + oneOf: + - type: string + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + - type: string + description: Name of the tool that was invoked content: $ref: '#/components/schemas/InterleavedContent' + description: The response content from the tool + metadata: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object description: >- - The content of the message, which can include text and other media - context: - $ref: '#/components/schemas/InterleavedContent' + (Optional) Additional metadata about the tool response + additionalProperties: false + required: + - call_id + - tool_name + - content + title: ToolResponse + description: Response from a tool invocation. + ToolResponseMessage: + type: object + properties: + role: + type: string + const: tool + default: tool description: >- - (Optional) This field is used internally by Llama Stack to pass RAG context. - This field may be removed in the API in the future. + Must be "tool" to identify this as a tool response + call_id: + type: string + description: >- + Unique identifier for the tool call this response is for + content: + $ref: '#/components/schemas/InterleavedContent' + description: The response content from the tool additionalProperties: false required: - role + - call_id - content - title: UserMessage + title: ToolResponseMessage description: >- - A message from the user in a chat conversation. - CreateAgentTurnRequest: - type: object - ResumeAgentTurnRequest: - type: object - AgentStepResponse: + A message representing the result of a tool invocation. + Turn: $defs: + Attachment: + description: >- + An attachment to an agent turn. + + + :param content: The content of the attachment. + + :param mime_type: The MIME type of the attachment. + properties: + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + - $ref: '#/$defs/URL' + title: Content + mime_type: + title: Mime Type + type: string + required: + - content + - mime_type + title: Attachment + type: object BuiltinTool: enum: - brave_search @@ -19026,31 +18098,144 @@ components: - $ref: '#/$defs/TextContentItem' type: array title: Content - metadata: + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + required: + - call_id + - tool_name + - content + title: ToolResponse + type: object + ToolResponseMessage: + description: >- + A message representing the result of a tool invocation. + + + :param role: Must be "tool" to identify this as a tool response + + :param call_id: Unique identifier for the tool call this response is for + + :param content: The response content from the tool + properties: + role: + const: tool + default: tool + title: Role + type: string + call_id: + title: Call Id + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + required: + - call_id + - content + title: ToolResponseMessage + type: object + URL: + description: >- + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + UserMessage: + description: >- + A message from the user in a chat conversation. + + + :param role: Must be "user" to identify this as a user message + + :param content: The content of the message, which can include text and + other media + + :param context: (Optional) This field is used internally by Llama Stack + to pass RAG context. This field may be removed in the API in the future. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + context: anyOf: - - additionalProperties: true - type: object + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array - type: 'null' - title: Metadata + title: Context required: - - call_id - - tool_name - content - title: ToolResponse - type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL + title: UserMessage type: object ViolationLevel: description: >- @@ -19091,155 +18276,215 @@ components: title: _URLOrData type: object description: >- - Response containing details of a specific agent step. + A single turn in an interaction with an Agentic System. - :param step: The complete step data and execution details - properties: - step: - discriminator: - mapping: - inference: '#/$defs/InferenceStep' - memory_retrieval: '#/$defs/MemoryRetrievalStep' - shield_call: '#/$defs/ShieldCallStep' - tool_execution: '#/$defs/ToolExecutionStep' - propertyName: step_type - oneOf: - - $ref: '#/$defs/InferenceStep' - - $ref: '#/$defs/ToolExecutionStep' - - $ref: '#/$defs/ShieldCallStep' - - $ref: '#/$defs/MemoryRetrievalStep' - title: Step - required: - - step - title: AgentStepResponse - type: object - ListBenchmarksResponse: - $defs: - Benchmark: - description: >- - A benchmark resource for evaluating model performance. + :param turn_id: Unique identifier for the turn within a session + :param session_id: Unique identifier for the conversation session - :param dataset_id: Identifier of the dataset to use for the benchmark - evaluation + :param input_messages: List of messages that initiated this turn - :param scoring_functions: List of scoring function identifiers to apply - during evaluation + :param steps: Ordered list of processing steps executed during this turn - :param metadata: Metadata for this evaluation task + :param output_message: The model's generated response containing content and + metadata - :param type: The resource type, always benchmark - properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier - type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: benchmark - default: benchmark - title: Type - type: string - dataset_id: - title: Dataset Id - type: string - scoring_functions: - items: - type: string - title: Scoring Functions - type: array - metadata: - additionalProperties: true - description: Metadata for this evaluation task - title: Metadata - type: object - required: - - identifier - - provider_id - - dataset_id - - scoring_functions - title: Benchmark - type: object + :param output_attachments: (Optional) Files or media attached to the agent's + response + + :param started_at: Timestamp when the turn began + + :param completed_at: (Optional) Timestamp when the turn finished, if completed properties: - data: + turn_id: + title: Turn Id + type: string + session_id: + title: Session Id + type: string + input_messages: items: - $ref: '#/$defs/Benchmark' - title: Data + anyOf: + - $ref: '#/$defs/UserMessage' + - $ref: '#/$defs/ToolResponseMessage' + title: Input Messages + type: array + steps: + items: + discriminator: + mapping: + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + title: Output type: array + parallel_tool_calls: + default: false + title: Parallel Tool Calls + type: boolean + previous_response_id: + title: Previous Response Id + type: string + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At required: - - data - title: ListBenchmarksResponse - type: object - RegisterBenchmarkRequest: - type: object - Benchmark: + - turn_id + - session_id + - input_messages + - steps + - output_message + - started_at + title: Turn description: >- - A benchmark resource for evaluating model performance. - - - :param dataset_id: Identifier of the dataset to use for the benchmark evaluation - - :param scoring_functions: List of scoring function identifiers to apply during - evaluation - - :param metadata: Metadata for this evaluation task - - :param type: The resource type, always benchmark + A single turn in an interaction with an Agentic System. + UserMessage: + type: object properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier + role: type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' + const: user + default: user description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: + Must be "user" to identify this as a user message + content: + $ref: '#/components/schemas/InterleavedContent' description: >- - ID of the provider that owns this resource - title: Provider Id + The content of the message, which can include text and other media + context: + $ref: '#/components/schemas/InterleavedContent' + description: >- + (Optional) This field is used internally by Llama Stack to pass RAG context. + This field may be removed in the API in the future. + additionalProperties: false + required: + - role + - content + title: UserMessage + description: >- + A message from the user in a chat conversation. + CreateAgentTurnRequest: + type: object + ResumeAgentTurnRequest: + type: object + AgentStepResponse: + $defs: + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool type: string - type: - const: benchmark - default: benchmark - title: Type + temperature: + title: Temperature + type: number + nullable: true + text: + $ref: '#/components/schemas/OpenAIResponseText' + default: + format: + type: text + top_p: + title: Top P + type: number + nullable: true + tools: + title: Tools + items: + discriminator: + mapping: + file_search: '#/$defs/OpenAIResponseInputToolFileSearch' + function: '#/$defs/OpenAIResponseInputToolFunction' + mcp: '#/$defs/OpenAIResponseToolMCP' + web_search: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + type: array + nullable: true + truncation: + title: Truncation type: string - dataset_id: - title: Dataset Id + nullable: true + usage: + $ref: '#/components/schemas/OpenAIResponseUsage' + nullable: true + instructions: + title: Instructions + type: string + nullable: true + input: + items: + anyOf: + - discriminator: + mapping: + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage' + title: Input + type: array + required: + - created_at + - id + - model + - output + - status + - input + title: OpenAIResponseObjectWithInput + type: object + ImageContentItem: + description: "A image content item\n\n:param type: Discriminator type of the content item. Always \"image\"\n:param image: Image as a base64 encoded string or an URL" + properties: + type: + const: image + default: image + title: Type type: string - scoring_functions: - items: - type: string - title: Scoring Functions - type: array - metadata: - additionalProperties: true - description: Metadata for this evaluation task - title: Metadata - type: object + image: + $ref: '#/components/schemas/_URLOrData' required: - - identifier - - provider_id - - dataset_id - - scoring_functions - title: Benchmark + - image + title: ImageContentItem type: object properties: type: @@ -19372,401 +18617,46 @@ components: :param scores: The scores from the evaluation. properties: - generations: - items: - additionalProperties: true - type: object - title: Generations - type: array - scores: - additionalProperties: - $ref: '#/$defs/ScoringResult' - title: Scores - type: object - required: - - generations - - scores - title: EvaluateResponse - type: object - RunEvalRequest: - type: object - Job: - $defs: - JobStatus: - description: >- - Status of a job execution. - - :cvar completed: Job has finished successfully - - :cvar in_progress: Job is currently running - - :cvar failed: Job has failed during execution - - :cvar scheduled: Job is scheduled but not yet started - - :cvar cancelled: Job was cancelled before completion - enum: - - completed - - in_progress - - failed - - scheduled - - cancelled - title: JobStatus - type: string - description: >- - A job execution instance with status tracking. - - - :param job_id: Unique identifier for the job - - :param status: Current execution status of the job - properties: - job_id: - title: Job Id - type: string - status: - $ref: '#/$defs/JobStatus' - required: - - job_id - - status - title: Job - type: object - RerankRequest: - type: object - RerankResponse: - $defs: - RerankData: - description: >- - A single rerank result from a reranking response. - - - :param index: The original index of the document in the input list - - :param relevance_score: The relevance score from the model output. Values - are inverted when applicable so that higher scores indicate greater relevance. - properties: - index: - title: Index - type: integer - relevance_score: - title: Relevance Score - type: number - required: - - index - - relevance_score - title: RerankData - type: object - description: >- - Response from a reranking request. - - - :param data: List of rerank result objects, sorted by relevance score (descending) - properties: - data: - items: - $ref: '#/$defs/RerankData' - title: Data - type: array - required: - - data - title: RerankResponse - type: object - PostTrainingJobArtifactsResponse: - $defs: - Checkpoint: - description: >- - Checkpoint created during training runs. - - - :param identifier: Unique identifier for the checkpoint - - :param created_at: Timestamp when the checkpoint was created - - :param epoch: Training epoch when the checkpoint was saved - - :param post_training_job_id: Identifier of the training job that created - this checkpoint - - :param path: File system path where the checkpoint is stored - - :param training_metrics: (Optional) Training metrics associated with this - checkpoint - properties: - identifier: - title: Identifier - type: string - created_at: - format: date-time - title: Created At - type: string - epoch: - title: Epoch - type: integer - post_training_job_id: - title: Post Training Job Id - type: string - path: - title: Path - type: string - training_metrics: - anyOf: - - $ref: '#/$defs/PostTrainingMetric' - - type: 'null' - required: - - identifier - - created_at - - epoch - - post_training_job_id - - path - title: Checkpoint - type: object - PostTrainingMetric: - description: >- - Training metrics captured during post-training jobs. - - - :param epoch: Training epoch number - - :param train_loss: Loss value on the training dataset - - :param validation_loss: Loss value on the validation dataset - - :param perplexity: Perplexity metric indicating model confidence - properties: - epoch: - title: Epoch - type: integer - train_loss: - title: Train Loss - type: number - validation_loss: - title: Validation Loss - type: number - perplexity: - title: Perplexity - type: number - required: - - epoch - - train_loss - - validation_loss - - perplexity - title: PostTrainingMetric - type: object - description: >- - Artifacts of a finetuning job. - - - :param job_uuid: Unique identifier for the training job - - :param checkpoints: List of model checkpoints created during training - properties: - job_uuid: - title: Job Uuid - type: string - checkpoints: - items: - $ref: '#/$defs/Checkpoint' - title: Checkpoints - type: array + epoch: + title: Epoch + type: integer + train_loss: + title: Train Loss + type: number + validation_loss: + title: Validation Loss + type: number + perplexity: + title: Perplexity + type: number required: - - job_uuid - title: PostTrainingJobArtifactsResponse + - epoch + - train_loss + - validation_loss + - perplexity + title: PostTrainingMetric type: object - CancelTrainingJobRequest: - type: object - PostTrainingJobStatusResponse: - $defs: - Checkpoint: - description: >- - Checkpoint created during training runs. - - - :param identifier: Unique identifier for the checkpoint - - :param created_at: Timestamp when the checkpoint was created - - :param epoch: Training epoch when the checkpoint was saved - - :param post_training_job_id: Identifier of the training job that created - this checkpoint - - :param path: File system path where the checkpoint is stored - - :param training_metrics: (Optional) Training metrics associated with this - checkpoint - properties: - identifier: - title: Identifier - type: string - created_at: - format: date-time - title: Created At - type: string - epoch: - title: Epoch - type: integer - post_training_job_id: - title: Post Training Job Id - type: string - path: - title: Path - type: string - training_metrics: - anyOf: - - $ref: '#/$defs/PostTrainingMetric' - - type: 'null' - required: - - identifier - - created_at - - epoch - - post_training_job_id - - path - title: Checkpoint - type: object - JobStatus: - description: >- - Status of a job execution. - - :cvar completed: Job has finished successfully - - :cvar in_progress: Job is currently running - - :cvar failed: Job has failed during execution - - :cvar scheduled: Job is scheduled but not yet started - - :cvar cancelled: Job was cancelled before completion - enum: - - completed - - in_progress - - failed - - scheduled - - cancelled - title: JobStatus - type: string - PostTrainingMetric: - description: >- - Training metrics captured during post-training jobs. - - - :param epoch: Training epoch number - - :param train_loss: Loss value on the training dataset - - :param validation_loss: Loss value on the validation dataset - - :param perplexity: Perplexity metric indicating model confidence - properties: - epoch: - title: Epoch - type: integer - train_loss: - title: Train Loss - type: number - validation_loss: - title: Validation Loss - type: number - perplexity: - title: Perplexity - type: number - required: - - epoch - - train_loss - - validation_loss - - perplexity - title: PostTrainingMetric - type: object - description: >- - Status of a finetuning job. - - - :param job_uuid: Unique identifier for the training job - - :param status: Current status of the training job - - :param scheduled_at: (Optional) Timestamp when the job was scheduled - - :param started_at: (Optional) Timestamp when the job execution began - - :param completed_at: (Optional) Timestamp when the job finished, if completed - - :param resources_allocated: (Optional) Information about computational resources - allocated to the job - - :param checkpoints: List of model checkpoints created during training + _safety_run_shield_Request: properties: - job_uuid: - title: Job Uuid + shield_id: + title: Shield Id type: string - status: - $ref: '#/$defs/JobStatus' - scheduled_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Scheduled At - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - resources_allocated: + messages: anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Resources Allocated - checkpoints: - items: - $ref: '#/$defs/Checkpoint' - title: Checkpoints - type: array - required: - - job_uuid - - status - title: PostTrainingJobStatusResponse - type: object - ListPostTrainingJobsResponse: - $defs: - PostTrainingJob: - properties: - job_uuid: - title: Job Uuid - type: string - required: - - job_uuid - title: PostTrainingJob - type: object - properties: - data: - items: - $ref: '#/$defs/PostTrainingJob' - title: Data - type: array - required: - - data - title: ListPostTrainingJobsResponse - type: object - PreferenceOptimizeRequest: - type: object - PostTrainingJob: - properties: - job_uuid: - title: Job Uuid + - $ref: '#/components/schemas/OpenAIUserMessageParam' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Messages + params: + title: Params type: string required: - - job_uuid - title: PostTrainingJob - type: object - SupervisedFineTuneRequest: + - shield_id + - messages + - params + title: _safety_run_shield_Request type: object responses: BadRequest400: @@ -19780,8 +18670,7 @@ components: title: Bad Request detail: The request was invalid or malformed TooManyRequests429: - description: >- - The client has sent too many requests in a given amount of time + description: The client has sent too many requests in a given amount of time content: application/json: schema: @@ -19789,11 +18678,9 @@ components: example: status: 429 title: Too Many Requests - detail: >- - You have exceeded the rate limit. Please try again later. + detail: You have exceeded the rate limit. Please try again later. InternalServerError500: - description: >- - The server encountered an unexpected error + description: The server encountered an unexpected error content: application/json: schema: @@ -19801,10 +18688,9 @@ components: example: status: 500 title: Internal Server Error - detail: >- - An unexpected error occurred. Our team has been notified. + detail: An unexpected error occurred DefaultError: - description: An unexpected error occurred + description: An error occurred content: application/json: schema: diff --git a/docs/static/experimental-llama-stack-spec.yaml b/docs/static/experimental-llama-stack-spec.yaml index c81b375b02..204cc9e02d 100644 --- a/docs/static/experimental-llama-stack-spec.yaml +++ b/docs/static/experimental-llama-stack-spec.yaml @@ -27,6 +27,12 @@ paths: required: true schema: title: Kwargs + - name: dataset_id + in: path + required: true + schema: + type: string + description: 'Path parameter: dataset_id' responses: '200': description: Successful Response @@ -59,18 +65,18 @@ paths: schema: type: string title: Dataset Id - - name: start_index + - name: limit in: query - required: false + required: true schema: type: integer - title: Start Index - - name: limit + title: Limit + - name: start_index in: query - required: false + required: true schema: type: integer - title: Limit + title: Start Index responses: '200': description: A PaginatedResponse. @@ -105,41 +111,29 @@ paths: schema: $ref: '#/components/schemas/ListDatasetsResponse' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' post: tags: - V1Beta summary: Register Dataset - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: register_dataset_v1beta_datasets_post - parameters: - - name: purpose - in: query - required: false - schema: - $ref: '#/components/schemas/DatasetPurpose' - - name: metadata - in: query - required: false - schema: - type: string - title: Metadata - - name: dataset_id - in: query - required: false - schema: - type: string - title: Dataset Id + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/__main_____datasets_Request' + required: true responses: '200': description: A Dataset. @@ -148,17 +142,17 @@ paths: schema: $ref: '#/components/schemas/Dataset' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' /v1beta/datasets/{dataset_id}: delete: tags: @@ -177,6 +171,12 @@ paths: required: true schema: title: Kwargs + - name: dataset_id + in: path + required: true + schema: + type: string + description: 'Path parameter: dataset_id' responses: '200': description: Successful Response @@ -235,18 +235,18 @@ paths: description: Query endpoint for proper schema generation. operationId: list_agents_v1alpha_agents_get parameters: - - name: start_index + - name: limit in: query - required: false + required: true schema: type: integer - title: Start Index - - name: limit + title: Limit + - name: start_index in: query - required: false + required: true schema: type: integer - title: Limit + title: Start Index responses: '200': description: A PaginatedResponse. @@ -315,6 +315,12 @@ paths: required: true schema: title: Kwargs + - name: agent_id + in: path + required: true + schema: + type: string + description: 'Path parameter: agent_id' responses: '200': description: Successful Response @@ -370,21 +376,14 @@ paths: tags: - V1Alpha summary: Create Agent Session - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: create_agent_session_v1alpha_agents__agent_id__session_post - parameters: - - name: agent_id - in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/__main_____agents_agent_id_session_Request' required: true - schema: - type: string - title: Agent Id - - name: session_name - in: query - required: false - schema: - type: string - title: Session Name responses: '200': description: An AgentSessionCreateResponse. @@ -393,17 +392,24 @@ paths: schema: $ref: '#/components/schemas/AgentSessionCreateResponse' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: 'Path parameter: agent_id' /v1alpha/agents/{agent_id}/session/{session_id}: delete: tags: @@ -422,6 +428,18 @@ paths: required: true schema: title: Kwargs + - name: agent_id + in: path + required: true + schema: + type: string + description: 'Path parameter: agent_id' + - name: session_id + in: path + required: true + schema: + type: string + description: 'Path parameter: session_id' responses: '200': description: Successful Response @@ -447,21 +465,21 @@ paths: description: Query endpoint for proper schema generation. operationId: get_agents_session_v1alpha_agents__agent_id__session__session_id__get parameters: - - name: session_id + - name: agent_id in: path required: true schema: type: string - title: Session Id - - name: agent_id + title: Agent Id + - name: session_id in: path required: true schema: type: string - title: Agent Id + title: Session Id - name: turn_ids in: query - required: false + required: true schema: type: string title: Turn Ids @@ -489,33 +507,14 @@ paths: tags: - V1Alpha summary: Create Agent Turn - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post - parameters: - - name: agent_id - in: path - required: true - schema: - type: string - title: Agent Id - - name: session_id - in: path - required: true - schema: - type: string - title: Session Id - - name: stream - in: query - required: false - schema: - type: boolean - default: false - title: Stream requestBody: content: application/json: schema: - $ref: '#/components/schemas/Body_create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post' + $ref: '#/components/schemas/__main_____agents_agent_id_session_session_id_turn_Request' + required: true responses: '200': description: If stream=False, returns a Turn object. @@ -524,17 +523,30 @@ paths: schema: $ref: '#/components/schemas/Turn' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: 'Path parameter: agent_id' + - name: session_id + in: path + required: true + schema: + type: string + description: 'Path parameter: session_id' /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}: get: tags: @@ -585,39 +597,14 @@ paths: tags: - V1Alpha summary: Resume Agent Turn - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: resume_agent_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__resume_post - parameters: - - name: agent_id - in: path - required: true - schema: - type: string - title: Agent Id - - name: session_id - in: path - required: true - schema: - type: string - title: Session Id - - name: turn_id - in: path - required: true - schema: - type: string - title: Turn Id - - name: stream - in: query - required: false - schema: - type: boolean - default: false - title: Stream requestBody: content: application/json: schema: - $ref: '#/components/schemas/ToolResponse' + $ref: '#/components/schemas/__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request' + required: true responses: '200': description: A Turn object if stream is False, otherwise an AsyncIterator @@ -627,17 +614,36 @@ paths: schema: $ref: '#/components/schemas/Turn' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: 'Path parameter: agent_id' + - name: session_id + in: path + required: true + schema: + type: string + description: 'Path parameter: session_id' + - name: turn_id + in: path + required: true + schema: + type: string + description: 'Path parameter: turn_id' /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}: get: tags: @@ -658,18 +664,18 @@ paths: schema: type: string title: Session Id - - name: turn_id + - name: step_id in: path required: true schema: type: string - title: Turn Id - - name: step_id + title: Step Id + - name: turn_id in: path required: true schema: type: string - title: Step Id + title: Turn Id responses: '200': description: An AgentStepResponse. @@ -703,18 +709,18 @@ paths: schema: type: string title: Agent Id - - name: start_index + - name: limit in: query - required: false + required: true schema: type: integer - title: Start Index - - name: limit + title: Limit + - name: start_index in: query - required: false + required: true schema: type: integer - title: Limit + title: Start Index responses: '200': description: A PaginatedResponse. @@ -813,6 +819,12 @@ paths: required: true schema: title: Kwargs + - name: benchmark_id + in: path + required: true + schema: + type: string + description: 'Path parameter: benchmark_id' responses: '200': description: Successful Response @@ -895,6 +907,13 @@ paths: default: description: Default Response $ref: '#/components/responses/DefaultError' + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: 'Path parameter: benchmark_id' /v1alpha/eval/benchmarks/{benchmark_id}/jobs: post: tags: @@ -927,6 +946,13 @@ paths: default: description: Default Response $ref: '#/components/responses/DefaultError' + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: 'Path parameter: benchmark_id' /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}: delete: tags: @@ -945,6 +971,18 @@ paths: required: true schema: title: Kwargs + - name: benchmark_id + in: path + required: true + schema: + type: string + description: 'Path parameter: benchmark_id' + - name: job_id + in: path + required: true + schema: + type: string + description: 'Path parameter: job_id' responses: '200': description: Successful Response @@ -1045,33 +1083,14 @@ paths: tags: - V1Alpha summary: Rerank - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: rerank_v1alpha_inference_rerank_post - parameters: - - name: model - in: query - required: false - schema: - type: string - title: Model - - name: query - in: query - required: false - schema: - type: string - title: Query - - name: items - in: query - required: false - schema: - type: string - title: Items - - name: max_num_results - in: query - required: false - schema: - type: integer - title: Max Num Results + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_inference_rerank_Request' + required: true responses: '200': description: RerankResponse with indices sorted by relevance score (descending). @@ -1080,17 +1099,17 @@ paths: schema: $ref: '#/components/schemas/RerankResponse' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' /v1alpha/post-training/job/artifacts: get: tags: @@ -1101,7 +1120,7 @@ paths: parameters: - name: job_uuid in: query - required: false + required: true schema: type: string title: Job Uuid @@ -1170,7 +1189,7 @@ paths: parameters: - name: job_uuid in: query - required: false + required: true schema: type: string title: Job Uuid @@ -1305,59 +1324,41 @@ components: AgentConfig: properties: sampling_params: - anyOf: - - $ref: '#/components/schemas/SamplingParams' - - type: 'null' + $ref: '#/components/schemas/SamplingParams' input_shields: - anyOf: - - items: - type: string - type: array - - type: 'null' title: Input Shields + items: + type: string + type: array output_shields: - anyOf: - - items: - type: string - type: array - - type: 'null' title: Output Shields + items: + type: string + type: array toolgroups: - anyOf: - - items: - anyOf: - - type: string - - $ref: '#/components/schemas/AgentToolGroupWithArgs' - type: array - - type: 'null' title: Toolgroups + items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array client_tools: - anyOf: - - items: - $ref: '#/components/schemas/ToolDef' - type: array - - type: 'null' title: Client Tools + items: + $ref: '#/components/schemas/ToolDef' + type: array tool_choice: - anyOf: - - $ref: '#/components/schemas/ToolChoice' - - type: 'null' deprecated: true + $ref: '#/components/schemas/ToolChoice' tool_prompt_format: - anyOf: - - $ref: '#/components/schemas/ToolPromptFormat' - - type: 'null' deprecated: true + $ref: '#/components/schemas/ToolPromptFormat' tool_config: - anyOf: - - $ref: '#/components/schemas/ToolConfig' - - type: 'null' + $ref: '#/components/schemas/ToolConfig' max_infer_iters: - anyOf: - - type: integer - - type: 'null' title: Max Infer Iters default: 10 + type: integer model: type: string title: Model @@ -1365,28 +1366,22 @@ components: type: string title: Instructions name: - anyOf: - - type: string - - type: 'null' title: Name + type: string enable_session_persistence: - anyOf: - - type: boolean - - type: 'null' title: Enable Session Persistence default: false + type: boolean response_format: - anyOf: - - oneOf: - - $ref: '#/components/schemas/JsonSchemaResponseFormat' - - $ref: '#/components/schemas/GrammarResponseFormat' - discriminator: - propertyName: type - mapping: - grammar: '#/components/schemas/GrammarResponseFormat' - json_schema: '#/components/schemas/JsonSchemaResponseFormat' - - type: 'null' title: Response Format + oneOf: + - $ref: '#/components/schemas/JsonSchemaResponseFormat' + - $ref: '#/components/schemas/GrammarResponseFormat' + discriminator: + propertyName: type + mapping: + grammar: '#/components/schemas/GrammarResponseFormat' + json_schema: '#/components/schemas/JsonSchemaResponseFormat' type: object required: - model @@ -1418,6 +1413,19 @@ components: :param agent_id: Unique identifier for the created agent' + AgentSessionCreateResponse: + properties: + session_id: + type: string + title: Session Id + type: object + required: + - session_id + title: AgentSessionCreateResponse + description: 'Response returned when creating a new agent session. + + + :param session_id: Unique identifier for the created session' AgentToolGroupWithArgs: properties: name: @@ -1452,6 +1460,45 @@ components: :cvar categorical_count: Count occurrences of categorical values :cvar accuracy: Calculate accuracy as the proportion of correct answers' + Attachment-Output: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + title: Content + mime_type: + type: string + title: Mime Type + type: object + required: + - content + - mime_type + title: Attachment + description: 'An attachment to an agent turn. + + + :param content: The content of the attachment. + + :param mime_type: The MIME type of the attachment.' BasicScoringFnParams: properties: type: @@ -1480,11 +1527,9 @@ components: title: Identifier description: Unique identifier for this resource in llama stack provider_resource_id: - anyOf: - - type: string - - type: 'null' title: Provider Resource Id description: Unique identifier for this resource in the provider + type: string provider_id: type: string title: Provider Id @@ -1554,12 +1599,10 @@ components: description: Map between scoring function id and parameters for each scoring function you want to run num_examples: - anyOf: - - type: integer - - type: 'null' title: Num Examples description: Number of examples to evaluate (useful for testing), if not provided, all examples in the dataset will be evaluated + type: integer type: object required: - eval_candidate @@ -1574,21 +1617,6 @@ components: :param num_examples: (Optional) The number of examples to evaluate. If not provided, all examples in the dataset will be evaluated' - Body_create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post: - properties: - messages: - $ref: '#/components/schemas/UserMessage' - documents: - $ref: '#/components/schemas/Document' - toolgroups: - anyOf: - - type: string - - $ref: '#/components/schemas/AgentToolGroupWithArgs' - title: Toolgroups - tool_config: - $ref: '#/components/schemas/ToolConfig' - type: object - title: Body_create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post BuiltinTool: type: string enum: @@ -1597,6 +1625,57 @@ components: - photogen - code_interpreter title: BuiltinTool + CompletionMessage-Output: + properties: + role: + type: string + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + title: Tool Calls + items: + $ref: '#/components/schemas/ToolCall' + type: array + type: object + required: + - content + - stop_reason + title: CompletionMessage + description: "A message containing the model's (assistant) response in a chat\ + \ conversation.\n\n:param role: Must be \"assistant\" to identify this as\ + \ the model's response\n:param content: The content of the model's response\n\ + :param stop_reason: Reason why the model stopped generating. Options are:\n\ + \ - `StopReason.end_of_turn`: The model finished generating the entire\ + \ response.\n - `StopReason.end_of_message`: The model finished generating\ + \ but generated a partial response -- usually, a tool call. The user may call\ + \ the tool and continue the conversation with the tool's response.\n -\ + \ `StopReason.out_of_tokens`: The model ran out of token budget.\n:param tool_calls:\ + \ List of tool calls. Each tool call is a ToolCall object." DPOAlignmentConfig: properties: beta: @@ -1637,22 +1716,16 @@ components: data_format: $ref: '#/components/schemas/DatasetFormat' validation_dataset_id: - anyOf: - - type: string - - type: 'null' title: Validation Dataset Id + type: string packed: - anyOf: - - type: boolean - - type: 'null' title: Packed default: false + type: boolean train_on_input: - anyOf: - - type: boolean - - type: 'null' title: Train On Input default: false + type: boolean type: object required: - dataset_id @@ -1686,11 +1759,9 @@ components: title: Identifier description: Unique identifier for this resource in llama stack provider_resource_id: - anyOf: - - type: string - - type: 'null' title: Provider Resource Id description: Unique identifier for this resource in the provider + type: string provider_id: type: string title: Provider Id @@ -1767,21 +1838,21 @@ components: anyOf: - type: string - oneOf: - - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/ImageContentItem-Input' - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem' + image: '#/components/schemas/ImageContentItem-Input' text: '#/components/schemas/TextContentItem' - items: oneOf: - - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/ImageContentItem-Input' - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem' + image: '#/components/schemas/ImageContentItem-Input' text: '#/components/schemas/TextContentItem' type: array - $ref: '#/components/schemas/URL' @@ -1803,29 +1874,21 @@ components: EfficiencyConfig: properties: enable_activation_checkpointing: - anyOf: - - type: boolean - - type: 'null' title: Enable Activation Checkpointing default: false + type: boolean enable_activation_offloading: - anyOf: - - type: boolean - - type: 'null' title: Enable Activation Offloading default: false + type: boolean memory_efficient_fsdp_wrap: - anyOf: - - type: boolean - - type: 'null' title: Memory Efficient Fsdp Wrap default: false + type: boolean fsdp_cpu_offload: - anyOf: - - type: boolean - - type: 'null' title: Fsdp Cpu Offload default: false + type: boolean type: object title: EfficiencyConfig description: 'Configuration for memory and compute efficiency optimizations. @@ -1901,7 +1964,26 @@ components: :param type: Must be "greedy" to identify this sampling strategy' - ImageContentItem: + ImageContentItem-Input: + properties: + type: + type: string + const: image + title: Type + default: image + image: + $ref: '#/components/schemas/_URLOrData' + type: object + required: + - image + title: ImageContentItem + description: 'A image content item + + + :param type: Discriminator type of the content item. Always "image" + + :param image: Image as a base64 encoded string or an URL' + ImageContentItem-Output: properties: type: type: string @@ -1920,6 +2002,39 @@ components: :param type: Discriminator type of the content item. Always "image" :param image: Image as a base64 encoded string or an URL' + InferenceStep-Output: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + started_at: + title: Started At + type: string + format: date-time + completed_at: + title: Completed At + type: string + format: date-time + step_type: + type: string + const: inference + title: Step Type + default: inference + model_response: + $ref: '#/components/schemas/CompletionMessage-Output' + type: object + required: + - turn_id + - step_id + - model_response + title: InferenceStep + description: 'An inference step in an agent turn. + + + :param model_response: The response from the LLM.' Job: properties: job_id: @@ -1991,10 +2106,8 @@ components: type: string title: Judge Model prompt_template: - anyOf: - - type: string - - type: 'null' title: Prompt Template + type: string judge_score_regexes: items: type: string @@ -2060,6 +2173,66 @@ components: required: - data title: ListPostTrainingJobsResponse + MemoryRetrievalStep-Output: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + started_at: + title: Started At + type: string + format: date-time + completed_at: + title: Completed At + type: string + format: date-time + step_type: + type: string + const: memory_retrieval + title: Step Type + default: memory_retrieval + vector_store_ids: + type: string + title: Vector Store Ids + inserted_context: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Inserted Context + type: object + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + description: 'A memory retrieval step in an agent turn. + + + :param vector_store_ids: The IDs of the vector databases to retrieve context + from. + + :param inserted_context: The context retrieved from the vector databases.' ModelCandidate: properties: type: @@ -2073,9 +2246,7 @@ components: sampling_params: $ref: '#/components/schemas/SamplingParams' system_message: - anyOf: - - $ref: '#/components/schemas/SystemMessage' - - type: 'null' + $ref: '#/components/schemas/SystemMessage' type: object required: - model @@ -2172,18 +2343,53 @@ components: :param aggregation_functions: Aggregation functions to apply to the scores of each row' - RowsDataSource: + RerankData: properties: - type: - type: string - const: rows - title: Type - default: rows - rows: - items: - additionalProperties: true - type: object - type: array + index: + type: integer + title: Index + relevance_score: + type: number + title: Relevance Score + type: object + required: + - index + - relevance_score + title: RerankData + description: 'A single rerank result from a reranking response. + + + :param index: The original index of the document in the input list + + :param relevance_score: The relevance score from the model output. Values + are inverted when applicable so that higher scores indicate greater relevance.' + RerankResponse: + properties: + data: + items: + $ref: '#/components/schemas/RerankData' + type: array + title: Data + type: object + required: + - data + title: RerankResponse + description: 'Response from a reranking request. + + + :param data: List of rerank result objects, sorted by relevance score (descending)' + RowsDataSource: + properties: + type: + type: string + const: rows + title: Type + default: rows + rows: + items: + additionalProperties: true + type: object + type: array title: Rows type: object required: @@ -2193,6 +2399,30 @@ components: \ in rows. E.g.\n - [\n {\"messages\": [{\"role\": \"user\", \"\ content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello,\ \ world!\"}]}\n ]" + SafetyViolation: + properties: + violation_level: + $ref: '#/components/schemas/ViolationLevel' + user_message: + title: User Message + type: string + metadata: + additionalProperties: true + type: object + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + description: 'Details of a safety violation detected by content moderation. + + + :param violation_level: Severity level of the violation + + :param user_message: (Optional) Message to convey to the user about the violation + + :param metadata: Additional metadata including specific violation codes for + debugging and telemetry' SamplingParams: properties: strategy: @@ -2208,23 +2438,17 @@ components: top_k: '#/components/schemas/TopKSamplingStrategy' top_p: '#/components/schemas/TopPSamplingStrategy' max_tokens: - anyOf: - - type: integer - - type: 'null' title: Max Tokens + type: integer repetition_penalty: - anyOf: - - type: number - - type: 'null' title: Repetition Penalty default: 1.0 + type: number stop: - anyOf: - - items: - type: string - type: array - - type: 'null' title: Stop + items: + type: string + type: array type: object title: SamplingParams description: "Sampling parameters.\n\n:param strategy: The sampling strategy.\n\ @@ -2259,6 +2483,46 @@ components: name to value. :param aggregated_results: Map of metric name to aggregated value' + ShieldCallStep-Output: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + started_at: + title: Started At + type: string + format: date-time + completed_at: + title: Completed At + type: string + format: date-time + step_type: + type: string + const: shield_call + title: Step Type + default: shield_call + violation: + $ref: '#/components/schemas/SafetyViolation' + type: object + required: + - turn_id + - step_id + - violation + title: ShieldCallStep + description: 'A shield call step in an agent turn. + + + :param violation: The violation from the shield call.' + StopReason: + type: string + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason SystemMessage: properties: role: @@ -2270,21 +2534,21 @@ components: anyOf: - type: string - oneOf: - - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/ImageContentItem-Input' - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem' + image: '#/components/schemas/ImageContentItem-Input' text: '#/components/schemas/TextContentItem' - items: oneOf: - - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/ImageContentItem-Input' - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem' + image: '#/components/schemas/ImageContentItem-Input' text: '#/components/schemas/TextContentItem' type: array title: Content @@ -2332,6 +2596,25 @@ components: :param type: Discriminator type of the content item. Always "text" :param text: Text content' + ToolCall: + properties: + call_id: + type: string + title: Call Id + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + type: string + title: Arguments + type: object + required: + - call_id + - tool_name + - arguments + title: ToolCall ToolChoice: type: string enum: @@ -2355,18 +2638,13 @@ components: anyOf: - $ref: '#/components/schemas/ToolChoice' - type: string - - type: 'null' title: Tool Choice default: auto tool_prompt_format: - anyOf: - - $ref: '#/components/schemas/ToolPromptFormat' - - type: 'null' + $ref: '#/components/schemas/ToolPromptFormat' system_message_behavior: - anyOf: - - $ref: '#/components/schemas/SystemMessageBehavior' - - type: 'null' default: append + $ref: '#/components/schemas/SystemMessageBehavior' type: object title: ToolConfig description: "Configuration for tool use.\n\n:param tool_choice: (Optional)\ @@ -2387,36 +2665,26 @@ components: ToolDef: properties: toolgroup_id: - anyOf: - - type: string - - type: 'null' title: Toolgroup Id + type: string name: type: string title: Name description: - anyOf: - - type: string - - type: 'null' title: Description + type: string input_schema: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Input Schema + additionalProperties: true + type: object output_schema: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Output Schema + additionalProperties: true + type: object metadata: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Metadata + additionalProperties: true + type: object type: object required: - name @@ -2436,6 +2704,50 @@ components: :param metadata: (Optional) Additional metadata about the tool :param toolgroup_id: (Optional) ID of the tool group this tool belongs to' + ToolExecutionStep-Output: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + started_at: + title: Started At + type: string + format: date-time + completed_at: + title: Completed At + type: string + format: date-time + step_type: + type: string + const: tool_execution + title: Step Type + default: tool_execution + tool_calls: + items: + $ref: '#/components/schemas/ToolCall' + type: array + title: Tool Calls + tool_responses: + items: + $ref: '#/components/schemas/ToolResponse-Output' + type: array + title: Tool Responses + type: object + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + description: 'A tool execution step in an agent turn. + + + :param tool_calls: The tool calls to execute. + + :param tool_responses: The tool responses from the tool calls.' ToolPromptFormat: type: string enum: @@ -2453,7 +2765,7 @@ components: \ that can be\n evaluated to a list. Each element in the list is a function\ \ call. Example:\n [\"function_name(param1, param2)\", \"function_name(param1,\ \ param2)\"]" - ToolResponse: + ToolResponse-Input: properties: call_id: type: string @@ -2467,30 +2779,80 @@ components: anyOf: - type: string - oneOf: - - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/ImageContentItem-Input' - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem' + image: '#/components/schemas/ImageContentItem-Input' text: '#/components/schemas/TextContentItem' - items: oneOf: - - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/ImageContentItem-Input' - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem' + image: '#/components/schemas/ImageContentItem-Input' text: '#/components/schemas/TextContentItem' type: array title: Content metadata: + title: Metadata + additionalProperties: true + type: object + type: object + required: + - call_id + - tool_name + - content + title: ToolResponse + description: 'Response from a tool invocation. + + + :param call_id: Unique identifier for the tool call this response is for + + :param tool_name: Name of the tool that was invoked + + :param content: The response content from the tool + + :param metadata: (Optional) Additional metadata about the tool response' + ToolResponse-Output: + properties: + call_id: + type: string + title: Call Id + tool_name: anyOf: - - additionalProperties: true - type: object - - type: 'null' + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: title: Metadata + additionalProperties: true + type: object type: object required: - call_id @@ -2507,6 +2869,51 @@ components: :param content: The response content from the tool :param metadata: (Optional) Additional metadata about the tool response' + ToolResponseMessage-Output: + properties: + role: + type: string + const: tool + title: Role + default: tool + call_id: + type: string + title: Call Id + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + type: object + required: + - call_id + - content + title: ToolResponseMessage + description: 'A message representing the result of a tool invocation. + + + :param role: Must be "tool" to identify this as a tool response + + :param call_id: Unique identifier for the tool call this response is for + + :param content: The response content from the tool' TopKSamplingStrategy: properties: type: @@ -2538,17 +2945,13 @@ components: title: Type default: top_p temperature: - anyOf: - - type: number - minimum: 0.0 - - type: 'null' title: Temperature + type: number + minimum: 0.0 top_p: - anyOf: - - type: number - - type: 'null' title: Top P default: 0.95 + type: number type: object required: - temperature @@ -2578,29 +2981,19 @@ components: title: Gradient Accumulation Steps default: 1 max_validation_steps: - anyOf: - - type: integer - - type: 'null' title: Max Validation Steps default: 1 + type: integer data_config: - anyOf: - - $ref: '#/components/schemas/DataConfig' - - type: 'null' + $ref: '#/components/schemas/DataConfig' optimizer_config: - anyOf: - - $ref: '#/components/schemas/OptimizerConfig' - - type: 'null' + $ref: '#/components/schemas/OptimizerConfig' efficiency_config: - anyOf: - - $ref: '#/components/schemas/EfficiencyConfig' - - type: 'null' + $ref: '#/components/schemas/EfficiencyConfig' dtype: - anyOf: - - type: string - - type: 'null' title: Dtype default: bf16 + type: string type: object required: - n_epochs @@ -2626,6 +3019,81 @@ components: optimizations :param dtype: (Optional) Data type for model parameters (bf16, fp16, fp32)' + Turn: + properties: + turn_id: + type: string + title: Turn Id + session_id: + type: string + title: Session Id + input_messages: + items: + anyOf: + - $ref: '#/components/schemas/UserMessage-Output' + - $ref: '#/components/schemas/ToolResponseMessage-Output' + type: array + title: Input Messages + steps: + items: + oneOf: + - $ref: '#/components/schemas/InferenceStep-Output' + - $ref: '#/components/schemas/ToolExecutionStep-Output' + - $ref: '#/components/schemas/ShieldCallStep-Output' + - $ref: '#/components/schemas/MemoryRetrievalStep-Output' + discriminator: + propertyName: step_type + mapping: + inference: '#/components/schemas/InferenceStep-Output' + memory_retrieval: '#/components/schemas/MemoryRetrievalStep-Output' + shield_call: '#/components/schemas/ShieldCallStep-Output' + tool_execution: '#/components/schemas/ToolExecutionStep-Output' + type: array + title: Steps + output_message: + $ref: '#/components/schemas/CompletionMessage-Output' + output_attachments: + title: Output Attachments + items: + $ref: '#/components/schemas/Attachment-Output' + type: array + started_at: + type: string + format: date-time + title: Started At + completed_at: + title: Completed At + type: string + format: date-time + type: object + required: + - turn_id + - session_id + - input_messages + - steps + - output_message + - started_at + title: Turn + description: 'A single turn in an interaction with an Agentic System. + + + :param turn_id: Unique identifier for the turn within a session + + :param session_id: Unique identifier for the conversation session + + :param input_messages: List of messages that initiated this turn + + :param steps: Ordered list of processing steps executed during this turn + + :param output_message: The model''s generated response containing content + and metadata + + :param output_attachments: (Optional) Files or media attached to the agent''s + response + + :param started_at: Timestamp when the turn began + + :param completed_at: (Optional) Timestamp when the turn finished, if completed' URIDataSource: properties: type: @@ -2656,7 +3124,7 @@ components: :param uri: The URL string pointing to the resource' - UserMessage: + UserMessage-Input: properties: role: type: string @@ -2667,21 +3135,21 @@ components: anyOf: - type: string - oneOf: - - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/ImageContentItem-Input' - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem' + image: '#/components/schemas/ImageContentItem-Input' text: '#/components/schemas/TextContentItem' - items: oneOf: - - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/ImageContentItem-Input' - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem' + image: '#/components/schemas/ImageContentItem-Input' text: '#/components/schemas/TextContentItem' type: array title: Content @@ -2689,24 +3157,23 @@ components: anyOf: - type: string - oneOf: - - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/ImageContentItem-Input' - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem' + image: '#/components/schemas/ImageContentItem-Input' text: '#/components/schemas/TextContentItem' - items: oneOf: - - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/ImageContentItem-Input' - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem' + image: '#/components/schemas/ImageContentItem-Input' text: '#/components/schemas/TextContentItem' type: array - - type: 'null' title: Context type: object required: @@ -2722,18 +3189,94 @@ components: :param context: (Optional) This field is used internally by Llama Stack to pass RAG context. This field may be removed in the API in the future.' - _URLOrData: + UserMessage-Output: properties: - url: + role: + type: string + const: user + title: Role + default: user + content: anyOf: - - $ref: '#/components/schemas/URL' - - type: 'null' - data: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + context: anyOf: - type: string - - type: 'null' + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Context + type: object + required: + - content + title: UserMessage + description: 'A message from the user in a chat conversation. + + + :param role: Must be "user" to identify this as a user message + + :param content: The content of the message, which can include text and other + media + + :param context: (Optional) This field is used internally by Llama Stack to + pass RAG context. This field may be removed in the API in the future.' + ViolationLevel: + type: string + enum: + - info + - warn + - error + title: ViolationLevel + description: 'Severity level of a safety violation. + + + :cvar INFO: Informational level violation that does not require action + + :cvar WARN: Warning level violation that suggests caution but allows continuation + + :cvar ERROR: Error level violation that requires blocking or intervention' + _URLOrData: + properties: + url: + $ref: '#/components/schemas/URL' + data: contentEncoding: base64 title: Data + type: string type: object title: _URLOrData description: 'A URL or a base64 encoded string @@ -2743,6 +3286,112 @@ components: Note that URL could have length limits. :param data: base64 encoded image data as string' + __main_____agents_agent_id_session_Request: + properties: + agent_id: + type: string + title: Agent Id + session_name: + type: string + title: Session Name + type: object + required: + - agent_id + - session_name + title: _agents_agent_id_session_Request + __main_____agents_agent_id_session_session_id_turn_Request: + properties: + agent_id: + type: string + title: Agent Id + session_id: + type: string + title: Session Id + messages: + $ref: '#/components/schemas/UserMessage-Input' + stream: + type: boolean + title: Stream + default: false + documents: + $ref: '#/components/schemas/Document' + toolgroups: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + title: Toolgroups + tool_config: + $ref: '#/components/schemas/ToolConfig' + type: object + required: + - agent_id + - session_id + - messages + - documents + - toolgroups + - tool_config + title: _agents_agent_id_session_session_id_turn_Request + __main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request: + properties: + agent_id: + type: string + title: Agent Id + session_id: + type: string + title: Session Id + turn_id: + type: string + title: Turn Id + tool_responses: + $ref: '#/components/schemas/ToolResponse-Input' + stream: + type: boolean + title: Stream + default: false + type: object + required: + - agent_id + - session_id + - turn_id + - tool_responses + title: _agents_agent_id_session_session_id_turn_turn_id_resume_Request + __main_____datasets_Request: + properties: + purpose: + $ref: '#/components/schemas/DatasetPurpose' + metadata: + type: string + title: Metadata + dataset_id: + type: string + title: Dataset Id + type: object + required: + - purpose + - metadata + - dataset_id + title: _datasets_Request + _inference_rerank_Request: + properties: + model: + type: string + title: Model + query: + type: string + title: Query + items: + type: string + title: Items + max_num_results: + type: integer + title: Max Num Results + type: object + required: + - model + - query + - items + - max_num_results + title: _inference_rerank_Request Error: description: 'Error response from the API. Roughly follows RFC 7807. @@ -2767,17 +3416,577 @@ components: title: Detail type: string instance: - anyOf: - - type: string - - type: 'null' - default: null title: Instance + type: string + nullable: true required: - status - title - detail title: Error type: object + Agent: + description: 'An agent instance with configuration and metadata. + + + :param agent_id: Unique identifier for the agent + + :param agent_config: Configuration settings for the agent + + :param created_at: Timestamp when the agent was created' + properties: + agent_id: + title: Agent Id + type: string + agent_config: + $ref: '#/components/schemas/AgentConfig' + created_at: + format: date-time + title: Created At + type: string + required: + - agent_id + - agent_config + - created_at + title: Agent + type: object + AgentStepResponse: + description: 'Response containing details of a specific agent step. + + + :param step: The complete step data and execution details' + properties: + step: + discriminator: + mapping: + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/components/schemas/InferenceStep' + - $ref: '#/components/schemas/ToolExecutionStep' + - $ref: '#/components/schemas/ShieldCallStep' + - $ref: '#/components/schemas/MemoryRetrievalStep' + title: Step + required: + - step + title: AgentStepResponse + type: object + CompletionMessage: + description: "A message containing the model's (assistant) response in a chat\ + \ conversation.\n\n:param role: Must be \"assistant\" to identify this as\ + \ the model's response\n:param content: The content of the model's response\n\ + :param stop_reason: Reason why the model stopped generating. Options are:\n\ + \ - `StopReason.end_of_turn`: The model finished generating the entire\ + \ response.\n - `StopReason.end_of_message`: The model finished generating\ + \ but generated a partial response -- usually, a tool call. The user may call\ + \ the tool and continue the conversation with the tool's response.\n -\ + \ `StopReason.out_of_tokens`: The model ran out of token budget.\n:param tool_calls:\ + \ List of tool calls. Each tool call is a ToolCall object." + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + title: Tool Calls + items: + $ref: '#/components/schemas/ToolCall' + type: array + required: + - content + - stop_reason + title: CompletionMessage + type: object + InferenceStep: + description: 'An inference step in an agent turn. + + + :param model_response: The response from the LLM.' + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + title: Started At + format: date-time + type: string + nullable: true + completed_at: + title: Completed At + format: date-time + type: string + nullable: true + step_type: + const: inference + default: inference + title: Step Type + type: string + model_response: + $ref: '#/components/schemas/CompletionMessage' + required: + - turn_id + - step_id + - model_response + title: InferenceStep + type: object + MemoryRetrievalStep: + description: 'A memory retrieval step in an agent turn. + + + :param vector_store_ids: The IDs of the vector databases to retrieve context + from. + + :param inserted_context: The context retrieved from the vector databases.' + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + title: Started At + format: date-time + type: string + nullable: true + completed_at: + title: Completed At + format: date-time + type: string + nullable: true + step_type: + const: memory_retrieval + default: memory_retrieval + title: Step Type + type: string + vector_store_ids: + title: Vector Store Ids + type: string + inserted_context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Inserted Context + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + type: object + PaginatedResponse: + description: 'A generic paginated response that follows a simple format. + + + :param data: The list of items for the current page + + :param has_more: Whether there are more items available after this set + + :param url: The URL for accessing this list' + properties: + data: + items: + additionalProperties: true + type: object + title: Data + type: array + has_more: + title: Has More + type: boolean + url: + title: Url + type: string + nullable: true + required: + - data + - has_more + title: PaginatedResponse + type: object + Session: + description: 'A single session of an interaction with an Agentic System. + + + :param session_id: Unique identifier for the conversation session + + :param session_name: Human-readable name for the session + + :param turns: List of all turns that have occurred in this session + + :param started_at: Timestamp when the session was created' + properties: + session_id: + title: Session Id + type: string + session_name: + title: Session Name + type: string + turns: + items: + $ref: '#/components/schemas/Turn' + title: Turns + type: array + started_at: + format: date-time + title: Started At + type: string + required: + - session_id + - session_name + - turns + - started_at + title: Session + type: object + ShieldCallStep: + description: 'A shield call step in an agent turn. + + + :param violation: The violation from the shield call.' + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + title: Started At + format: date-time + type: string + nullable: true + completed_at: + title: Completed At + format: date-time + type: string + nullable: true + step_type: + const: shield_call + default: shield_call + title: Step Type + type: string + violation: + $ref: '#/components/schemas/SafetyViolation' + required: + - turn_id + - step_id + - violation + title: ShieldCallStep + type: object + ToolExecutionStep: + description: 'A tool execution step in an agent turn. + + + :param tool_calls: The tool calls to execute. + + :param tool_responses: The tool responses from the tool calls.' + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + title: Started At + format: date-time + type: string + nullable: true + completed_at: + title: Completed At + format: date-time + type: string + nullable: true + step_type: + const: tool_execution + default: tool_execution + title: Step Type + type: string + tool_calls: + items: + $ref: '#/components/schemas/ToolCall' + title: Tool Calls + type: array + tool_responses: + items: + $ref: '#/components/schemas/ToolResponse' + title: Tool Responses + type: array + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + type: object + ToolResponse: + description: 'Response from a tool invocation. + + + :param call_id: Unique identifier for the tool call this response is for + + :param tool_name: Name of the tool that was invoked + + :param content: The response content from the tool + + :param metadata: (Optional) Additional metadata about the tool response' + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + title: Metadata + additionalProperties: true + type: object + nullable: true + required: + - call_id + - tool_name + - content + title: ToolResponse + type: object + Checkpoint: + description: 'Checkpoint created during training runs. + + + :param identifier: Unique identifier for the checkpoint + + :param created_at: Timestamp when the checkpoint was created + + :param epoch: Training epoch when the checkpoint was saved + + :param post_training_job_id: Identifier of the training job that created this + checkpoint + + :param path: File system path where the checkpoint is stored + + :param training_metrics: (Optional) Training metrics associated with this + checkpoint' + properties: + identifier: + title: Identifier + type: string + created_at: + format: date-time + title: Created At + type: string + epoch: + title: Epoch + type: integer + post_training_job_id: + title: Post Training Job Id + type: string + path: + title: Path + type: string + training_metrics: + $ref: '#/components/schemas/PostTrainingMetric' + nullable: true + required: + - identifier + - created_at + - epoch + - post_training_job_id + - path + title: Checkpoint + type: object + PostTrainingJobArtifactsResponse: + description: 'Artifacts of a finetuning job. + + + :param job_uuid: Unique identifier for the training job + + :param checkpoints: List of model checkpoints created during training' + properties: + job_uuid: + title: Job Uuid + type: string + checkpoints: + items: + $ref: '#/components/schemas/Checkpoint' + title: Checkpoints + type: array + required: + - job_uuid + title: PostTrainingJobArtifactsResponse + type: object + PostTrainingJobStatusResponse: + description: 'Status of a finetuning job. + + + :param job_uuid: Unique identifier for the training job + + :param status: Current status of the training job + + :param scheduled_at: (Optional) Timestamp when the job was scheduled + + :param started_at: (Optional) Timestamp when the job execution began + + :param completed_at: (Optional) Timestamp when the job finished, if completed + + :param resources_allocated: (Optional) Information about computational resources + allocated to the job + + :param checkpoints: List of model checkpoints created during training' + properties: + job_uuid: + title: Job Uuid + type: string + status: + $ref: '#/components/schemas/JobStatus' + scheduled_at: + title: Scheduled At + format: date-time + type: string + nullable: true + started_at: + title: Started At + format: date-time + type: string + nullable: true + completed_at: + title: Completed At + format: date-time + type: string + nullable: true + resources_allocated: + title: Resources Allocated + additionalProperties: true + type: object + nullable: true + checkpoints: + items: + $ref: '#/components/schemas/Checkpoint' + title: Checkpoints + type: array + required: + - job_uuid + - status + title: PostTrainingJobStatusResponse + type: object + ImageContentItem: + description: 'A image content item + + + :param type: Discriminator type of the content item. Always "image" + + :param image: Image as a base64 encoded string or an URL' + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + PostTrainingMetric: + description: 'Training metrics captured during post-training jobs. + + + :param epoch: Training epoch number + + :param train_loss: Loss value on the training dataset + + :param validation_loss: Loss value on the validation dataset + + :param perplexity: Perplexity metric indicating model confidence' + properties: + epoch: + title: Epoch + type: integer + train_loss: + title: Train Loss + type: number + validation_loss: + title: Validation Loss + type: number + perplexity: + title: Perplexity + type: number + required: + - epoch + - train_loss + - validation_loss + - perplexity + title: PostTrainingMetric + type: object responses: BadRequest400: description: The request was invalid or malformed diff --git a/docs/static/llama-stack-spec.yaml b/docs/static/llama-stack-spec.yaml index 16e00b829e..dd2fe12cfb 100644 --- a/docs/static/llama-stack-spec.yaml +++ b/docs/static/llama-stack-spec.yaml @@ -19,7 +19,7 @@ paths: parameters: - name: after in: query - required: false + required: true schema: type: string title: After @@ -53,39 +53,14 @@ paths: tags: - V1 summary: Create Batch - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: create_batch_v1_batches_post - parameters: - - name: input_file_id - in: query - required: false - schema: - type: string - title: Input File Id - - name: endpoint - in: query - required: false - schema: - type: string - title: Endpoint - - name: completion_window - in: query - required: false - schema: - type: string - title: Completion Window - - name: metadata - in: query - required: false - schema: - type: string - title: Metadata - - name: idempotency_key - in: query - required: false - schema: - type: string - title: Idempotency Key + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/_batches_Request' responses: '200': description: The created batch object. @@ -143,15 +118,14 @@ paths: tags: - V1 summary: Cancel Batch - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: cancel_batch_v1_batches__batch_id__cancel_post - parameters: - - name: batch_id - in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_batches_batch_id_cancel_Request' required: true - schema: - type: string - title: Batch Id responses: '200': description: The updated batch object. @@ -160,17 +134,24 @@ paths: schema: $ref: '#/components/schemas/Batch' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: batch_id + in: path + required: true + schema: + type: string + description: 'Path parameter: batch_id' /v1/chat/completions: get: tags: @@ -181,10 +162,16 @@ paths: parameters: - name: after in: query - required: false + required: true schema: type: string title: After + - name: model + in: query + required: true + schema: + type: string + title: Model - name: limit in: query required: false @@ -192,12 +179,6 @@ paths: type: integer default: 20 title: Limit - - name: model - in: query - required: false - schema: - type: string - title: Model - name: order in: query required: false @@ -324,42 +305,14 @@ paths: tags: - V1 summary: Create Conversation - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: create_conversation_v1_conversations_post - parameters: - - name: metadata - in: query - required: false - schema: - type: string - title: Metadata requestBody: content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - title: Items + $ref: '#/components/schemas/_conversations_Request' + required: true responses: '200': description: The created conversation object. @@ -368,17 +321,17 @@ paths: schema: $ref: '#/components/schemas/Conversation' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' /v1/conversations/{conversation_id}: delete: tags: @@ -448,21 +401,14 @@ paths: tags: - V1 summary: Update Conversation - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: update_conversation_v1_conversations__conversation_id__post - parameters: - - name: conversation_id - in: path + requestBody: required: true - schema: - type: string - title: Conversation Id - - name: metadata - in: query - required: false - schema: - type: string - title: Metadata + content: + application/json: + schema: + $ref: '#/components/schemas/_conversations_conversation_id_Request' responses: '200': description: The updated conversation object. @@ -482,6 +428,13 @@ paths: default: $ref: '#/components/responses/DefaultError' description: Default Response + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + description: 'Path parameter: conversation_id' /v1/conversations/{conversation_id}/items: get: tags: @@ -498,24 +451,24 @@ paths: title: Conversation Id - name: after in: query - required: false + required: true schema: type: string title: After - name: include in: query - required: false + required: true schema: $ref: '#/components/schemas/ConversationItemInclude' - name: limit in: query - required: false + required: true schema: type: integer title: Limit - name: order in: query - required: false + required: true schema: type: string title: Order @@ -542,30 +495,14 @@ paths: tags: - V1 summary: Add Items - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: add_items_v1_conversations__conversation_id__items_post - parameters: - - name: conversation_id - in: path - required: true - schema: - type: string - title: Conversation Id requestBody: + required: true content: application/json: schema: - anyOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - title: Items + $ref: '#/components/schemas/_conversations_conversation_id_items_Request' responses: '200': description: List of created items. @@ -585,6 +522,13 @@ paths: default: $ref: '#/components/responses/DefaultError' description: Default Response + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + description: 'Path parameter: conversation_id' /v1/conversations/{conversation_id}/items/{item_id}: delete: tags: @@ -628,25 +572,28 @@ paths: tags: - V1 summary: Retrieve - description: Generic endpoint - this would be replaced with actual implementation. + description: Query endpoint for proper schema generation. operationId: retrieve_v1_conversations__conversation_id__items__item_id__get parameters: - - name: args - in: query + - name: conversation_id + in: path required: true schema: - title: Args - - name: kwargs - in: query + type: string + title: Conversation Id + - name: item_id + in: path required: true schema: - title: Kwargs + type: string + title: Item Id responses: '200': description: The conversation item. content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/OpenAIResponseMessage' '400': $ref: '#/components/responses/BadRequest400' description: Bad Request @@ -701,10 +648,15 @@ paths: parameters: - name: after in: query - required: false + required: true schema: type: string title: After + - name: purpose + in: query + required: true + schema: + $ref: '#/components/schemas/OpenAIFilePurpose' - name: limit in: query required: false @@ -718,11 +670,6 @@ paths: schema: $ref: '#/components/schemas/Order' default: desc - - name: purpose - in: query - required: false - schema: - $ref: '#/components/schemas/OpenAIFilePurpose' responses: '200': description: An ListOpenAIFileResponse containing the list of files. @@ -850,6 +797,12 @@ paths: required: true schema: title: Kwargs + - name: file_id + in: path + required: true + schema: + type: string + description: 'Path parameter: file_id' responses: '200': description: The raw file content as a binary response. @@ -959,14 +912,14 @@ paths: schema: $ref: '#/components/schemas/OpenAIListModelsResponse' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: $ref: '#/components/responses/DefaultError' tags: @@ -979,38 +932,14 @@ paths: tags: - V1 summary: Register Model - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: register_model_v1_models_post - parameters: - - name: model_id - in: query - required: false - schema: - type: string - title: Model Id - - name: provider_model_id - in: query - required: false - schema: - type: string - title: Provider Model Id - - name: provider_id - in: query - required: false - schema: - type: string - title: Provider Id - - name: metadata - in: query - required: false - schema: - type: string - title: Metadata - - name: model_type - in: query - required: false - schema: - $ref: '#/components/schemas/ModelType' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_models_Request' + required: true responses: '200': description: A Model. @@ -1019,17 +948,17 @@ paths: schema: $ref: '#/components/schemas/Model' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' /v1/models/{model_id}: delete: tags: @@ -1048,6 +977,12 @@ paths: required: true schema: title: Kwargs + - name: model_id + in: path + required: true + schema: + type: string + description: 'Path parameter: model_id' responses: '200': description: Successful Response @@ -1103,21 +1038,14 @@ paths: tags: - V1 summary: Run Moderation - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: run_moderation_v1_moderations_post - parameters: - - name: input - in: query - required: false - schema: - type: string - title: Input - - name: model - in: query - required: false - schema: - type: string - title: Model + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_moderations_Request' + required: true responses: '200': description: A moderation object. @@ -1126,17 +1054,17 @@ paths: schema: $ref: '#/components/schemas/ModerationObject' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' /v1/prompts: get: tags: @@ -1152,36 +1080,29 @@ paths: schema: $ref: '#/components/schemas/ListPromptsResponse' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' post: tags: - V1 summary: Create Prompt - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: create_prompt_v1_prompts_post - parameters: - - name: prompt - in: query - required: false - schema: - type: string - title: Prompt - - name: variables - in: query - required: false - schema: - type: string - title: Variables + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_prompts_Request' + required: true responses: '200': description: The created Prompt resource. @@ -1190,17 +1111,17 @@ paths: schema: $ref: '#/components/schemas/Prompt' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' /v1/prompts/{prompt_id}: delete: tags: @@ -1219,6 +1140,13 @@ paths: required: true schema: title: Kwargs + - &id001 + name: prompt_id + in: path + required: true + schema: + type: string + description: 'Path parameter: prompt_id' responses: '200': description: Successful Response @@ -1252,7 +1180,7 @@ paths: title: Prompt Id - name: version in: query - required: false + required: true schema: type: integer title: Version @@ -1279,40 +1207,14 @@ paths: tags: - V1 summary: Update Prompt - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: update_prompt_v1_prompts__prompt_id__post - parameters: - - name: prompt_id - in: path + requestBody: required: true - schema: - type: string - title: Prompt Id - - name: prompt - in: query - required: false - schema: - type: string - title: Prompt - - name: version - in: query - required: false - schema: - type: integer - title: Version - - name: variables - in: query - required: false - schema: - type: string - title: Variables - - name: set_as_default - in: query - required: false - schema: - type: boolean - default: true - title: Set As Default + content: + application/json: + schema: + $ref: '#/components/schemas/_prompts_prompt_id_Request' responses: '200': description: The updated Prompt resource with incremented version. @@ -1332,26 +1234,21 @@ paths: default: $ref: '#/components/responses/DefaultError' description: Default Response + parameters: + - *id001 /v1/prompts/{prompt_id}/set-default-version: post: tags: - V1 summary: Set Default Version - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: set_default_version_v1_prompts__prompt_id__set_default_version_post - parameters: - - name: prompt_id - in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_prompts_prompt_id_set_default_version_Request' required: true - schema: - type: string - title: Prompt Id - - name: version - in: query - required: false - schema: - type: integer - title: Version responses: '200': description: The prompt with the specified version now set as default. @@ -1360,17 +1257,24 @@ paths: schema: $ref: '#/components/schemas/Prompt' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: prompt_id + in: path + required: true + schema: + type: string + description: 'Path parameter: prompt_id' /v1/prompts/{prompt_id}/versions: get: tags: @@ -1473,10 +1377,16 @@ paths: parameters: - name: after in: query - required: false + required: true schema: type: string title: After + - name: model + in: query + required: true + schema: + type: string + title: Model - name: limit in: query required: false @@ -1484,12 +1394,6 @@ paths: type: integer default: 50 title: Limit - - name: model - in: query - required: false - schema: - type: string - title: Model - name: order in: query required: false @@ -1519,77 +1423,14 @@ paths: tags: - V1 summary: Create Openai Response - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: create_openai_response_v1_responses_post - parameters: - - name: input - in: query - required: false - schema: - type: string - title: Input - - name: model - in: query - required: false - schema: - type: string - title: Model - - name: instructions - in: query - required: false - schema: - type: string - title: Instructions - - name: previous_response_id - in: query - required: false - schema: - type: string - title: Previous Response Id - - name: conversation - in: query - required: false - schema: - type: string - title: Conversation - - name: store - in: query - required: false - schema: - type: boolean - default: true - title: Store - - name: stream - in: query - required: false - schema: - type: boolean - default: false - title: Stream - - name: temperature - in: query - required: false - schema: - type: number - title: Temperature - - name: include - in: query - required: false - schema: - type: string - title: Include - - name: max_infer_iters - in: query - required: false - schema: - type: integer - default: 10 - title: Max Infer Iters requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/Body_create_openai_response_v1_responses_post' + $ref: '#/components/schemas/_responses_Request' responses: '200': description: An OpenAIResponseObject. @@ -1690,19 +1531,19 @@ paths: title: Response Id - name: after in: query - required: false + required: true schema: type: string title: After - name: before in: query - required: false + required: true schema: type: string title: Before - name: include in: query - required: false + required: true schema: type: string title: Include @@ -1743,32 +1584,14 @@ paths: tags: - V1 summary: Run Shield - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: run_shield_v1_safety_run_shield_post - parameters: - - name: shield_id - in: query - required: false - schema: - type: string - title: Shield Id - - name: params - in: query - required: false - schema: - type: string - title: Params requestBody: content: application/json: schema: - anyOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - title: Messages + $ref: '#/components/schemas/_safety_run_shield_Request' + required: true responses: '200': description: A RunShieldResponse. @@ -1777,17 +1600,17 @@ paths: schema: $ref: '#/components/schemas/RunShieldResponse' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' /v1/scoring-functions: get: tags: @@ -1867,6 +1690,12 @@ paths: required: true schema: title: Kwargs + - name: scoring_fn_id + in: path + required: true + schema: + type: string + description: 'Path parameter: scoring_fn_id' responses: '200': description: Successful Response @@ -1922,21 +1751,14 @@ paths: tags: - V1 summary: Score - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: score_v1_scoring_score_post - parameters: - - name: input_rows - in: query - required: false - schema: - type: string - title: Input Rows - - name: scoring_functions - in: query - required: false - schema: - type: string - title: Scoring Functions + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_scoring_score_Request' + required: true responses: '200': description: A ScoreResponse object containing rows and aggregated results. @@ -1945,44 +1767,30 @@ paths: schema: $ref: '#/components/schemas/ScoreResponse' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' /v1/scoring/score-batch: post: tags: - V1 summary: Score Batch - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: score_batch_v1_scoring_score_batch_post - parameters: - - name: dataset_id - in: query - required: false - schema: - type: string - title: Dataset Id - - name: scoring_functions - in: query - required: false - schema: - type: string - title: Scoring Functions - - name: save_results_dataset - in: query - required: false - schema: - type: boolean - default: false - title: Save Results Dataset + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_scoring_score_batch_Request' + required: true responses: '200': description: A ScoreBatchResponse. @@ -1991,17 +1799,17 @@ paths: schema: $ref: '#/components/schemas/ScoreBatchResponse' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' /v1/shields: get: tags: @@ -2017,48 +1825,29 @@ paths: schema: $ref: '#/components/schemas/ListShieldsResponse' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' post: tags: - V1 summary: Register Shield - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: register_shield_v1_shields_post - parameters: - - name: shield_id - in: query - required: false - schema: - type: string - title: Shield Id - - name: provider_shield_id - in: query - required: false - schema: - type: string - title: Provider Shield Id - - name: provider_id - in: query - required: false - schema: - type: string - title: Provider Id - - name: params - in: query - required: false - schema: - type: string - title: Params + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_shields_Request' + required: true responses: '200': description: A Shield. @@ -2067,17 +1856,17 @@ paths: schema: $ref: '#/components/schemas/Shield' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' /v1/shields/{identifier}: delete: tags: @@ -2096,6 +1885,12 @@ paths: required: true schema: title: Kwargs + - name: identifier + in: path + required: true + schema: + type: string + description: 'Path parameter: identifier' responses: '200': description: Successful Response @@ -2189,21 +1984,14 @@ paths: tags: - V1 summary: Invoke Tool - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: invoke_tool_v1_tool_runtime_invoke_post - parameters: - - name: tool_name - in: query - required: false - schema: - type: string - title: Tool Name - - name: kwargs - in: query - required: false - schema: - type: string - title: Kwargs + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_tool_runtime_invoke_Request' + required: true responses: '200': description: A ToolInvocationResult. @@ -2212,17 +2000,17 @@ paths: schema: $ref: '#/components/schemas/ToolInvocationResult' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' /v1/tool-runtime/list-tools: get: tags: @@ -2233,11 +2021,12 @@ paths: parameters: - name: tool_group_id in: query - required: false + required: true schema: type: string title: Tool Group Id requestBody: + required: true content: application/json: schema: @@ -2302,26 +2091,14 @@ paths: tags: - V1 summary: Rag Tool.Query - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: rag_tool_query_v1_tool_runtime_rag_tool_query_post - parameters: - - name: content - in: query - required: false - schema: - type: string - title: Content - - name: vector_store_ids - in: query - required: false - schema: - type: string - title: Vector Store Ids requestBody: content: application/json: schema: - $ref: '#/components/schemas/RAGQueryConfig' + $ref: '#/components/schemas/_tool_runtime_rag_tool_query_Request' + required: true responses: '200': description: RAGQueryResult containing the retrieved content and metadata @@ -2330,17 +2107,17 @@ paths: schema: $ref: '#/components/schemas/RAGQueryResult' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' /v1/toolgroups: get: tags: @@ -2420,6 +2197,12 @@ paths: required: true schema: title: Kwargs + - name: toolgroup_id + in: path + required: true + schema: + type: string + description: 'Path parameter: toolgroup_id' responses: '200': description: Successful Response @@ -2480,7 +2263,7 @@ paths: parameters: - name: toolgroup_id in: query - required: false + required: true schema: type: string title: Toolgroup Id @@ -2577,27 +2360,14 @@ paths: tags: - V1 summary: Query Chunks - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: query_chunks_v1_vector_io_query_post - parameters: - - name: vector_store_id - in: query - required: false - schema: - type: string - title: Vector Store Id - - name: query - in: query - required: false - schema: - type: string - title: Query - - name: params - in: query - required: false - schema: - type: string - title: Params + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_vector_io_query_Request' + required: true responses: '200': description: A QueryChunksResponse. @@ -2606,17 +2376,17 @@ paths: schema: $ref: '#/components/schemas/QueryChunksResponse' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' /v1/vector_stores: get: tags: @@ -2625,6 +2395,18 @@ paths: description: Query endpoint for proper schema generation. operationId: openai_list_vector_stores_v1_vector_stores_get parameters: + - name: after + in: query + required: true + schema: + type: string + title: After + - name: before + in: query + required: true + schema: + type: string + title: Before - name: limit in: query required: false @@ -2639,18 +2421,6 @@ paths: type: string default: desc title: Order - - name: after - in: query - required: false - schema: - type: string - title: After - - name: before - in: query - required: false - schema: - type: string - title: Before responses: '200': description: A VectorStoreListResponse containing the list of vector stores. @@ -2770,33 +2540,14 @@ paths: tags: - V1 summary: Openai Update Vector Store - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: openai_update_vector_store_v1_vector_stores__vector_store_id__post - parameters: - - name: vector_store_id - in: path + requestBody: required: true - schema: - type: string - title: Vector Store Id - - name: name - in: query - required: false - schema: - type: string - title: Name - - name: expires_after - in: query - required: false - schema: - type: string - title: Expires After - - name: metadata - in: query - required: false - schema: - type: string - title: Metadata + content: + application/json: + schema: + $ref: '#/components/schemas/_vector_stores_vector_store_id_Request' responses: '200': description: A VectorStoreObject representing the updated vector store. @@ -2816,6 +2567,13 @@ paths: default: $ref: '#/components/responses/DefaultError' description: Default Response + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: 'Path parameter: vector_store_id' /v1/vector_stores/{vector_store_id}/file_batches: post: tags: @@ -2849,6 +2607,13 @@ paths: default: description: Default Response $ref: '#/components/responses/DefaultError' + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: 'Path parameter: vector_store_id' /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: get: tags: @@ -2893,21 +2658,14 @@ paths: tags: - V1 summary: Openai Cancel Vector Store File Batch - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post - parameters: - - name: batch_id - in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request' required: true - schema: - type: string - title: Batch Id - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id responses: '200': description: A VectorStoreFileBatchObject representing the cancelled file @@ -2917,17 +2675,30 @@ paths: schema: $ref: '#/components/schemas/VectorStoreFileBatchObject' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: 'Path parameter: vector_store_id' + - name: batch_id + in: path + required: true + schema: + type: string + description: 'Path parameter: batch_id' /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: get: tags: @@ -2950,19 +2721,19 @@ paths: title: Vector Store Id - name: after in: query - required: false + required: true schema: type: string title: After - name: before in: query - required: false + required: true schema: type: string title: Before - name: filter in: query - required: false + required: true schema: type: string title: Filter @@ -3014,38 +2785,38 @@ paths: schema: type: string title: Vector Store Id - - name: limit - in: query - required: false - schema: - type: integer - default: 20 - title: Limit - - name: order - in: query - required: false - schema: - type: string - default: desc - title: Order - name: after in: query - required: false + required: true schema: type: string title: After - name: before in: query - required: false + required: true schema: type: string title: Before - name: filter in: query - required: false + required: true schema: type: string title: Filter + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit + - name: order + in: query + required: false + schema: + type: string + default: desc + title: Order responses: '200': description: A VectorStoreListFilesResponse containing the list of files. @@ -3069,35 +2840,14 @@ paths: tags: - V1 summary: Openai Attach File To Vector Store - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - - name: file_id - in: query - required: false - schema: - type: string - title: File Id - - name: attributes - in: query - required: false - schema: - type: string - title: Attributes requestBody: + required: true content: application/json: schema: - anyOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' - title: Chunking Strategy + $ref: '#/components/schemas/_vector_stores_vector_store_id_files_Request' responses: '200': description: A VectorStoreFileObject representing the attached file. @@ -3117,6 +2867,13 @@ paths: default: $ref: '#/components/responses/DefaultError' description: Default Response + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: 'Path parameter: vector_store_id' /v1/vector_stores/{vector_store_id}/files/{file_id}: delete: tags: @@ -3125,18 +2882,18 @@ paths: description: Query endpoint for proper schema generation. operationId: openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete parameters: - - name: vector_store_id + - name: file_id in: path required: true schema: type: string - title: Vector Store Id - - name: file_id + title: File Id + - name: vector_store_id in: path required: true schema: type: string - title: File Id + title: Vector Store Id responses: '200': description: A VectorStoreFileDeleteResponse indicating the deletion status. @@ -3163,18 +2920,18 @@ paths: description: Query endpoint for proper schema generation. operationId: openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get parameters: - - name: vector_store_id + - name: file_id in: path required: true schema: type: string - title: Vector Store Id - - name: file_id + title: File Id + - name: vector_store_id in: path required: true schema: type: string - title: File Id + title: Vector Store Id responses: '200': description: A VectorStoreFileObject representing the file. @@ -3198,27 +2955,14 @@ paths: tags: - V1 summary: Openai Update Vector Store File - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - - name: file_id - in: path + requestBody: required: true - schema: - type: string - title: File Id - - name: attributes - in: query - required: false - schema: - type: string - title: Attributes + content: + application/json: + schema: + $ref: '#/components/schemas/_vector_stores_vector_store_id_files_file_id_Request' responses: '200': description: A VectorStoreFileObject representing the updated file. @@ -3238,6 +2982,19 @@ paths: default: $ref: '#/components/responses/DefaultError' description: Default Response + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: 'Path parameter: vector_store_id' + - name: file_id + in: path + required: true + schema: + type: string + description: 'Path parameter: file_id' /v1/vector_stores/{vector_store_id}/files/{file_id}/content: get: tags: @@ -3246,18 +3003,18 @@ paths: description: Query endpoint for proper schema generation. operationId: openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get parameters: - - name: vector_store_id + - name: file_id in: path required: true schema: type: string - title: Vector Store Id - - name: file_id + title: File Id + - name: vector_store_id in: path required: true schema: type: string - title: File Id + title: Vector Store Id responses: '200': description: A list of InterleavedContent representing the file contents. @@ -3282,53 +3039,14 @@ paths: tags: - V1 summary: Openai Search Vector Store - description: Query endpoint for proper schema generation. + description: Typed endpoint for proper schema generation. operationId: openai_search_vector_store_v1_vector_stores__vector_store_id__search_post - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - - name: query - in: query - required: false - schema: - type: string - title: Query - - name: filters - in: query - required: false - schema: - type: string - title: Filters - - name: max_num_results - in: query - required: false - schema: - type: integer - default: 10 - title: Max Num Results - - name: rewrite_query - in: query - required: false - schema: - type: boolean - default: false - title: Rewrite Query - - name: search_mode - in: query - required: false - schema: - type: string - default: vector - title: Search Mode requestBody: content: application/json: schema: - $ref: '#/components/schemas/SearchRankingOptions' + $ref: '#/components/schemas/_vector_stores_vector_store_id_search_Request' + required: true responses: '200': description: A VectorStoreSearchResponse containing the search results. @@ -3337,17 +3055,24 @@ paths: schema: $ref: '#/components/schemas/VectorStoreSearchResponsePage' '400': - $ref: '#/components/responses/BadRequest400' description: Bad Request + $ref: '#/components/responses/BadRequest400' '429': - $ref: '#/components/responses/TooManyRequests429' description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: '#/components/responses/InternalServerError500' description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: - $ref: '#/components/responses/DefaultError' description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: 'Path parameter: vector_store_id' /v1/version: get: tags: @@ -8462,12 +8187,10 @@ components: AllowedToolsFilter: properties: tool_names: - anyOf: - - items: - type: string - type: array - - type: 'null' title: Tool Names + items: + type: string + type: array type: object title: AllowedToolsFilter description: 'Filter configuration for restricting which MCP tools can be used. @@ -8477,19 +8200,15 @@ components: ApprovalFilter: properties: always: - anyOf: - - items: - type: string - type: array - - type: 'null' title: Always + items: + type: string + type: array never: - anyOf: - - items: - type: string - type: array - - type: 'null' title: Never + items: + type: string + type: array type: object title: ApprovalFilter description: 'Filter configuration for MCP tool approval requirements. @@ -8532,47 +8251,287 @@ components: :param aggregation_functions: Aggregation functions to apply to the scores of each row' - Body_create_openai_response_v1_responses_post: - properties: - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - text: - $ref: '#/components/schemas/OpenAIResponseText' - tools: - anyOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' - title: Tools - type: object - title: Body_create_openai_response_v1_responses_post - BooleanType: + Batch: properties: - type: + id: type: string - const: boolean - title: Type - default: boolean - type: object - title: BooleanType - description: 'Parameter type for boolean values. - - - :param type: Discriminator type. Always "boolean"' - ChatCompletionInputType: - properties: - type: + title: Id + completion_window: type: string - const: chat_completion_input - title: Type - default: chat_completion_input + title: Completion Window + created_at: + type: integer + title: Created At + endpoint: + type: string + title: Endpoint + input_file_id: + type: string + title: Input File Id + object: + type: string + const: batch + title: Object + status: + type: string + enum: + - validating + - failed + - in_progress + - finalizing + - completed + - expired + - cancelling + - cancelled + title: Status + cancelled_at: + title: Cancelled At + type: integer + cancelling_at: + title: Cancelling At + type: integer + completed_at: + title: Completed At + type: integer + error_file_id: + title: Error File Id + type: string + errors: + $ref: '#/components/schemas/Errors' + expired_at: + title: Expired At + type: integer + expires_at: + title: Expires At + type: integer + failed_at: + title: Failed At + type: integer + finalizing_at: + title: Finalizing At + type: integer + in_progress_at: + title: In Progress At + type: integer + metadata: + title: Metadata + additionalProperties: + type: string + type: object + model: + title: Model + type: string + output_file_id: + title: Output File Id + type: string + request_counts: + $ref: '#/components/schemas/BatchRequestCounts' + usage: + $ref: '#/components/schemas/BatchUsage' + additionalProperties: true + type: object + required: + - id + - completion_window + - created_at + - endpoint + - input_file_id + - object + - status + title: Batch + BatchError: + properties: + code: + title: Code + type: string + line: + title: Line + type: integer + message: + title: Message + type: string + param: + title: Param + type: string + additionalProperties: true + type: object + title: BatchError + BatchRequestCounts: + properties: + completed: + type: integer + title: Completed + failed: + type: integer + title: Failed + total: + type: integer + title: Total + additionalProperties: true + type: object + required: + - completed + - failed + - total + title: BatchRequestCounts + BatchUsage: + properties: + input_tokens: + type: integer + title: Input Tokens + input_tokens_details: + $ref: '#/components/schemas/InputTokensDetails' + output_tokens: + type: integer + title: Output Tokens + output_tokens_details: + $ref: '#/components/schemas/OutputTokensDetails' + total_tokens: + type: integer + title: Total Tokens + additionalProperties: true + type: object + required: + - input_tokens + - input_tokens_details + - output_tokens + - output_tokens_details + - total_tokens + title: BatchUsage + BooleanType: + properties: + type: + type: string + const: boolean + title: Type + default: boolean + type: object + title: BooleanType + description: 'Parameter type for boolean values. + + + :param type: Discriminator type. Always "boolean"' + ChatCompletionInputType: + properties: + type: + type: string + const: chat_completion_input + title: Type + default: chat_completion_input type: object title: ChatCompletionInputType description: 'Parameter type for chat completion input. :param type: Discriminator type. Always "chat_completion_input"' + Chunk-Output: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + chunk_id: + type: string + title: Chunk Id + metadata: + additionalProperties: true + type: object + title: Metadata + embedding: + title: Embedding + items: + type: number + type: array + chunk_metadata: + $ref: '#/components/schemas/ChunkMetadata' + type: object + required: + - content + - chunk_id + title: Chunk + description: "A chunk of content that can be inserted into a vector database.\n\ + :param content: The content of the chunk, which can be interleaved text, images,\ + \ or other types.\n:param chunk_id: Unique identifier for the chunk. Must\ + \ be provided explicitly.\n:param metadata: Metadata associated with the chunk\ + \ that will be used in the model context during inference.\n:param embedding:\ + \ Optional embedding for the chunk. If not provided, it will be computed later.\n\ + :param chunk_metadata: Metadata for the chunk that will NOT be used in the\ + \ context during inference.\n The `chunk_metadata` is required backend\ + \ functionality." + ChunkMetadata: + properties: + chunk_id: + title: Chunk Id + type: string + document_id: + title: Document Id + type: string + source: + title: Source + type: string + created_timestamp: + title: Created Timestamp + type: integer + updated_timestamp: + title: Updated Timestamp + type: integer + chunk_window: + title: Chunk Window + type: string + chunk_tokenizer: + title: Chunk Tokenizer + type: string + chunk_embedding_model: + title: Chunk Embedding Model + type: string + chunk_embedding_dimension: + title: Chunk Embedding Dimension + type: integer + content_token_count: + title: Content Token Count + type: integer + metadata_token_count: + title: Metadata Token Count + type: integer + type: object + title: ChunkMetadata + description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used\ + \ to store additional information about the chunk that\n will not be used\ + \ in the context during inference, but is required for backend functionality.\ + \ The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and\ + \ is not expected to change after.\n Use `Chunk.metadata` for metadata\ + \ that will be used in the context during inference.\n:param chunk_id: The\ + \ ID of the chunk. If not set, it will be generated based on the document\ + \ ID and content.\n:param document_id: The ID of the document this chunk belongs\ + \ to.\n:param source: The source of the content, such as a URL, file path,\ + \ or other identifier.\n:param created_timestamp: An optional timestamp indicating\ + \ when the chunk was created.\n:param updated_timestamp: An optional timestamp\ + \ indicating when the chunk was last updated.\n:param chunk_window: The window\ + \ of the chunk, which can be used to group related chunks together.\n:param\ + \ chunk_tokenizer: The tokenizer used to create the chunk. Default is Tiktoken.\n\ + :param chunk_embedding_model: The embedding model used to create the chunk's\ + \ embedding.\n:param chunk_embedding_dimension: The dimension of the embedding\ + \ vector for the chunk.\n:param content_token_count: The number of tokens\ + \ in the content of the chunk.\n:param metadata_token_count: The number of\ + \ tokens in the metadata of the chunk." CompletionInputType: properties: type: @@ -8586,6 +8545,45 @@ components: :param type: Discriminator type. Always "completion_input"' + Conversation: + properties: + id: + type: string + title: Id + description: The unique ID of the conversation. + object: + type: string + const: conversation + title: Object + description: The object type, which is always conversation. + default: conversation + created_at: + type: integer + title: Created At + description: The time at which the conversation was created, measured in + seconds since the Unix epoch. + metadata: + title: Metadata + description: Set of 16 key-value pairs that can be attached to an object. + This can be useful for storing additional information about the object + in a structured format, and querying for objects via API or the dashboard. + additionalProperties: + type: string + type: object + items: + title: Items + description: Initial items to include in the conversation context. You may + add up to 20 items at a time. + items: + additionalProperties: true + type: object + type: array + type: object + required: + - id + - created_at + title: Conversation + description: OpenAI-compatible conversation object. ConversationItemInclude: type: string enum: @@ -9170,6 +9168,19 @@ components: :param type: Type of query generator, always ''default'' :param separator: String separator used to join query terms' + Errors: + properties: + data: + title: Data + items: + $ref: '#/components/schemas/BatchError' + type: array + object: + title: Object + type: string + additionalProperties: true + type: object + title: Errors HealthInfo: properties: status: @@ -9189,6 +9200,35 @@ components: - Error - Not Implemented title: HealthStatus + ImageContentItem-Output: + properties: + type: + type: string + const: image + title: Type + default: image + image: + $ref: '#/components/schemas/_URLOrData' + type: object + required: + - image + title: ImageContentItem + description: 'A image content item + + + :param type: Discriminator type of the content item. Always "image" + + :param image: Image as a base64 encoded string or an URL' + InputTokensDetails: + properties: + cached_tokens: + type: integer + title: Cached Tokens + additionalProperties: true + type: object + required: + - cached_tokens + title: InputTokensDetails JsonType: properties: type: @@ -9213,10 +9253,8 @@ components: type: string title: Judge Model prompt_template: - anyOf: - - type: string - - type: 'null' title: Prompt Template + type: string judge_score_regexes: items: type: string @@ -9371,10 +9409,8 @@ components: type: string title: Name description: - anyOf: - - type: string - - type: 'null' title: Description + type: string type: object required: - input_schema @@ -9395,11 +9431,9 @@ components: title: Identifier description: Unique identifier for this resource in llama stack provider_resource_id: - anyOf: - - type: string - - type: 'null' title: Provider Resource Id description: Unique identifier for this resource in the provider + type: string provider_id: type: string title: Provider Id @@ -9452,59 +9486,125 @@ components: :cvar rerank: Reranking model for reordering documents based on their relevance to a query' - NumberType: + ModerationObject: properties: - type: + id: type: string - const: number - title: Type - default: number - type: object - title: NumberType - description: 'Parameter type for numeric values. - - - :param type: Discriminator type. Always "number"' - ObjectType: - properties: - type: + title: Id + model: type: string - const: object - title: Type - default: object + title: Model + results: + items: + $ref: '#/components/schemas/ModerationObjectResults' + type: array + title: Results type: object - title: ObjectType - description: 'Parameter type for object values. + required: + - id + - model + - results + title: ModerationObject + description: 'A moderation object. + :param id: The unique identifier for the moderation request. - :param type: Discriminator type. Always "object"' - OpenAIAssistantMessageParam-Input: + :param model: The model used to generate the moderation results. + + :param results: A list of moderation objects' + ModerationObjectResults: properties: - role: - type: string - const: assistant - title: Role - default: assistant + flagged: + type: boolean + title: Flagged + categories: + title: Categories + additionalProperties: + type: boolean + type: object + category_applied_input_types: + title: Category Applied Input Types + additionalProperties: + items: + type: string + type: array + type: object + category_scores: + title: Category Scores + additionalProperties: + type: number + type: object + user_message: + title: User Message + type: string + metadata: + additionalProperties: true + type: object + title: Metadata + type: object + required: + - flagged + title: ModerationObjectResults + description: 'A moderation object. + + :param flagged: Whether any of the below categories are flagged. + + :param categories: A list of the categories, and whether they are flagged + or not. + + :param category_applied_input_types: A list of the categories along with the + input type(s) that the score applies to. + + :param category_scores: A list of the categories along with their scores as + predicted by model.' + NumberType: + properties: + type: + type: string + const: number + title: Type + default: number + type: object + title: NumberType + description: 'Parameter type for numeric values. + + + :param type: Discriminator type. Always "number"' + ObjectType: + properties: + type: + type: string + const: object + title: Type + default: object + type: object + title: ObjectType + description: 'Parameter type for object values. + + + :param type: Discriminator type. Always "object"' + OpenAIAssistantMessageParam-Input: + properties: + role: + type: string + const: assistant + title: Role + default: assistant content: anyOf: - type: string - items: $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' type: array - - type: 'null' title: Content name: - anyOf: - - type: string - - type: 'null' title: Name + type: string tool_calls: - anyOf: - - items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' - type: array - - type: 'null' title: Tool Calls + items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array type: object title: OpenAIAssistantMessageParam description: 'A message containing the model''s (assistant) response in an OpenAI-compatible @@ -9532,20 +9632,15 @@ components: - items: $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' type: array - - type: 'null' title: Content name: - anyOf: - - type: string - - type: 'null' title: Name + type: string tool_calls: - anyOf: - - items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' - type: array - - type: 'null' title: Tool Calls + items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array type: object title: OpenAIAssistantMessageParam description: 'A message containing the model''s (assistant) response in an OpenAI-compatible @@ -9582,9 +9677,7 @@ components: type: string title: Model usage: - anyOf: - - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - - type: 'null' + $ref: '#/components/schemas/OpenAIChatCompletionUsage' type: object required: - id @@ -9671,135 +9764,96 @@ components: minItems: 1 title: Messages frequency_penalty: - anyOf: - - type: number - - type: 'null' title: Frequency Penalty + type: number function_call: anyOf: - type: string - additionalProperties: true type: object - - type: 'null' title: Function Call functions: - anyOf: - - items: - additionalProperties: true - type: object - type: array - - type: 'null' title: Functions - logit_bias: - anyOf: - - additionalProperties: - type: number + items: + additionalProperties: true type: object - - type: 'null' + type: array + logit_bias: title: Logit Bias + additionalProperties: + type: number + type: object logprobs: - anyOf: - - type: boolean - - type: 'null' title: Logprobs + type: boolean max_completion_tokens: - anyOf: - - type: integer - - type: 'null' title: Max Completion Tokens + type: integer max_tokens: - anyOf: - - type: integer - - type: 'null' title: Max Tokens + type: integer n: - anyOf: - - type: integer - - type: 'null' title: N + type: integer parallel_tool_calls: - anyOf: - - type: boolean - - type: 'null' title: Parallel Tool Calls + type: boolean presence_penalty: - anyOf: - - type: number - - type: 'null' title: Presence Penalty + type: number response_format: - anyOf: - - oneOf: - - $ref: '#/components/schemas/OpenAIResponseFormatText' - - $ref: '#/components/schemas/OpenAIResponseFormatJSONSchema' - - $ref: '#/components/schemas/OpenAIResponseFormatJSONObject' - discriminator: - propertyName: type - mapping: - json_object: '#/components/schemas/OpenAIResponseFormatJSONObject' - json_schema: '#/components/schemas/OpenAIResponseFormatJSONSchema' - text: '#/components/schemas/OpenAIResponseFormatText' - - type: 'null' title: Response Format + oneOf: + - $ref: '#/components/schemas/OpenAIResponseFormatText' + - $ref: '#/components/schemas/OpenAIResponseFormatJSONSchema' + - $ref: '#/components/schemas/OpenAIResponseFormatJSONObject' + discriminator: + propertyName: type + mapping: + json_object: '#/components/schemas/OpenAIResponseFormatJSONObject' + json_schema: '#/components/schemas/OpenAIResponseFormatJSONSchema' + text: '#/components/schemas/OpenAIResponseFormatText' seed: - anyOf: - - type: integer - - type: 'null' title: Seed + type: integer stop: anyOf: - type: string - items: type: string type: array - - type: 'null' title: Stop stream: - anyOf: - - type: boolean - - type: 'null' title: Stream + type: boolean stream_options: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Stream Options + additionalProperties: true + type: object temperature: - anyOf: - - type: number - - type: 'null' title: Temperature + type: number tool_choice: anyOf: - type: string - additionalProperties: true type: object - - type: 'null' title: Tool Choice tools: - anyOf: - - items: - additionalProperties: true - type: object - type: array - - type: 'null' title: Tools + items: + additionalProperties: true + type: object + type: array top_logprobs: - anyOf: - - type: integer - - type: 'null' title: Top Logprobs + type: integer top_p: - anyOf: - - type: number - - type: 'null' title: Top P + type: number user: - anyOf: - - type: string - - type: 'null' title: User + type: string additionalProperties: true type: object required: @@ -9858,24 +9912,18 @@ components: OpenAIChatCompletionToolCall: properties: index: - anyOf: - - type: integer - - type: 'null' title: Index + type: integer id: - anyOf: - - type: string - - type: 'null' title: Id + type: string type: type: string const: function title: Type default: function function: - anyOf: - - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' - - type: 'null' + $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' type: object title: OpenAIChatCompletionToolCall description: 'Tool call specification for OpenAI-compatible chat completion @@ -9892,15 +9940,11 @@ components: OpenAIChatCompletionToolCallFunction: properties: name: - anyOf: - - type: string - - type: 'null' title: Name + type: string arguments: - anyOf: - - type: string - - type: 'null' title: Arguments + type: string type: object title: OpenAIChatCompletionToolCallFunction description: 'Function call details for OpenAI-compatible tool calls. @@ -9921,13 +9965,9 @@ components: type: integer title: Total Tokens prompt_tokens_details: - anyOf: - - $ref: '#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails' - - type: 'null' + $ref: '#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails' completion_tokens_details: - anyOf: - - $ref: '#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails' - - type: 'null' + $ref: '#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails' type: object required: - prompt_tokens @@ -9949,10 +9989,8 @@ components: OpenAIChatCompletionUsageCompletionTokensDetails: properties: reasoning_tokens: - anyOf: - - type: integer - - type: 'null' title: Reasoning Tokens + type: integer type: object title: OpenAIChatCompletionUsageCompletionTokensDetails description: 'Token details for output tokens in OpenAI chat completion usage. @@ -9962,10 +10000,8 @@ components: OpenAIChatCompletionUsagePromptTokensDetails: properties: cached_tokens: - anyOf: - - type: integer - - type: 'null' title: Cached Tokens + type: integer type: object title: OpenAIChatCompletionUsagePromptTokensDetails description: 'Token details for prompt tokens in OpenAI chat completion usage. @@ -9997,9 +10033,7 @@ components: type: integer title: Index logprobs: - anyOf: - - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' - - type: 'null' + $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' type: object required: - message @@ -10019,19 +10053,15 @@ components: OpenAIChoiceLogprobs-Output: properties: content: - anyOf: - - items: - $ref: '#/components/schemas/OpenAITokenLogProb' - type: array - - type: 'null' title: Content + items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array refusal: - anyOf: - - items: - $ref: '#/components/schemas/OpenAITokenLogProb' - type: array - - type: 'null' title: Refusal + items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array type: object title: OpenAIChoiceLogprobs description: 'The log probabilities for the tokens in the message from an OpenAI-compatible @@ -10093,9 +10123,7 @@ components: type: integer title: Index logprobs: - anyOf: - - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' - - type: 'null' + $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' type: object required: - finish_reason @@ -10133,91 +10161,60 @@ components: type: array title: Prompt best_of: - anyOf: - - type: integer - - type: 'null' title: Best Of + type: integer echo: - anyOf: - - type: boolean - - type: 'null' title: Echo + type: boolean frequency_penalty: - anyOf: - - type: number - - type: 'null' title: Frequency Penalty + type: number logit_bias: - anyOf: - - additionalProperties: - type: number - type: object - - type: 'null' title: Logit Bias + additionalProperties: + type: number + type: object logprobs: - anyOf: - - type: boolean - - type: 'null' title: Logprobs + type: boolean max_tokens: - anyOf: - - type: integer - - type: 'null' title: Max Tokens + type: integer n: - anyOf: - - type: integer - - type: 'null' title: N + type: integer presence_penalty: - anyOf: - - type: number - - type: 'null' title: Presence Penalty + type: number seed: - anyOf: - - type: integer - - type: 'null' title: Seed + type: integer stop: anyOf: - type: string - items: type: string type: array - - type: 'null' title: Stop stream: - anyOf: - - type: boolean - - type: 'null' title: Stream + type: boolean stream_options: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Stream Options + additionalProperties: true + type: object temperature: - anyOf: - - type: number - - type: 'null' title: Temperature + type: number top_p: - anyOf: - - type: number - - type: 'null' title: Top P + type: number user: - anyOf: - - type: string - - type: 'null' title: User + type: string suffix: - anyOf: - - type: string - - type: 'null' title: Suffix + type: string additionalProperties: true type: object required: @@ -10271,23 +10268,19 @@ components: type: array title: File Ids attributes: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Attributes + additionalProperties: true + type: object chunking_strategy: - anyOf: - - oneOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' - discriminator: - propertyName: type - mapping: - auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' - static: '#/components/schemas/VectorStoreChunkingStrategyStatic' - - type: 'null' title: Chunking Strategy + oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' additionalProperties: true type: object required: @@ -10305,35 +10298,25 @@ components: OpenAICreateVectorStoreRequestWithExtraBody: properties: name: - anyOf: - - type: string - - type: 'null' title: Name + type: string file_ids: - anyOf: - - items: - type: string - type: array - - type: 'null' title: File Ids + items: + type: string + type: array expires_after: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Expires After + additionalProperties: true + type: object chunking_strategy: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Chunking Strategy + additionalProperties: true + type: object metadata: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Metadata + additionalProperties: true + type: object additionalProperties: true type: object title: OpenAICreateVectorStoreRequestWithExtraBody @@ -10365,10 +10348,8 @@ components: type: array title: Content name: - anyOf: - - type: string - - type: 'null' title: Name + type: string type: object required: - content @@ -10446,21 +10427,15 @@ components: type: array title: Input encoding_format: - anyOf: - - type: string - - type: 'null' title: Encoding Format default: float + type: string dimensions: - anyOf: - - type: integer - - type: 'null' title: Dimensions + type: integer user: - anyOf: - - type: string - - type: 'null' title: User + type: string additionalProperties: true type: object required: @@ -10533,20 +10508,14 @@ components: OpenAIFileFile: properties: file_data: - anyOf: - - type: string - - type: 'null' title: File Data + type: string file_id: - anyOf: - - type: string - - type: 'null' title: File Id + type: string filename: - anyOf: - - type: string - - type: 'null' title: Filename + type: string type: object title: OpenAIFileFile OpenAIFileObject: @@ -10611,10 +10580,8 @@ components: type: string title: Url detail: - anyOf: - - type: string - - type: 'null' title: Detail + type: string type: object required: - url @@ -10633,21 +10600,15 @@ components: type: string title: Name description: - anyOf: - - type: string - - type: 'null' title: Description + type: string strict: - anyOf: - - type: boolean - - type: 'null' title: Strict + type: boolean schema: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Schema + additionalProperties: true + type: object type: object title: OpenAIJSONSchema description: 'JSON schema specification for OpenAI-compatible structured response @@ -10800,6 +10761,25 @@ components: :param type: Content part type identifier, always "refusal" :param refusal: Refusal text supplied by the model' + OpenAIResponseError: + properties: + code: + type: string + title: Code + message: + type: string + title: Message + type: object + required: + - code + - message + title: OpenAIResponseError + description: 'Error details for failed OpenAI response requests. + + + :param code: Error code identifying the type of failure + + :param message: Human-readable error message describing the failure' OpenAIResponseFormatJSONObject: properties: type: @@ -10862,15 +10842,11 @@ components: title: Type default: function_call_output id: - anyOf: - - type: string - - type: 'null' title: Id + type: string status: - anyOf: - - type: string - - type: 'null' title: Status + type: string type: object required: - call_id @@ -10886,25 +10862,17 @@ components: title: Type default: input_file file_data: - anyOf: - - type: string - - type: 'null' title: File Data + type: string file_id: - anyOf: - - type: string - - type: 'null' title: File Id + type: string file_url: - anyOf: - - type: string - - type: 'null' title: File Url + type: string filename: - anyOf: - - type: string - - type: 'null' title: Filename + type: string type: object title: OpenAIResponseInputMessageContentFile description: 'File content for input messages in OpenAI response format. @@ -10937,15 +10905,11 @@ components: title: Type default: input_image file_id: - anyOf: - - type: string - - type: 'null' title: File Id + type: string image_url: - anyOf: - - type: string - - type: 'null' title: Image Url + type: string type: object title: OpenAIResponseInputMessageContentImage description: 'Image content for input messages in OpenAI response format. @@ -10992,23 +10956,17 @@ components: type: array title: Vector Store Ids filters: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Filters + additionalProperties: true + type: object max_num_results: - anyOf: - - type: integer - maximum: 50.0 - minimum: 1.0 - - type: 'null' title: Max Num Results default: 10 + type: integer + maximum: 50.0 + minimum: 1.0 ranking_options: - anyOf: - - $ref: '#/components/schemas/SearchRankingOptions' - - type: 'null' + $ref: '#/components/schemas/SearchRankingOptions' type: object required: - vector_store_ids @@ -11038,21 +10996,15 @@ components: type: string title: Name description: - anyOf: - - type: string - - type: 'null' title: Description + type: string parameters: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Parameters + additionalProperties: true + type: object strict: - anyOf: - - type: boolean - - type: 'null' title: Strict + type: boolean type: object required: - name @@ -11084,11 +11036,9 @@ components: type: string title: Server Url headers: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Headers + additionalProperties: true + type: object require_approval: anyOf: - type: string @@ -11104,7 +11054,6 @@ components: type: string type: array - $ref: '#/components/schemas/AllowedToolsFilter' - - type: 'null' title: Allowed Tools type: object required: @@ -11142,12 +11091,10 @@ components: title: Type default: web_search search_context_size: - anyOf: - - type: string - pattern: ^low|medium|high$ - - type: 'null' title: Search Context Size default: medium + type: string + pattern: ^low|medium|high$ type: object title: OpenAIResponseInputToolWebSearch description: 'Web search tool configuration for OpenAI response inputs. @@ -11198,22 +11145,18 @@ components: title: Type default: mcp_approval_response id: - anyOf: - - type: string - - type: 'null' title: Id + type: string reason: - anyOf: - - type: string - - type: 'null' title: Reason + type: string type: object required: - approval_request_id - approve title: OpenAIResponseMCPApprovalResponse description: A response to an MCP approval request. - OpenAIResponseMessage: + OpenAIResponseMessage-Input: properties: content: anyOf: @@ -11258,15 +11201,11 @@ components: title: Type default: message id: - anyOf: - - type: string - - type: 'null' title: Id + type: string status: - anyOf: - - type: string - - type: 'null' title: Status + type: string type: object required: - content @@ -11279,115 +11218,311 @@ components: the same "type" value, and there is no way to tell them apart in certain scenarios.' - OpenAIResponseOutputMessageContentOutputText: + OpenAIResponseMessage-Output: properties: - text: - type: string - title: Text + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - type: string + const: system + - type: string + const: developer + - type: string + const: user + - type: string + const: assistant + title: Role type: type: string - const: output_text + const: message title: Type - default: output_text - annotations: - items: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' - discriminator: - propertyName: type - mapping: - container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' - url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' - type: array - title: Annotations - type: object - required: - - text - title: OpenAIResponseOutputMessageContentOutputText - OpenAIResponseOutputMessageFileSearchToolCall: - properties: + default: message id: - type: string title: Id - queries: - items: - type: string - type: array - title: Queries - status: type: string + status: title: Status - type: type: string - const: file_search_call - title: Type - default: file_search_call - results: - anyOf: - - items: - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' - type: array - - type: 'null' - title: Results type: object required: - - id - - queries - - status - title: OpenAIResponseOutputMessageFileSearchToolCall - description: 'File search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param queries: List of search queries executed + - content + - role + title: OpenAIResponseMessage + description: 'Corresponds to the various Message types in the Responses API. - :param status: Current status of the file search operation + They are all under one type because the Responses API gives them all - :param type: Tool call type identifier, always "file_search_call" + the same "type" value, and there is no way to tell them apart in certain - :param results: (Optional) Search results returned by the file search operation' - OpenAIResponseOutputMessageFileSearchToolCallResults: + scenarios.' + OpenAIResponseObject: properties: - attributes: - additionalProperties: true - type: object - title: Attributes - file_id: + created_at: + type: integer + title: Created At + error: + $ref: '#/components/schemas/OpenAIResponseError' + id: type: string - title: File Id - filename: + title: Id + model: type: string - title: Filename - score: - type: number - title: Score - text: + title: Model + object: type: string - title: Text - type: object - required: - - attributes - - file_id - - filename - - score - - text - title: OpenAIResponseOutputMessageFileSearchToolCallResults - description: 'Search results returned by the file search operation. - - - :param attributes: (Optional) Key-value attributes associated with the file - - :param file_id: Unique identifier of the file containing the result - - :param filename: Name of the file containing the result - - :param score: Relevance score for this search result (between 0 and 1) + const: response + title: Object + default: response + output: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + title: Output + parallel_tool_calls: + type: boolean + title: Parallel Tool Calls + default: false + previous_response_id: + title: Previous Response Id + type: string + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' + status: + type: string + title: Status + temperature: + title: Temperature + type: number + text: + $ref: '#/components/schemas/OpenAIResponseText' + default: + format: + type: text + top_p: + title: Top P + type: number + tools: + title: Tools + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + type: array + truncation: + title: Truncation + type: string + usage: + $ref: '#/components/schemas/OpenAIResponseUsage' + instructions: + title: Instructions + type: string + type: object + required: + - created_at + - id + - model + - output + - status + title: OpenAIResponseObject + description: 'Complete OpenAI response object containing generation results + and metadata. + + + :param created_at: Unix timestamp when the response was created + + :param error: (Optional) Error details if the response generation failed + + :param id: Unique identifier for this response + + :param model: Model identifier used for generation + + :param object: Object type identifier, always "response" + + :param output: List of generated output items (messages, tool calls, etc.) + + :param parallel_tool_calls: Whether tool calls can be executed in parallel + + :param previous_response_id: (Optional) ID of the previous response in a conversation + + :param prompt: (Optional) Reference to a prompt template and its variables. + + :param status: Current status of the response generation + + :param temperature: (Optional) Sampling temperature used for generation + + :param text: Text formatting configuration for the response + + :param top_p: (Optional) Nucleus sampling parameter used for generation + + :param tools: (Optional) An array of tools the model may call while generating + a response. + + :param truncation: (Optional) Truncation strategy applied to the response + + :param usage: (Optional) Token usage information for the response + + :param instructions: (Optional) System message inserted into the model''s + context' + OpenAIResponseOutputMessageContentOutputText: + properties: + text: + type: string + title: Text + type: + type: string + const: output_text + title: Type + default: output_text + annotations: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + discriminator: + propertyName: type + mapping: + container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' + url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' + type: array + title: Annotations + type: object + required: + - text + title: OpenAIResponseOutputMessageContentOutputText + OpenAIResponseOutputMessageFileSearchToolCall: + properties: + id: + type: string + title: Id + queries: + items: + type: string + type: array + title: Queries + status: + type: string + title: Status + type: + type: string + const: file_search_call + title: Type + default: file_search_call + results: + title: Results + items: + $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' + type: array + type: object + required: + - id + - queries + - status + title: OpenAIResponseOutputMessageFileSearchToolCall + description: 'File search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param queries: List of search queries executed + + :param status: Current status of the file search operation + + :param type: Tool call type identifier, always "file_search_call" + + :param results: (Optional) Search results returned by the file search operation' + OpenAIResponseOutputMessageFileSearchToolCallResults: + properties: + attributes: + additionalProperties: true + type: object + title: Attributes + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + score: + type: number + title: Score + text: + type: string + title: Text + type: object + required: + - attributes + - file_id + - filename + - score + - text + title: OpenAIResponseOutputMessageFileSearchToolCallResults + description: 'Search results returned by the file search operation. + + + :param attributes: (Optional) Key-value attributes associated with the file + + :param file_id: Unique identifier of the file containing the result + + :param filename: Name of the file containing the result + + :param score: Relevance score for this search result (between 0 and 1) :param text: Text content of the search result' OpenAIResponseOutputMessageFunctionToolCall: @@ -11407,15 +11542,11 @@ components: title: Type default: function_call id: - anyOf: - - type: string - - type: 'null' title: Id + type: string status: - anyOf: - - type: string - - type: 'null' title: Status + type: string type: object required: - call_id @@ -11456,15 +11587,11 @@ components: type: string title: Server Label error: - anyOf: - - type: string - - type: 'null' title: Error + type: string output: - anyOf: - - type: string - - type: 'null' title: Output + type: string type: object required: - id @@ -11555,26 +11682,22 @@ components: type: string title: Id variables: - anyOf: - - additionalProperties: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' - discriminator: - propertyName: type - mapping: - input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' - input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' - input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' - type: object - - type: 'null' title: Variables + additionalProperties: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: object version: - anyOf: - - type: string - - type: 'null' title: Version + type: string type: object required: - id @@ -11595,9 +11718,7 @@ components: OpenAIResponseText: properties: format: - anyOf: - - $ref: '#/components/schemas/OpenAIResponseTextFormat' - - type: 'null' + $ref: '#/components/schemas/OpenAIResponseTextFormat' type: object title: OpenAIResponseText description: 'Text response configuration for OpenAI responses. @@ -11617,26 +11738,18 @@ components: const: json_object title: Type name: - anyOf: - - type: string - - type: 'null' title: Name + type: string schema: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Schema + additionalProperties: true + type: object description: - anyOf: - - type: string - - type: 'null' title: Description + type: string strict: - anyOf: - - type: boolean - - type: 'null' title: Strict + type: boolean type: object title: OpenAIResponseTextFormat description: 'Configuration for Responses API text format. @@ -11655,26 +11768,110 @@ components: :param strict: (Optional) Whether to strictly enforce the JSON schema. If true, the response must match the schema exactly. Only used for json_schema.' - OpenAISystemMessageParam: + OpenAIResponseToolMCP: properties: - role: + type: type: string - const: system - title: Role - default: system - content: + const: mcp + title: Type + default: mcp + server_label: + type: string + title: Server Label + allowed_tools: anyOf: - - type: string - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: string type: array - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - type: object + - $ref: '#/components/schemas/AllowedToolsFilter' + title: Allowed Tools + type: object + required: + - server_label + title: OpenAIResponseToolMCP + description: 'Model Context Protocol (MCP) tool configuration for OpenAI response + object. + + + :param type: Tool type identifier, always "mcp" + + :param server_label: Label to identify this MCP server + + :param allowed_tools: (Optional) Restriction on which tools can be used from + this server' + OpenAIResponseUsage: + properties: + input_tokens: + type: integer + title: Input Tokens + output_tokens: + type: integer + title: Output Tokens + total_tokens: + type: integer + title: Total Tokens + input_tokens_details: + $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' + output_tokens_details: + $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + type: object + required: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + description: 'Usage information for OpenAI response. + + + :param input_tokens: Number of tokens in the input + + :param output_tokens: Number of tokens in the output + + :param total_tokens: Total tokens used (input + output) + + :param input_tokens_details: Detailed breakdown of input token usage + + :param output_tokens_details: Detailed breakdown of output token usage' + OpenAIResponseUsageInputTokensDetails: + properties: + cached_tokens: + title: Cached Tokens + type: integer + type: object + title: OpenAIResponseUsageInputTokensDetails + description: 'Token details for input tokens in OpenAI response usage. + + + :param cached_tokens: Number of tokens retrieved from cache' + OpenAIResponseUsageOutputTokensDetails: + properties: + reasoning_tokens: + title: Reasoning Tokens + type: integer + type: object + title: OpenAIResponseUsageOutputTokensDetails + description: 'Token details for output tokens in OpenAI response usage. + + + :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)' + OpenAISystemMessageParam: + properties: + role: + type: string + const: system + title: Role + default: system + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + title: Name + type: string + type: object required: - content title: OpenAISystemMessageParam @@ -11694,12 +11891,10 @@ components: type: string title: Token bytes: - anyOf: - - items: - type: integer - type: array - - type: 'null' title: Bytes + items: + type: integer + type: array logprob: type: number title: Logprob @@ -11763,12 +11958,10 @@ components: type: string title: Token bytes: - anyOf: - - items: - type: integer - type: array - - type: 'null' title: Bytes + items: + type: integer + type: array logprob: type: number title: Logprob @@ -11810,10 +12003,8 @@ components: type: array title: Content name: - anyOf: - - type: string - - type: 'null' title: Name + type: string type: object required: - content @@ -11852,10 +12043,8 @@ components: type: array title: Content name: - anyOf: - - type: string - - type: 'null' title: Name + type: string type: object required: - content @@ -11881,14 +12070,22 @@ components: :cvar asc: Ascending order :cvar desc: Descending order' + OutputTokensDetails: + properties: + reasoning_tokens: + type: integer + title: Reasoning Tokens + additionalProperties: true + type: object + required: + - reasoning_tokens + title: OutputTokensDetails Prompt: properties: prompt: - anyOf: - - type: string - - type: 'null' title: Prompt description: The system prompt with variable placeholders + type: string version: type: integer minimum: 1.0 @@ -11970,6 +12167,29 @@ components: :param config: Configuration parameters for the provider :param health: Current health status of the provider' + QueryChunksResponse: + properties: + chunks: + items: + $ref: '#/components/schemas/Chunk-Output' + type: array + title: Chunks + scores: + items: + type: number + type: array + title: Scores + type: object + required: + - chunks + - scores + title: QueryChunksResponse + description: 'Response from querying chunks in a vector database. + + + :param chunks: List of content chunks returned from the query + + :param scores: Relevance scores corresponding to each returned chunk' RAGQueryConfig: properties: query_generator_config: @@ -12004,22 +12224,18 @@ components: ' mode: - anyOf: - - $ref: '#/components/schemas/RAGSearchMode' - - type: 'null' default: vector + $ref: '#/components/schemas/RAGSearchMode' ranker: - anyOf: - - oneOf: - - $ref: '#/components/schemas/RRFRanker' - - $ref: '#/components/schemas/WeightedRanker' - discriminator: - propertyName: type - mapping: - rrf: '#/components/schemas/RRFRanker' - weighted: '#/components/schemas/WeightedRanker' - - type: 'null' title: Ranker + oneOf: + - $ref: '#/components/schemas/RRFRanker' + - $ref: '#/components/schemas/WeightedRanker' + discriminator: + propertyName: type + mapping: + rrf: '#/components/schemas/RRFRanker' + weighted: '#/components/schemas/WeightedRanker' type: object title: RAGQueryConfig description: "Configuration for the RAG query generation.\n\n:param query_generator_config:\ @@ -12032,6 +12248,42 @@ components: \ {metadata}\\n\"\n:param mode: Search mode for retrieval\u2014either \"vector\"\ , \"keyword\", or \"hybrid\". Default \"vector\".\n:param ranker: Configuration\ \ for the ranker to use in hybrid search. Defaults to RRF ranker." + RAGQueryResult: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + additionalProperties: true + type: object + title: Metadata + type: object + title: RAGQueryResult + description: 'Result of a RAG query containing retrieved content and metadata. + + + :param content: (Optional) The retrieved content from the query + + :param metadata: Additional metadata about the query result' RAGSearchMode: type: string enum: @@ -12121,6 +12373,75 @@ components: :param method: HTTP method for the route :param provider_types: List of provider types that implement this route' + RunShieldResponse: + properties: + violation: + $ref: '#/components/schemas/SafetyViolation' + type: object + title: RunShieldResponse + description: 'Response from running a safety shield. + + + :param violation: (Optional) Safety violation detected by the shield, if any' + SafetyViolation: + properties: + violation_level: + $ref: '#/components/schemas/ViolationLevel' + user_message: + title: User Message + type: string + metadata: + additionalProperties: true + type: object + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + description: 'Details of a safety violation detected by content moderation. + + + :param violation_level: Severity level of the violation + + :param user_message: (Optional) Message to convey to the user about the violation + + :param metadata: Additional metadata including specific violation codes for + debugging and telemetry' + ScoreBatchResponse: + properties: + dataset_id: + title: Dataset Id + type: string + results: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' + type: object + title: Results + type: object + required: + - results + title: ScoreBatchResponse + description: 'Response from batch scoring operations on datasets. + + + :param dataset_id: (Optional) The identifier of the dataset that was scored + + :param results: A map of scoring function name to ScoringResult' + ScoreResponse: + properties: + results: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' + type: object + title: Results + type: object + required: + - results + title: ScoreResponse + description: 'The response from scoring. + + + :param results: A map of scoring function name to ScoringResult.' ScoringFn-Output: properties: identifier: @@ -12128,11 +12449,9 @@ components: title: Identifier description: Unique identifier for this resource in llama stack provider_resource_id: - anyOf: - - type: string - - type: 'null' title: Provider Resource Id description: Unique identifier for this resource in the provider + type: string provider_id: type: string title: Provider Id @@ -12143,10 +12462,8 @@ components: title: Type default: scoring_function description: - anyOf: - - type: string - - type: 'null' title: Description + type: string metadata: additionalProperties: true type: object @@ -12180,21 +12497,19 @@ components: string: '#/components/schemas/StringType' union: '#/components/schemas/UnionType' params: - anyOf: - - oneOf: - - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - - $ref: '#/components/schemas/RegexParserScoringFnParams' - - $ref: '#/components/schemas/BasicScoringFnParams' - discriminator: - propertyName: type - mapping: - basic: '#/components/schemas/BasicScoringFnParams' - llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' - regex_parser: '#/components/schemas/RegexParserScoringFnParams' - - type: 'null' title: Params description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval + oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' type: object required: - identifier @@ -12204,19 +12519,39 @@ components: description: 'A scoring function resource for evaluating model outputs. :param type: The resource type, always scoring_function' + ScoringResult: + properties: + score_rows: + items: + additionalProperties: true + type: object + type: array + title: Score Rows + aggregated_results: + additionalProperties: true + type: object + title: Aggregated Results + type: object + required: + - score_rows + - aggregated_results + title: ScoringResult + description: 'A scoring result for a single row. + + + :param score_rows: The scoring result for each row. Each row is a map of column + name to value. + + :param aggregated_results: Map of metric name to aggregated value' SearchRankingOptions: properties: ranker: - anyOf: - - type: string - - type: 'null' title: Ranker + type: string score_threshold: - anyOf: - - type: number - - type: 'null' title: Score Threshold default: 0.0 + type: number type: object title: SearchRankingOptions description: 'Options for ranking and filtering search results. @@ -12232,11 +12567,9 @@ components: title: Identifier description: Unique identifier for this resource in llama stack provider_resource_id: - anyOf: - - type: string - - type: 'null' title: Provider Resource Id description: Unique identifier for this resource in the provider + type: string provider_id: type: string title: Provider Id @@ -12247,11 +12580,9 @@ components: title: Type default: shield params: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Params + additionalProperties: true + type: object type: object required: - identifier @@ -12276,39 +12607,49 @@ components: :param type: Discriminator type. Always "string"' - ToolDef: + TextContentItem: properties: - toolgroup_id: - anyOf: - - type: string - - type: 'null' - title: Toolgroup Id - name: + type: type: string - title: Name - description: - anyOf: - - type: string - - type: 'null' - title: Description - input_schema: - anyOf: - - additionalProperties: true - type: object - - type: 'null' + const: text + title: Type + default: text + text: + type: string + title: Text + type: object + required: + - text + title: TextContentItem + description: 'A text content item + + + :param type: Discriminator type of the content item. Always "text" + + :param text: Text content' + ToolDef: + properties: + toolgroup_id: + title: Toolgroup Id + type: string + name: + type: string + title: Name + description: + title: Description + type: string + input_schema: title: Input Schema + additionalProperties: true + type: object output_schema: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Output Schema + additionalProperties: true + type: object metadata: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Metadata + additionalProperties: true + type: object type: object required: - name @@ -12335,11 +12676,9 @@ components: title: Identifier description: Unique identifier for this resource in llama stack provider_resource_id: - anyOf: - - type: string - - type: 'null' title: Provider Resource Id description: Unique identifier for this resource in the provider + type: string provider_id: type: string title: Provider Id @@ -12350,15 +12689,11 @@ components: title: Type default: tool_group mcp_endpoint: - anyOf: - - $ref: '#/components/schemas/URL' - - type: 'null' + $ref: '#/components/schemas/URL' args: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Args + additionalProperties: true + type: object type: object required: - identifier @@ -12373,6 +12708,52 @@ components: tools :param args: (Optional) Additional arguments for the tool group' + ToolInvocationResult: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + error_message: + title: Error Message + type: string + error_code: + title: Error Code + type: integer + metadata: + title: Metadata + additionalProperties: true + type: object + type: object + title: ToolInvocationResult + description: 'Result of a tool invocation. + + + :param content: (Optional) The output content from the tool execution + + :param error_message: (Optional) Error message if the tool execution failed + + :param error_code: (Optional) Numeric error code if the tool execution failed + + :param metadata: (Optional) Additional metadata about the tool execution' URL: properties: uri: @@ -12453,6 +12834,26 @@ components: :param max_chunk_size_tokens: Maximum number of tokens per chunk, must be between 100 and 4096' + VectorStoreContent: + properties: + type: + type: string + const: text + title: Type + text: + type: string + title: Text + type: object + required: + - type + - text + title: VectorStoreContent + description: 'Content item from a vector store file or search result. + + + :param type: Content type, currently only "text" is supported + + :param text: The actual text content' VectorStoreFileBatchObject: properties: id: @@ -12540,6 +12941,103 @@ components: :param in_progress: Number of files currently being processed :param total: Total number of files in the vector store' + VectorStoreFileLastError: + properties: + code: + anyOf: + - type: string + const: server_error + - type: string + const: rate_limit_exceeded + title: Code + message: + type: string + title: Message + type: object + required: + - code + - message + title: VectorStoreFileLastError + description: 'Error information for failed vector store file processing. + + + :param code: Error code indicating the type of failure + + :param message: Human-readable error message describing the failure' + VectorStoreFileObject: + properties: + id: + type: string + title: Id + object: + type: string + title: Object + default: vector_store.file + attributes: + additionalProperties: true + type: object + title: Attributes + chunking_strategy: + oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + title: Chunking Strategy + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + created_at: + type: integer + title: Created At + last_error: + $ref: '#/components/schemas/VectorStoreFileLastError' + status: + anyOf: + - type: string + const: completed + - type: string + const: in_progress + - type: string + const: cancelled + - type: string + const: failed + title: Status + usage_bytes: + type: integer + title: Usage Bytes + default: 0 + vector_store_id: + type: string + title: Vector Store Id + type: object + required: + - id + - chunking_strategy + - created_at + - status + - vector_store_id + title: VectorStoreFileObject + description: 'OpenAI Vector Store File object. + + + :param id: Unique identifier for the file + + :param object: Object type identifier, always "vector_store.file" + + :param attributes: Key-value attributes associated with the file + + :param chunking_strategy: Strategy used for splitting the file into chunks + + :param created_at: Timestamp when the file was added to the vector store + + :param last_error: (Optional) Error information if file processing failed + + :param status: Current processing status of the file + + :param usage_bytes: Storage space used by this file in bytes + + :param vector_store_id: ID of the vector store containing this file' VectorStoreObject: properties: id: @@ -12553,10 +13051,8 @@ components: type: integer title: Created At name: - anyOf: - - type: string - - type: 'null' title: Name + type: string usage_bytes: type: integer title: Usage Bytes @@ -12568,21 +13064,15 @@ components: title: Status default: completed expires_after: - anyOf: - - additionalProperties: true - type: object - - type: 'null' title: Expires After + additionalProperties: true + type: object expires_at: - anyOf: - - type: integer - - type: 'null' title: Expires At + type: integer last_active_at: - anyOf: - - type: integer - - type: 'null' title: Last Active At + type: integer metadata: additionalProperties: true type: object @@ -12619,6 +13109,87 @@ components: :param metadata: Set of key-value pairs that can be attached to the vector store' + VectorStoreSearchResponse: + properties: + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + score: + type: number + title: Score + attributes: + title: Attributes + additionalProperties: + anyOf: + - type: string + - type: number + - type: boolean + type: object + content: + items: + $ref: '#/components/schemas/VectorStoreContent' + type: array + title: Content + type: object + required: + - file_id + - filename + - score + - content + title: VectorStoreSearchResponse + description: 'Response from searching a vector store. + + + :param file_id: Unique identifier of the file containing the result + + :param filename: Name of the file containing the result + + :param score: Relevance score for this search result + + :param attributes: (Optional) Key-value attributes associated with the file + + :param content: List of content items matching the search query' + VectorStoreSearchResponsePage: + properties: + object: + type: string + title: Object + default: vector_store.search_results.page + search_query: + type: string + title: Search Query + data: + items: + $ref: '#/components/schemas/VectorStoreSearchResponse' + type: array + title: Data + has_more: + type: boolean + title: Has More + default: false + next_page: + title: Next Page + type: string + type: object + required: + - search_query + - data + title: VectorStoreSearchResponsePage + description: 'Paginated response from searching a vector store. + + + :param object: Object type identifier for the search results page + + :param search_query: The original search query that was executed + + :param data: List of search result objects + + :param has_more: Whether there are more results available beyond this page + + :param next_page: (Optional) Token for retrieving the next page of results' VersionInfo: properties: version: @@ -12632,6 +13203,21 @@ components: :param version: Version number of the service' + ViolationLevel: + type: string + enum: + - info + - warn + - error + title: ViolationLevel + description: 'Severity level of a safety violation. + + + :cvar INFO: Informational level violation that does not require action + + :cvar WARN: Warning level violation that suggests caution but allows continuation + + :cvar ERROR: Error level violation that requires blocking or intervention' WeightedRanker: properties: type: @@ -12654,40 +13240,1524 @@ components: \ alpha: Weight factor between 0 and 1.\n 0 means only use keyword\ \ scores,\n 1 means only use vector scores,\n values\ \ in between blend both scores." - Error: - description: 'Error response from the API. Roughly follows RFC 7807. - - - :param status: HTTP status code + _URLOrData: + properties: + url: + $ref: '#/components/schemas/URL' + data: + contentEncoding: base64 + title: Data + type: string + type: object + title: _URLOrData + description: 'A URL or a base64 encoded string - :param title: Error title, a short summary of the error which is invariant - for an error type - :param detail: Error detail, a longer human-readable description of the error + :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. + Note that URL could have length limits. - :param instance: (Optional) A URL which can be used to retrieve more information - about the specific occurrence of the error' + :param data: base64 encoded image data as string' + _batches_Request: properties: - status: - title: Status + input_file_id: + type: string + title: Input File Id + endpoint: + type: string + title: Endpoint + completion_window: + type: string + title: Completion Window + metadata: + type: string + title: Metadata + idempotency_key: + type: string + title: Idempotency Key + type: object + required: + - input_file_id + - endpoint + - completion_window + - metadata + - idempotency_key + title: _batches_Request + _batches_batch_id_cancel_Request: + properties: + batch_id: + type: string + title: Batch Id + type: object + required: + - batch_id + title: _batches_batch_id_cancel_Request + _conversations_Request: + properties: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + title: Items + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Input' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + metadata: + type: string + title: Metadata + type: object + required: + - items + - metadata + title: _conversations_Request + _conversations_conversation_id_Request: + properties: + conversation_id: + type: string + title: Conversation Id + metadata: + type: string + title: Metadata + type: object + required: + - conversation_id + - metadata + title: _conversations_conversation_id_Request + _conversations_conversation_id_items_Request: + properties: + conversation_id: + type: string + title: Conversation Id + items: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + title: Items + type: object + required: + - conversation_id + - items + title: _conversations_conversation_id_items_Request + _models_Request: + properties: + model_id: + type: string + title: Model Id + provider_model_id: + type: string + title: Provider Model Id + provider_id: + type: string + title: Provider Id + metadata: + type: string + title: Metadata + model_type: + $ref: '#/components/schemas/ModelType' + type: object + required: + - model_id + - provider_model_id + - provider_id + - metadata + - model_type + title: _models_Request + _moderations_Request: + properties: + input: + type: string + title: Input + model: + type: string + title: Model + type: object + required: + - input + - model + title: _moderations_Request + _prompts_Request: + properties: + prompt: + type: string + title: Prompt + variables: + type: string + title: Variables + type: object + required: + - prompt + - variables + title: _prompts_Request + _prompts_prompt_id_Request: + properties: + prompt_id: + type: string + title: Prompt Id + prompt: + type: string + title: Prompt + version: + type: integer + title: Version + variables: + type: string + title: Variables + set_as_default: + type: boolean + title: Set As Default + default: true + type: object + required: + - prompt_id + - prompt + - version + - variables + title: _prompts_prompt_id_Request + _prompts_prompt_id_set_default_version_Request: + properties: + prompt_id: + type: string + title: Prompt Id + version: + type: integer + title: Version + type: object + required: + - prompt_id + - version + title: _prompts_prompt_id_set_default_version_Request + _responses_Request: + properties: + input: + type: string + title: Input + model: + type: string + title: Model + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' + instructions: + type: string + title: Instructions + previous_response_id: + type: string + title: Previous Response Id + conversation: + type: string + title: Conversation + store: + type: boolean + title: Store + default: true + stream: + type: boolean + title: Stream + default: false + temperature: + type: number + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + tools: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' + title: Tools + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseInputToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + include: + type: string + title: Include + max_infer_iters: + type: integer + title: Max Infer Iters + default: 10 + type: object + required: + - input + - model + - prompt + - instructions + - previous_response_id + - conversation + - temperature + - text + - tools + - include + title: _responses_Request + _scoring_score_Request: + properties: + input_rows: + type: string + title: Input Rows + scoring_functions: + type: string + title: Scoring Functions + type: object + required: + - input_rows + - scoring_functions + title: _scoring_score_Request + _scoring_score_batch_Request: + properties: + dataset_id: + type: string + title: Dataset Id + scoring_functions: + type: string + title: Scoring Functions + save_results_dataset: + type: boolean + title: Save Results Dataset + default: false + type: object + required: + - dataset_id + - scoring_functions + title: _scoring_score_batch_Request + _shields_Request: + properties: + shield_id: + type: string + title: Shield Id + provider_shield_id: + type: string + title: Provider Shield Id + provider_id: + type: string + title: Provider Id + params: + type: string + title: Params + type: object + required: + - shield_id + - provider_shield_id + - provider_id + - params + title: _shields_Request + _tool_runtime_invoke_Request: + properties: + tool_name: + type: string + title: Tool Name + kwargs: + type: string + title: Kwargs + type: object + required: + - tool_name + - kwargs + title: _tool_runtime_invoke_Request + _tool_runtime_rag_tool_query_Request: + properties: + content: + type: string + title: Content + vector_store_ids: + type: string + title: Vector Store Ids + query_config: + $ref: '#/components/schemas/RAGQueryConfig' + type: object + required: + - content + - vector_store_ids + - query_config + title: _tool_runtime_rag_tool_query_Request + _vector_io_query_Request: + properties: + vector_store_id: + type: string + title: Vector Store Id + query: + type: string + title: Query + params: + type: string + title: Params + type: object + required: + - vector_store_id + - query + - params + title: _vector_io_query_Request + _vector_stores_vector_store_id_Request: + properties: + vector_store_id: + type: string + title: Vector Store Id + name: + type: string + title: Name + expires_after: + type: string + title: Expires After + metadata: + type: string + title: Metadata + type: object + required: + - vector_store_id + - name + - expires_after + - metadata + title: _vector_stores_vector_store_id_Request + _vector_stores_vector_store_id_file_batches_batch_id_cancel_Request: + properties: + batch_id: + type: string + title: Batch Id + vector_store_id: + type: string + title: Vector Store Id + type: object + required: + - batch_id + - vector_store_id + title: _vector_stores_vector_store_id_file_batches_batch_id_cancel_Request + _vector_stores_vector_store_id_files_Request: + properties: + vector_store_id: + type: string + title: Vector Store Id + file_id: + type: string + title: File Id + attributes: + type: string + title: Attributes + chunking_strategy: + anyOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + title: Chunking Strategy + type: object + required: + - vector_store_id + - file_id + - attributes + - chunking_strategy + title: _vector_stores_vector_store_id_files_Request + _vector_stores_vector_store_id_files_file_id_Request: + properties: + vector_store_id: + type: string + title: Vector Store Id + file_id: + type: string + title: File Id + attributes: + type: string + title: Attributes + type: object + required: + - vector_store_id + - file_id + - attributes + title: _vector_stores_vector_store_id_files_file_id_Request + _vector_stores_vector_store_id_search_Request: + properties: + vector_store_id: + type: string + title: Vector Store Id + query: + type: string + title: Query + filters: + type: string + title: Filters + max_num_results: + type: integer + title: Max Num Results + default: 10 + ranking_options: + $ref: '#/components/schemas/SearchRankingOptions' + rewrite_query: + type: boolean + title: Rewrite Query + default: false + search_mode: + type: string + title: Search Mode + default: vector + type: object + required: + - vector_store_id + - query + - filters + - ranking_options + title: _vector_stores_vector_store_id_search_Request + Error: + description: 'Error response from the API. Roughly follows RFC 7807. + + + :param status: HTTP status code + + :param title: Error title, a short summary of the error which is invariant + for an error type + + :param detail: Error detail, a longer human-readable description of the error + + :param instance: (Optional) A URL which can be used to retrieve more information + about the specific occurrence of the error' + properties: + status: + title: Status + type: integer + title: + title: Title + type: string + detail: + title: Detail + type: string + instance: + title: Instance + type: string + nullable: true + required: + - status + - title + - detail + title: Error + type: object + ListOpenAIResponseInputItem: + description: 'List container for OpenAI response input items. + + + :param data: List of input items + + :param object: Object type identifier, always "list"' + properties: + data: + items: + anyOf: + - discriminator: + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage' + title: Data + type: array + object: + const: list + default: list + title: Object + type: string + required: + - data + title: ListOpenAIResponseInputItem + type: object + ListOpenAIResponseObject: + description: 'Paginated list of OpenAI response objects with navigation metadata. + + + :param data: List of response objects with their input context + + :param has_more: Whether there are more results available beyond this page + + :param first_id: Identifier of the first item in this page + + :param last_id: Identifier of the last item in this page + + :param object: Object type identifier, always "list"' + properties: + data: + items: + $ref: '#/components/schemas/OpenAIResponseObjectWithInput' + title: Data + type: array + has_more: + title: Has More + type: boolean + first_id: + title: First Id + type: string + last_id: + title: Last Id + type: string + object: + const: list + default: list + title: Object + type: string + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIResponseObject + type: object + OpenAIDeleteResponseObject: + description: 'Response object confirming deletion of an OpenAI response. + + + :param id: Unique identifier of the deleted response + + :param object: Object type identifier, always "response" + + :param deleted: Deletion confirmation flag, always True' + properties: + id: + title: Id + type: string + object: + const: response + default: response + title: Object + type: string + deleted: + default: true + title: Deleted + type: boolean + required: + - id + title: OpenAIDeleteResponseObject + type: object + ListBatchesResponse: + description: Response containing a list of batch objects. + properties: + object: + const: list + default: list + title: Object + type: string + data: + description: List of batch objects + items: + $ref: '#/components/schemas/Batch' + title: Data + type: array + first_id: + description: ID of the first batch in the list + title: First Id + type: string + nullable: true + last_id: + description: ID of the last batch in the list + title: Last Id + type: string + nullable: true + has_more: + default: false + description: Whether there are more batches available + title: Has More + type: boolean + required: + - data + title: ListBatchesResponse + type: object + ConversationDeletedResource: + description: Response for deleted conversation. + properties: + id: + description: The deleted conversation identifier + title: Id + type: string + object: + default: conversation.deleted + description: Object type + title: Object + type: string + deleted: + default: true + description: Whether the object was deleted + title: Deleted + type: boolean + required: + - id + title: ConversationDeletedResource + type: object + ConversationItemDeletedResource: + description: Response for deleted conversation item. + properties: + id: + description: The deleted item identifier + title: Id + type: string + object: + default: conversation.item.deleted + description: Object type + title: Object + type: string + deleted: + default: true + description: Whether the object was deleted + title: Deleted + type: boolean + required: + - id + title: ConversationItemDeletedResource + type: object + ListOpenAIFileResponse: + description: 'Response for listing files in OpenAI Files API. + + + :param data: List of file objects + + :param has_more: Whether there are more files available beyond this page + + :param first_id: ID of the first file in the list for pagination + + :param last_id: ID of the last file in the list for pagination + + :param object: The object type, which is always "list"' + properties: + data: + items: + $ref: '#/components/schemas/OpenAIFileObject' + title: Data + type: array + has_more: + title: Has More + type: boolean + first_id: + title: First Id + type: string + last_id: + title: Last Id + type: string + object: + const: list + default: list + title: Object + type: string + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIFileResponse + type: object + OpenAIFileDeleteResponse: + description: 'Response for deleting a file in OpenAI Files API. + + + :param id: The file identifier that was deleted + + :param object: The object type, which is always "file" + + :param deleted: Whether the file was successfully deleted' + properties: + id: + title: Id + type: string + object: + const: file + default: file + title: Object + type: string + deleted: + title: Deleted + type: boolean + required: + - id + - deleted + title: OpenAIFileDeleteResponse + type: object + ListOpenAIChatCompletionResponse: + description: 'Response from listing OpenAI-compatible chat completions. + + + :param data: List of chat completion objects with their input messages + + :param has_more: Whether there are more completions available beyond this + list + + :param first_id: ID of the first completion in this list + + :param last_id: ID of the last completion in this list + + :param object: Must be "list" to identify this as a list response' + properties: + data: + items: + $ref: '#/components/schemas/OpenAICompletionWithInputMessages' + title: Data + type: array + has_more: + title: Has More + type: boolean + first_id: + title: First Id + type: string + last_id: + title: Last Id + type: string + object: + const: list + default: list + title: Object + type: string + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIChatCompletionResponse + type: object + OpenAIAssistantMessageParam: + description: 'A message containing the model''s (assistant) response in an OpenAI-compatible + chat completion request. + + + :param role: Must be "assistant" to identify this as the model''s response + + :param content: The content of the model''s response + + :param name: (Optional) The name of the assistant message participant. + + :param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall + object.' + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + nullable: true + name: + title: Name + type: string + nullable: true + tool_calls: + title: Tool Calls + items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + nullable: true + title: OpenAIAssistantMessageParam + type: object + OpenAIChoice: + description: 'A choice from an OpenAI-compatible chat completion response. + + + :param message: The message from the model + + :param finish_reason: The reason the model stopped generating + + :param index: The index of the choice + + :param logprobs: (Optional) The log probabilities for the tokens in the message' + properties: + message: + discriminator: + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam' + propertyName: role + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Message + finish_reason: + title: Finish Reason + type: string + index: + title: Index type: integer - title: - title: Title + logprobs: + $ref: '#/components/schemas/OpenAIChoiceLogprobs' + nullable: true + required: + - message + - finish_reason + - index + title: OpenAIChoice + type: object + OpenAIChoiceLogprobs: + description: 'The log probabilities for the tokens in the message from an OpenAI-compatible + chat completion response. + + + :param content: (Optional) The log probabilities for the tokens in the message + + :param refusal: (Optional) The log probabilities for the tokens in the message' + properties: + content: + title: Content + items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + nullable: true + refusal: + title: Refusal + items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + nullable: true + title: OpenAIChoiceLogprobs + type: object + OpenAICompletionWithInputMessages: + properties: + id: + title: Id + type: string + choices: + items: + $ref: '#/components/schemas/OpenAIChoice' + title: Choices + type: array + object: + const: chat.completion + default: chat.completion + title: Object + type: string + created: + title: Created + type: integer + model: + title: Model + type: string + usage: + $ref: '#/components/schemas/OpenAIChatCompletionUsage' + nullable: true + input_messages: + items: + discriminator: + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam' + propertyName: role + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Input Messages + type: array + required: + - id + - choices + - created + - model + - input_messages + title: OpenAICompletionWithInputMessages + type: object + OpenAIUserMessageParam: + description: 'A message from the user in an OpenAI-compatible chat completion + request. + + + :param role: Must be "user" to identify this as a user message + + :param content: The content of the message, which can include text and other + media + + :param name: (Optional) The name of the user message participant.' + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + file: '#/components/schemas/OpenAIFile' + image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' + type: array + title: Content + name: + title: Name + type: string + nullable: true + required: + - content + title: OpenAIUserMessageParam + type: object + ScoringFn: + description: 'A scoring function resource for evaluating model outputs. + + :param type: The resource type, always scoring_function' + properties: + identifier: + description: Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + description: Unique identifier for this resource in the provider + title: Provider Resource Id + type: string + nullable: true + provider_id: + description: ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: scoring_function + default: scoring_function + title: Type + type: string + description: + title: Description + type: string + nullable: true + metadata: + additionalProperties: true + description: Any additional metadata for this definition + title: Metadata + type: object + return_type: + description: The return type of the deterministic function + discriminator: + mapping: + agent_turn_input: '#/components/schemas/AgentTurnInputType' + array: '#/components/schemas/ArrayType' + boolean: '#/components/schemas/BooleanType' + chat_completion_input: '#/components/schemas/ChatCompletionInputType' + completion_input: '#/components/schemas/CompletionInputType' + json: '#/components/schemas/JsonType' + number: '#/components/schemas/NumberType' + object: '#/components/schemas/ObjectType' + string: '#/components/schemas/StringType' + union: '#/components/schemas/UnionType' + propertyName: type + oneOf: + - $ref: '#/components/schemas/StringType' + - $ref: '#/components/schemas/NumberType' + - $ref: '#/components/schemas/BooleanType' + - $ref: '#/components/schemas/ArrayType' + - $ref: '#/components/schemas/ObjectType' + - $ref: '#/components/schemas/JsonType' + - $ref: '#/components/schemas/UnionType' + - $ref: '#/components/schemas/ChatCompletionInputType' + - $ref: '#/components/schemas/CompletionInputType' + - $ref: '#/components/schemas/AgentTurnInputType' + title: Return Type + params: + description: The parameters for the scoring function for benchmark eval, + these can be overridden for app eval + title: Params + discriminator: + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + propertyName: type + oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + nullable: true + required: + - identifier + - provider_id + - return_type + title: ScoringFn + type: object + ListToolDefsResponse: + description: 'Response containing a list of tool definitions. + + + :param data: List of tool definitions' + properties: + data: + items: + $ref: '#/components/schemas/ToolDef' + title: Data + type: array + required: + - data + title: ListToolDefsResponse + type: object + VectorStoreDeleteResponse: + description: 'Response from deleting a vector store. + + + :param id: Unique identifier of the deleted vector store + + :param object: Object type identifier for the deletion response + + :param deleted: Whether the deletion operation was successful' + properties: + id: + title: Id + type: string + object: + default: vector_store.deleted + title: Object + type: string + deleted: + default: true + title: Deleted + type: boolean + required: + - id + title: VectorStoreDeleteResponse + type: object + VectorStoreFileContentsResponse: + description: 'Response from retrieving the contents of a vector store file. + + + :param file_id: Unique identifier for the file + + :param filename: Name of the file + + :param attributes: Key-value attributes associated with the file + + :param content: List of content items from the file' + properties: + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + attributes: + additionalProperties: true + title: Attributes + type: object + content: + items: + $ref: '#/components/schemas/VectorStoreContent' + title: Content + type: array + required: + - file_id + - filename + - attributes + - content + title: VectorStoreFileContentsResponse + type: object + VectorStoreFileDeleteResponse: + description: 'Response from deleting a vector store file. + + + :param id: Unique identifier of the deleted file + + :param object: Object type identifier for the deletion response + + :param deleted: Whether the deletion operation was successful' + properties: + id: + title: Id + type: string + object: + default: vector_store.file.deleted + title: Object + type: string + deleted: + default: true + title: Deleted + type: boolean + required: + - id + title: VectorStoreFileDeleteResponse + type: object + VectorStoreFilesListInBatchResponse: + description: 'Response from listing files in a vector store file batch. + + + :param object: Object type identifier, always "list" + + :param data: List of vector store file objects in the batch + + :param first_id: (Optional) ID of the first file in the list for pagination + + :param last_id: (Optional) ID of the last file in the list for pagination + + :param has_more: Whether there are more files available beyond this page' + properties: + object: + default: list + title: Object type: string - detail: - title: Detail + data: + items: + $ref: '#/components/schemas/VectorStoreFileObject' + title: Data + type: array + first_id: + title: First Id type: string - instance: + nullable: true + last_id: + title: Last Id + type: string + nullable: true + has_more: + default: false + title: Has More + type: boolean + required: + - data + title: VectorStoreFilesListInBatchResponse + type: object + VectorStoreListFilesResponse: + description: 'Response from listing files in a vector store. + + + :param object: Object type identifier, always "list" + + :param data: List of vector store file objects + + :param first_id: (Optional) ID of the first file in the list for pagination + + :param last_id: (Optional) ID of the last file in the list for pagination + + :param has_more: Whether there are more files available beyond this page' + properties: + object: + default: list + title: Object + type: string + data: + items: + $ref: '#/components/schemas/VectorStoreFileObject' + title: Data + type: array + first_id: + title: First Id + type: string + nullable: true + last_id: + title: Last Id + type: string + nullable: true + has_more: + default: false + title: Has More + type: boolean + required: + - data + title: VectorStoreListFilesResponse + type: object + VectorStoreListResponse: + description: 'Response from listing vector stores. + + + :param object: Object type identifier, always "list" + + :param data: List of vector store objects + + :param first_id: (Optional) ID of the first vector store in the list for pagination + + :param last_id: (Optional) ID of the last vector store in the list for pagination + + :param has_more: Whether there are more vector stores available beyond this + page' + properties: + object: + default: list + title: Object + type: string + data: + items: + $ref: '#/components/schemas/VectorStoreObject' + title: Data + type: array + first_id: + title: First Id + type: string + nullable: true + last_id: + title: Last Id + type: string + nullable: true + has_more: + default: false + title: Has More + type: boolean + required: + - data + title: VectorStoreListResponse + type: object + OpenAIResponseMessage: + description: 'Corresponds to the various Message types in the Responses API. + + They are all under one type because the Responses API gives them all + + the same "type" value, and there is no way to tell them apart in certain + + scenarios.' + properties: + content: anyOf: - type: string - - type: 'null' - default: null - title: Instance + - items: + discriminator: + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: array + - items: + discriminator: + mapping: + output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + title: Id + type: string + nullable: true + status: + title: Status + type: string + nullable: true + required: + - content + - role + title: OpenAIResponseMessage + type: object + OpenAIResponseObjectWithInput: + description: 'OpenAI response object extended with input context information. + + + :param input: List of input items that led to this response' + properties: + created_at: + title: Created At + type: integer + error: + $ref: '#/components/schemas/OpenAIResponseError' + nullable: true + id: + title: Id + type: string + model: + title: Model + type: string + object: + const: response + default: response + title: Object + type: string + output: + items: + discriminator: + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + title: Output + type: array + parallel_tool_calls: + default: false + title: Parallel Tool Calls + type: boolean + previous_response_id: + title: Previous Response Id + type: string + nullable: true + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' + nullable: true + status: + title: Status + type: string + temperature: + title: Temperature + type: number + nullable: true + text: + $ref: '#/components/schemas/OpenAIResponseText' + default: + format: + type: text + top_p: + title: Top P + type: number + nullable: true + tools: + title: Tools + items: + discriminator: + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + type: array + nullable: true + truncation: + title: Truncation + type: string + nullable: true + usage: + $ref: '#/components/schemas/OpenAIResponseUsage' + nullable: true + instructions: + title: Instructions + type: string + nullable: true + input: + items: + anyOf: + - discriminator: + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage' + title: Input + type: array required: + - created_at + - id + - model + - output - status - - title - - detail - title: Error + - input + title: OpenAIResponseObjectWithInput + type: object + _safety_run_shield_Request: + properties: + shield_id: + title: Shield Id + type: string + messages: + anyOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Messages + params: + title: Params + type: string + required: + - shield_id + - messages + - params + title: _safety_run_shield_Request type: object responses: BadRequest400: diff --git a/docs/static/stainless-llama-stack-spec.yaml b/docs/static/stainless-llama-stack-spec.yaml index 120c20b6ad..118a887d6f 100644 --- a/docs/static/stainless-llama-stack-spec.yaml +++ b/docs/static/stainless-llama-stack-spec.yaml @@ -1,19 +1,13 @@ openapi: 3.1.0 info: - title: >- - Llama Stack Specification - Stable & Experimental APIs - version: v1 - description: >- - This is the specification of the Llama Stack that provides - a set of endpoints and their corresponding interfaces that are - tailored to - best leverage Llama Models. - - **🔗 COMBINED**: This specification includes both stable production-ready APIs - and experimental pre-release APIs. Use stable APIs for production deployments - and experimental APIs for testing new features. + title: Llama Stack API - Stable & Experimental APIs + description: "A comprehensive API for building and deploying AI applications\n\n**🔗 COMBINED**: This specification includes both stable production-ready APIs and experimental pre-release APIs. Use stable APIs for production deployments and experimental APIs for testing new features." + version: 1.0.0 servers: - - url: http://any-hosted-llama-stack.com +- url: https://api.llamastack.com + description: Production server +- url: https://staging-api.llamastack.com + description: Staging server paths: /v1/batches: get: @@ -3480,44 +3474,72 @@ paths: deprecated: false /v1beta/datasetio/append-rows/{dataset_id}: post: + tags: + - V1Beta + summary: Append Rows + description: Generic endpoint - this would be replaced with actual implementation. + operationId: append_rows_v1beta_datasetio_append_rows__dataset_id__post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: dataset_id + in: path + required: true + schema: + type: string + description: 'Path parameter: dataset_id' responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1beta/datasetio/iterrows/{dataset_id}: + get: tags: - - DatasetIO - summary: Append rows to a dataset. - description: >- - Append rows to a dataset. - - :param dataset_id: The ID of the dataset to append the rows to. - :param rows: The rows to append to the dataset. + - V1Beta + summary: Iterrows + description: Query endpoint for proper schema generation. + operationId: iterrows_v1beta_datasetio_iterrows__dataset_id__get parameters: - - name: dataset_id - description: >- - The ID of the dataset to append the rows to. - required: true - schema: - type: string - in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AppendRowsRequest' + - name: dataset_id + in: path required: true - deprecated: false - /v1beta/datasetio/iterrows/{dataset_id}: - get: + schema: + type: string + title: Dataset Id + - name: limit + in: query + required: true + schema: + type: integer + title: Limit + - name: start_index + in: query + required: true + schema: + type: integer + title: Start Index responses: '200': description: A PaginatedResponse. @@ -3527,59 +3549,23 @@ paths: $ref: '#/components/schemas/PaginatedResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - DatasetIO - summary: >- - Get a paginated list of rows from a dataset. - description: >- - Get a paginated list of rows from a dataset. - - Uses offset-based pagination where: - - start_index: The starting index (0-based). If None, starts from - beginning. - - limit: Number of items to return. If None or -1, returns all items. - - The response includes: - - data: List of items for the current page. - - has_more: Whether there are more items available after this set. - - :param dataset_id: The ID of the dataset to get the rows from. - :param start_index: Index into dataset for the first row to get. Get - all rows if None. - :param limit: The number of rows to get. - :returns: A PaginatedResponse. - parameters: - - name: dataset_id - description: >- - The ID of the dataset to get the rows from. - required: true - schema: - type: string - in: path - - name: start_index - description: >- - Index into dataset for the first row to get. Get all rows if None. - required: false - schema: - type: integer - in: query - - name: limit - description: The number of rows to get. - required: false - schema: - type: integer - in: query - deprecated: false + description: Default Response /v1beta/datasets: get: + tags: + - V1Beta + summary: List Datasets + description: Response-only endpoint for proper schema generation. + operationId: list_datasets_v1beta_datasets_get responses: '200': description: A ListDatasetsResponse. @@ -3588,120 +3574,29 @@ paths: schema: $ref: '#/components/schemas/ListDatasetsResponse' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - Datasets - summary: List all datasets. - description: >- - List all datasets. - - :returns: A ListDatasetsResponse. - parameters: [] - deprecated: false post: - responses: - '200': - description: A Dataset. - content: - application/json: - schema: - $ref: '#/components/schemas/Dataset' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' tags: - - Datasets - summary: Register a new dataset. - description: >- - Register a new dataset. - - :param purpose: The purpose of the dataset. - One of: - - "post-training/messages": The dataset contains a messages column - with list of messages for post-training. - { - "messages": [ - {"role": "user", "content": "Hello, world!"}, - {"role": "assistant", "content": "Hello, world!"}, - ] - } - - "eval/question-answer": The dataset contains a question column - and an answer column for evaluation. - { - "question": "What is the capital of France?", - "answer": "Paris" - } - - "eval/messages-answer": The dataset contains a messages column - with list of messages and an answer column for evaluation. - { - "messages": [ - {"role": "user", "content": "Hello, my name is John - Doe."}, - {"role": "assistant", "content": "Hello, John Doe. - How can I help you today?"}, - {"role": "user", "content": "What's my name?"}, - ], - "answer": "John Doe" - } - :param source: The data source of the dataset. Ensure that the data - source schema is compatible with the purpose of the dataset. Examples: - - { - "type": "uri", - "uri": "https://mywebsite.com/mydata.jsonl" - } - - { - "type": "uri", - "uri": "lsfs://mydata.jsonl" - } - - { - "type": "uri", - "uri": "data:csv;base64,{base64_content}" - } - - { - "type": "uri", - "uri": "huggingface://llamastack/simpleqa?split=train" - } - - { - "type": "rows", - "rows": [ - { - "messages": [ - {"role": "user", "content": "Hello, world!"}, - {"role": "assistant", "content": "Hello, world!"}, - ] - } - ] - } - :param metadata: The metadata for the dataset. - - E.g. {"description": "My dataset"}. - :param dataset_id: The ID of the dataset. If not provided, an ID will - be generated. - :returns: A Dataset. - parameters: [] + - V1Beta + summary: Register Dataset + description: Typed endpoint for proper schema generation. + operationId: register_dataset_v1beta_datasets_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/RegisterDatasetRequest' + $ref: '#/components/schemas/__main_____datasets_Request' required: true - deprecated: false - /v1beta/datasets/{dataset_id}: - get: responses: '200': description: A Dataset. @@ -3710,520 +3605,539 @@ paths: schema: $ref: '#/components/schemas/Dataset' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' + /v1beta/datasets/{dataset_id}: + delete: tags: - - Datasets - summary: Get a dataset by its ID. - description: >- - Get a dataset by its ID. - - :param dataset_id: The ID of the dataset to get. - :returns: A Dataset. + - V1Beta + summary: Unregister Dataset + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_dataset_v1beta_datasets__dataset_id__delete parameters: - - name: dataset_id - description: The ID of the dataset to get. - required: true - schema: - type: string - in: path - deprecated: false - delete: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: dataset_id + in: path + required: true + schema: + type: string + description: 'Path parameter: dataset_id' responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Datasets - summary: Unregister a dataset by its ID. - description: >- - Unregister a dataset by its ID. - - :param dataset_id: The ID of the dataset to unregister. + - V1Beta + summary: Get Dataset + description: Query endpoint for proper schema generation. + operationId: get_dataset_v1beta_datasets__dataset_id__get parameters: - - name: dataset_id - description: The ID of the dataset to unregister. - required: true - schema: - type: string - in: path - deprecated: false - /v1alpha/agents: - get: + - name: dataset_id + in: path + required: true + schema: + type: string + title: Dataset Id responses: '200': - description: A PaginatedResponse. + description: A Dataset. content: application/json: schema: - $ref: '#/components/schemas/PaginatedResponse' + $ref: '#/components/schemas/Dataset' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/agents: + get: tags: - - Agents - summary: List all agents. - description: >- - List all agents. - - :param start_index: The index to start the pagination from. - :param limit: The number of agents to return. - :returns: A PaginatedResponse. + - V1Alpha + summary: List Agents + description: Query endpoint for proper schema generation. + operationId: list_agents_v1alpha_agents_get parameters: - - name: start_index - description: The index to start the pagination from. - required: false - schema: - type: integer - in: query - - name: limit - description: The number of agents to return. - required: false - schema: - type: integer - in: query - deprecated: false - post: + - name: limit + in: query + required: true + schema: + type: integer + title: Limit + - name: start_index + in: query + required: true + schema: + type: integer + title: Start Index responses: '200': - description: >- - An AgentCreateResponse with the agent ID. + description: A PaginatedResponse. content: application/json: schema: - $ref: '#/components/schemas/AgentCreateResponse' + $ref: '#/components/schemas/PaginatedResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + post: tags: - - Agents - summary: >- - Create an agent with the given configuration. - description: >- - Create an agent with the given configuration. - - :param agent_config: The configuration for the agent. - :returns: An AgentCreateResponse with the agent ID. - parameters: [] + - V1Alpha + summary: Create Agent + description: Typed endpoint for proper schema generation. + operationId: create_agent_v1alpha_agents_post requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/CreateAgentRequest' - required: true - deprecated: false - /v1alpha/agents/{agent_id}: - get: + $ref: '#/components/schemas/AgentConfig' responses: '200': - description: An Agent of the agent. + description: An AgentCreateResponse with the agent ID. content: application/json: schema: - $ref: '#/components/schemas/Agent' + $ref: '#/components/schemas/AgentCreateResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/agents/{agent_id}: + delete: tags: - - Agents - summary: Describe an agent by its ID. - description: >- - Describe an agent by its ID. - - :param agent_id: ID of the agent. - :returns: An Agent of the agent. + - V1Alpha + summary: Delete Agent + description: Generic endpoint - this would be replaced with actual implementation. + operationId: delete_agent_v1alpha_agents__agent_id__delete parameters: - - name: agent_id - description: ID of the agent. - required: true - schema: - type: string - in: path - deprecated: false - delete: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: agent_id + in: path + required: true + schema: + type: string + description: 'Path parameter: agent_id' responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Agents - summary: >- - Delete an agent by its ID and its associated sessions and turns. - description: >- - Delete an agent by its ID and its associated sessions and turns. - - :param agent_id: The ID of the agent to delete. + - V1Alpha + summary: Get Agent + description: Query endpoint for proper schema generation. + operationId: get_agent_v1alpha_agents__agent_id__get parameters: - - name: agent_id - description: The ID of the agent to delete. - required: true - schema: - type: string - in: path - deprecated: false - /v1alpha/agents/{agent_id}/session: - post: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id responses: '200': - description: An AgentSessionCreateResponse. + description: An Agent of the agent. content: application/json: schema: - $ref: '#/components/schemas/AgentSessionCreateResponse' + $ref: '#/components/schemas/Agent' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/agents/{agent_id}/session: + post: tags: - - Agents - summary: Create a new session for an agent. - description: >- - Create a new session for an agent. - - :param agent_id: The ID of the agent to create the session for. - :param session_name: The name of the session to create. - :returns: An AgentSessionCreateResponse. - parameters: - - name: agent_id - description: >- - The ID of the agent to create the session for. - required: true - schema: - type: string - in: path + - V1Alpha + summary: Create Agent Session + description: Typed endpoint for proper schema generation. + operationId: create_agent_session_v1alpha_agents__agent_id__session_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/CreateAgentSessionRequest' + $ref: '#/components/schemas/__main_____agents_agent_id_session_Request' required: true - deprecated: false - /v1alpha/agents/{agent_id}/session/{session_id}: - get: responses: '200': - description: A Session. + description: An AgentSessionCreateResponse. content: application/json: schema: - $ref: '#/components/schemas/Session' + $ref: '#/components/schemas/AgentSessionCreateResponse' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: Retrieve an agent session by its ID. - description: >- - Retrieve an agent session by its ID. - - :param session_id: The ID of the session to get. - :param agent_id: The ID of the agent to get the session for. - :param turn_ids: (Optional) List of turn IDs to filter the session - by. - :returns: A Session. parameters: - - name: session_id - description: The ID of the session to get. - required: true - schema: - type: string - in: path - - name: agent_id - description: >- - The ID of the agent to get the session for. - required: true - schema: - type: string - in: path - - name: turn_ids - description: >- - (Optional) List of turn IDs to filter the session by. - required: false - schema: - $ref: '#/components/schemas/list' - in: query - deprecated: false + - name: agent_id + in: path + required: true + schema: + type: string + description: 'Path parameter: agent_id' + /v1alpha/agents/{agent_id}/session/{session_id}: delete: + tags: + - V1Alpha + summary: Delete Agents Session + description: Generic endpoint - this would be replaced with actual implementation. + operationId: delete_agents_session_v1alpha_agents__agent_id__session__session_id__delete + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: agent_id + in: path + required: true + schema: + type: string + description: 'Path parameter: agent_id' + - name: session_id + in: path + required: true + schema: + type: string + description: 'Path parameter: session_id' responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Agents - summary: >- - Delete an agent session by its ID and its associated turns. - description: >- - Delete an agent session by its ID and its associated turns. - - :param session_id: The ID of the session to delete. - :param agent_id: The ID of the agent to delete the session for. + - V1Alpha + summary: Get Agents Session + description: Query endpoint for proper schema generation. + operationId: get_agents_session_v1alpha_agents__agent_id__session__session_id__get parameters: - - name: session_id - description: The ID of the session to delete. - required: true - schema: - type: string - in: path - - name: agent_id - description: >- - The ID of the agent to delete the session for. - required: true - schema: - type: string - in: path - deprecated: false - /v1alpha/agents/{agent_id}/session/{session_id}/turn: - post: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + - name: session_id + in: path + required: true + schema: + type: string + title: Session Id + - name: turn_ids + in: query + required: true + schema: + type: string + title: Turn Ids responses: '200': - description: If stream=False, returns a Turn object. + description: A Session. content: application/json: schema: - $ref: '#/components/schemas/Turn' - text/event-stream: - schema: - $ref: '#/components/schemas/AsyncIterator' + $ref: '#/components/schemas/Session' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/agents/{agent_id}/session/{session_id}/turn: + post: tags: - - Agents - summary: Create a new turn for an agent. - description: >- - Create a new turn for an agent. - - :param agent_id: The ID of the agent to create the turn for. - :param session_id: The ID of the session to create the turn for. - :param messages: List of messages to start the turn with. - :param stream: (Optional) If True, generate an SSE event stream of - the response. Defaults to False. - :param documents: (Optional) List of documents to create the turn - with. - :param toolgroups: (Optional) List of toolgroups to create the turn - with, will be used in addition to the agent's config toolgroups for the request. - :param tool_config: (Optional) The tool configuration to create the - turn with, will be used to override the agent's tool_config. - :returns: If stream=False, returns a Turn object. - If stream=True, returns an SSE event stream of AgentTurnResponseStreamChunk. - parameters: - - name: agent_id - description: >- - The ID of the agent to create the turn for. - required: true - schema: - type: string - in: path - - name: session_id - description: >- - The ID of the session to create the turn for. - required: true - schema: - type: string - in: path + - V1Alpha + summary: Create Agent Turn + description: Typed endpoint for proper schema generation. + operationId: create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/CreateAgentTurnRequest' + $ref: '#/components/schemas/__main_____agents_agent_id_session_session_id_turn_Request' required: true - deprecated: false - /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}: - get: responses: '200': - description: A Turn. + description: If stream=False, returns a Turn object. content: application/json: schema: $ref: '#/components/schemas/Turn' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: 'Path parameter: agent_id' + - name: session_id + in: path + required: true + schema: + type: string + description: 'Path parameter: session_id' + /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}: + get: tags: - - Agents - summary: Retrieve an agent turn by its ID. - description: >- - Retrieve an agent turn by its ID. - - :param agent_id: The ID of the agent to get the turn for. - :param session_id: The ID of the session to get the turn for. - :param turn_id: The ID of the turn to get. - :returns: A Turn. + - V1Alpha + summary: Get Agents Turn + description: Query endpoint for proper schema generation. + operationId: get_agents_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__get parameters: - - name: agent_id - description: The ID of the agent to get the turn for. - required: true - schema: - type: string - in: path - - name: session_id - description: >- - The ID of the session to get the turn for. - required: true - schema: - type: string - in: path - - name: turn_id - description: The ID of the turn to get. - required: true - schema: - type: string - in: path - deprecated: false - /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume: - post: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + - name: session_id + in: path + required: true + schema: + type: string + title: Session Id + - name: turn_id + in: path + required: true + schema: + type: string + title: Turn Id responses: '200': - description: >- - A Turn object if stream is False, otherwise an AsyncIterator of AgentTurnResponseStreamChunk - objects. + description: A Turn. content: application/json: schema: $ref: '#/components/schemas/Turn' - text/event-stream: - schema: - $ref: '#/components/schemas/AsyncIterator' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume: + post: tags: - - Agents - summary: >- - Resume an agent turn with executed tool call responses. - description: >- - Resume an agent turn with executed tool call responses. - - When a Turn has the status `awaiting_input` due to pending input from client - side tool calls, this endpoint can be used to submit the outputs from the - tool calls once they are ready. - - :param agent_id: The ID of the agent to resume. - :param session_id: The ID of the session to resume. - :param turn_id: The ID of the turn to resume. - :param tool_responses: The tool call responses to resume the turn - with. - :param stream: Whether to stream the response. - :returns: A Turn object if stream is False, otherwise an AsyncIterator - of AgentTurnResponseStreamChunk objects. - parameters: - - name: agent_id - description: The ID of the agent to resume. - required: true - schema: - type: string - in: path - - name: session_id - description: The ID of the session to resume. - required: true - schema: - type: string - in: path - - name: turn_id - description: The ID of the turn to resume. - required: true - schema: - type: string - in: path + - V1Alpha + summary: Resume Agent Turn + description: Typed endpoint for proper schema generation. + operationId: resume_agent_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__resume_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/ResumeAgentTurnRequest' + $ref: '#/components/schemas/__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request' required: true - deprecated: false + responses: + '200': + description: A Turn object if stream is False, otherwise an AsyncIterator of AgentTurnResponseStreamChunk objects. + content: + application/json: + schema: + $ref: '#/components/schemas/Turn' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: 'Path parameter: agent_id' + - name: session_id + in: path + required: true + schema: + type: string + description: 'Path parameter: session_id' + - name: turn_id + in: path + required: true + schema: + type: string + description: 'Path parameter: turn_id' /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}: get: + tags: + - V1Alpha + summary: Get Agents Step + description: Query endpoint for proper schema generation. + operationId: get_agents_step_v1alpha_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + - name: session_id + in: path + required: true + schema: + type: string + title: Session Id + - name: step_id + in: path + required: true + schema: + type: string + title: Step Id + - name: turn_id + in: path + required: true + schema: + type: string + title: Turn Id responses: '200': description: An AgentStepResponse. @@ -4233,54 +4147,42 @@ paths: $ref: '#/components/schemas/AgentStepResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: Retrieve an agent step by its ID. - description: >- - Retrieve an agent step by its ID. - - :param agent_id: The ID of the agent to get the step for. - :param session_id: The ID of the session to get the step for. - :param turn_id: The ID of the turn to get the step for. - :param step_id: The ID of the step to get. - :returns: An AgentStepResponse. - parameters: - - name: agent_id - description: The ID of the agent to get the step for. - required: true - schema: - type: string - in: path - - name: session_id - description: >- - The ID of the session to get the step for. - required: true - schema: - type: string - in: path - - name: turn_id - description: The ID of the turn to get the step for. - required: true - schema: - type: string - in: path - - name: step_id - description: The ID of the step to get. - required: true - schema: - type: string - in: path - deprecated: false + description: Default Response /v1alpha/agents/{agent_id}/sessions: get: + tags: + - V1Alpha + summary: List Agent Sessions + description: Query endpoint for proper schema generation. + operationId: list_agent_sessions_v1alpha_agents__agent_id__sessions_get + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + - name: limit + in: query + required: true + schema: + type: integer + title: Limit + - name: start_index + in: query + required: true + schema: + type: integer + title: Start Index responses: '200': description: A PaginatedResponse. @@ -4290,47 +4192,23 @@ paths: $ref: '#/components/schemas/PaginatedResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: List all session(s) of a given agent. - description: >- - List all session(s) of a given agent. - - :param agent_id: The ID of the agent to list sessions for. - :param start_index: The index to start the pagination from. - :param limit: The number of sessions to return. - :returns: A PaginatedResponse. - parameters: - - name: agent_id - description: >- - The ID of the agent to list sessions for. - required: true - schema: - type: string - in: path - - name: start_index - description: The index to start the pagination from. - required: false - schema: - type: integer - in: query - - name: limit - description: The number of sessions to return. - required: false - schema: - type: integer - in: query - deprecated: false + description: Default Response /v1alpha/eval/benchmarks: get: + tags: + - V1Alpha + summary: List Benchmarks + description: Response-only endpoint for proper schema generation. + operationId: list_benchmarks_v1alpha_eval_benchmarks_get responses: '200': description: A ListBenchmarksResponse. @@ -4340,294 +4218,309 @@ paths: $ref: '#/components/schemas/ListBenchmarksResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + post: tags: - - Benchmarks - summary: List all benchmarks. - description: >- - List all benchmarks. - - :returns: A ListBenchmarksResponse. - parameters: [] - deprecated: false - post: + - V1Alpha + summary: Register Benchmark + description: Generic endpoint - this would be replaced with actual implementation. + operationId: register_benchmark_v1alpha_eval_benchmarks_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/eval/benchmarks/{benchmark_id}: + delete: tags: - - Benchmarks - summary: Register a benchmark. - description: >- - Register a benchmark. - - :param benchmark_id: The ID of the benchmark to register. - :param dataset_id: The ID of the dataset to use for the benchmark. - :param scoring_functions: The scoring functions to use for the benchmark. - :param provider_benchmark_id: The ID of the provider benchmark to - use for the benchmark. - :param provider_id: The ID of the provider to use for the benchmark. - :param metadata: The metadata to use for the benchmark. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterBenchmarkRequest' + - V1Alpha + summary: Unregister Benchmark + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_benchmark_v1alpha_eval_benchmarks__benchmark_id__delete + parameters: + - name: args + in: query required: true - deprecated: false - /v1alpha/eval/benchmarks/{benchmark_id}: - get: + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: benchmark_id + in: path + required: true + schema: + type: string + description: 'Path parameter: benchmark_id' responses: '200': - description: A Benchmark. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/Benchmark' + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Benchmarks - summary: Get a benchmark by its ID. - description: >- - Get a benchmark by its ID. - - :param benchmark_id: The ID of the benchmark to get. - :returns: A Benchmark. + - V1Alpha + summary: Get Benchmark + description: Query endpoint for proper schema generation. + operationId: get_benchmark_v1alpha_eval_benchmarks__benchmark_id__get parameters: - - name: benchmark_id - description: The ID of the benchmark to get. - required: true - schema: - type: string - in: path - deprecated: false - delete: + - name: benchmark_id + in: path + required: true + schema: + type: string + title: Benchmark Id responses: '200': - description: OK + description: A Benchmark. + content: + application/json: + schema: + $ref: '#/components/schemas/Benchmark' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Benchmarks - summary: Unregister a benchmark. - description: >- - Unregister a benchmark. - - :param benchmark_id: The ID of the benchmark to unregister. - parameters: - - name: benchmark_id - description: The ID of the benchmark to unregister. - required: true - schema: - type: string - in: path - deprecated: false + description: Default Response /v1alpha/eval/benchmarks/{benchmark_id}/evaluations: post: + tags: + - V1Alpha + summary: Evaluate Rows + description: Typed endpoint for proper schema generation. + operationId: evaluate_rows_v1alpha_eval_benchmarks__benchmark_id__evaluations_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BenchmarkConfig' + required: true responses: '200': - description: >- - EvaluateResponse object containing generations and scores. + description: EvaluateResponse object containing generations and scores. content: application/json: schema: $ref: '#/components/schemas/EvaluateResponse' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - Eval - summary: Evaluate a list of rows on a benchmark. - description: >- - Evaluate a list of rows on a benchmark. - - :param benchmark_id: The ID of the benchmark to run the evaluation on. - :param input_rows: The rows to evaluate. - :param scoring_functions: The scoring functions to use for the evaluation. - :param benchmark_config: The configuration for the benchmark. - :returns: EvaluateResponse object containing generations and scores. parameters: - - name: benchmark_id - description: >- - The ID of the benchmark to run the evaluation on. - required: true - schema: - type: string - in: path + - name: benchmark_id + in: path + required: true + schema: + type: string + description: 'Path parameter: benchmark_id' + /v1alpha/eval/benchmarks/{benchmark_id}/jobs: + post: + tags: + - V1Alpha + summary: Run Eval + description: Typed endpoint for proper schema generation. + operationId: run_eval_v1alpha_eval_benchmarks__benchmark_id__jobs_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/EvaluateRowsRequest' + $ref: '#/components/schemas/BenchmarkConfig' required: true - deprecated: false - /v1alpha/eval/benchmarks/{benchmark_id}/jobs: - post: responses: '200': - description: >- - The job that was created to run the evaluation. + description: The job that was created to run the evaluation. content: application/json: schema: $ref: '#/components/schemas/Job' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - Eval - summary: Run an evaluation on a benchmark. - description: >- - Run an evaluation on a benchmark. - - :param benchmark_id: The ID of the benchmark to run the evaluation on. - :param benchmark_config: The configuration for the benchmark. - :returns: The job that was created to run the evaluation. parameters: - - name: benchmark_id - description: >- - The ID of the benchmark to run the evaluation on. - required: true - schema: - type: string - in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RunEvalRequest' + - name: benchmark_id + in: path required: true - deprecated: false + schema: + type: string + description: 'Path parameter: benchmark_id' /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}: - get: + delete: + tags: + - V1Alpha + summary: Job Cancel + description: Generic endpoint - this would be replaced with actual implementation. + operationId: job_cancel_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__delete + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: benchmark_id + in: path + required: true + schema: + type: string + description: 'Path parameter: benchmark_id' + - name: job_id + in: path + required: true + schema: + type: string + description: 'Path parameter: job_id' responses: '200': - description: The status of the evaluation job. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/Job' + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + get: tags: - - Eval - summary: Get the status of a job. - description: >- - Get the status of a job. - - :param benchmark_id: The ID of the benchmark to run the evaluation on. - :param job_id: The ID of the job to get the status of. - :returns: The status of the evaluation job. + - V1Alpha + summary: Job Status + description: Query endpoint for proper schema generation. + operationId: job_status_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__get parameters: - - name: benchmark_id - description: >- - The ID of the benchmark to run the evaluation on. - required: true - schema: - type: string - in: path - - name: job_id - description: The ID of the job to get the status of. - required: true - schema: - type: string - in: path - deprecated: false - delete: + - name: benchmark_id + in: path + required: true + schema: + type: string + title: Benchmark Id + - name: job_id + in: path + required: true + schema: + type: string + title: Job Id responses: '200': - description: OK + description: The status of the evaluation job. + content: + application/json: + schema: + $ref: '#/components/schemas/Job' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Eval - summary: Cancel a job. - description: >- - Cancel a job. - - :param benchmark_id: The ID of the benchmark to run the evaluation on. - :param job_id: The ID of the job to cancel. - parameters: - - name: benchmark_id - description: >- - The ID of the benchmark to run the evaluation on. - required: true - schema: - type: string - in: path - - name: job_id - description: The ID of the job to cancel. - required: true - schema: - type: string - in: path - deprecated: false + description: Default Response /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result: get: + tags: + - V1Alpha + summary: Job Result + description: Query endpoint for proper schema generation. + operationId: job_result_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__result_get + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + title: Benchmark Id + - name: job_id + in: path + required: true + schema: + type: string + title: Job Id responses: '200': description: The result of the job. @@ -4637,85 +4530,62 @@ paths: $ref: '#/components/schemas/EvaluateResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - Eval - summary: Get the result of a job. - description: >- - Get the result of a job. - - :param benchmark_id: The ID of the benchmark to run the evaluation on. - :param job_id: The ID of the job to get the result of. - :returns: The result of the job. - parameters: - - name: benchmark_id - description: >- - The ID of the benchmark to run the evaluation on. - required: true - schema: - type: string - in: path - - name: job_id - description: The ID of the job to get the result of. - required: true - schema: - type: string - in: path - deprecated: false + description: Default Response /v1alpha/inference/rerank: post: + tags: + - V1Alpha + summary: Rerank + description: Typed endpoint for proper schema generation. + operationId: rerank_v1alpha_inference_rerank_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_inference_rerank_Request' + required: true responses: '200': - description: >- - RerankResponse with indices sorted by relevance score (descending). + description: RerankResponse with indices sorted by relevance score (descending). content: application/json: schema: $ref: '#/components/schemas/RerankResponse' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - Inference - summary: >- - Rerank a list of documents based on their relevance to a query. - description: >- - Rerank a list of documents based on their relevance to a query. - - :param model: The identifier of the reranking model to use. - :param query: The search query to rank items against. Can be a string, - text content part, or image content part. The input must not exceed the model's - max input token length. - :param items: List of items to rerank. Each item can be a string, - text content part, or image content part. Each input must not exceed the model's - max input token length. - :param max_num_results: (Optional) Maximum number of results to return. - Default: returns all. - :returns: RerankResponse with indices sorted by relevance score (descending). - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RerankRequest' - required: true - deprecated: false /v1alpha/post-training/job/artifacts: get: + tags: + - V1Alpha + summary: Get Training Job Artifacts + description: Query endpoint for proper schema generation. + operationId: get_training_job_artifacts_v1alpha_post_training_job_artifacts_get + parameters: + - name: job_uuid + in: query + required: true + schema: + type: string + title: Job Uuid responses: '200': description: A PostTrainingJobArtifactsResponse. @@ -4725,63 +4595,66 @@ paths: $ref: '#/components/schemas/PostTrainingJobArtifactsResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - PostTraining (Coming Soon) - summary: Get the artifacts of a training job. - description: >- - Get the artifacts of a training job. - - :param job_uuid: The UUID of the job to get the artifacts of. - :returns: A PostTrainingJobArtifactsResponse. - parameters: - - name: job_uuid - description: >- - The UUID of the job to get the artifacts of. - required: true - schema: - type: string - in: query - deprecated: false + description: Default Response /v1alpha/post-training/job/cancel: post: + tags: + - V1Alpha + summary: Cancel Training Job + description: Generic endpoint - this would be replaced with actual implementation. + operationId: cancel_training_job_v1alpha_post_training_job_cancel_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' + description: Default Response + /v1alpha/post-training/job/status: + get: tags: - - PostTraining (Coming Soon) - summary: Cancel a training job. - description: >- - Cancel a training job. - - :param job_uuid: The UUID of the job to cancel. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CancelTrainingJobRequest' + - V1Alpha + summary: Get Training Job Status + description: Query endpoint for proper schema generation. + operationId: get_training_job_status_v1alpha_post_training_job_status_get + parameters: + - name: job_uuid + in: query required: true - deprecated: false - /v1alpha/post-training/job/status: - get: + schema: + type: string + title: Job Uuid responses: '200': description: A PostTrainingJobStatusResponse. @@ -4791,33 +4664,23 @@ paths: $ref: '#/components/schemas/PostTrainingJobStatusResponse' '400': $ref: '#/components/responses/BadRequest400' + description: Bad Request '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error default: $ref: '#/components/responses/DefaultError' - tags: - - PostTraining (Coming Soon) - summary: Get the status of a training job. - description: >- - Get the status of a training job. - - :param job_uuid: The UUID of the job to get the status of. - :returns: A PostTrainingJobStatusResponse. - parameters: - - name: job_uuid - description: >- - The UUID of the job to get the status of. - required: true - schema: - type: string - in: query - deprecated: false + description: Default Response /v1alpha/post-training/jobs: get: + tags: + - V1Alpha + summary: Get Training Jobs + description: Response-only endpoint for proper schema generation. + operationId: get_training_jobs_v1alpha_post_training_jobs_get responses: '200': description: A ListPostTrainingJobsResponse. @@ -4826,26 +4689,30 @@ paths: schema: $ref: '#/components/schemas/ListPostTrainingJobsResponse' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' - tags: - - PostTraining (Coming Soon) - summary: Get all training jobs. - description: >- - Get all training jobs. - - :returns: A ListPostTrainingJobsResponse. - parameters: [] - deprecated: false /v1alpha/post-training/preference-optimize: post: + tags: + - V1Alpha + summary: Preference Optimize + description: Typed endpoint for proper schema generation. + operationId: preference_optimize_v1alpha_post_training_preference_optimize_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DPOAlignmentConfig' + required: true responses: '200': description: A PostTrainingJob. @@ -4854,38 +4721,30 @@ paths: schema: $ref: '#/components/schemas/PostTrainingJob' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' + /v1alpha/post-training/supervised-fine-tune: + post: tags: - - PostTraining (Coming Soon) - summary: Run preference optimization of a model. - description: >- - Run preference optimization of a model. - - :param job_uuid: The UUID of the job to create. - :param finetuned_model: The model to fine-tune. - :param algorithm_config: The algorithm configuration. - :param training_config: The training configuration. - :param hyperparam_search_config: The hyperparam search configuration. - :param logger_config: The logger configuration. - :returns: A PostTrainingJob. - parameters: [] + - V1Alpha + summary: Supervised Fine Tune + description: Typed endpoint for proper schema generation. + operationId: supervised_fine_tune_v1alpha_post_training_supervised_fine_tune_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/PreferenceOptimizeRequest' + $ref: '#/components/schemas/TrainingConfig' required: true - deprecated: false - /v1alpha/post-training/supervised-fine-tune: - post: responses: '200': description: A PostTrainingJob. @@ -4894,9725 +4753,9028 @@ paths: schema: $ref: '#/components/schemas/PostTrainingJob' '400': + description: Bad Request $ref: '#/components/responses/BadRequest400' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' default: + description: Default Response $ref: '#/components/responses/DefaultError' + /v1/batches: + get: tags: - - PostTraining (Coming Soon) - summary: Run supervised fine-tuning of a model. - description: >- - Run supervised fine-tuning of a model. - - :param job_uuid: The UUID of the job to create. - :param training_config: The training configuration. - :param hyperparam_search_config: The hyperparam search configuration. - :param logger_config: The logger configuration. - :param model: The model to fine-tune. - :param checkpoint_dir: The directory to save checkpoint(s) to. - :param algorithm_config: The algorithm configuration. - :returns: A PostTrainingJob. - parameters: [] + - V1 + summary: List Batches + description: Query endpoint for proper schema generation. + operationId: list_batches_v1_batches_get + parameters: + - name: after + in: query + required: true + schema: + type: string + title: After + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit + responses: + '200': + description: A list of batch objects. + content: + application/json: + schema: + $ref: '#/components/schemas/ListBatchesResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Create Batch + description: Typed endpoint for proper schema generation. + operationId: create_batch_v1_batches_post requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/SupervisedFineTuneRequest' + $ref: '#/components/schemas/_batches_Request' + responses: + '200': + description: The created batch object. + content: + application/json: + schema: + $ref: '#/components/schemas/Batch' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/batches/{batch_id}: + get: + tags: + - V1 + summary: Retrieve Batch + description: Query endpoint for proper schema generation. + operationId: retrieve_batch_v1_batches__batch_id__get + parameters: + - name: batch_id + in: path required: true - deprecated: false -jsonSchemaDialect: >- - https://json-schema.org/draft/2020-12/schema -components: - schemas: - Error: - description: >- - Error response from the API. Roughly follows RFC 7807. - - - :param status: HTTP status code - - :param title: Error title, a short summary of the error which is invariant - for an error type - - :param detail: Error detail, a longer human-readable description of the error - - :param instance: (Optional) A URL which can be used to retrieve more information - about the specific occurrence of the error - properties: - status: - title: Status - type: integer - title: - title: Title - type: string - detail: - title: Detail - type: string - instance: - anyOf: - - type: string - - type: 'null' - title: Instance - required: - - status - - title - - detail - title: Error - description: >- - Error response from the API. Roughly follows RFC 7807. - ListBatchesResponse: - type: object - properties: - object: - type: string - const: list - default: list - data: - type: array - items: - type: object - properties: - id: - type: string - completion_window: - type: string - created_at: - type: integer - endpoint: - type: string - input_file_id: - type: string - object: - type: string - const: batch - status: - type: string - enum: - - validating - - failed - - in_progress - - finalizing - - completed - - expired - - cancelling - - cancelled - cancelled_at: - type: integer - cancelling_at: - type: integer - completed_at: - type: integer - error_file_id: - type: string - errors: - type: object - properties: - data: - type: array - items: - type: object - properties: - code: - type: string - line: - type: integer - message: - type: string - param: - type: string - additionalProperties: false - title: BatchError - object: - type: string - additionalProperties: false - title: Errors - expired_at: - type: integer - expires_at: - type: integer - failed_at: - type: integer - finalizing_at: - type: integer - in_progress_at: - type: integer - metadata: - type: object - additionalProperties: - type: string - model: - type: string - output_file_id: - type: string - request_counts: - type: object - properties: - completed: - type: integer - failed: - type: integer - total: - type: integer - additionalProperties: false - required: - - completed - - failed - - total - title: BatchRequestCounts - usage: - type: object - properties: - input_tokens: - type: integer - input_tokens_details: - type: object - properties: - cached_tokens: - type: integer - additionalProperties: false - required: - - cached_tokens - title: InputTokensDetails - output_tokens: - type: integer - output_tokens_details: - type: object - properties: - reasoning_tokens: - type: integer - additionalProperties: false - required: - - reasoning_tokens - title: OutputTokensDetails - total_tokens: - type: integer - additionalProperties: false - required: - - input_tokens - - input_tokens_details - - output_tokens - - output_tokens_details - - total_tokens - title: BatchUsage - additionalProperties: false - required: - - id - - completion_window - - created_at - - endpoint - - input_file_id - - object - - status - title: Batch - first_id: - type: string - last_id: - type: string - has_more: - type: boolean - default: false - additionalProperties: false - required: - - object - - data - - has_more - title: ListBatchesResponse - description: >- - Response containing a list of batch objects. - CreateBatchRequest: - type: object - properties: - input_file_id: - type: string - description: >- - The ID of an uploaded file containing requests for the batch. - endpoint: - type: string - description: >- - The endpoint to be used for all requests in the batch. - completion_window: - type: string - const: 24h - description: >- - The time window within which the batch should be processed. - metadata: - type: object - additionalProperties: - type: string - description: Optional metadata for the batch. - idempotency_key: - type: string - description: >- - Optional idempotency key. When provided, enables idempotent behavior. - additionalProperties: false - required: - - input_file_id - - endpoint - - completion_window - title: CreateBatchRequest - Batch: - type: object - properties: - id: - type: string - completion_window: - type: string - created_at: - type: integer - endpoint: + schema: type: string - input_file_id: + title: Batch Id + responses: + '200': + description: The batch object. + content: + application/json: + schema: + $ref: '#/components/schemas/Batch' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/batches/{batch_id}/cancel: + post: + tags: + - V1 + summary: Cancel Batch + description: Typed endpoint for proper schema generation. + operationId: cancel_batch_v1_batches__batch_id__cancel_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_batches_batch_id_cancel_Request' + required: true + responses: + '200': + description: The updated batch object. + content: + application/json: + schema: + $ref: '#/components/schemas/Batch' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: batch_id + in: path + required: true + schema: type: string - object: + description: 'Path parameter: batch_id' + /v1/chat/completions: + get: + tags: + - V1 + summary: List Chat Completions + description: Query endpoint for proper schema generation. + operationId: list_chat_completions_v1_chat_completions_get + parameters: + - name: after + in: query + required: true + schema: type: string - const: batch - status: + title: After + - name: model + in: query + required: true + schema: type: string - enum: - - validating - - failed - - in_progress - - finalizing - - completed - - expired - - cancelling - - cancelled - cancelled_at: + title: Model + - name: limit + in: query + required: false + schema: type: integer - cancelling_at: - type: integer - completed_at: - type: integer - error_file_id: + default: 20 + title: Limit + - name: order + in: query + required: false + schema: + $ref: '#/components/schemas/Order' + default: desc + responses: + '200': + description: A ListOpenAIChatCompletionResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/ListOpenAIChatCompletionResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Openai Chat Completion + description: Typed endpoint for proper schema generation. + operationId: openai_chat_completion_v1_chat_completions_post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIChatCompletionRequestWithExtraBody' + responses: + '200': + description: An OpenAIChatCompletion. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIChatCompletion' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/chat/completions/{completion_id}: + get: + tags: + - V1 + summary: Get Chat Completion + description: Query endpoint for proper schema generation. + operationId: get_chat_completion_v1_chat_completions__completion_id__get + parameters: + - name: completion_id + in: path + required: true + schema: type: string - errors: - type: object - properties: - data: - type: array - items: - type: object - properties: - code: - type: string - line: - type: integer - message: - type: string - param: - type: string - additionalProperties: false - title: BatchError - object: - type: string - additionalProperties: false - title: Errors - expired_at: - type: integer - expires_at: - type: integer - failed_at: - type: integer - finalizing_at: - type: integer - in_progress_at: + title: Completion Id + responses: + '200': + description: A OpenAICompletionWithInputMessages. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAICompletionWithInputMessages' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/completions: + post: + tags: + - V1 + summary: Openai Completion + description: Typed endpoint for proper schema generation. + operationId: openai_completion_v1_completions_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAICompletionRequestWithExtraBody' + required: true + responses: + '200': + description: An OpenAICompletion. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAICompletion' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/conversations: + post: + tags: + - V1 + summary: Create Conversation + description: Typed endpoint for proper schema generation. + operationId: create_conversation_v1_conversations_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_conversations_Request' + required: true + responses: + '200': + description: The created conversation object. + content: + application/json: + schema: + $ref: '#/components/schemas/Conversation' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/conversations/{conversation_id}: + delete: + tags: + - V1 + summary: Openai Delete Conversation + description: Query endpoint for proper schema generation. + operationId: openai_delete_conversation_v1_conversations__conversation_id__delete + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id + responses: + '200': + description: The deleted conversation resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationDeletedResource' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Get Conversation + description: Query endpoint for proper schema generation. + operationId: get_conversation_v1_conversations__conversation_id__get + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id + responses: + '200': + description: The conversation object. + content: + application/json: + schema: + $ref: '#/components/schemas/Conversation' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Update Conversation + description: Typed endpoint for proper schema generation. + operationId: update_conversation_v1_conversations__conversation_id__post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/_conversations_conversation_id_Request' + responses: + '200': + description: The updated conversation object. + content: + application/json: + schema: + $ref: '#/components/schemas/Conversation' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + description: 'Path parameter: conversation_id' + /v1/conversations/{conversation_id}/items: + get: + tags: + - V1 + summary: List Items + description: Query endpoint for proper schema generation. + operationId: list_items_v1_conversations__conversation_id__items_get + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id + - name: after + in: query + required: true + schema: + type: string + title: After + - name: include + in: query + required: true + schema: + $ref: '#/components/schemas/ConversationItemInclude' + - name: limit + in: query + required: true + schema: type: integer - metadata: - type: object - additionalProperties: - type: string - model: + title: Limit + - name: order + in: query + required: true + schema: type: string - output_file_id: + title: Order + responses: + '200': + description: List of conversation items. + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationItemList' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Add Items + description: Typed endpoint for proper schema generation. + operationId: add_items_v1_conversations__conversation_id__items_post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/_conversations_conversation_id_items_Request' + responses: + '200': + description: List of created items. + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationItemList' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + parameters: + - name: conversation_id + in: path + required: true + schema: type: string - request_counts: - type: object - properties: - completed: - type: integer - failed: - type: integer - total: - type: integer - additionalProperties: false - required: - - completed - - failed - - total - title: BatchRequestCounts - usage: - type: object - properties: - input_tokens: - type: integer - input_tokens_details: - type: object - properties: - cached_tokens: - type: integer - additionalProperties: false - required: - - cached_tokens - title: InputTokensDetails - output_tokens: - type: integer - output_tokens_details: - type: object - properties: - reasoning_tokens: - type: integer - additionalProperties: false - required: - - reasoning_tokens - title: OutputTokensDetails - total_tokens: - type: integer - additionalProperties: false - required: - - input_tokens - - input_tokens_details - - output_tokens - - output_tokens_details - - total_tokens - title: BatchUsage - additionalProperties: false - required: - - id - - completion_window - - created_at - - endpoint - - input_file_id - - object - - status - title: Batch - Order: - type: string - enum: - - asc - - desc - title: Order - description: Sort order for paginated responses. - ListOpenAIChatCompletionResponse: - type: object - Order: - type: object - ListOpenAIChatCompletionResponse: - $defs: - OpenAIAssistantMessageParam: - description: >- - A message containing the model's (assistant) response in an OpenAI-compatible - chat completion request. - - - :param role: Must be "assistant" to identify this as the model's response - - :param content: The content of the model's response - - :param name: (Optional) The name of the assistant message participant. - - :param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall - object. - properties: - role: - const: assistant - default: assistant - title: Role - type: string - content: - anyOf: - - type: string - - items: - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - type: array - - type: 'null' - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - tool_calls: - anyOf: - - items: - $ref: '#/$defs/OpenAIChatCompletionToolCall' - type: array - - type: 'null' - title: Tool Calls - title: OpenAIAssistantMessageParam - type: object - "OpenAIChatCompletionContentPartImageParam": - description: >- - Image content part for OpenAI-compatible chat completion messages. - - - :param type: Must be "image_url" to identify this as image content - - :param image_url: Image URL specification and processing details - properties: - type: - const: image_url - default: image_url - title: Type - type: string - image_url: - $ref: '#/$defs/OpenAIImageURL' - required: - - image_url - title: >- - OpenAIChatCompletionContentPartImageParam - type: object - OpenAIChatCompletionContentPartTextParam: - description: >- - Text content part for OpenAI-compatible chat completion messages. - - - :param type: Must be "text" to identify this as text content - - :param text: The text content of the message - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: OpenAIChatCompletionContentPartTextParam - type: object - OpenAIChatCompletionToolCall: - description: >- - Tool call specification for OpenAI-compatible chat completion responses. - - - :param index: (Optional) Index of the tool call in the list - - :param id: (Optional) Unique identifier for the tool call - - :param type: Must be "function" to identify this as a function call - - :param function: (Optional) Function call details - properties: - index: - anyOf: - - type: integer - - type: 'null' - title: Index - id: - anyOf: - - type: string - - type: 'null' - title: Id - type: - const: function - default: function - title: Type - type: string - function: - anyOf: - - $ref: >- - #/$defs/OpenAIChatCompletionToolCallFunction - - type: 'null' - title: OpenAIChatCompletionToolCall - type: object - OpenAIChatCompletionToolCallFunction: - description: >- - Function call details for OpenAI-compatible tool calls. - - - :param name: (Optional) Name of the function to call - - :param arguments: (Optional) Arguments to pass to the function as a JSON - string - properties: - name: - anyOf: - - type: string - - type: 'null' - title: Name - arguments: - anyOf: - - type: string - - type: 'null' - title: Arguments - title: OpenAIChatCompletionToolCallFunction - type: object - OpenAIChatCompletionUsage: - description: >- - Usage information for OpenAI chat completion. - - - :param prompt_tokens: Number of tokens in the prompt - - :param completion_tokens: Number of tokens in the completion - - :param total_tokens: Total tokens used (prompt + completion) - - :param input_tokens_details: Detailed breakdown of input token usage - - :param output_tokens_details: Detailed breakdown of output token usage - properties: - prompt_tokens: - title: Prompt Tokens - type: integer - completion_tokens: - title: Completion Tokens - type: integer - total_tokens: - title: Total Tokens - type: integer - prompt_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIChatCompletionUsagePromptTokensDetails - - type: 'null' - completion_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIChatCompletionUsageCompletionTokensDetails - - type: 'null' - required: - - prompt_tokens - - completion_tokens - - total_tokens - title: OpenAIChatCompletionUsage - type: object - "OpenAIChatCompletionUsageCompletionTokensDetails": - description: >- - Token details for output tokens in OpenAI chat completion usage. - - - :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) - properties: - reasoning_tokens: - anyOf: - - type: integer - - type: 'null' - title: Reasoning Tokens - title: >- - OpenAIChatCompletionUsageCompletionTokensDetails - type: object - "OpenAIChatCompletionUsagePromptTokensDetails": - description: >- - Token details for prompt tokens in OpenAI chat completion usage. - - - :param cached_tokens: Number of tokens retrieved from cache - properties: - cached_tokens: - anyOf: - - type: integer - - type: 'null' - title: Cached Tokens - title: >- - OpenAIChatCompletionUsagePromptTokensDetails - type: object - OpenAIChoice: - description: >- - A choice from an OpenAI-compatible chat completion response. - - - :param message: The message from the model - - :param finish_reason: The reason the model stopped generating - - :param index: The index of the choice - - :param logprobs: (Optional) The log probabilities for the tokens in the - message - properties: - message: - discriminator: - mapping: - assistant: '#/$defs/OpenAIAssistantMessageParam' - developer: '#/$defs/OpenAIDeveloperMessageParam' - system: '#/$defs/OpenAISystemMessageParam' - tool: '#/$defs/OpenAIToolMessageParam' - user: '#/$defs/OpenAIUserMessageParam' - propertyName: role - oneOf: - - $ref: '#/$defs/OpenAIUserMessageParam' - - $ref: '#/$defs/OpenAISystemMessageParam' - - $ref: '#/$defs/OpenAIAssistantMessageParam' - - $ref: '#/$defs/OpenAIToolMessageParam' - - $ref: '#/$defs/OpenAIDeveloperMessageParam' - title: Message - finish_reason: - title: Finish Reason - type: string - index: - title: Index - type: integer - logprobs: - anyOf: - - $ref: '#/$defs/OpenAIChoiceLogprobs' - - type: 'null' - required: - - message - - finish_reason - - index - title: OpenAIChoice - type: object - OpenAIChoiceLogprobs: - description: >- - The log probabilities for the tokens in the message from an OpenAI-compatible - chat completion response. - - - :param content: (Optional) The log probabilities for the tokens in the - message - - :param refusal: (Optional) The log probabilities for the tokens in the - message - properties: - content: - anyOf: - - items: - $ref: '#/$defs/OpenAITokenLogProb' - type: array - - type: 'null' - title: Content - refusal: - anyOf: - - items: - $ref: '#/$defs/OpenAITokenLogProb' - type: array - - type: 'null' - title: Refusal - title: OpenAIChoiceLogprobs - type: object - OpenAICompletionWithInputMessages: - properties: - id: - title: Id - type: string - choices: - items: - $ref: '#/$defs/OpenAIChoice' - title: Choices - type: array - object: - const: chat.completion - default: chat.completion - title: Object - type: string - created: - title: Created - type: integer - model: - title: Model - type: string - usage: - anyOf: - - $ref: '#/$defs/OpenAIChatCompletionUsage' - - type: 'null' - input_messages: - items: - discriminator: - mapping: - assistant: '#/$defs/OpenAIAssistantMessageParam' - developer: '#/$defs/OpenAIDeveloperMessageParam' - system: '#/$defs/OpenAISystemMessageParam' - tool: '#/$defs/OpenAIToolMessageParam' - user: '#/$defs/OpenAIUserMessageParam' - propertyName: role - oneOf: - - $ref: '#/$defs/OpenAIUserMessageParam' - - $ref: '#/$defs/OpenAISystemMessageParam' - - $ref: '#/$defs/OpenAIAssistantMessageParam' - - $ref: '#/$defs/OpenAIToolMessageParam' - - $ref: '#/$defs/OpenAIDeveloperMessageParam' - title: Input Messages - type: array - required: - - id - - choices - - created - - model - - input_messages - title: OpenAICompletionWithInputMessages - type: object - OpenAIDeveloperMessageParam: - description: >- - A message from the developer in an OpenAI-compatible chat completion request. - - - :param role: Must be "developer" to identify this as a developer message - - :param content: The content of the developer message - - :param name: (Optional) The name of the developer message participant. - properties: - role: - const: developer - default: developer - title: Role - type: string - content: - anyOf: - - type: string - - items: - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - type: array - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - required: - - content - title: OpenAIDeveloperMessageParam - type: object - OpenAIFile: - properties: - type: - const: file - default: file - title: Type - type: string - file: - $ref: '#/$defs/OpenAIFileFile' - required: - - file - title: OpenAIFile - type: object - OpenAIFileFile: - properties: - file_data: - anyOf: - - type: string - - type: 'null' - title: File Data - file_id: - anyOf: - - type: string - - type: 'null' - title: File Id - filename: - anyOf: - - type: string - - type: 'null' - title: Filename - title: OpenAIFileFile - type: object - OpenAIImageURL: - description: >- - Image URL specification for OpenAI-compatible chat completion messages. - - - :param url: URL of the image to include in the message - - :param detail: (Optional) Level of detail for image processing. Can be - "low", "high", or "auto" - properties: - url: - title: Url - type: string - detail: - anyOf: - - type: string - - type: 'null' - title: Detail - required: - - url - title: OpenAIImageURL - type: object - OpenAISystemMessageParam: - description: >- - A system message providing instructions or context to the model. - - - :param role: Must be "system" to identify this as a system message - - :param content: The content of the "system prompt". If multiple system - messages are provided, they are concatenated. The underlying Llama Stack - code may also add other system messages (for example, for formatting tool - definitions). - - :param name: (Optional) The name of the system message participant. - properties: - role: - const: system - default: system - title: Role - type: string - content: - anyOf: - - type: string - - items: - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - type: array - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - required: - - content - title: OpenAISystemMessageParam - type: object - OpenAITokenLogProb: - description: >- - The log probability for a token from an OpenAI-compatible chat completion - response. - - - :token: The token - - :bytes: (Optional) The bytes for the token - - :logprob: The log probability of the token - - :top_logprobs: The top log probabilities for the token - properties: - token: - title: Token - type: string - bytes: - anyOf: - - items: - type: integer - type: array - - type: 'null' - title: Bytes - logprob: - title: Logprob - type: number - top_logprobs: - items: - $ref: '#/$defs/OpenAITopLogProb' - title: Top Logprobs - type: array - required: - - token - - logprob - - top_logprobs - title: OpenAITokenLogProb - type: object - OpenAIToolMessageParam: - description: >- - A message representing the result of a tool invocation in an OpenAI-compatible - chat completion request. - - - :param role: Must be "tool" to identify this as a tool response - - :param tool_call_id: Unique identifier for the tool call this response - is for - - :param content: The response content from the tool - properties: - role: - const: tool - default: tool - title: Role - type: string - tool_call_id: - title: Tool Call Id - type: string - content: - anyOf: - - type: string - - items: - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - type: array - title: Content - required: - - tool_call_id - - content - title: OpenAIToolMessageParam - type: object - OpenAITopLogProb: - description: >- - The top log probability for a token from an OpenAI-compatible chat completion - response. - - - :token: The token - - :bytes: (Optional) The bytes for the token - - :logprob: The log probability of the token - properties: - token: - title: Token - type: string - bytes: - anyOf: - - items: - type: integer - type: array - - type: 'null' - title: Bytes - logprob: - title: Logprob - type: number - required: - - token - - logprob - title: OpenAITopLogProb - type: object - OpenAIUserMessageParam: - description: >- - A message from the user in an OpenAI-compatible chat completion request. - - - :param role: Must be "user" to identify this as a user message - - :param content: The content of the message, which can include text and - other media - - :param name: (Optional) The name of the user message participant. - properties: - role: - const: user - default: user - title: Role - type: string - content: - anyOf: - - type: string - - items: - discriminator: - mapping: - file: '#/$defs/OpenAIFile' - image_url: >- - #/$defs/OpenAIChatCompletionContentPartImageParam - text: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - - $ref: >- - #/$defs/OpenAIChatCompletionContentPartImageParam - - $ref: '#/$defs/OpenAIFile' - type: array - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - required: - - content - title: OpenAIUserMessageParam - type: object - description: >- - Response from listing OpenAI-compatible chat completions. - - - :param data: List of chat completion objects with their input messages - - :param has_more: Whether there are more completions available beyond this - list - - :param first_id: ID of the first completion in this list - - :param last_id: ID of the last completion in this list - - :param object: Must be "list" to identify this as a list response - properties: - data: - items: - $ref: >- - #/$defs/OpenAICompletionWithInputMessages - title: Data - type: array - has_more: - title: Has More - type: boolean - first_id: - title: First Id - type: string - last_id: - title: Last Id - type: string - object: - const: list - default: list - title: Object - type: string - required: - - data - - has_more - - first_id - - last_id - title: ListOpenAIChatCompletionResponse - type: object - Annotated: - type: object - ? >- - llama_stack.apis.inference.inference.OpenAIChatCompletion | collections.abc.AsyncIterator[llama_stack.apis.inference.inference.OpenAIChatCompletionChunk] - : type: object - OpenAICompletionWithInputMessages: - $defs: - OpenAIAssistantMessageParam: - description: >- - A message containing the model's (assistant) response in an OpenAI-compatible - chat completion request. - - - :param role: Must be "assistant" to identify this as the model's response - - :param content: The content of the model's response - - :param name: (Optional) The name of the assistant message participant. - - :param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall - object. - properties: - role: - const: assistant - default: assistant - title: Role - type: string - content: - anyOf: - - type: string - - items: - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - type: array - - type: 'null' - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - tool_calls: - anyOf: - - items: - $ref: '#/$defs/OpenAIChatCompletionToolCall' - type: array - - type: 'null' - title: Tool Calls - title: OpenAIAssistantMessageParam - type: object - "OpenAIChatCompletionContentPartImageParam": - description: >- - Image content part for OpenAI-compatible chat completion messages. - - - :param type: Must be "image_url" to identify this as image content - - :param image_url: Image URL specification and processing details - properties: - type: - const: image_url - default: image_url - title: Type - type: string - image_url: - $ref: '#/$defs/OpenAIImageURL' - required: - - image_url - title: >- - OpenAIChatCompletionContentPartImageParam - type: object - OpenAIChatCompletionContentPartTextParam: - description: >- - Text content part for OpenAI-compatible chat completion messages. - - - :param type: Must be "text" to identify this as text content - - :param text: The text content of the message - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: OpenAIChatCompletionContentPartTextParam - type: object - OpenAIChatCompletionToolCall: - description: >- - Tool call specification for OpenAI-compatible chat completion responses. - - - :param index: (Optional) Index of the tool call in the list - - :param id: (Optional) Unique identifier for the tool call - - :param type: Must be "function" to identify this as a function call - - :param function: (Optional) Function call details - properties: - index: - anyOf: - - type: integer - - type: 'null' - title: Index - id: - anyOf: - - type: string - - type: 'null' - title: Id - type: - const: function - default: function - title: Type - type: string - function: - anyOf: - - $ref: >- - #/$defs/OpenAIChatCompletionToolCallFunction - - type: 'null' - title: OpenAIChatCompletionToolCall - type: object - OpenAIChatCompletionToolCallFunction: - description: >- - Function call details for OpenAI-compatible tool calls. - - - :param name: (Optional) Name of the function to call - - :param arguments: (Optional) Arguments to pass to the function as a JSON - string - properties: - name: - anyOf: - - type: string - - type: 'null' - title: Name - arguments: - anyOf: - - type: string - - type: 'null' - title: Arguments - title: OpenAIChatCompletionToolCallFunction - type: object - OpenAIChatCompletionUsage: - description: >- - Usage information for OpenAI chat completion. - - - :param prompt_tokens: Number of tokens in the prompt - - :param completion_tokens: Number of tokens in the completion - - :param total_tokens: Total tokens used (prompt + completion) - - :param input_tokens_details: Detailed breakdown of input token usage - - :param output_tokens_details: Detailed breakdown of output token usage - properties: - prompt_tokens: - title: Prompt Tokens - type: integer - completion_tokens: - title: Completion Tokens - type: integer - total_tokens: - title: Total Tokens - type: integer - prompt_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIChatCompletionUsagePromptTokensDetails - - type: 'null' - completion_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIChatCompletionUsageCompletionTokensDetails - - type: 'null' - required: - - prompt_tokens - - completion_tokens - - total_tokens - title: OpenAIChatCompletionUsage - type: object - "OpenAIChatCompletionUsageCompletionTokensDetails": - description: >- - Token details for output tokens in OpenAI chat completion usage. - - - :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) - properties: - reasoning_tokens: - anyOf: - - type: integer - - type: 'null' - title: Reasoning Tokens - title: >- - OpenAIChatCompletionUsageCompletionTokensDetails - type: object - "OpenAIChatCompletionUsagePromptTokensDetails": - description: >- - Token details for prompt tokens in OpenAI chat completion usage. - - - :param cached_tokens: Number of tokens retrieved from cache - properties: - cached_tokens: - anyOf: - - type: integer - - type: 'null' - title: Cached Tokens - title: >- - OpenAIChatCompletionUsagePromptTokensDetails - type: object - OpenAIChoice: - description: >- - A choice from an OpenAI-compatible chat completion response. - - - :param message: The message from the model - - :param finish_reason: The reason the model stopped generating - - :param index: The index of the choice - - :param logprobs: (Optional) The log probabilities for the tokens in the - message - properties: - message: - discriminator: - mapping: - assistant: '#/$defs/OpenAIAssistantMessageParam' - developer: '#/$defs/OpenAIDeveloperMessageParam' - system: '#/$defs/OpenAISystemMessageParam' - tool: '#/$defs/OpenAIToolMessageParam' - user: '#/$defs/OpenAIUserMessageParam' - propertyName: role - oneOf: - - $ref: '#/$defs/OpenAIUserMessageParam' - - $ref: '#/$defs/OpenAISystemMessageParam' - - $ref: '#/$defs/OpenAIAssistantMessageParam' - - $ref: '#/$defs/OpenAIToolMessageParam' - - $ref: '#/$defs/OpenAIDeveloperMessageParam' - title: Message - finish_reason: - title: Finish Reason - type: string - index: - title: Index - type: integer - logprobs: - anyOf: - - $ref: '#/$defs/OpenAIChoiceLogprobs' - - type: 'null' - required: - - message - - finish_reason - - index - title: OpenAIChoice - type: object - OpenAIChoiceLogprobs: - description: >- - The log probabilities for the tokens in the message from an OpenAI-compatible - chat completion response. - - - :param content: (Optional) The log probabilities for the tokens in the - message - - :param refusal: (Optional) The log probabilities for the tokens in the - message - properties: - content: - anyOf: - - items: - $ref: '#/$defs/OpenAITokenLogProb' - type: array - - type: 'null' - title: Content - refusal: - anyOf: - - items: - $ref: '#/$defs/OpenAITokenLogProb' - type: array - - type: 'null' - title: Refusal - title: OpenAIChoiceLogprobs - type: object - OpenAIDeveloperMessageParam: - description: >- - A message from the developer in an OpenAI-compatible chat completion request. - - - :param role: Must be "developer" to identify this as a developer message - - :param content: The content of the developer message - - :param name: (Optional) The name of the developer message participant. - properties: - role: - const: developer - default: developer - title: Role - type: string - content: - anyOf: - - type: string - - items: - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - type: array - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - required: - - content - title: OpenAIDeveloperMessageParam - type: object - OpenAIFile: - properties: - type: - const: file - default: file - title: Type - type: string - file: - $ref: '#/$defs/OpenAIFileFile' - required: - - file - title: OpenAIFile - type: object - OpenAIFileFile: - properties: - file_data: - anyOf: - - type: string - - type: 'null' - title: File Data - file_id: - anyOf: - - type: string - - type: 'null' - title: File Id - filename: - anyOf: - - type: string - - type: 'null' - title: Filename - title: OpenAIFileFile - type: object - OpenAIImageURL: - description: >- - Image URL specification for OpenAI-compatible chat completion messages. - - - :param url: URL of the image to include in the message - - :param detail: (Optional) Level of detail for image processing. Can be - "low", "high", or "auto" - properties: - url: - title: Url - type: string - detail: - anyOf: - - type: string - - type: 'null' - title: Detail - required: - - url - title: OpenAIImageURL - type: object - OpenAISystemMessageParam: - description: >- - A system message providing instructions or context to the model. - - - :param role: Must be "system" to identify this as a system message - - :param content: The content of the "system prompt". If multiple system - messages are provided, they are concatenated. The underlying Llama Stack - code may also add other system messages (for example, for formatting tool - definitions). - - :param name: (Optional) The name of the system message participant. - properties: - role: - const: system - default: system - title: Role - type: string - content: - anyOf: - - type: string - - items: - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - type: array - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - required: - - content - title: OpenAISystemMessageParam - type: object - OpenAITokenLogProb: - description: >- - The log probability for a token from an OpenAI-compatible chat completion - response. - - - :token: The token - - :bytes: (Optional) The bytes for the token - - :logprob: The log probability of the token - - :top_logprobs: The top log probabilities for the token - properties: - token: - title: Token - type: string - bytes: - anyOf: - - items: - type: integer - type: array - - type: 'null' - title: Bytes - logprob: - title: Logprob - type: number - top_logprobs: - items: - $ref: '#/$defs/OpenAITopLogProb' - title: Top Logprobs - type: array - required: - - token - - logprob - - top_logprobs - title: OpenAITokenLogProb - type: object - OpenAIToolMessageParam: - description: >- - A message representing the result of a tool invocation in an OpenAI-compatible - chat completion request. - - - :param role: Must be "tool" to identify this as a tool response - - :param tool_call_id: Unique identifier for the tool call this response - is for - - :param content: The response content from the tool - properties: - role: - const: tool - default: tool - title: Role - type: string - tool_call_id: - title: Tool Call Id - type: string - content: - anyOf: - - type: string - - items: - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - type: array - title: Content - required: - - tool_call_id - - content - title: OpenAIToolMessageParam - type: object - OpenAITopLogProb: - description: >- - The top log probability for a token from an OpenAI-compatible chat completion - response. - - - :token: The token - - :bytes: (Optional) The bytes for the token - - :logprob: The log probability of the token - properties: - token: - title: Token - type: string - bytes: - anyOf: - - items: - type: integer - type: array - - type: 'null' - title: Bytes - logprob: - title: Logprob - type: number - required: - - token - - logprob - title: OpenAITopLogProb - type: object - OpenAIUserMessageParam: - description: >- - A message from the user in an OpenAI-compatible chat completion request. - - - :param role: Must be "user" to identify this as a user message - - :param content: The content of the message, which can include text and - other media - - :param name: (Optional) The name of the user message participant. - properties: - role: - const: user - default: user - title: Role - type: string - content: - anyOf: - - type: string - - items: - discriminator: - mapping: - file: '#/$defs/OpenAIFile' - image_url: >- - #/$defs/OpenAIChatCompletionContentPartImageParam - text: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIChatCompletionContentPartTextParam - - $ref: >- - #/$defs/OpenAIChatCompletionContentPartImageParam - - $ref: '#/$defs/OpenAIFile' - type: array - title: Content - name: - anyOf: - - type: string - - type: 'null' - title: Name - required: - - content - title: OpenAIUserMessageParam - type: object - properties: - id: - title: Id - type: string - choices: - items: - $ref: '#/$defs/OpenAIChoice' - title: Choices - type: array - object: - const: chat.completion - default: chat.completion - title: Object - type: string - created: - title: Created - type: integer - model: - title: Model - type: string - usage: - anyOf: - - $ref: '#/$defs/OpenAIChatCompletionUsage' - - type: 'null' - input_messages: - items: - discriminator: - mapping: - assistant: '#/$defs/OpenAIAssistantMessageParam' - developer: '#/$defs/OpenAIDeveloperMessageParam' - system: '#/$defs/OpenAISystemMessageParam' - tool: '#/$defs/OpenAIToolMessageParam' - user: '#/$defs/OpenAIUserMessageParam' - propertyName: role - oneOf: - - $ref: '#/$defs/OpenAIUserMessageParam' - - $ref: '#/$defs/OpenAISystemMessageParam' - - $ref: '#/$defs/OpenAIAssistantMessageParam' - - $ref: '#/$defs/OpenAIToolMessageParam' - - $ref: '#/$defs/OpenAIDeveloperMessageParam' - title: Input Messages - type: array - required: - - id - - choices - - created - - model - - input_messages - title: OpenAICompletionWithInputMessages - type: object - OpenAICompletion: - $defs: - OpenAIChoiceLogprobs: - description: >- - The log probabilities for the tokens in the message from an OpenAI-compatible - chat completion response. - - - :param content: (Optional) The log probabilities for the tokens in the - message - - :param refusal: (Optional) The log probabilities for the tokens in the - message - properties: - content: - anyOf: - - items: - $ref: '#/$defs/OpenAITokenLogProb' - type: array - - type: 'null' - title: Content - refusal: - anyOf: - - items: - $ref: '#/$defs/OpenAITokenLogProb' - type: array - - type: 'null' - title: Refusal - title: OpenAIChoiceLogprobs - type: object - OpenAICompletionChoice: - description: >- - A choice from an OpenAI-compatible completion response. - - - :finish_reason: The reason the model stopped generating - - :text: The text of the choice - - :index: The index of the choice - - :logprobs: (Optional) The log probabilities for the tokens in the choice - properties: - finish_reason: - title: Finish Reason - type: string - text: - title: Text - type: string - index: - title: Index - type: integer - logprobs: - anyOf: - - $ref: '#/$defs/OpenAIChoiceLogprobs' - - type: 'null' - required: - - finish_reason - - text - - index - title: OpenAICompletionChoice - type: object - OpenAITokenLogProb: - description: >- - The log probability for a token from an OpenAI-compatible chat completion - response. - - - :token: The token - - :bytes: (Optional) The bytes for the token - - :logprob: The log probability of the token - - :top_logprobs: The top log probabilities for the token - properties: - token: - title: Token - type: string - bytes: - anyOf: - - items: - type: integer - type: array - - type: 'null' - title: Bytes - logprob: - title: Logprob - type: number - top_logprobs: - items: - $ref: '#/$defs/OpenAITopLogProb' - title: Top Logprobs - type: array - required: - - token - - logprob - - top_logprobs - title: OpenAITokenLogProb - type: object - OpenAITopLogProb: - description: >- - The top log probability for a token from an OpenAI-compatible chat completion - response. - - - :token: The token - - :bytes: (Optional) The bytes for the token - - :logprob: The log probability of the token - properties: - token: - title: Token - type: string - bytes: - anyOf: - - items: - type: integer - type: array - - type: 'null' - title: Bytes - logprob: - title: Logprob - type: number - required: - - token - - logprob - title: OpenAITopLogProb - type: object - description: >- - Response from an OpenAI-compatible completion request. - - - :id: The ID of the completion - - :choices: List of choices - - :created: The Unix timestamp in seconds when the completion was created - - :model: The model that was used to generate the completion - - :object: The object type, which will be "text_completion" - properties: - id: - title: Id - type: string - choices: - items: - $ref: '#/$defs/OpenAICompletionChoice' - title: Choices - type: array - created: - title: Created - type: integer - model: - title: Model - type: string - object: - const: text_completion - default: text_completion - title: Object - type: string - required: - - id - - choices - - created - - model - title: OpenAICompletion - type: object - properties: - finish_reason: - type: string - text: - type: string - index: - type: integer - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - additionalProperties: false - required: - - finish_reason - - text - - index - title: OpenAICompletionChoice - description: >- - A choice from an OpenAI-compatible completion response. - ConversationItem: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - OpenAIResponseAnnotationCitation: - type: object - properties: - type: - type: string - const: url_citation - default: url_citation - description: >- - Annotation type identifier, always "url_citation" - end_index: - type: integer - description: >- - End position of the citation span in the content - start_index: - type: integer - description: >- - Start position of the citation span in the content - title: - type: string - description: Title of the referenced web resource - url: - type: string - description: URL of the referenced web resource - additionalProperties: false - required: - - type - - end_index - - start_index - - title - - url - title: OpenAIResponseAnnotationCitation - description: >- - URL citation annotation for referencing external web resources. - "OpenAIResponseAnnotationContainerFileCitation": - type: object - properties: - type: - type: string - const: container_file_citation - default: container_file_citation - container_id: - type: string - end_index: - type: integer - file_id: - type: string - filename: - type: string - start_index: - type: integer - additionalProperties: false - required: - - type - - container_id - - end_index - - file_id - - filename - - start_index - title: >- - OpenAIResponseAnnotationContainerFileCitation - OpenAIResponseAnnotationFileCitation: - type: object - properties: - type: - type: string - const: file_citation - default: file_citation - description: >- - Annotation type identifier, always "file_citation" - file_id: - type: string - description: Unique identifier of the referenced file - filename: - type: string - description: Name of the referenced file - index: - type: integer - description: >- - Position index of the citation within the content - additionalProperties: false - required: - - type - - file_id - - filename - - index - title: OpenAIResponseAnnotationFileCitation - description: >- - File citation annotation for referencing specific files in response content. - OpenAIResponseAnnotationFilePath: - type: object - properties: - type: - type: string - const: file_path - default: file_path - file_id: - type: string - index: - type: integer - additionalProperties: false - required: - - type - - file_id - - index - title: OpenAIResponseAnnotationFilePath - OpenAIResponseAnnotations: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' - discriminator: - propertyName: type - mapping: - file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' - container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' - OpenAIResponseContentPartRefusal: - type: object - properties: - type: - type: string - const: refusal - default: refusal - description: >- - Content part type identifier, always "refusal" - refusal: - type: string - description: Refusal text supplied by the model - additionalProperties: false - required: - - type - - refusal - title: OpenAIResponseContentPartRefusal - description: >- - Refusal content within a streamed response part. - "OpenAIResponseInputFunctionToolCallOutput": - type: object - properties: - call_id: - type: string - output: - type: string - type: - type: string - const: function_call_output - default: function_call_output - id: - type: string - status: - type: string - additionalProperties: false - required: - - call_id - - output - - type - title: >- - OpenAIResponseInputFunctionToolCallOutput - description: >- - This represents the output of a function call that gets passed back to the - model. - OpenAIResponseInputMessageContent: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' - discriminator: - propertyName: type - mapping: - input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' - input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' - input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' - OpenAIResponseInputMessageContentFile: - type: object - properties: - type: - type: string - const: input_file - default: input_file - description: >- - The type of the input item. Always `input_file`. - file_data: - type: string - description: >- - The data of the file to be sent to the model. - file_id: - type: string - description: >- - (Optional) The ID of the file to be sent to the model. - file_url: - type: string - description: >- - The URL of the file to be sent to the model. - filename: - type: string - description: >- - The name of the file to be sent to the model. - additionalProperties: false - required: - - type - title: OpenAIResponseInputMessageContentFile - description: >- - File content for input messages in OpenAI response format. - OpenAIResponseInputMessageContentImage: - type: object - properties: - detail: - oneOf: - - type: string - const: low - - type: string - const: high - - type: string - const: auto - default: auto - description: >- - Level of detail for image processing, can be "low", "high", or "auto" - type: - type: string - const: input_image - default: input_image - description: >- - Content type identifier, always "input_image" - file_id: - type: string - description: >- - (Optional) The ID of the file to be sent to the model. - image_url: - type: string - description: (Optional) URL of the image content - additionalProperties: false - required: - - detail - - type - title: OpenAIResponseInputMessageContentImage - description: >- - Image content for input messages in OpenAI response format. - OpenAIResponseInputMessageContentText: - type: object - properties: - text: - type: string - description: The text content of the input message - type: - type: string - const: input_text - default: input_text - description: >- - Content type identifier, always "input_text" - additionalProperties: false - required: - - text - - type - title: OpenAIResponseInputMessageContentText - description: >- - Text content for input messages in OpenAI response format. - OpenAIResponseMCPApprovalRequest: - type: object - properties: - arguments: - type: string - id: - type: string - name: - type: string - server_label: - type: string - type: - type: string - const: mcp_approval_request - default: mcp_approval_request - additionalProperties: false - required: - - arguments - - id - - name - - server_label - - type - title: OpenAIResponseMCPApprovalRequest - description: >- - A request for human approval of a tool invocation. - OpenAIResponseMCPApprovalResponse: - type: object - properties: - approval_request_id: - type: string - approve: - type: boolean - type: - type: string - const: mcp_approval_response - default: mcp_approval_response - id: - type: string - reason: - type: string - additionalProperties: false - required: - - approval_request_id - - approve - - type - title: OpenAIResponseMCPApprovalResponse - description: A response to an MCP approval request. - OpenAIResponseMessage: - type: object - properties: - content: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInputMessageContent' - - type: array - items: - $ref: '#/components/schemas/OpenAIResponseOutputMessageContent' - role: - oneOf: - - type: string - const: system - - type: string - const: developer - - type: string - const: user - - type: string - const: assistant - type: - type: string - const: message - default: message - id: - type: string - status: - type: string - additionalProperties: false - required: - - content - - role - - type - title: OpenAIResponseMessage - description: >- - Corresponds to the various Message types in the Responses API. They are all - under one type because the Responses API gives them all the same "type" value, - and there is no way to tell them apart in certain scenarios. - OpenAIResponseOutputMessageContent: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' - discriminator: - propertyName: type - mapping: - output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' - "OpenAIResponseOutputMessageContentOutputText": - type: object - properties: - text: - type: string - type: - type: string - const: output_text - default: output_text - annotations: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseAnnotations' - additionalProperties: false - required: - - text - - type - - annotations - title: >- - OpenAIResponseOutputMessageContentOutputText - "OpenAIResponseOutputMessageFileSearchToolCall": - type: object - properties: - id: - type: string - description: Unique identifier for this tool call - queries: - type: array - items: - type: string - description: List of search queries executed - status: - type: string - description: >- - Current status of the file search operation - type: - type: string - const: file_search_call - default: file_search_call - description: >- - Tool call type identifier, always "file_search_call" - results: - type: array - items: - type: object - properties: - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Key-value attributes associated with the file - file_id: - type: string - description: >- - Unique identifier of the file containing the result - filename: - type: string - description: Name of the file containing the result - score: - type: number - description: >- - Relevance score for this search result (between 0 and 1) - text: - type: string - description: Text content of the search result - additionalProperties: false - required: - - attributes - - file_id - - filename - - score - - text - title: >- - OpenAIResponseOutputMessageFileSearchToolCallResults - description: >- - Search results returned by the file search operation. - description: >- - (Optional) Search results returned by the file search operation - additionalProperties: false - required: - - id - - queries - - status - - type - title: >- - OpenAIResponseOutputMessageFileSearchToolCall - description: >- - File search tool call output message for OpenAI responses. - "OpenAIResponseOutputMessageFunctionToolCall": - type: object - properties: - call_id: - type: string - description: Unique identifier for the function call - name: - type: string - description: Name of the function being called - arguments: - type: string - description: >- - JSON string containing the function arguments - type: - type: string - const: function_call - default: function_call - description: >- - Tool call type identifier, always "function_call" - id: - type: string - description: >- - (Optional) Additional identifier for the tool call - status: - type: string - description: >- - (Optional) Current status of the function call execution - additionalProperties: false - required: - - call_id - - name - - arguments - - type - title: >- - OpenAIResponseOutputMessageFunctionToolCall - description: >- - Function tool call output message for OpenAI responses. - OpenAIResponseOutputMessageMCPCall: - type: object - properties: - id: - type: string - description: Unique identifier for this MCP call - type: - type: string - const: mcp_call - default: mcp_call - description: >- - Tool call type identifier, always "mcp_call" - arguments: - type: string - description: >- - JSON string containing the MCP call arguments - name: - type: string - description: Name of the MCP method being called - server_label: - type: string - description: >- - Label identifying the MCP server handling the call - error: - type: string - description: >- - (Optional) Error message if the MCP call failed - output: - type: string - description: >- - (Optional) Output result from the successful MCP call - additionalProperties: false - required: - - id - - type - - arguments - - name - - server_label - title: OpenAIResponseOutputMessageMCPCall - description: >- - Model Context Protocol (MCP) call output message for OpenAI responses. - OpenAIResponseOutputMessageMCPListTools: - type: object - properties: - id: - type: string - description: >- - Unique identifier for this MCP list tools operation - type: - type: string - const: mcp_list_tools - default: mcp_list_tools - description: >- - Tool call type identifier, always "mcp_list_tools" - server_label: - type: string - description: >- - Label identifying the MCP server providing the tools - tools: - type: array - items: - type: object - properties: - input_schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - JSON schema defining the tool's input parameters - name: - type: string - description: Name of the tool - description: - type: string - description: >- - (Optional) Description of what the tool does - additionalProperties: false - required: - - input_schema - - name - title: MCPListToolsTool - description: >- - Tool definition returned by MCP list tools operation. - description: >- - List of available tools provided by the MCP server - additionalProperties: false - required: - - id - - type - - server_label - - tools - title: OpenAIResponseOutputMessageMCPListTools - description: >- - MCP list tools output message containing available tools from an MCP server. - "OpenAIResponseOutputMessageWebSearchToolCall": - type: object - properties: - id: - type: string - description: Unique identifier for this tool call - status: - type: string - description: >- - Current status of the web search operation - type: - type: string - const: web_search_call - default: web_search_call - description: >- - Tool call type identifier, always "web_search_call" - additionalProperties: false - required: - - id - - status - - type - title: >- - OpenAIResponseOutputMessageWebSearchToolCall - description: >- - Web search tool call output message for OpenAI responses. - CreateConversationRequest: - type: object - Conversation: - description: OpenAI-compatible conversation object. - properties: - id: - description: The unique ID of the conversation. - title: Id - type: string - object: - const: conversation - default: conversation - description: >- - The object type, which is always conversation. - title: Object - type: string - created_at: - description: >- - The time at which the conversation was created, measured in seconds since - the Unix epoch. - title: Created At - type: integer - metadata: - anyOf: - - additionalProperties: - type: string - type: object - - type: 'null' - description: >- - Set of 16 key-value pairs that can be attached to an object. This can - be useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - title: Metadata - items: - anyOf: - - items: - additionalProperties: true - type: object - type: array - - type: 'null' - description: >- - Initial items to include in the conversation context. You may add up to - 20 items at a time. - title: Items - required: - - id - - created_at - title: Conversation - type: object - UpdateConversationRequest: - type: object - ConversationDeletedResource: - description: Response for deleted conversation. - properties: - id: - description: The deleted conversation identifier - title: Id - type: string - object: - default: conversation.deleted - description: Object type - title: Object - type: string - deleted: - default: true - description: Whether the object was deleted - title: Deleted - type: boolean - required: - - id - title: ConversationDeletedResource - type: object - list: - type: object - Literal: - type: object - ConversationItemList: - $defs: - MCPListToolsTool: - description: >- - Tool definition returned by MCP list tools operation. - - - :param input_schema: JSON schema defining the tool's input parameters - - :param name: Name of the tool - - :param description: (Optional) Description of what the tool does - properties: - input_schema: - additionalProperties: true - title: Input Schema - type: object - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - required: - - input_schema - - name - title: MCPListToolsTool - type: object - OpenAIResponseAnnotationCitation: - description: >- - URL citation annotation for referencing external web resources. - - - :param type: Annotation type identifier, always "url_citation" - - :param end_index: End position of the citation span in the content - - :param start_index: Start position of the citation span in the content - - :param title: Title of the referenced web resource - - :param url: URL of the referenced web resource - properties: - type: - const: url_citation - default: url_citation - title: Type - type: string - end_index: - title: End Index - type: integer - start_index: - title: Start Index - type: integer - title: - title: Title - type: string - url: - title: Url - type: string - required: - - end_index - - start_index - - title - - url - title: OpenAIResponseAnnotationCitation - type: object - "OpenAIResponseAnnotationContainerFileCitation": - properties: - type: - const: container_file_citation - default: container_file_citation - title: Type - type: string - container_id: - title: Container Id - type: string - end_index: - title: End Index - type: integer - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - start_index: - title: Start Index - type: integer - required: - - container_id - - end_index - - file_id - - filename - - start_index - title: >- - OpenAIResponseAnnotationContainerFileCitation - type: object - OpenAIResponseAnnotationFileCitation: - description: >- - File citation annotation for referencing specific files in response content. - - - :param type: Annotation type identifier, always "file_citation" - - :param file_id: Unique identifier of the referenced file - - :param filename: Name of the referenced file - - :param index: Position index of the citation within the content - properties: - type: - const: file_citation - default: file_citation - title: Type - type: string - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - index: - title: Index - type: integer - required: - - file_id - - filename - - index - title: OpenAIResponseAnnotationFileCitation - type: object - OpenAIResponseAnnotationFilePath: - properties: - type: - const: file_path - default: file_path - title: Type - type: string - file_id: - title: File Id - type: string - index: - title: Index - type: integer - required: - - file_id - - index - title: OpenAIResponseAnnotationFilePath - type: object - OpenAIResponseContentPartRefusal: - description: >- - Refusal content within a streamed response part. - - - :param type: Content part type identifier, always "refusal" - - :param refusal: Refusal text supplied by the model - properties: - type: - const: refusal - default: refusal - title: Type - type: string - refusal: - title: Refusal - type: string - required: - - refusal - title: OpenAIResponseContentPartRefusal - type: object - "OpenAIResponseInputFunctionToolCallOutput": - description: >- - This represents the output of a function call that gets passed back to - the model. - properties: - call_id: - title: Call Id - type: string - output: - title: Output - type: string - type: - const: function_call_output - default: function_call_output - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - output - title: >- - OpenAIResponseInputFunctionToolCallOutput - type: object - OpenAIResponseInputMessageContentImage: - description: >- - Image content for input messages in OpenAI response format. - - - :param detail: Level of detail for image processing, can be "low", "high", - or "auto" - - :param type: Content type identifier, always "input_image" - - :param image_url: (Optional) URL of the image content - properties: - detail: - anyOf: - - const: low - type: string - - const: high - type: string - - const: auto - type: string - default: auto - title: Detail - type: - const: input_image - default: input_image - title: Type - type: string - image_url: - anyOf: - - type: string - - type: 'null' - title: Image Url - title: OpenAIResponseInputMessageContentImage - type: object - OpenAIResponseInputMessageContentText: - description: >- - Text content for input messages in OpenAI response format. - - - :param text: The text content of the input message - - :param type: Content type identifier, always "input_text" - properties: - text: - title: Text - type: string - type: - const: input_text - default: input_text - title: Type - type: string - required: - - text - title: OpenAIResponseInputMessageContentText - type: object - OpenAIResponseMCPApprovalRequest: - description: >- - A request for human approval of a tool invocation. - properties: - arguments: - title: Arguments - type: string - id: - title: Id - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - type: - const: mcp_approval_request - default: mcp_approval_request - title: Type - type: string - required: - - arguments - - id - - name - - server_label - title: OpenAIResponseMCPApprovalRequest - type: object - OpenAIResponseMCPApprovalResponse: - description: A response to an MCP approval request. - properties: - approval_request_id: - title: Approval Request Id - type: string - approve: - title: Approve - type: boolean - type: - const: mcp_approval_response - default: mcp_approval_response - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - reason: - anyOf: - - type: string - - type: 'null' - title: Reason - required: - - approval_request_id - - approve - title: OpenAIResponseMCPApprovalResponse - type: object - OpenAIResponseMessage: - description: >- - Corresponds to the various Message types in the Responses API. - - They are all under one type because the Responses API gives them all - - the same "type" value, and there is no way to tell them apart in certain - - scenarios. - properties: - content: - anyOf: - - type: string - - items: - discriminator: - mapping: - input_image: >- - #/$defs/OpenAIResponseInputMessageContentImage - input_text: >- - #/$defs/OpenAIResponseInputMessageContentText - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentText - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentImage - type: array - - items: - discriminator: - mapping: - output_text: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - refusal: '#/$defs/OpenAIResponseContentPartRefusal' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - - $ref: '#/$defs/OpenAIResponseContentPartRefusal' - type: array - title: Content - role: - anyOf: - - const: system - type: string - - const: developer - type: string - - const: user - type: string - - const: assistant - type: string - title: Role - type: - const: message - default: message - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - content - - role - title: OpenAIResponseMessage - type: object - "OpenAIResponseOutputMessageContentOutputText": - properties: - text: - title: Text - type: string - type: - const: output_text - default: output_text - title: Type - type: string - annotations: - items: - discriminator: - mapping: - container_file_citation: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - file_citation: >- - #/$defs/OpenAIResponseAnnotationFileCitation - file_path: '#/$defs/OpenAIResponseAnnotationFilePath' - url_citation: '#/$defs/OpenAIResponseAnnotationCitation' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseAnnotationFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationCitation' - - $ref: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' - title: Annotations - type: array - required: - - text - title: >- - OpenAIResponseOutputMessageContentOutputText - type: object - "OpenAIResponseOutputMessageFileSearchToolCall": - description: >- - File search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param queries: List of search queries executed - - :param status: Current status of the file search operation - - :param type: Tool call type identifier, always "file_search_call" - - :param results: (Optional) Search results returned by the file search - operation - properties: - id: - title: Id - type: string - queries: - items: - type: string - title: Queries - type: array - status: - title: Status - type: string - type: - const: file_search_call - default: file_search_call - title: Type - type: string - results: - anyOf: - - items: - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults - type: array - - type: 'null' - title: Results - required: - - id - - queries - - status - title: >- - OpenAIResponseOutputMessageFileSearchToolCall - type: object - "OpenAIResponseOutputMessageFileSearchToolCallResults": - description: >- - Search results returned by the file search operation. - - - :param attributes: (Optional) Key-value attributes associated with the - file - - :param file_id: Unique identifier of the file containing the result - - :param filename: Name of the file containing the result - - :param score: Relevance score for this search result (between 0 and 1) - - :param text: Text content of the search result - properties: - attributes: - additionalProperties: true - title: Attributes - type: object - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - score: - title: Score - type: number - text: - title: Text - type: string - required: - - attributes - - file_id - - filename - - score - - text - title: >- - OpenAIResponseOutputMessageFileSearchToolCallResults - type: object - "OpenAIResponseOutputMessageFunctionToolCall": - description: >- - Function tool call output message for OpenAI responses. - - - :param call_id: Unique identifier for the function call - - :param name: Name of the function being called - - :param arguments: JSON string containing the function arguments - - :param type: Tool call type identifier, always "function_call" - - :param id: (Optional) Additional identifier for the tool call - - :param status: (Optional) Current status of the function call execution - properties: - call_id: - title: Call Id - type: string - name: - title: Name - type: string - arguments: - title: Arguments - type: string - type: - const: function_call - default: function_call - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - name - - arguments - title: >- - OpenAIResponseOutputMessageFunctionToolCall - type: object - OpenAIResponseOutputMessageMCPCall: - description: >- - Model Context Protocol (MCP) call output message for OpenAI responses. - - - :param id: Unique identifier for this MCP call - - :param type: Tool call type identifier, always "mcp_call" - - :param arguments: JSON string containing the MCP call arguments - - :param name: Name of the MCP method being called - - :param server_label: Label identifying the MCP server handling the call - - :param error: (Optional) Error message if the MCP call failed - - :param output: (Optional) Output result from the successful MCP call - properties: - id: - title: Id - type: string - type: - const: mcp_call - default: mcp_call - title: Type - type: string - arguments: - title: Arguments - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - error: - anyOf: - - type: string - - type: 'null' - title: Error - output: - anyOf: - - type: string - - type: 'null' - title: Output - required: - - id - - arguments - - name - - server_label - title: OpenAIResponseOutputMessageMCPCall - type: object - OpenAIResponseOutputMessageMCPListTools: - description: >- - MCP list tools output message containing available tools from an MCP server. - - - :param id: Unique identifier for this MCP list tools operation - - :param type: Tool call type identifier, always "mcp_list_tools" - - :param server_label: Label identifying the MCP server providing the tools - - :param tools: List of available tools provided by the MCP server - properties: - id: - title: Id - type: string - type: - const: mcp_list_tools - default: mcp_list_tools - title: Type - type: string - server_label: - title: Server Label - type: string - tools: - items: - $ref: '#/$defs/MCPListToolsTool' - title: Tools - type: array - required: - - id - - server_label - - tools - title: OpenAIResponseOutputMessageMCPListTools - type: object - "OpenAIResponseOutputMessageWebSearchToolCall": - description: >- - Web search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param status: Current status of the web search operation - - :param type: Tool call type identifier, always "web_search_call" - properties: - id: - title: Id - type: string - status: - title: Status - type: string - type: - const: web_search_call - default: web_search_call - title: Type - type: string - required: - - id - - status - title: >- - OpenAIResponseOutputMessageWebSearchToolCall - type: object - description: >- - List of conversation items with pagination. - properties: - object: - default: list - description: Object type - title: Object - type: string - data: - description: List of conversation items - items: - discriminator: - mapping: - file_search_call: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - function_call: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - function_call_output: >- - #/$defs/OpenAIResponseInputFunctionToolCallOutput - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_approval_response: >- - #/$defs/OpenAIResponseMCPApprovalResponse - mcp_call: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - mcp_list_tools: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - message: '#/$defs/OpenAIResponseMessage' - web_search_call: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseMessage' - - $ref: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - - $ref: >- - #/$defs/OpenAIResponseInputFunctionToolCallOutput - - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' - - $ref: >- - #/$defs/OpenAIResponseMCPApprovalResponse - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - title: Data - type: array - first_id: - anyOf: - - type: string - - type: 'null' - description: The ID of the first item in the list - title: First Id - last_id: - anyOf: - - type: string - - type: 'null' - description: The ID of the last item in the list - title: Last Id - has_more: - default: false - description: Whether there are more items available - title: Has More - type: boolean - required: - - data - title: ConversationItemList - type: object - AddItemsRequest: - type: object - ConversationItemDeletedResource: - description: Response for deleted conversation item. - properties: - id: - description: The deleted item identifier - title: Id - type: string - object: - default: conversation.item.deleted - description: Object type - title: Object - type: string - deleted: - default: true - description: Whether the object was deleted - title: Deleted - type: boolean - required: - - id - title: ConversationItemDeletedResource - type: object - OpenAIEmbeddingsResponse: - $defs: - OpenAIEmbeddingData: - description: >- - A single embedding data object from an OpenAI-compatible embeddings response. - - - :param object: The object type, which will be "embedding" - - :param embedding: The embedding vector as a list of floats (when encoding_format="float") - or as a base64-encoded string (when encoding_format="base64") - - :param index: The index of the embedding in the input list - properties: - object: - const: embedding - default: embedding - title: Object - type: string - embedding: - anyOf: - - items: - type: number - type: array - - type: string - title: Embedding - index: - title: Index - type: integer - required: - - embedding - - index - title: OpenAIEmbeddingData - type: object - OpenAIEmbeddingUsage: - description: >- - Usage information for an OpenAI-compatible embeddings response. - - - :param prompt_tokens: The number of tokens in the input - - :param total_tokens: The total number of tokens used - properties: - prompt_tokens: - title: Prompt Tokens - type: integer - total_tokens: - title: Total Tokens - type: integer - required: - - prompt_tokens - - total_tokens - title: OpenAIEmbeddingUsage - type: object - description: >- - Response from an OpenAI-compatible embeddings request. - - - :param object: The object type, which will be "list" - - :param data: List of embedding data objects - - :param model: The model that was used to generate the embeddings - - :param usage: Usage information - properties: - object: - const: list - default: list - title: Object - type: string - data: - items: - $ref: '#/$defs/OpenAIEmbeddingData' - title: Data - type: array - model: - title: Model - type: string - usage: - $ref: '#/$defs/OpenAIEmbeddingUsage' - required: - - data - - model - - usage - title: OpenAIEmbeddingsResponse - type: object - OpenAIFilePurpose: - type: object - ListOpenAIFileResponse: - $defs: - OpenAIFileObject: - description: >- - OpenAI File object as defined in the OpenAI Files API. - - - :param object: The object type, which is always "file" - - :param id: The file identifier, which can be referenced in the API endpoints - - :param bytes: The size of the file, in bytes - - :param created_at: The Unix timestamp (in seconds) for when the file was - created - - :param expires_at: The Unix timestamp (in seconds) for when the file expires - - :param filename: The name of the file - - :param purpose: The intended purpose of the file - properties: - object: - const: file - default: file - title: Object - type: string - id: - title: Id - type: string - bytes: - title: Bytes - type: integer - created_at: - title: Created At - type: integer - expires_at: - title: Expires At - type: integer - filename: - title: Filename - type: string - purpose: - $ref: '#/$defs/OpenAIFilePurpose' - required: - - id - - bytes - - created_at - - expires_at - - filename - - purpose - title: OpenAIFileObject - type: object - OpenAIFilePurpose: - description: >- - Valid purpose values for OpenAI Files API. - enum: - - assistants - - batch - title: OpenAIFilePurpose - type: string - description: >- - Response for listing files in OpenAI Files API. - - - :param data: List of file objects - - :param has_more: Whether there are more files available beyond this page - - :param first_id: ID of the first file in the list for pagination - - :param last_id: ID of the last file in the list for pagination - - :param object: The object type, which is always "list" - properties: - data: - items: - $ref: '#/$defs/OpenAIFileObject' - title: Data - type: array - has_more: - title: Has More - type: boolean - first_id: - title: First Id - type: string - last_id: - title: Last Id - type: string - object: - const: list - default: list - title: Object - type: string - required: - - data - - has_more - - first_id - - last_id - title: ListOpenAIFileResponse - type: object - ExpiresAfter: - description: >- - Control expiration of uploaded files. - - - Params: - - anchor, must be "created_at" - - seconds, must be int between 3600 and 2592000 (1 hour to 30 days) - properties: - anchor: - const: created_at - title: Anchor - type: string - seconds: - maximum: 2592000 - minimum: 3600 - title: Seconds - type: integer - required: - - anchor - - seconds - title: ExpiresAfter - type: object - OpenAIFileObject: - $defs: - OpenAIFilePurpose: - description: >- - Valid purpose values for OpenAI Files API. - enum: - - assistants - - batch - title: OpenAIFilePurpose - type: string - description: >- - OpenAI File object as defined in the OpenAI Files API. - - - :param object: The object type, which is always "file" - - :param id: The file identifier, which can be referenced in the API endpoints - - :param bytes: The size of the file, in bytes - - :param created_at: The Unix timestamp (in seconds) for when the file was created - - :param expires_at: The Unix timestamp (in seconds) for when the file expires - - :param filename: The name of the file - - :param purpose: The intended purpose of the file - properties: - object: - const: file - default: file - title: Object - type: string - id: - title: Id - type: string - bytes: - title: Bytes - type: integer - created_at: - title: Created At - type: integer - expires_at: - title: Expires At - type: integer - filename: - title: Filename - type: string - purpose: - $ref: '#/$defs/OpenAIFilePurpose' - required: - - id - - bytes - - created_at - - expires_at - - filename - - purpose - title: OpenAIFileObject - type: object - OpenAIFileDeleteResponse: - description: >- - Response for deleting a file in OpenAI Files API. - - - :param id: The file identifier that was deleted - - :param object: The object type, which is always "file" - - :param deleted: Whether the file was successfully deleted - properties: - id: - title: Id - type: string - object: - const: file - default: file - title: Object - type: string - deleted: - title: Deleted - type: boolean - required: - - id - - deleted - title: OpenAIFileDeleteResponse - type: object - Response: - type: object - HealthInfo: - $defs: - HealthStatus: - enum: - - OK - - Error - - Not Implemented - title: HealthStatus - type: string - description: >- - Health status information for the service. - - - :param status: Current health status of the service - properties: - status: - $ref: '#/$defs/HealthStatus' - required: - - status - title: HealthInfo - type: object - ListRoutesResponse: - $defs: - RouteInfo: - description: >- - Information about an API route including its path, method, and implementing - providers. - - - :param route: The API endpoint path - - :param method: HTTP method for the route - - :param provider_types: List of provider types that implement this route - properties: - route: - title: Route - type: string - method: - title: Method - type: string - provider_types: - items: - type: string - title: Provider Types - type: array - required: - - route - - method - - provider_types - title: RouteInfo - type: object - description: >- - Response containing a list of all available API routes. - - - :param data: List of available route information objects - properties: - data: - items: - $ref: '#/$defs/RouteInfo' - title: Data - type: array - required: - - data - title: ListRoutesResponse - description: >- - Response containing a list of all available API routes. - OpenAIModel: - type: object - properties: - id: - type: string - object: - type: string - const: model - default: model - created: - type: integer - owned_by: - type: string - custom_metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - additionalProperties: false - required: - - id - - object - - created - - owned_by - title: OpenAIModel - description: A model from OpenAI. - OpenAIListModelsResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAIModel' - additionalProperties: false - required: - - data - title: OpenAIListModelsResponse - ModelType: - type: string - enum: - - llm - - embedding - - rerank - title: ModelType - description: >- - Enumeration of supported model types in Llama Stack. - RegisterModelRequest: - type: object - properties: - model_id: - type: string - description: The identifier of the model to register. - provider_model_id: - type: string - description: >- - The identifier of the model in the provider. - provider_id: - type: string - description: The identifier of the provider. - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Any additional metadata for this model. - model_type: - $ref: '#/components/schemas/ModelType' - description: The type of model to register. - additionalProperties: false - required: - - model_id - title: RegisterModelRequest - Model: - type: object - properties: - identifier: - type: string - description: >- - Unique identifier for this resource in llama stack - provider_resource_id: - type: string - description: >- - Unique identifier for this resource in the provider - provider_id: - type: string - description: >- - ID of the provider that owns this resource - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: model - default: model - description: >- - The resource type, always 'model' for model resources - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Any additional metadata for this model - model_type: - $ref: '#/components/schemas/ModelType' - default: llm - description: >- - The type of model (LLM or embedding model) - additionalProperties: false - required: - - identifier - - provider_id - - type - - metadata - - model_type - title: Model - description: >- - A model resource representing an AI model registered in Llama Stack. - RunModerationRequest: - type: object - ModerationObject: - $defs: - ModerationObjectResults: - description: >- - A moderation object. - - :param flagged: Whether any of the below categories are flagged. - - :param categories: A list of the categories, and whether they are flagged - or not. - - :param category_applied_input_types: A list of the categories along with - the input type(s) that the score applies to. - - :param category_scores: A list of the categories along with their scores - as predicted by model. - properties: - flagged: - title: Flagged - type: boolean - categories: - anyOf: - - additionalProperties: - type: boolean - type: object - - type: 'null' - title: Categories - category_applied_input_types: - anyOf: - - additionalProperties: - items: - type: string - type: array - type: object - - type: 'null' - title: Category Applied Input Types - category_scores: - anyOf: - - additionalProperties: - type: number - type: object - - type: 'null' - title: Category Scores - user_message: - anyOf: - - type: string - - type: 'null' - title: User Message - metadata: - additionalProperties: true - title: Metadata - type: object - required: - - flagged - title: ModerationObjectResults - type: object - description: >- - A moderation object. - - :param id: The unique identifier for the moderation request. - - :param model: The model used to generate the moderation results. - - :param results: A list of moderation objects - properties: - id: - title: Id - type: string - model: - title: Model - type: string - results: - items: - $ref: '#/$defs/ModerationObjectResults' - title: Results - type: array - required: - - id - - model - - results - title: ModerationObject - type: object - ListPromptsResponse: - $defs: - Prompt: - description: >- - A prompt resource representing a stored OpenAI Compatible prompt template - in Llama Stack. - - - :param prompt: The system prompt text with variable placeholders. Variables - are only supported when using the Responses API. - - :param version: Version (integer starting at 1, incremented on save) - - :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' - - :param variables: List of prompt variable names that can be used in the - prompt template - - :param is_default: Boolean indicating whether this version is the default - version for this prompt - properties: - prompt: - anyOf: - - type: string - - type: 'null' - description: >- - The system prompt with variable placeholders - title: Prompt - version: - description: >- - Version (integer starting at 1, incremented on save) - minimum: 1 - title: Version - type: integer - prompt_id: - description: >- - Unique identifier in format 'pmpt_<48-digit-hash>' - title: Prompt Id - type: string - variables: - description: >- - List of variable names that can be used in the prompt template - items: - type: string - title: Variables - type: array - is_default: - default: false - description: >- - Boolean indicating whether this version is the default version - title: Is Default - type: boolean - required: - - version - - prompt_id - title: Prompt - type: object - description: Response model to list prompts. - properties: - data: - items: - $ref: '#/$defs/Prompt' - title: Data - type: array - required: - - data - title: ListPromptsResponse - type: object - CreatePromptRequest: - type: object - Prompt: - description: >- - A prompt resource representing a stored OpenAI Compatible prompt template - in Llama Stack. - - - :param prompt: The system prompt text with variable placeholders. Variables - are only supported when using the Responses API. - - :param version: Version (integer starting at 1, incremented on save) - - :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' - - :param variables: List of prompt variable names that can be used in the prompt - template - - :param is_default: Boolean indicating whether this version is the default - version for this prompt - properties: - prompt: - anyOf: - - type: string - - type: 'null' - description: >- - The system prompt with variable placeholders - title: Prompt - version: - description: >- - Version (integer starting at 1, incremented on save) - minimum: 1 - title: Version - type: integer - prompt_id: - description: >- - Unique identifier in format 'pmpt_<48-digit-hash>' - title: Prompt Id - type: string - variables: - description: >- - List of variable names that can be used in the prompt template - items: - type: string - title: Variables - type: array - is_default: - default: false - description: >- - Boolean indicating whether this version is the default version - title: Is Default - type: boolean - required: - - version - - prompt_id - title: Prompt - type: object - UpdatePromptRequest: - type: object - SetDefaultVersionRequest: - type: object - ListProvidersResponse: - $defs: - ProviderInfo: - description: >- - Information about a registered provider including its configuration and - health status. - - - :param api: The API name this provider implements - - :param provider_id: Unique identifier for the provider - - :param provider_type: The type of provider implementation - - :param config: Configuration parameters for the provider - - :param health: Current health status of the provider - properties: - api: - title: Api - type: string - provider_id: - title: Provider Id - type: string - provider_type: - title: Provider Type - type: string - config: - additionalProperties: true - title: Config - type: object - health: - additionalProperties: true - title: Health - type: object - required: - - api - - provider_id - - provider_type - - config - - health - title: ProviderInfo - type: object - description: >- - Response containing a list of all available providers. - - - :param data: List of provider information objects - properties: - data: - items: - $ref: '#/$defs/ProviderInfo' - title: Data - type: array - required: - - data - title: ListProvidersResponse - type: object - ProviderInfo: - description: >- - Information about a registered provider including its configuration and health - status. - - - :param api: The API name this provider implements - - :param provider_id: Unique identifier for the provider - - :param provider_type: The type of provider implementation - - :param config: Configuration parameters for the provider - - :param health: Current health status of the provider - properties: - api: - title: Api - type: string - provider_id: - title: Provider Id - type: string - provider_type: - title: Provider Type - type: string - config: - additionalProperties: true - title: Config - type: object - health: - additionalProperties: true - title: Health - type: object - required: - - api - - provider_id - - provider_type - - config - - health - title: ProviderInfo - type: object - ListOpenAIResponseObject: - $defs: - AllowedToolsFilter: - description: >- - Filter configuration for restricting which MCP tools can be used. - - - :param tool_names: (Optional) List of specific tool names that are allowed - properties: - tool_names: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Tool Names - title: AllowedToolsFilter - type: object - MCPListToolsTool: - description: >- - Tool definition returned by MCP list tools operation. - - - :param input_schema: JSON schema defining the tool's input parameters - - :param name: Name of the tool - - :param description: (Optional) Description of what the tool does - properties: - input_schema: - additionalProperties: true - title: Input Schema - type: object - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - required: - - input_schema - - name - title: MCPListToolsTool - type: object - OpenAIResponseAnnotationCitation: - description: >- - URL citation annotation for referencing external web resources. - - - :param type: Annotation type identifier, always "url_citation" - - :param end_index: End position of the citation span in the content - - :param start_index: Start position of the citation span in the content - - :param title: Title of the referenced web resource - - :param url: URL of the referenced web resource - properties: - type: - const: url_citation - default: url_citation - title: Type - type: string - end_index: - title: End Index - type: integer - start_index: - title: Start Index - type: integer - title: - title: Title - type: string - url: - title: Url - type: string - required: - - end_index - - start_index - - title - - url - title: OpenAIResponseAnnotationCitation - type: object - "OpenAIResponseAnnotationContainerFileCitation": - properties: - type: - const: container_file_citation - default: container_file_citation - title: Type - type: string - container_id: - title: Container Id - type: string - end_index: - title: End Index - type: integer - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - start_index: - title: Start Index - type: integer - required: - - container_id - - end_index - - file_id - - filename - - start_index - title: >- - OpenAIResponseAnnotationContainerFileCitation - type: object - OpenAIResponseAnnotationFileCitation: - description: >- - File citation annotation for referencing specific files in response content. - - - :param type: Annotation type identifier, always "file_citation" - - :param file_id: Unique identifier of the referenced file - - :param filename: Name of the referenced file - - :param index: Position index of the citation within the content - properties: - type: - const: file_citation - default: file_citation - title: Type - type: string - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - index: - title: Index - type: integer - required: - - file_id - - filename - - index - title: OpenAIResponseAnnotationFileCitation - type: object - OpenAIResponseAnnotationFilePath: - properties: - type: - const: file_path - default: file_path - title: Type - type: string - file_id: - title: File Id - type: string - index: - title: Index - type: integer - required: - - file_id - - index - title: OpenAIResponseAnnotationFilePath - type: object - OpenAIResponseContentPartRefusal: - description: >- - Refusal content within a streamed response part. - - - :param type: Content part type identifier, always "refusal" - - :param refusal: Refusal text supplied by the model - properties: - type: - const: refusal - default: refusal - title: Type - type: string - refusal: - title: Refusal - type: string - required: - - refusal - title: OpenAIResponseContentPartRefusal - type: object - OpenAIResponseError: - description: >- - Error details for failed OpenAI response requests. - - - :param code: Error code identifying the type of failure - - :param message: Human-readable error message describing the failure - properties: - code: - title: Code - type: string - message: - title: Message - type: string - required: - - code - - message - title: OpenAIResponseError - type: object - "OpenAIResponseInputFunctionToolCallOutput": - description: >- - This represents the output of a function call that gets passed back to - the model. - properties: - call_id: - title: Call Id - type: string - output: - title: Output - type: string - type: - const: function_call_output - default: function_call_output - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - output - title: >- - OpenAIResponseInputFunctionToolCallOutput - type: object - OpenAIResponseInputMessageContentImage: - description: >- - Image content for input messages in OpenAI response format. - - - :param detail: Level of detail for image processing, can be "low", "high", - or "auto" - - :param type: Content type identifier, always "input_image" - - :param image_url: (Optional) URL of the image content - properties: - detail: - anyOf: - - const: low - type: string - - const: high - type: string - - const: auto - type: string - default: auto - title: Detail - type: - const: input_image - default: input_image - title: Type - type: string - image_url: - anyOf: - - type: string - - type: 'null' - title: Image Url - title: OpenAIResponseInputMessageContentImage - type: object - OpenAIResponseInputMessageContentText: - description: >- - Text content for input messages in OpenAI response format. - - - :param text: The text content of the input message - - :param type: Content type identifier, always "input_text" - properties: - text: - title: Text - type: string - type: - const: input_text - default: input_text - title: Type - type: string - required: - - text - title: OpenAIResponseInputMessageContentText - type: object - OpenAIResponseInputToolFileSearch: - description: >- - File search tool configuration for OpenAI response inputs. - - - :param type: Tool type identifier, always "file_search" - - :param vector_store_ids: List of vector store identifiers to search within - - :param filters: (Optional) Additional filters to apply to the search - - :param max_num_results: (Optional) Maximum number of search results to - return (1-50) - - :param ranking_options: (Optional) Options for ranking and scoring search - results - properties: - type: - const: file_search - default: file_search - title: Type - type: string - vector_store_ids: - items: - type: string - title: Vector Store Ids - type: array - filters: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Filters - max_num_results: - anyOf: - - maximum: 50 - minimum: 1 - type: integer - - type: 'null' - default: 10 - title: Max Num Results - ranking_options: - anyOf: - - $ref: '#/$defs/SearchRankingOptions' - - type: 'null' - required: - - vector_store_ids - title: OpenAIResponseInputToolFileSearch - type: object - OpenAIResponseInputToolFunction: - description: >- - Function tool configuration for OpenAI response inputs. - - - :param type: Tool type identifier, always "function" - - :param name: Name of the function that can be called - - :param description: (Optional) Description of what the function does - - :param parameters: (Optional) JSON schema defining the function's parameters - - :param strict: (Optional) Whether to enforce strict parameter validation - properties: - type: - const: function - default: function - title: Type - type: string - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - parameters: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Parameters - strict: - anyOf: - - type: boolean - - type: 'null' - title: Strict - required: - - name - - parameters - title: OpenAIResponseInputToolFunction - type: object - OpenAIResponseInputToolWebSearch: - description: >- - Web search tool configuration for OpenAI response inputs. - - - :param type: Web search tool type variant to use - - :param search_context_size: (Optional) Size of search context, must be - "low", "medium", or "high" - properties: - type: - anyOf: - - const: web_search - type: string - - const: web_search_preview - type: string - - const: web_search_preview_2025_03_11 - type: string - default: web_search - title: Type - search_context_size: - anyOf: - - pattern: ^low|medium|high$ - type: string - - type: 'null' - default: medium - title: Search Context Size - title: OpenAIResponseInputToolWebSearch - type: object - OpenAIResponseMCPApprovalRequest: - description: >- - A request for human approval of a tool invocation. - properties: - arguments: - title: Arguments - type: string - id: - title: Id - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - type: - const: mcp_approval_request - default: mcp_approval_request - title: Type - type: string - required: - - arguments - - id - - name - - server_label - title: OpenAIResponseMCPApprovalRequest - type: object - OpenAIResponseMCPApprovalResponse: - description: A response to an MCP approval request. - properties: - approval_request_id: - title: Approval Request Id - type: string - approve: - title: Approve - type: boolean - type: - const: mcp_approval_response - default: mcp_approval_response - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - reason: - anyOf: - - type: string - - type: 'null' - title: Reason - required: - - approval_request_id - - approve - title: OpenAIResponseMCPApprovalResponse - type: object - OpenAIResponseMessage: - description: >- - Corresponds to the various Message types in the Responses API. - - They are all under one type because the Responses API gives them all - - the same "type" value, and there is no way to tell them apart in certain - - scenarios. - properties: - content: - anyOf: - - type: string - - items: - discriminator: - mapping: - input_image: >- - #/$defs/OpenAIResponseInputMessageContentImage - input_text: >- - #/$defs/OpenAIResponseInputMessageContentText - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentText - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentImage - type: array - - items: - discriminator: - mapping: - output_text: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - refusal: '#/$defs/OpenAIResponseContentPartRefusal' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - - $ref: '#/$defs/OpenAIResponseContentPartRefusal' - type: array - title: Content - role: - anyOf: - - const: system - type: string - - const: developer - type: string - - const: user - type: string - - const: assistant - type: string - title: Role - type: - const: message - default: message - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - content - - role - title: OpenAIResponseMessage - type: object - OpenAIResponseObjectWithInput: - description: >- - OpenAI response object extended with input context information. - - - :param input: List of input items that led to this response - properties: - created_at: - title: Created At - type: integer - error: - anyOf: - - $ref: '#/$defs/OpenAIResponseError' - - type: 'null' - id: - title: Id - type: string - model: - title: Model - type: string - object: - const: response - default: response - title: Object - type: string - output: - items: - discriminator: - mapping: - file_search_call: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - function_call: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - mcp_list_tools: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - message: '#/$defs/OpenAIResponseMessage' - web_search_call: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseMessage' - - $ref: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' - title: Output - type: array - parallel_tool_calls: - default: false - title: Parallel Tool Calls - type: boolean - previous_response_id: - anyOf: - - type: string - - type: 'null' - title: Previous Response Id - status: - title: Status - type: string - temperature: - anyOf: - - type: number - - type: 'null' - title: Temperature - text: - $ref: '#/$defs/OpenAIResponseText' - default: - format: - type: text - top_p: - anyOf: - - type: number - - type: 'null' - title: Top P - tools: - anyOf: - - items: - discriminator: - mapping: - file_search: >- - #/$defs/OpenAIResponseInputToolFileSearch - function: '#/$defs/OpenAIResponseInputToolFunction' - mcp: '#/$defs/OpenAIResponseToolMCP' - web_search: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseInputToolWebSearch' - - $ref: >- - #/$defs/OpenAIResponseInputToolFileSearch - - $ref: '#/$defs/OpenAIResponseInputToolFunction' - - $ref: '#/$defs/OpenAIResponseToolMCP' - type: array - - type: 'null' - title: Tools - truncation: - anyOf: - - type: string - - type: 'null' - title: Truncation - usage: - anyOf: - - $ref: '#/$defs/OpenAIResponseUsage' - - type: 'null' - instructions: - anyOf: - - type: string - - type: 'null' - title: Instructions - input: - items: - anyOf: - - discriminator: - mapping: - file_search_call: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - function_call: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - mcp_list_tools: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - message: '#/$defs/OpenAIResponseMessage' - web_search_call: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseMessage' - - $ref: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' - - $ref: >- - #/$defs/OpenAIResponseInputFunctionToolCallOutput - - $ref: >- - #/$defs/OpenAIResponseMCPApprovalResponse - - $ref: '#/$defs/OpenAIResponseMessage' - title: Input - type: array - required: - - created_at - - id - - model - - output - - status - - input - title: OpenAIResponseObjectWithInput - type: object - "OpenAIResponseOutputMessageContentOutputText": - properties: - text: - title: Text - type: string - type: - const: output_text - default: output_text - title: Type - type: string - annotations: - items: - discriminator: - mapping: - container_file_citation: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - file_citation: >- - #/$defs/OpenAIResponseAnnotationFileCitation - file_path: '#/$defs/OpenAIResponseAnnotationFilePath' - url_citation: '#/$defs/OpenAIResponseAnnotationCitation' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseAnnotationFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationCitation' - - $ref: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' - title: Annotations - type: array - required: - - text - title: >- - OpenAIResponseOutputMessageContentOutputText - type: object - "OpenAIResponseOutputMessageFileSearchToolCall": - description: >- - File search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param queries: List of search queries executed - - :param status: Current status of the file search operation - - :param type: Tool call type identifier, always "file_search_call" - - :param results: (Optional) Search results returned by the file search - operation - properties: - id: - title: Id - type: string - queries: - items: - type: string - title: Queries - type: array - status: - title: Status - type: string - type: - const: file_search_call - default: file_search_call - title: Type - type: string - results: - anyOf: - - items: - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults - type: array - - type: 'null' - title: Results - required: - - id - - queries - - status - title: >- - OpenAIResponseOutputMessageFileSearchToolCall - type: object - "OpenAIResponseOutputMessageFileSearchToolCallResults": - description: >- - Search results returned by the file search operation. - - - :param attributes: (Optional) Key-value attributes associated with the - file - - :param file_id: Unique identifier of the file containing the result - - :param filename: Name of the file containing the result - - :param score: Relevance score for this search result (between 0 and 1) - - :param text: Text content of the search result - properties: - attributes: - additionalProperties: true - title: Attributes - type: object - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - score: - title: Score - type: number - text: - title: Text - type: string - required: - - attributes - - file_id - - filename - - score - - text - title: >- - OpenAIResponseOutputMessageFileSearchToolCallResults - type: object - "OpenAIResponseOutputMessageFunctionToolCall": - description: >- - Function tool call output message for OpenAI responses. - - - :param call_id: Unique identifier for the function call - - :param name: Name of the function being called - - :param arguments: JSON string containing the function arguments - - :param type: Tool call type identifier, always "function_call" - - :param id: (Optional) Additional identifier for the tool call - - :param status: (Optional) Current status of the function call execution - properties: - call_id: - title: Call Id - type: string - name: - title: Name - type: string - arguments: - title: Arguments - type: string - type: - const: function_call - default: function_call - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - name - - arguments - title: >- - OpenAIResponseOutputMessageFunctionToolCall - type: object - OpenAIResponseOutputMessageMCPCall: - description: >- - Model Context Protocol (MCP) call output message for OpenAI responses. - - - :param id: Unique identifier for this MCP call - - :param type: Tool call type identifier, always "mcp_call" - - :param arguments: JSON string containing the MCP call arguments - - :param name: Name of the MCP method being called - - :param server_label: Label identifying the MCP server handling the call - - :param error: (Optional) Error message if the MCP call failed - - :param output: (Optional) Output result from the successful MCP call - properties: - id: - title: Id - type: string - type: - const: mcp_call - default: mcp_call - title: Type - type: string - arguments: - title: Arguments - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - error: - anyOf: - - type: string - - type: 'null' - title: Error - output: - anyOf: - - type: string - - type: 'null' - title: Output - required: - - id - - arguments - - name - - server_label - title: OpenAIResponseOutputMessageMCPCall - type: object - OpenAIResponseOutputMessageMCPListTools: - description: >- - MCP list tools output message containing available tools from an MCP server. - - - :param id: Unique identifier for this MCP list tools operation - - :param type: Tool call type identifier, always "mcp_list_tools" - - :param server_label: Label identifying the MCP server providing the tools - - :param tools: List of available tools provided by the MCP server - properties: - id: - title: Id - type: string - type: - const: mcp_list_tools - default: mcp_list_tools - title: Type - type: string - server_label: - title: Server Label - type: string - tools: - items: - $ref: '#/$defs/MCPListToolsTool' - title: Tools - type: array - required: - - id - - server_label - - tools - title: OpenAIResponseOutputMessageMCPListTools - type: object - "OpenAIResponseOutputMessageWebSearchToolCall": - description: >- - Web search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param status: Current status of the web search operation - - :param type: Tool call type identifier, always "web_search_call" - properties: - id: - title: Id - type: string - status: - title: Status - type: string - type: - const: web_search_call - default: web_search_call - title: Type - type: string - required: - - id - - status - title: >- - OpenAIResponseOutputMessageWebSearchToolCall - type: object - OpenAIResponseText: - description: >- - Text response configuration for OpenAI responses. - - - :param format: (Optional) Text format configuration specifying output - format requirements - properties: - format: - anyOf: - - $ref: '#/$defs/OpenAIResponseTextFormat' - - type: 'null' - title: OpenAIResponseText - type: object - OpenAIResponseTextFormat: - description: >- - Configuration for Responses API text format. - - - :param type: Must be "text", "json_schema", or "json_object" to identify - the format type - - :param name: The name of the response format. Only used for json_schema. - - :param schema: The JSON schema the response should conform to. In a Python - SDK, this is often a `pydantic` model. Only used for json_schema. - - :param description: (Optional) A description of the response format. Only - used for json_schema. - - :param strict: (Optional) Whether to strictly enforce the JSON schema. - If true, the response must match the schema exactly. Only used for json_schema. - properties: - type: - anyOf: - - const: text - type: string - - const: json_schema - type: string - - const: json_object - type: string - title: Type - name: - anyOf: - - type: string - - type: 'null' - title: Name + description: 'Path parameter: conversation_id' + /v1/conversations/{conversation_id}/items/{item_id}: + delete: + tags: + - V1 + summary: Openai Delete Conversation Item + description: Query endpoint for proper schema generation. + operationId: openai_delete_conversation_item_v1_conversations__conversation_id__items__item_id__delete + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id + - name: item_id + in: path + required: true + schema: + type: string + title: Item Id + responses: + '200': + description: The deleted item resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationItemDeletedResource' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Retrieve + description: Query endpoint for proper schema generation. + operationId: retrieve_v1_conversations__conversation_id__items__item_id__get + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id + - name: item_id + in: path + required: true + schema: + type: string + title: Item Id + responses: + '200': + description: The conversation item. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIResponseMessage' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/embeddings: + post: + tags: + - V1 + summary: Openai Embeddings + description: Typed endpoint for proper schema generation. + operationId: openai_embeddings_v1_embeddings_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody' + required: true + responses: + '200': + description: An OpenAIEmbeddingsResponse containing the embeddings. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIEmbeddingsResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/files: + get: + tags: + - V1 + summary: Openai List Files + description: Query endpoint for proper schema generation. + operationId: openai_list_files_v1_files_get + parameters: + - name: after + in: query + required: true + schema: + type: string + title: After + - name: purpose + in: query + required: true + schema: + $ref: '#/components/schemas/OpenAIFilePurpose' + - name: limit + in: query + required: false + schema: + type: integer + default: 10000 + title: Limit + - name: order + in: query + required: false + schema: + $ref: '#/components/schemas/Order' + default: desc + responses: + '200': + description: An ListOpenAIFileResponse containing the list of files. + content: + application/json: + schema: + $ref: '#/components/schemas/ListOpenAIFileResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Openai Upload File + description: Response-only endpoint for proper schema generation. + operationId: openai_upload_file_v1_files_post + responses: + '200': + description: An OpenAIFileObject representing the uploaded file. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIFileObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/files/{file_id}: + delete: + tags: + - V1 + summary: Openai Delete File + description: Query endpoint for proper schema generation. + operationId: openai_delete_file_v1_files__file_id__delete + parameters: + - name: file_id + in: path + required: true + schema: + type: string + title: File Id + responses: + '200': + description: An OpenAIFileDeleteResponse indicating successful deletion. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIFileDeleteResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Openai Retrieve File + description: Query endpoint for proper schema generation. + operationId: openai_retrieve_file_v1_files__file_id__get + parameters: + - name: file_id + in: path + required: true + schema: + type: string + title: File Id + responses: + '200': + description: An OpenAIFileObject containing file information. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIFileObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/files/{file_id}/content: + get: + tags: + - V1 + summary: Openai Retrieve File Content + description: Generic endpoint - this would be replaced with actual implementation. + operationId: openai_retrieve_file_content_v1_files__file_id__content_get + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: file_id + in: path + required: true + schema: + type: string + description: 'Path parameter: file_id' + responses: + '200': + description: The raw file content as a binary response. + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/health: + get: + tags: + - V1 + summary: Health + description: Response-only endpoint for proper schema generation. + operationId: health_v1_health_get + responses: + '200': + description: Health information indicating if the service is operational. + content: + application/json: + schema: + $ref: '#/components/schemas/HealthInfo' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/inspect/routes: + get: + tags: + - V1 + summary: List Routes + description: Response-only endpoint for proper schema generation. + operationId: list_routes_v1_inspect_routes_get + responses: + '200': + description: Response containing information about all available routes. + content: + application/json: + schema: + $ref: '#/components/schemas/ListRoutesResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/models: + get: + tags: + - V1 + summary: List Models + description: Response-only endpoint for proper schema generation. + operationId: list_models_v1_models_get + responses: + '200': + description: A ListModelsResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/ListModelsResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + post: + tags: + - V1 + summary: Register Model + description: Typed endpoint for proper schema generation. + operationId: register_model_v1_models_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_models_Request' + required: true + responses: + '200': + description: A Model. + content: + application/json: + schema: + $ref: '#/components/schemas/Model' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/models/{model_id}: + delete: + tags: + - V1 + summary: Unregister Model + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_model_v1_models__model_id__delete + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: model_id + in: path + required: true + schema: + type: string + description: 'Path parameter: model_id' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Get Model + description: Query endpoint for proper schema generation. + operationId: get_model_v1_models__model_id__get + parameters: + - name: model_id + in: path + required: true + schema: + type: string + title: Model Id + responses: + '200': + description: A Model. + content: + application/json: + schema: + $ref: '#/components/schemas/Model' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/moderations: + post: + tags: + - V1 + summary: Run Moderation + description: Typed endpoint for proper schema generation. + operationId: run_moderation_v1_moderations_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_moderations_Request' + required: true + responses: + '200': + description: A moderation object. + content: + application/json: + schema: + $ref: '#/components/schemas/ModerationObject' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/prompts: + get: + tags: + - V1 + summary: List Prompts + description: Response-only endpoint for proper schema generation. + operationId: list_prompts_v1_prompts_get + responses: + '200': + description: A ListPromptsResponse containing all prompts. + content: + application/json: + schema: + $ref: '#/components/schemas/ListPromptsResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + post: + tags: + - V1 + summary: Create Prompt + description: Typed endpoint for proper schema generation. + operationId: create_prompt_v1_prompts_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_prompts_Request' + required: true + responses: + '200': + description: The created Prompt resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Prompt' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/prompts/{prompt_id}: + delete: + tags: + - V1 + summary: Delete Prompt + description: Generic endpoint - this would be replaced with actual implementation. + operationId: delete_prompt_v1_prompts__prompt_id__delete + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - &id001 + name: prompt_id + in: path + required: true + schema: + type: string + description: 'Path parameter: prompt_id' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Get Prompt + description: Query endpoint for proper schema generation. + operationId: get_prompt_v1_prompts__prompt_id__get + parameters: + - name: prompt_id + in: path + required: true + schema: + type: string + title: Prompt Id + - name: version + in: query + required: true + schema: + type: integer + title: Version + responses: + '200': + description: A Prompt resource. + content: + application/json: + schema: + $ref: '#/components/schemas/Prompt' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Update Prompt + description: Typed endpoint for proper schema generation. + operationId: update_prompt_v1_prompts__prompt_id__post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/_prompts_prompt_id_Request' + responses: + '200': + description: The updated Prompt resource with incremented version. + content: + application/json: + schema: + $ref: '#/components/schemas/Prompt' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + parameters: + - *id001 + /v1/prompts/{prompt_id}/set-default-version: + post: + tags: + - V1 + summary: Set Default Version + description: Typed endpoint for proper schema generation. + operationId: set_default_version_v1_prompts__prompt_id__set_default_version_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_prompts_prompt_id_set_default_version_Request' + required: true + responses: + '200': + description: The prompt with the specified version now set as default. + content: + application/json: + schema: + $ref: '#/components/schemas/Prompt' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: prompt_id + in: path + required: true + schema: + type: string + description: 'Path parameter: prompt_id' + /v1/prompts/{prompt_id}/versions: + get: + tags: + - V1 + summary: List Prompt Versions + description: Query endpoint for proper schema generation. + operationId: list_prompt_versions_v1_prompts__prompt_id__versions_get + parameters: + - name: prompt_id + in: path + required: true + schema: + type: string + title: Prompt Id + responses: + '200': + description: A ListPromptsResponse containing all versions of the prompt. + content: + application/json: + schema: + $ref: '#/components/schemas/ListPromptsResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/providers: + get: + tags: + - V1 + summary: List Providers + description: Response-only endpoint for proper schema generation. + operationId: list_providers_v1_providers_get + responses: + '200': + description: A ListProvidersResponse containing information about all providers. + content: + application/json: + schema: + $ref: '#/components/schemas/ListProvidersResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/providers/{provider_id}: + get: + tags: + - V1 + summary: Inspect Provider + description: Query endpoint for proper schema generation. + operationId: inspect_provider_v1_providers__provider_id__get + parameters: + - name: provider_id + in: path + required: true + schema: + type: string + title: Provider Id + responses: + '200': + description: A ProviderInfo object containing the provider's details. + content: + application/json: + schema: + $ref: '#/components/schemas/ProviderInfo' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/responses: + get: + tags: + - V1 + summary: List Openai Responses + description: Query endpoint for proper schema generation. + operationId: list_openai_responses_v1_responses_get + parameters: + - name: after + in: query + required: true + schema: + type: string + title: After + - name: model + in: query + required: true + schema: + type: string + title: Model + - name: limit + in: query + required: false + schema: + type: integer + default: 50 + title: Limit + - name: order + in: query + required: false + schema: + $ref: '#/components/schemas/Order' + default: desc + responses: + '200': + description: A ListOpenAIResponseObject. + content: + application/json: + schema: + $ref: '#/components/schemas/ListOpenAIResponseObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Create Openai Response + description: Typed endpoint for proper schema generation. + operationId: create_openai_response_v1_responses_post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/_responses_Request' + responses: + '200': + description: An OpenAIResponseObject. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIResponseObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/responses/{response_id}: + delete: + tags: + - V1 + summary: Delete Openai Response + description: Query endpoint for proper schema generation. + operationId: delete_openai_response_v1_responses__response_id__delete + parameters: + - name: response_id + in: path + required: true + schema: + type: string + title: Response Id + responses: + '200': + description: An OpenAIDeleteResponseObject + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIDeleteResponseObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Get Openai Response + description: Query endpoint for proper schema generation. + operationId: get_openai_response_v1_responses__response_id__get + parameters: + - name: response_id + in: path + required: true + schema: + type: string + title: Response Id + responses: + '200': + description: An OpenAIResponseObject. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIResponseObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/responses/{response_id}/input_items: + get: + tags: + - V1 + summary: List Openai Response Input Items + description: Query endpoint for proper schema generation. + operationId: list_openai_response_input_items_v1_responses__response_id__input_items_get + parameters: + - name: response_id + in: path + required: true + schema: + type: string + title: Response Id + - name: after + in: query + required: true + schema: + type: string + title: After + - name: before + in: query + required: true + schema: + type: string + title: Before + - name: include + in: query + required: true + schema: + type: string + title: Include + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit + - name: order + in: query + required: false + schema: + $ref: '#/components/schemas/Order' + default: desc + responses: + '200': + description: An ListOpenAIResponseInputItem. + content: + application/json: + schema: + $ref: '#/components/schemas/ListOpenAIResponseInputItem' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/safety/run-shield: + post: + tags: + - V1 + summary: Run Shield + description: Typed endpoint for proper schema generation. + operationId: run_shield_v1_safety_run_shield_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_safety_run_shield_Request' + required: true + responses: + '200': + description: A RunShieldResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/RunShieldResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/scoring-functions: + get: + tags: + - V1 + summary: List Scoring Functions + description: Response-only endpoint for proper schema generation. + operationId: list_scoring_functions_v1_scoring_functions_get + responses: + '200': + description: A ListScoringFunctionsResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/ListScoringFunctionsResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Register Scoring Function + description: Generic endpoint - this would be replaced with actual implementation. + operationId: register_scoring_function_v1_scoring_functions_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/scoring-functions/{scoring_fn_id}: + delete: + tags: + - V1 + summary: Unregister Scoring Function + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_scoring_function_v1_scoring_functions__scoring_fn_id__delete + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: scoring_fn_id + in: path + required: true + schema: + type: string + description: 'Path parameter: scoring_fn_id' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Get Scoring Function + description: Query endpoint for proper schema generation. + operationId: get_scoring_function_v1_scoring_functions__scoring_fn_id__get + parameters: + - name: scoring_fn_id + in: path + required: true + schema: + type: string + title: Scoring Fn Id + responses: + '200': + description: A ScoringFn. + content: + application/json: + schema: + $ref: '#/components/schemas/ScoringFn' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/scoring/score: + post: + tags: + - V1 + summary: Score + description: Typed endpoint for proper schema generation. + operationId: score_v1_scoring_score_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_scoring_score_Request' + required: true + responses: + '200': + description: A ScoreResponse object containing rows and aggregated results. + content: + application/json: + schema: + $ref: '#/components/schemas/ScoreResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/scoring/score-batch: + post: + tags: + - V1 + summary: Score Batch + description: Typed endpoint for proper schema generation. + operationId: score_batch_v1_scoring_score_batch_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_scoring_score_batch_Request' + required: true + responses: + '200': + description: A ScoreBatchResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/ScoreBatchResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/shields: + get: + tags: + - V1 + summary: List Shields + description: Response-only endpoint for proper schema generation. + operationId: list_shields_v1_shields_get + responses: + '200': + description: A ListShieldsResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/ListShieldsResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + post: + tags: + - V1 + summary: Register Shield + description: Typed endpoint for proper schema generation. + operationId: register_shield_v1_shields_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_shields_Request' + required: true + responses: + '200': + description: A Shield. + content: + application/json: + schema: + $ref: '#/components/schemas/Shield' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/shields/{identifier}: + delete: + tags: + - V1 + summary: Unregister Shield + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_shield_v1_shields__identifier__delete + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: identifier + in: path + required: true + schema: + type: string + description: 'Path parameter: identifier' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Get Shield + description: Query endpoint for proper schema generation. + operationId: get_shield_v1_shields__identifier__get + parameters: + - name: identifier + in: path + required: true + schema: + type: string + title: Identifier + responses: + '200': + description: A Shield. + content: + application/json: + schema: + $ref: '#/components/schemas/Shield' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/tool-runtime/invoke: + post: + tags: + - V1 + summary: Invoke Tool + description: Typed endpoint for proper schema generation. + operationId: invoke_tool_v1_tool_runtime_invoke_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_tool_runtime_invoke_Request' + required: true + responses: + '200': + description: A ToolInvocationResult. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolInvocationResult' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/tool-runtime/list-tools: + get: + tags: + - V1 + summary: List Runtime Tools + description: Query endpoint for proper schema generation. + operationId: list_runtime_tools_v1_tool_runtime_list_tools_get + parameters: + - name: tool_group_id + in: query + required: true + schema: + type: string + title: Tool Group Id + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/URL' + responses: + '200': + description: A ListToolDefsResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/ListToolDefsResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/tool-runtime/rag-tool/insert: + post: + tags: + - V1 + summary: Rag Tool.Insert + description: Generic endpoint - this would be replaced with actual implementation. + operationId: rag_tool_insert_v1_tool_runtime_rag_tool_insert_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/tool-runtime/rag-tool/query: + post: + tags: + - V1 + summary: Rag Tool.Query + description: Typed endpoint for proper schema generation. + operationId: rag_tool_query_v1_tool_runtime_rag_tool_query_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_tool_runtime_rag_tool_query_Request' + required: true + responses: + '200': + description: RAGQueryResult containing the retrieved content and metadata + content: + application/json: + schema: + $ref: '#/components/schemas/RAGQueryResult' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/toolgroups: + get: + tags: + - V1 + summary: List Tool Groups + description: Response-only endpoint for proper schema generation. + operationId: list_tool_groups_v1_toolgroups_get + responses: + '200': + description: A ListToolGroupsResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/ListToolGroupsResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Register Tool Group + description: Generic endpoint - this would be replaced with actual implementation. + operationId: register_tool_group_v1_toolgroups_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/toolgroups/{toolgroup_id}: + delete: + tags: + - V1 + summary: Unregister Toolgroup + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_toolgroup_v1_toolgroups__toolgroup_id__delete + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + - name: toolgroup_id + in: path + required: true + schema: + type: string + description: 'Path parameter: toolgroup_id' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Get Tool Group + description: Query endpoint for proper schema generation. + operationId: get_tool_group_v1_toolgroups__toolgroup_id__get + parameters: + - name: toolgroup_id + in: path + required: true + schema: + type: string + title: Toolgroup Id + responses: + '200': + description: A ToolGroup. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolGroup' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/tools: + get: + tags: + - V1 + summary: List Tools + description: Query endpoint for proper schema generation. + operationId: list_tools_v1_tools_get + parameters: + - name: toolgroup_id + in: query + required: true + schema: + type: string + title: Toolgroup Id + responses: + '200': + description: A ListToolDefsResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/ListToolDefsResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/tools/{tool_name}: + get: + tags: + - V1 + summary: Get Tool + description: Query endpoint for proper schema generation. + operationId: get_tool_v1_tools__tool_name__get + parameters: + - name: tool_name + in: path + required: true + schema: + type: string + title: Tool Name + responses: + '200': + description: A ToolDef. + content: + application/json: + schema: + $ref: '#/components/schemas/ToolDef' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector-io/insert: + post: + tags: + - V1 + summary: Insert Chunks + description: Generic endpoint - this would be replaced with actual implementation. + operationId: insert_chunks_v1_vector_io_insert_post + parameters: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector-io/query: + post: + tags: + - V1 + summary: Query Chunks + description: Typed endpoint for proper schema generation. + operationId: query_chunks_v1_vector_io_query_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_vector_io_query_Request' + required: true + responses: + '200': + description: A QueryChunksResponse. + content: + application/json: + schema: + $ref: '#/components/schemas/QueryChunksResponse' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + /v1/vector_stores: + get: + tags: + - V1 + summary: Openai List Vector Stores + description: Query endpoint for proper schema generation. + operationId: openai_list_vector_stores_v1_vector_stores_get + parameters: + - name: after + in: query + required: true + schema: + type: string + title: After + - name: before + in: query + required: true + schema: + type: string + title: Before + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit + - name: order + in: query + required: false + schema: + type: string + default: desc + title: Order + responses: + '200': + description: A VectorStoreListResponse containing the list of vector stores. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreListResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Openai Create Vector Store + description: Typed endpoint for proper schema generation. + operationId: openai_create_vector_store_v1_vector_stores_post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody' + responses: + '200': + description: A VectorStoreObject representing the created vector store. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector_stores/{vector_store_id}: + delete: + tags: + - V1 + summary: Openai Delete Vector Store + description: Query endpoint for proper schema generation. + operationId: openai_delete_vector_store_v1_vector_stores__vector_store_id__delete + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + responses: + '200': + description: A VectorStoreDeleteResponse indicating the deletion status. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreDeleteResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Openai Retrieve Vector Store + description: Query endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_v1_vector_stores__vector_store_id__get + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + responses: + '200': + description: A VectorStoreObject representing the vector store. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Openai Update Vector Store + description: Typed endpoint for proper schema generation. + operationId: openai_update_vector_store_v1_vector_stores__vector_store_id__post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/_vector_stores_vector_store_id_Request' + responses: + '200': + description: A VectorStoreObject representing the updated vector store. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: 'Path parameter: vector_store_id' + /v1/vector_stores/{vector_store_id}/file_batches: + post: + tags: + - V1 + summary: Openai Create Vector Store File Batch + description: Typed endpoint for proper schema generation. + operationId: openai_create_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody' + required: true + responses: + '200': + description: A VectorStoreFileBatchObject representing the created file batch. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileBatchObject' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: 'Path parameter: vector_store_id' + /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: + get: + tags: + - V1 + summary: Openai Retrieve Vector Store File Batch + description: Query endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__get + parameters: + - name: batch_id + in: path + required: true + schema: + type: string + title: Batch Id + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + responses: + '200': + description: A VectorStoreFileBatchObject representing the file batch. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileBatchObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: + post: + tags: + - V1 + summary: Openai Cancel Vector Store File Batch + description: Typed endpoint for proper schema generation. + operationId: openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post + requestBody: + content: + application/json: schema: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Schema - description: - anyOf: - - type: string - - type: 'null' - title: Description - strict: - anyOf: - - type: boolean - - type: 'null' - title: Strict - title: OpenAIResponseTextFormat - type: object - OpenAIResponseToolMCP: - description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response object. - - - :param type: Tool type identifier, always "mcp" - - :param server_label: Label to identify this MCP server - - :param allowed_tools: (Optional) Restriction on which tools can be used - from this server - properties: - type: - const: mcp - default: mcp - title: Type - type: string - server_label: - title: Server Label - type: string - allowed_tools: - anyOf: - - items: - type: string - type: array - - $ref: '#/$defs/AllowedToolsFilter' - - type: 'null' - title: Allowed Tools - required: - - server_label - title: OpenAIResponseToolMCP - type: object - OpenAIResponseUsage: - description: >- - Usage information for OpenAI response. - - - :param input_tokens: Number of tokens in the input - - :param output_tokens: Number of tokens in the output - - :param total_tokens: Total tokens used (input + output) - - :param input_tokens_details: Detailed breakdown of input token usage - - :param output_tokens_details: Detailed breakdown of output token usage - properties: - input_tokens: - title: Input Tokens - type: integer - output_tokens: - title: Output Tokens - type: integer - total_tokens: - title: Total Tokens - type: integer - input_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIResponseUsageInputTokensDetails - - type: 'null' - output_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIResponseUsageOutputTokensDetails - - type: 'null' - required: - - input_tokens - - output_tokens - - total_tokens - title: OpenAIResponseUsage - type: object - OpenAIResponseUsageInputTokensDetails: - description: >- - Token details for input tokens in OpenAI response usage. - - - :param cached_tokens: Number of tokens retrieved from cache - properties: - cached_tokens: - anyOf: - - type: integer - - type: 'null' - title: Cached Tokens - title: OpenAIResponseUsageInputTokensDetails - type: object - OpenAIResponseUsageOutputTokensDetails: - description: >- - Token details for output tokens in OpenAI response usage. - - - :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) - properties: - reasoning_tokens: - anyOf: - - type: integer - - type: 'null' - title: Reasoning Tokens - title: OpenAIResponseUsageOutputTokensDetails - type: object - SearchRankingOptions: - description: >- - Options for ranking and filtering search results. - - - :param ranker: (Optional) Name of the ranking algorithm to use - - :param score_threshold: (Optional) Minimum relevance score threshold for - results - properties: - ranker: - anyOf: - - type: string - - type: 'null' - title: Ranker - score_threshold: - anyOf: - - type: number - - type: 'null' - default: 0.0 - title: Score Threshold - title: SearchRankingOptions - type: object - description: >- - Paginated list of OpenAI response objects with navigation metadata. - - - :param data: List of response objects with their input context - - :param has_more: Whether there are more results available beyond this page - - :param first_id: Identifier of the first item in this page - - :param last_id: Identifier of the last item in this page - - :param object: Object type identifier, always "list" - properties: - data: - items: - $ref: '#/$defs/OpenAIResponseObjectWithInput' - title: Data - type: array - has_more: - title: Has More - type: boolean - first_id: - title: First Id + $ref: '#/components/schemas/_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request' + required: true + responses: + '200': + description: A VectorStoreFileBatchObject representing the cancelled file batch. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileBatchObject' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: vector_store_id + in: path + required: true + schema: type: string - last_id: - title: Last Id + description: 'Path parameter: vector_store_id' + - name: batch_id + in: path + required: true + schema: type: string - object: - const: list - default: list - title: Object + description: 'Path parameter: batch_id' + /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: + get: + tags: + - V1 + summary: Openai List Files In Vector Store File Batch + description: Query endpoint for proper schema generation. + operationId: openai_list_files_in_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get + parameters: + - name: batch_id + in: path + required: true + schema: + type: string + title: Batch Id + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + - name: after + in: query + required: true + schema: + type: string + title: After + - name: before + in: query + required: true + schema: + type: string + title: Before + - name: filter + in: query + required: true + schema: + type: string + title: Filter + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit + - name: order + in: query + required: false + schema: + type: string + default: desc + title: Order + responses: + '200': + description: A VectorStoreFilesListInBatchResponse containing the list of files in the batch. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFilesListInBatchResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector_stores/{vector_store_id}/files: + get: + tags: + - V1 + summary: Openai List Files In Vector Store + description: Query endpoint for proper schema generation. + operationId: openai_list_files_in_vector_store_v1_vector_stores__vector_store_id__files_get + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + - name: after + in: query + required: true + schema: + type: string + title: After + - name: before + in: query + required: true + schema: + type: string + title: Before + - name: filter + in: query + required: true + schema: + type: string + title: Filter + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + title: Limit + - name: order + in: query + required: false + schema: + type: string + default: desc + title: Order + responses: + '200': + description: A VectorStoreListFilesResponse containing the list of files. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreListFilesResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Openai Attach File To Vector Store + description: Typed endpoint for proper schema generation. + operationId: openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/_vector_stores_vector_store_id_files_Request' + responses: + '200': + description: A VectorStoreFileObject representing the attached file. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + parameters: + - name: vector_store_id + in: path + required: true + schema: type: string - required: - - data - - has_more - - first_id - - last_id - title: ListOpenAIResponseObject - type: object - properties: - code: + description: 'Path parameter: vector_store_id' + /v1/vector_stores/{vector_store_id}/files/{file_id}: + delete: + tags: + - V1 + summary: Openai Delete Vector Store File + description: Query endpoint for proper schema generation. + operationId: openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete + parameters: + - name: file_id + in: path + required: true + schema: type: string - description: >- - Error code identifying the type of failure - message: + title: File Id + - name: vector_store_id + in: path + required: true + schema: type: string - description: >- - Human-readable error message describing the failure - additionalProperties: false - required: - - code - - message - title: OpenAIResponseError - description: >- - Error details for failed OpenAI response requests. - OpenAIResponseInput: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutput' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseMessage' - OpenAIResponseInputToolFileSearch: - type: object - properties: - type: + title: Vector Store Id + responses: + '200': + description: A VectorStoreFileDeleteResponse indicating the deletion status. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileDeleteResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + get: + tags: + - V1 + summary: Openai Retrieve Vector Store File + description: Query endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get + parameters: + - name: file_id + in: path + required: true + schema: type: string - const: file_search - default: file_search - description: >- - Tool type identifier, always "file_search" - vector_store_ids: - type: array - items: - type: string - description: >- - List of vector store identifiers to search within - filters: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional filters to apply to the search - max_num_results: - type: integer - default: 10 - description: >- - (Optional) Maximum number of search results to return (1-50) - ranking_options: - type: object - properties: - ranker: - type: string - description: >- - (Optional) Name of the ranking algorithm to use - score_threshold: - type: number - default: 0.0 - description: >- - (Optional) Minimum relevance score threshold for results - additionalProperties: false - description: >- - (Optional) Options for ranking and scoring search results - additionalProperties: false - required: - - type - - vector_store_ids - title: OpenAIResponseInputToolFileSearch - description: >- - File search tool configuration for OpenAI response inputs. - OpenAIResponseInputToolFunction: - type: object - properties: - type: + title: File Id + - name: vector_store_id + in: path + required: true + schema: type: string - const: function - default: function - description: Tool type identifier, always "function" - name: + title: Vector Store Id + responses: + '200': + description: A VectorStoreFileObject representing the file. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + post: + tags: + - V1 + summary: Openai Update Vector Store File + description: Typed endpoint for proper schema generation. + operationId: openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/_vector_stores_vector_store_id_files_file_id_Request' + responses: + '200': + description: A VectorStoreFileObject representing the updated file. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileObject' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + parameters: + - name: vector_store_id + in: path + required: true + schema: type: string - description: Name of the function that can be called - description: + description: 'Path parameter: vector_store_id' + - name: file_id + in: path + required: true + schema: type: string - description: >- - (Optional) Description of what the function does - parameters: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON schema defining the function's parameters - strict: - type: boolean - description: >- - (Optional) Whether to enforce strict parameter validation - additionalProperties: false - required: - - type - - name - title: OpenAIResponseInputToolFunction - description: >- - Function tool configuration for OpenAI response inputs. - OpenAIResponseInputToolWebSearch: - type: object - properties: - type: - oneOf: - - type: string - const: web_search - - type: string - const: web_search_preview - - type: string - const: web_search_preview_2025_03_11 - default: web_search - description: Web search tool type variant to use - search_context_size: + description: 'Path parameter: file_id' + /v1/vector_stores/{vector_store_id}/files/{file_id}/content: + get: + tags: + - V1 + summary: Openai Retrieve Vector Store File Contents + description: Query endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get + parameters: + - name: file_id + in: path + required: true + schema: type: string - default: medium - description: >- - (Optional) Size of search context, must be "low", "medium", or "high" - additionalProperties: false - required: - - type - title: OpenAIResponseInputToolWebSearch - description: >- - Web search tool configuration for OpenAI response inputs. - OpenAIResponseObjectWithInput: - type: object - properties: - created_at: - type: integer - description: >- - Unix timestamp when the response was created - error: - $ref: '#/components/schemas/OpenAIResponseError' - description: >- - (Optional) Error details if the response generation failed - id: + title: File Id + - name: vector_store_id + in: path + required: true + schema: type: string - description: Unique identifier for this response - model: + title: Vector Store Id + responses: + '200': + description: A list of InterleavedContent representing the file contents. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileContentsResponse' + '400': + $ref: '#/components/responses/BadRequest400' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequests429' + description: Too Many Requests + '500': + $ref: '#/components/responses/InternalServerError500' + description: Internal Server Error + default: + $ref: '#/components/responses/DefaultError' + description: Default Response + /v1/vector_stores/{vector_store_id}/search: + post: + tags: + - V1 + summary: Openai Search Vector Store + description: Typed endpoint for proper schema generation. + operationId: openai_search_vector_store_v1_vector_stores__vector_store_id__search_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_vector_stores_vector_store_id_search_Request' + required: true + responses: + '200': + description: A VectorStoreSearchResponse containing the search results. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreSearchResponsePage' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' + parameters: + - name: vector_store_id + in: path + required: true + schema: type: string - description: Model identifier used for generation - object: + description: 'Path parameter: vector_store_id' + /v1/version: + get: + tags: + - V1 + summary: Version + description: Response-only endpoint for proper schema generation. + operationId: version_v1_version_get + responses: + '200': + description: Version information containing the service version number. + content: + application/json: + schema: + $ref: '#/components/schemas/VersionInfo' + '400': + description: Bad Request + $ref: '#/components/responses/BadRequest400' + '429': + description: Too Many Requests + $ref: '#/components/responses/TooManyRequests429' + '500': + description: Internal Server Error + $ref: '#/components/responses/InternalServerError500' + default: + description: Default Response + $ref: '#/components/responses/DefaultError' +components: + schemas: + AgentCandidate: + properties: + type: type: string - const: response - default: response - description: >- - Object type identifier, always "response" - output: + const: agent + title: Type + default: agent + config: + $ref: '#/components/schemas/AgentConfig' + type: object + required: + - config + title: AgentCandidate + description: "An agent candidate for evaluation.\n\n:param config: The configuration for the agent candidate." + AgentConfig: + properties: + sampling_params: + $ref: '#/components/schemas/SamplingParams' + input_shields: + title: Input Shields + items: + type: string type: array + output_shields: + title: Output Shields items: - $ref: '#/components/schemas/OpenAIResponseOutput' - description: >- - List of generated output items (messages, tool calls, etc.) - parallel_tool_calls: - type: boolean - default: false - description: >- - Whether tool calls can be executed in parallel - previous_response_id: - type: string - description: >- - (Optional) ID of the previous response in a conversation - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - description: >- - (Optional) Reference to a prompt template and its variables. - status: - type: string - description: >- - Current status of the response generation - temperature: - type: number - description: >- - (Optional) Sampling temperature used for generation - text: - $ref: '#/components/schemas/OpenAIResponseText' - description: >- - Text formatting configuration for the response - top_p: - type: number - description: >- - (Optional) Nucleus sampling parameter used for generation - tools: + type: string type: array + toolgroups: + title: Toolgroups items: - $ref: '#/components/schemas/OpenAIResponseTool' - description: >- - (Optional) An array of tools the model may call while generating a response. - truncation: - type: string - description: >- - (Optional) Truncation strategy applied to the response - usage: - $ref: '#/components/schemas/OpenAIResponseUsage' - description: >- - (Optional) Token usage information for the response - instructions: - type: string - description: >- - (Optional) System message inserted into the model's context - input: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' type: array + client_tools: + title: Client Tools items: - $ref: '#/components/schemas/OpenAIResponseInput' - description: >- - List of input items that led to this response - additionalProperties: false - required: - - created_at - - id - - model - - object - - output - - parallel_tool_calls - - status - - text - - input - title: OpenAIResponseObjectWithInput - description: >- - OpenAI response object extended with input context information. - OpenAIResponseOutput: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - OpenAIResponsePrompt: - type: object - properties: - id: - type: string - description: Unique identifier of the prompt template - variables: - type: object - additionalProperties: - $ref: '#/components/schemas/OpenAIResponseInputMessageContent' - description: >- - Dictionary of variable names to OpenAIResponseInputMessageContent structure - for template substitution. The substitution values can either be strings, - or other Response input types like images or files. - version: + $ref: '#/components/schemas/ToolDef' + type: array + tool_choice: + deprecated: true + $ref: '#/components/schemas/ToolChoice' + tool_prompt_format: + deprecated: true + $ref: '#/components/schemas/ToolPromptFormat' + tool_config: + $ref: '#/components/schemas/ToolConfig' + max_infer_iters: + title: Max Infer Iters + default: 10 + type: integer + model: type: string - description: >- - Version number of the prompt to use (defaults to latest if not specified) - additionalProperties: false - required: - - id - title: OpenAIResponsePrompt - description: >- - OpenAI compatible Prompt object that is used in OpenAI responses. - OpenAIResponseText: - type: object - properties: - format: - type: object - properties: - type: - oneOf: - - type: string - const: text - - type: string - const: json_schema - - type: string - const: json_object - description: >- - Must be "text", "json_schema", or "json_object" to identify the format - type - name: - type: string - description: >- - The name of the response format. Only used for json_schema. - schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The JSON schema the response should conform to. In a Python SDK, this - is often a `pydantic` model. Only used for json_schema. - description: - type: string - description: >- - (Optional) A description of the response format. Only used for json_schema. - strict: - type: boolean - description: >- - (Optional) Whether to strictly enforce the JSON schema. If true, the - response must match the schema exactly. Only used for json_schema. - additionalProperties: false - required: - - type - description: >- - (Optional) Text format configuration specifying output format requirements - additionalProperties: false - title: OpenAIResponseText - description: >- - Text response configuration for OpenAI responses. - OpenAIResponseTool: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseToolMCP' - discriminator: - propertyName: type - mapping: - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseToolMCP' - OpenAIResponseToolMCP: - type: object - properties: - type: + title: Model + instructions: type: string - const: mcp - default: mcp - description: Tool type identifier, always "mcp" - server_label: + title: Instructions + name: + title: Name type: string - description: Label to identify this MCP server - allowed_tools: + enable_session_persistence: + title: Enable Session Persistence + default: false + type: boolean + response_format: + title: Response Format oneOf: - - type: array - items: - type: string - - type: object - properties: - tool_names: - type: array - items: - type: string - description: >- - (Optional) List of specific tool names that are allowed - additionalProperties: false - title: AllowedToolsFilter - description: >- - Filter configuration for restricting which MCP tools can be used. - description: >- - (Optional) Restriction on which tools can be used from this server - additionalProperties: false - required: - - type - - server_label - title: OpenAIResponseToolMCP - description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response object. - OpenAIResponseUsage: + - $ref: '#/components/schemas/JsonSchemaResponseFormat' + - $ref: '#/components/schemas/GrammarResponseFormat' + discriminator: + propertyName: type + mapping: + grammar: '#/components/schemas/GrammarResponseFormat' + json_schema: '#/components/schemas/JsonSchemaResponseFormat' type: object - properties: - input_tokens: - type: integer - description: Number of tokens in the input - output_tokens: - type: integer - description: Number of tokens in the output - total_tokens: - type: integer - description: Total tokens used (input + output) - input_tokens_details: - type: object - properties: - cached_tokens: - type: integer - description: Number of tokens retrieved from cache - additionalProperties: false - description: Detailed breakdown of input token usage - output_tokens_details: - type: object - properties: - reasoning_tokens: - type: integer - description: >- - Number of tokens used for reasoning (o1/o3 models) - additionalProperties: false - description: Detailed breakdown of output token usage - additionalProperties: false required: - - input_tokens - - output_tokens - - total_tokens - title: OpenAIResponseUsage - description: Usage information for OpenAI response. - ResponseGuardrailSpec: - type: object + - model + - instructions + title: AgentConfig + description: "Configuration for an agent.\n\n:param model: The model identifier to use for the agent\n:param instructions: The system instructions for the agent\n:param name: Optional name for the agent, used in telemetry and identification\n:param enable_session_persistence: Optional flag indicating whether session data has to be persisted\n:param response_format: Optional response format configuration" + AgentCreateResponse: properties: - type: + agent_id: type: string - description: The type/identifier of the guardrail. - additionalProperties: false - required: - - type - title: ResponseGuardrailSpec - description: >- - Specification for a guardrail to apply during response generation. - OpenAIResponseInputTool: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' - discriminator: - propertyName: type - mapping: - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseInputToolMCP' - OpenAIResponseInputToolMCP: + title: Agent Id type: object - properties: - type: - type: string - const: mcp - default: mcp - description: Tool type identifier, always "mcp" - server_label: - type: string - description: Label to identify this MCP server - server_url: - type: string - description: URL endpoint of the MCP server - headers: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) HTTP headers to include when connecting to the server - require_approval: - oneOf: - - type: string - const: always - - type: string - const: never - - type: object - properties: - always: - type: array - items: - type: string - description: >- - (Optional) List of tool names that always require approval - never: - type: array - items: - type: string - description: >- - (Optional) List of tool names that never require approval - additionalProperties: false - title: ApprovalFilter - description: >- - Filter configuration for MCP tool approval requirements. - default: never - description: >- - Approval requirement for tool calls ("always", "never", or filter) - allowed_tools: - oneOf: - - type: array - items: - type: string - - type: object - properties: - tool_names: - type: array - items: - type: string - description: >- - (Optional) List of specific tool names that are allowed - additionalProperties: false - title: AllowedToolsFilter - description: >- - Filter configuration for restricting which MCP tools can be used. - description: >- - (Optional) Restriction on which tools can be used from this server - additionalProperties: false required: - - type - - server_label - - server_url - - require_approval - title: OpenAIResponseInputToolMCP - description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response inputs. - CreateOpenaiResponseRequest: - type: object - properties: - input: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInput' - description: Input message(s) to create the response. - model: - type: string - description: The underlying LLM used for completions. - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - description: >- - (Optional) Prompt object with ID, version, and variables. - instructions: + - agent_id + title: AgentCreateResponse + description: "Response returned when creating a new agent.\n\n:param agent_id: Unique identifier for the created agent" + AgentSessionCreateResponse: + properties: + session_id: type: string - previous_response_id: + title: Session Id + type: object + required: + - session_id + title: AgentSessionCreateResponse + description: "Response returned when creating a new agent session.\n\n:param session_id: Unique identifier for the created session" + AgentToolGroupWithArgs: + properties: + name: type: string - description: >- - (Optional) if specified, the new response will be a continuation of the - previous response. This can be used to easily fork-off new responses from - existing responses. - conversation: + title: Name + args: + additionalProperties: true + type: object + title: Args + type: object + required: + - name + - args + title: AgentToolGroupWithArgs + AgentTurnInputType: + properties: + type: type: string - description: >- - (Optional) The ID of a conversation to add the response to. Must begin - with 'conv_'. Input and output messages will be automatically added to - the conversation. - store: - type: boolean - stream: - type: boolean - temperature: - type: number - text: - $ref: '#/components/schemas/OpenAIResponseText' - tools: + const: agent_turn_input + title: Type + default: agent_turn_input + type: object + title: AgentTurnInputType + description: "Parameter type for agent turn input.\n\n:param type: Discriminator type. Always \"agent_turn_input\"" + AggregationFunctionType: + type: string + enum: + - average + - weighted_average + - median + - categorical_count + - accuracy + title: AggregationFunctionType + description: "Types of aggregation functions for scoring results.\n:cvar average: Calculate the arithmetic mean of scores\n:cvar weighted_average: Calculate a weighted average of scores\n:cvar median: Calculate the median value of scores\n:cvar categorical_count: Count occurrences of categorical values\n:cvar accuracy: Calculate accuracy as the proportion of correct answers" + AllowedToolsFilter: + properties: + tool_names: + title: Tool Names + items: + type: string type: array + type: object + title: AllowedToolsFilter + description: "Filter configuration for restricting which MCP tools can be used.\n\n:param tool_names: (Optional) List of specific tool names that are allowed" + ApprovalFilter: + properties: + always: + title: Always items: - $ref: '#/components/schemas/OpenAIResponseInputTool' - include: + type: string type: array + never: + title: Never items: type: string - description: >- - (Optional) Additional fields to include in the response. - max_infer_iters: - type: integer - additionalProperties: false + type: array + type: object + title: ApprovalFilter + description: "Filter configuration for MCP tool approval requirements.\n\n:param always: (Optional) List of tool names that always require approval\n:param never: (Optional) List of tool names that never require approval" + ArrayType: + properties: + type: + type: string + const: array + title: Type + default: array + type: object + title: ArrayType + description: "Parameter type for array values.\n\n:param type: Discriminator type. Always \"array\"" + Attachment-Output: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + title: Content + mime_type: + type: string + title: Mime Type + type: object required: - - input - - model - title: CreateOpenaiResponseRequest - OpenAIResponseObject: - $defs: - AllowedToolsFilter: - description: >- - Filter configuration for restricting which MCP tools can be used. - - - :param tool_names: (Optional) List of specific tool names that are allowed - properties: - tool_names: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Tool Names - title: AllowedToolsFilter - type: object - MCPListToolsTool: - description: >- - Tool definition returned by MCP list tools operation. - - - :param input_schema: JSON schema defining the tool's input parameters - - :param name: Name of the tool - - :param description: (Optional) Description of what the tool does - properties: - input_schema: - additionalProperties: true - title: Input Schema - type: object - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - required: - - input_schema - - name - title: MCPListToolsTool - type: object - OpenAIResponseAnnotationCitation: - description: >- - URL citation annotation for referencing external web resources. - - - :param type: Annotation type identifier, always "url_citation" - - :param end_index: End position of the citation span in the content - - :param start_index: Start position of the citation span in the content - - :param title: Title of the referenced web resource - - :param url: URL of the referenced web resource - properties: - type: - const: url_citation - default: url_citation - title: Type - type: string - end_index: - title: End Index - type: integer - start_index: - title: Start Index - type: integer - title: - title: Title - type: string - url: - title: Url - type: string - required: - - end_index - - start_index - - title - - url - title: OpenAIResponseAnnotationCitation - type: object - "OpenAIResponseAnnotationContainerFileCitation": - properties: - type: - const: container_file_citation - default: container_file_citation - title: Type - type: string - container_id: - title: Container Id - type: string - end_index: - title: End Index - type: integer - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - start_index: - title: Start Index - type: integer - required: - - container_id - - end_index - - file_id - - filename - - start_index - title: >- - OpenAIResponseAnnotationContainerFileCitation - type: object - OpenAIResponseAnnotationFileCitation: - description: >- - File citation annotation for referencing specific files in response content. - - - :param type: Annotation type identifier, always "file_citation" - - :param file_id: Unique identifier of the referenced file - - :param filename: Name of the referenced file - - :param index: Position index of the citation within the content - properties: - type: - const: file_citation - default: file_citation - title: Type - type: string - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - index: - title: Index - type: integer - required: - - file_id - - filename - - index - title: OpenAIResponseAnnotationFileCitation - type: object - OpenAIResponseAnnotationFilePath: - properties: - type: - const: file_path - default: file_path - title: Type - type: string - file_id: - title: File Id - type: string - index: - title: Index - type: integer - required: - - file_id - - index - title: OpenAIResponseAnnotationFilePath + - content + - mime_type + title: Attachment + description: "An attachment to an agent turn.\n\n:param content: The content of the attachment.\n:param mime_type: The MIME type of the attachment." + BasicScoringFnParams: + properties: + type: + type: string + const: basic + title: Type + default: basic + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row + type: object + title: BasicScoringFnParams + description: "Parameters for basic scoring function configuration.\n:param type: The type of scoring function parameters, always basic\n:param aggregation_functions: Aggregation functions to apply to the scores of each row" + Batch: + properties: + id: + type: string + title: Id + completion_window: + type: string + title: Completion Window + created_at: + type: integer + title: Created At + endpoint: + type: string + title: Endpoint + input_file_id: + type: string + title: Input File Id + object: + type: string + const: batch + title: Object + status: + type: string + enum: + - validating + - failed + - in_progress + - finalizing + - completed + - expired + - cancelling + - cancelled + title: Status + cancelled_at: + title: Cancelled At + type: integer + cancelling_at: + title: Cancelling At + type: integer + completed_at: + title: Completed At + type: integer + error_file_id: + title: Error File Id + type: string + errors: + $ref: '#/components/schemas/Errors' + expired_at: + title: Expired At + type: integer + expires_at: + title: Expires At + type: integer + failed_at: + title: Failed At + type: integer + finalizing_at: + title: Finalizing At + type: integer + in_progress_at: + title: In Progress At + type: integer + metadata: + title: Metadata + additionalProperties: + type: string type: object - OpenAIResponseContentPartRefusal: - description: >- - Refusal content within a streamed response part. - - - :param type: Content part type identifier, always "refusal" - - :param refusal: Refusal text supplied by the model - properties: - type: - const: refusal - default: refusal - title: Type - type: string - refusal: - title: Refusal - type: string - required: - - refusal - title: OpenAIResponseContentPartRefusal + model: + title: Model + type: string + output_file_id: + title: Output File Id + type: string + request_counts: + $ref: '#/components/schemas/BatchRequestCounts' + usage: + $ref: '#/components/schemas/BatchUsage' + additionalProperties: true + type: object + required: + - id + - completion_window + - created_at + - endpoint + - input_file_id + - object + - status + title: Batch + BatchError: + properties: + code: + title: Code + type: string + line: + title: Line + type: integer + message: + title: Message + type: string + param: + title: Param + type: string + additionalProperties: true + type: object + title: BatchError + BatchRequestCounts: + properties: + completed: + type: integer + title: Completed + failed: + type: integer + title: Failed + total: + type: integer + title: Total + additionalProperties: true + type: object + required: + - completed + - failed + - total + title: BatchRequestCounts + BatchUsage: + properties: + input_tokens: + type: integer + title: Input Tokens + input_tokens_details: + $ref: '#/components/schemas/InputTokensDetails' + output_tokens: + type: integer + title: Output Tokens + output_tokens_details: + $ref: '#/components/schemas/OutputTokensDetails' + total_tokens: + type: integer + title: Total Tokens + additionalProperties: true + type: object + required: + - input_tokens + - input_tokens_details + - output_tokens + - output_tokens_details + - total_tokens + title: BatchUsage + Benchmark: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + title: Provider Resource Id + description: Unique identifier for this resource in the provider + type: string + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: benchmark + title: Type + default: benchmark + dataset_id: + type: string + title: Dataset Id + scoring_functions: + items: + type: string + type: array + title: Scoring Functions + metadata: + additionalProperties: true type: object - OpenAIResponseError: - description: >- - Error details for failed OpenAI response requests. - - - :param code: Error code identifying the type of failure - - :param message: Human-readable error message describing the failure - properties: - code: - title: Code - type: string - message: - title: Message - type: string - required: - - code - - message - title: OpenAIResponseError + title: Metadata + description: Metadata for this evaluation task + type: object + required: + - identifier + - provider_id + - dataset_id + - scoring_functions + title: Benchmark + description: "A benchmark resource for evaluating model performance.\n\n:param dataset_id: Identifier of the dataset to use for the benchmark evaluation\n:param scoring_functions: List of scoring function identifiers to apply during evaluation\n:param metadata: Metadata for this evaluation task\n:param type: The resource type, always benchmark" + BenchmarkConfig: + properties: + eval_candidate: + oneOf: + - $ref: '#/components/schemas/ModelCandidate' + - $ref: '#/components/schemas/AgentCandidate' + title: Eval Candidate + discriminator: + propertyName: type + mapping: + agent: '#/components/schemas/AgentCandidate' + model: '#/components/schemas/ModelCandidate' + scoring_params: + additionalProperties: + oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' type: object - OpenAIResponseInputMessageContentImage: - description: >- - Image content for input messages in OpenAI response format. - - - :param detail: Level of detail for image processing, can be "low", "high", - or "auto" - - :param type: Content type identifier, always "input_image" - - :param image_url: (Optional) URL of the image content - properties: - detail: - anyOf: - - const: low - type: string - - const: high - type: string - - const: auto - type: string - default: auto - title: Detail - type: - const: input_image - default: input_image - title: Type - type: string - image_url: - anyOf: - - type: string - - type: 'null' - title: Image Url - title: OpenAIResponseInputMessageContentImage + title: Scoring Params + description: Map between scoring function id and parameters for each scoring function you want to run + num_examples: + title: Num Examples + description: Number of examples to evaluate (useful for testing), if not provided, all examples in the dataset will be evaluated + type: integer + type: object + required: + - eval_candidate + title: BenchmarkConfig + description: "A benchmark configuration for evaluation.\n\n:param eval_candidate: The candidate to evaluate.\n:param scoring_params: Map between scoring function id and parameters for each scoring function you want to run\n:param num_examples: (Optional) The number of examples to evaluate. If not provided, all examples in the dataset will be evaluated" + BooleanType: + properties: + type: + type: string + const: boolean + title: Type + default: boolean + type: object + title: BooleanType + description: "Parameter type for boolean values.\n\n:param type: Discriminator type. Always \"boolean\"" + BuiltinTool: + type: string + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + ChatCompletionInputType: + properties: + type: + type: string + const: chat_completion_input + title: Type + default: chat_completion_input + type: object + title: ChatCompletionInputType + description: "Parameter type for chat completion input.\n\n:param type: Discriminator type. Always \"chat_completion_input\"" + Chunk-Output: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + chunk_id: + type: string + title: Chunk Id + metadata: + additionalProperties: true type: object - OpenAIResponseInputMessageContentText: - description: >- - Text content for input messages in OpenAI response format. - - - :param text: The text content of the input message - - :param type: Content type identifier, always "input_text" - properties: - text: - title: Text - type: string - type: - const: input_text - default: input_text - title: Type - type: string - required: - - text - title: OpenAIResponseInputMessageContentText + title: Metadata + embedding: + title: Embedding + items: + type: number + type: array + chunk_metadata: + $ref: '#/components/schemas/ChunkMetadata' + type: object + required: + - content + - chunk_id + title: Chunk + description: "A chunk of content that can be inserted into a vector database.\n:param content: The content of the chunk, which can be interleaved text, images, or other types.\n:param chunk_id: Unique identifier for the chunk. Must be provided explicitly.\n:param metadata: Metadata associated with the chunk that will be used in the model context during inference.\n:param embedding: Optional embedding for the chunk. If not provided, it will be computed later.\n:param chunk_metadata: Metadata for the chunk that will NOT be used in the context during inference.\n The `chunk_metadata` is required backend functionality." + ChunkMetadata: + properties: + chunk_id: + title: Chunk Id + type: string + document_id: + title: Document Id + type: string + source: + title: Source + type: string + created_timestamp: + title: Created Timestamp + type: integer + updated_timestamp: + title: Updated Timestamp + type: integer + chunk_window: + title: Chunk Window + type: string + chunk_tokenizer: + title: Chunk Tokenizer + type: string + chunk_embedding_model: + title: Chunk Embedding Model + type: string + chunk_embedding_dimension: + title: Chunk Embedding Dimension + type: integer + content_token_count: + title: Content Token Count + type: integer + metadata_token_count: + title: Metadata Token Count + type: integer + type: object + title: ChunkMetadata + description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference.\n:param chunk_id: The ID of the chunk. If not set, it will be generated based on the document ID and content.\n:param document_id: The ID of the document this chunk belongs to.\n:param source: The source of the content, such as a URL, file path, or other identifier.\n:param created_timestamp: An optional timestamp indicating when the chunk was created.\n:param updated_timestamp: An optional timestamp indicating when the chunk was last updated.\n:param chunk_window: The window of the chunk, which can be used to group related chunks together.\n:param chunk_tokenizer: The tokenizer used to create the chunk. Default is Tiktoken.\n:param chunk_embedding_model: The embedding model used to create the chunk's embedding.\n:param chunk_embedding_dimension: The dimension of the embedding vector for the chunk.\n:param content_token_count: The number of tokens in the content of the chunk.\n:param metadata_token_count: The number of tokens in the metadata of the chunk." + CompletionInputType: + properties: + type: + type: string + const: completion_input + title: Type + default: completion_input + type: object + title: CompletionInputType + description: "Parameter type for completion input.\n\n:param type: Discriminator type. Always \"completion_input\"" + CompletionMessage-Output: + properties: + role: + type: string + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + title: Tool Calls + items: + $ref: '#/components/schemas/ToolCall' + type: array + type: object + required: + - content + - stop_reason + title: CompletionMessage + description: "A message containing the model's (assistant) response in a chat conversation.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param stop_reason: Reason why the model stopped generating. Options are:\n - `StopReason.end_of_turn`: The model finished generating the entire response.\n - `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n - `StopReason.out_of_tokens`: The model ran out of token budget.\n:param tool_calls: List of tool calls. Each tool call is a ToolCall object." + Conversation: + properties: + id: + type: string + title: Id + description: The unique ID of the conversation. + object: + type: string + const: conversation + title: Object + description: The object type, which is always conversation. + default: conversation + created_at: + type: integer + title: Created At + description: The time at which the conversation was created, measured in seconds since the Unix epoch. + metadata: + title: Metadata + description: Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. + additionalProperties: + type: string type: object - OpenAIResponseInputToolFileSearch: - description: >- - File search tool configuration for OpenAI response inputs. - - - :param type: Tool type identifier, always "file_search" - - :param vector_store_ids: List of vector store identifiers to search within - - :param filters: (Optional) Additional filters to apply to the search - - :param max_num_results: (Optional) Maximum number of search results to - return (1-50) - - :param ranking_options: (Optional) Options for ranking and scoring search - results - properties: - type: - const: file_search - default: file_search - title: Type - type: string - vector_store_ids: - items: - type: string - title: Vector Store Ids - type: array - filters: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Filters - max_num_results: - anyOf: - - maximum: 50 - minimum: 1 - type: integer - - type: 'null' - default: 10 - title: Max Num Results - ranking_options: - anyOf: - - $ref: '#/$defs/SearchRankingOptions' - - type: 'null' - required: - - vector_store_ids - title: OpenAIResponseInputToolFileSearch + items: + title: Items + description: Initial items to include in the conversation context. You may add up to 20 items at a time. + items: + additionalProperties: true + type: object + type: array + type: object + required: + - id + - created_at + title: Conversation + description: OpenAI-compatible conversation object. + ConversationItemInclude: + type: string + enum: + - web_search_call.action.sources + - code_interpreter_call.outputs + - computer_call_output.output.image_url + - file_search_call.results + - message.input_image.image_url + - message.output_text.logprobs + - reasoning.encrypted_content + title: ConversationItemInclude + description: Specify additional output data to include in the model response. + ConversationItemList: + properties: + object: + type: string + title: Object + description: Object type + default: list + data: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + title: Data + description: List of conversation items + first_id: + title: First Id + description: The ID of the first item in the list + type: string + last_id: + title: Last Id + description: The ID of the last item in the list + type: string + has_more: + type: boolean + title: Has More + description: Whether there are more items available + default: false + type: object + required: + - data + title: ConversationItemList + description: List of conversation items with pagination. + DPOAlignmentConfig: + properties: + beta: + type: number + title: Beta + loss_type: + $ref: '#/components/schemas/DPOLossType' + default: sigmoid + type: object + required: + - beta + title: DPOAlignmentConfig + description: "Configuration for Direct Preference Optimization (DPO) alignment.\n\n:param beta: Temperature parameter for the DPO loss\n:param loss_type: The type of loss function to use for DPO" + DPOLossType: + type: string + enum: + - sigmoid + - hinge + - ipo + - kto_pair + title: DPOLossType + DataConfig: + properties: + dataset_id: + type: string + title: Dataset Id + batch_size: + type: integer + title: Batch Size + shuffle: + type: boolean + title: Shuffle + data_format: + $ref: '#/components/schemas/DatasetFormat' + validation_dataset_id: + title: Validation Dataset Id + type: string + packed: + title: Packed + default: false + type: boolean + train_on_input: + title: Train On Input + default: false + type: boolean + type: object + required: + - dataset_id + - batch_size + - shuffle + - data_format + title: DataConfig + description: "Configuration for training data and data loading.\n\n:param dataset_id: Unique identifier for the training dataset\n:param batch_size: Number of samples per training batch\n:param shuffle: Whether to shuffle the dataset during training\n:param data_format: Format of the dataset (instruct or dialog)\n:param validation_dataset_id: (Optional) Unique identifier for the validation dataset\n:param packed: (Optional) Whether to pack multiple samples into a single sequence for efficiency\n:param train_on_input: (Optional) Whether to compute loss on input tokens as well as output tokens" + Dataset: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + title: Provider Resource Id + description: Unique identifier for this resource in the provider + type: string + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: dataset + title: Type + default: dataset + purpose: + $ref: '#/components/schemas/DatasetPurpose' + source: + oneOf: + - $ref: '#/components/schemas/URIDataSource' + - $ref: '#/components/schemas/RowsDataSource' + title: Source + discriminator: + propertyName: type + mapping: + rows: '#/components/schemas/RowsDataSource' + uri: '#/components/schemas/URIDataSource' + metadata: + additionalProperties: true type: object - OpenAIResponseInputToolFunction: - description: >- - Function tool configuration for OpenAI response inputs. - - - :param type: Tool type identifier, always "function" - - :param name: Name of the function that can be called - - :param description: (Optional) Description of what the function does - - :param parameters: (Optional) JSON schema defining the function's parameters - - :param strict: (Optional) Whether to enforce strict parameter validation - properties: - type: - const: function - default: function - title: Type - type: string - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - parameters: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Parameters - strict: - anyOf: - - type: boolean - - type: 'null' - title: Strict - required: - - name - - parameters - title: OpenAIResponseInputToolFunction + title: Metadata + description: Any additional metadata for this dataset + type: object + required: + - identifier + - provider_id + - purpose + - source + title: Dataset + description: "Dataset resource for storing and accessing training or evaluation data.\n\n:param type: Type of resource, always 'dataset' for datasets" + DatasetFormat: + type: string + enum: + - instruct + - dialog + title: DatasetFormat + description: "Format of the training dataset.\n:cvar instruct: Instruction-following format with prompt and completion\n:cvar dialog: Multi-turn conversation format with messages" + DatasetPurpose: + type: string + enum: + - post-training/messages + - eval/question-answer + - eval/messages-answer + title: DatasetPurpose + description: "Purpose of the dataset. Each purpose has a required input data schema.\n\n:cvar post-training/messages: The dataset contains messages used for post-training.\n {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello, world!\"},\n {\"role\": \"assistant\", \"content\": \"Hello, world!\"},\n ]\n }\n:cvar eval/question-answer: The dataset contains a question column and an answer column.\n {\n \"question\": \"What is the capital of France?\",\n \"answer\": \"Paris\"\n }\n:cvar eval/messages-answer: The dataset contains a messages column with list of messages and an answer column.\n {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello, my name is John Doe.\"},\n {\"role\": \"assistant\", \"content\": \"Hello, John Doe. How can I help you today?\"},\n {\"role\": \"user\", \"content\": \"What's my name?\"},\n ],\n \"answer\": \"John Doe\"\n }" + DefaultRAGQueryGeneratorConfig: + properties: + type: + type: string + const: default + title: Type + default: default + separator: + type: string + title: Separator + default: ' ' + type: object + title: DefaultRAGQueryGeneratorConfig + description: "Configuration for the default RAG query generator.\n\n:param type: Type of query generator, always 'default'\n:param separator: String separator used to join query terms" + Document: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + title: Content + mime_type: + type: string + title: Mime Type + type: object + required: + - content + - mime_type + title: Document + description: "A document to be used by an agent.\n\n:param content: The content of the document.\n:param mime_type: The MIME type of the document." + EfficiencyConfig: + properties: + enable_activation_checkpointing: + title: Enable Activation Checkpointing + default: false + type: boolean + enable_activation_offloading: + title: Enable Activation Offloading + default: false + type: boolean + memory_efficient_fsdp_wrap: + title: Memory Efficient Fsdp Wrap + default: false + type: boolean + fsdp_cpu_offload: + title: Fsdp Cpu Offload + default: false + type: boolean + type: object + title: EfficiencyConfig + description: "Configuration for memory and compute efficiency optimizations.\n\n:param enable_activation_checkpointing: (Optional) Whether to use activation checkpointing to reduce memory usage\n:param enable_activation_offloading: (Optional) Whether to offload activations to CPU to save GPU memory\n:param memory_efficient_fsdp_wrap: (Optional) Whether to use memory-efficient FSDP wrapping\n:param fsdp_cpu_offload: (Optional) Whether to offload FSDP parameters to CPU" + Errors: + properties: + data: + title: Data + items: + $ref: '#/components/schemas/BatchError' + type: array + object: + title: Object + type: string + additionalProperties: true + type: object + title: Errors + EvaluateResponse: + properties: + generations: + items: + additionalProperties: true + type: object + type: array + title: Generations + scores: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' type: object - OpenAIResponseInputToolWebSearch: - description: >- - Web search tool configuration for OpenAI response inputs. - - - :param type: Web search tool type variant to use - - :param search_context_size: (Optional) Size of search context, must be - "low", "medium", or "high" - properties: - type: - anyOf: - - const: web_search - type: string - - const: web_search_preview - type: string - - const: web_search_preview_2025_03_11 - type: string - default: web_search - title: Type - search_context_size: - anyOf: - - pattern: ^low|medium|high$ - type: string - - type: 'null' - default: medium - title: Search Context Size - title: OpenAIResponseInputToolWebSearch + title: Scores + type: object + required: + - generations + - scores + title: EvaluateResponse + description: "The response from an evaluation.\n\n:param generations: The generations from the evaluation.\n:param scores: The scores from the evaluation." + GrammarResponseFormat: + properties: + type: + type: string + const: grammar + title: Type + default: grammar + bnf: + additionalProperties: true type: object - OpenAIResponseMCPApprovalRequest: - description: >- - A request for human approval of a tool invocation. - properties: - arguments: - title: Arguments - type: string - id: - title: Id - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - type: - const: mcp_approval_request - default: mcp_approval_request - title: Type - type: string - required: - - arguments - - id - - name - - server_label - title: OpenAIResponseMCPApprovalRequest + title: Bnf + type: object + required: + - bnf + title: GrammarResponseFormat + description: "Configuration for grammar-guided response generation.\n\n:param type: Must be \"grammar\" to identify this format type\n:param bnf: The BNF grammar specification the response should conform to" + GreedySamplingStrategy: + properties: + type: + type: string + const: greedy + title: Type + default: greedy + type: object + title: GreedySamplingStrategy + description: "Greedy sampling strategy that selects the highest probability token at each step.\n\n:param type: Must be \"greedy\" to identify this sampling strategy" + HealthInfo: + properties: + status: + $ref: '#/components/schemas/HealthStatus' + type: object + required: + - status + title: HealthInfo + description: "Health status information for the service.\n\n:param status: Current health status of the service" + HealthStatus: + type: string + enum: + - OK + - Error + - Not Implemented + title: HealthStatus + ImageContentItem-Input: + properties: + type: + type: string + const: image + title: Type + default: image + image: + $ref: '#/components/schemas/_URLOrData' + type: object + required: + - image + title: ImageContentItem + description: "A image content item\n\n:param type: Discriminator type of the content item. Always \"image\"\n:param image: Image as a base64 encoded string or an URL" + ImageContentItem-Output: + properties: + type: + type: string + const: image + title: Type + default: image + image: + $ref: '#/components/schemas/_URLOrData' + type: object + required: + - image + title: ImageContentItem + description: "A image content item\n\n:param type: Discriminator type of the content item. Always \"image\"\n:param image: Image as a base64 encoded string or an URL" + InferenceStep-Output: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + started_at: + title: Started At + type: string + format: date-time + completed_at: + title: Completed At + type: string + format: date-time + step_type: + type: string + const: inference + title: Step Type + default: inference + model_response: + $ref: '#/components/schemas/CompletionMessage-Output' + type: object + required: + - turn_id + - step_id + - model_response + title: InferenceStep + description: "An inference step in an agent turn.\n\n:param model_response: The response from the LLM." + InputTokensDetails: + properties: + cached_tokens: + type: integer + title: Cached Tokens + additionalProperties: true + type: object + required: + - cached_tokens + title: InputTokensDetails + Job: + properties: + job_id: + type: string + title: Job Id + status: + $ref: '#/components/schemas/JobStatus' + type: object + required: + - job_id + - status + title: Job + description: "A job execution instance with status tracking.\n\n:param job_id: Unique identifier for the job\n:param status: Current execution status of the job" + JobStatus: + type: string + enum: + - completed + - in_progress + - failed + - scheduled + - cancelled + title: JobStatus + description: "Status of a job execution.\n:cvar completed: Job has finished successfully\n:cvar in_progress: Job is currently running\n:cvar failed: Job has failed during execution\n:cvar scheduled: Job is scheduled but not yet started\n:cvar cancelled: Job was cancelled before completion" + JsonSchemaResponseFormat: + properties: + type: + type: string + const: json_schema + title: Type + default: json_schema + json_schema: + additionalProperties: true type: object - OpenAIResponseMessage: - description: >- - Corresponds to the various Message types in the Responses API. - - They are all under one type because the Responses API gives them all - - the same "type" value, and there is no way to tell them apart in certain - - scenarios. - properties: - content: - anyOf: - - type: string - - items: - discriminator: - mapping: - input_image: >- - #/$defs/OpenAIResponseInputMessageContentImage - input_text: >- - #/$defs/OpenAIResponseInputMessageContentText - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentText - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentImage - type: array - - items: - discriminator: - mapping: - output_text: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - refusal: '#/$defs/OpenAIResponseContentPartRefusal' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - - $ref: '#/$defs/OpenAIResponseContentPartRefusal' - type: array - title: Content - role: - anyOf: - - const: system - type: string - - const: developer - type: string - - const: user - type: string - - const: assistant - type: string - title: Role - type: - const: message - default: message - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - content - - role - title: OpenAIResponseMessage + title: Json Schema + type: object + required: + - json_schema + title: JsonSchemaResponseFormat + description: "Configuration for JSON schema-guided response generation.\n\n:param type: Must be \"json_schema\" to identify this format type\n:param json_schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model." + JsonType: + properties: + type: + type: string + const: json + title: Type + default: json + type: object + title: JsonType + description: "Parameter type for JSON values.\n\n:param type: Discriminator type. Always \"json\"" + LLMAsJudgeScoringFnParams: + properties: + type: + type: string + const: llm_as_judge + title: Type + default: llm_as_judge + judge_model: + type: string + title: Judge Model + prompt_template: + title: Prompt Template + type: string + judge_score_regexes: + items: + type: string + type: array + title: Judge Score Regexes + description: Regexes to extract the answer from generated response + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row + type: object + required: + - judge_model + title: LLMAsJudgeScoringFnParams + description: "Parameters for LLM-as-judge scoring function configuration.\n:param type: The type of scoring function parameters, always llm_as_judge\n:param judge_model: Identifier of the LLM model to use as a judge for scoring\n:param prompt_template: (Optional) Custom prompt template for the judge model\n:param judge_score_regexes: Regexes to extract the answer from generated response\n:param aggregation_functions: Aggregation functions to apply to the scores of each row" + LLMRAGQueryGeneratorConfig: + properties: + type: + type: string + const: llm + title: Type + default: llm + model: + type: string + title: Model + template: + type: string + title: Template + type: object + required: + - model + - template + title: LLMRAGQueryGeneratorConfig + description: "Configuration for the LLM-based RAG query generator.\n\n:param type: Type of query generator, always 'llm'\n:param model: Name of the language model to use for query generation\n:param template: Template string for formatting the query generation prompt" + ListBenchmarksResponse: + properties: + data: + items: + $ref: '#/components/schemas/Benchmark' + type: array + title: Data + type: object + required: + - data + title: ListBenchmarksResponse + ListDatasetsResponse: + properties: + data: + items: + $ref: '#/components/schemas/Dataset' + type: array + title: Data + type: object + required: + - data + title: ListDatasetsResponse + description: "Response from listing datasets.\n\n:param data: List of datasets" + ListModelsResponse: + properties: + data: + items: + $ref: '#/components/schemas/Model' + type: array + title: Data + type: object + required: + - data + title: ListModelsResponse + ListPostTrainingJobsResponse: + properties: + data: + items: + $ref: '#/components/schemas/PostTrainingJob' + type: array + title: Data + type: object + required: + - data + title: ListPostTrainingJobsResponse + ListPromptsResponse: + properties: + data: + items: + $ref: '#/components/schemas/Prompt' + type: array + title: Data + type: object + required: + - data + title: ListPromptsResponse + description: Response model to list prompts. + ListProvidersResponse: + properties: + data: + items: + $ref: '#/components/schemas/ProviderInfo' + type: array + title: Data + type: object + required: + - data + title: ListProvidersResponse + description: "Response containing a list of all available providers.\n\n:param data: List of provider information objects" + ListRoutesResponse: + properties: + data: + items: + $ref: '#/components/schemas/RouteInfo' + type: array + title: Data + type: object + required: + - data + title: ListRoutesResponse + description: "Response containing a list of all available API routes.\n\n:param data: List of available route information objects" + ListScoringFunctionsResponse: + properties: + data: + items: + $ref: '#/components/schemas/ScoringFn-Output' + type: array + title: Data + type: object + required: + - data + title: ListScoringFunctionsResponse + ListShieldsResponse: + properties: + data: + items: + $ref: '#/components/schemas/Shield' + type: array + title: Data + type: object + required: + - data + title: ListShieldsResponse + ListToolGroupsResponse: + properties: + data: + items: + $ref: '#/components/schemas/ToolGroup' + type: array + title: Data + type: object + required: + - data + title: ListToolGroupsResponse + description: "Response containing a list of tool groups.\n\n:param data: List of tool groups" + MCPListToolsTool: + properties: + input_schema: + additionalProperties: true type: object - "OpenAIResponseOutputMessageContentOutputText": - properties: - text: - title: Text - type: string - type: - const: output_text - default: output_text - title: Type - type: string - annotations: - items: - discriminator: - mapping: - container_file_citation: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - file_citation: >- - #/$defs/OpenAIResponseAnnotationFileCitation - file_path: '#/$defs/OpenAIResponseAnnotationFilePath' - url_citation: '#/$defs/OpenAIResponseAnnotationCitation' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseAnnotationFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationCitation' - - $ref: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' - title: Annotations - type: array - required: - - text - title: >- - OpenAIResponseOutputMessageContentOutputText + title: Input Schema + name: + type: string + title: Name + description: + title: Description + type: string + type: object + required: + - input_schema + - name + title: MCPListToolsTool + description: "Tool definition returned by MCP list tools operation.\n\n:param input_schema: JSON schema defining the tool's input parameters\n:param name: Name of the tool\n:param description: (Optional) Description of what the tool does" + MemoryRetrievalStep-Output: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + started_at: + title: Started At + type: string + format: date-time + completed_at: + title: Completed At + type: string + format: date-time + step_type: + type: string + const: memory_retrieval + title: Step Type + default: memory_retrieval + vector_store_ids: + type: string + title: Vector Store Ids + inserted_context: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Inserted Context + type: object + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + description: "A memory retrieval step in an agent turn.\n\n:param vector_store_ids: The IDs of the vector databases to retrieve context from.\n:param inserted_context: The context retrieved from the vector databases." + Model: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + title: Provider Resource Id + description: Unique identifier for this resource in the provider + type: string + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: model + title: Type + default: model + metadata: + additionalProperties: true type: object - "OpenAIResponseOutputMessageFileSearchToolCall": - description: >- - File search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param queries: List of search queries executed - - :param status: Current status of the file search operation - - :param type: Tool call type identifier, always "file_search_call" - - :param results: (Optional) Search results returned by the file search - operation - properties: - id: - title: Id - type: string - queries: - items: - type: string - title: Queries - type: array - status: - title: Status - type: string - type: - const: file_search_call - default: file_search_call - title: Type - type: string - results: - anyOf: - - items: - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults - type: array - - type: 'null' - title: Results - required: - - id - - queries - - status - title: >- - OpenAIResponseOutputMessageFileSearchToolCall + title: Metadata + description: Any additional metadata for this model + model_type: + $ref: '#/components/schemas/ModelType' + default: llm + type: object + required: + - identifier + - provider_id + title: Model + description: "A model resource representing an AI model registered in Llama Stack.\n\n:param type: The resource type, always 'model' for model resources\n:param model_type: The type of model (LLM or embedding model)\n:param metadata: Any additional metadata for this model\n:param identifier: Unique identifier for this resource in llama stack\n:param provider_resource_id: Unique identifier for this resource in the provider\n:param provider_id: ID of the provider that owns this resource" + ModelCandidate: + properties: + type: + type: string + const: model + title: Type + default: model + model: + type: string + title: Model + sampling_params: + $ref: '#/components/schemas/SamplingParams' + system_message: + $ref: '#/components/schemas/SystemMessage' + type: object + required: + - model + - sampling_params + title: ModelCandidate + description: "A model candidate for evaluation.\n\n:param model: The model ID to evaluate.\n:param sampling_params: The sampling parameters for the model.\n:param system_message: (Optional) The system message providing instructions or context to the model." + ModelType: + type: string + enum: + - llm + - embedding + - rerank + title: ModelType + description: "Enumeration of supported model types in Llama Stack.\n:cvar llm: Large language model for text generation and completion\n:cvar embedding: Embedding model for converting text to vector representations\n:cvar rerank: Reranking model for reordering documents based on their relevance to a query" + ModerationObject: + properties: + id: + type: string + title: Id + model: + type: string + title: Model + results: + items: + $ref: '#/components/schemas/ModerationObjectResults' + type: array + title: Results + type: object + required: + - id + - model + - results + title: ModerationObject + description: "A moderation object.\n:param id: The unique identifier for the moderation request.\n:param model: The model used to generate the moderation results.\n:param results: A list of moderation objects" + ModerationObjectResults: + properties: + flagged: + type: boolean + title: Flagged + categories: + title: Categories + additionalProperties: + type: boolean type: object - "OpenAIResponseOutputMessageFileSearchToolCallResults": - description: >- - Search results returned by the file search operation. - - - :param attributes: (Optional) Key-value attributes associated with the - file - - :param file_id: Unique identifier of the file containing the result - - :param filename: Name of the file containing the result - - :param score: Relevance score for this search result (between 0 and 1) - - :param text: Text content of the search result - properties: - attributes: - additionalProperties: true - title: Attributes - type: object - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - score: - title: Score - type: number - text: - title: Text + category_applied_input_types: + title: Category Applied Input Types + additionalProperties: + items: type: string - required: - - attributes - - file_id - - filename - - score - - text - title: >- - OpenAIResponseOutputMessageFileSearchToolCallResults + type: array type: object - "OpenAIResponseOutputMessageFunctionToolCall": - description: >- - Function tool call output message for OpenAI responses. - - - :param call_id: Unique identifier for the function call - - :param name: Name of the function being called - - :param arguments: JSON string containing the function arguments - - :param type: Tool call type identifier, always "function_call" - - :param id: (Optional) Additional identifier for the tool call - - :param status: (Optional) Current status of the function call execution - properties: - call_id: - title: Call Id - type: string - name: - title: Name - type: string - arguments: - title: Arguments - type: string - type: - const: function_call - default: function_call - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - name - - arguments - title: >- - OpenAIResponseOutputMessageFunctionToolCall + category_scores: + title: Category Scores + additionalProperties: + type: number type: object - OpenAIResponseOutputMessageMCPCall: - description: >- - Model Context Protocol (MCP) call output message for OpenAI responses. - - - :param id: Unique identifier for this MCP call - - :param type: Tool call type identifier, always "mcp_call" - - :param arguments: JSON string containing the MCP call arguments - - :param name: Name of the MCP method being called - - :param server_label: Label identifying the MCP server handling the call - - :param error: (Optional) Error message if the MCP call failed - - :param output: (Optional) Output result from the successful MCP call - properties: - id: - title: Id - type: string - type: - const: mcp_call - default: mcp_call - title: Type - type: string - arguments: - title: Arguments - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - error: - anyOf: - - type: string - - type: 'null' - title: Error - output: - anyOf: - - type: string - - type: 'null' - title: Output - required: - - id - - arguments - - name - - server_label - title: OpenAIResponseOutputMessageMCPCall + user_message: + title: User Message + type: string + metadata: + additionalProperties: true type: object - OpenAIResponseOutputMessageMCPListTools: - description: >- - MCP list tools output message containing available tools from an MCP server. - - - :param id: Unique identifier for this MCP list tools operation - - :param type: Tool call type identifier, always "mcp_list_tools" - - :param server_label: Label identifying the MCP server providing the tools - - :param tools: List of available tools provided by the MCP server - properties: - id: - title: Id - type: string - type: - const: mcp_list_tools - default: mcp_list_tools - title: Type - type: string - server_label: - title: Server Label - type: string - tools: - items: - $ref: '#/$defs/MCPListToolsTool' - title: Tools - type: array - required: - - id - - server_label - - tools - title: OpenAIResponseOutputMessageMCPListTools + title: Metadata + type: object + required: + - flagged + title: ModerationObjectResults + description: "A moderation object.\n:param flagged: Whether any of the below categories are flagged.\n:param categories: A list of the categories, and whether they are flagged or not.\n:param category_applied_input_types: A list of the categories along with the input type(s) that the score applies to.\n:param category_scores: A list of the categories along with their scores as predicted by model." + NumberType: + properties: + type: + type: string + const: number + title: Type + default: number + type: object + title: NumberType + description: "Parameter type for numeric values.\n\n:param type: Discriminator type. Always \"number\"" + ObjectType: + properties: + type: + type: string + const: object + title: Type + default: object + type: object + title: ObjectType + description: "Parameter type for object values.\n\n:param type: Discriminator type. Always \"object\"" + OpenAIAssistantMessageParam-Input: + properties: + role: + type: string + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + title: Name + type: string + tool_calls: + title: Tool Calls + items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + type: object + title: OpenAIAssistantMessageParam + description: "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param name: (Optional) The name of the assistant message participant.\n:param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object." + OpenAIAssistantMessageParam-Output: + properties: + role: + type: string + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + title: Name + type: string + tool_calls: + title: Tool Calls + items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + type: object + title: OpenAIAssistantMessageParam + description: "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param name: (Optional) The name of the assistant message participant.\n:param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object." + OpenAIChatCompletion: + properties: + id: + type: string + title: Id + choices: + items: + $ref: '#/components/schemas/OpenAIChoice-Output' + type: array + title: Choices + object: + type: string + const: chat.completion + title: Object + default: chat.completion + created: + type: integer + title: Created + model: + type: string + title: Model + usage: + $ref: '#/components/schemas/OpenAIChatCompletionUsage' + type: object + required: + - id + - choices + - created + - model + title: OpenAIChatCompletion + description: "Response from an OpenAI-compatible chat completion request.\n\n:param id: The ID of the chat completion\n:param choices: List of choices\n:param object: The object type, which will be \"chat.completion\"\n:param created: The Unix timestamp in seconds when the chat completion was created\n:param model: The model that was used to generate the chat completion\n:param usage: Token usage information for the completion" + OpenAIChatCompletionContentPartImageParam: + properties: + type: + type: string + const: image_url + title: Type + default: image_url + image_url: + $ref: '#/components/schemas/OpenAIImageURL' + type: object + required: + - image_url + title: OpenAIChatCompletionContentPartImageParam + description: "Image content part for OpenAI-compatible chat completion messages.\n\n:param type: Must be \"image_url\" to identify this as image content\n:param image_url: Image URL specification and processing details" + OpenAIChatCompletionContentPartTextParam: + properties: + type: + type: string + const: text + title: Type + default: text + text: + type: string + title: Text + type: object + required: + - text + title: OpenAIChatCompletionContentPartTextParam + description: "Text content part for OpenAI-compatible chat completion messages.\n\n:param type: Must be \"text\" to identify this as text content\n:param text: The text content of the message" + OpenAIChatCompletionRequestWithExtraBody: + properties: + model: + type: string + title: Model + messages: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Input' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Input' + type: array + minItems: 1 + title: Messages + frequency_penalty: + title: Frequency Penalty + type: number + function_call: + anyOf: + - type: string + - additionalProperties: true + type: object + title: Function Call + functions: + title: Functions + items: + additionalProperties: true + type: object + type: array + logit_bias: + title: Logit Bias + additionalProperties: + type: number type: object - "OpenAIResponseOutputMessageWebSearchToolCall": - description: >- - Web search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param status: Current status of the web search operation - - :param type: Tool call type identifier, always "web_search_call" - properties: - id: - title: Id - type: string - status: - title: Status - type: string - type: - const: web_search_call - default: web_search_call - title: Type + logprobs: + title: Logprobs + type: boolean + max_completion_tokens: + title: Max Completion Tokens + type: integer + max_tokens: + title: Max Tokens + type: integer + n: + title: N + type: integer + parallel_tool_calls: + title: Parallel Tool Calls + type: boolean + presence_penalty: + title: Presence Penalty + type: number + response_format: + title: Response Format + oneOf: + - $ref: '#/components/schemas/OpenAIResponseFormatText' + - $ref: '#/components/schemas/OpenAIResponseFormatJSONSchema' + - $ref: '#/components/schemas/OpenAIResponseFormatJSONObject' + discriminator: + propertyName: type + mapping: + json_object: '#/components/schemas/OpenAIResponseFormatJSONObject' + json_schema: '#/components/schemas/OpenAIResponseFormatJSONSchema' + text: '#/components/schemas/OpenAIResponseFormatText' + seed: + title: Seed + type: integer + stop: + anyOf: + - type: string + - items: type: string - required: - - id - - status - title: >- - OpenAIResponseOutputMessageWebSearchToolCall - type: object - OpenAIResponseText: - description: >- - Text response configuration for OpenAI responses. - - - :param format: (Optional) Text format configuration specifying output - format requirements - properties: - format: - anyOf: - - $ref: '#/$defs/OpenAIResponseTextFormat' - - type: 'null' - title: OpenAIResponseText - type: object - OpenAIResponseTextFormat: - description: >- - Configuration for Responses API text format. - - - :param type: Must be "text", "json_schema", or "json_object" to identify - the format type - - :param name: The name of the response format. Only used for json_schema. - - :param schema: The JSON schema the response should conform to. In a Python - SDK, this is often a `pydantic` model. Only used for json_schema. - - :param description: (Optional) A description of the response format. Only - used for json_schema. - - :param strict: (Optional) Whether to strictly enforce the JSON schema. - If true, the response must match the schema exactly. Only used for json_schema. - properties: - type: - anyOf: - - const: text - type: string - - const: json_schema - type: string - - const: json_object - type: string - title: Type - name: - anyOf: - - type: string - - type: 'null' - title: Name - schema: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Schema - description: - anyOf: - - type: string - - type: 'null' - title: Description - strict: - anyOf: - - type: boolean - - type: 'null' - title: Strict - title: OpenAIResponseTextFormat + type: array + title: Stop + stream: + title: Stream + type: boolean + stream_options: + title: Stream Options + additionalProperties: true type: object - OpenAIResponseToolMCP: - description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response object. - - - :param type: Tool type identifier, always "mcp" - - :param server_label: Label to identify this MCP server - - :param allowed_tools: (Optional) Restriction on which tools can be used - from this server - properties: - type: - const: mcp - default: mcp - title: Type + temperature: + title: Temperature + type: number + tool_choice: + anyOf: + - type: string + - additionalProperties: true + type: object + title: Tool Choice + tools: + title: Tools + items: + additionalProperties: true + type: object + type: array + top_logprobs: + title: Top Logprobs + type: integer + top_p: + title: Top P + type: number + user: + title: User + type: string + additionalProperties: true + type: object + required: + - model + - messages + title: OpenAIChatCompletionRequestWithExtraBody + description: "Request parameters for OpenAI-compatible chat completion endpoint.\n\n:param model: The identifier of the model to use. The model must be registered with Llama Stack and available via the /models endpoint.\n:param messages: List of messages in the conversation.\n:param frequency_penalty: (Optional) The penalty for repeated tokens.\n:param function_call: (Optional) The function call to use.\n:param functions: (Optional) List of functions to use.\n:param logit_bias: (Optional) The logit bias to use.\n:param logprobs: (Optional) The log probabilities to use.\n:param max_completion_tokens: (Optional) The maximum number of tokens to generate.\n:param max_tokens: (Optional) The maximum number of tokens to generate.\n:param n: (Optional) The number of completions to generate.\n:param parallel_tool_calls: (Optional) Whether to parallelize tool calls.\n:param presence_penalty: (Optional) The penalty for repeated tokens.\n:param response_format: (Optional) The response format to use.\n:param seed: (Optional) The seed to use.\n:param stop: (Optional) The stop tokens to use.\n:param stream: (Optional) Whether to stream the response.\n:param stream_options: (Optional) The stream options to use.\n:param temperature: (Optional) The temperature to use.\n:param tool_choice: (Optional) The tool choice to use.\n:param tools: (Optional) The tools to use.\n:param top_logprobs: (Optional) The top log probabilities to use.\n:param top_p: (Optional) The top p to use.\n:param user: (Optional) The user to use." + OpenAIChatCompletionToolCall: + properties: + index: + title: Index + type: integer + id: + title: Id + type: string + type: + type: string + const: function + title: Type + default: function + function: + $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' + type: object + title: OpenAIChatCompletionToolCall + description: "Tool call specification for OpenAI-compatible chat completion responses.\n\n:param index: (Optional) Index of the tool call in the list\n:param id: (Optional) Unique identifier for the tool call\n:param type: Must be \"function\" to identify this as a function call\n:param function: (Optional) Function call details" + OpenAIChatCompletionToolCallFunction: + properties: + name: + title: Name + type: string + arguments: + title: Arguments + type: string + type: object + title: OpenAIChatCompletionToolCallFunction + description: "Function call details for OpenAI-compatible tool calls.\n\n:param name: (Optional) Name of the function to call\n:param arguments: (Optional) Arguments to pass to the function as a JSON string" + OpenAIChatCompletionUsage: + properties: + prompt_tokens: + type: integer + title: Prompt Tokens + completion_tokens: + type: integer + title: Completion Tokens + total_tokens: + type: integer + title: Total Tokens + prompt_tokens_details: + $ref: '#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails' + completion_tokens_details: + $ref: '#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails' + type: object + required: + - prompt_tokens + - completion_tokens + - total_tokens + title: OpenAIChatCompletionUsage + description: "Usage information for OpenAI chat completion.\n\n:param prompt_tokens: Number of tokens in the prompt\n:param completion_tokens: Number of tokens in the completion\n:param total_tokens: Total tokens used (prompt + completion)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + OpenAIChatCompletionUsageCompletionTokensDetails: + properties: + reasoning_tokens: + title: Reasoning Tokens + type: integer + type: object + title: OpenAIChatCompletionUsageCompletionTokensDetails + description: "Token details for output tokens in OpenAI chat completion usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + OpenAIChatCompletionUsagePromptTokensDetails: + properties: + cached_tokens: + title: Cached Tokens + type: integer + type: object + title: OpenAIChatCompletionUsagePromptTokensDetails + description: "Token details for prompt tokens in OpenAI chat completion usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + OpenAIChoice-Output: + properties: + message: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Output' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Output' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Message + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Output' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Output' + finish_reason: + type: string + title: Finish Reason + index: + type: integer + title: Index + logprobs: + $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + type: object + required: + - message + - finish_reason + - index + title: OpenAIChoice + description: "A choice from an OpenAI-compatible chat completion response.\n\n:param message: The message from the model\n:param finish_reason: The reason the model stopped generating\n:param index: The index of the choice\n:param logprobs: (Optional) The log probabilities for the tokens in the message" + OpenAIChoiceLogprobs-Output: + properties: + content: + title: Content + items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + refusal: + title: Refusal + items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + type: object + title: OpenAIChoiceLogprobs + description: "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response.\n\n:param content: (Optional) The log probabilities for the tokens in the message\n:param refusal: (Optional) The log probabilities for the tokens in the message" + OpenAICompletion: + properties: + id: + type: string + title: Id + choices: + items: + $ref: '#/components/schemas/OpenAICompletionChoice-Output' + type: array + title: Choices + created: + type: integer + title: Created + model: + type: string + title: Model + object: + type: string + const: text_completion + title: Object + default: text_completion + type: object + required: + - id + - choices + - created + - model + title: OpenAICompletion + description: "Response from an OpenAI-compatible completion request.\n\n:id: The ID of the completion\n:choices: List of choices\n:created: The Unix timestamp in seconds when the completion was created\n:model: The model that was used to generate the completion\n:object: The object type, which will be \"text_completion\"" + OpenAICompletionChoice-Output: + properties: + finish_reason: + type: string + title: Finish Reason + text: + type: string + title: Text + index: + type: integer + title: Index + logprobs: + $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + type: object + required: + - finish_reason + - text + - index + title: OpenAICompletionChoice + description: "A choice from an OpenAI-compatible completion response.\n\n:finish_reason: The reason the model stopped generating\n:text: The text of the choice\n:index: The index of the choice\n:logprobs: (Optional) The log probabilities for the tokens in the choice" + OpenAICompletionRequestWithExtraBody: + properties: + model: + type: string + title: Model + prompt: + anyOf: + - type: string + - items: type: string - server_label: - title: Server Label + type: array + - items: + type: integer + type: array + - items: + items: + type: integer + type: array + type: array + title: Prompt + best_of: + title: Best Of + type: integer + echo: + title: Echo + type: boolean + frequency_penalty: + title: Frequency Penalty + type: number + logit_bias: + title: Logit Bias + additionalProperties: + type: number + type: object + logprobs: + title: Logprobs + type: boolean + max_tokens: + title: Max Tokens + type: integer + n: + title: N + type: integer + presence_penalty: + title: Presence Penalty + type: number + seed: + title: Seed + type: integer + stop: + anyOf: + - type: string + - items: type: string - allowed_tools: - anyOf: - - items: - type: string - type: array - - $ref: '#/$defs/AllowedToolsFilter' - - type: 'null' - title: Allowed Tools - required: - - server_label - title: OpenAIResponseToolMCP + type: array + title: Stop + stream: + title: Stream + type: boolean + stream_options: + title: Stream Options + additionalProperties: true type: object - OpenAIResponseUsage: - description: >- - Usage information for OpenAI response. - - - :param input_tokens: Number of tokens in the input - - :param output_tokens: Number of tokens in the output - - :param total_tokens: Total tokens used (input + output) - - :param input_tokens_details: Detailed breakdown of input token usage - - :param output_tokens_details: Detailed breakdown of output token usage - properties: - input_tokens: - title: Input Tokens - type: integer - output_tokens: - title: Output Tokens - type: integer - total_tokens: - title: Total Tokens - type: integer - input_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIResponseUsageInputTokensDetails - - type: 'null' - output_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIResponseUsageOutputTokensDetails - - type: 'null' - required: - - input_tokens - - output_tokens - - total_tokens - title: OpenAIResponseUsage + temperature: + title: Temperature + type: number + top_p: + title: Top P + type: number + user: + title: User + type: string + suffix: + title: Suffix + type: string + additionalProperties: true + type: object + required: + - model + - prompt + title: OpenAICompletionRequestWithExtraBody + description: "Request parameters for OpenAI-compatible completion endpoint.\n\n:param model: The identifier of the model to use. The model must be registered with Llama Stack and available via the /models endpoint.\n:param prompt: The prompt to generate a completion for.\n:param best_of: (Optional) The number of completions to generate.\n:param echo: (Optional) Whether to echo the prompt.\n:param frequency_penalty: (Optional) The penalty for repeated tokens.\n:param logit_bias: (Optional) The logit bias to use.\n:param logprobs: (Optional) The log probabilities to use.\n:param max_tokens: (Optional) The maximum number of tokens to generate.\n:param n: (Optional) The number of completions to generate.\n:param presence_penalty: (Optional) The penalty for repeated tokens.\n:param seed: (Optional) The seed to use.\n:param stop: (Optional) The stop tokens to use.\n:param stream: (Optional) Whether to stream the response.\n:param stream_options: (Optional) The stream options to use.\n:param temperature: (Optional) The temperature to use.\n:param top_p: (Optional) The top p to use.\n:param user: (Optional) The user to use.\n:param suffix: (Optional) The suffix that should be appended to the completion." + OpenAICreateVectorStoreFileBatchRequestWithExtraBody: + properties: + file_ids: + items: + type: string + type: array + title: File Ids + attributes: + title: Attributes + additionalProperties: true type: object - OpenAIResponseUsageInputTokensDetails: - description: >- - Token details for input tokens in OpenAI response usage. - - - :param cached_tokens: Number of tokens retrieved from cache - properties: - cached_tokens: - anyOf: - - type: integer - - type: 'null' - title: Cached Tokens - title: OpenAIResponseUsageInputTokensDetails + chunking_strategy: + title: Chunking Strategy + oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + additionalProperties: true + type: object + required: + - file_ids + title: OpenAICreateVectorStoreFileBatchRequestWithExtraBody + description: "Request to create a vector store file batch with extra_body support.\n\n:param file_ids: A list of File IDs that the vector store should use\n:param attributes: (Optional) Key-value attributes to store with the files\n:param chunking_strategy: (Optional) The chunking strategy used to chunk the file(s). Defaults to auto" + OpenAICreateVectorStoreRequestWithExtraBody: + properties: + name: + title: Name + type: string + file_ids: + title: File Ids + items: + type: string + type: array + expires_after: + title: Expires After + additionalProperties: true type: object - OpenAIResponseUsageOutputTokensDetails: - description: >- - Token details for output tokens in OpenAI response usage. - - - :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) - properties: - reasoning_tokens: - anyOf: - - type: integer - - type: 'null' - title: Reasoning Tokens - title: OpenAIResponseUsageOutputTokensDetails + chunking_strategy: + title: Chunking Strategy + additionalProperties: true type: object - SearchRankingOptions: - description: >- - Options for ranking and filtering search results. - - - :param ranker: (Optional) Name of the ranking algorithm to use - - :param score_threshold: (Optional) Minimum relevance score threshold for - results - properties: - ranker: - anyOf: - - type: string - - type: 'null' - title: Ranker - score_threshold: - anyOf: - - type: number - - type: 'null' - default: 0.0 - title: Score Threshold - title: SearchRankingOptions + metadata: + title: Metadata + additionalProperties: true type: object - description: >- - Complete OpenAI response object containing generation results and metadata. - - - :param created_at: Unix timestamp when the response was created - - :param error: (Optional) Error details if the response generation failed - - :param id: Unique identifier for this response - - :param model: Model identifier used for generation - - :param object: Object type identifier, always "response" - - :param output: List of generated output items (messages, tool calls, etc.) - - :param parallel_tool_calls: Whether tool calls can be executed in parallel - - :param previous_response_id: (Optional) ID of the previous response in a conversation - - :param status: Current status of the response generation - - :param temperature: (Optional) Sampling temperature used for generation - - :param text: Text formatting configuration for the response - - :param top_p: (Optional) Nucleus sampling parameter used for generation - - :param tools: (Optional) An array of tools the model may call while generating - a response. - - :param truncation: (Optional) Truncation strategy applied to the response - - :param usage: (Optional) Token usage information for the response - - :param instructions: (Optional) System message inserted into the model's context + additionalProperties: true + type: object + title: OpenAICreateVectorStoreRequestWithExtraBody + description: "Request to create a vector store with extra_body support.\n\n:param name: (Optional) A name for the vector store\n:param file_ids: List of file IDs to include in the vector store\n:param expires_after: (Optional) Expiration policy for the vector store\n:param chunking_strategy: (Optional) Strategy for splitting files into chunks\n:param metadata: Set of key-value pairs that can be attached to the vector store" + OpenAIDeveloperMessageParam: properties: - created_at: - title: Created At + role: + type: string + const: developer + title: Role + default: developer + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + title: Name + type: string + type: object + required: + - content + title: OpenAIDeveloperMessageParam + description: "A message from the developer in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"developer\" to identify this as a developer message\n:param content: The content of the developer message\n:param name: (Optional) The name of the developer message participant." + OpenAIEmbeddingData: + properties: + object: + type: string + const: embedding + title: Object + default: embedding + embedding: + anyOf: + - items: + type: number + type: array + - type: string + title: Embedding + index: type: integer - error: + title: Index + type: object + required: + - embedding + - index + title: OpenAIEmbeddingData + description: "A single embedding data object from an OpenAI-compatible embeddings response.\n\n:param object: The object type, which will be \"embedding\"\n:param embedding: The embedding vector as a list of floats (when encoding_format=\"float\") or as a base64-encoded string (when encoding_format=\"base64\")\n:param index: The index of the embedding in the input list" + OpenAIEmbeddingUsage: + properties: + prompt_tokens: + type: integer + title: Prompt Tokens + total_tokens: + type: integer + title: Total Tokens + type: object + required: + - prompt_tokens + - total_tokens + title: OpenAIEmbeddingUsage + description: "Usage information for an OpenAI-compatible embeddings response.\n\n:param prompt_tokens: The number of tokens in the input\n:param total_tokens: The total number of tokens used" + OpenAIEmbeddingsRequestWithExtraBody: + properties: + model: + type: string + title: Model + input: anyOf: - - $ref: '#/$defs/OpenAIResponseError' - - type: 'null' - id: - title: Id + - type: string + - items: + type: string + type: array + title: Input + encoding_format: + title: Encoding Format + default: float + type: string + dimensions: + title: Dimensions + type: integer + user: + title: User + type: string + additionalProperties: true + type: object + required: + - model + - input + title: OpenAIEmbeddingsRequestWithExtraBody + description: "Request parameters for OpenAI-compatible embeddings endpoint.\n\n:param model: The identifier of the model to use. The model must be an embedding model registered with Llama Stack and available via the /models endpoint.\n:param input: Input text to embed, encoded as a string or array of strings. To embed multiple inputs in a single request, pass an array of strings.\n:param encoding_format: (Optional) The format to return the embeddings in. Can be either \"float\" or \"base64\". Defaults to \"float\".\n:param dimensions: (Optional) The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.\n:param user: (Optional) A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse." + OpenAIEmbeddingsResponse: + properties: + object: type: string + const: list + title: Object + default: list + data: + items: + $ref: '#/components/schemas/OpenAIEmbeddingData' + type: array + title: Data model: + type: string title: Model + usage: + $ref: '#/components/schemas/OpenAIEmbeddingUsage' + type: object + required: + - data + - model + - usage + title: OpenAIEmbeddingsResponse + description: "Response from an OpenAI-compatible embeddings request.\n\n:param object: The object type, which will be \"list\"\n:param data: List of embedding data objects\n:param model: The model that was used to generate the embeddings\n:param usage: Usage information" + OpenAIFile: + properties: + type: type: string + const: file + title: Type + default: file + file: + $ref: '#/components/schemas/OpenAIFileFile' + type: object + required: + - file + title: OpenAIFile + OpenAIFileFile: + properties: + file_data: + title: File Data + type: string + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + type: object + title: OpenAIFileFile + OpenAIFileObject: + properties: object: - const: response - default: response + type: string + const: file title: Object + default: file + id: type: string - output: - items: - discriminator: - mapping: - file_search_call: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - function_call: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - mcp_list_tools: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - message: '#/$defs/OpenAIResponseMessage' - web_search_call: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseMessage' - - $ref: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' - title: Output - type: array - parallel_tool_calls: - default: false - title: Parallel Tool Calls + title: Id + bytes: + type: integer + title: Bytes + created_at: + type: integer + title: Created At + expires_at: + type: integer + title: Expires At + filename: + type: string + title: Filename + purpose: + $ref: '#/components/schemas/OpenAIFilePurpose' + type: object + required: + - id + - bytes + - created_at + - expires_at + - filename + - purpose + title: OpenAIFileObject + description: "OpenAI File object as defined in the OpenAI Files API.\n\n:param object: The object type, which is always \"file\"\n:param id: The file identifier, which can be referenced in the API endpoints\n:param bytes: The size of the file, in bytes\n:param created_at: The Unix timestamp (in seconds) for when the file was created\n:param expires_at: The Unix timestamp (in seconds) for when the file expires\n:param filename: The name of the file\n:param purpose: The intended purpose of the file" + OpenAIFilePurpose: + type: string + enum: + - assistants + - batch + title: OpenAIFilePurpose + description: Valid purpose values for OpenAI Files API. + OpenAIImageURL: + properties: + url: + type: string + title: Url + detail: + title: Detail + type: string + type: object + required: + - url + title: OpenAIImageURL + description: "Image URL specification for OpenAI-compatible chat completion messages.\n\n:param url: URL of the image to include in the message\n:param detail: (Optional) Level of detail for image processing. Can be \"low\", \"high\", or \"auto\"" + OpenAIJSONSchema: + properties: + name: + type: string + title: Name + description: + title: Description + type: string + strict: + title: Strict type: boolean - previous_response_id: + schema: + title: Schema + additionalProperties: true + type: object + type: object + title: OpenAIJSONSchema + description: "JSON schema specification for OpenAI-compatible structured response format.\n\n:param name: Name of the schema\n:param description: (Optional) Description of the schema\n:param strict: (Optional) Whether to enforce strict adherence to the schema\n:param schema: (Optional) The JSON schema definition" + OpenAIResponseAnnotationCitation: + properties: + type: type: string - description: >- - (Optional) ID of the previous response in a conversation - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - description: >- - (Optional) Reference to a prompt template and its variables. - status: - title: Status + const: url_citation + title: Type + default: url_citation + end_index: + type: integer + title: End Index + start_index: + type: integer + title: Start Index + title: type: string - temperature: - anyOf: - - type: number - - type: 'null' - title: Temperature - text: - $ref: '#/$defs/OpenAIResponseText' - default: - format: - type: text - top_p: - anyOf: - - type: number - - type: 'null' - title: Top P - tools: - anyOf: - - items: - discriminator: - mapping: - file_search: >- - #/$defs/OpenAIResponseInputToolFileSearch - function: '#/$defs/OpenAIResponseInputToolFunction' - mcp: '#/$defs/OpenAIResponseToolMCP' - web_search: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseInputToolWebSearch' - - $ref: >- - #/$defs/OpenAIResponseInputToolFileSearch - - $ref: '#/$defs/OpenAIResponseInputToolFunction' - - $ref: '#/$defs/OpenAIResponseToolMCP' - type: array - - type: 'null' - title: Tools - truncation: - anyOf: - - type: string - - type: 'null' - title: Truncation - usage: - anyOf: - - $ref: '#/$defs/OpenAIResponseUsage' - - type: 'null' - instructions: - anyOf: - - type: string - - type: 'null' - title: Instructions + title: Title + url: + type: string + title: Url + type: object required: - - created_at - - id - - model - - output - - status - title: OpenAIResponseObject + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + type: string + const: container_file_citation + title: Type + default: container_file_citation + container_id: + type: string + title: Container Id + end_index: + type: integer + title: End Index + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + start_index: + type: integer + title: Start Index + type: object + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + OpenAIResponseAnnotationFileCitation: + properties: + type: + type: string + const: file_citation + title: Type + default: file_citation + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + index: + type: integer + title: Index + type: object + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + OpenAIResponseAnnotationFilePath: + properties: + type: + type: string + const: file_path + title: Type + default: file_path + file_id: + type: string + title: File Id + index: + type: integer + title: Index + type: object + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + OpenAIResponseContentPartRefusal: + properties: + type: + type: string + const: refusal + title: Type + default: refusal + refusal: + type: string + title: Refusal + type: object + required: + - refusal + title: OpenAIResponseContentPartRefusal + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + OpenAIResponseError: + properties: + code: + type: string + title: Code + message: + type: string + title: Message + type: object + required: + - code + - message + title: OpenAIResponseError + description: "Error details for failed OpenAI response requests.\n\n:param code: Error code identifying the type of failure\n:param message: Human-readable error message describing the failure" + OpenAIResponseFormatJSONObject: + properties: + type: + type: string + const: json_object + title: Type + default: json_object + type: object + title: OpenAIResponseFormatJSONObject + description: "JSON object response format for OpenAI-compatible chat completion requests.\n\n:param type: Must be \"json_object\" to indicate generic JSON object response format" + OpenAIResponseFormatJSONSchema: + properties: + type: + type: string + const: json_schema + title: Type + default: json_schema + json_schema: + $ref: '#/components/schemas/OpenAIJSONSchema' type: object - AsyncIterator: + required: + - json_schema + title: OpenAIResponseFormatJSONSchema + description: "JSON schema response format for OpenAI-compatible chat completion requests.\n\n:param type: Must be \"json_schema\" to indicate structured JSON response format\n:param json_schema: The JSON schema specification for the response" + OpenAIResponseFormatText: + properties: + type: + type: string + const: text + title: Type + default: text type: object - OpenAIDeleteResponseObject: - description: >- - Response object confirming deletion of an OpenAI response. - - - :param id: Unique identifier of the deleted response - - :param object: Object type identifier, always "response" - - :param deleted: Deletion confirmation flag, always True + title: OpenAIResponseFormatText + description: "Text response format for OpenAI-compatible chat completion requests.\n\n:param type: Must be \"text\" to indicate plain text response format" + OpenAIResponseInputFunctionToolCallOutput: properties: + call_id: + type: string + title: Call Id + output: + type: string + title: Output + type: + type: string + const: function_call_output + title: Type + default: function_call_output id: title: Id type: string - object: - const: response - default: response - title: Object + status: + title: Status type: string - deleted: - default: true - title: Deleted - type: boolean - required: - - id - title: OpenAIDeleteResponseObject type: object - ListOpenAIResponseInputItem: - $defs: - MCPListToolsTool: - description: >- - Tool definition returned by MCP list tools operation. - - - :param input_schema: JSON schema defining the tool's input parameters - - :param name: Name of the tool - - :param description: (Optional) Description of what the tool does - properties: - input_schema: - additionalProperties: true - title: Input Schema - type: object - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - required: - - input_schema - - name - title: MCPListToolsTool - type: object - OpenAIResponseAnnotationCitation: - description: >- - URL citation annotation for referencing external web resources. - - - :param type: Annotation type identifier, always "url_citation" - - :param end_index: End position of the citation span in the content - - :param start_index: Start position of the citation span in the content - - :param title: Title of the referenced web resource - - :param url: URL of the referenced web resource - properties: - type: - const: url_citation - default: url_citation - title: Type - type: string - end_index: - title: End Index - type: integer - start_index: - title: Start Index - type: integer - title: - title: Title - type: string - url: - title: Url - type: string - required: - - end_index - - start_index - - title - - url - title: OpenAIResponseAnnotationCitation - type: object - "OpenAIResponseAnnotationContainerFileCitation": - properties: - type: - const: container_file_citation - default: container_file_citation - title: Type - type: string - container_id: - title: Container Id - type: string - end_index: - title: End Index - type: integer - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - start_index: - title: Start Index - type: integer - required: - - container_id - - end_index - - file_id - - filename - - start_index - title: >- - OpenAIResponseAnnotationContainerFileCitation - type: object - OpenAIResponseAnnotationFileCitation: - description: >- - File citation annotation for referencing specific files in response content. - - - :param type: Annotation type identifier, always "file_citation" - - :param file_id: Unique identifier of the referenced file - - :param filename: Name of the referenced file - - :param index: Position index of the citation within the content - properties: - type: - const: file_citation - default: file_citation - title: Type - type: string - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - index: - title: Index - type: integer - required: - - file_id - - filename - - index - title: OpenAIResponseAnnotationFileCitation - type: object - OpenAIResponseAnnotationFilePath: - properties: - type: - const: file_path - default: file_path - title: Type - type: string - file_id: - title: File Id - type: string - index: - title: Index - type: integer - required: - - file_id - - index - title: OpenAIResponseAnnotationFilePath - type: object - OpenAIResponseContentPartRefusal: - description: >- - Refusal content within a streamed response part. - - - :param type: Content part type identifier, always "refusal" - - :param refusal: Refusal text supplied by the model - properties: - type: - const: refusal - default: refusal - title: Type - type: string - refusal: - title: Refusal - type: string - required: - - refusal - title: OpenAIResponseContentPartRefusal - type: object - "OpenAIResponseInputFunctionToolCallOutput": - description: >- - This represents the output of a function call that gets passed back to - the model. - properties: - call_id: - title: Call Id - type: string - output: - title: Output - type: string - type: - const: function_call_output - default: function_call_output - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - output - title: >- - OpenAIResponseInputFunctionToolCallOutput + required: + - call_id + - output + title: OpenAIResponseInputFunctionToolCallOutput + description: This represents the output of a function call that gets passed back to the model. + OpenAIResponseInputMessageContentFile: + properties: + type: + type: string + const: input_file + title: Type + default: input_file + file_data: + title: File Data + type: string + file_id: + title: File Id + type: string + file_url: + title: File Url + type: string + filename: + title: Filename + type: string + type: object + title: OpenAIResponseInputMessageContentFile + description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + OpenAIResponseInputMessageContentImage: + properties: + detail: + anyOf: + - type: string + const: low + - type: string + const: high + - type: string + const: auto + title: Detail + default: auto + type: + type: string + const: input_image + title: Type + default: input_image + file_id: + title: File Id + type: string + image_url: + title: Image Url + type: string + type: object + title: OpenAIResponseInputMessageContentImage + description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + OpenAIResponseInputMessageContentText: + properties: + text: + type: string + title: Text + type: + type: string + const: input_text + title: Type + default: input_text + type: object + required: + - text + title: OpenAIResponseInputMessageContentText + description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + OpenAIResponseInputToolFileSearch: + properties: + type: + type: string + const: file_search + title: Type + default: file_search + vector_store_ids: + items: + type: string + type: array + title: Vector Store Ids + filters: + title: Filters + additionalProperties: true type: object - OpenAIResponseInputMessageContentImage: - description: >- - Image content for input messages in OpenAI response format. - - - :param detail: Level of detail for image processing, can be "low", "high", - or "auto" - - :param type: Content type identifier, always "input_image" - - :param image_url: (Optional) URL of the image content - properties: - detail: - anyOf: - - const: low - type: string - - const: high - type: string - - const: auto - type: string - default: auto - title: Detail - type: - const: input_image - default: input_image - title: Type - type: string - image_url: - anyOf: - - type: string - - type: 'null' - title: Image Url - title: OpenAIResponseInputMessageContentImage + max_num_results: + title: Max Num Results + default: 10 + type: integer + maximum: 50.0 + minimum: 1.0 + ranking_options: + $ref: '#/components/schemas/SearchRankingOptions' + type: object + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + description: "File search tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"file_search\"\n:param vector_store_ids: List of vector store identifiers to search within\n:param filters: (Optional) Additional filters to apply to the search\n:param max_num_results: (Optional) Maximum number of search results to return (1-50)\n:param ranking_options: (Optional) Options for ranking and scoring search results" + OpenAIResponseInputToolFunction: + properties: + type: + type: string + const: function + title: Type + default: function + name: + type: string + title: Name + description: + title: Description + type: string + parameters: + title: Parameters + additionalProperties: true type: object - OpenAIResponseInputMessageContentText: - description: >- - Text content for input messages in OpenAI response format. - - - :param text: The text content of the input message - - :param type: Content type identifier, always "input_text" - properties: - text: - title: Text - type: string - type: - const: input_text - default: input_text - title: Type - type: string - required: - - text - title: OpenAIResponseInputMessageContentText + strict: + title: Strict + type: boolean + type: object + required: + - name + - parameters + title: OpenAIResponseInputToolFunction + description: "Function tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"function\"\n:param name: Name of the function that can be called\n:param description: (Optional) Description of what the function does\n:param parameters: (Optional) JSON schema defining the function's parameters\n:param strict: (Optional) Whether to enforce strict parameter validation" + OpenAIResponseInputToolMCP: + properties: + type: + type: string + const: mcp + title: Type + default: mcp + server_label: + type: string + title: Server Label + server_url: + type: string + title: Server Url + headers: + title: Headers + additionalProperties: true type: object - OpenAIResponseMCPApprovalRequest: - description: >- - A request for human approval of a tool invocation. - properties: - arguments: - title: Arguments - type: string - id: - title: Id - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - type: - const: mcp_approval_request - default: mcp_approval_request - title: Type + require_approval: + anyOf: + - type: string + const: always + - type: string + const: never + - $ref: '#/components/schemas/ApprovalFilter' + title: Require Approval + default: never + allowed_tools: + anyOf: + - items: type: string - required: - - arguments - - id - - name - - server_label - title: OpenAIResponseMCPApprovalRequest + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + title: Allowed Tools + type: object + required: + - server_label + - server_url + title: OpenAIResponseInputToolMCP + description: "Model Context Protocol (MCP) tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param server_url: URL endpoint of the MCP server\n:param headers: (Optional) HTTP headers to include when connecting to the server\n:param require_approval: Approval requirement for tool calls (\"always\", \"never\", or filter)\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + OpenAIResponseInputToolWebSearch: + properties: + type: + anyOf: + - type: string + const: web_search + - type: string + const: web_search_preview + - type: string + const: web_search_preview_2025_03_11 + title: Type + default: web_search + search_context_size: + title: Search Context Size + default: medium + type: string + pattern: ^low|medium|high$ + type: object + title: OpenAIResponseInputToolWebSearch + description: "Web search tool configuration for OpenAI response inputs.\n\n:param type: Web search tool type variant to use\n:param search_context_size: (Optional) Size of search context, must be \"low\", \"medium\", or \"high\"" + OpenAIResponseMCPApprovalRequest: + properties: + arguments: + type: string + title: Arguments + id: + type: string + title: Id + name: + type: string + title: Name + server_label: + type: string + title: Server Label + type: + type: string + const: mcp_approval_request + title: Type + default: mcp_approval_request + type: object + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + description: A request for human approval of a tool invocation. + OpenAIResponseMCPApprovalResponse: + properties: + approval_request_id: + type: string + title: Approval Request Id + approve: + type: boolean + title: Approve + type: + type: string + const: mcp_approval_response + title: Type + default: mcp_approval_response + id: + title: Id + type: string + reason: + title: Reason + type: string + type: object + required: + - approval_request_id + - approve + title: OpenAIResponseMCPApprovalResponse + description: A response to an MCP approval request. + OpenAIResponseMessage-Input: + properties: + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - type: string + const: system + - type: string + const: developer + - type: string + const: user + - type: string + const: assistant + title: Role + type: + type: string + const: message + title: Type + default: message + id: + title: Id + type: string + status: + title: Status + type: string + type: object + required: + - content + - role + title: OpenAIResponseMessage + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + OpenAIResponseMessage-Output: + properties: + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - type: string + const: system + - type: string + const: developer + - type: string + const: user + - type: string + const: assistant + title: Role + type: + type: string + const: message + title: Type + default: message + id: + title: Id + type: string + status: + title: Status + type: string + type: object + required: + - content + - role + title: OpenAIResponseMessage + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + OpenAIResponseObject: + properties: + created_at: + type: integer + title: Created At + error: + $ref: '#/components/schemas/OpenAIResponseError' + id: + type: string + title: Id + model: + type: string + title: Model + object: + type: string + const: response + title: Object + default: response + output: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + title: Output + parallel_tool_calls: + type: boolean + title: Parallel Tool Calls + default: false + previous_response_id: + title: Previous Response Id + type: string + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' + status: + type: string + title: Status + temperature: + title: Temperature + type: number + text: + $ref: '#/components/schemas/OpenAIResponseText' + default: + format: + type: text + top_p: + title: Top P + type: number + tools: + title: Tools + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + type: array + truncation: + title: Truncation + type: string + usage: + $ref: '#/components/schemas/OpenAIResponseUsage' + instructions: + title: Instructions + type: string + type: object + required: + - created_at + - id + - model + - output + - status + title: OpenAIResponseObject + description: "Complete OpenAI response object containing generation results and metadata.\n\n:param created_at: Unix timestamp when the response was created\n:param error: (Optional) Error details if the response generation failed\n:param id: Unique identifier for this response\n:param model: Model identifier used for generation\n:param object: Object type identifier, always \"response\"\n:param output: List of generated output items (messages, tool calls, etc.)\n:param parallel_tool_calls: Whether tool calls can be executed in parallel\n:param previous_response_id: (Optional) ID of the previous response in a conversation\n:param prompt: (Optional) Reference to a prompt template and its variables.\n:param status: Current status of the response generation\n:param temperature: (Optional) Sampling temperature used for generation\n:param text: Text formatting configuration for the response\n:param top_p: (Optional) Nucleus sampling parameter used for generation\n:param tools: (Optional) An array of tools the model may call while generating a response.\n:param truncation: (Optional) Truncation strategy applied to the response\n:param usage: (Optional) Token usage information for the response\n:param instructions: (Optional) System message inserted into the model's context" + OpenAIResponseOutputMessageContentOutputText: + properties: + text: + type: string + title: Text + type: + type: string + const: output_text + title: Type + default: output_text + annotations: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + discriminator: + propertyName: type + mapping: + container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' + url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' + type: array + title: Annotations + type: object + required: + - text + title: OpenAIResponseOutputMessageContentOutputText + OpenAIResponseOutputMessageFileSearchToolCall: + properties: + id: + type: string + title: Id + queries: + items: + type: string + type: array + title: Queries + status: + type: string + title: Status + type: + type: string + const: file_search_call + title: Type + default: file_search_call + results: + title: Results + items: + $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' + type: array + type: object + required: + - id + - queries + - status + title: OpenAIResponseOutputMessageFileSearchToolCall + description: "File search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param queries: List of search queries executed\n:param status: Current status of the file search operation\n:param type: Tool call type identifier, always \"file_search_call\"\n:param results: (Optional) Search results returned by the file search operation" + OpenAIResponseOutputMessageFileSearchToolCallResults: + properties: + attributes: + additionalProperties: true type: object - OpenAIResponseMCPApprovalResponse: - description: A response to an MCP approval request. - properties: - approval_request_id: - title: Approval Request Id - type: string - approve: - title: Approve - type: boolean - type: - const: mcp_approval_response - default: mcp_approval_response - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - reason: - anyOf: - - type: string - - type: 'null' - title: Reason - required: - - approval_request_id - - approve - title: OpenAIResponseMCPApprovalResponse + title: Attributes + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + score: + type: number + title: Score + text: + type: string + title: Text + type: object + required: + - attributes + - file_id + - filename + - score + - text + title: OpenAIResponseOutputMessageFileSearchToolCallResults + description: "Search results returned by the file search operation.\n\n:param attributes: (Optional) Key-value attributes associated with the file\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result (between 0 and 1)\n:param text: Text content of the search result" + OpenAIResponseOutputMessageFunctionToolCall: + properties: + call_id: + type: string + title: Call Id + name: + type: string + title: Name + arguments: + type: string + title: Arguments + type: + type: string + const: function_call + title: Type + default: function_call + id: + title: Id + type: string + status: + title: Status + type: string + type: object + required: + - call_id + - name + - arguments + title: OpenAIResponseOutputMessageFunctionToolCall + description: "Function tool call output message for OpenAI responses.\n\n:param call_id: Unique identifier for the function call\n:param name: Name of the function being called\n:param arguments: JSON string containing the function arguments\n:param type: Tool call type identifier, always \"function_call\"\n:param id: (Optional) Additional identifier for the tool call\n:param status: (Optional) Current status of the function call execution" + OpenAIResponseOutputMessageMCPCall: + properties: + id: + type: string + title: Id + type: + type: string + const: mcp_call + title: Type + default: mcp_call + arguments: + type: string + title: Arguments + name: + type: string + title: Name + server_label: + type: string + title: Server Label + error: + title: Error + type: string + output: + title: Output + type: string + type: object + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + description: "Model Context Protocol (MCP) call output message for OpenAI responses.\n\n:param id: Unique identifier for this MCP call\n:param type: Tool call type identifier, always \"mcp_call\"\n:param arguments: JSON string containing the MCP call arguments\n:param name: Name of the MCP method being called\n:param server_label: Label identifying the MCP server handling the call\n:param error: (Optional) Error message if the MCP call failed\n:param output: (Optional) Output result from the successful MCP call" + OpenAIResponseOutputMessageMCPListTools: + properties: + id: + type: string + title: Id + type: + type: string + const: mcp_list_tools + title: Type + default: mcp_list_tools + server_label: + type: string + title: Server Label + tools: + items: + $ref: '#/components/schemas/MCPListToolsTool' + type: array + title: Tools + type: object + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + description: "MCP list tools output message containing available tools from an MCP server.\n\n:param id: Unique identifier for this MCP list tools operation\n:param type: Tool call type identifier, always \"mcp_list_tools\"\n:param server_label: Label identifying the MCP server providing the tools\n:param tools: List of available tools provided by the MCP server" + OpenAIResponseOutputMessageWebSearchToolCall: + properties: + id: + type: string + title: Id + status: + type: string + title: Status + type: + type: string + const: web_search_call + title: Type + default: web_search_call + type: object + required: + - id + - status + title: OpenAIResponseOutputMessageWebSearchToolCall + description: "Web search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param status: Current status of the web search operation\n:param type: Tool call type identifier, always \"web_search_call\"" + OpenAIResponsePrompt: + properties: + id: + type: string + title: Id + variables: + title: Variables + additionalProperties: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' type: object - OpenAIResponseMessage: - description: >- - Corresponds to the various Message types in the Responses API. - - They are all under one type because the Responses API gives them all - - the same "type" value, and there is no way to tell them apart in certain - - scenarios. - properties: - content: - anyOf: - - type: string - - items: - discriminator: - mapping: - input_image: >- - #/$defs/OpenAIResponseInputMessageContentImage - input_text: >- - #/$defs/OpenAIResponseInputMessageContentText - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentText - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentImage - type: array - - items: - discriminator: - mapping: - output_text: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - refusal: '#/$defs/OpenAIResponseContentPartRefusal' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - - $ref: '#/$defs/OpenAIResponseContentPartRefusal' - type: array - title: Content - role: - anyOf: - - const: system - type: string - - const: developer - type: string - - const: user - type: string - - const: assistant - type: string - title: Role - type: - const: message - default: message - title: Type + version: + title: Version + type: string + type: object + required: + - id + title: OpenAIResponsePrompt + description: "OpenAI compatible Prompt object that is used in OpenAI responses.\n\n:param id: Unique identifier of the prompt template\n:param variables: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types\nlike images or files.\n:param version: Version number of the prompt to use (defaults to latest if not specified)" + OpenAIResponseText: + properties: + format: + $ref: '#/components/schemas/OpenAIResponseTextFormat' + type: object + title: OpenAIResponseText + description: "Text response configuration for OpenAI responses.\n\n:param format: (Optional) Text format configuration specifying output format requirements" + OpenAIResponseTextFormat: + properties: + type: + anyOf: + - type: string + const: text + - type: string + const: json_schema + - type: string + const: json_object + title: Type + name: + title: Name + type: string + schema: + title: Schema + additionalProperties: true + type: object + description: + title: Description + type: string + strict: + title: Strict + type: boolean + type: object + title: OpenAIResponseTextFormat + description: "Configuration for Responses API text format.\n\n:param type: Must be \"text\", \"json_schema\", or \"json_object\" to identify the format type\n:param name: The name of the response format. Only used for json_schema.\n:param schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model. Only used for json_schema.\n:param description: (Optional) A description of the response format. Only used for json_schema.\n:param strict: (Optional) Whether to strictly enforce the JSON schema. If true, the response must match the schema exactly. Only used for json_schema." + OpenAIResponseToolMCP: + properties: + type: + type: string + const: mcp + title: Type + default: mcp + server_label: + type: string + title: Server Label + allowed_tools: + anyOf: + - items: type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - content - - role - title: OpenAIResponseMessage + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + title: Allowed Tools + type: object + required: + - server_label + title: OpenAIResponseToolMCP + description: "Model Context Protocol (MCP) tool configuration for OpenAI response object.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + OpenAIResponseUsage: + properties: + input_tokens: + type: integer + title: Input Tokens + output_tokens: + type: integer + title: Output Tokens + total_tokens: + type: integer + title: Total Tokens + input_tokens_details: + $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' + output_tokens_details: + $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + type: object + required: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + description: "Usage information for OpenAI response.\n\n:param input_tokens: Number of tokens in the input\n:param output_tokens: Number of tokens in the output\n:param total_tokens: Total tokens used (input + output)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + OpenAIResponseUsageInputTokensDetails: + properties: + cached_tokens: + title: Cached Tokens + type: integer + type: object + title: OpenAIResponseUsageInputTokensDetails + description: "Token details for input tokens in OpenAI response usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + OpenAIResponseUsageOutputTokensDetails: + properties: + reasoning_tokens: + title: Reasoning Tokens + type: integer + type: object + title: OpenAIResponseUsageOutputTokensDetails + description: "Token details for output tokens in OpenAI response usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + OpenAISystemMessageParam: + properties: + role: + type: string + const: system + title: Role + default: system + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + title: Name + type: string + type: object + required: + - content + title: OpenAISystemMessageParam + description: "A system message providing instructions or context to the model.\n\n:param role: Must be \"system\" to identify this as a system message\n:param content: The content of the \"system prompt\". If multiple system messages are provided, they are concatenated. The underlying Llama Stack code may also add other system messages (for example, for formatting tool definitions).\n:param name: (Optional) The name of the system message participant." + OpenAITokenLogProb: + properties: + token: + type: string + title: Token + bytes: + title: Bytes + items: + type: integer + type: array + logprob: + type: number + title: Logprob + top_logprobs: + items: + $ref: '#/components/schemas/OpenAITopLogProb' + type: array + title: Top Logprobs + type: object + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + description: "The log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token\n:top_logprobs: The top log probabilities for the token" + OpenAIToolMessageParam: + properties: + role: + type: string + const: tool + title: Role + default: tool + tool_call_id: + type: string + title: Tool Call Id + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + type: object + required: + - tool_call_id + - content + title: OpenAIToolMessageParam + description: "A message representing the result of a tool invocation in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"tool\" to identify this as a tool response\n:param tool_call_id: Unique identifier for the tool call this response is for\n:param content: The response content from the tool" + OpenAITopLogProb: + properties: + token: + type: string + title: Token + bytes: + title: Bytes + items: + type: integer + type: array + logprob: + type: number + title: Logprob + type: object + required: + - token + - logprob + title: OpenAITopLogProb + description: "The top log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token" + OpenAIUserMessageParam-Input: + properties: + role: + type: string + const: user + title: Role + default: user + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/OpenAIFile' + image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + title: Name + type: string + type: object + required: + - content + title: OpenAIUserMessageParam + description: "A message from the user in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param name: (Optional) The name of the user message participant." + OpenAIUserMessageParam-Output: + properties: + role: + type: string + const: user + title: Role + default: user + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/OpenAIFile' + image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + title: Name + type: string + type: object + required: + - content + title: OpenAIUserMessageParam + description: "A message from the user in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param name: (Optional) The name of the user message participant." + OptimizerConfig: + properties: + optimizer_type: + $ref: '#/components/schemas/OptimizerType' + lr: + type: number + title: Lr + weight_decay: + type: number + title: Weight Decay + num_warmup_steps: + type: integer + title: Num Warmup Steps + type: object + required: + - optimizer_type + - lr + - weight_decay + - num_warmup_steps + title: OptimizerConfig + description: "Configuration parameters for the optimization algorithm.\n\n:param optimizer_type: Type of optimizer to use (adam, adamw, or sgd)\n:param lr: Learning rate for the optimizer\n:param weight_decay: Weight decay coefficient for regularization\n:param num_warmup_steps: Number of steps for learning rate warmup" + OptimizerType: + type: string + enum: + - adam + - adamw + - sgd + title: OptimizerType + description: "Available optimizer algorithms for training.\n:cvar adam: Adaptive Moment Estimation optimizer\n:cvar adamw: AdamW optimizer with weight decay\n:cvar sgd: Stochastic Gradient Descent optimizer" + Order: + type: string + enum: + - asc + - desc + title: Order + description: "Sort order for paginated responses.\n:cvar asc: Ascending order\n:cvar desc: Descending order" + OutputTokensDetails: + properties: + reasoning_tokens: + type: integer + title: Reasoning Tokens + additionalProperties: true + type: object + required: + - reasoning_tokens + title: OutputTokensDetails + PostTrainingJob: + properties: + job_uuid: + type: string + title: Job Uuid + type: object + required: + - job_uuid + title: PostTrainingJob + Prompt: + properties: + prompt: + title: Prompt + description: The system prompt with variable placeholders + type: string + version: + type: integer + minimum: 1.0 + title: Version + description: Version (integer starting at 1, incremented on save) + prompt_id: + type: string + title: Prompt Id + description: Unique identifier in format 'pmpt_<48-digit-hash>' + variables: + items: + type: string + type: array + title: Variables + description: List of variable names that can be used in the prompt template + is_default: + type: boolean + title: Is Default + description: Boolean indicating whether this version is the default version + default: false + type: object + required: + - version + - prompt_id + title: Prompt + description: "A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack.\n\n:param prompt: The system prompt text with variable placeholders. Variables are only supported when using the Responses API.\n:param version: Version (integer starting at 1, incremented on save)\n:param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>'\n:param variables: List of prompt variable names that can be used in the prompt template\n:param is_default: Boolean indicating whether this version is the default version for this prompt" + ProviderInfo: + properties: + api: + type: string + title: Api + provider_id: + type: string + title: Provider Id + provider_type: + type: string + title: Provider Type + config: + additionalProperties: true type: object - "OpenAIResponseOutputMessageContentOutputText": - properties: - text: - title: Text - type: string - type: - const: output_text - default: output_text - title: Type - type: string - annotations: - items: - discriminator: - mapping: - container_file_citation: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - file_citation: >- - #/$defs/OpenAIResponseAnnotationFileCitation - file_path: '#/$defs/OpenAIResponseAnnotationFilePath' - url_citation: '#/$defs/OpenAIResponseAnnotationCitation' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseAnnotationFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationCitation' - - $ref: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' - title: Annotations - type: array - required: - - text - title: >- - OpenAIResponseOutputMessageContentOutputText + title: Config + health: + additionalProperties: true type: object - "OpenAIResponseOutputMessageFileSearchToolCall": - description: >- - File search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param queries: List of search queries executed - - :param status: Current status of the file search operation - - :param type: Tool call type identifier, always "file_search_call" - - :param results: (Optional) Search results returned by the file search - operation - properties: - id: - title: Id - type: string - queries: - items: - type: string - title: Queries - type: array - status: - title: Status - type: string - type: - const: file_search_call - default: file_search_call - title: Type - type: string - results: - anyOf: - - items: - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults - type: array - - type: 'null' - title: Results - required: - - id - - queries - - status - title: >- - OpenAIResponseOutputMessageFileSearchToolCall + title: Health + type: object + required: + - api + - provider_id + - provider_type + - config + - health + title: ProviderInfo + description: "Information about a registered provider including its configuration and health status.\n\n:param api: The API name this provider implements\n:param provider_id: Unique identifier for the provider\n:param provider_type: The type of provider implementation\n:param config: Configuration parameters for the provider\n:param health: Current health status of the provider" + QueryChunksResponse: + properties: + chunks: + items: + $ref: '#/components/schemas/Chunk-Output' + type: array + title: Chunks + scores: + items: + type: number + type: array + title: Scores + type: object + required: + - chunks + - scores + title: QueryChunksResponse + description: "Response from querying chunks in a vector database.\n\n:param chunks: List of content chunks returned from the query\n:param scores: Relevance scores corresponding to each returned chunk" + RAGQueryConfig: + properties: + query_generator_config: + oneOf: + - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' + title: Query Generator Config + default: + type: default + separator: ' ' + discriminator: + propertyName: type + mapping: + default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' + max_tokens_in_context: + type: integer + title: Max Tokens In Context + default: 4096 + max_chunks: + type: integer + title: Max Chunks + default: 5 + chunk_template: + type: string + title: Chunk Template + default: "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n" + mode: + default: vector + $ref: '#/components/schemas/RAGSearchMode' + ranker: + title: Ranker + oneOf: + - $ref: '#/components/schemas/RRFRanker' + - $ref: '#/components/schemas/WeightedRanker' + discriminator: + propertyName: type + mapping: + rrf: '#/components/schemas/RRFRanker' + weighted: '#/components/schemas/WeightedRanker' + type: object + title: RAGQueryConfig + description: "Configuration for the RAG query generation.\n\n:param query_generator_config: Configuration for the query generator.\n:param max_tokens_in_context: Maximum number of tokens in the context.\n:param max_chunks: Maximum number of chunks to retrieve.\n:param chunk_template: Template for formatting each retrieved chunk in the context.\n Available placeholders: {index} (1-based chunk ordinal), {chunk.content} (chunk content string), {metadata} (chunk metadata dict).\n Default: \"Result {index}\\nContent: {chunk.content}\\nMetadata: {metadata}\\n\"\n:param mode: Search mode for retrieval—either \"vector\", \"keyword\", or \"hybrid\". Default \"vector\".\n:param ranker: Configuration for the ranker to use in hybrid search. Defaults to RRF ranker." + RAGQueryResult: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + additionalProperties: true type: object - "OpenAIResponseOutputMessageFileSearchToolCallResults": - description: >- - Search results returned by the file search operation. - - - :param attributes: (Optional) Key-value attributes associated with the - file - - :param file_id: Unique identifier of the file containing the result - - :param filename: Name of the file containing the result - - :param score: Relevance score for this search result (between 0 and 1) - - :param text: Text content of the search result - properties: - attributes: - additionalProperties: true - title: Attributes - type: object - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - score: - title: Score - type: number - text: - title: Text - type: string - required: - - attributes - - file_id - - filename - - score - - text - title: >- - OpenAIResponseOutputMessageFileSearchToolCallResults + title: Metadata + type: object + title: RAGQueryResult + description: "Result of a RAG query containing retrieved content and metadata.\n\n:param content: (Optional) The retrieved content from the query\n:param metadata: Additional metadata about the query result" + RAGSearchMode: + type: string + enum: + - vector + - keyword + - hybrid + title: RAGSearchMode + description: "Search modes for RAG query retrieval:\n- VECTOR: Uses vector similarity search for semantic matching\n- KEYWORD: Uses keyword-based search for exact matching\n- HYBRID: Combines both vector and keyword search for better results" + RRFRanker: + properties: + type: + type: string + const: rrf + title: Type + default: rrf + impact_factor: + type: number + title: Impact Factor + default: 60.0 + minimum: 0.0 + type: object + title: RRFRanker + description: "Reciprocal Rank Fusion (RRF) ranker configuration.\n\n:param type: The type of ranker, always \"rrf\"\n:param impact_factor: The impact factor for RRF scoring. Higher values give more weight to higher-ranked results.\n Must be greater than 0" + RegexParserScoringFnParams: + properties: + type: + type: string + const: regex_parser + title: Type + default: regex_parser + parsing_regexes: + items: + type: string + type: array + title: Parsing Regexes + description: Regex to extract the answer from generated response + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row + type: object + title: RegexParserScoringFnParams + description: "Parameters for regex parser scoring function configuration.\n:param type: The type of scoring function parameters, always regex_parser\n:param parsing_regexes: Regex to extract the answer from generated response\n:param aggregation_functions: Aggregation functions to apply to the scores of each row" + RerankData: + properties: + index: + type: integer + title: Index + relevance_score: + type: number + title: Relevance Score + type: object + required: + - index + - relevance_score + title: RerankData + description: "A single rerank result from a reranking response.\n\n:param index: The original index of the document in the input list\n:param relevance_score: The relevance score from the model output. Values are inverted when applicable so that higher scores indicate greater relevance." + RerankResponse: + properties: + data: + items: + $ref: '#/components/schemas/RerankData' + type: array + title: Data + type: object + required: + - data + title: RerankResponse + description: "Response from a reranking request.\n\n:param data: List of rerank result objects, sorted by relevance score (descending)" + RouteInfo: + properties: + route: + type: string + title: Route + method: + type: string + title: Method + provider_types: + items: + type: string + type: array + title: Provider Types + type: object + required: + - route + - method + - provider_types + title: RouteInfo + description: "Information about an API route including its path, method, and implementing providers.\n\n:param route: The API endpoint path\n:param method: HTTP method for the route\n:param provider_types: List of provider types that implement this route" + RowsDataSource: + properties: + type: + type: string + const: rows + title: Type + default: rows + rows: + items: + additionalProperties: true + type: object + type: array + title: Rows + type: object + required: + - rows + title: RowsDataSource + description: "A dataset stored in rows.\n:param rows: The dataset is stored in rows. E.g.\n - [\n {\"messages\": [{\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}]}\n ]" + RunShieldResponse: + properties: + violation: + $ref: '#/components/schemas/SafetyViolation' + type: object + title: RunShieldResponse + description: "Response from running a safety shield.\n\n:param violation: (Optional) Safety violation detected by the shield, if any" + SafetyViolation: + properties: + violation_level: + $ref: '#/components/schemas/ViolationLevel' + user_message: + title: User Message + type: string + metadata: + additionalProperties: true type: object - "OpenAIResponseOutputMessageFunctionToolCall": - description: >- - Function tool call output message for OpenAI responses. - - - :param call_id: Unique identifier for the function call - - :param name: Name of the function being called - - :param arguments: JSON string containing the function arguments - - :param type: Tool call type identifier, always "function_call" - - :param id: (Optional) Additional identifier for the tool call - - :param status: (Optional) Current status of the function call execution - properties: - call_id: - title: Call Id - type: string - name: - title: Name - type: string - arguments: - title: Arguments - type: string - type: - const: function_call - default: function_call - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - name - - arguments - title: >- - OpenAIResponseOutputMessageFunctionToolCall + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + description: "Details of a safety violation detected by content moderation.\n\n:param violation_level: Severity level of the violation\n:param user_message: (Optional) Message to convey to the user about the violation\n:param metadata: Additional metadata including specific violation codes for debugging and telemetry" + SamplingParams: + properties: + strategy: + oneOf: + - $ref: '#/components/schemas/GreedySamplingStrategy' + - $ref: '#/components/schemas/TopPSamplingStrategy' + - $ref: '#/components/schemas/TopKSamplingStrategy' + title: Strategy + discriminator: + propertyName: type + mapping: + greedy: '#/components/schemas/GreedySamplingStrategy' + top_k: '#/components/schemas/TopKSamplingStrategy' + top_p: '#/components/schemas/TopPSamplingStrategy' + max_tokens: + title: Max Tokens + type: integer + repetition_penalty: + title: Repetition Penalty + default: 1.0 + type: number + stop: + title: Stop + items: + type: string + type: array + type: object + title: SamplingParams + description: "Sampling parameters.\n\n:param strategy: The sampling strategy.\n:param max_tokens: The maximum number of tokens that can be generated in the completion. The token count of\n your prompt plus max_tokens cannot exceed the model's context length.\n:param repetition_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens\n based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\n:param stop: Up to 4 sequences where the API will stop generating further tokens.\n The returned text will not contain the stop sequence." + ScoreBatchResponse: + properties: + dataset_id: + title: Dataset Id + type: string + results: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' type: object - OpenAIResponseOutputMessageMCPCall: - description: >- - Model Context Protocol (MCP) call output message for OpenAI responses. - - - :param id: Unique identifier for this MCP call - - :param type: Tool call type identifier, always "mcp_call" - - :param arguments: JSON string containing the MCP call arguments - - :param name: Name of the MCP method being called - - :param server_label: Label identifying the MCP server handling the call - - :param error: (Optional) Error message if the MCP call failed - - :param output: (Optional) Output result from the successful MCP call - properties: - id: - title: Id - type: string - type: - const: mcp_call - default: mcp_call - title: Type - type: string - arguments: - title: Arguments - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - error: - anyOf: - - type: string - - type: 'null' - title: Error - output: - anyOf: - - type: string - - type: 'null' - title: Output - required: - - id - - arguments - - name - - server_label - title: OpenAIResponseOutputMessageMCPCall + title: Results + type: object + required: + - results + title: ScoreBatchResponse + description: "Response from batch scoring operations on datasets.\n\n:param dataset_id: (Optional) The identifier of the dataset that was scored\n:param results: A map of scoring function name to ScoringResult" + ScoreResponse: + properties: + results: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' type: object - OpenAIResponseOutputMessageMCPListTools: - description: >- - MCP list tools output message containing available tools from an MCP server. - - - :param id: Unique identifier for this MCP list tools operation - - :param type: Tool call type identifier, always "mcp_list_tools" - - :param server_label: Label identifying the MCP server providing the tools - - :param tools: List of available tools provided by the MCP server - properties: - id: - title: Id - type: string - type: - const: mcp_list_tools - default: mcp_list_tools - title: Type - type: string - server_label: - title: Server Label - type: string - tools: - items: - $ref: '#/$defs/MCPListToolsTool' - title: Tools - type: array - required: - - id - - server_label - - tools - title: OpenAIResponseOutputMessageMCPListTools + title: Results + type: object + required: + - results + title: ScoreResponse + description: "The response from scoring.\n\n:param results: A map of scoring function name to ScoringResult." + ScoringFn-Output: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + title: Provider Resource Id + description: Unique identifier for this resource in the provider + type: string + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: scoring_function + title: Type + default: scoring_function + description: + title: Description + type: string + metadata: + additionalProperties: true type: object - "OpenAIResponseOutputMessageWebSearchToolCall": - description: >- - Web search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param status: Current status of the web search operation - - :param type: Tool call type identifier, always "web_search_call" - properties: - id: - title: Id - type: string - status: - title: Status - type: string - type: - const: web_search_call - default: web_search_call - title: Type - type: string - required: - - id - - status - title: >- - OpenAIResponseOutputMessageWebSearchToolCall + title: Metadata + description: Any additional metadata for this definition + return_type: + oneOf: + - $ref: '#/components/schemas/StringType' + - $ref: '#/components/schemas/NumberType' + - $ref: '#/components/schemas/BooleanType' + - $ref: '#/components/schemas/ArrayType' + - $ref: '#/components/schemas/ObjectType' + - $ref: '#/components/schemas/JsonType' + - $ref: '#/components/schemas/UnionType' + - $ref: '#/components/schemas/ChatCompletionInputType' + - $ref: '#/components/schemas/CompletionInputType' + - $ref: '#/components/schemas/AgentTurnInputType' + title: Return Type + description: The return type of the deterministic function + discriminator: + propertyName: type + mapping: + agent_turn_input: '#/components/schemas/AgentTurnInputType' + array: '#/components/schemas/ArrayType' + boolean: '#/components/schemas/BooleanType' + chat_completion_input: '#/components/schemas/ChatCompletionInputType' + completion_input: '#/components/schemas/CompletionInputType' + json: '#/components/schemas/JsonType' + number: '#/components/schemas/NumberType' + object: '#/components/schemas/ObjectType' + string: '#/components/schemas/StringType' + union: '#/components/schemas/UnionType' + params: + title: Params + description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval + oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + type: object + required: + - identifier + - provider_id + - return_type + title: ScoringFn + description: "A scoring function resource for evaluating model outputs.\n:param type: The resource type, always scoring_function" + ScoringResult: + properties: + score_rows: + items: + additionalProperties: true + type: object + type: array + title: Score Rows + aggregated_results: + additionalProperties: true + type: object + title: Aggregated Results + type: object + required: + - score_rows + - aggregated_results + title: ScoringResult + description: "A scoring result for a single row.\n\n:param score_rows: The scoring result for each row. Each row is a map of column name to value.\n:param aggregated_results: Map of metric name to aggregated value" + SearchRankingOptions: + properties: + ranker: + title: Ranker + type: string + score_threshold: + title: Score Threshold + default: 0.0 + type: number + type: object + title: SearchRankingOptions + description: "Options for ranking and filtering search results.\n\n:param ranker: (Optional) Name of the ranking algorithm to use\n:param score_threshold: (Optional) Minimum relevance score threshold for results" + Shield: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + title: Provider Resource Id + description: Unique identifier for this resource in the provider + type: string + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: shield + title: Type + default: shield + params: + title: Params + additionalProperties: true type: object - description: >- - List container for OpenAI response input items. - - - :param data: List of input items - - :param object: Object type identifier, always "list" + type: object + required: + - identifier + - provider_id + title: Shield + description: "A safety shield resource that can be used to check content.\n\n:param params: (Optional) Configuration parameters for the shield\n:param type: The resource type, always shield" + ShieldCallStep-Output: properties: - data: - items: - anyOf: - - discriminator: - mapping: - file_search_call: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - function_call: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - mcp_list_tools: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - message: '#/$defs/OpenAIResponseMessage' - web_search_call: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseMessage' - - $ref: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' - - $ref: >- - #/$defs/OpenAIResponseInputFunctionToolCallOutput - - $ref: >- - #/$defs/OpenAIResponseMCPApprovalResponse - - $ref: '#/$defs/OpenAIResponseMessage' - title: Data - type: array - object: - const: list - default: list - title: Object + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + started_at: + title: Started At + type: string + format: date-time + completed_at: + title: Completed At type: string + format: date-time + step_type: + type: string + const: shield_call + title: Step Type + default: shield_call + violation: + $ref: '#/components/schemas/SafetyViolation' + type: object required: - - data - title: ListOpenAIResponseInputItem + - turn_id + - step_id + - violation + title: ShieldCallStep + description: "A shield call step in an agent turn.\n\n:param violation: The violation from the shield call." + StopReason: + type: string + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + StringType: + properties: + type: + type: string + const: string + title: Type + default: string type: object - RunShieldRequest: + title: StringType + description: "Parameter type for string values.\n\n:param type: Discriminator type. Always \"string\"" + SystemMessage: + properties: + role: + type: string + const: system + title: Role + default: system + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content type: object - RunShieldResponse: - $defs: - SafetyViolation: - description: >- - Details of a safety violation detected by content moderation. - - - :param violation_level: Severity level of the violation - - :param user_message: (Optional) Message to convey to the user about the - violation - - :param metadata: Additional metadata including specific violation codes - for debugging and telemetry - properties: - violation_level: - $ref: '#/$defs/ViolationLevel' - user_message: - anyOf: - - type: string - - type: 'null' - title: User Message - metadata: - additionalProperties: true - title: Metadata - type: object - required: - - violation_level - title: SafetyViolation - type: object - ViolationLevel: - description: >- - Severity level of a safety violation. - - - :cvar INFO: Informational level violation that does not require action - - :cvar WARN: Warning level violation that suggests caution but allows continuation - - :cvar ERROR: Error level violation that requires blocking or intervention - enum: - - info - - warn - - error - title: ViolationLevel + required: + - content + title: SystemMessage + description: "A system message providing instructions or context to the model.\n\n:param role: Must be \"system\" to identify this as a system message\n:param content: The content of the \"system prompt\". If multiple system messages are provided, they are concatenated. The underlying Llama Stack code may also add other system messages (for example, for formatting tool definitions)." + SystemMessageBehavior: + type: string + enum: + - append + - replace + title: SystemMessageBehavior + description: "Config for how to override the default system prompt.\n\n:cvar append: Appends the provided system message to the default system prompt:\n https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt-\n:cvar replace: Replaces the default system prompt with the provided system message. The system message can include the string\n '{{function_definitions}}' to indicate where the function definitions should be inserted." + TextContentItem: + properties: + type: type: string - description: >- - Response from running a safety shield. - - - :param violation: (Optional) Safety violation detected by the shield, if any + const: text + title: Type + default: text + text: + type: string + title: Text + type: object + required: + - text + title: TextContentItem + description: "A text content item\n\n:param type: Discriminator type of the content item. Always \"text\"\n:param text: Text content" + ToolCall: properties: - violation: + call_id: + type: string + title: Call Id + tool_name: anyOf: - - $ref: '#/$defs/SafetyViolation' - - type: 'null' - title: RunShieldResponse + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + type: string + title: Arguments type: object - ListScoringFunctionsResponse: - $defs: - AgentTurnInputType: - description: >- - Parameter type for agent turn input. - - - :param type: Discriminator type. Always "agent_turn_input" - properties: - type: - const: agent_turn_input - default: agent_turn_input - title: Type - type: string - title: AgentTurnInputType - type: object - AggregationFunctionType: - description: >- - Types of aggregation functions for scoring results. - - :cvar average: Calculate the arithmetic mean of scores - - :cvar weighted_average: Calculate a weighted average of scores - - :cvar median: Calculate the median value of scores - - :cvar categorical_count: Count occurrences of categorical values - - :cvar accuracy: Calculate accuracy as the proportion of correct answers - enum: - - average - - weighted_average - - median - - categorical_count - - accuracy - title: AggregationFunctionType - type: string - ArrayType: - description: >- - Parameter type for array values. - - - :param type: Discriminator type. Always "array" - properties: - type: - const: array - default: array - title: Type - type: string - title: ArrayType - type: object - BasicScoringFnParams: - description: >- - Parameters for basic scoring function configuration. - - :param type: The type of scoring function parameters, always basic - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row - properties: - type: - const: basic - default: basic - title: Type - type: string - aggregation_functions: - description: >- - Aggregation functions to apply to the scores of each row - items: - $ref: '#/$defs/AggregationFunctionType' - title: Aggregation Functions - type: array - title: BasicScoringFnParams - type: object - BooleanType: - description: >- - Parameter type for boolean values. - - - :param type: Discriminator type. Always "boolean" - properties: - type: - const: boolean - default: boolean - title: Type - type: string - title: BooleanType - type: object - ChatCompletionInputType: - description: >- - Parameter type for chat completion input. - - - :param type: Discriminator type. Always "chat_completion_input" - properties: - type: - const: chat_completion_input - default: chat_completion_input - title: Type - type: string - title: ChatCompletionInputType - type: object - CompletionInputType: - description: >- - Parameter type for completion input. - - - :param type: Discriminator type. Always "completion_input" - properties: - type: - const: completion_input - default: completion_input - title: Type - type: string - title: CompletionInputType - type: object - JsonType: - description: >- - Parameter type for JSON values. - - - :param type: Discriminator type. Always "json" - properties: - type: - const: json - default: json - title: Type - type: string - title: JsonType + required: + - call_id + - tool_name + - arguments + title: ToolCall + ToolChoice: + type: string + enum: + - auto + - required + - none + title: ToolChoice + description: "Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model.\n\n:cvar auto: The model may use tools if it determines that is appropriate.\n:cvar required: The model must use tools.\n:cvar none: The model must not use tools." + ToolConfig: + properties: + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: string + title: Tool Choice + default: auto + tool_prompt_format: + $ref: '#/components/schemas/ToolPromptFormat' + system_message_behavior: + default: append + $ref: '#/components/schemas/SystemMessageBehavior' + type: object + title: ToolConfig + description: "Configuration for tool use.\n\n:param tool_choice: (Optional) Whether tool use is automatic, required, or none. Can also specify a tool name to use a specific tool. Defaults to ToolChoice.auto.\n:param tool_prompt_format: (Optional) Instructs the model how to format tool calls. By default, Llama Stack will attempt to use a format that is best adapted to the model.\n - `ToolPromptFormat.json`: The tool calls are formatted as a JSON object.\n - `ToolPromptFormat.function_tag`: The tool calls are enclosed in a tag.\n - `ToolPromptFormat.python_list`: The tool calls are output as Python syntax -- a list of function calls.\n:param system_message_behavior: (Optional) Config for how to override the default system prompt.\n - `SystemMessageBehavior.append`: Appends the provided system message to the default system prompt.\n - `SystemMessageBehavior.replace`: Replaces the default system prompt with the provided system message. The system message can include the string\n '{{function_definitions}}' to indicate where the function definitions should be inserted." + ToolDef: + properties: + toolgroup_id: + title: Toolgroup Id + type: string + name: + type: string + title: Name + description: + title: Description + type: string + input_schema: + title: Input Schema + additionalProperties: true type: object - LLMAsJudgeScoringFnParams: - description: >- - Parameters for LLM-as-judge scoring function configuration. - - :param type: The type of scoring function parameters, always llm_as_judge - - :param judge_model: Identifier of the LLM model to use as a judge for - scoring - - :param prompt_template: (Optional) Custom prompt template for the judge - model - - :param judge_score_regexes: Regexes to extract the answer from generated - response - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row - properties: - type: - const: llm_as_judge - default: llm_as_judge - title: Type - type: string - judge_model: - title: Judge Model - type: string - prompt_template: - anyOf: - - type: string - - type: 'null' - title: Prompt Template - judge_score_regexes: - description: >- - Regexes to extract the answer from generated response - items: - type: string - title: Judge Score Regexes - type: array - aggregation_functions: - description: >- - Aggregation functions to apply to the scores of each row - items: - $ref: '#/$defs/AggregationFunctionType' - title: Aggregation Functions - type: array - required: - - judge_model - title: LLMAsJudgeScoringFnParams + output_schema: + title: Output Schema + additionalProperties: true type: object - NumberType: - description: >- - Parameter type for numeric values. - - - :param type: Discriminator type. Always "number" - properties: - type: - const: number - default: number - title: Type - type: string - title: NumberType + metadata: + title: Metadata + additionalProperties: true type: object - ObjectType: - description: >- - Parameter type for object values. - - - :param type: Discriminator type. Always "object" - properties: - type: - const: object - default: object - title: Type - type: string - title: ObjectType + type: object + required: + - name + title: ToolDef + description: "Tool definition used in runtime contexts.\n\n:param name: Name of the tool\n:param description: (Optional) Human-readable description of what the tool does\n:param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema)\n:param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema)\n:param metadata: (Optional) Additional metadata about the tool\n:param toolgroup_id: (Optional) ID of the tool group this tool belongs to" + ToolExecutionStep-Output: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + started_at: + title: Started At + type: string + format: date-time + completed_at: + title: Completed At + type: string + format: date-time + step_type: + type: string + const: tool_execution + title: Step Type + default: tool_execution + tool_calls: + items: + $ref: '#/components/schemas/ToolCall' + type: array + title: Tool Calls + tool_responses: + items: + $ref: '#/components/schemas/ToolResponse-Output' + type: array + title: Tool Responses + type: object + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + description: "A tool execution step in an agent turn.\n\n:param tool_calls: The tool calls to execute.\n:param tool_responses: The tool responses from the tool calls." + ToolGroup: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + title: Provider Resource Id + description: Unique identifier for this resource in the provider + type: string + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: tool_group + title: Type + default: tool_group + mcp_endpoint: + $ref: '#/components/schemas/URL' + args: + title: Args + additionalProperties: true type: object - RegexParserScoringFnParams: - description: >- - Parameters for regex parser scoring function configuration. - - :param type: The type of scoring function parameters, always regex_parser - - :param parsing_regexes: Regex to extract the answer from generated response - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row - properties: - type: - const: regex_parser - default: regex_parser - title: Type - type: string - parsing_regexes: - description: >- - Regex to extract the answer from generated response - items: - type: string - title: Parsing Regexes - type: array - aggregation_functions: - description: >- - Aggregation functions to apply to the scores of each row - items: - $ref: '#/$defs/AggregationFunctionType' - title: Aggregation Functions - type: array - title: RegexParserScoringFnParams + type: object + required: + - identifier + - provider_id + title: ToolGroup + description: "A group of related tools managed together.\n\n:param type: Type of resource, always 'tool_group'\n:param mcp_endpoint: (Optional) Model Context Protocol endpoint for remote tools\n:param args: (Optional) Additional arguments for the tool group" + ToolInvocationResult: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + error_message: + title: Error Message + type: string + error_code: + title: Error Code + type: integer + metadata: + title: Metadata + additionalProperties: true type: object - ScoringFn: - description: >- - A scoring function resource for evaluating model outputs. - - :param type: The resource type, always scoring_function - properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier - type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: scoring_function - default: scoring_function - title: Type - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - metadata: - additionalProperties: true - description: >- - Any additional metadata for this definition - title: Metadata - type: object - return_type: - description: >- - The return type of the deterministic function + type: object + title: ToolInvocationResult + description: "Result of a tool invocation.\n\n:param content: (Optional) The output content from the tool execution\n:param error_message: (Optional) Error message if the tool execution failed\n:param error_code: (Optional) Numeric error code if the tool execution failed\n:param metadata: (Optional) Additional metadata about the tool execution" + ToolPromptFormat: + type: string + enum: + - json + - function_tag + - python_list + title: ToolPromptFormat + description: "Prompt format for calling custom / zero shot tools.\n\n:cvar json: JSON format for calling tools. It takes the form:\n {\n \"type\": \"function\",\n \"function\" : {\n \"name\": \"function_name\",\n \"description\": \"function_description\",\n \"parameters\": {...}\n }\n }\n:cvar function_tag: Function tag format, pseudo-XML. This looks like:\n (parameters)\n\n:cvar python_list: Python list. The output is a valid Python expression that can be\n evaluated to a list. Each element in the list is a function call. Example:\n [\"function_name(param1, param2)\", \"function_name(param1, param2)\"]" + ToolResponse-Input: + properties: + call_id: + type: string + title: Call Id + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + title: Metadata + additionalProperties: true + type: object + type: object + required: + - call_id + - tool_name + - content + title: ToolResponse + description: "Response from a tool invocation.\n\n:param call_id: Unique identifier for the tool call this response is for\n:param tool_name: Name of the tool that was invoked\n:param content: The response content from the tool\n:param metadata: (Optional) Additional metadata about the tool response" + ToolResponse-Output: + properties: + call_id: + type: string + title: Call Id + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + title: Metadata + additionalProperties: true + type: object + type: object + required: + - call_id + - tool_name + - content + title: ToolResponse + description: "Response from a tool invocation.\n\n:param call_id: Unique identifier for the tool call this response is for\n:param tool_name: Name of the tool that was invoked\n:param content: The response content from the tool\n:param metadata: (Optional) Additional metadata about the tool response" + ToolResponseMessage-Output: + properties: + role: + type: string + const: tool + title: Role + default: tool + call_id: + type: string + title: Call Id + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + type: object + required: + - call_id + - content + title: ToolResponseMessage + description: "A message representing the result of a tool invocation.\n\n:param role: Must be \"tool\" to identify this as a tool response\n:param call_id: Unique identifier for the tool call this response is for\n:param content: The response content from the tool" + TopKSamplingStrategy: + properties: + type: + type: string + const: top_k + title: Type + default: top_k + top_k: + type: integer + minimum: 1.0 + title: Top K + type: object + required: + - top_k + title: TopKSamplingStrategy + description: "Top-k sampling strategy that restricts sampling to the k most likely tokens.\n\n:param type: Must be \"top_k\" to identify this sampling strategy\n:param top_k: Number of top tokens to consider for sampling. Must be at least 1" + TopPSamplingStrategy: + properties: + type: + type: string + const: top_p + title: Type + default: top_p + temperature: + title: Temperature + type: number + minimum: 0.0 + top_p: + title: Top P + default: 0.95 + type: number + type: object + required: + - temperature + title: TopPSamplingStrategy + description: "Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p.\n\n:param type: Must be \"top_p\" to identify this sampling strategy\n:param temperature: Controls randomness in sampling. Higher values increase randomness\n:param top_p: Cumulative probability threshold for nucleus sampling. Defaults to 0.95" + TrainingConfig: + properties: + n_epochs: + type: integer + title: N Epochs + max_steps_per_epoch: + type: integer + title: Max Steps Per Epoch + default: 1 + gradient_accumulation_steps: + type: integer + title: Gradient Accumulation Steps + default: 1 + max_validation_steps: + title: Max Validation Steps + default: 1 + type: integer + data_config: + $ref: '#/components/schemas/DataConfig' + optimizer_config: + $ref: '#/components/schemas/OptimizerConfig' + efficiency_config: + $ref: '#/components/schemas/EfficiencyConfig' + dtype: + title: Dtype + default: bf16 + type: string + type: object + required: + - n_epochs + title: TrainingConfig + description: "Comprehensive configuration for the training process.\n\n:param n_epochs: Number of training epochs to run\n:param max_steps_per_epoch: Maximum number of steps to run per epoch\n:param gradient_accumulation_steps: Number of steps to accumulate gradients before updating\n:param max_validation_steps: (Optional) Maximum number of validation steps per epoch\n:param data_config: (Optional) Configuration for data loading and formatting\n:param optimizer_config: (Optional) Configuration for the optimization algorithm\n:param efficiency_config: (Optional) Configuration for memory and compute optimizations\n:param dtype: (Optional) Data type for model parameters (bf16, fp16, fp32)" + Turn: + properties: + turn_id: + type: string + title: Turn Id + session_id: + type: string + title: Session Id + input_messages: + items: + anyOf: + - $ref: '#/components/schemas/UserMessage-Output' + - $ref: '#/components/schemas/ToolResponseMessage-Output' + type: array + title: Input Messages + steps: + items: + oneOf: + - $ref: '#/components/schemas/InferenceStep-Output' + - $ref: '#/components/schemas/ToolExecutionStep-Output' + - $ref: '#/components/schemas/ShieldCallStep-Output' + - $ref: '#/components/schemas/MemoryRetrievalStep-Output' + discriminator: + propertyName: step_type + mapping: + inference: '#/components/schemas/InferenceStep-Output' + memory_retrieval: '#/components/schemas/MemoryRetrievalStep-Output' + shield_call: '#/components/schemas/ShieldCallStep-Output' + tool_execution: '#/components/schemas/ToolExecutionStep-Output' + type: array + title: Steps + output_message: + $ref: '#/components/schemas/CompletionMessage-Output' + output_attachments: + title: Output Attachments + items: + $ref: '#/components/schemas/Attachment-Output' + type: array + started_at: + type: string + format: date-time + title: Started At + completed_at: + title: Completed At + type: string + format: date-time + type: object + required: + - turn_id + - session_id + - input_messages + - steps + - output_message + - started_at + title: Turn + description: "A single turn in an interaction with an Agentic System.\n\n:param turn_id: Unique identifier for the turn within a session\n:param session_id: Unique identifier for the conversation session\n:param input_messages: List of messages that initiated this turn\n:param steps: Ordered list of processing steps executed during this turn\n:param output_message: The model's generated response containing content and metadata\n:param output_attachments: (Optional) Files or media attached to the agent's response\n:param started_at: Timestamp when the turn began\n:param completed_at: (Optional) Timestamp when the turn finished, if completed" + URIDataSource: + properties: + type: + type: string + const: uri + title: Type + default: uri + uri: + type: string + title: Uri + type: object + required: + - uri + title: URIDataSource + description: "A dataset that can be obtained from a URI.\n:param uri: The dataset can be obtained from a URI. E.g.\n - \"https://mywebsite.com/mydata.jsonl\"\n - \"lsfs://mydata.jsonl\"\n - \"data:csv;base64,{base64_content}\"" + URL: + properties: + uri: + type: string + title: Uri + type: object + required: + - uri + title: URL + description: "A URL reference to external content.\n\n:param uri: The URL string pointing to the resource" + UnionType: + properties: + type: + type: string + const: union + title: Type + default: union + type: object + title: UnionType + description: "Parameter type for union values.\n\n:param type: Discriminator type. Always \"union\"" + UserMessage-Input: + properties: + role: + type: string + const: user + title: Role + default: user + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' discriminator: + propertyName: type mapping: - agent_turn_input: '#/$defs/AgentTurnInputType' - array: '#/$defs/ArrayType' - boolean: '#/$defs/BooleanType' - chat_completion_input: '#/$defs/ChatCompletionInputType' - completion_input: '#/$defs/CompletionInputType' - json: '#/$defs/JsonType' - number: '#/$defs/NumberType' - object: '#/$defs/ObjectType' - string: '#/$defs/StringType' - union: '#/$defs/UnionType' + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Context + type: object + required: + - content + title: UserMessage + description: "A message from the user in a chat conversation.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param context: (Optional) This field is used internally by Llama Stack to pass RAG context. This field may be removed in the API in the future." + UserMessage-Output: + properties: + role: + type: string + const: user + title: Role + default: user + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: oneOf: - - $ref: '#/$defs/StringType' - - $ref: '#/$defs/NumberType' - - $ref: '#/$defs/BooleanType' - - $ref: '#/$defs/ArrayType' - - $ref: '#/$defs/ObjectType' - - $ref: '#/$defs/JsonType' - - $ref: '#/$defs/UnionType' - - $ref: '#/$defs/ChatCompletionInputType' - - $ref: '#/$defs/CompletionInputType' - - $ref: '#/$defs/AgentTurnInputType' - title: Return Type - params: - anyOf: - - discriminator: - mapping: - basic: '#/$defs/BasicScoringFnParams' - llm_as_judge: '#/$defs/LLMAsJudgeScoringFnParams' - regex_parser: '#/$defs/RegexParserScoringFnParams' - propertyName: type - oneOf: - - $ref: '#/$defs/LLMAsJudgeScoringFnParams' - - $ref: '#/$defs/RegexParserScoringFnParams' - - $ref: '#/$defs/BasicScoringFnParams' - - type: 'null' - description: >- - The parameters for the scoring function for benchmark eval, these - can be overridden for app eval - title: Params - required: - - identifier - - provider_id - - return_type - title: ScoringFn + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Context + type: object + required: + - content + title: UserMessage + description: "A message from the user in a chat conversation.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param context: (Optional) This field is used internally by Llama Stack to pass RAG context. This field may be removed in the API in the future." + VectorStoreChunkingStrategyAuto: + properties: + type: + type: string + const: auto + title: Type + default: auto + type: object + title: VectorStoreChunkingStrategyAuto + description: "Automatic chunking strategy for vector store files.\n\n:param type: Strategy type, always \"auto\" for automatic chunking" + VectorStoreChunkingStrategyStatic: + properties: + type: + type: string + const: static + title: Type + default: static + static: + $ref: '#/components/schemas/VectorStoreChunkingStrategyStaticConfig' + type: object + required: + - static + title: VectorStoreChunkingStrategyStatic + description: "Static chunking strategy with configurable parameters.\n\n:param type: Strategy type, always \"static\" for static chunking\n:param static: Configuration parameters for the static chunking strategy" + VectorStoreChunkingStrategyStaticConfig: + properties: + chunk_overlap_tokens: + type: integer + title: Chunk Overlap Tokens + default: 400 + max_chunk_size_tokens: + type: integer + maximum: 4096.0 + minimum: 100.0 + title: Max Chunk Size Tokens + default: 800 + type: object + title: VectorStoreChunkingStrategyStaticConfig + description: "Configuration for static chunking strategy.\n\n:param chunk_overlap_tokens: Number of tokens to overlap between adjacent chunks\n:param max_chunk_size_tokens: Maximum number of tokens per chunk, must be between 100 and 4096" + VectorStoreContent: + properties: + type: + type: string + const: text + title: Type + text: + type: string + title: Text + type: object + required: + - type + - text + title: VectorStoreContent + description: "Content item from a vector store file or search result.\n\n:param type: Content type, currently only \"text\" is supported\n:param text: The actual text content" + VectorStoreFileBatchObject: + properties: + id: + type: string + title: Id + object: + type: string + title: Object + default: vector_store.file_batch + created_at: + type: integer + title: Created At + vector_store_id: + type: string + title: Vector Store Id + status: + anyOf: + - type: string + const: completed + - type: string + const: in_progress + - type: string + const: cancelled + - type: string + const: failed + title: Status + file_counts: + $ref: '#/components/schemas/VectorStoreFileCounts' + type: object + required: + - id + - created_at + - vector_store_id + - status + - file_counts + title: VectorStoreFileBatchObject + description: "OpenAI Vector Store File Batch object.\n\n:param id: Unique identifier for the file batch\n:param object: Object type identifier, always \"vector_store.file_batch\"\n:param created_at: Timestamp when the file batch was created\n:param vector_store_id: ID of the vector store containing the file batch\n:param status: Current processing status of the file batch\n:param file_counts: File processing status counts for the batch" + VectorStoreFileCounts: + properties: + completed: + type: integer + title: Completed + cancelled: + type: integer + title: Cancelled + failed: + type: integer + title: Failed + in_progress: + type: integer + title: In Progress + total: + type: integer + title: Total + type: object + required: + - completed + - cancelled + - failed + - in_progress + - total + title: VectorStoreFileCounts + description: "File processing status counts for a vector store.\n\n:param completed: Number of files that have been successfully processed\n:param cancelled: Number of files that had their processing cancelled\n:param failed: Number of files that failed to process\n:param in_progress: Number of files currently being processed\n:param total: Total number of files in the vector store" + VectorStoreFileLastError: + properties: + code: + anyOf: + - type: string + const: server_error + - type: string + const: rate_limit_exceeded + title: Code + message: + type: string + title: Message + type: object + required: + - code + - message + title: VectorStoreFileLastError + description: "Error information for failed vector store file processing.\n\n:param code: Error code indicating the type of failure\n:param message: Human-readable error message describing the failure" + VectorStoreFileObject: + properties: + id: + type: string + title: Id + object: + type: string + title: Object + default: vector_store.file + attributes: + additionalProperties: true type: object - StringType: - description: >- - Parameter type for string values. - - - :param type: Discriminator type. Always "string" - properties: - type: - const: string - default: string - title: Type - type: string - title: StringType + title: Attributes + chunking_strategy: + oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + title: Chunking Strategy + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + created_at: + type: integer + title: Created At + last_error: + $ref: '#/components/schemas/VectorStoreFileLastError' + status: + anyOf: + - type: string + const: completed + - type: string + const: in_progress + - type: string + const: cancelled + - type: string + const: failed + title: Status + usage_bytes: + type: integer + title: Usage Bytes + default: 0 + vector_store_id: + type: string + title: Vector Store Id + type: object + required: + - id + - chunking_strategy + - created_at + - status + - vector_store_id + title: VectorStoreFileObject + description: "OpenAI Vector Store File object.\n\n:param id: Unique identifier for the file\n:param object: Object type identifier, always \"vector_store.file\"\n:param attributes: Key-value attributes associated with the file\n:param chunking_strategy: Strategy used for splitting the file into chunks\n:param created_at: Timestamp when the file was added to the vector store\n:param last_error: (Optional) Error information if file processing failed\n:param status: Current processing status of the file\n:param usage_bytes: Storage space used by this file in bytes\n:param vector_store_id: ID of the vector store containing this file" + VectorStoreObject: + properties: + id: + type: string + title: Id + object: + type: string + title: Object + default: vector_store + created_at: + type: integer + title: Created At + name: + title: Name + type: string + usage_bytes: + type: integer + title: Usage Bytes + default: 0 + file_counts: + $ref: '#/components/schemas/VectorStoreFileCounts' + status: + type: string + title: Status + default: completed + expires_after: + title: Expires After + additionalProperties: true type: object - UnionType: - description: >- - Parameter type for union values. - - - :param type: Discriminator type. Always "union" - properties: - type: - const: union - default: union - title: Type - type: string - title: UnionType + expires_at: + title: Expires At + type: integer + last_active_at: + title: Last Active At + type: integer + metadata: + additionalProperties: true + type: object + title: Metadata + type: object + required: + - id + - created_at + - file_counts + title: VectorStoreObject + description: "OpenAI Vector Store object.\n\n:param id: Unique identifier for the vector store\n:param object: Object type identifier, always \"vector_store\"\n:param created_at: Timestamp when the vector store was created\n:param name: (Optional) Name of the vector store\n:param usage_bytes: Storage space used by the vector store in bytes\n:param file_counts: File processing status counts for the vector store\n:param status: Current status of the vector store\n:param expires_after: (Optional) Expiration policy for the vector store\n:param expires_at: (Optional) Timestamp when the vector store will expire\n:param last_active_at: (Optional) Timestamp of last activity on the vector store\n:param metadata: Set of key-value pairs that can be attached to the vector store" + VectorStoreSearchResponse: + properties: + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + score: + type: number + title: Score + attributes: + title: Attributes + additionalProperties: + anyOf: + - type: string + - type: number + - type: boolean type: object + content: + items: + $ref: '#/components/schemas/VectorStoreContent' + type: array + title: Content + type: object + required: + - file_id + - filename + - score + - content + title: VectorStoreSearchResponse + description: "Response from searching a vector store.\n\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result\n:param attributes: (Optional) Key-value attributes associated with the file\n:param content: List of content items matching the search query" + VectorStoreSearchResponsePage: properties: + object: + type: string + title: Object + default: vector_store.search_results.page + search_query: + type: string + title: Search Query data: items: - $ref: '#/$defs/ScoringFn' - title: Data + $ref: '#/components/schemas/VectorStoreSearchResponse' type: array + title: Data + has_more: + type: boolean + title: Has More + default: false + next_page: + title: Next Page + type: string + type: object required: - - data - title: ListScoringFunctionsResponse + - search_query + - data + title: VectorStoreSearchResponsePage + description: "Paginated response from searching a vector store.\n\n:param object: Object type identifier for the search results page\n:param search_query: The original search query that was executed\n:param data: List of search result objects\n:param has_more: Whether there are more results available beyond this page\n:param next_page: (Optional) Token for retrieving the next page of results" + VersionInfo: + properties: + version: + type: string + title: Version type: object - RegisterScoringFunctionRequest: + required: + - version + title: VersionInfo + description: "Version information for the service.\n\n:param version: Version number of the service" + ViolationLevel: + type: string + enum: + - info + - warn + - error + title: ViolationLevel + description: "Severity level of a safety violation.\n\n:cvar INFO: Informational level violation that does not require action\n:cvar WARN: Warning level violation that suggests caution but allows continuation\n:cvar ERROR: Error level violation that requires blocking or intervention" + WeightedRanker: + properties: + type: + type: string + const: weighted + title: Type + default: weighted + alpha: + type: number + maximum: 1.0 + minimum: 0.0 + title: Alpha + description: Weight factor between 0 and 1. 0 means only keyword scores, 1 means only vector scores. + default: 0.5 type: object - ScoringFn: - $defs: - AgentTurnInputType: - description: >- - Parameter type for agent turn input. - - - :param type: Discriminator type. Always "agent_turn_input" - properties: - type: - const: agent_turn_input - default: agent_turn_input - title: Type - type: string - title: AgentTurnInputType - type: object - AggregationFunctionType: - description: >- - Types of aggregation functions for scoring results. - - :cvar average: Calculate the arithmetic mean of scores - - :cvar weighted_average: Calculate a weighted average of scores - - :cvar median: Calculate the median value of scores - - :cvar categorical_count: Count occurrences of categorical values - - :cvar accuracy: Calculate accuracy as the proportion of correct answers - enum: - - average - - weighted_average - - median - - categorical_count - - accuracy - title: AggregationFunctionType - type: string - ArrayType: - description: >- - Parameter type for array values. - - - :param type: Discriminator type. Always "array" - properties: - type: - const: array - default: array - title: Type - type: string - title: ArrayType - type: object - BasicScoringFnParams: - description: >- - Parameters for basic scoring function configuration. - - :param type: The type of scoring function parameters, always basic - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row - properties: - type: - const: basic - default: basic - title: Type - type: string - aggregation_functions: - description: >- - Aggregation functions to apply to the scores of each row - items: - $ref: '#/$defs/AggregationFunctionType' - title: Aggregation Functions - type: array - title: BasicScoringFnParams - type: object - BooleanType: - description: >- - Parameter type for boolean values. - - - :param type: Discriminator type. Always "boolean" - properties: - type: - const: boolean - default: boolean - title: Type - type: string - title: BooleanType - type: object - ChatCompletionInputType: - description: >- - Parameter type for chat completion input. - - - :param type: Discriminator type. Always "chat_completion_input" - properties: - type: - const: chat_completion_input - default: chat_completion_input - title: Type - type: string - title: ChatCompletionInputType - type: object - CompletionInputType: - description: >- - Parameter type for completion input. - - - :param type: Discriminator type. Always "completion_input" - properties: - type: - const: completion_input - default: completion_input - title: Type - type: string - title: CompletionInputType - type: object - JsonType: - description: >- - Parameter type for JSON values. - - - :param type: Discriminator type. Always "json" - properties: - type: - const: json - default: json - title: Type - type: string - title: JsonType - type: object - LLMAsJudgeScoringFnParams: - description: >- - Parameters for LLM-as-judge scoring function configuration. - - :param type: The type of scoring function parameters, always llm_as_judge - - :param judge_model: Identifier of the LLM model to use as a judge for - scoring - - :param prompt_template: (Optional) Custom prompt template for the judge - model - - :param judge_score_regexes: Regexes to extract the answer from generated - response - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row - properties: - type: - const: llm_as_judge - default: llm_as_judge - title: Type - type: string - judge_model: - title: Judge Model - type: string - prompt_template: - anyOf: - - type: string - - type: 'null' - title: Prompt Template - judge_score_regexes: - description: >- - Regexes to extract the answer from generated response - items: - type: string - title: Judge Score Regexes - type: array - aggregation_functions: - description: >- - Aggregation functions to apply to the scores of each row - items: - $ref: '#/$defs/AggregationFunctionType' - title: Aggregation Functions - type: array - required: - - judge_model - title: LLMAsJudgeScoringFnParams - type: object - NumberType: - description: >- - Parameter type for numeric values. - - - :param type: Discriminator type. Always "number" - properties: - type: - const: number - default: number - title: Type - type: string - title: NumberType - type: object - ObjectType: - description: >- - Parameter type for object values. - - - :param type: Discriminator type. Always "object" - properties: - type: - const: object - default: object - title: Type - type: string - title: ObjectType - type: object - RegexParserScoringFnParams: - description: >- - Parameters for regex parser scoring function configuration. - - :param type: The type of scoring function parameters, always regex_parser - - :param parsing_regexes: Regex to extract the answer from generated response - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row - properties: - type: - const: regex_parser - default: regex_parser - title: Type - type: string - parsing_regexes: - description: >- - Regex to extract the answer from generated response - items: - type: string - title: Parsing Regexes - type: array - aggregation_functions: - description: >- - Aggregation functions to apply to the scores of each row - items: - $ref: '#/$defs/AggregationFunctionType' - title: Aggregation Functions - type: array - title: RegexParserScoringFnParams - type: object - StringType: - description: >- - Parameter type for string values. - - - :param type: Discriminator type. Always "string" - properties: - type: - const: string - default: string - title: Type - type: string - title: StringType - type: object - UnionType: - description: >- - Parameter type for union values. - - - :param type: Discriminator type. Always "union" - properties: - type: - const: union - default: union - title: Type - type: string - title: UnionType - type: object - description: >- - A scoring function resource for evaluating model outputs. - - :param type: The resource type, always scoring_function + title: WeightedRanker + description: "Weighted ranker configuration that combines vector and keyword scores.\n\n:param type: The type of ranker, always \"weighted\"\n:param alpha: Weight factor between 0 and 1.\n 0 means only use keyword scores,\n 1 means only use vector scores,\n values in between blend both scores." + _URLOrData: + properties: + url: + $ref: '#/components/schemas/URL' + data: + contentEncoding: base64 + title: Data + type: string + type: object + title: _URLOrData + description: "A URL or a base64 encoded string\n\n:param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. Note that URL could have length limits.\n:param data: base64 encoded image data as string" + __main_____agents_agent_id_session_Request: + properties: + agent_id: + type: string + title: Agent Id + session_name: + type: string + title: Session Name + type: object + required: + - agent_id + - session_name + title: _agents_agent_id_session_Request + __main_____agents_agent_id_session_session_id_turn_Request: + properties: + agent_id: + type: string + title: Agent Id + session_id: + type: string + title: Session Id + messages: + $ref: '#/components/schemas/UserMessage-Input' + stream: + type: boolean + title: Stream + default: false + documents: + $ref: '#/components/schemas/Document' + toolgroups: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + title: Toolgroups + tool_config: + $ref: '#/components/schemas/ToolConfig' + type: object + required: + - agent_id + - session_id + - messages + - documents + - toolgroups + - tool_config + title: _agents_agent_id_session_session_id_turn_Request + __main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request: + properties: + agent_id: + type: string + title: Agent Id + session_id: + type: string + title: Session Id + turn_id: + type: string + title: Turn Id + tool_responses: + $ref: '#/components/schemas/ToolResponse-Input' + stream: + type: boolean + title: Stream + default: false + type: object + required: + - agent_id + - session_id + - turn_id + - tool_responses + title: _agents_agent_id_session_session_id_turn_turn_id_resume_Request + __main_____datasets_Request: properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier + purpose: + $ref: '#/components/schemas/DatasetPurpose' + metadata: type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id + title: Metadata + dataset_id: type: string - type: - const: scoring_function - default: scoring_function - title: Type + title: Dataset Id + type: object + required: + - purpose + - metadata + - dataset_id + title: _datasets_Request + _batches_Request: + properties: + input_file_id: type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description + title: Input File Id + endpoint: + type: string + title: Endpoint + completion_window: + type: string + title: Completion Window metadata: - additionalProperties: true - description: >- - Any additional metadata for this definition + type: string title: Metadata - type: object - return_type: - description: >- - The return type of the deterministic function + idempotency_key: + type: string + title: Idempotency Key + type: object + required: + - input_file_id + - endpoint + - completion_window + - metadata + - idempotency_key + title: _batches_Request + _batches_batch_id_cancel_Request: + properties: + batch_id: + type: string + title: Batch Id + type: object + required: + - batch_id + title: _batches_batch_id_cancel_Request + _conversations_Request: + properties: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + title: Items discriminator: - mapping: - agent_turn_input: '#/$defs/AgentTurnInputType' - array: '#/$defs/ArrayType' - boolean: '#/$defs/BooleanType' - chat_completion_input: '#/$defs/ChatCompletionInputType' - completion_input: '#/$defs/CompletionInputType' - json: '#/$defs/JsonType' - number: '#/$defs/NumberType' - object: '#/$defs/ObjectType' - string: '#/$defs/StringType' - union: '#/$defs/UnionType' propertyName: type - oneOf: - - $ref: '#/$defs/StringType' - - $ref: '#/$defs/NumberType' - - $ref: '#/$defs/BooleanType' - - $ref: '#/$defs/ArrayType' - - $ref: '#/$defs/ObjectType' - - $ref: '#/$defs/JsonType' - - $ref: '#/$defs/UnionType' - - $ref: '#/$defs/ChatCompletionInputType' - - $ref: '#/$defs/CompletionInputType' - - $ref: '#/$defs/AgentTurnInputType' - title: Return Type - params: + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Input' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + metadata: + type: string + title: Metadata + type: object + required: + - items + - metadata + title: _conversations_Request + _conversations_conversation_id_Request: + properties: + conversation_id: + type: string + title: Conversation Id + metadata: + type: string + title: Metadata + type: object + required: + - conversation_id + - metadata + title: _conversations_conversation_id_Request + _conversations_conversation_id_items_Request: + properties: + conversation_id: + type: string + title: Conversation Id + items: anyOf: - - discriminator: - mapping: - basic: '#/$defs/BasicScoringFnParams' - llm_as_judge: '#/$defs/LLMAsJudgeScoringFnParams' - regex_parser: '#/$defs/RegexParserScoringFnParams' - propertyName: type - oneOf: - - $ref: '#/$defs/LLMAsJudgeScoringFnParams' - - $ref: '#/$defs/RegexParserScoringFnParams' - - $ref: '#/$defs/BasicScoringFnParams' - - type: 'null' - description: >- - The parameters for the scoring function for benchmark eval, these can - be overridden for app eval - title: Params + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + title: Items + type: object required: - - identifier - - provider_id - - return_type - title: ScoringFn + - conversation_id + - items + title: _conversations_conversation_id_items_Request + _inference_rerank_Request: + properties: + model: + type: string + title: Model + query: + type: string + title: Query + items: + type: string + title: Items + max_num_results: + type: integer + title: Max Num Results type: object - ScoreRequest: + required: + - model + - query + - items + - max_num_results + title: _inference_rerank_Request + _models_Request: + properties: + model_id: + type: string + title: Model Id + provider_model_id: + type: string + title: Provider Model Id + provider_id: + type: string + title: Provider Id + metadata: + type: string + title: Metadata + model_type: + $ref: '#/components/schemas/ModelType' type: object - ScoreResponse: - $defs: - ScoringResult: - description: >- - A scoring result for a single row. - - - :param score_rows: The scoring result for each row. Each row is a map - of column name to value. - - :param aggregated_results: Map of metric name to aggregated value - properties: - score_rows: - items: - additionalProperties: true - type: object - title: Score Rows - type: array - aggregated_results: - additionalProperties: true - title: Aggregated Results - type: object - required: - - score_rows - - aggregated_results - title: ScoringResult - type: object - description: >- - The response from scoring. - - - :param results: A map of scoring function name to ScoringResult. + required: + - model_id + - provider_model_id + - provider_id + - metadata + - model_type + title: _models_Request + _moderations_Request: properties: - results: - additionalProperties: - $ref: '#/$defs/ScoringResult' - title: Results - type: object + input: + type: string + title: Input + model: + type: string + title: Model + type: object required: - - results - title: ScoreResponse + - input + - model + title: _moderations_Request + _prompts_Request: + properties: + prompt: + type: string + title: Prompt + variables: + type: string + title: Variables type: object - ScoreBatchRequest: + required: + - prompt + - variables + title: _prompts_Request + _prompts_prompt_id_Request: + properties: + prompt_id: + type: string + title: Prompt Id + prompt: + type: string + title: Prompt + version: + type: integer + title: Version + variables: + type: string + title: Variables + set_as_default: + type: boolean + title: Set As Default + default: true + type: object + required: + - prompt_id + - prompt + - version + - variables + title: _prompts_prompt_id_Request + _prompts_prompt_id_set_default_version_Request: + properties: + prompt_id: + type: string + title: Prompt Id + version: + type: integer + title: Version + type: object + required: + - prompt_id + - version + title: _prompts_prompt_id_set_default_version_Request + _responses_Request: + properties: + input: + type: string + title: Input + model: + type: string + title: Model + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' + instructions: + type: string + title: Instructions + previous_response_id: + type: string + title: Previous Response Id + conversation: + type: string + title: Conversation + store: + type: boolean + title: Store + default: true + stream: + type: boolean + title: Stream + default: false + temperature: + type: number + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + tools: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' + title: Tools + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseInputToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + include: + type: string + title: Include + max_infer_iters: + type: integer + title: Max Infer Iters + default: 10 + type: object + required: + - input + - model + - prompt + - instructions + - previous_response_id + - conversation + - temperature + - text + - tools + - include + title: _responses_Request + _scoring_score_Request: + properties: + input_rows: + type: string + title: Input Rows + scoring_functions: + type: string + title: Scoring Functions type: object - ScoreBatchResponse: - $defs: - ScoringResult: - description: >- - A scoring result for a single row. - - - :param score_rows: The scoring result for each row. Each row is a map - of column name to value. - - :param aggregated_results: Map of metric name to aggregated value - properties: - score_rows: - items: - additionalProperties: true - type: object - title: Score Rows - type: array - aggregated_results: - additionalProperties: true - title: Aggregated Results - type: object - required: - - score_rows - - aggregated_results - title: ScoringResult - type: object - description: >- - Response from batch scoring operations on datasets. - - - :param dataset_id: (Optional) The identifier of the dataset that was scored - - :param results: A map of scoring function name to ScoringResult + required: + - input_rows + - scoring_functions + title: _scoring_score_Request + _scoring_score_batch_Request: properties: dataset_id: - anyOf: - - type: string - - type: 'null' + type: string title: Dataset Id - results: - additionalProperties: - $ref: '#/$defs/ScoringResult' - title: Results - type: object - required: - - results - title: ScoreBatchResponse + scoring_functions: + type: string + title: Scoring Functions + save_results_dataset: + type: boolean + title: Save Results Dataset + default: false type: object - ListShieldsResponse: - $defs: - Shield: - description: >- - A safety shield resource that can be used to check content. - - - :param params: (Optional) Configuration parameters for the shield - - :param type: The resource type, always shield - properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier - type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: shield - default: shield - title: Type - type: string - params: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Params - required: - - identifier - - provider_id - title: Shield - type: object - properties: - data: - items: - $ref: '#/$defs/Shield' - title: Data - type: array required: - - data - title: ListShieldsResponse - type: object - RegisterShieldRequest: - type: object + - dataset_id + - scoring_functions + title: _scoring_score_batch_Request + _shields_Request: properties: shield_id: type: string - description: >- - The identifier of the shield to register. + title: Shield Id provider_shield_id: type: string - description: >- - The identifier of the shield in the provider. + title: Provider Shield Id provider_id: type: string - description: The identifier of the provider. + title: Provider Id params: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The parameters of the shield. - additionalProperties: false - required: - - shield_id - title: RegisterShieldRequest - InvokeToolRequest: + type: string + title: Params type: object + required: + - shield_id + - provider_shield_id + - provider_id + - params + title: _shields_Request + _tool_runtime_invoke_Request: properties: tool_name: type: string - description: The name of the tool to invoke. + title: Tool Name kwargs: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - A dictionary of arguments to pass to the tool. - additionalProperties: false - required: - - tool_name - - kwargs - title: InvokeToolRequest - ImageContentItem: - type: object - properties: - type: type: string - const: image - default: image - description: >- - Discriminator type of the content item. Always "image" - image: - type: object - properties: - url: - $ref: '#/components/schemas/URL' - description: >- - A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - data: - type: string - contentEncoding: base64 - description: base64 encoded image data as string - additionalProperties: false - description: >- - Image as a base64 encoded string or an URL - additionalProperties: false - required: - - type - - image - title: ImageContentItem - description: A image content item - InterleavedContent: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - InterleavedContentItem: - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem' - text: '#/components/schemas/TextContentItem' - TextContentItem: + title: Kwargs type: object - properties: - type: - type: string - const: text - default: text - description: >- - Discriminator type of the content item. Always "text" - text: - type: string - description: Text content - additionalProperties: false required: - - type - - text - title: TextContentItem - description: A text content item - ToolInvocationResult: - type: object + - tool_name + - kwargs + title: _tool_runtime_invoke_Request + _tool_runtime_rag_tool_query_Request: properties: content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - (Optional) The output content from the tool execution - error_message: type: string - description: >- - (Optional) Error message if the tool execution failed - error_code: - type: integer - description: >- - (Optional) Numeric error code if the tool execution failed - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool execution - additionalProperties: false - title: ToolInvocationResult - description: Result of a tool invocation. - URL: + title: Content + vector_store_ids: + type: string + title: Vector Store Ids + query_config: + $ref: '#/components/schemas/RAGQueryConfig' type: object + required: + - content + - vector_store_ids + - query_config + title: _tool_runtime_rag_tool_query_Request + _vector_io_query_Request: properties: - uri: + vector_store_id: type: string - description: The URL string pointing to the resource - additionalProperties: false - required: - - uri - title: URL - description: A URL reference to external content. - ToolDef: + title: Vector Store Id + query: + type: string + title: Query + params: + type: string + title: Params type: object + required: + - vector_store_id + - query + - params + title: _vector_io_query_Request + _vector_stores_vector_store_id_Request: properties: - toolgroup_id: + vector_store_id: type: string - description: >- - (Optional) ID of the tool group this tool belongs to + title: Vector Store Id name: type: string - description: Name of the tool - description: + title: Name + expires_after: type: string - description: >- - (Optional) Human-readable description of what the tool does - input_schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON Schema for tool inputs (MCP inputSchema) - output_schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON Schema for tool outputs (MCP outputSchema) + title: Expires After metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool - additionalProperties: false - required: - - name - title: ToolDef - description: >- - Tool definition used in runtime contexts. - ListToolDefsResponse: + type: string + title: Metadata type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/ToolDef' - description: List of tool definitions - additionalProperties: false required: - - data - title: ListToolDefsResponse - description: >- - Response containing a list of tool definitions. - RAGDocument: - type: object + - vector_store_id + - name + - expires_after + - metadata + title: _vector_stores_vector_store_id_Request + _vector_stores_vector_store_id_file_batches_batch_id_cancel_Request: properties: - document_id: + batch_id: type: string - description: The unique identifier for the document. - content: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - - $ref: '#/components/schemas/URL' - description: The content of the document. - mime_type: + title: Batch Id + vector_store_id: type: string - description: The MIME type of the document. - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Additional metadata for the document. - additionalProperties: false - required: - - document_id - - content - - metadata - title: RAGDocument - description: >- - A document to be used for document ingestion in the RAG Tool. - InsertRequest: + title: Vector Store Id type: object + required: + - batch_id + - vector_store_id + title: _vector_stores_vector_store_id_file_batches_batch_id_cancel_Request + _vector_stores_vector_store_id_files_Request: properties: - documents: - type: array - items: - $ref: '#/components/schemas/RAGDocument' - description: >- - List of documents to index in the RAG system vector_store_id: type: string - description: >- - ID of the vector database to store the document embeddings - chunk_size_in_tokens: - type: integer - description: >- - (Optional) Size in tokens for document chunking during indexing - additionalProperties: false - required: - - documents - - vector_store_id - - chunk_size_in_tokens - title: InsertRequest - DefaultRAGQueryGeneratorConfig: + title: Vector Store Id + file_id: + type: string + title: File Id + attributes: + type: string + title: Attributes + chunking_strategy: + anyOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + title: Chunking Strategy type: object + required: + - vector_store_id + - file_id + - attributes + - chunking_strategy + title: _vector_stores_vector_store_id_files_Request + _vector_stores_vector_store_id_files_file_id_Request: properties: - type: + vector_store_id: type: string - const: default - default: default - description: >- - Type of query generator, always 'default' - separator: + title: Vector Store Id + file_id: type: string - default: ' ' - description: >- - String separator used to join query terms - additionalProperties: false - required: - - type - - separator - title: DefaultRAGQueryGeneratorConfig - description: >- - Configuration for the default RAG query generator. - LLMRAGQueryGeneratorConfig: + title: File Id + attributes: + type: string + title: Attributes type: object + required: + - vector_store_id + - file_id + - attributes + title: _vector_stores_vector_store_id_files_file_id_Request + _vector_stores_vector_store_id_search_Request: properties: - type: + vector_store_id: type: string - const: llm - default: llm - description: Type of query generator, always 'llm' - model: + title: Vector Store Id + query: type: string - description: >- - Name of the language model to use for query generation - template: + title: Query + filters: type: string - description: >- - Template string for formatting the query generation prompt - additionalProperties: false - required: - - type - - model - - template - title: LLMRAGQueryGeneratorConfig - description: >- - Configuration for the LLM-based RAG query generator. - RAGQueryConfig: + title: Filters + max_num_results: + type: integer + title: Max Num Results + default: 10 + ranking_options: + $ref: '#/components/schemas/SearchRankingOptions' + rewrite_query: + type: boolean + title: Rewrite Query + default: false + search_mode: + type: string + title: Search Mode + default: vector type: object + required: + - vector_store_id + - query + - filters + - ranking_options + title: _vector_stores_vector_store_id_search_Request + Error: + description: "Error response from the API. Roughly follows RFC 7807.\n\n:param status: HTTP status code\n:param title: Error title, a short summary of the error which is invariant for an error type\n:param detail: Error detail, a longer human-readable description of the error\n:param instance: (Optional) A URL which can be used to retrieve more information about the specific occurrence of the error" properties: - query_generator_config: - oneOf: - - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' - - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' - discriminator: - propertyName: type - mapping: - default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' - llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' - description: Configuration for the query generator. - max_tokens_in_context: - type: integer - default: 4096 - description: Maximum number of tokens in the context. - max_chunks: + status: + title: Status type: integer - default: 5 - description: Maximum number of chunks to retrieve. - chunk_template: + title: + title: Title type: string - default: > - Result {index} - - - :param params: (Optional) Configuration parameters for the shield - - :param type: The resource type, always shield - properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier + detail: + title: Detail type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id + instance: + title: Instance type: string - type: - const: shield - default: shield - title: Type + nullable: true + required: + - status + - title + - detail + title: Error + type: object + Agent: + description: "An agent instance with configuration and metadata.\n\n:param agent_id: Unique identifier for the agent\n:param agent_config: Configuration settings for the agent\n:param created_at: Timestamp when the agent was created" + properties: + agent_id: + title: Agent Id + type: string + agent_config: + $ref: '#/components/schemas/AgentConfig' + created_at: + format: date-time + title: Created At type: string - params: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Params required: - - identifier - - provider_id - title: Shield - type: object - SyntheticDataGenerateRequest: + - agent_id + - agent_config + - created_at + title: Agent type: object - SyntheticDataGenerationResponse: - description: >- - Response from the synthetic data generation. Batch of (prompt, response, score) - tuples that pass the threshold. - - - :param synthetic_data: List of generated synthetic data samples that passed - the filtering criteria - - :param statistics: (Optional) Statistical information about the generation - process and filtering results + AgentStepResponse: + description: "Response containing details of a specific agent step.\n\n:param step: The complete step data and execution details" properties: - synthetic_data: - items: - additionalProperties: true - type: object - title: Synthetic Data - type: array - statistics: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Statistics + step: + discriminator: + mapping: + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/components/schemas/InferenceStep' + - $ref: '#/components/schemas/ToolExecutionStep' + - $ref: '#/components/schemas/ShieldCallStep' + - $ref: '#/components/schemas/MemoryRetrievalStep' + title: Step required: - - synthetic_data - title: SyntheticDataGenerationResponse - type: object - InvokeToolRequest: + - step + title: AgentStepResponse type: object - ToolInvocationResult: - $defs: - ImageContentItem: - description: >- - A image content item - - - :param type: Discriminator type of the content item. Always "image" - - :param image: Image as a base64 encoded string or an URL - properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/$defs/_URLOrData' - required: - - image - title: ImageContentItem - type: object - TextContentItem: - description: >- - A text content item - - - :param type: Discriminator type of the content item. Always "text" - - :param text: Text content - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: TextContentItem - type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL - type: object - _URLOrData: - description: >- - A URL or a base64 encoded string - - - :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - - :param data: base64 encoded image data as string - properties: - url: - anyOf: - - $ref: '#/$defs/URL' - - type: 'null' - data: - anyOf: - - type: string - - type: 'null' - contentEncoding: base64 - title: Data - title: _URLOrData - type: object - description: >- - Result of a tool invocation. - - - :param content: (Optional) The output content from the tool execution - - :param error_message: (Optional) Error message if the tool execution failed - - :param error_code: (Optional) Numeric error code if the tool execution failed - - :param metadata: (Optional) Additional metadata about the tool execution + CompletionMessage: + description: "A message containing the model's (assistant) response in a chat conversation.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param stop_reason: Reason why the model stopped generating. Options are:\n - `StopReason.end_of_turn`: The model finished generating the entire response.\n - `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n - `StopReason.out_of_tokens`: The model ran out of token budget.\n:param tool_calls: List of tool calls. Each tool call is a ToolCall object." properties: + role: + const: assistant + default: assistant + title: Role + type: string content: anyOf: - - type: string - - discriminator: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: mapping: image: '#/$defs/ImageContentItem' text: '#/$defs/TextContentItem' propertyName: type oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - type: 'null' + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array title: Content - error_message: - anyOf: - - type: string - - type: 'null' - title: Error Message - error_code: - anyOf: - - type: integer - - type: 'null' - title: Error Code - metadata: + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + title: Tool Calls + items: + $ref: '#/components/schemas/ToolCall' + type: array + required: + - content + - stop_reason + title: CompletionMessage + type: object + InferenceStep: + description: "An inference step in an agent turn.\n\n:param model_response: The response from the LLM." + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + title: Started At + format: date-time + type: string + nullable: true + completed_at: + title: Completed At + format: date-time + type: string + nullable: true + step_type: + const: inference + default: inference + title: Step Type + type: string + model_response: + $ref: '#/components/schemas/CompletionMessage' + required: + - turn_id + - step_id + - model_response + title: InferenceStep + type: object + ListOpenAIResponseInputItem: + description: "List container for OpenAI response input items.\n\n:param data: List of input items\n:param object: Object type identifier, always \"list\"" + properties: + data: + items: + anyOf: + - discriminator: + mapping: + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage' + title: Data + type: array + object: + const: list + default: list + title: Object + type: string + required: + - data + title: ListOpenAIResponseInputItem + type: object + ListOpenAIResponseObject: + description: "Paginated list of OpenAI response objects with navigation metadata.\n\n:param data: List of response objects with their input context\n:param has_more: Whether there are more results available beyond this page\n:param first_id: Identifier of the first item in this page\n:param last_id: Identifier of the last item in this page\n:param object: Object type identifier, always \"list\"" + properties: + data: + items: + $ref: '#/components/schemas/OpenAIResponseObjectWithInput' + title: Data + type: array + has_more: + title: Has More + type: boolean + first_id: + title: First Id + type: string + last_id: + title: Last Id + type: string + object: + const: list + default: list + title: Object + type: string + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIResponseObject + type: object + MemoryRetrievalStep: + description: "A memory retrieval step in an agent turn.\n\n:param vector_store_ids: The IDs of the vector databases to retrieve context from.\n:param inserted_context: The context retrieved from the vector databases." + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + title: Started At + format: date-time + type: string + nullable: true + completed_at: + title: Completed At + format: date-time + type: string + nullable: true + step_type: + const: memory_retrieval + default: memory_retrieval + title: Step Type + type: string + vector_store_ids: + title: Vector Store Ids + type: string + inserted_context: anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Metadata - title: ToolInvocationResult + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Inserted Context + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource + OpenAIDeleteResponseObject: + description: "Response object confirming deletion of an OpenAI response.\n\n:param id: Unique identifier of the deleted response\n:param object: Object type identifier, always \"response\"\n:param deleted: Deletion confirmation flag, always True" properties: - uri: - title: Uri + id: + title: Id + type: string + object: + const: response + default: response + title: Object type: string + deleted: + default: true + title: Deleted + type: boolean required: - - uri - title: URL + - id + title: OpenAIDeleteResponseObject type: object - ListToolDefsResponse: - $defs: - ToolDef: - description: >- - Tool definition used in runtime contexts. - - - :param name: Name of the tool - - :param description: (Optional) Human-readable description of what the - tool does - - :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) - - :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) - - :param metadata: (Optional) Additional metadata about the tool - - :param toolgroup_id: (Optional) ID of the tool group this tool belongs - to - properties: - toolgroup_id: - anyOf: - - type: string - - type: 'null' - title: Toolgroup Id - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - input_schema: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Input Schema - output_schema: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Output Schema - metadata: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Metadata - required: - - name - title: ToolDef - type: object - description: >- - Response containing a list of tool definitions. - - - :param data: List of tool definitions + PaginatedResponse: + description: "A generic paginated response that follows a simple format.\n\n:param data: The list of items for the current page\n:param has_more: Whether there are more items available after this set\n:param url: The URL for accessing this list" properties: data: items: - $ref: '#/$defs/ToolDef' + additionalProperties: true + type: object title: Data type: array + has_more: + title: Has More + type: boolean + url: + title: Url + type: string + nullable: true required: - - data - title: ListToolDefsResponse + - data + - has_more + title: PaginatedResponse type: object - InsertRequest: + Session: + description: "A single session of an interaction with an Agentic System.\n\n:param session_id: Unique identifier for the conversation session\n:param session_name: Human-readable name for the session\n:param turns: List of all turns that have occurred in this session\n:param started_at: Timestamp when the session was created" + properties: + session_id: + title: Session Id + type: string + session_name: + title: Session Name + type: string + turns: + items: + $ref: '#/components/schemas/Turn' + title: Turns + type: array + started_at: + format: date-time + title: Started At + type: string + required: + - session_id + - session_name + - turns + - started_at + title: Session type: object - QueryRequest: + ShieldCallStep: + description: "A shield call step in an agent turn.\n\n:param violation: The violation from the shield call." + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + title: Started At + format: date-time + type: string + nullable: true + completed_at: + title: Completed At + format: date-time + type: string + nullable: true + step_type: + const: shield_call + default: shield_call + title: Step Type + type: string + violation: + $ref: '#/components/schemas/SafetyViolation' + required: + - turn_id + - step_id + - violation + title: ShieldCallStep type: object - RAGQueryResult: - $defs: - ImageContentItem: - description: >- - A image content item - - - :param type: Discriminator type of the content item. Always "image" - - :param image: Image as a base64 encoded string or an URL - properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/$defs/_URLOrData' - required: - - image - title: ImageContentItem - type: object - TextContentItem: - description: >- - A text content item - - - :param type: Discriminator type of the content item. Always "text" - - :param text: Text content - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: TextContentItem - type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL - type: object - _URLOrData: - description: >- - A URL or a base64 encoded string - - - :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - - :param data: base64 encoded image data as string - properties: - url: - anyOf: - - $ref: '#/$defs/URL' - - type: 'null' - data: - anyOf: - - type: string - - type: 'null' - contentEncoding: base64 - title: Data - title: _URLOrData - type: object - description: >- - Result of a RAG query containing retrieved content and metadata. - - - :param content: (Optional) The retrieved content from the query - - :param metadata: Additional metadata about the query result + ToolExecutionStep: + description: "A tool execution step in an agent turn.\n\n:param tool_calls: The tool calls to execute.\n:param tool_responses: The tool responses from the tool calls." + properties: + turn_id: + title: Turn Id + type: string + step_id: + title: Step Id + type: string + started_at: + title: Started At + format: date-time + type: string + nullable: true + completed_at: + title: Completed At + format: date-time + type: string + nullable: true + step_type: + const: tool_execution + default: tool_execution + title: Step Type + type: string + tool_calls: + items: + $ref: '#/components/schemas/ToolCall' + title: Tool Calls + type: array + tool_responses: + items: + $ref: '#/components/schemas/ToolResponse' + title: Tool Responses + type: array + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + type: object + ToolResponse: + description: "Response from a tool invocation.\n\n:param call_id: Unique identifier for the tool call this response is for\n:param tool_name: Name of the tool that was invoked\n:param content: The response content from the tool\n:param metadata: (Optional) Additional metadata about the tool response" properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name content: anyOf: - - type: string - - discriminator: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: mapping: image: '#/$defs/ImageContentItem' text: '#/$defs/TextContentItem' propertyName: type oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - type: 'null' + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array title: Content metadata: - additionalProperties: true title: Metadata + additionalProperties: true type: object - title: RAGQueryResult + nullable: true + required: + - call_id + - tool_name + - content + title: ToolResponse type: object - ListToolGroupsResponse: - $defs: - ToolGroup: - description: >- - A group of related tools managed together. - - - :param type: Type of resource, always 'tool_group' - - :param mcp_endpoint: (Optional) Model Context Protocol endpoint for remote - tools - - :param args: (Optional) Additional arguments for the tool group - properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier - type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: tool_group - default: tool_group - title: Type - type: string - mcp_endpoint: - anyOf: - - $ref: '#/$defs/URL' - - type: 'null' - args: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Args - required: - - identifier - - provider_id - title: ToolGroup - type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL - type: object - description: >- - Response containing a list of tool groups. - - - :param data: List of tool groups + ListBatchesResponse: + description: Response containing a list of batch objects. properties: + object: + const: list + default: list + title: Object + type: string data: + description: List of batch objects items: - $ref: '#/$defs/ToolGroup' + $ref: '#/components/schemas/Batch' title: Data type: array + first_id: + description: ID of the first batch in the list + title: First Id + type: string + nullable: true + last_id: + description: ID of the last batch in the list + title: Last Id + type: string + nullable: true + has_more: + default: false + description: Whether there are more batches available + title: Has More + type: boolean required: - - data - title: ListToolGroupsResponse + - data + title: ListBatchesResponse type: object - RegisterToolGroupRequest: + ConversationDeletedResource: + description: Response for deleted conversation. + properties: + id: + description: The deleted conversation identifier + title: Id + type: string + object: + default: conversation.deleted + description: Object type + title: Object + type: string + deleted: + default: true + description: Whether the object was deleted + title: Deleted + type: boolean + required: + - id + title: ConversationDeletedResource type: object - ToolGroup: - $defs: - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL - type: object - description: >- - A group of related tools managed together. - - - :param type: Type of resource, always 'tool_group' - - :param mcp_endpoint: (Optional) Model Context Protocol endpoint for remote - tools - - :param args: (Optional) Additional arguments for the tool group + ConversationItemDeletedResource: + description: Response for deleted conversation item. properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier + id: + description: The deleted item identifier + title: Id type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id + object: + default: conversation.item.deleted + description: Object type + title: Object type: string - type: - const: tool_group - default: tool_group - title: Type + deleted: + default: true + description: Whether the object was deleted + title: Deleted + type: boolean + required: + - id + title: ConversationItemDeletedResource + type: object + ListOpenAIFileResponse: + description: "Response for listing files in OpenAI Files API.\n\n:param data: List of file objects\n:param has_more: Whether there are more files available beyond this page\n:param first_id: ID of the first file in the list for pagination\n:param last_id: ID of the last file in the list for pagination\n:param object: The object type, which is always \"list\"" + properties: + data: + items: + $ref: '#/components/schemas/OpenAIFileObject' + title: Data + type: array + has_more: + title: Has More + type: boolean + first_id: + title: First Id + type: string + last_id: + title: Last Id + type: string + object: + const: list + default: list + title: Object type: string - mcp_endpoint: - anyOf: - - $ref: '#/$defs/URL' - - type: 'null' - args: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Args required: - - identifier - - provider_id - title: ToolGroup + - data + - has_more + - first_id + - last_id + title: ListOpenAIFileResponse type: object - ToolDef: - description: >- - Tool definition used in runtime contexts. - - - :param name: Name of the tool - - :param description: (Optional) Human-readable description of what the tool - does - - :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) - - :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) - - :param metadata: (Optional) Additional metadata about the tool - - :param toolgroup_id: (Optional) ID of the tool group this tool belongs to + OpenAIFileDeleteResponse: + description: "Response for deleting a file in OpenAI Files API.\n\n:param id: The file identifier that was deleted\n:param object: The object type, which is always \"file\"\n:param deleted: Whether the file was successfully deleted" properties: - toolgroup_id: - anyOf: - - type: string - - type: 'null' - title: Toolgroup Id - name: - title: Name + id: + title: Id + type: string + object: + const: file + default: file + title: Object + type: string + deleted: + title: Deleted + type: boolean + required: + - id + - deleted + title: OpenAIFileDeleteResponse + type: object + ListOpenAIChatCompletionResponse: + description: "Response from listing OpenAI-compatible chat completions.\n\n:param data: List of chat completion objects with their input messages\n:param has_more: Whether there are more completions available beyond this list\n:param first_id: ID of the first completion in this list\n:param last_id: ID of the last completion in this list\n:param object: Must be \"list\" to identify this as a list response" + properties: + data: + items: + $ref: '#/$defs/RouteInfo' + title: Data + type: array + required: + - data + title: ListRoutesResponse + description: >- + Response containing a list of all available API routes. + OpenAIModel: + type: object + properties: + id: type: string - description: The ID of the tool group to register. - provider_id: + object: type: string - description: >- - The ID of the provider to use for the tool group. - mcp_endpoint: - $ref: '#/components/schemas/URL' - description: >- - The MCP endpoint to use for the tool group. - args: + const: model + default: model + created: + type: integer + owned_by: + type: string + custom_metadata: type: object additionalProperties: oneOf: @@ -14622,25 +13784,47 @@ components: - type: string - type: array - type: object - description: >- - A dictionary of arguments to pass to the tool group. additionalProperties: false required: - - toolgroup_id - - provider_id - title: RegisterToolGroupRequest - Chunk: + - id + - object + - created + - owned_by + title: OpenAIModel + description: A model from OpenAI. + OpenAIListModelsResponse: type: object properties: - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - The content of the chunk, which can be interleaved text, images, or other - types. - chunk_id: + data: + type: array + items: + $ref: '#/components/schemas/OpenAIModel' + additionalProperties: false + required: + - data + title: OpenAIListModelsResponse + ModelType: + type: string + enum: + - llm + - embedding + - rerank + title: ModelType + description: >- + Enumeration of supported model types in Llama Stack. + RegisterModelRequest: + type: object + properties: + model_id: + type: string + description: The identifier of the model to register. + provider_model_id: type: string description: >- - Unique identifier for the chunk. Must be provided explicitly. + The identifier of the model in the provider. + provider_id: + type: string + description: The identifier of the provider. metadata: type: object additionalProperties: @@ -14651,2933 +13835,2550 @@ components: - type: string - type: array - type: object - description: >- - Metadata associated with the chunk that will be used in the model context - during inference. - embedding: - type: array - items: - type: number - description: >- - Optional embedding for the chunk. If not provided, it will be computed - later. - chunk_metadata: - $ref: '#/components/schemas/ChunkMetadata' - description: >- - Metadata for the chunk that will NOT be used in the context during inference. - The `chunk_metadata` is required backend functionality. + description: Any additional metadata for this model. + model_type: + $ref: '#/components/schemas/ModelType' + description: The type of model to register. additionalProperties: false required: - - content - - chunk_id - - metadata - title: Chunk - description: >- - A chunk of content that can be inserted into a vector database. - ChunkMetadata: - type: object - InsertChunksRequest: - type: object - QueryChunksRequest: + - model_id + title: RegisterModelRequest + Model: type: object - QueryChunksResponse: - $defs: - Chunk: - description: >- - A chunk of content that can be inserted into a vector database. - - :param content: The content of the chunk, which can be interleaved text, - images, or other types. - - :param embedding: Optional embedding for the chunk. If not provided, it - will be computed later. - - :param metadata: Metadata associated with the chunk that will be used - in the model context during inference. - - :param stored_chunk_id: The chunk ID that is stored in the vector database. - Used for backend functionality. - - :param chunk_metadata: Metadata for the chunk that will NOT be used in - the context during inference. - The `chunk_metadata` is required backend functionality. - properties: - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - metadata: - additionalProperties: true - title: Metadata - type: object - embedding: - anyOf: - - items: - type: number - type: array - - type: 'null' - title: Embedding - chunk_id: - anyOf: - - type: string - - type: 'null' - title: Chunk Id - chunk_metadata: - anyOf: - - $ref: '#/$defs/ChunkMetadata' - - type: 'null' - required: - - content - title: Chunk - type: object - ChunkMetadata: + properties: + identifier: + type: string description: >- - `ChunkMetadata` is backend metadata for a `Chunk` that is used to store - additional information about the chunk that - will not be used in the context during inference, but is required - for backend functionality. The `ChunkMetadata` - is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and - is not expected to change after. - Use `Chunk.metadata` for metadata that will be used in the context - during inference. - :param chunk_id: The ID of the chunk. If not set, it will be generated - based on the document ID and content. - - :param document_id: The ID of the document this chunk belongs to. - - :param source: The source of the content, such as a URL, file path, or - other identifier. - - :param created_timestamp: An optional timestamp indicating when the chunk - was created. - - :param updated_timestamp: An optional timestamp indicating when the chunk - was last updated. - - :param chunk_window: The window of the chunk, which can be used to group - related chunks together. - - :param chunk_tokenizer: The tokenizer used to create the chunk. Default - is Tiktoken. - - :param chunk_embedding_model: The embedding model used to create the chunk's - embedding. - - :param chunk_embedding_dimension: The dimension of the embedding vector - for the chunk. - - :param content_token_count: The number of tokens in the content of the - chunk. - - :param metadata_token_count: The number of tokens in the metadata of the - chunk. - properties: - chunk_id: - anyOf: - - type: string - - type: 'null' - title: Chunk Id - document_id: - anyOf: - - type: string - - type: 'null' - title: Document Id - source: - anyOf: - - type: string - - type: 'null' - title: Source - created_timestamp: - anyOf: - - type: integer - - type: 'null' - title: Created Timestamp - updated_timestamp: - anyOf: - - type: integer - - type: 'null' - title: Updated Timestamp - chunk_window: - anyOf: - - type: string - - type: 'null' - title: Chunk Window - chunk_tokenizer: - anyOf: - - type: string - - type: 'null' - title: Chunk Tokenizer - chunk_embedding_model: - anyOf: - - type: string - - type: 'null' - title: Chunk Embedding Model - chunk_embedding_dimension: - anyOf: - - type: integer - - type: 'null' - title: Chunk Embedding Dimension - content_token_count: - anyOf: - - type: integer - - type: 'null' - title: Content Token Count - metadata_token_count: - anyOf: - - type: integer - - type: 'null' - title: Metadata Token Count - title: ChunkMetadata - type: object - ImageContentItem: + Unique identifier for this resource in llama stack + provider_resource_id: + type: string description: >- - A image content item - - - :param type: Discriminator type of the content item. Always "image" - - :param image: Image as a base64 encoded string or an URL - properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/$defs/_URLOrData' - required: - - image - title: ImageContentItem - type: object - TextContentItem: + Unique identifier for this resource in the provider + provider_id: + type: string description: >- - A text content item - - - :param type: Discriminator type of the content item. Always "text" - - :param text: Text content - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: TextContentItem - type: object - URL: + ID of the provider that owns this resource + type: + type: string + enum: + - model + - shield + - vector_store + - dataset + - scoring_function + - benchmark + - tool + - tool_group + - prompt + const: model + default: model description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL + The resource type, always 'model' for model resources + metadata: type: object - _URLOrData: + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: Any additional metadata for this model + model_type: + $ref: '#/components/schemas/ModelType' + default: llm description: >- - A URL or a base64 encoded string - - - :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - - :param data: base64 encoded image data as string - properties: - url: - anyOf: - - $ref: '#/$defs/URL' - - type: 'null' - data: - anyOf: - - type: string - - type: 'null' - contentEncoding: base64 - title: Data - title: _URLOrData - type: object - description: >- - Response from querying chunks in a vector database. - - - :param chunks: List of content chunks returned from the query - - :param scores: Relevance scores corresponding to each returned chunk - properties: - chunks: - items: - $ref: '#/$defs/Chunk' - title: Chunks - type: array - scores: - items: - type: number - title: Scores - type: array + The type of model (LLM or embedding model) + additionalProperties: false required: - - chunks - - scores - title: QueryChunksResponse + - identifier + - provider_id + - type + - metadata + - model_type + title: Model + description: >- + A model resource representing an AI model registered in Llama Stack. + RunModerationRequest: type: object - VectorStoreListResponse: + ModerationObject: $defs: - VectorStoreFileCounts: - description: >- - File processing status counts for a vector store. - - - :param completed: Number of files that have been successfully processed - - :param cancelled: Number of files that had their processing cancelled - - :param failed: Number of files that failed to process - - :param in_progress: Number of files currently being processed - - :param total: Total number of files in the vector store - properties: - completed: - title: Completed - type: integer - cancelled: - title: Cancelled - type: integer - failed: - title: Failed - type: integer - in_progress: - title: In Progress - type: integer - total: - title: Total - type: integer - required: - - completed - - cancelled - - failed - - in_progress - - total - title: VectorStoreFileCounts - type: object - VectorStoreObject: + ModerationObjectResults: description: >- - OpenAI Vector Store object. - - - :param id: Unique identifier for the vector store - - :param object: Object type identifier, always "vector_store" - - :param created_at: Timestamp when the vector store was created - - :param name: (Optional) Name of the vector store - - :param usage_bytes: Storage space used by the vector store in bytes - - :param file_counts: File processing status counts for the vector store - - :param status: Current status of the vector store + A moderation object. - :param expires_after: (Optional) Expiration policy for the vector store + :param flagged: Whether any of the below categories are flagged. - :param expires_at: (Optional) Timestamp when the vector store will expire + :param categories: A list of the categories, and whether they are flagged + or not. - :param last_active_at: (Optional) Timestamp of last activity on the vector - store + :param category_applied_input_types: A list of the categories along with + the input type(s) that the score applies to. - :param metadata: Set of key-value pairs that can be attached to the vector - store + :param category_scores: A list of the categories along with their scores + as predicted by model. properties: - id: - title: Id - type: string - object: - default: vector_store - title: Object - type: string - created_at: - title: Created At - type: integer - name: + flagged: + title: Flagged + type: boolean + categories: anyOf: - - type: string + - additionalProperties: + type: boolean + type: object - type: 'null' - title: Name - usage_bytes: - default: 0 - title: Usage Bytes - type: integer - file_counts: - $ref: '#/$defs/VectorStoreFileCounts' - status: - default: completed - title: Status - type: string - expires_after: + title: Categories + category_applied_input_types: anyOf: - - additionalProperties: true + - additionalProperties: + items: + type: string + type: array type: object - type: 'null' - title: Expires After - expires_at: + title: Category Applied Input Types + category_scores: anyOf: - - type: integer + - additionalProperties: + type: number + type: object - type: 'null' - title: Expires At - last_active_at: + title: Category Scores + user_message: anyOf: - - type: integer + - type: string - type: 'null' - title: Last Active At + title: User Message metadata: additionalProperties: true title: Metadata type: object required: - - id - - created_at - - file_counts - title: VectorStoreObject - type: object - description: >- - Response from listing vector stores. - - - :param object: Object type identifier, always "list" - - :param data: List of vector store objects - - :param first_id: (Optional) ID of the first vector store in the list for pagination - - :param last_id: (Optional) ID of the last vector store in the list for pagination - - :param has_more: Whether there are more vector stores available beyond this - page - properties: - object: - default: list - title: Object - type: string - data: - items: - $ref: '#/$defs/VectorStoreObject' - title: Data - type: array - first_id: - anyOf: - - type: string - - type: 'null' - title: First Id - last_id: - anyOf: - - type: string - - type: 'null' - title: Last Id - has_more: - default: false - title: Has More - type: boolean - required: - - data - title: VectorStoreListResponse - type: object - VectorStoreObject: - $defs: - VectorStoreFileCounts: - description: >- - File processing status counts for a vector store. - - - :param completed: Number of files that have been successfully processed - - :param cancelled: Number of files that had their processing cancelled - - :param failed: Number of files that failed to process - - :param in_progress: Number of files currently being processed - - :param total: Total number of files in the vector store - properties: - completed: - title: Completed - type: integer - cancelled: - title: Cancelled - type: integer - failed: - title: Failed - type: integer - in_progress: - title: In Progress - type: integer - total: - title: Total - type: integer - required: - - completed - - cancelled - - failed - - in_progress - - total - title: VectorStoreFileCounts - type: object - description: >- - OpenAI Vector Store object. - - - :param id: Unique identifier for the vector store - - :param object: Object type identifier, always "vector_store" - - :param created_at: Timestamp when the vector store was created - - :param name: (Optional) Name of the vector store - - :param usage_bytes: Storage space used by the vector store in bytes - - :param file_counts: File processing status counts for the vector store - - :param status: Current status of the vector store - - :param expires_after: (Optional) Expiration policy for the vector store - - :param expires_at: (Optional) Timestamp when the vector store will expire - - :param last_active_at: (Optional) Timestamp of last activity on the vector - store - - :param metadata: Set of key-value pairs that can be attached to the vector - store - properties: - id: - title: Id - type: string - object: - default: vector_store - title: Object - type: string - created_at: - title: Created At - type: integer - name: - anyOf: - - type: string - - type: 'null' - title: Name - usage_bytes: - default: 0 - title: Usage Bytes - type: integer - file_counts: - $ref: '#/$defs/VectorStoreFileCounts' - status: - default: completed - title: Status - type: string - expires_after: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Expires After - expires_at: - anyOf: - - type: integer - - type: 'null' - title: Expires At - last_active_at: - anyOf: - - type: integer - - type: 'null' - title: Last Active At - metadata: - additionalProperties: true - title: Metadata + - flagged + title: ModerationObjectResults type: object - required: - - id - - created_at - - file_counts - title: VectorStoreObject - type: object - OpenaiUpdateVectorStoreRequest: - type: object - VectorStoreDeleteResponse: description: >- - Response from deleting a vector store. - + A moderation object. - :param id: Unique identifier of the deleted vector store + :param id: The unique identifier for the moderation request. - :param object: Object type identifier for the deletion response + :param model: The model used to generate the moderation results. - :param deleted: Whether the deletion operation was successful + :param results: A list of moderation objects properties: id: title: Id type: string - object: - default: vector_store.deleted - title: Object + model: + title: Model type: string - deleted: - default: true - title: Deleted - type: boolean + results: + items: + $ref: '#/$defs/ModerationObjectResults' + title: Results + type: array required: - id - title: VectorStoreDeleteResponse + - model + - results + title: ModerationObject type: object - VectorStoreFileBatchObject: + ListPromptsResponse: $defs: - VectorStoreFileCounts: + Prompt: description: >- - File processing status counts for a vector store. + A prompt resource representing a stored OpenAI Compatible prompt template + in Llama Stack. - :param completed: Number of files that have been successfully processed + :param prompt: The system prompt text with variable placeholders. Variables + are only supported when using the Responses API. - :param cancelled: Number of files that had their processing cancelled + :param version: Version (integer starting at 1, incremented on save) - :param failed: Number of files that failed to process + :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' - :param in_progress: Number of files currently being processed + :param variables: List of prompt variable names that can be used in the + prompt template - :param total: Total number of files in the vector store + :param is_default: Boolean indicating whether this version is the default + version for this prompt properties: - completed: - title: Completed - type: integer - cancelled: - title: Cancelled - type: integer - failed: - title: Failed - type: integer - in_progress: - title: In Progress - type: integer - total: - title: Total + prompt: + anyOf: + - type: string + - type: 'null' + description: >- + The system prompt with variable placeholders + title: Prompt + version: + description: >- + Version (integer starting at 1, incremented on save) + minimum: 1 + title: Version type: integer + prompt_id: + description: >- + Unique identifier in format 'pmpt_<48-digit-hash>' + title: Prompt Id + type: string + variables: + description: >- + List of variable names that can be used in the prompt template + items: + type: string + title: Variables + type: array + is_default: + default: false + description: >- + Boolean indicating whether this version is the default version + title: Is Default + type: boolean required: - - completed - - cancelled - - failed - - in_progress - - total - title: VectorStoreFileCounts + - version + - prompt_id + title: Prompt type: object + description: Response model to list prompts. + properties: + data: + items: + $ref: '#/$defs/Prompt' + title: Data + type: array + required: + - data + title: ListPromptsResponse + type: object + CreatePromptRequest: + type: object + Prompt: description: >- - OpenAI Vector Store File Batch object. - + A prompt resource representing a stored OpenAI Compatible prompt template + in Llama Stack. - :param id: Unique identifier for the file batch - :param object: Object type identifier, always "vector_store.file_batch" + :param prompt: The system prompt text with variable placeholders. Variables + are only supported when using the Responses API. - :param created_at: Timestamp when the file batch was created + :param version: Version (integer starting at 1, incremented on save) - :param vector_store_id: ID of the vector store containing the file batch + :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' - :param status: Current processing status of the file batch + :param variables: List of prompt variable names that can be used in the prompt + template - :param file_counts: File processing status counts for the batch + :param is_default: Boolean indicating whether this version is the default + version for this prompt properties: - id: - title: Id - type: string - object: - default: vector_store.file_batch - title: Object - type: string - created_at: - title: Created At + prompt: + anyOf: + - type: string + - type: 'null' + description: >- + The system prompt with variable placeholders + title: Prompt + version: + description: >- + Version (integer starting at 1, incremented on save) + minimum: 1 + title: Version type: integer - vector_store_id: - title: Vector Store Id + prompt_id: + description: >- + Unique identifier in format 'pmpt_<48-digit-hash>' + title: Prompt Id type: string - status: - anyOf: - - const: completed - type: string - - const: in_progress - type: string - - const: cancelled - type: string - - const: failed - type: string - title: Status - file_counts: - $ref: '#/$defs/VectorStoreFileCounts' + variables: + description: >- + List of variable names that can be used in the prompt template + items: + type: string + title: Variables + type: array + is_default: + default: false + description: >- + Boolean indicating whether this version is the default version + title: Is Default + type: boolean required: - - id - - created_at - - vector_store_id - - status - - file_counts - title: VectorStoreFileBatchObject + - version + - prompt_id + title: Prompt type: object - VectorStoreFilesListInBatchResponse: + UpdatePromptRequest: + type: object + SetDefaultVersionRequest: + type: object + ListProvidersResponse: $defs: - VectorStoreChunkingStrategyAuto: - description: >- - Automatic chunking strategy for vector store files. - - - :param type: Strategy type, always "auto" for automatic chunking - properties: - type: - const: auto - default: auto - title: Type - type: string - title: VectorStoreChunkingStrategyAuto - type: object - VectorStoreChunkingStrategyStatic: - description: >- - Static chunking strategy with configurable parameters. - - - :param type: Strategy type, always "static" for static chunking - - :param static: Configuration parameters for the static chunking strategy - properties: - type: - const: static - default: static - title: Type - type: string - static: - $ref: >- - #/$defs/VectorStoreChunkingStrategyStaticConfig - required: - - static - title: VectorStoreChunkingStrategyStatic - type: object - VectorStoreChunkingStrategyStaticConfig: + ProviderInfo: description: >- - Configuration for static chunking strategy. + Information about a registered provider including its configuration and + health status. - :param chunk_overlap_tokens: Number of tokens to overlap between adjacent - chunks + :param api: The API name this provider implements - :param max_chunk_size_tokens: Maximum number of tokens per chunk, must - be between 100 and 4096 - properties: - chunk_overlap_tokens: - default: 400 - title: Chunk Overlap Tokens - type: integer - max_chunk_size_tokens: - default: 800 - maximum: 4096 - minimum: 100 - title: Max Chunk Size Tokens - type: integer - title: VectorStoreChunkingStrategyStaticConfig - type: object - VectorStoreFileLastError: - description: >- - Error information for failed vector store file processing. + :param provider_id: Unique identifier for the provider + :param provider_type: The type of provider implementation - :param code: Error code indicating the type of failure + :param config: Configuration parameters for the provider - :param message: Human-readable error message describing the failure + :param health: Current health status of the provider properties: - code: - anyOf: - - const: server_error - type: string - - const: rate_limit_exceeded - type: string - title: Code - message: - title: Message + api: + title: Api type: string - required: - - code - - message - title: VectorStoreFileLastError - type: object - VectorStoreFileObject: - description: >- - OpenAI Vector Store File object. - - - :param id: Unique identifier for the file - - :param object: Object type identifier, always "vector_store.file" - - :param attributes: Key-value attributes associated with the file - - :param chunking_strategy: Strategy used for splitting the file into chunks - - :param created_at: Timestamp when the file was added to the vector store - - :param last_error: (Optional) Error information if file processing failed - - :param status: Current processing status of the file - - :param usage_bytes: Storage space used by this file in bytes - - :param vector_store_id: ID of the vector store containing this file - properties: - id: - title: Id + provider_id: + title: Provider Id type: string - object: - default: vector_store.file - title: Object + provider_type: + title: Provider Type type: string - attributes: + config: additionalProperties: true - title: Attributes + title: Config + type: object + health: + additionalProperties: true + title: Health type: object - chunking_strategy: - discriminator: - mapping: - auto: '#/$defs/VectorStoreChunkingStrategyAuto' - static: >- - #/$defs/VectorStoreChunkingStrategyStatic - propertyName: type - oneOf: - - $ref: '#/$defs/VectorStoreChunkingStrategyAuto' - - $ref: >- - #/$defs/VectorStoreChunkingStrategyStatic - title: Chunking Strategy - created_at: - title: Created At - type: integer - last_error: - anyOf: - - $ref: '#/$defs/VectorStoreFileLastError' - - type: 'null' - status: - anyOf: - - const: completed - type: string - - const: in_progress - type: string - - const: cancelled - type: string - - const: failed - type: string - title: Status - usage_bytes: - default: 0 - title: Usage Bytes - type: integer - vector_store_id: - title: Vector Store Id - type: string required: - - id - - chunking_strategy - - created_at - - status - - vector_store_id - title: VectorStoreFileObject + - api + - provider_id + - provider_type + - config + - health + title: ProviderInfo type: object description: >- - Response from listing files in a vector store file batch. - - - :param object: Object type identifier, always "list" - - :param data: List of vector store file objects in the batch - - :param first_id: (Optional) ID of the first file in the list for pagination + Response containing a list of all available providers. - :param last_id: (Optional) ID of the last file in the list for pagination - :param has_more: Whether there are more files available beyond this page + :param data: List of provider information objects properties: - object: - default: list - title: Object - type: string data: items: - $ref: '#/$defs/VectorStoreFileObject' + $ref: '#/$defs/ProviderInfo' title: Data type: array - first_id: - anyOf: - - type: string - - type: 'null' - title: First Id - last_id: - anyOf: - - type: string - - type: 'null' - title: Last Id - has_more: - default: false - title: Has More - type: boolean required: - data - title: VectorStoreFilesListInBatchResponse - type: object - Union: + title: ListProvidersResponse type: object - nullable: true - VectorStoreListFilesResponse: - $defs: - VectorStoreChunkingStrategyAuto: - description: >- - Automatic chunking strategy for vector store files. + ProviderInfo: + description: >- + Information about a registered provider including its configuration and health + status. - :param type: Strategy type, always "auto" for automatic chunking - properties: - type: - const: auto - default: auto - title: Type - type: string - title: VectorStoreChunkingStrategyAuto - type: object - VectorStoreChunkingStrategyStatic: - description: >- - Static chunking strategy with configurable parameters. + :param api: The API name this provider implements + + :param provider_id: Unique identifier for the provider + :param provider_type: The type of provider implementation - :param type: Strategy type, always "static" for static chunking + :param config: Configuration parameters for the provider - :param static: Configuration parameters for the static chunking strategy - properties: - type: - const: static - default: static - title: Type - type: string - static: - $ref: >- - #/$defs/VectorStoreChunkingStrategyStaticConfig - required: - - static - title: VectorStoreChunkingStrategyStatic + :param health: Current health status of the provider + properties: + api: + title: Api + type: string + provider_id: + title: Provider Id + type: string + provider_type: + title: Provider Type + type: string + config: + additionalProperties: true + title: Config + type: object + health: + additionalProperties: true + title: Health type: object - VectorStoreChunkingStrategyStaticConfig: + required: + - api + - provider_id + - provider_type + - config + - health + title: ProviderInfo + type: object + ListOpenAIResponseObject: + $defs: + AllowedToolsFilter: description: >- - Configuration for static chunking strategy. - + Filter configuration for restricting which MCP tools can be used. - :param chunk_overlap_tokens: Number of tokens to overlap between adjacent - chunks - :param max_chunk_size_tokens: Maximum number of tokens per chunk, must - be between 100 and 4096 + :param tool_names: (Optional) List of specific tool names that are allowed properties: - chunk_overlap_tokens: - default: 400 - title: Chunk Overlap Tokens - type: integer - max_chunk_size_tokens: - default: 800 - maximum: 4096 - minimum: 100 - title: Max Chunk Size Tokens - type: integer - title: VectorStoreChunkingStrategyStaticConfig + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Tool Names + title: AllowedToolsFilter type: object - VectorStoreFileLastError: + MCPListToolsTool: description: >- - Error information for failed vector store file processing. + Tool definition returned by MCP list tools operation. + + :param input_schema: JSON schema defining the tool's input parameters - :param code: Error code indicating the type of failure + :param name: Name of the tool - :param message: Human-readable error message describing the failure + :param description: (Optional) Description of what the tool does properties: - code: - anyOf: - - const: server_error - type: string - - const: rate_limit_exceeded - type: string - title: Code - message: - title: Message + input_schema: + additionalProperties: true + title: Input Schema + type: object + name: + title: Name type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description required: - - code - - message - title: VectorStoreFileLastError + - input_schema + - name + title: MCPListToolsTool type: object - VectorStoreFileObject: + OpenAIResponseAnnotationCitation: description: >- - OpenAI Vector Store File object. - - - :param id: Unique identifier for the file - - :param object: Object type identifier, always "vector_store.file" - - :param attributes: Key-value attributes associated with the file + URL citation annotation for referencing external web resources. - :param chunking_strategy: Strategy used for splitting the file into chunks - :param created_at: Timestamp when the file was added to the vector store + :param type: Annotation type identifier, always "url_citation" - :param last_error: (Optional) Error information if file processing failed + :param end_index: End position of the citation span in the content - :param status: Current processing status of the file + :param start_index: Start position of the citation span in the content - :param usage_bytes: Storage space used by this file in bytes + :param title: Title of the referenced web resource - :param vector_store_id: ID of the vector store containing this file + :param url: URL of the referenced web resource properties: - id: - title: Id - type: string - object: - default: vector_store.file - title: Object + type: + const: url_citation + default: url_citation + title: Type type: string - attributes: - additionalProperties: true - title: Attributes - type: object - chunking_strategy: - discriminator: - mapping: - auto: '#/$defs/VectorStoreChunkingStrategyAuto' - static: >- - #/$defs/VectorStoreChunkingStrategyStatic - propertyName: type - oneOf: - - $ref: '#/$defs/VectorStoreChunkingStrategyAuto' - - $ref: >- - #/$defs/VectorStoreChunkingStrategyStatic - title: Chunking Strategy - created_at: - title: Created At + end_index: + title: End Index type: integer - last_error: - anyOf: - - $ref: '#/$defs/VectorStoreFileLastError' - - type: 'null' - status: - anyOf: - - const: completed - type: string - - const: in_progress - type: string - - const: cancelled - type: string - - const: failed - type: string - title: Status - usage_bytes: - default: 0 - title: Usage Bytes + start_index: + title: Start Index type: integer - vector_store_id: - title: Vector Store Id + title: + title: Title + type: string + url: + title: Url type: string required: - - id - - chunking_strategy - - created_at - - status - - vector_store_id - title: VectorStoreFileObject + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation type: object - description: >- - Response from listing files in a vector store. - - - :param object: Object type identifier, always "list" - - :param data: List of vector store file objects - - :param first_id: (Optional) ID of the first file in the list for pagination + "OpenAIResponseAnnotationContainerFileCitation": + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: >- + OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: + description: >- + File citation annotation for referencing specific files in response content. - :param last_id: (Optional) ID of the last file in the list for pagination - :param has_more: Whether there are more files available beyond this page - properties: - object: - default: list - title: Object - type: string - data: - items: - $ref: '#/$defs/VectorStoreFileObject' - title: Data - type: array - first_id: - anyOf: - - type: string - - type: 'null' - title: First Id - last_id: - anyOf: - - type: string - - type: 'null' - title: Last Id - has_more: - default: false - title: Has More - type: boolean - required: - - data - title: VectorStoreListFilesResponse - type: object - OpenaiAttachFileToVectorStoreRequest: - type: object - VectorStoreFileObject: - $defs: - VectorStoreChunkingStrategyAuto: - description: >- - Automatic chunking strategy for vector store files. + :param type: Annotation type identifier, always "file_citation" + :param file_id: Unique identifier of the referenced file + + :param filename: Name of the referenced file - :param type: Strategy type, always "auto" for automatic chunking + :param index: Position index of the citation within the content properties: type: - const: auto - default: auto + const: file_citation + default: file_citation title: Type type: string - title: VectorStoreChunkingStrategyAuto + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + index: + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation type: object - VectorStoreChunkingStrategyStatic: - description: >- - Static chunking strategy with configurable parameters. - - - :param type: Strategy type, always "static" for static chunking - - :param static: Configuration parameters for the static chunking strategy + OpenAIResponseAnnotationFilePath: properties: type: - const: static - default: static + const: file_path + default: file_path title: Type type: string - static: - $ref: >- - #/$defs/VectorStoreChunkingStrategyStaticConfig + file_id: + title: File Id + type: string + index: + title: Index + type: integer required: - - static - title: VectorStoreChunkingStrategyStatic + - file_id + - index + title: OpenAIResponseAnnotationFilePath type: object - VectorStoreChunkingStrategyStaticConfig: + OpenAIResponseContentPartRefusal: description: >- - Configuration for static chunking strategy. + Refusal content within a streamed response part. - :param chunk_overlap_tokens: Number of tokens to overlap between adjacent - chunks + :param type: Content part type identifier, always "refusal" - :param max_chunk_size_tokens: Maximum number of tokens per chunk, must - be between 100 and 4096 + :param refusal: Refusal text supplied by the model properties: - chunk_overlap_tokens: - default: 400 - title: Chunk Overlap Tokens - type: integer - max_chunk_size_tokens: - default: 800 - maximum: 4096 - minimum: 100 - title: Max Chunk Size Tokens - type: integer - title: VectorStoreChunkingStrategyStaticConfig + type: + const: refusal + default: refusal + title: Type + type: string + refusal: + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal type: object - VectorStoreFileLastError: + OpenAIResponseError: description: >- - Error information for failed vector store file processing. + Error details for failed OpenAI response requests. - :param code: Error code indicating the type of failure + :param code: Error code identifying the type of failure :param message: Human-readable error message describing the failure properties: code: - anyOf: - - const: server_error - type: string - - const: rate_limit_exceeded - type: string title: Code + type: string message: title: Message type: string required: - code - message - title: VectorStoreFileLastError - type: object - description: >- - OpenAI Vector Store File object. - - - :param id: Unique identifier for the file - - :param object: Object type identifier, always "vector_store.file" - - :param attributes: Key-value attributes associated with the file - - :param chunking_strategy: Strategy used for splitting the file into chunks - - :param created_at: Timestamp when the file was added to the vector store - - :param last_error: (Optional) Error information if file processing failed - - :param status: Current processing status of the file - - :param usage_bytes: Storage space used by this file in bytes - - :param vector_store_id: ID of the vector store containing this file - properties: - id: - title: Id - type: string - object: - default: vector_store.file - title: Object - type: string - attributes: - additionalProperties: true - title: Attributes + title: OpenAIResponseError type: object - chunking_strategy: - discriminator: - mapping: - auto: '#/$defs/VectorStoreChunkingStrategyAuto' - static: >- - #/$defs/VectorStoreChunkingStrategyStatic - propertyName: type - oneOf: - - $ref: '#/$defs/VectorStoreChunkingStrategyAuto' - - $ref: >- - #/$defs/VectorStoreChunkingStrategyStatic - title: Chunking Strategy - created_at: - title: Created At - type: integer - last_error: - anyOf: - - $ref: '#/$defs/VectorStoreFileLastError' - - type: 'null' - status: - anyOf: - - const: completed - type: string - - const: in_progress + "OpenAIResponseInputFunctionToolCallOutput": + description: >- + This represents the output of a function call that gets passed back to + the model. + properties: + call_id: + title: Call Id type: string - - const: cancelled + output: + title: Output type: string - - const: failed + type: + const: function_call_output + default: function_call_output + title: Type type: string - title: Status - usage_bytes: - default: 0 - title: Usage Bytes - type: integer - vector_store_id: - title: Vector Store Id - type: string - required: - - id - - chunking_strategy - - created_at - - status - - vector_store_id - title: VectorStoreFileObject - type: object - OpenaiUpdateVectorStoreFileRequest: - type: object - VectorStoreFileDeleteResponse: - description: >- - Response from deleting a vector store file. + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - call_id + - output + title: >- + OpenAIResponseInputFunctionToolCallOutput + type: object + OpenAIResponseInputMessageContentImage: + description: >- + Image content for input messages in OpenAI response format. - :param id: Unique identifier of the deleted file + :param detail: Level of detail for image processing, can be "low", "high", + or "auto" - :param object: Object type identifier for the deletion response + :param type: Content type identifier, always "input_image" - :param deleted: Whether the deletion operation was successful - properties: - id: - title: Id - type: string - object: - default: vector_store.file.deleted - title: Object - type: string - deleted: - default: true - title: Deleted - type: boolean - required: - - id - title: VectorStoreFileDeleteResponse - type: object - VectorStoreFileContentsResponse: - $defs: - VectorStoreContent: + :param image_url: (Optional) URL of the image content + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + title: Detail + type: + const: input_image + default: input_image + title: Type + type: string + image_url: + anyOf: + - type: string + - type: 'null' + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: description: >- - Content item from a vector store file or search result. + Text content for input messages in OpenAI response format. - :param type: Content type, currently only "text" is supported + :param text: The text content of the input message - :param text: The actual text content + :param type: Content type identifier, always "input_text" properties: - type: - const: text - title: Type - type: string text: title: Text type: string + type: + const: input_text + default: input_text + title: Type + type: string required: - - type - text - title: VectorStoreContent + title: OpenAIResponseInputMessageContentText type: object - description: >- - Response from retrieving the contents of a vector store file. + OpenAIResponseInputToolFileSearch: + description: >- + File search tool configuration for OpenAI response inputs. - :param file_id: Unique identifier for the file + :param type: Tool type identifier, always "file_search" - :param filename: Name of the file + :param vector_store_ids: List of vector store identifiers to search within - :param attributes: Key-value attributes associated with the file + :param filters: (Optional) Additional filters to apply to the search - :param content: List of content items from the file - properties: - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - attributes: - additionalProperties: true - title: Attributes + :param max_num_results: (Optional) Maximum number of search results to + return (1-50) + + :param ranking_options: (Optional) Options for ranking and scoring search + results + properties: + type: + const: file_search + default: file_search + title: Type + type: string + vector_store_ids: + items: + type: string + title: Vector Store Ids + type: array + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Filters + max_num_results: + anyOf: + - maximum: 50 + minimum: 1 + type: integer + - type: 'null' + default: 10 + title: Max Num Results + ranking_options: + anyOf: + - $ref: '#/$defs/SearchRankingOptions' + - type: 'null' + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch type: object - content: - items: - $ref: '#/$defs/VectorStoreContent' - title: Content - type: array - required: - - file_id - - filename - - attributes - - content - title: VectorStoreFileContentsResponse - type: object - OpenaiSearchVectorStoreRequest: - type: object - VectorStoreSearchResponsePage: - $defs: - VectorStoreContent: + OpenAIResponseInputToolFunction: description: >- - Content item from a vector store file or search result. + Function tool configuration for OpenAI response inputs. + + + :param type: Tool type identifier, always "function" + + :param name: Name of the function that can be called + :param description: (Optional) Description of what the function does - :param type: Content type, currently only "text" is supported + :param parameters: (Optional) JSON schema defining the function's parameters - :param text: The actual text content + :param strict: (Optional) Whether to enforce strict parameter validation properties: type: - const: text + const: function + default: function title: Type type: string - text: - title: Text + name: + title: Name type: string + description: + anyOf: + - type: string + - type: 'null' + title: Description + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Parameters + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict required: - - type - - text - title: VectorStoreContent + - name + - parameters + title: OpenAIResponseInputToolFunction type: object - VectorStoreSearchResponse: + OpenAIResponseInputToolWebSearch: description: >- - Response from searching a vector store. - - - :param file_id: Unique identifier of the file containing the result - - :param filename: Name of the file containing the result + Web search tool configuration for OpenAI response inputs. - :param score: Relevance score for this search result - :param attributes: (Optional) Key-value attributes associated with the - file + :param type: Web search tool type variant to use - :param content: List of content items matching the search query + :param search_context_size: (Optional) Size of search context, must be + "low", "medium", or "high" properties: - file_id: - title: File Id + type: + anyOf: + - const: web_search + type: string + - const: web_search_preview + type: string + - const: web_search_preview_2025_03_11 + type: string + default: web_search + title: Type + search_context_size: + anyOf: + - pattern: ^low|medium|high$ + type: string + - type: 'null' + default: medium + title: Search Context Size + title: OpenAIResponseInputToolWebSearch + type: object + OpenAIResponseMCPApprovalRequest: + description: >- + A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments type: string - filename: - title: Filename + id: + title: Id type: string - score: - title: Score - type: number - attributes: + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMCPApprovalResponse: + description: A response to an MCP approval request. + properties: + approval_request_id: + title: Approval Request Id + type: string + approve: + title: Approve + type: boolean + type: + const: mcp_approval_response + default: mcp_approval_response + title: Type + type: string + id: anyOf: - - additionalProperties: - anyOf: - - type: string - - type: number - - type: boolean - type: object + - type: string - type: 'null' - title: Attributes - content: - items: - $ref: '#/$defs/VectorStoreContent' - title: Content - type: array + title: Id + reason: + anyOf: + - type: string + - type: 'null' + title: Reason required: - - file_id - - filename - - score - - content - title: VectorStoreSearchResponse + - approval_request_id + - approve + title: OpenAIResponseMCPApprovalResponse type: object - description: >- - Paginated response from searching a vector store. - - - :param object: Object type identifier for the search results page - - :param search_query: The original search query that was executed - - :param data: List of search result objects - - :param has_more: Whether there are more results available beyond this page - - :param next_page: (Optional) Token for retrieving the next page of results - properties: - object: - default: vector_store.search_results.page - title: Object - type: string - search_query: - title: Search Query - type: string - data: - items: - $ref: '#/$defs/VectorStoreSearchResponse' - title: Data - type: array - has_more: - default: false - title: Has More - type: boolean - next_page: - anyOf: - - type: string - - type: 'null' - title: Next Page - required: - - search_query - - data - title: VectorStoreSearchResponsePage - type: object - VersionInfo: - description: >- - Version information for the service. - - - :param version: Version number of the service - properties: - version: - title: Version - type: string - required: - - version - title: VersionInfo - type: object - AppendRowsRequest: - type: object - PaginatedResponse: - description: >- - A generic paginated response that follows a simple format. - + OpenAIResponseMessage: + description: >- + Corresponds to the various Message types in the Responses API. - :param data: The list of items for the current page + They are all under one type because the Responses API gives them all - :param has_more: Whether there are more items available after this set + the same "type" value, and there is no way to tell them apart in certain - :param url: The URL for accessing this list - properties: - data: - items: - additionalProperties: true - type: object - title: Data - type: array - has_more: - title: Has More - type: boolean - url: - anyOf: - - type: string - - type: 'null' - title: Url - required: - - data - - has_more - title: PaginatedResponse - type: object - ListDatasetsResponse: - $defs: - Dataset: + scenarios. + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_image: >- + #/$defs/OpenAIResponseInputMessageContentImage + input_text: >- + #/$defs/OpenAIResponseInputMessageContentText + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentText + - $ref: >- + #/$defs/OpenAIResponseInputMessageContentImage + type: array + - items: + discriminator: + mapping: + output_text: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseOutputMessageContentOutputText + - $ref: '#/$defs/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + OpenAIResponseObjectWithInput: description: >- - Dataset resource for storing and accessing training or evaluation data. + OpenAI response object extended with input context information. - :param type: Type of resource, always 'dataset' for datasets + :param input: List of input items that led to this response properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier + created_at: + title: Created At + type: integer + error: + anyOf: + - $ref: '#/$defs/OpenAIResponseError' + - type: 'null' + id: + title: Id type: string - provider_resource_id: + model: + title: Model + type: string + object: + const: response + default: response + title: Object + type: string + output: + items: + discriminator: + mapping: + file_search_call: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + function_call: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + mcp_list_tools: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + message: '#/$defs/OpenAIResponseMessage' + web_search_call: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseMessage' + - $ref: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' + title: Output + type: array + parallel_tool_calls: + default: false + title: Parallel Tool Calls + type: boolean + previous_response_id: anyOf: - type: string - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id + title: Previous Response Id + status: + title: Status + type: string + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + text: + $ref: '#/$defs/OpenAIResponseText' + default: + format: + type: text + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + tools: + anyOf: + - items: + discriminator: + mapping: + file_search: >- + #/$defs/OpenAIResponseInputToolFileSearch + function: '#/$defs/OpenAIResponseInputToolFunction' + mcp: '#/$defs/OpenAIResponseToolMCP' + web_search: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseInputToolWebSearch' + - $ref: >- + #/$defs/OpenAIResponseInputToolFileSearch + - $ref: '#/$defs/OpenAIResponseInputToolFunction' + - $ref: '#/$defs/OpenAIResponseToolMCP' + type: array + - type: 'null' + title: Tools + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + usage: + anyOf: + - $ref: '#/$defs/OpenAIResponseUsage' + - type: 'null' + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + input: + items: + anyOf: + - discriminator: + mapping: + file_search_call: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + function_call: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + mcp_list_tools: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + message: '#/$defs/OpenAIResponseMessage' + web_search_call: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + propertyName: type + oneOf: + - $ref: '#/$defs/OpenAIResponseMessage' + - $ref: >- + #/$defs/OpenAIResponseOutputMessageWebSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageFunctionToolCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPCall + - $ref: >- + #/$defs/OpenAIResponseOutputMessageMCPListTools + - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' + - $ref: >- + #/$defs/OpenAIResponseInputFunctionToolCallOutput + - $ref: >- + #/$defs/OpenAIResponseMCPApprovalResponse + - $ref: '#/$defs/OpenAIResponseMessage' + title: Input + type: array + required: + - created_at + - id + - model + - output + - status + - input + title: OpenAIResponseObjectWithInput + type: object + "OpenAIResponseOutputMessageContentOutputText": + properties: + text: + title: Text type: string type: - const: dataset - default: dataset + const: output_text + default: output_text title: Type type: string - purpose: - $ref: '#/$defs/DatasetPurpose' - source: - discriminator: - mapping: - rows: '#/$defs/RowsDataSource' - uri: '#/$defs/URIDataSource' - propertyName: type - oneOf: - - $ref: '#/$defs/URIDataSource' - - $ref: '#/$defs/RowsDataSource' - title: Source - metadata: - additionalProperties: true - description: Any additional metadata for this dataset - title: Metadata - type: object + annotations: + items: + discriminator: + mapping: + container_file_citation: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + file_citation: >- + #/$defs/OpenAIResponseAnnotationFileCitation + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: >- + #/$defs/OpenAIResponseAnnotationFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationCitation' + - $ref: >- + #/$defs/OpenAIResponseAnnotationContainerFileCitation + - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array required: - - identifier - - provider_id - - purpose - - source - title: Dataset + - text + title: >- + OpenAIResponseOutputMessageContentOutputText type: object - DatasetPurpose: - description: >- - Purpose of the dataset. Each purpose has a required input data schema. - - - :cvar post-training/messages: The dataset contains messages used for post-training. - { - "messages": [ - {"role": "user", "content": "Hello, world!"}, - {"role": "assistant", "content": "Hello, world!"}, - ] - } - :cvar eval/question-answer: The dataset contains a question column and - an answer column. - { - "question": "What is the capital of France?", - "answer": "Paris" - } - :cvar eval/messages-answer: The dataset contains a messages column with - list of messages and an answer column. - { - "messages": [ - {"role": "user", "content": "Hello, my name is John Doe."}, - {"role": "assistant", "content": "Hello, John Doe. How can - I help you today?"}, - {"role": "user", "content": "What's my name?"}, - ], - "answer": "John Doe" - } - enum: - - post-training/messages - - eval/question-answer - - eval/messages-answer - title: DatasetPurpose - type: string - RowsDataSource: + "OpenAIResponseOutputMessageFileSearchToolCall": description: >- - A dataset stored in rows. + File search tool call output message for OpenAI responses. + + + :param id: Unique identifier for this tool call + + :param queries: List of search queries executed - :param rows: The dataset is stored in rows. E.g. - - [ - {"messages": [{"role": "user", "content": "Hello, world!"}, {"role": - "assistant", "content": "Hello, world!"}]} - ] + :param status: Current status of the file search operation + + :param type: Tool call type identifier, always "file_search_call" + + :param results: (Optional) Search results returned by the file search + operation properties: - type: - const: rows - default: rows - title: Type + id: + title: Id type: string - rows: + queries: items: - additionalProperties: true - type: object - title: Rows + type: string + title: Queries type: array - required: - - rows - title: RowsDataSource - type: object - URIDataSource: - description: >- - A dataset that can be obtained from a URI. - - :param uri: The dataset can be obtained from a URI. E.g. - - "https://mywebsite.com/mydata.jsonl" - - "lsfs://mydata.jsonl" - - "data:csv;base64,{base64_content}" - properties: + status: + title: Status + type: string type: - const: uri - default: uri + const: file_search_call + default: file_search_call title: Type type: string - uri: - title: Uri - type: string + results: + anyOf: + - items: + $ref: >- + #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults + type: array + - type: 'null' + title: Results required: - - uri - title: URIDataSource + - id + - queries + - status + title: >- + OpenAIResponseOutputMessageFileSearchToolCall type: object - description: >- - Response from listing datasets. + "OpenAIResponseOutputMessageFileSearchToolCallResults": + description: >- + Search results returned by the file search operation. - :param data: List of datasets - properties: - data: - items: - $ref: '#/$defs/Dataset' - title: Data - type: array - required: - - data - title: ListDatasetsResponse - type: object - RegisterDatasetRequest: - type: object - Dataset: - $defs: - DatasetPurpose: - description: >- - Purpose of the dataset. Each purpose has a required input data schema. - - - :cvar post-training/messages: The dataset contains messages used for post-training. - { - "messages": [ - {"role": "user", "content": "Hello, world!"}, - {"role": "assistant", "content": "Hello, world!"}, - ] - } - :cvar eval/question-answer: The dataset contains a question column and - an answer column. - { - "question": "What is the capital of France?", - "answer": "Paris" - } - :cvar eval/messages-answer: The dataset contains a messages column with - list of messages and an answer column. - { - "messages": [ - {"role": "user", "content": "Hello, my name is John Doe."}, - {"role": "assistant", "content": "Hello, John Doe. How can - I help you today?"}, - {"role": "user", "content": "What's my name?"}, - ], - "answer": "John Doe" - } - enum: - - post-training/messages - - eval/question-answer - - eval/messages-answer - title: DatasetPurpose - type: string - RowsDataSource: - description: >- - A dataset stored in rows. + :param attributes: (Optional) Key-value attributes associated with the + file - :param rows: The dataset is stored in rows. E.g. - - [ - {"messages": [{"role": "user", "content": "Hello, world!"}, {"role": - "assistant", "content": "Hello, world!"}]} - ] + :param file_id: Unique identifier of the file containing the result + + :param filename: Name of the file containing the result + + :param score: Relevance score for this search result (between 0 and 1) + + :param text: Text content of the search result properties: - type: - const: rows - default: rows - title: Type + attributes: + additionalProperties: true + title: Attributes + type: object + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + score: + title: Score + type: number + text: + title: Text type: string - rows: - items: - additionalProperties: true - type: object - title: Rows - type: array required: - - rows - title: RowsDataSource + - attributes + - file_id + - filename + - score + - text + title: >- + OpenAIResponseOutputMessageFileSearchToolCallResults type: object - URIDataSource: + "OpenAIResponseOutputMessageFunctionToolCall": description: >- - A dataset that can be obtained from a URI. + Function tool call output message for OpenAI responses. + + + :param call_id: Unique identifier for the function call + + :param name: Name of the function being called + + :param arguments: JSON string containing the function arguments + + :param type: Tool call type identifier, always "function_call" + + :param id: (Optional) Additional identifier for the tool call - :param uri: The dataset can be obtained from a URI. E.g. - - "https://mywebsite.com/mydata.jsonl" - - "lsfs://mydata.jsonl" - - "data:csv;base64,{base64_content}" + :param status: (Optional) Current status of the function call execution properties: + call_id: + title: Call Id + type: string + name: + title: Name + type: string + arguments: + title: Arguments + type: string type: - const: uri - default: uri + const: function_call + default: function_call title: Type type: string - uri: - title: Uri - type: string + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status required: - - uri - title: URIDataSource + - call_id + - name + - arguments + title: >- + OpenAIResponseOutputMessageFunctionToolCall type: object - description: >- - Dataset resource for storing and accessing training or evaluation data. - - - :param type: Type of resource, always 'dataset' for datasets - properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier - type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: + OpenAIResponseOutputMessageMCPCall: description: >- - ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: dataset - default: dataset - title: Type - type: string - purpose: - $ref: '#/$defs/DatasetPurpose' - source: - discriminator: - mapping: - rows: '#/$defs/RowsDataSource' - uri: '#/$defs/URIDataSource' - propertyName: type - oneOf: - - $ref: '#/$defs/URIDataSource' - - $ref: '#/$defs/RowsDataSource' - title: Source - metadata: - additionalProperties: true - description: Any additional metadata for this dataset - title: Metadata - type: object - required: - - identifier - - provider_id - - purpose - - source - title: Dataset - type: object - CreateAgentRequest: - type: object - AgentCreateResponse: - description: >- - Response returned when creating a new agent. + Model Context Protocol (MCP) call output message for OpenAI responses. - :param agent_id: Unique identifier for the created agent - properties: - agent_id: - title: Agent Id - type: string - required: - - agent_id - title: AgentCreateResponse - type: object - Agent: - $defs: - AgentConfig: - description: >- - Configuration for an agent. + :param id: Unique identifier for this MCP call + :param type: Tool call type identifier, always "mcp_call" - :param model: The model identifier to use for the agent + :param arguments: JSON string containing the MCP call arguments - :param instructions: The system instructions for the agent + :param name: Name of the MCP method being called - :param name: Optional name for the agent, used in telemetry and identification + :param server_label: Label identifying the MCP server handling the call - :param enable_session_persistence: Optional flag indicating whether session - data has to be persisted + :param error: (Optional) Error message if the MCP call failed - :param response_format: Optional response format configuration + :param output: (Optional) Output result from the successful MCP call properties: - sampling_params: - anyOf: - - $ref: '#/$defs/SamplingParams' - - type: 'null' - input_shields: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Input Shields - output_shields: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Output Shields - toolgroups: - anyOf: - - items: - anyOf: - - type: string - - $ref: '#/$defs/AgentToolGroupWithArgs' - type: array - - type: 'null' - title: Toolgroups - client_tools: - anyOf: - - items: - $ref: '#/$defs/ToolDef' - type: array - - type: 'null' - title: Client Tools - tool_choice: - anyOf: - - $ref: '#/$defs/ToolChoice' - - type: 'null' - deprecated: true - tool_prompt_format: - anyOf: - - $ref: '#/$defs/ToolPromptFormat' - - type: 'null' - deprecated: true - tool_config: - anyOf: - - $ref: '#/$defs/ToolConfig' - - type: 'null' - max_infer_iters: - anyOf: - - type: integer - - type: 'null' - default: 10 - title: Max Infer Iters - model: - title: Model + id: + title: Id type: string - instructions: - title: Instructions + type: + const: mcp_call + default: mcp_call + title: Type + type: string + arguments: + title: Arguments type: string name: + title: Name + type: string + server_label: + title: Server Label + type: string + error: anyOf: - type: string - type: 'null' - title: Name - enable_session_persistence: - anyOf: - - type: boolean - - type: 'null' - default: false - title: Enable Session Persistence - response_format: + title: Error + output: anyOf: - - discriminator: - mapping: - grammar: '#/$defs/GrammarResponseFormat' - json_schema: '#/$defs/JsonSchemaResponseFormat' - propertyName: type - oneOf: - - $ref: '#/$defs/JsonSchemaResponseFormat' - - $ref: '#/$defs/GrammarResponseFormat' + - type: string - type: 'null' - title: Response Format - required: - - model - - instructions - title: AgentConfig - type: object - AgentToolGroupWithArgs: - properties: - name: - title: Name - type: string - args: - additionalProperties: true - title: Args - type: object + title: Output required: + - id + - arguments - name - - args - title: AgentToolGroupWithArgs + - server_label + title: OpenAIResponseOutputMessageMCPCall type: object - GrammarResponseFormat: + OpenAIResponseOutputMessageMCPListTools: description: >- - Configuration for grammar-guided response generation. + MCP list tools output message containing available tools from an MCP server. - :param type: Must be "grammar" to identify this format type + :param id: Unique identifier for this MCP list tools operation - :param bnf: The BNF grammar specification the response should conform - to - properties: - type: - const: grammar - default: grammar - title: Type - type: string - bnf: - additionalProperties: true - title: Bnf - type: object - required: - - bnf - title: GrammarResponseFormat - type: object - GreedySamplingStrategy: - description: >- - Greedy sampling strategy that selects the highest probability token at - each step. + :param type: Tool call type identifier, always "mcp_list_tools" + :param server_label: Label identifying the MCP server providing the tools - :param type: Must be "greedy" to identify this sampling strategy + :param tools: List of available tools provided by the MCP server properties: + id: + title: Id + type: string type: - const: greedy - default: greedy + const: mcp_list_tools + default: mcp_list_tools title: Type type: string - title: GreedySamplingStrategy + server_label: + title: Server Label + type: string + tools: + items: + $ref: '#/$defs/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools type: object - JsonSchemaResponseFormat: + "OpenAIResponseOutputMessageWebSearchToolCall": description: >- - Configuration for JSON schema-guided response generation. + Web search tool call output message for OpenAI responses. + + :param id: Unique identifier for this tool call - :param type: Must be "json_schema" to identify this format type + :param status: Current status of the web search operation - :param json_schema: The JSON schema the response should conform to. In - a Python SDK, this is often a `pydantic` model. + :param type: Tool call type identifier, always "web_search_call" properties: + id: + title: Id + type: string + status: + title: Status + type: string type: - const: json_schema - default: json_schema + const: web_search_call + default: web_search_call title: Type type: string - json_schema: - additionalProperties: true - title: Json Schema - type: object required: - - json_schema - title: JsonSchemaResponseFormat + - id + - status + title: >- + OpenAIResponseOutputMessageWebSearchToolCall type: object - SamplingParams: + OpenAIResponseText: description: >- - Sampling parameters. - + Text response configuration for OpenAI responses. - :param strategy: The sampling strategy. - :param max_tokens: The maximum number of tokens that can be generated - in the completion. The token count of - your prompt plus max_tokens cannot exceed the model's context length. - :param repetition_penalty: Number between -2.0 and 2.0. Positive values - penalize new tokens - based on whether they appear in the text so far, increasing the model's - likelihood to talk about new topics. - :param stop: Up to 4 sequences where the API will stop generating further - tokens. - The returned text will not contain the stop sequence. + :param format: (Optional) Text format configuration specifying output + format requirements properties: - strategy: - discriminator: - mapping: - greedy: '#/$defs/GreedySamplingStrategy' - top_k: '#/$defs/TopKSamplingStrategy' - top_p: '#/$defs/TopPSamplingStrategy' - propertyName: type - oneOf: - - $ref: '#/$defs/GreedySamplingStrategy' - - $ref: '#/$defs/TopPSamplingStrategy' - - $ref: '#/$defs/TopKSamplingStrategy' - title: Strategy - max_tokens: - anyOf: - - type: integer - - type: 'null' - title: Max Tokens - repetition_penalty: - anyOf: - - type: number - - type: 'null' - default: 1.0 - title: Repetition Penalty - stop: + format: anyOf: - - items: - type: string - type: array + - $ref: '#/$defs/OpenAIResponseTextFormat' - type: 'null' - title: Stop - title: SamplingParams + title: OpenAIResponseText type: object - SystemMessageBehavior: + OpenAIResponseTextFormat: description: >- - Config for how to override the default system prompt. + Configuration for Responses API text format. - :cvar append: Appends the provided system message to the default system - prompt: - https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt- - :cvar replace: Replaces the default system prompt with the provided system - message. The system message can include the string - '{{function_definitions}}' to indicate where the function definitions - should be inserted. - enum: - - append - - replace - title: SystemMessageBehavior - type: string - ToolChoice: - description: >- - Whether tool use is required or automatic. This is a hint to the model - which may not be followed. It depends on the Instruction Following capabilities - of the model. + :param type: Must be "text", "json_schema", or "json_object" to identify + the format type + :param name: The name of the response format. Only used for json_schema. - :cvar auto: The model may use tools if it determines that is appropriate. + :param schema: The JSON schema the response should conform to. In a Python + SDK, this is often a `pydantic` model. Only used for json_schema. - :cvar required: The model must use tools. + :param description: (Optional) A description of the response format. Only + used for json_schema. - :cvar none: The model must not use tools. - enum: - - auto - - required - - none - title: ToolChoice - type: string - ToolConfig: - description: >- - Configuration for tool use. - - - :param tool_choice: (Optional) Whether tool use is automatic, required, - or none. Can also specify a tool name to use a specific tool. Defaults - to ToolChoice.auto. - - :param tool_prompt_format: (Optional) Instructs the model how to format - tool calls. By default, Llama Stack will attempt to use a format that - is best adapted to the model. - - `ToolPromptFormat.json`: The tool calls are formatted as a JSON - object. - - `ToolPromptFormat.function_tag`: The tool calls are enclosed in - a tag. - - `ToolPromptFormat.python_list`: The tool calls are output as Python - syntax -- a list of function calls. - :param system_message_behavior: (Optional) Config for how to override - the default system prompt. - - `SystemMessageBehavior.append`: Appends the provided system message - to the default system prompt. - - `SystemMessageBehavior.replace`: Replaces the default system prompt - with the provided system message. The system message can include the string - '{{function_definitions}}' to indicate where the function definitions - should be inserted. + :param strict: (Optional) Whether to strictly enforce the JSON schema. + If true, the response must match the schema exactly. Only used for json_schema. properties: - tool_choice: + type: + anyOf: + - const: text + type: string + - const: json_schema + type: string + - const: json_object + type: string + title: Type + name: anyOf: - - $ref: '#/$defs/ToolChoice' - type: string - type: 'null' - default: auto - title: Tool Choice - tool_prompt_format: + title: Name + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: anyOf: - - $ref: '#/$defs/ToolPromptFormat' + - type: string - type: 'null' - system_message_behavior: + title: Description + strict: anyOf: - - $ref: '#/$defs/SystemMessageBehavior' + - type: boolean - type: 'null' - default: append - title: ToolConfig + title: Strict + title: OpenAIResponseTextFormat type: object - ToolDef: + OpenAIResponseToolMCP: description: >- - Tool definition used in runtime contexts. - - - :param name: Name of the tool - - :param description: (Optional) Human-readable description of what the - tool does + Model Context Protocol (MCP) tool configuration for OpenAI response object. - :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) - :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) + :param type: Tool type identifier, always "mcp" - :param metadata: (Optional) Additional metadata about the tool + :param server_label: Label to identify this MCP server - :param toolgroup_id: (Optional) ID of the tool group this tool belongs - to + :param allowed_tools: (Optional) Restriction on which tools can be used + from this server properties: - toolgroup_id: - anyOf: - - type: string - - type: 'null' - title: Toolgroup Id - name: - title: Name + type: + const: mcp + default: mcp + title: Type type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - input_schema: + server_label: + title: Server Label + type: string + allowed_tools: anyOf: - - additionalProperties: true - type: object + - items: + type: string + type: array + - $ref: '#/$defs/AllowedToolsFilter' - type: 'null' - title: Input Schema - output_schema: + title: Allowed Tools + required: + - server_label + title: OpenAIResponseToolMCP + type: object + OpenAIResponseUsage: + description: >- + Usage information for OpenAI response. + + + :param input_tokens: Number of tokens in the input + + :param output_tokens: Number of tokens in the output + + :param total_tokens: Total tokens used (input + output) + + :param input_tokens_details: Detailed breakdown of input token usage + + :param output_tokens_details: Detailed breakdown of output token usage + properties: + input_tokens: + title: Input Tokens + type: integer + output_tokens: + title: Output Tokens + type: integer + total_tokens: + title: Total Tokens + type: integer + input_tokens_details: anyOf: - - additionalProperties: true - type: object + - $ref: >- + #/$defs/OpenAIResponseUsageInputTokensDetails - type: 'null' - title: Output Schema - metadata: + output_tokens_details: anyOf: - - additionalProperties: true - type: object + - $ref: >- + #/$defs/OpenAIResponseUsageOutputTokensDetails - type: 'null' - title: Metadata required: - - name - title: ToolDef + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage type: object - ToolPromptFormat: - description: >- - Prompt format for calling custom / zero shot tools. - - - :cvar json: JSON format for calling tools. It takes the form: - { - "type": "function", - "function" : { - "name": "function_name", - "description": "function_description", - "parameters": {...} - } - } - :cvar function_tag: Function tag format, pseudo-XML. This looks like: - (parameters) - - :cvar python_list: Python list. The output is a valid Python expression - that can be - evaluated to a list. Each element in the list is a function call. - Example: - ["function_name(param1, param2)", "function_name(param1, param2)"] - enum: - - json - - function_tag - - python_list - title: ToolPromptFormat - type: string - TopKSamplingStrategy: + OpenAIResponseUsageInputTokensDetails: description: >- - Top-k sampling strategy that restricts sampling to the k most likely tokens. + Token details for input tokens in OpenAI response usage. - :param type: Must be "top_k" to identify this sampling strategy + :param cached_tokens: Number of tokens retrieved from cache + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens + title: OpenAIResponseUsageInputTokensDetails + type: object + OpenAIResponseUsageOutputTokensDetails: + description: >- + Token details for output tokens in OpenAI response usage. + - :param top_k: Number of top tokens to consider for sampling. Must be at - least 1 + :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) properties: - type: - const: top_k - default: top_k - title: Type - type: string - top_k: - minimum: 1 - title: Top K - type: integer - required: - - top_k - title: TopKSamplingStrategy + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens + title: OpenAIResponseUsageOutputTokensDetails type: object - TopPSamplingStrategy: + SearchRankingOptions: description: >- - Top-p (nucleus) sampling strategy that samples from the smallest set of - tokens with cumulative probability >= p. - + Options for ranking and filtering search results. - :param type: Must be "top_p" to identify this sampling strategy - :param temperature: Controls randomness in sampling. Higher values increase - randomness + :param ranker: (Optional) Name of the ranking algorithm to use - :param top_p: Cumulative probability threshold for nucleus sampling. Defaults - to 0.95 + :param score_threshold: (Optional) Minimum relevance score threshold for + results properties: - type: - const: top_p - default: top_p - title: Type - type: string - temperature: + ranker: anyOf: - - exclusiveMinimum: 0.0 - type: number + - type: string - type: 'null' - title: Temperature - top_p: + title: Ranker + score_threshold: anyOf: - type: number - type: 'null' - default: 0.95 - title: Top P - required: - - temperature - title: TopPSamplingStrategy + default: 0.0 + title: Score Threshold + title: SearchRankingOptions type: object description: >- - An agent instance with configuration and metadata. + Paginated list of OpenAI response objects with navigation metadata. + + + :param data: List of response objects with their input context + :param has_more: Whether there are more results available beyond this page - :param agent_id: Unique identifier for the agent + :param first_id: Identifier of the first item in this page - :param agent_config: Configuration settings for the agent + :param last_id: Identifier of the last item in this page - :param created_at: Timestamp when the agent was created + :param object: Object type identifier, always "list" properties: - agent_id: - title: Agent Id + data: + items: + $ref: '#/$defs/OpenAIResponseObjectWithInput' + title: Data + type: array + has_more: + title: Has More + type: boolean + first_id: + title: First Id type: string - agent_config: - $ref: '#/$defs/AgentConfig' - created_at: - format: date-time - title: Created At + last_id: + title: Last Id + type: string + object: + const: list + default: list + title: Object type: string required: - - agent_id - - agent_config - - created_at - title: Agent + - data + - has_more + - first_id + - last_id + title: ListOpenAIChatCompletionResponse type: object - CreateAgentSessionRequest: + OpenAIAssistantMessageParam: + description: "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param name: (Optional) The name of the assistant message participant.\n:param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object." + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + nullable: true + name: + title: Name + type: string + nullable: true + tool_calls: + title: Tool Calls + items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + nullable: true + title: OpenAIAssistantMessageParam type: object - AgentSessionCreateResponse: - description: >- - Response returned when creating a new agent session. - - - :param session_id: Unique identifier for the created session + OpenAIChoice: + description: "A choice from an OpenAI-compatible chat completion response.\n\n:param message: The message from the model\n:param finish_reason: The reason the model stopped generating\n:param index: The index of the choice\n:param logprobs: (Optional) The log probabilities for the tokens in the message" properties: - session_id: - title: Session Id + message: + discriminator: + mapping: + assistant: '#/$defs/OpenAIAssistantMessageParam' + developer: '#/$defs/OpenAIDeveloperMessageParam' + system: '#/$defs/OpenAISystemMessageParam' + tool: '#/$defs/OpenAIToolMessageParam' + user: '#/$defs/OpenAIUserMessageParam' + propertyName: role + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Message + finish_reason: + title: Finish Reason type: string + index: + title: Index + type: integer + logprobs: + $ref: '#/components/schemas/OpenAIChoiceLogprobs' + nullable: true required: - - session_id - title: AgentSessionCreateResponse - description: >- - Response returned when creating a new agent session. - CompletionMessage: + - message + - finish_reason + - index + title: OpenAIChoice + type: object + OpenAIChoiceLogprobs: + description: "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response.\n\n:param content: (Optional) The log probabilities for the tokens in the message\n:param refusal: (Optional) The log probabilities for the tokens in the message" + properties: + content: + title: Content + items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + nullable: true + refusal: + title: Refusal + items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + nullable: true + title: OpenAIChoiceLogprobs + type: object + OpenAICompletionWithInputMessages: + properties: + id: + title: Id + type: string + choices: + items: + $ref: '#/components/schemas/OpenAIChoice' + title: Choices + type: array + object: + const: chat.completion + default: chat.completion + title: Object + type: string + created: + title: Created + type: integer + model: + title: Model + type: string + usage: + $ref: '#/components/schemas/OpenAIChatCompletionUsage' + nullable: true + input_messages: + items: + discriminator: + mapping: + assistant: '#/$defs/OpenAIAssistantMessageParam' + developer: '#/$defs/OpenAIDeveloperMessageParam' + system: '#/$defs/OpenAISystemMessageParam' + tool: '#/$defs/OpenAIToolMessageParam' + user: '#/$defs/OpenAIUserMessageParam' + propertyName: role + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Input Messages + type: array + required: + - id + - choices + - created + - model + - input_messages + title: OpenAICompletionWithInputMessages type: object + OpenAIUserMessageParam: + description: "A message from the user in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param name: (Optional) The name of the user message participant." properties: role: + const: user + default: user + title: Role type: string - const: assistant - default: assistant - description: >- - Must be "assistant" to identify this as the model's response content: - $ref: '#/components/schemas/InterleavedContent' - description: The content of the model's response - stop_reason: + anyOf: + - type: string + - items: + discriminator: + mapping: + file: '#/$defs/OpenAIFile' + image_url: '#/$defs/OpenAIChatCompletionContentPartImageParam' + text: '#/$defs/OpenAIChatCompletionContentPartTextParam' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' + type: array + title: Content + name: + title: Name type: string - enum: - - end_of_turn - - end_of_message - - out_of_tokens - description: >- - Reason why the model stopped generating. Options are: - `StopReason.end_of_turn`: - The model finished generating the entire response. - `StopReason.end_of_message`: - The model finished generating but generated a partial response -- usually, - a tool call. The user may call the tool and continue the conversation - with the tool's response. - `StopReason.out_of_tokens`: The model ran - out of token budget. - tool_calls: + nullable: true + required: + - content + title: OpenAIUserMessageParam + type: object + Checkpoint: + description: "Checkpoint created during training runs.\n\n:param identifier: Unique identifier for the checkpoint\n:param created_at: Timestamp when the checkpoint was created\n:param epoch: Training epoch when the checkpoint was saved\n:param post_training_job_id: Identifier of the training job that created this checkpoint\n:param path: File system path where the checkpoint is stored\n:param training_metrics: (Optional) Training metrics associated with this checkpoint" + properties: + identifier: + title: Identifier + type: string + created_at: + format: date-time + title: Created At + type: string + epoch: + title: Epoch + type: integer + post_training_job_id: + title: Post Training Job Id + type: string + path: + title: Path + type: string + training_metrics: + $ref: '#/components/schemas/PostTrainingMetric' + nullable: true + required: + - identifier + - created_at + - epoch + - post_training_job_id + - path + title: Checkpoint + type: object + PostTrainingJobArtifactsResponse: + description: "Artifacts of a finetuning job.\n\n:param job_uuid: Unique identifier for the training job\n:param checkpoints: List of model checkpoints created during training" + properties: + job_uuid: + title: Job Uuid + type: string + checkpoints: + items: + $ref: '#/components/schemas/Checkpoint' + title: Checkpoints type: array + required: + - job_uuid + title: PostTrainingJobArtifactsResponse + type: object + PostTrainingJobStatusResponse: + description: "Status of a finetuning job.\n\n:param job_uuid: Unique identifier for the training job\n:param status: Current status of the training job\n:param scheduled_at: (Optional) Timestamp when the job was scheduled\n:param started_at: (Optional) Timestamp when the job execution began\n:param completed_at: (Optional) Timestamp when the job finished, if completed\n:param resources_allocated: (Optional) Information about computational resources allocated to the job\n:param checkpoints: List of model checkpoints created during training" + properties: + job_uuid: + title: Job Uuid + type: string + status: + $ref: '#/components/schemas/JobStatus' + scheduled_at: + title: Scheduled At + format: date-time + type: string + nullable: true + started_at: + title: Started At + format: date-time + type: string + nullable: true + completed_at: + title: Completed At + format: date-time + type: string + nullable: true + resources_allocated: + title: Resources Allocated + additionalProperties: true + type: object + nullable: true + checkpoints: items: - $ref: '#/components/schemas/ToolCall' - description: >- - List of tool calls. Each tool call is a ToolCall object. - additionalProperties: false + $ref: '#/components/schemas/Checkpoint' + title: Checkpoints + type: array + required: + - job_uuid + - status + title: PostTrainingJobStatusResponse + type: object + ScoringFn: + description: "A scoring function resource for evaluating model outputs.\n:param type: The resource type, always scoring_function" + properties: + identifier: + description: Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + description: Unique identifier for this resource in the provider + title: Provider Resource Id + type: string + nullable: true + provider_id: + description: ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: scoring_function + default: scoring_function + title: Type + type: string + description: + title: Description + type: string + nullable: true + metadata: + additionalProperties: true + description: Any additional metadata for this definition + title: Metadata + type: object + return_type: + description: The return type of the deterministic function + discriminator: + mapping: + agent_turn_input: '#/$defs/AgentTurnInputType' + array: '#/$defs/ArrayType' + boolean: '#/$defs/BooleanType' + chat_completion_input: '#/$defs/ChatCompletionInputType' + completion_input: '#/$defs/CompletionInputType' + json: '#/$defs/JsonType' + number: '#/$defs/NumberType' + object: '#/$defs/ObjectType' + string: '#/$defs/StringType' + union: '#/$defs/UnionType' + propertyName: type + oneOf: + - $ref: '#/components/schemas/StringType' + - $ref: '#/components/schemas/NumberType' + - $ref: '#/components/schemas/BooleanType' + - $ref: '#/components/schemas/ArrayType' + - $ref: '#/components/schemas/ObjectType' + - $ref: '#/components/schemas/JsonType' + - $ref: '#/components/schemas/UnionType' + - $ref: '#/components/schemas/ChatCompletionInputType' + - $ref: '#/components/schemas/CompletionInputType' + - $ref: '#/components/schemas/AgentTurnInputType' + title: Return Type + params: + description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval + title: Params + discriminator: + mapping: + basic: '#/$defs/BasicScoringFnParams' + llm_as_judge: '#/$defs/LLMAsJudgeScoringFnParams' + regex_parser: '#/$defs/RegexParserScoringFnParams' + propertyName: type + oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + nullable: true required: - - role - - content - - stop_reason - title: CompletionMessage - description: >- - A message containing the model's (assistant) response in a chat conversation. - InferenceStep: + - identifier + - provider_id + - return_type + title: ScoringFn type: object - Session: + ScoreRequest: + type: object + ScoreResponse: $defs: - Attachment: + ScoringResult: description: >- - An attachment to an agent turn. + A scoring result for a single row. - :param content: The content of the attachment. + :param score_rows: The scoring result for each row. Each row is a map + of column name to value. - :param mime_type: The MIME type of the attachment. + :param aggregated_results: Map of metric name to aggregated value properties: - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - $ref: '#/$defs/URL' - title: Content - mime_type: - title: Mime Type - type: string + score_rows: + items: + additionalProperties: true + type: object + title: Score Rows + type: array + aggregated_results: + additionalProperties: true + title: Aggregated Results + type: object required: - - content - - mime_type - title: Attachment + - score_rows + - aggregated_results + title: ScoringResult type: object - BuiltinTool: - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - type: string - CompletionMessage: - description: >- - A message containing the model's (assistant) response in a chat conversation. - - - :param role: Must be "assistant" to identify this as the model's response + description: >- + The response from scoring. - :param content: The content of the model's response - :param stop_reason: Reason why the model stopped generating. Options are: - - `StopReason.end_of_turn`: The model finished generating the entire - response. - - `StopReason.end_of_message`: The model finished generating but generated - a partial response -- usually, a tool call. The user may call the tool - and continue the conversation with the tool's response. - - `StopReason.out_of_tokens`: The model ran out of token budget. - :param tool_calls: List of tool calls. Each tool call is a ToolCall object. - properties: - role: - const: assistant - default: assistant - title: Role - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - stop_reason: - $ref: '#/$defs/StopReason' - tool_calls: - anyOf: - - items: - $ref: '#/$defs/ToolCall' - type: array - - type: 'null' - title: Tool Calls - required: - - content - - stop_reason - title: CompletionMessage + :param results: A map of scoring function name to ScoringResult. + properties: + results: + additionalProperties: + $ref: '#/$defs/ScoringResult' + title: Results type: object - ImageContentItem: + required: + - results + title: ScoreResponse + type: object + ScoreBatchRequest: + type: object + ScoreBatchResponse: + $defs: + ScoringResult: description: >- - A image content item + A scoring result for a single row. - :param type: Discriminator type of the content item. Always "image" + :param score_rows: The scoring result for each row. Each row is a map + of column name to value. - :param image: Image as a base64 encoded string or an URL + :param aggregated_results: Map of metric name to aggregated value properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/$defs/_URLOrData' + score_rows: + items: + additionalProperties: true + type: object + title: Score Rows + type: array + aggregated_results: + additionalProperties: true + title: Aggregated Results + type: object required: - - image - title: ImageContentItem + - score_rows + - aggregated_results + title: ScoringResult type: object - InferenceStep: - description: >- - An inference step in an agent turn. + description: >- + Response from batch scoring operations on datasets. - :param model_response: The response from the LLM. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: inference - default: inference - title: Step Type - type: string - model_response: - $ref: '#/$defs/CompletionMessage' - required: - - turn_id - - step_id - - model_response - title: InferenceStep + :param dataset_id: (Optional) The identifier of the dataset that was scored + + :param results: A map of scoring function name to ScoringResult + properties: + dataset_id: + anyOf: + - type: string + - type: 'null' + title: Dataset Id + results: + additionalProperties: + $ref: '#/$defs/ScoringResult' + title: Results type: object - MemoryRetrievalStep: + required: + - results + title: ScoreBatchResponse + type: object + ListShieldsResponse: + $defs: + Shield: description: >- - A memory retrieval step in an agent turn. + A safety shield resource that can be used to check content. - :param vector_store_ids: The IDs of the vector databases to retrieve context - from. + :param params: (Optional) Configuration parameters for the shield - :param inserted_context: The context retrieved from the vector databases. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id + :param type: The resource type, always shield + properties: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: + provider_resource_id: anyOf: - - format: date-time - type: string + - type: string - type: 'null' - title: Completed At - step_type: - const: memory_retrieval - default: memory_retrieval - title: Step Type + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id type: string - vector_store_ids: - title: Vector Store Ids + type: + const: shield + default: shield + title: Type type: string - inserted_context: + params: anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Inserted Context + - additionalProperties: true + type: object + - type: 'null' + title: Params required: - - turn_id - - step_id - - vector_store_ids - - inserted_context - title: MemoryRetrievalStep + - identifier + - provider_id + title: Shield + type: object + properties: + data: + items: + $ref: '#/$defs/Shield' + title: Data + type: array + required: + - data + title: ListShieldsResponse + type: object + RegisterShieldRequest: + type: object + properties: + shield_id: + type: string + description: >- + The identifier of the shield to register. + provider_shield_id: + type: string + description: >- + The identifier of the shield in the provider. + provider_id: + type: string + description: The identifier of the provider. + params: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: The parameters of the shield. + additionalProperties: false + required: + - shield_id + title: RegisterShieldRequest + InvokeToolRequest: + type: object + properties: + tool_name: + type: string + description: The name of the tool to invoke. + kwargs: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + A dictionary of arguments to pass to the tool. + additionalProperties: false + required: + - tool_name + - kwargs + title: InvokeToolRequest + ImageContentItem: + type: object + properties: + type: + type: string + const: image + default: image + description: >- + Discriminator type of the content item. Always "image" + image: + type: object + properties: + url: + $ref: '#/components/schemas/URL' + description: >- + A URL of the image or data URL in the format of data:image/{type};base64,{data}. + Note that URL could have length limits. + data: + type: string + contentEncoding: base64 + description: base64 encoded image data as string + additionalProperties: false + description: >- + Image as a base64 encoded string or an URL + additionalProperties: false + required: + - type + - image + title: ImageContentItem + description: A image content item + InterleavedContent: + oneOf: + - type: string + - $ref: '#/components/schemas/InterleavedContentItem' + - type: array + items: + $ref: '#/components/schemas/InterleavedContentItem' + InterleavedContentItem: + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem' + text: '#/components/schemas/TextContentItem' + TextContentItem: + type: object + properties: + type: + type: string + const: text + default: text + description: >- + Discriminator type of the content item. Always "text" + text: + type: string + description: Text content + additionalProperties: false + required: + - type + - text + title: TextContentItem + description: A text content item + ToolInvocationResult: + type: object + properties: + content: + $ref: '#/components/schemas/InterleavedContent' + description: >- + (Optional) The output content from the tool execution + error_message: + type: string + description: >- + (Optional) Error message if the tool execution failed + error_code: + type: integer + description: >- + (Optional) Numeric error code if the tool execution failed + metadata: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + (Optional) Additional metadata about the tool execution + additionalProperties: false + title: ToolInvocationResult + description: Result of a tool invocation. + URL: + type: object + properties: + uri: + type: string + description: The URL string pointing to the resource + additionalProperties: false + required: + - uri + title: URL + description: A URL reference to external content. + ToolDef: + type: object + properties: + toolgroup_id: + type: string + description: >- + (Optional) ID of the tool group this tool belongs to + name: + type: string + description: Name of the tool + description: + type: string + description: >- + (Optional) Human-readable description of what the tool does + input_schema: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: >- + (Optional) JSON Schema for tool inputs (MCP inputSchema) + output_schema: type: object - SafetyViolation: + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object description: >- - Details of a safety violation detected by content moderation. - - - :param violation_level: Severity level of the violation - - :param user_message: (Optional) Message to convey to the user about the - violation - - :param metadata: Additional metadata including specific violation codes - for debugging and telemetry - properties: - violation_level: - $ref: '#/$defs/ViolationLevel' - user_message: - anyOf: - - type: string - - type: 'null' - title: User Message - metadata: - additionalProperties: true - title: Metadata - type: object - required: - - violation_level - title: SafetyViolation + (Optional) JSON Schema for tool outputs (MCP outputSchema) + metadata: type: object - ShieldCallStep: + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object description: >- - A shield call step in an agent turn. - - - :param violation: The violation from the shield call. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: shield_call - default: shield_call - title: Step Type - type: string - violation: - anyOf: - - $ref: '#/$defs/SafetyViolation' - - type: 'null' - required: - - turn_id - - step_id - - violation - title: ShieldCallStep + (Optional) Additional metadata about the tool + additionalProperties: false + required: + - name + title: ToolDef + description: >- + Tool definition used in runtime contexts. + ListToolDefsResponse: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/ToolDef' + description: List of tool definitions + additionalProperties: false + required: + - data + title: ListToolDefsResponse + description: >- + Response containing a list of tool definitions. + RAGDocument: + type: object + properties: + document_id: + type: string + description: The unique identifier for the document. + content: + oneOf: + - type: string + - $ref: '#/components/schemas/InterleavedContentItem' + - type: array + items: + $ref: '#/components/schemas/InterleavedContentItem' + - $ref: '#/components/schemas/URL' + description: The content of the document. + mime_type: + type: string + description: The MIME type of the document. + metadata: type: object - StopReason: - enum: - - end_of_turn - - end_of_message - - out_of_tokens - title: StopReason + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object + description: Additional metadata for the document. + additionalProperties: false + required: + - document_id + - content + - metadata + title: RAGDocument + description: >- + A document to be used for document ingestion in the RAG Tool. + InsertRequest: + type: object + properties: + documents: + type: array + items: + $ref: '#/components/schemas/RAGDocument' + description: >- + List of documents to index in the RAG system + vector_store_id: type: string - TextContentItem: description: >- - A text content item - - - :param type: Discriminator type of the content item. Always "text" - - :param text: Text content - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: TextContentItem - type: object - ToolCall: - properties: - call_id: - title: Call Id - type: string - tool_name: - anyOf: - - $ref: '#/$defs/BuiltinTool' - - type: string - title: Tool Name - arguments: - title: Arguments - type: string - required: - - call_id - - tool_name - - arguments - title: ToolCall - type: object - ToolExecutionStep: + ID of the vector database to store the document embeddings + chunk_size_in_tokens: + type: integer description: >- - A tool execution step in an agent turn. + (Optional) Size in tokens for document chunking during indexing + additionalProperties: false + required: + - documents + - vector_store_id + - chunk_size_in_tokens + title: InsertRequest + DefaultRAGQueryGeneratorConfig: + type: object + properties: + type: + type: string + const: default + default: default + description: >- + Type of query generator, always 'default' + separator: + type: string + default: ' ' + description: >- + String separator used to join query terms + additionalProperties: false + required: + - type + - separator + title: DefaultRAGQueryGeneratorConfig + description: >- + Configuration for the default RAG query generator. + LLMRAGQueryGeneratorConfig: + type: object + properties: + type: + type: string + const: llm + default: llm + description: Type of query generator, always 'llm' + model: + type: string + description: >- + Name of the language model to use for query generation + template: + type: string + description: >- + Template string for formatting the query generation prompt + additionalProperties: false + required: + - type + - model + - template + title: LLMRAGQueryGeneratorConfig + description: >- + Configuration for the LLM-based RAG query generator. + RAGQueryConfig: + type: object + properties: + query_generator_config: + oneOf: + - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' + discriminator: + propertyName: type + mapping: + default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' + description: Configuration for the query generator. + max_tokens_in_context: + type: integer + default: 4096 + description: Maximum number of tokens in the context. + max_chunks: + type: integer + default: 5 + description: Maximum number of chunks to retrieve. + chunk_template: + type: string + default: > + Result {index} - :param tool_calls: The tool calls to execute. + :param params: (Optional) Configuration parameters for the shield - :param tool_responses: The tool responses from the tool calls. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: tool_execution - default: tool_execution - title: Step Type - type: string - tool_calls: - items: - $ref: '#/$defs/ToolCall' - title: Tool Calls - type: array - tool_responses: - items: - $ref: '#/$defs/ToolResponse' - title: Tool Responses - type: array - required: - - turn_id - - step_id - - tool_calls - - tool_responses - title: ToolExecutionStep - type: object - ToolResponse: + :param type: The resource type, always shield + properties: + identifier: description: >- - Response from a tool invocation. - - - :param call_id: Unique identifier for the tool call this response is for + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' + description: >- + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: + description: >- + ID of the provider that owns this resource + title: Provider Id + type: string + type: + const: shield + default: shield + title: Type + type: string + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + required: + - identifier + - provider_id + title: Shield + type: object + SyntheticDataGenerateRequest: + type: object + SyntheticDataGenerationResponse: + description: >- + Response from the synthetic data generation. Batch of (prompt, response, score) + tuples that pass the threshold. - :param tool_name: Name of the tool that was invoked - :param content: The response content from the tool + :param synthetic_data: List of generated synthetic data samples that passed + the filtering criteria - :param metadata: (Optional) Additional metadata about the tool response - properties: - call_id: - title: Call Id - type: string - tool_name: - anyOf: - - $ref: '#/$defs/BuiltinTool' - - type: string - title: Tool Name - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - metadata: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Metadata - required: - - call_id - - tool_name - - content - title: ToolResponse - type: object - ToolResponseMessage: + :param statistics: (Optional) Statistical information about the generation + process and filtering results + properties: + synthetic_data: + items: + additionalProperties: true + type: object + title: Synthetic Data + type: array + statistics: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Statistics + required: + - synthetic_data + title: SyntheticDataGenerationResponse + type: object + InvokeToolRequest: + type: object + ToolInvocationResult: + $defs: + ImageContentItem: description: >- - A message representing the result of a tool invocation. - + A image content item - :param role: Must be "tool" to identify this as a tool response - :param call_id: Unique identifier for the tool call this response is for + :param type: Discriminator type of the content item. Always "image" - :param content: The response content from the tool + :param image: Image as a base64 encoded string or an URL properties: - role: - const: tool - default: tool - title: Role - type: string - call_id: - title: Call Id + type: + const: image + default: image + title: Type type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content + image: + $ref: '#/$defs/_URLOrData' required: - - call_id - - content - title: ToolResponseMessage + - image + title: ImageContentItem type: object - Turn: + TextContentItem: description: >- - A single turn in an interaction with an Agentic System. - - - :param turn_id: Unique identifier for the turn within a session - - :param session_id: Unique identifier for the conversation session - - :param input_messages: List of messages that initiated this turn - - :param steps: Ordered list of processing steps executed during this turn - - :param output_message: The model's generated response containing content - and metadata - - :param output_attachments: (Optional) Files or media attached to the agent's - response + A text content item - :param started_at: Timestamp when the turn began - :param completed_at: (Optional) Timestamp when the turn finished, if completed + :param type: Discriminator type of the content item. Always "text" + + :param text: Text content properties: - turn_id: - title: Turn Id - type: string - session_id: - title: Session Id + type: + const: text + default: text + title: Type type: string - input_messages: - items: - anyOf: - - $ref: '#/$defs/UserMessage' - - $ref: '#/$defs/ToolResponseMessage' - title: Input Messages - type: array - steps: - items: - discriminator: - mapping: - inference: '#/$defs/InferenceStep' - memory_retrieval: '#/$defs/MemoryRetrievalStep' - shield_call: '#/$defs/ShieldCallStep' - tool_execution: '#/$defs/ToolExecutionStep' - propertyName: step_type - oneOf: - - $ref: '#/$defs/InferenceStep' - - $ref: '#/$defs/ToolExecutionStep' - - $ref: '#/$defs/ShieldCallStep' - - $ref: '#/$defs/MemoryRetrievalStep' - title: Steps - type: array - output_message: - $ref: '#/$defs/CompletionMessage' - output_attachments: - anyOf: - - items: - $ref: '#/$defs/Attachment' - type: array - - type: 'null' - title: Output Attachments - started_at: - format: date-time - title: Started At + text: + title: Text type: string - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At required: - - turn_id - - session_id - - input_messages - - steps - - output_message - - started_at - title: Turn + - text + title: TextContentItem type: object URL: description: >- @@ -17593,89 +16394,6 @@ components: - uri title: URL type: object - UserMessage: - description: >- - A message from the user in a chat conversation. - - - :param role: Must be "user" to identify this as a user message - - :param content: The content of the message, which can include text and - other media - - :param context: (Optional) This field is used internally by Llama Stack - to pass RAG context. This field may be removed in the API in the future. - properties: - role: - const: user - default: user - title: Role - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - context: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - type: 'null' - title: Context - required: - - content - title: UserMessage - type: object - ViolationLevel: - description: >- - Severity level of a safety violation. - - - :cvar INFO: Informational level violation that does not require action - - :cvar WARN: Warning level violation that suggests caution but allows continuation - - :cvar ERROR: Error level violation that requires blocking or intervention - enum: - - info - - warn - - error - title: ViolationLevel - type: string _URLOrData: description: >- A URL or a base64 encoded string @@ -17699,210 +16417,349 @@ components: title: _URLOrData type: object description: >- - A single session of an interaction with an Agentic System. + Result of a tool invocation. - :param session_id: Unique identifier for the conversation session + :param content: (Optional) The output content from the tool execution - :param session_name: Human-readable name for the session + :param error_message: (Optional) Error message if the tool execution failed - :param turns: List of all turns that have occurred in this session + :param error_code: (Optional) Numeric error code if the tool execution failed - :param started_at: Timestamp when the session was created + :param metadata: (Optional) Additional metadata about the tool execution properties: - session_id: - title: Session Id + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + - type: 'null' + title: Content + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + error_code: + anyOf: + - type: integer + - type: 'null' + title: Error Code + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + title: ToolInvocationResult + type: object + URL: + description: >- + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri type: string - session_name: - title: Session Name + required: + - uri + title: URL + type: object + ListToolDefsResponse: + description: "Response containing a list of tool definitions.\n\n:param data: List of tool definitions" + properties: + data: + items: + $ref: '#/components/schemas/ToolDef' + title: Data + type: array + required: + - data + title: ListToolDefsResponse + type: object + VectorStoreDeleteResponse: + description: "Response from deleting a vector store.\n\n:param id: Unique identifier of the deleted vector store\n:param object: Object type identifier for the deletion response\n:param deleted: Whether the deletion operation was successful" + properties: + id: + title: Id type: string - turns: + object: + default: vector_store.deleted + title: Object + type: string + deleted: + default: true + title: Deleted + type: boolean + required: + - id + title: VectorStoreDeleteResponse + type: object + VectorStoreFileContentsResponse: + description: "Response from retrieving the contents of a vector store file.\n\n:param file_id: Unique identifier for the file\n:param filename: Name of the file\n:param attributes: Key-value attributes associated with the file\n:param content: List of content items from the file" + properties: + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + attributes: + additionalProperties: true + title: Attributes + type: object + content: items: - $ref: '#/$defs/Turn' - title: Turns + $ref: '#/components/schemas/VectorStoreContent' + title: Content type: array - started_at: - format: date-time - title: Started At - type: string required: - - session_id - - session_name - - turns - - started_at - title: Session + - file_id + - filename + - attributes + - content + title: VectorStoreFileContentsResponse type: object + VectorStoreFileDeleteResponse: + description: "Response from deleting a vector store file.\n\n:param id: Unique identifier of the deleted file\n:param object: Object type identifier for the deletion response\n:param deleted: Whether the deletion operation was successful" properties: - turn_id: - type: string - description: The ID of the turn. - step_id: - type: string - description: The ID of the step. - started_at: - type: string - format: date-time - description: The time the step started. - completed_at: + id: + title: Id type: string - format: date-time - description: The time the step completed. - step_type: + object: + default: vector_store.file.deleted + title: Object type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - title: StepType - description: Type of the step in an agent turn. - const: shield_call - default: shield_call - violation: - $ref: '#/components/schemas/SafetyViolation' - description: The violation from the shield call. - additionalProperties: false + deleted: + default: true + title: Deleted + type: boolean required: - - turn_id - - step_id - - step_type - title: ShieldCallStep - description: A shield call step in an agent turn. - ToolCall: + - id + title: VectorStoreFileDeleteResponse type: object + VectorStoreFilesListInBatchResponse: + description: "Response from listing files in a vector store file batch.\n\n:param object: Object type identifier, always \"list\"\n:param data: List of vector store file objects in the batch\n:param first_id: (Optional) ID of the first file in the list for pagination\n:param last_id: (Optional) ID of the last file in the list for pagination\n:param has_more: Whether there are more files available beyond this page" properties: - call_id: + object: + default: list + title: Object type: string - tool_name: - oneOf: - - type: string - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - - type: string - arguments: + data: + items: + $ref: '#/components/schemas/VectorStoreFileObject' + title: Data + type: array + first_id: + title: First Id type: string - additionalProperties: false + nullable: true + last_id: + title: Last Id + type: string + nullable: true + has_more: + default: false + title: Has More + type: boolean required: - - call_id - - tool_name - - arguments - title: ToolCall - ToolExecutionStep: + - data + title: VectorStoreFilesListInBatchResponse type: object + VectorStoreListFilesResponse: + description: "Response from listing files in a vector store.\n\n:param object: Object type identifier, always \"list\"\n:param data: List of vector store file objects\n:param first_id: (Optional) ID of the first file in the list for pagination\n:param last_id: (Optional) ID of the last file in the list for pagination\n:param has_more: Whether there are more files available beyond this page" properties: - turn_id: - type: string - description: The ID of the turn. - step_id: + object: + default: list + title: Object type: string - description: The ID of the step. - started_at: + data: + items: + $ref: '#/components/schemas/VectorStoreFileObject' + title: Data + type: array + first_id: + title: First Id type: string - format: date-time - description: The time the step started. - completed_at: + nullable: true + last_id: + title: Last Id type: string - format: date-time - description: The time the step completed. - step_type: + nullable: true + has_more: + default: false + title: Has More + type: boolean + required: + - data + title: VectorStoreListFilesResponse + type: object + VectorStoreListResponse: + description: "Response from listing vector stores.\n\n:param object: Object type identifier, always \"list\"\n:param data: List of vector store objects\n:param first_id: (Optional) ID of the first vector store in the list for pagination\n:param last_id: (Optional) ID of the last vector store in the list for pagination\n:param has_more: Whether there are more vector stores available beyond this page" + properties: + object: + default: list + title: Object type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - title: StepType - description: Type of the step in an agent turn. - const: tool_execution - default: tool_execution - tool_calls: - type: array + data: items: - $ref: '#/components/schemas/ToolCall' - description: The tool calls to execute. - tool_responses: + $ref: '#/components/schemas/VectorStoreObject' + title: Data type: array - items: - $ref: '#/components/schemas/ToolResponse' - description: The tool responses from the tool calls. - additionalProperties: false + first_id: + title: First Id + type: string + nullable: true + last_id: + title: Last Id + type: string + nullable: true + has_more: + default: false + title: Has More + type: boolean required: - - turn_id - - step_id - - step_type - - tool_calls - - tool_responses - title: ToolExecutionStep - description: A tool execution step in an agent turn. - ToolResponse: + - data + title: VectorStoreListResponse type: object + OpenAIResponseMessage: + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." properties: - call_id: - type: string - description: >- - Unique identifier for the tool call this response is for - tool_name: - oneOf: - - type: string - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - - type: string - description: Name of the tool that was invoked content: - $ref: '#/components/schemas/InterleavedContent' - description: The response content from the tool - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool response - additionalProperties: false + anyOf: + - type: string + - items: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: array + - items: + discriminator: + mapping: + output_text: '#/$defs/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + title: Id + type: string + nullable: true + status: + title: Status + type: string + nullable: true required: - - call_id - - tool_name - - content - title: ToolResponse - description: Response from a tool invocation. - ToolResponseMessage: + - content + - role + title: OpenAIResponseMessage type: object + OpenAIResponseObjectWithInput: + description: "OpenAI response object extended with input context information.\n\n:param input: List of input items that led to this response" properties: - role: + created_at: + title: Created At + type: integer + error: + $ref: '#/components/schemas/OpenAIResponseError' + nullable: true + id: + title: Id type: string - const: tool - default: tool - description: >- - Must be "tool" to identify this as a tool response - call_id: + model: + title: Model + type: string + required: + - session_id + title: AgentSessionCreateResponse + description: >- + Response returned when creating a new agent session. + CompletionMessage: + type: object + properties: + role: type: string + const: assistant + default: assistant description: >- - Unique identifier for the tool call this response is for + Must be "assistant" to identify this as the model's response content: $ref: '#/components/schemas/InterleavedContent' - description: The response content from the tool + description: The content of the model's response + stop_reason: + type: string + enum: + - end_of_turn + - end_of_message + - out_of_tokens + description: >- + Reason why the model stopped generating. Options are: - `StopReason.end_of_turn`: + The model finished generating the entire response. - `StopReason.end_of_message`: + The model finished generating but generated a partial response -- usually, + a tool call. The user may call the tool and continue the conversation + with the tool's response. - `StopReason.out_of_tokens`: The model ran + out of token budget. + tool_calls: + type: array + items: + $ref: '#/components/schemas/ToolCall' + description: >- + List of tool calls. Each tool call is a ToolCall object. additionalProperties: false required: - role - - call_id - content - title: ToolResponseMessage + - stop_reason + title: CompletionMessage description: >- - A message representing the result of a tool invocation. - Turn: + A message containing the model's (assistant) response in a chat conversation. + InferenceStep: + type: object + Session: $defs: Attachment: description: >- @@ -18399,6 +17256,86 @@ components: - content title: ToolResponseMessage type: object + Turn: + description: >- + A single turn in an interaction with an Agentic System. + + + :param turn_id: Unique identifier for the turn within a session + + :param session_id: Unique identifier for the conversation session + + :param input_messages: List of messages that initiated this turn + + :param steps: Ordered list of processing steps executed during this turn + + :param output_message: The model's generated response containing content + and metadata + + :param output_attachments: (Optional) Files or media attached to the agent's + response + + :param started_at: Timestamp when the turn began + + :param completed_at: (Optional) Timestamp when the turn finished, if completed + properties: + turn_id: + title: Turn Id + type: string + session_id: + title: Session Id + type: string + input_messages: + items: + anyOf: + - $ref: '#/$defs/UserMessage' + - $ref: '#/$defs/ToolResponseMessage' + title: Input Messages + type: array + steps: + items: + discriminator: + mapping: + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/$defs/InferenceStep' + - $ref: '#/$defs/ToolExecutionStep' + - $ref: '#/$defs/ShieldCallStep' + - $ref: '#/$defs/MemoryRetrievalStep' + title: Steps + type: array + output_message: + $ref: '#/$defs/CompletionMessage' + output_attachments: + anyOf: + - items: + $ref: '#/$defs/Attachment' + type: array + - type: 'null' + title: Output Attachments + started_at: + format: date-time + title: Started At + type: string + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At + required: + - turn_id + - session_id + - input_messages + - steps + - output_message + - started_at + title: Turn + type: object URL: description: >- A URL reference to external content. @@ -18519,116 +17456,251 @@ components: title: _URLOrData type: object description: >- - A single turn in an interaction with an Agentic System. - + A single session of an interaction with an Agentic System. - :param turn_id: Unique identifier for the turn within a session :param session_id: Unique identifier for the conversation session - :param input_messages: List of messages that initiated this turn - - :param steps: Ordered list of processing steps executed during this turn - - :param output_message: The model's generated response containing content and - metadata - - :param output_attachments: (Optional) Files or media attached to the agent's - response + :param session_name: Human-readable name for the session - :param started_at: Timestamp when the turn began + :param turns: List of all turns that have occurred in this session - :param completed_at: (Optional) Timestamp when the turn finished, if completed + :param started_at: Timestamp when the session was created properties: - turn_id: - title: Turn Id - type: string session_id: title: Session Id type: string - input_messages: + session_name: + title: Session Name + type: string + turns: items: - anyOf: - - $ref: '#/$defs/UserMessage' - - $ref: '#/$defs/ToolResponseMessage' - title: Input Messages + $ref: '#/$defs/Turn' + title: Turns + type: array + started_at: + format: date-time + title: Started At + type: string + required: + - session_id + - session_name + - turns + - started_at + title: Session + type: object + properties: + turn_id: + type: string + description: The ID of the turn. + step_id: + type: string + description: The ID of the step. + started_at: + type: string + format: date-time + description: The time the step started. + completed_at: + type: string + format: date-time + description: The time the step completed. + step_type: + type: string + enum: + - inference + - tool_execution + - shield_call + - memory_retrieval + title: StepType + description: Type of the step in an agent turn. + const: shield_call + default: shield_call + violation: + $ref: '#/components/schemas/SafetyViolation' + description: The violation from the shield call. + additionalProperties: false + required: + - turn_id + - step_id + - step_type + title: ShieldCallStep + description: A shield call step in an agent turn. + ToolCall: + type: object + properties: + call_id: + type: string + tool_name: + oneOf: + - type: string + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + - type: string + arguments: + type: string + additionalProperties: false + required: + - call_id + - tool_name + - arguments + title: ToolCall + ToolExecutionStep: + type: object + properties: + turn_id: + type: string + description: The ID of the turn. + step_id: + type: string + description: The ID of the step. + started_at: + type: string + format: date-time + description: The time the step started. + completed_at: + type: string + format: date-time + description: The time the step completed. + step_type: + type: string + enum: + - inference + - tool_execution + - shield_call + - memory_retrieval + title: StepType + description: Type of the step in an agent turn. + const: tool_execution + default: tool_execution + tool_calls: type: array - steps: items: - discriminator: - mapping: - inference: '#/$defs/InferenceStep' - memory_retrieval: '#/$defs/MemoryRetrievalStep' - shield_call: '#/$defs/ShieldCallStep' - tool_execution: '#/$defs/ToolExecutionStep' - propertyName: step_type - oneOf: - - $ref: '#/$defs/InferenceStep' - - $ref: '#/$defs/ToolExecutionStep' - - $ref: '#/$defs/ShieldCallStep' - - $ref: '#/$defs/MemoryRetrievalStep' - title: Steps + $ref: '#/components/schemas/ToolCall' + description: The tool calls to execute. + tool_responses: type: array - output_message: - $ref: '#/$defs/CompletionMessage' - output_attachments: - anyOf: - - items: - $ref: '#/$defs/Attachment' - type: array - - type: 'null' - title: Output Attachments - started_at: - format: date-time - title: Started At - type: string - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At + items: + $ref: '#/components/schemas/ToolResponse' + description: The tool responses from the tool calls. + additionalProperties: false required: - turn_id - - session_id - - input_messages - - steps - - output_message - - started_at - title: Turn - description: >- - A single turn in an interaction with an Agentic System. - UserMessage: + - step_id + - step_type + - tool_calls + - tool_responses + title: ToolExecutionStep + description: A tool execution step in an agent turn. + ToolResponse: type: object properties: - role: + call_id: type: string - const: user - default: user description: >- - Must be "user" to identify this as a user message + Unique identifier for the tool call this response is for + tool_name: + oneOf: + - type: string + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + - type: string + description: Name of the tool that was invoked content: $ref: '#/components/schemas/InterleavedContent' + description: The response content from the tool + metadata: + type: object + additionalProperties: + oneOf: + - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object description: >- - The content of the message, which can include text and other media - context: - $ref: '#/components/schemas/InterleavedContent' + (Optional) Additional metadata about the tool response + additionalProperties: false + required: + - call_id + - tool_name + - content + title: ToolResponse + description: Response from a tool invocation. + ToolResponseMessage: + type: object + properties: + role: + type: string + const: tool + default: tool description: >- - (Optional) This field is used internally by Llama Stack to pass RAG context. - This field may be removed in the API in the future. + Must be "tool" to identify this as a tool response + call_id: + type: string + description: >- + Unique identifier for the tool call this response is for + content: + $ref: '#/components/schemas/InterleavedContent' + description: The response content from the tool additionalProperties: false required: - role + - call_id - content - title: UserMessage + title: ToolResponseMessage description: >- - A message from the user in a chat conversation. - CreateAgentTurnRequest: - type: object - ResumeAgentTurnRequest: - type: object - AgentStepResponse: + A message representing the result of a tool invocation. + Turn: $defs: + Attachment: + description: >- + An attachment to an agent turn. + + + :param content: The content of the attachment. + + :param mime_type: The MIME type of the attachment. + properties: + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + - $ref: '#/$defs/URL' + title: Content + mime_type: + title: Mime Type + type: string + required: + - content + - mime_type + title: Attachment + type: object BuiltinTool: enum: - brave_search @@ -19026,31 +18098,144 @@ components: - $ref: '#/$defs/TextContentItem' type: array title: Content - metadata: + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + required: + - call_id + - tool_name + - content + title: ToolResponse + type: object + ToolResponseMessage: + description: >- + A message representing the result of a tool invocation. + + + :param role: Must be "tool" to identify this as a tool response + + :param call_id: Unique identifier for the tool call this response is for + + :param content: The response content from the tool + properties: + role: + const: tool + default: tool + title: Role + type: string + call_id: + title: Call Id + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + required: + - call_id + - content + title: ToolResponseMessage + type: object + URL: + description: >- + A URL reference to external content. + + + :param uri: The URL string pointing to the resource + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + UserMessage: + description: >- + A message from the user in a chat conversation. + + + :param role: Must be "user" to identify this as a user message + + :param content: The content of the message, which can include text and + other media + + :param context: (Optional) This field is used internally by Llama Stack + to pass RAG context. This field may be removed in the API in the future. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array + title: Content + context: anyOf: - - additionalProperties: true - type: object + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/$defs/ImageContentItem' + - $ref: '#/$defs/TextContentItem' + type: array - type: 'null' - title: Metadata + title: Context required: - - call_id - - tool_name - content - title: ToolResponse - type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL + title: UserMessage type: object ViolationLevel: description: >- @@ -19091,155 +18276,215 @@ components: title: _URLOrData type: object description: >- - Response containing details of a specific agent step. + A single turn in an interaction with an Agentic System. - :param step: The complete step data and execution details - properties: - step: - discriminator: - mapping: - inference: '#/$defs/InferenceStep' - memory_retrieval: '#/$defs/MemoryRetrievalStep' - shield_call: '#/$defs/ShieldCallStep' - tool_execution: '#/$defs/ToolExecutionStep' - propertyName: step_type - oneOf: - - $ref: '#/$defs/InferenceStep' - - $ref: '#/$defs/ToolExecutionStep' - - $ref: '#/$defs/ShieldCallStep' - - $ref: '#/$defs/MemoryRetrievalStep' - title: Step - required: - - step - title: AgentStepResponse - type: object - ListBenchmarksResponse: - $defs: - Benchmark: - description: >- - A benchmark resource for evaluating model performance. + :param turn_id: Unique identifier for the turn within a session + :param session_id: Unique identifier for the conversation session - :param dataset_id: Identifier of the dataset to use for the benchmark - evaluation + :param input_messages: List of messages that initiated this turn - :param scoring_functions: List of scoring function identifiers to apply - during evaluation + :param steps: Ordered list of processing steps executed during this turn - :param metadata: Metadata for this evaluation task + :param output_message: The model's generated response containing content and + metadata - :param type: The resource type, always benchmark - properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier - type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: benchmark - default: benchmark - title: Type - type: string - dataset_id: - title: Dataset Id - type: string - scoring_functions: - items: - type: string - title: Scoring Functions - type: array - metadata: - additionalProperties: true - description: Metadata for this evaluation task - title: Metadata - type: object - required: - - identifier - - provider_id - - dataset_id - - scoring_functions - title: Benchmark - type: object + :param output_attachments: (Optional) Files or media attached to the agent's + response + + :param started_at: Timestamp when the turn began + + :param completed_at: (Optional) Timestamp when the turn finished, if completed properties: - data: + turn_id: + title: Turn Id + type: string + session_id: + title: Session Id + type: string + input_messages: items: - $ref: '#/$defs/Benchmark' - title: Data + anyOf: + - $ref: '#/$defs/UserMessage' + - $ref: '#/$defs/ToolResponseMessage' + title: Input Messages + type: array + steps: + items: + discriminator: + mapping: + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + title: Output type: array + parallel_tool_calls: + default: false + title: Parallel Tool Calls + type: boolean + previous_response_id: + title: Previous Response Id + type: string + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + title: Completed At required: - - data - title: ListBenchmarksResponse - type: object - RegisterBenchmarkRequest: - type: object - Benchmark: + - turn_id + - session_id + - input_messages + - steps + - output_message + - started_at + title: Turn description: >- - A benchmark resource for evaluating model performance. - - - :param dataset_id: Identifier of the dataset to use for the benchmark evaluation - - :param scoring_functions: List of scoring function identifiers to apply during - evaluation - - :param metadata: Metadata for this evaluation task - - :param type: The resource type, always benchmark + A single turn in an interaction with an Agentic System. + UserMessage: + type: object properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier + role: type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' + const: user + default: user description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: + Must be "user" to identify this as a user message + content: + $ref: '#/components/schemas/InterleavedContent' description: >- - ID of the provider that owns this resource - title: Provider Id + The content of the message, which can include text and other media + context: + $ref: '#/components/schemas/InterleavedContent' + description: >- + (Optional) This field is used internally by Llama Stack to pass RAG context. + This field may be removed in the API in the future. + additionalProperties: false + required: + - role + - content + title: UserMessage + description: >- + A message from the user in a chat conversation. + CreateAgentTurnRequest: + type: object + ResumeAgentTurnRequest: + type: object + AgentStepResponse: + $defs: + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool type: string - type: - const: benchmark - default: benchmark - title: Type + temperature: + title: Temperature + type: number + nullable: true + text: + $ref: '#/components/schemas/OpenAIResponseText' + default: + format: + type: text + top_p: + title: Top P + type: number + nullable: true + tools: + title: Tools + items: + discriminator: + mapping: + file_search: '#/$defs/OpenAIResponseInputToolFileSearch' + function: '#/$defs/OpenAIResponseInputToolFunction' + mcp: '#/$defs/OpenAIResponseToolMCP' + web_search: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + type: array + nullable: true + truncation: + title: Truncation type: string - dataset_id: - title: Dataset Id + nullable: true + usage: + $ref: '#/components/schemas/OpenAIResponseUsage' + nullable: true + instructions: + title: Instructions + type: string + nullable: true + input: + items: + anyOf: + - discriminator: + mapping: + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage' + title: Input + type: array + required: + - created_at + - id + - model + - output + - status + - input + title: OpenAIResponseObjectWithInput + type: object + ImageContentItem: + description: "A image content item\n\n:param type: Discriminator type of the content item. Always \"image\"\n:param image: Image as a base64 encoded string or an URL" + properties: + type: + const: image + default: image + title: Type type: string - scoring_functions: - items: - type: string - title: Scoring Functions - type: array - metadata: - additionalProperties: true - description: Metadata for this evaluation task - title: Metadata - type: object + image: + $ref: '#/components/schemas/_URLOrData' required: - - identifier - - provider_id - - dataset_id - - scoring_functions - title: Benchmark + - image + title: ImageContentItem type: object properties: type: @@ -19372,401 +18617,46 @@ components: :param scores: The scores from the evaluation. properties: - generations: - items: - additionalProperties: true - type: object - title: Generations - type: array - scores: - additionalProperties: - $ref: '#/$defs/ScoringResult' - title: Scores - type: object - required: - - generations - - scores - title: EvaluateResponse - type: object - RunEvalRequest: - type: object - Job: - $defs: - JobStatus: - description: >- - Status of a job execution. - - :cvar completed: Job has finished successfully - - :cvar in_progress: Job is currently running - - :cvar failed: Job has failed during execution - - :cvar scheduled: Job is scheduled but not yet started - - :cvar cancelled: Job was cancelled before completion - enum: - - completed - - in_progress - - failed - - scheduled - - cancelled - title: JobStatus - type: string - description: >- - A job execution instance with status tracking. - - - :param job_id: Unique identifier for the job - - :param status: Current execution status of the job - properties: - job_id: - title: Job Id - type: string - status: - $ref: '#/$defs/JobStatus' - required: - - job_id - - status - title: Job - type: object - RerankRequest: - type: object - RerankResponse: - $defs: - RerankData: - description: >- - A single rerank result from a reranking response. - - - :param index: The original index of the document in the input list - - :param relevance_score: The relevance score from the model output. Values - are inverted when applicable so that higher scores indicate greater relevance. - properties: - index: - title: Index - type: integer - relevance_score: - title: Relevance Score - type: number - required: - - index - - relevance_score - title: RerankData - type: object - description: >- - Response from a reranking request. - - - :param data: List of rerank result objects, sorted by relevance score (descending) - properties: - data: - items: - $ref: '#/$defs/RerankData' - title: Data - type: array - required: - - data - title: RerankResponse - type: object - PostTrainingJobArtifactsResponse: - $defs: - Checkpoint: - description: >- - Checkpoint created during training runs. - - - :param identifier: Unique identifier for the checkpoint - - :param created_at: Timestamp when the checkpoint was created - - :param epoch: Training epoch when the checkpoint was saved - - :param post_training_job_id: Identifier of the training job that created - this checkpoint - - :param path: File system path where the checkpoint is stored - - :param training_metrics: (Optional) Training metrics associated with this - checkpoint - properties: - identifier: - title: Identifier - type: string - created_at: - format: date-time - title: Created At - type: string - epoch: - title: Epoch - type: integer - post_training_job_id: - title: Post Training Job Id - type: string - path: - title: Path - type: string - training_metrics: - anyOf: - - $ref: '#/$defs/PostTrainingMetric' - - type: 'null' - required: - - identifier - - created_at - - epoch - - post_training_job_id - - path - title: Checkpoint - type: object - PostTrainingMetric: - description: >- - Training metrics captured during post-training jobs. - - - :param epoch: Training epoch number - - :param train_loss: Loss value on the training dataset - - :param validation_loss: Loss value on the validation dataset - - :param perplexity: Perplexity metric indicating model confidence - properties: - epoch: - title: Epoch - type: integer - train_loss: - title: Train Loss - type: number - validation_loss: - title: Validation Loss - type: number - perplexity: - title: Perplexity - type: number - required: - - epoch - - train_loss - - validation_loss - - perplexity - title: PostTrainingMetric - type: object - description: >- - Artifacts of a finetuning job. - - - :param job_uuid: Unique identifier for the training job - - :param checkpoints: List of model checkpoints created during training - properties: - job_uuid: - title: Job Uuid - type: string - checkpoints: - items: - $ref: '#/$defs/Checkpoint' - title: Checkpoints - type: array + epoch: + title: Epoch + type: integer + train_loss: + title: Train Loss + type: number + validation_loss: + title: Validation Loss + type: number + perplexity: + title: Perplexity + type: number required: - - job_uuid - title: PostTrainingJobArtifactsResponse + - epoch + - train_loss + - validation_loss + - perplexity + title: PostTrainingMetric type: object - CancelTrainingJobRequest: - type: object - PostTrainingJobStatusResponse: - $defs: - Checkpoint: - description: >- - Checkpoint created during training runs. - - - :param identifier: Unique identifier for the checkpoint - - :param created_at: Timestamp when the checkpoint was created - - :param epoch: Training epoch when the checkpoint was saved - - :param post_training_job_id: Identifier of the training job that created - this checkpoint - - :param path: File system path where the checkpoint is stored - - :param training_metrics: (Optional) Training metrics associated with this - checkpoint - properties: - identifier: - title: Identifier - type: string - created_at: - format: date-time - title: Created At - type: string - epoch: - title: Epoch - type: integer - post_training_job_id: - title: Post Training Job Id - type: string - path: - title: Path - type: string - training_metrics: - anyOf: - - $ref: '#/$defs/PostTrainingMetric' - - type: 'null' - required: - - identifier - - created_at - - epoch - - post_training_job_id - - path - title: Checkpoint - type: object - JobStatus: - description: >- - Status of a job execution. - - :cvar completed: Job has finished successfully - - :cvar in_progress: Job is currently running - - :cvar failed: Job has failed during execution - - :cvar scheduled: Job is scheduled but not yet started - - :cvar cancelled: Job was cancelled before completion - enum: - - completed - - in_progress - - failed - - scheduled - - cancelled - title: JobStatus - type: string - PostTrainingMetric: - description: >- - Training metrics captured during post-training jobs. - - - :param epoch: Training epoch number - - :param train_loss: Loss value on the training dataset - - :param validation_loss: Loss value on the validation dataset - - :param perplexity: Perplexity metric indicating model confidence - properties: - epoch: - title: Epoch - type: integer - train_loss: - title: Train Loss - type: number - validation_loss: - title: Validation Loss - type: number - perplexity: - title: Perplexity - type: number - required: - - epoch - - train_loss - - validation_loss - - perplexity - title: PostTrainingMetric - type: object - description: >- - Status of a finetuning job. - - - :param job_uuid: Unique identifier for the training job - - :param status: Current status of the training job - - :param scheduled_at: (Optional) Timestamp when the job was scheduled - - :param started_at: (Optional) Timestamp when the job execution began - - :param completed_at: (Optional) Timestamp when the job finished, if completed - - :param resources_allocated: (Optional) Information about computational resources - allocated to the job - - :param checkpoints: List of model checkpoints created during training + _safety_run_shield_Request: properties: - job_uuid: - title: Job Uuid + shield_id: + title: Shield Id type: string - status: - $ref: '#/$defs/JobStatus' - scheduled_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Scheduled At - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - resources_allocated: + messages: anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Resources Allocated - checkpoints: - items: - $ref: '#/$defs/Checkpoint' - title: Checkpoints - type: array - required: - - job_uuid - - status - title: PostTrainingJobStatusResponse - type: object - ListPostTrainingJobsResponse: - $defs: - PostTrainingJob: - properties: - job_uuid: - title: Job Uuid - type: string - required: - - job_uuid - title: PostTrainingJob - type: object - properties: - data: - items: - $ref: '#/$defs/PostTrainingJob' - title: Data - type: array - required: - - data - title: ListPostTrainingJobsResponse - type: object - PreferenceOptimizeRequest: - type: object - PostTrainingJob: - properties: - job_uuid: - title: Job Uuid + - $ref: '#/components/schemas/OpenAIUserMessageParam' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Messages + params: + title: Params type: string required: - - job_uuid - title: PostTrainingJob - type: object - SupervisedFineTuneRequest: + - shield_id + - messages + - params + title: _safety_run_shield_Request type: object responses: BadRequest400: @@ -19780,8 +18670,7 @@ components: title: Bad Request detail: The request was invalid or malformed TooManyRequests429: - description: >- - The client has sent too many requests in a given amount of time + description: The client has sent too many requests in a given amount of time content: application/json: schema: @@ -19789,11 +18678,9 @@ components: example: status: 429 title: Too Many Requests - detail: >- - You have exceeded the rate limit. Please try again later. + detail: You have exceeded the rate limit. Please try again later. InternalServerError500: - description: >- - The server encountered an unexpected error + description: The server encountered an unexpected error content: application/json: schema: @@ -19801,10 +18688,9 @@ components: example: status: 500 title: Internal Server Error - detail: >- - An unexpected error occurred. Our team has been notified. + detail: An unexpected error occurred DefaultError: - description: An unexpected error occurred + description: An error occurred content: application/json: schema: diff --git a/pyproject.toml b/pyproject.toml index 6a01d7843b..e676b6d5df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,13 +68,14 @@ dev = [ "pytest-cov", "pytest-html", "pytest-json-report", - "pytest-socket", # For blocking network access in unit tests - "nbval", # For notebook testing + "pytest-socket", # For blocking network access in unit tests + "nbval", # For notebook testing "black", "ruff", "mypy", "pre-commit", - "ruamel.yaml", # needed for openapi generator + "ruamel.yaml", # needed for openapi generator + "openapi-spec-validator>=0.7.2", ] # Type checking dependencies - includes type stubs and optional runtime dependencies # needed for complete mypy coverage across all optional features diff --git a/scripts/fastapi_generator.py b/scripts/fastapi_generator.py index 5a0dbd00aa..08b80a0fbb 100755 --- a/scripts/fastapi_generator.py +++ b/scripts/fastapi_generator.py @@ -17,6 +17,8 @@ import yaml from fastapi import FastAPI from fastapi.openapi.utils import get_openapi +from openapi_spec_validator import validate_spec +from openapi_spec_validator.exceptions import OpenAPISpecValidatorError from llama_stack.apis.datatypes import Api from llama_stack.core.resolver import api_protocol_map @@ -24,6 +26,9 @@ # Import the existing route discovery system from llama_stack.core.server.routes import get_all_api_routes +# Global list to store dynamic models created during endpoint generation +_dynamic_models = [] + def _get_all_api_routes_with_functions(): """ @@ -108,6 +113,37 @@ def create_llama_stack_app() -> FastAPI: return app +def _extract_path_parameters(path: str) -> list[dict[str, Any]]: + """ + Extract path parameters from a URL path and return them as OpenAPI parameter definitions. + + Args: + path: URL path with parameters like /v1/batches/{batch_id}/cancel + + Returns: + List of parameter definitions for OpenAPI + """ + import re + + # Find all path parameters in the format {param} or {param:type} + param_pattern = r"\{([^}:]+)(?::[^}]+)?\}" + matches = re.findall(param_pattern, path) + + parameters = [] + for param_name in matches: + parameters.append( + { + "name": param_name, + "in": "path", + "required": True, + "schema": {"type": "string"}, + "description": f"Path parameter: {param_name}", + } + ) + + return parameters + + def _create_fastapi_endpoint(app: FastAPI, route, webmethod): """ Create a FastAPI endpoint from a discovered route and webmethod. @@ -124,6 +160,12 @@ def _create_fastapi_endpoint(app: FastAPI, route, webmethod): # Try to find actual models for this endpoint request_model, response_model, query_parameters = _find_models_for_endpoint(webmethod) + # Debug: Print info for safety endpoints + if "safety" in webmethod.route or "shield" in webmethod.route: + print( + f"Debug: {webmethod.route} - request_model: {request_model}, response_model: {response_model}, query_parameters: {query_parameters}" + ) + # Extract response description from webmethod docstring (always try this first) response_description = _extract_response_description_from_docstring(webmethod, response_model) @@ -136,46 +178,107 @@ async def typed_endpoint(request: request_model) -> response_model: endpoint_func = typed_endpoint elif response_model and query_parameters: - # Request with individual parameters (could be GET with query params or POST with individual params) - # Create a function with the actual query parameters - def create_query_endpoint_func(): - # Build the function signature dynamically - import inspect - - # Create parameter annotations - param_annotations = {} - param_defaults = {} - - for param_name, param_type, default_value in query_parameters: - # Handle problematic type annotations that cause FastAPI issues - safe_type = _make_type_safe_for_fastapi(param_type) - param_annotations[param_name] = safe_type - if default_value is not None: - param_defaults[param_name] = default_value - - # Create the function signature - sig = inspect.Signature( - [ - inspect.Parameter( - name=param_name, - kind=inspect.Parameter.POSITIONAL_OR_KEYWORD, - default=default_value, - annotation=param_annotations[param_name], + # Check if this is a POST/PUT endpoint with individual parameters + # For POST/PUT, individual parameters should go in request body, not query params + is_post_put = any(method.upper() in ["POST", "PUT", "PATCH"] for method in methods) + + if is_post_put: + # POST/PUT with individual parameters - create a request body model + try: + from pydantic import create_model + + # Create a dynamic Pydantic model for the request body + field_definitions = {} + for param_name, param_type, default_value in query_parameters: + # Handle complex types that might cause issues with create_model + safe_type = _make_type_safe_for_fastapi(param_type) + + if default_value is None: + field_definitions[param_name] = (safe_type, ...) # Required field + else: + field_definitions[param_name] = (safe_type, default_value) # Optional field with default + + # Create the request model dynamically + # Clean up the route name to create a valid schema name + clean_route = webmethod.route.replace("/", "_").replace("{", "").replace("}", "").replace("-", "_") + model_name = f"{clean_route}_Request" + + print(f"Debug: Creating model {model_name} with fields: {field_definitions}") + request_model = create_model(model_name, **field_definitions) + print(f"Debug: Successfully created model {model_name}") + + # Store the dynamic model in the global list for schema inclusion + _dynamic_models.append(request_model) + + # Create endpoint with request body + async def typed_endpoint(request: request_model) -> response_model: + """Typed endpoint for proper schema generation.""" + return response_model() + + # Set the function signature to ensure FastAPI recognizes the request model + typed_endpoint.__annotations__ = {"request": request_model, "return": response_model} + + endpoint_func = typed_endpoint + except Exception as e: + # If dynamic model creation fails, fall back to query parameters + print(f"Warning: Failed to create dynamic request model for {webmethod.route}: {e}") + print(f" Query parameters: {query_parameters}") + # Fall through to the query parameter handling + pass + + if not is_post_put: + # GET with query parameters - create a function with the actual query parameters + def create_query_endpoint_func(): + # Build the function signature dynamically + import inspect + + # Create parameter annotations + param_annotations = {} + param_defaults = {} + + for param_name, param_type, default_value in query_parameters: + # Handle problematic type annotations that cause FastAPI issues + safe_type = _make_type_safe_for_fastapi(param_type) + param_annotations[param_name] = safe_type + if default_value is not None: + param_defaults[param_name] = default_value + + # Create the function with the correct signature + def create_endpoint_func(): + # Sort parameters so that required parameters come before optional ones + # Parameters with None default are required, others are optional + sorted_params = sorted( + query_parameters, + key=lambda x: (x[2] is not None, x[0]), # False (required) comes before True (optional) + ) + + # Create the function signature + sig = inspect.Signature( + [ + inspect.Parameter( + name=param_name, + kind=inspect.Parameter.POSITIONAL_OR_KEYWORD, + default=default_value if default_value is not None else inspect.Parameter.empty, + annotation=param_annotations[param_name], + ) + for param_name, param_type, default_value in sorted_params + ] ) - for param_name, param_type, default_value in query_parameters - ] - ) - async def query_endpoint(**kwargs) -> response_model: - """Query endpoint for proper schema generation.""" - return response_model() + # Create a simple function without **kwargs + async def query_endpoint(): + """Query endpoint for proper schema generation.""" + return response_model() - # Set the signature - query_endpoint.__signature__ = sig - query_endpoint.__annotations__ = param_annotations - return query_endpoint + # Set the signature and annotations + query_endpoint.__signature__ = sig + query_endpoint.__annotations__ = param_annotations - endpoint_func = create_query_endpoint_func() + return query_endpoint + + return create_endpoint_func() + + endpoint_func = create_query_endpoint_func() elif response_model: # Response-only endpoint (no parameters) async def response_only_endpoint() -> response_model: @@ -289,6 +392,10 @@ def _find_models_for_endpoint(webmethod) -> tuple[type | None, type | None, list if param_name == "self": continue + # Skip *args and **kwargs parameters - these are not real API parameters + if param.kind in (inspect.Parameter.VAR_POSITIONAL, inspect.Parameter.VAR_KEYWORD): + continue + # Check if it's a Pydantic model (for POST/PUT requests) param_type = param.annotation if hasattr(param_type, "model_json_schema"): @@ -319,8 +426,17 @@ def _find_models_for_endpoint(webmethod) -> tuple[type | None, type | None, list elif get_origin(return_annotation) is Annotated: # Handle Annotated return types args = get_args(return_annotation) - if args and hasattr(args[0], "model_json_schema"): - response_model = args[0] + if args: + # Check if the first argument is a Pydantic model + if hasattr(args[0], "model_json_schema"): + response_model = args[0] + # Check if the first argument is a union type + elif get_origin(args[0]) is type(args[0]): # Union type + union_args = get_args(args[0]) + for arg in union_args: + if hasattr(arg, "model_json_schema"): + response_model = arg + break elif get_origin(return_annotation) is type(return_annotation): # Union type # Handle union types - try to find the first Pydantic model args = get_args(return_annotation) @@ -340,6 +456,7 @@ def _make_type_safe_for_fastapi(type_hint) -> type: """ Make a type hint safe for FastAPI by converting problematic types to their base types. This handles cases like Literal["24h"] that cause forward reference errors. + Also removes Union with None to avoid anyOf with type: 'null' schemas. """ # Handle Literal types that might cause issues if hasattr(type_hint, "__origin__") and type_hint.__origin__ is Literal: @@ -369,11 +486,16 @@ def _make_type_safe_for_fastapi(type_hint) -> type: if origin is type(type_hint) or (hasattr(type_hint, "__args__") and type_hint.__args__): # This is a union type, find the non-None type args = get_args(type_hint) - for arg in args: - if arg is not type(None) and arg is not None: - return arg - # If all args are None, return the first one - return args[0] if args else type_hint + non_none_types = [arg for arg in args if arg is not type(None) and arg is not None] + + if non_none_types: + # Return the first non-None type to avoid anyOf with null + return non_none_types[0] + elif args: + # If all args are None, return the first one + return args[0] + else: + return type_hint # Not a union type, return as-is return type_hint @@ -475,6 +597,202 @@ def _find_extra_body_params_for_route(api_name: str, route, webmethod) -> list[d return [] +def _ensure_json_schema_types_included(openapi_schema: dict[str, Any]) -> dict[str, Any]: + """ + Ensure all @json_schema_type decorated models are included in the OpenAPI schema. + This finds all models with the _llama_stack_schema_type attribute and adds them to the schema. + """ + if "components" not in openapi_schema: + openapi_schema["components"] = {} + + if "schemas" not in openapi_schema["components"]: + openapi_schema["components"]["schemas"] = {} + + # Find all classes with the _llama_stack_schema_type attribute + from llama_stack import apis + + # Get all modules in the apis package + apis_modules = [] + for module_name in dir(apis): + if not module_name.startswith("_"): + try: + module = getattr(apis, module_name) + if hasattr(module, "__file__"): + apis_modules.append(module) + except (ImportError, AttributeError): + continue + + # Also check submodules + for module in apis_modules: + for attr_name in dir(module): + if not attr_name.startswith("_"): + try: + attr = getattr(module, attr_name) + if hasattr(attr, "__file__") and hasattr(attr, "__name__"): + apis_modules.append(attr) + except (ImportError, AttributeError): + continue + + # Find all classes with the _llama_stack_schema_type attribute + for module in apis_modules: + for attr_name in dir(module): + try: + attr = getattr(module, attr_name) + if ( + hasattr(attr, "_llama_stack_schema_type") + and hasattr(attr, "model_json_schema") + and hasattr(attr, "__name__") + ): + schema_name = attr.__name__ + if schema_name not in openapi_schema["components"]["schemas"]: + try: + schema = attr.model_json_schema() + openapi_schema["components"]["schemas"][schema_name] = schema + except Exception: + # Skip if we can't generate the schema + continue + except (AttributeError, TypeError): + continue + + # Also include any dynamic models that were created during endpoint generation + # This is a workaround to ensure dynamic models appear in the schema + global _dynamic_models + if "_dynamic_models" in globals(): + for model in _dynamic_models: + try: + schema_name = model.__name__ + if schema_name not in openapi_schema["components"]["schemas"]: + schema = model.model_json_schema() + openapi_schema["components"]["schemas"][schema_name] = schema + except Exception: + # Skip if we can't generate the schema + continue + + return openapi_schema + + +def _fix_ref_references(openapi_schema: dict[str, Any]) -> dict[str, Any]: + """ + Fix $ref references to point to components/schemas instead of $defs. + This prevents the YAML dumper from creating a root-level $defs section. + """ + + def fix_refs(obj: Any) -> None: + if isinstance(obj, dict): + if "$ref" in obj and obj["$ref"].startswith("#/$defs/"): + # Replace #/$defs/ with #/components/schemas/ + obj["$ref"] = obj["$ref"].replace("#/$defs/", "#/components/schemas/") + for value in obj.values(): + fix_refs(value) + elif isinstance(obj, list): + for item in obj: + fix_refs(item) + + fix_refs(openapi_schema) + return openapi_schema + + +def _fix_anyof_with_null(openapi_schema: dict[str, Any]) -> dict[str, Any]: + """ + Fix anyOf schemas that contain type: 'null' by removing the null type + and making the field optional through the required field instead. + """ + + def fix_anyof(obj: Any) -> None: + if isinstance(obj, dict): + if "anyOf" in obj and isinstance(obj["anyOf"], list): + # Check if anyOf contains type: 'null' + has_null = any(item.get("type") == "null" for item in obj["anyOf"] if isinstance(item, dict)) + if has_null: + # Remove null types and keep only the non-null types + non_null_types = [ + item for item in obj["anyOf"] if not (isinstance(item, dict) and item.get("type") == "null") + ] + if len(non_null_types) == 1: + # If only one non-null type remains, replace anyOf with that type + obj.update(non_null_types[0]) + if "anyOf" in obj: + del obj["anyOf"] + else: + # Keep the anyOf but without null types + obj["anyOf"] = non_null_types + + # Recursively process all values + for value in obj.values(): + fix_anyof(value) + elif isinstance(obj, list): + for item in obj: + fix_anyof(item) + + fix_anyof(openapi_schema) + return openapi_schema + + +def _eliminate_defs_section(openapi_schema: dict[str, Any]) -> dict[str, Any]: + """ + Eliminate $defs section entirely by moving all definitions to components/schemas. + This matches the structure of the old pyopenapi generator for oasdiff compatibility. + """ + if "components" not in openapi_schema: + openapi_schema["components"] = {} + + if "schemas" not in openapi_schema["components"]: + openapi_schema["components"]["schemas"] = {} + + # First pass: collect all $defs from anywhere in the schema + defs_to_move = {} + + def collect_defs(obj: Any) -> None: + if isinstance(obj, dict): + if "$defs" in obj: + # Collect $defs for later processing + for def_name, def_schema in obj["$defs"].items(): + if def_name not in defs_to_move: + defs_to_move[def_name] = def_schema + + # Recursively process all values + for value in obj.values(): + collect_defs(value) + elif isinstance(obj, list): + for item in obj: + collect_defs(item) + + # Collect all $defs + collect_defs(openapi_schema) + + # Move all $defs to components/schemas + for def_name, def_schema in defs_to_move.items(): + if def_name not in openapi_schema["components"]["schemas"]: + openapi_schema["components"]["schemas"][def_name] = def_schema + + # Also move any existing root-level $defs to components/schemas + if "$defs" in openapi_schema: + print(f"Found root-level $defs with {len(openapi_schema['$defs'])} items, moving to components/schemas") + for def_name, def_schema in openapi_schema["$defs"].items(): + if def_name not in openapi_schema["components"]["schemas"]: + openapi_schema["components"]["schemas"][def_name] = def_schema + # Remove the root-level $defs + del openapi_schema["$defs"] + + # Second pass: remove all $defs sections from anywhere in the schema + def remove_defs(obj: Any) -> None: + if isinstance(obj, dict): + if "$defs" in obj: + del obj["$defs"] + + # Recursively process all values + for value in obj.values(): + remove_defs(value) + elif isinstance(obj, list): + for item in obj: + remove_defs(item) + + # Remove all $defs sections + remove_defs(openapi_schema) + + return openapi_schema + + def _add_error_responses(openapi_schema: dict[str, Any]) -> dict[str, Any]: """ Add standard error response definitions to the OpenAPI schema. @@ -547,10 +865,40 @@ def _add_error_responses(openapi_schema: dict[str, Any]) -> dict[str, Any]: return openapi_schema +def _fix_path_parameters(openapi_schema: dict[str, Any]) -> dict[str, Any]: + """ + Fix path parameter resolution issues by adding explicit parameter definitions. + """ + if "paths" not in openapi_schema: + return openapi_schema + + for path, path_item in openapi_schema["paths"].items(): + # Extract path parameters from the URL + path_params = _extract_path_parameters(path) + + if not path_params: + continue + + # Add parameters to each operation in this path + for method in ["get", "post", "put", "delete", "patch", "head", "options"]: + if method in path_item and isinstance(path_item[method], dict): + operation = path_item[method] + if "parameters" not in operation: + operation["parameters"] = [] + + # Add path parameters that aren't already defined + existing_param_names = {p.get("name") for p in operation["parameters"] if p.get("in") == "path"} + for param in path_params: + if param["name"] not in existing_param_names: + operation["parameters"].append(param) + + return openapi_schema + + def _fix_schema_issues(openapi_schema: dict[str, Any]) -> dict[str, Any]: """ Fix common schema issues that cause OpenAPI validation problems. - This includes converting exclusiveMinimum numbers to minimum values. + This includes converting exclusiveMinimum numbers to minimum values and fixing string fields with null defaults. """ if "components" not in openapi_schema or "schemas" not in openapi_schema["components"]: return openapi_schema @@ -560,10 +908,64 @@ def _fix_schema_issues(openapi_schema: dict[str, Any]) -> dict[str, Any]: # Fix exclusiveMinimum issues for _, schema_def in schemas.items(): _fix_exclusive_minimum_in_schema(schema_def) + _fix_all_null_defaults(schema_def) return openapi_schema +def validate_openapi_schema(schema: dict[str, Any], schema_name: str = "OpenAPI schema") -> bool: + """ + Validate an OpenAPI schema using openapi-spec-validator. + + Args: + schema: The OpenAPI schema dictionary to validate + schema_name: Name of the schema for error reporting + + Returns: + True if valid, False otherwise + + Raises: + OpenAPIValidationError: If validation fails + """ + try: + validate_spec(schema) + print(f"✅ {schema_name} is valid") + return True + except OpenAPISpecValidatorError as e: + print(f"❌ {schema_name} validation failed:") + print(f" {e}") + return False + except Exception as e: + print(f"❌ {schema_name} validation error: {e}") + return False + + +def validate_schema_file(file_path: Path) -> bool: + """ + Validate an OpenAPI schema file (YAML or JSON). + + Args: + file_path: Path to the schema file + + Returns: + True if valid, False otherwise + """ + try: + with open(file_path) as f: + if file_path.suffix.lower() in [".yaml", ".yml"]: + schema = yaml.safe_load(f) + elif file_path.suffix.lower() == ".json": + schema = json.load(f) + else: + print(f"❌ Unsupported file format: {file_path.suffix}") + return False + + return validate_openapi_schema(schema, str(file_path)) + except Exception as e: + print(f"❌ Failed to read {file_path}: {e}") + return False + + def _fix_exclusive_minimum_in_schema(obj: Any) -> None: """ Recursively fix exclusiveMinimum issues in a schema object. @@ -586,6 +988,75 @@ def _fix_exclusive_minimum_in_schema(obj: Any) -> None: _fix_exclusive_minimum_in_schema(item) +def _fix_string_fields_with_null_defaults(obj: Any) -> None: + """ + Recursively fix string fields that have default: null. + This violates OpenAPI spec - string fields should either have a string default or be optional. + """ + if isinstance(obj, dict): + # Check if this is a field definition with type: string and default: null + if obj.get("type") == "string" and "default" in obj and obj["default"] is None: + # Remove the default: null to make the field optional + del obj["default"] + # Add nullable: true to indicate the field can be null + obj["nullable"] = True + + # Recursively process all values + for value in obj.values(): + _fix_string_fields_with_null_defaults(value) + + elif isinstance(obj, list): + # Recursively process all items + for item in obj: + _fix_string_fields_with_null_defaults(item) + + +def _fix_anyof_with_null_defaults(obj: Any) -> None: + """ + Recursively fix anyOf schemas that have default: null. + This violates OpenAPI spec - anyOf fields should not have null defaults. + """ + if isinstance(obj, dict): + # Check if this is a field definition with anyOf and default: null + if "anyOf" in obj and "default" in obj and obj["default"] is None: + # Remove the default: null to make the field optional + del obj["default"] + # Add nullable: true to indicate the field can be null + obj["nullable"] = True + + # Recursively process all values + for value in obj.values(): + _fix_anyof_with_null_defaults(value) + + elif isinstance(obj, list): + # Recursively process all items + for item in obj: + _fix_anyof_with_null_defaults(item) + + +def _fix_all_null_defaults(obj: Any) -> None: + """ + Recursively fix all field types that have default: null. + This violates OpenAPI spec - fields should not have null defaults. + """ + if isinstance(obj, dict): + # Check if this is a field definition with default: null + if "default" in obj and obj["default"] is None: + # Remove the default: null to make the field optional + del obj["default"] + # Add nullable: true to indicate the field can be null + obj["nullable"] = True + + # Recursively process all values + for value in obj.values(): + _fix_all_null_defaults(value) + + elif isinstance(obj, list): + # Recursively process all items + for item in obj: + _fix_all_null_defaults(item) + + def _sort_paths_alphabetically(openapi_schema: dict[str, Any]) -> dict[str, Any]: """ Sort the paths in the OpenAPI schema by version prefix first, then alphabetically. @@ -703,6 +1174,15 @@ def _filter_schema_by_version( filtered_schema["components"]["schemas"] = filtered_schemas + # Preserve $defs section if it exists + if "components" in openapi_schema and "$defs" in openapi_schema["components"]: + if "components" not in filtered_schema: + filtered_schema["components"] = {} + filtered_schema["components"]["$defs"] = openapi_schema["components"]["$defs"] + print(f"Preserved $defs section with {len(openapi_schema['components']['$defs'])} items") + else: + print("No $defs section to preserve") + return filtered_schema @@ -811,6 +1291,49 @@ def _filter_deprecated_schema(openapi_schema: dict[str, Any]) -> dict[str, Any]: return filtered_schema +def _filter_combined_schema(openapi_schema: dict[str, Any]) -> dict[str, Any]: + """ + Filter OpenAPI schema to include both stable (v1) and experimental (v1alpha, v1beta) APIs. + Excludes deprecated endpoints. This is used for the combined "stainless" spec. + """ + filtered_schema = openapi_schema.copy() + + if "paths" not in filtered_schema: + return filtered_schema + + # Filter paths to include stable (v1) and experimental (v1alpha, v1beta), excluding deprecated + filtered_paths = {} + for path, path_item in filtered_schema["paths"].items(): + # Check if path has any deprecated operations + is_deprecated = _is_path_deprecated(path_item) + + # Skip deprecated endpoints + if is_deprecated: + continue + + # Include /v1/ paths (stable) + if path.startswith("/v1/") and not path.startswith("/v1alpha/") and not path.startswith("/v1beta/"): + filtered_paths[path] = path_item + # Include /v1alpha/ and /v1beta/ paths (experimental) + elif path.startswith("/v1alpha/") or path.startswith("/v1beta/"): + filtered_paths[path] = path_item + + filtered_schema["paths"] = filtered_paths + + # Filter schemas/components to only include ones referenced by filtered paths + if "components" in filtered_schema and "schemas" in filtered_schema["components"]: + referenced_schemas = _find_schemas_referenced_by_paths(filtered_paths, openapi_schema) + + filtered_schemas = {} + for schema_name, schema_def in filtered_schema["components"]["schemas"].items(): + if schema_name in referenced_schemas: + filtered_schemas[schema_name] = schema_def + + filtered_schema["components"]["schemas"] = filtered_schemas + + return filtered_schema + + def generate_openapi_spec(output_dir: str, format: str = "yaml", include_examples: bool = True) -> dict[str, Any]: """ Generate OpenAPI specification using FastAPI's built-in method. @@ -835,12 +1358,63 @@ def generate_openapi_spec(output_dir: str, format: str = "yaml", include_example servers=app.servers, ) + # Debug: Check if there's a root-level $defs in the original schema + if "$defs" in openapi_schema: + print(f"Original schema has root-level $defs with {len(openapi_schema['$defs'])} items") + else: + print("Original schema has no root-level $defs") + # Add Llama Stack specific extensions openapi_schema = _add_llama_stack_extensions(openapi_schema, app) # Add standard error responses openapi_schema = _add_error_responses(openapi_schema) + # Ensure all @json_schema_type decorated models are included + openapi_schema = _ensure_json_schema_types_included(openapi_schema) + + # Fix $ref references to point to components/schemas instead of $defs + openapi_schema = _fix_ref_references(openapi_schema) + + # Debug: Check if there are any $ref references to $defs in the schema + defs_refs = [] + + def find_defs_refs(obj: Any, path: str = "") -> None: + if isinstance(obj, dict): + if "$ref" in obj and obj["$ref"].startswith("#/$defs/"): + defs_refs.append(f"{path}: {obj['$ref']}") + for key, value in obj.items(): + find_defs_refs(value, f"{path}.{key}" if path else key) + elif isinstance(obj, list): + for i, item in enumerate(obj): + find_defs_refs(item, f"{path}[{i}]") + + find_defs_refs(openapi_schema) + if defs_refs: + print(f"Found {len(defs_refs)} $ref references to $defs in schema") + for ref in defs_refs[:5]: # Show first 5 + print(f" {ref}") + else: + print("No $ref references to $defs found in schema") + + # Note: Let Pydantic/FastAPI generate the correct, standards-compliant schema + # Fields with default values should be optional according to OpenAPI standards + + # Fix anyOf schemas with type: 'null' to avoid oasdiff errors + openapi_schema = _fix_anyof_with_null(openapi_schema) + + # Fix path parameter resolution issues + openapi_schema = _fix_path_parameters(openapi_schema) + + # Eliminate $defs section entirely for oasdiff compatibility + openapi_schema = _eliminate_defs_section(openapi_schema) + + # Debug: Check if there's a root-level $defs after flattening + if "$defs" in openapi_schema: + print(f"After flattening: root-level $defs with {len(openapi_schema['$defs'])} items") + else: + print("After flattening: no root-level $defs") + # Ensure all referenced schemas are included # DISABLED: This was using hardcoded schema generation. FastAPI should handle this automatically. # openapi_schema = _ensure_referenced_schemas(openapi_schema) @@ -853,7 +1427,7 @@ def generate_openapi_spec(output_dir: str, format: str = "yaml", include_example # DISABLED: This was a hardcoded workaround. Using Pydantic's TypeAdapter instead. # _fix_malformed_schemas(openapi_schema) - # Split into stable (v1 only), experimental (v1alpha + v1beta), and deprecated specs + # Split into stable (v1 only), experimental (v1alpha + v1beta), deprecated, and combined (stainless) specs # Each spec needs its own deep copy of the full schema to avoid cross-contamination import copy @@ -862,6 +1436,16 @@ def generate_openapi_spec(output_dir: str, format: str = "yaml", include_example copy.deepcopy(openapi_schema), stable_only=False, exclude_deprecated=True ) deprecated_schema = _filter_deprecated_schema(copy.deepcopy(openapi_schema)) + combined_schema = _filter_combined_schema(copy.deepcopy(openapi_schema)) + + # Update title and description for combined schema + if "info" in combined_schema: + combined_schema["info"]["title"] = "Llama Stack API - Stable & Experimental APIs" + combined_schema["info"]["description"] = ( + combined_schema["info"].get("description", "") + + "\n\n**🔗 COMBINED**: This specification includes both stable production-ready APIs and experimental pre-release APIs. " + "Use stable APIs for production deployments and experimental APIs for testing new features." + ) # Sort paths alphabetically for stable (v1 only) stable_schema = _sort_paths_alphabetically(stable_schema) @@ -869,11 +1453,24 @@ def generate_openapi_spec(output_dir: str, format: str = "yaml", include_example experimental_schema = _sort_paths_alphabetically(experimental_schema) # Sort paths by version prefix for deprecated deprecated_schema = _sort_paths_alphabetically(deprecated_schema) + # Sort paths by version prefix for combined (stainless) + combined_schema = _sort_paths_alphabetically(combined_schema) # Fix schema issues (like exclusiveMinimum -> minimum) for each spec stable_schema = _fix_schema_issues(stable_schema) experimental_schema = _fix_schema_issues(experimental_schema) deprecated_schema = _fix_schema_issues(deprecated_schema) + combined_schema = _fix_schema_issues(combined_schema) + + # Validate the schemas + print("\n🔍 Validating generated schemas...") + stable_valid = validate_openapi_schema(stable_schema, "Stable schema") + experimental_valid = validate_openapi_schema(experimental_schema, "Experimental schema") + deprecated_valid = validate_openapi_schema(deprecated_schema, "Deprecated schema") + combined_valid = validate_openapi_schema(combined_schema, "Combined (stainless) schema") + + if not all([stable_valid, experimental_valid, deprecated_valid, combined_valid]): + print("⚠️ Some schemas failed validation, but continuing with generation...") # Add any custom modifications here if needed if include_examples: @@ -887,8 +1484,60 @@ def generate_openapi_spec(output_dir: str, format: str = "yaml", include_example # Save the stable specification if format in ["yaml", "both"]: yaml_path = output_path / "llama-stack-spec.yaml" - with open(yaml_path, "w") as f: - yaml.dump(stable_schema, f, default_flow_style=False, sort_keys=False) + + # Use ruamel.yaml for better control over YAML serialization + try: + from ruamel.yaml import YAML + + yaml_writer = YAML() + yaml_writer.default_flow_style = False + yaml_writer.sort_keys = False + yaml_writer.width = 4096 # Prevent line wrapping + yaml_writer.allow_unicode = True + + with open(yaml_path, "w") as f: + yaml_writer.dump(stable_schema, f) + except ImportError: + # Fallback to standard yaml if ruamel.yaml is not available + with open(yaml_path, "w") as f: + yaml.dump(stable_schema, f, default_flow_style=False, sort_keys=False) + # Post-process the YAML file to remove $defs section and fix references + with open(yaml_path) as f: + yaml_content = f.read() + + if " $defs:" in yaml_content or "#/$defs/" in yaml_content: + print("Post-processing YAML to remove $defs section") + + # Use string replacement to fix references directly + if "#/$defs/" in yaml_content: + refs_fixed = yaml_content.count("#/$defs/") + yaml_content = yaml_content.replace("#/$defs/", "#/components/schemas/") + print(f"Fixed {refs_fixed} $ref references using string replacement") + + # Parse the YAML content + yaml_data = yaml.safe_load(yaml_content) + + # Move $defs to components/schemas if it exists + if "$defs" in yaml_data: + print(f"Found $defs section with {len(yaml_data['$defs'])} items") + if "components" not in yaml_data: + yaml_data["components"] = {} + if "schemas" not in yaml_data["components"]: + yaml_data["components"]["schemas"] = {} + + # Move all $defs to components/schemas + for def_name, def_schema in yaml_data["$defs"].items(): + yaml_data["components"]["schemas"][def_name] = def_schema + + # Remove the $defs section + del yaml_data["$defs"] + print("Moved $defs to components/schemas") + + # Write the modified YAML back + with open(yaml_path, "w") as f: + yaml.dump(yaml_data, f, default_flow_style=False, sort_keys=False) + print("Updated YAML file") + print(f"✅ Generated YAML (stable): {yaml_path}") experimental_yaml_path = output_path / "experimental-llama-stack-spec.yaml" @@ -901,6 +1550,25 @@ def generate_openapi_spec(output_dir: str, format: str = "yaml", include_example yaml.dump(deprecated_schema, f, default_flow_style=False, sort_keys=False) print(f"✅ Generated YAML (deprecated): {deprecated_yaml_path}") + # Generate combined (stainless) spec + stainless_yaml_path = output_path / "stainless-llama-stack-spec.yaml" + try: + from ruamel.yaml import YAML + + yaml_writer = YAML() + yaml_writer.default_flow_style = False + yaml_writer.sort_keys = False + yaml_writer.width = 4096 # Prevent line wrapping + yaml_writer.allow_unicode = True + + with open(stainless_yaml_path, "w") as f: + yaml_writer.dump(combined_schema, f) + except ImportError: + # Fallback to standard yaml if ruamel.yaml is not available + with open(stainless_yaml_path, "w") as f: + yaml.dump(combined_schema, f, default_flow_style=False, sort_keys=False) + print(f"✅ Generated YAML (stainless/combined): {stainless_yaml_path}") + if format in ["json", "both"]: json_path = output_path / "llama-stack-spec.json" with open(json_path, "w") as f: @@ -917,6 +1585,11 @@ def generate_openapi_spec(output_dir: str, format: str = "yaml", include_example json.dump(deprecated_schema, f, indent=2) print(f"✅ Generated JSON (deprecated): {deprecated_json_path}") + stainless_json_path = output_path / "stainless-llama-stack-spec.json" + with open(stainless_json_path, "w") as f: + json.dump(combined_schema, f, indent=2) + print(f"✅ Generated JSON (stainless/combined): {stainless_json_path}") + # Generate HTML documentation html_path = output_path / "llama-stack-spec.html" generate_html_docs(stable_schema, html_path) @@ -930,6 +1603,10 @@ def generate_openapi_spec(output_dir: str, format: str = "yaml", include_example generate_html_docs(deprecated_schema, deprecated_html_path, spec_file="deprecated-llama-stack-spec.yaml") print(f"✅ Generated HTML (deprecated): {deprecated_html_path}") + stainless_html_path = output_path / "stainless-llama-stack-spec.html" + generate_html_docs(combined_schema, stainless_html_path, spec_file="stainless-llama-stack-spec.yaml") + print(f"✅ Generated HTML (stainless/combined): {stainless_html_path}") + return stable_schema @@ -968,9 +1645,55 @@ def main(): parser.add_argument("output_dir", help="Output directory for generated files") parser.add_argument("--format", choices=["yaml", "json", "both"], default="yaml", help="Output format") parser.add_argument("--no-examples", action="store_true", help="Exclude examples from the specification") + parser.add_argument( + "--validate-only", action="store_true", help="Only validate existing schema files, don't generate new ones" + ) + parser.add_argument("--validate-file", help="Validate a specific schema file") args = parser.parse_args() + # Handle validation-only mode + if args.validate_only or args.validate_file: + if args.validate_file: + # Validate a specific file + file_path = Path(args.validate_file) + if not file_path.exists(): + print(f"❌ File not found: {file_path}") + return 1 + + print(f"🔍 Validating {file_path}...") + is_valid = validate_schema_file(file_path) + return 0 if is_valid else 1 + else: + # Validate all schema files in output directory + output_path = Path(args.output_dir) + if not output_path.exists(): + print(f"❌ Output directory not found: {output_path}") + return 1 + + print(f"🔍 Validating all schema files in {output_path}...") + schema_files = ( + list(output_path.glob("*.yaml")) + list(output_path.glob("*.yml")) + list(output_path.glob("*.json")) + ) + + if not schema_files: + print("❌ No schema files found to validate") + return 1 + + all_valid = True + for schema_file in schema_files: + print(f"\n📄 Validating {schema_file.name}...") + is_valid = validate_schema_file(schema_file) + if not is_valid: + all_valid = False + + if all_valid: + print("\n✅ All schema files are valid!") + return 0 + else: + print("\n❌ Some schema files failed validation") + return 1 + print("🚀 Generating OpenAPI specification using FastAPI...") print(f"📁 Output directory: {args.output_dir}") print(f"📄 Format: {args.format}") diff --git a/scripts/run_openapi_generator.sh b/scripts/run_openapi_generator.sh new file mode 100755 index 0000000000..c6c61453df --- /dev/null +++ b/scripts/run_openapi_generator.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +PYTHONPATH=${PYTHONPATH:-} +THIS_DIR="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" + +set -euo pipefail + + +stack_dir=$(dirname "$THIS_DIR") +PYTHONPATH=$PYTHONPATH:$stack_dir \ + python3 -m scripts.fastapi_generator "$stack_dir"/docs/static + +cp "$stack_dir"/docs/static/stainless-llama-stack-spec.yaml "$stack_dir"/client-sdks/stainless/openapi.yml diff --git a/scripts/validate_openapi.py b/scripts/validate_openapi.py new file mode 100755 index 0000000000..ddc88f0f8d --- /dev/null +++ b/scripts/validate_openapi.py @@ -0,0 +1,290 @@ +#!/usr/bin/env python3 +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +""" +OpenAPI Schema Validator for Llama Stack. + +This script provides comprehensive validation of OpenAPI specifications +using multiple validation tools and approaches. +""" + +import argparse +import json +import sys +from pathlib import Path +from typing import Any + +import yaml +from openapi_spec_validator import validate_spec +from openapi_spec_validator.exceptions import OpenAPISpecValidatorError + + +def validate_openapi_schema(schema: dict[str, Any], schema_name: str = "OpenAPI schema") -> bool: + """ + Validate an OpenAPI schema using openapi-spec-validator. + + Args: + schema: The OpenAPI schema dictionary to validate + schema_name: Name of the schema for error reporting + + Returns: + True if valid, False otherwise + """ + try: + validate_spec(schema) + print(f"✅ {schema_name} is valid") + return True + except OpenAPISpecValidatorError as e: + print(f"❌ {schema_name} validation failed:") + print(f" {e}") + return False + except Exception as e: + print(f"❌ {schema_name} validation error: {e}") + return False + + +def validate_schema_file(file_path: Path) -> bool: + """ + Validate an OpenAPI schema file (YAML or JSON). + + Args: + file_path: Path to the schema file + + Returns: + True if valid, False otherwise + """ + try: + with open(file_path) as f: + if file_path.suffix.lower() in [".yaml", ".yml"]: + schema = yaml.safe_load(f) + elif file_path.suffix.lower() == ".json": + schema = json.load(f) + else: + print(f"❌ Unsupported file format: {file_path.suffix}") + return False + + return validate_openapi_schema(schema, str(file_path)) + except Exception as e: + print(f"❌ Failed to read {file_path}: {e}") + return False + + +def validate_directory(directory: Path, pattern: str = "*.yaml") -> bool: + """ + Validate all OpenAPI schema files in a directory. + + Args: + directory: Directory containing schema files + pattern: Glob pattern to match schema files + + Returns: + True if all files are valid, False otherwise + """ + if not directory.exists(): + print(f"❌ Directory not found: {directory}") + return False + + schema_files = list(directory.glob(pattern)) + list(directory.glob("*.yml")) + list(directory.glob("*.json")) + + if not schema_files: + print(f"❌ No schema files found in {directory}") + return False + + print(f"🔍 Found {len(schema_files)} schema files to validate") + + all_valid = True + for schema_file in schema_files: + print(f"\n📄 Validating {schema_file.name}...") + is_valid = validate_schema_file(schema_file) + if not is_valid: + all_valid = False + + return all_valid + + +def get_schema_stats(schema: dict[str, Any]) -> dict[str, int]: + """ + Get statistics about an OpenAPI schema. + + Args: + schema: The OpenAPI schema dictionary + + Returns: + Dictionary with schema statistics + """ + stats = { + "paths": len(schema.get("paths", {})), + "schemas": len(schema.get("components", {}).get("schemas", {})), + "operations": 0, + "parameters": 0, + "responses": 0, + } + + # Count operations + for path_info in schema.get("paths", {}).values(): + for method in ["get", "post", "put", "delete", "patch", "head", "options"]: + if method in path_info: + stats["operations"] += 1 + + operation = path_info[method] + if "parameters" in operation: + stats["parameters"] += len(operation["parameters"]) + if "responses" in operation: + stats["responses"] += len(operation["responses"]) + + return stats + + +def print_schema_stats(schema: dict[str, Any], schema_name: str = "Schema") -> None: + """ + Print statistics about an OpenAPI schema. + + Args: + schema: The OpenAPI schema dictionary + schema_name: Name of the schema for display + """ + stats = get_schema_stats(schema) + + print(f"\n📊 {schema_name} Statistics:") + print(f" 🛣️ Paths: {stats['paths']}") + print(f" 📋 Schemas: {stats['schemas']}") + print(f" 🔧 Operations: {stats['operations']}") + print(f" 📝 Parameters: {stats['parameters']}") + print(f" 📤 Responses: {stats['responses']}") + + +def main(): + """Main entry point for the OpenAPI validator.""" + parser = argparse.ArgumentParser( + description="Validate OpenAPI specifications", + formatter_class=argparse.RawDescriptionHelpFormatter, + epilog=""" +Examples: + # Validate a specific file + python validate_openapi.py docs/static/llama-stack-spec.yaml + + # Validate all YAML files in a directory + python validate_openapi.py docs/static/ + + # Validate with detailed statistics + python validate_openapi.py docs/static/llama-stack-spec.yaml --stats + + # Validate and show only errors + python validate_openapi.py docs/static/ --quiet + """, + ) + + parser.add_argument("path", help="Path to schema file or directory containing schema files") + parser.add_argument("--stats", action="store_true", help="Show detailed schema statistics") + parser.add_argument("--quiet", action="store_true", help="Only show errors, suppress success messages") + parser.add_argument("--pattern", default="*.yaml", help="Glob pattern for schema files (default: *.yaml)") + + args = parser.parse_args() + + path = Path(args.path) + + if not path.exists(): + print(f"❌ Path not found: {path}") + return 1 + + if path.is_file(): + # Validate a single file + if args.quiet: + # Override the validation function to be quiet + def quiet_validate(schema, name): + try: + validate_spec(schema) + return True + except Exception as e: + print(f"❌ {name}: {e}") + return False + + try: + with open(path) as f: + if path.suffix.lower() in [".yaml", ".yml"]: + schema = yaml.safe_load(f) + elif path.suffix.lower() == ".json": + schema = json.load(f) + else: + print(f"❌ Unsupported file format: {path.suffix}") + return 1 + + is_valid = quiet_validate(schema, str(path)) + if is_valid and args.stats: + print_schema_stats(schema, path.name) + return 0 if is_valid else 1 + except Exception as e: + print(f"❌ Failed to read {path}: {e}") + return 1 + else: + is_valid = validate_schema_file(path) + if is_valid and args.stats: + try: + with open(path) as f: + if path.suffix.lower() in [".yaml", ".yml"]: + schema = yaml.safe_load(f) + elif path.suffix.lower() == ".json": + schema = json.load(f) + else: + return 1 + print_schema_stats(schema, path.name) + except Exception: + pass + return 0 if is_valid else 1 + + elif path.is_dir(): + # Validate all files in directory + if args.quiet: + all_valid = True + schema_files = list(path.glob(args.pattern)) + list(path.glob("*.yml")) + list(path.glob("*.json")) + + for schema_file in schema_files: + try: + with open(schema_file) as f: + if schema_file.suffix.lower() in [".yaml", ".yml"]: + schema = yaml.safe_load(f) + elif schema_file.suffix.lower() == ".json": + schema = json.load(f) + else: + continue + + try: + validate_spec(schema) + except Exception as e: + print(f"❌ {schema_file.name}: {e}") + all_valid = False + except Exception as e: + print(f"❌ Failed to read {schema_file.name}: {e}") + all_valid = False + + return 0 if all_valid else 1 + else: + all_valid = validate_directory(path, args.pattern) + if all_valid and args.stats: + # Show stats for all files + schema_files = list(path.glob(args.pattern)) + list(path.glob("*.yml")) + list(path.glob("*.json")) + for schema_file in schema_files: + try: + with open(schema_file) as f: + if schema_file.suffix.lower() in [".yaml", ".yml"]: + schema = yaml.safe_load(f) + elif schema_file.suffix.lower() == ".json": + schema = json.load(f) + else: + continue + print_schema_stats(schema, schema_file.name) + except Exception: + continue + return 0 if all_valid else 1 + + else: + print(f"❌ Invalid path type: {path}") + return 1 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/src/llama_stack/apis/agents/openai_responses.py b/src/llama_stack/apis/agents/openai_responses.py index 69e2b2012c..3febbb733d 100644 --- a/src/llama_stack/apis/agents/openai_responses.py +++ b/src/llama_stack/apis/agents/openai_responses.py @@ -1309,6 +1309,7 @@ class OpenAIResponseInputFunctionToolCallOutput(BaseModel): register_schema(OpenAIResponseInput, name="OpenAIResponseInput") +@json_schema_type class ListOpenAIResponseInputItem(BaseModel): """List container for OpenAI response input items. diff --git a/src/llama_stack/apis/tools/tools.py b/src/llama_stack/apis/tools/tools.py index b13ac2f197..39706d2cbc 100644 --- a/src/llama_stack/apis/tools/tools.py +++ b/src/llama_stack/apis/tools/tools.py @@ -99,6 +99,7 @@ class ListToolGroupsResponse(BaseModel): data: list[ToolGroup] +@json_schema_type class ListToolDefsResponse(BaseModel): """Response containing a list of tool definitions. diff --git a/uv.lock b/uv.lock index 32e2e42192..311c8fb026 100644 --- a/uv.lock +++ b/uv.lock @@ -1824,6 +1824,21 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/fe/54/c86cd8e011fe98803d7e382fd67c0df5ceab8d2b7ad8c5a81524f791551c/jsonschema-4.25.0-py3-none-any.whl", hash = "sha256:24c2e8da302de79c8b9382fee3e76b355e44d2a4364bb207159ce10b517bd716", size = 89184, upload-time = "2025-07-18T15:39:42.956Z" }, ] +[[package]] +name = "jsonschema-path" +version = "0.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pathable" }, + { name = "pyyaml" }, + { name = "referencing" }, + { name = "requests" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/6e/45/41ebc679c2a4fced6a722f624c18d658dee42612b83ea24c1caf7c0eb3a8/jsonschema_path-0.3.4.tar.gz", hash = "sha256:8365356039f16cc65fddffafda5f58766e34bebab7d6d105616ab52bc4297001", size = 11159, upload-time = "2025-01-24T14:33:16.547Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/58/3485da8cb93d2f393bce453adeef16896751f14ba3e2024bc21dc9597646/jsonschema_path-0.3.4-py3-none-any.whl", hash = "sha256:f502191fdc2b22050f9a81c9237be9d27145b9001c55842bece5e94e382e52f8", size = 14810, upload-time = "2025-01-24T14:33:14.652Z" }, +] + [[package]] name = "jsonschema-specifications" version = "2025.4.1" @@ -1903,6 +1918,38 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/89/43/d9bebfc3db7dea6ec80df5cb2aad8d274dd18ec2edd6c4f21f32c237cbbb/kubernetes-33.1.0-py2.py3-none-any.whl", hash = "sha256:544de42b24b64287f7e0aa9513c93cb503f7f40eea39b20f66810011a86eabc5", size = 1941335, upload-time = "2025-06-09T21:57:56.327Z" }, ] +[[package]] +name = "lazy-object-proxy" +version = "1.12.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/08/a2/69df9c6ba6d316cfd81fe2381e464db3e6de5db45f8c43c6a23504abf8cb/lazy_object_proxy-1.12.0.tar.gz", hash = "sha256:1f5a462d92fd0cfb82f1fab28b51bfb209fabbe6aabf7f0d51472c0c124c0c61", size = 43681, upload-time = "2025-08-22T13:50:06.783Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0d/1b/b5f5bd6bda26f1e15cd3232b223892e4498e34ec70a7f4f11c401ac969f1/lazy_object_proxy-1.12.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8ee0d6027b760a11cc18281e702c0309dd92da458a74b4c15025d7fc490deede", size = 26746, upload-time = "2025-08-22T13:42:37.572Z" }, + { url = "https://files.pythonhosted.org/packages/55/64/314889b618075c2bfc19293ffa9153ce880ac6153aacfd0a52fcabf21a66/lazy_object_proxy-1.12.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:4ab2c584e3cc8be0dfca422e05ad30a9abe3555ce63e9ab7a559f62f8dbc6ff9", size = 71457, upload-time = "2025-08-22T13:42:38.743Z" }, + { url = "https://files.pythonhosted.org/packages/11/53/857fc2827fc1e13fbdfc0ba2629a7d2579645a06192d5461809540b78913/lazy_object_proxy-1.12.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:14e348185adbd03ec17d051e169ec45686dcd840a3779c9d4c10aabe2ca6e1c0", size = 71036, upload-time = "2025-08-22T13:42:40.184Z" }, + { url = "https://files.pythonhosted.org/packages/2b/24/e581ffed864cd33c1b445b5763d617448ebb880f48675fc9de0471a95cbc/lazy_object_proxy-1.12.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:c4fcbe74fb85df8ba7825fa05eddca764138da752904b378f0ae5ab33a36c308", size = 69329, upload-time = "2025-08-22T13:42:41.311Z" }, + { url = "https://files.pythonhosted.org/packages/78/be/15f8f5a0b0b2e668e756a152257d26370132c97f2f1943329b08f057eff0/lazy_object_proxy-1.12.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:563d2ec8e4d4b68ee7848c5ab4d6057a6d703cb7963b342968bb8758dda33a23", size = 70690, upload-time = "2025-08-22T13:42:42.51Z" }, + { url = "https://files.pythonhosted.org/packages/5d/aa/f02be9bbfb270e13ee608c2b28b8771f20a5f64356c6d9317b20043c6129/lazy_object_proxy-1.12.0-cp312-cp312-win_amd64.whl", hash = "sha256:53c7fd99eb156bbb82cbc5d5188891d8fdd805ba6c1e3b92b90092da2a837073", size = 26563, upload-time = "2025-08-22T13:42:43.685Z" }, + { url = "https://files.pythonhosted.org/packages/f4/26/b74c791008841f8ad896c7f293415136c66cc27e7c7577de4ee68040c110/lazy_object_proxy-1.12.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:86fd61cb2ba249b9f436d789d1356deae69ad3231dc3c0f17293ac535162672e", size = 26745, upload-time = "2025-08-22T13:42:44.982Z" }, + { url = "https://files.pythonhosted.org/packages/9b/52/641870d309e5d1fb1ea7d462a818ca727e43bfa431d8c34b173eb090348c/lazy_object_proxy-1.12.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:81d1852fb30fab81696f93db1b1e55a5d1ff7940838191062f5f56987d5fcc3e", size = 71537, upload-time = "2025-08-22T13:42:46.141Z" }, + { url = "https://files.pythonhosted.org/packages/47/b6/919118e99d51c5e76e8bf5a27df406884921c0acf2c7b8a3b38d847ab3e9/lazy_object_proxy-1.12.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be9045646d83f6c2664c1330904b245ae2371b5c57a3195e4028aedc9f999655", size = 71141, upload-time = "2025-08-22T13:42:47.375Z" }, + { url = "https://files.pythonhosted.org/packages/e5/47/1d20e626567b41de085cf4d4fb3661a56c159feaa73c825917b3b4d4f806/lazy_object_proxy-1.12.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:67f07ab742f1adfb3966c40f630baaa7902be4222a17941f3d85fd1dae5565ff", size = 69449, upload-time = "2025-08-22T13:42:48.49Z" }, + { url = "https://files.pythonhosted.org/packages/58/8d/25c20ff1a1a8426d9af2d0b6f29f6388005fc8cd10d6ee71f48bff86fdd0/lazy_object_proxy-1.12.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:75ba769017b944fcacbf6a80c18b2761a1795b03f8899acdad1f1c39db4409be", size = 70744, upload-time = "2025-08-22T13:42:49.608Z" }, + { url = "https://files.pythonhosted.org/packages/c0/67/8ec9abe15c4f8a4bcc6e65160a2c667240d025cbb6591b879bea55625263/lazy_object_proxy-1.12.0-cp313-cp313-win_amd64.whl", hash = "sha256:7b22c2bbfb155706b928ac4d74c1a63ac8552a55ba7fff4445155523ea4067e1", size = 26568, upload-time = "2025-08-22T13:42:57.719Z" }, + { url = "https://files.pythonhosted.org/packages/23/12/cd2235463f3469fd6c62d41d92b7f120e8134f76e52421413a0ad16d493e/lazy_object_proxy-1.12.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:4a79b909aa16bde8ae606f06e6bbc9d3219d2e57fb3e0076e17879072b742c65", size = 27391, upload-time = "2025-08-22T13:42:50.62Z" }, + { url = "https://files.pythonhosted.org/packages/60/9e/f1c53e39bbebad2e8609c67d0830cc275f694d0ea23d78e8f6db526c12d3/lazy_object_proxy-1.12.0-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:338ab2f132276203e404951205fe80c3fd59429b3a724e7b662b2eb539bb1be9", size = 80552, upload-time = "2025-08-22T13:42:51.731Z" }, + { url = "https://files.pythonhosted.org/packages/4c/b6/6c513693448dcb317d9d8c91d91f47addc09553613379e504435b4cc8b3e/lazy_object_proxy-1.12.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8c40b3c9faee2e32bfce0df4ae63f4e73529766893258eca78548bac801c8f66", size = 82857, upload-time = "2025-08-22T13:42:53.225Z" }, + { url = "https://files.pythonhosted.org/packages/12/1c/d9c4aaa4c75da11eb7c22c43d7c90a53b4fca0e27784a5ab207768debea7/lazy_object_proxy-1.12.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:717484c309df78cedf48396e420fa57fc8a2b1f06ea889df7248fdd156e58847", size = 80833, upload-time = "2025-08-22T13:42:54.391Z" }, + { url = "https://files.pythonhosted.org/packages/0b/ae/29117275aac7d7d78ae4f5a4787f36ff33262499d486ac0bf3e0b97889f6/lazy_object_proxy-1.12.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:a6b7ea5ea1ffe15059eb44bcbcb258f97bcb40e139b88152c40d07b1a1dfc9ac", size = 79516, upload-time = "2025-08-22T13:42:55.812Z" }, + { url = "https://files.pythonhosted.org/packages/19/40/b4e48b2c38c69392ae702ae7afa7b6551e0ca5d38263198b7c79de8b3bdf/lazy_object_proxy-1.12.0-cp313-cp313t-win_amd64.whl", hash = "sha256:08c465fb5cd23527512f9bd7b4c7ba6cec33e28aad36fbbe46bf7b858f9f3f7f", size = 27656, upload-time = "2025-08-22T13:42:56.793Z" }, + { url = "https://files.pythonhosted.org/packages/ef/3a/277857b51ae419a1574557c0b12e0d06bf327b758ba94cafc664cb1e2f66/lazy_object_proxy-1.12.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c9defba70ab943f1df98a656247966d7729da2fe9c2d5d85346464bf320820a3", size = 26582, upload-time = "2025-08-22T13:49:49.366Z" }, + { url = "https://files.pythonhosted.org/packages/1a/b6/c5e0fa43535bb9c87880e0ba037cdb1c50e01850b0831e80eb4f4762f270/lazy_object_proxy-1.12.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:6763941dbf97eea6b90f5b06eb4da9418cc088fce0e3883f5816090f9afcde4a", size = 71059, upload-time = "2025-08-22T13:49:50.488Z" }, + { url = "https://files.pythonhosted.org/packages/06/8a/7dcad19c685963c652624702f1a968ff10220b16bfcc442257038216bf55/lazy_object_proxy-1.12.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:fdc70d81235fc586b9e3d1aeef7d1553259b62ecaae9db2167a5d2550dcc391a", size = 71034, upload-time = "2025-08-22T13:49:54.224Z" }, + { url = "https://files.pythonhosted.org/packages/12/ac/34cbfb433a10e28c7fd830f91c5a348462ba748413cbb950c7f259e67aa7/lazy_object_proxy-1.12.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:0a83c6f7a6b2bfc11ef3ed67f8cbe99f8ff500b05655d8e7df9aab993a6abc95", size = 69529, upload-time = "2025-08-22T13:49:55.29Z" }, + { url = "https://files.pythonhosted.org/packages/6f/6a/11ad7e349307c3ca4c0175db7a77d60ce42a41c60bcb11800aabd6a8acb8/lazy_object_proxy-1.12.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:256262384ebd2a77b023ad02fbcc9326282bcfd16484d5531154b02bc304f4c5", size = 70391, upload-time = "2025-08-22T13:49:56.35Z" }, + { url = "https://files.pythonhosted.org/packages/59/97/9b410ed8fbc6e79c1ee8b13f8777a80137d4bc189caf2c6202358e66192c/lazy_object_proxy-1.12.0-cp314-cp314-win_amd64.whl", hash = "sha256:7601ec171c7e8584f8ff3f4e440aa2eebf93e854f04639263875b8c2971f819f", size = 26988, upload-time = "2025-08-22T13:49:57.302Z" }, +] + [[package]] name = "linkify" version = "1.4" @@ -1985,6 +2032,7 @@ dev = [ { name = "black" }, { name = "mypy" }, { name = "nbval" }, + { name = "openapi-spec-validator" }, { name = "pre-commit" }, { name = "pytest" }, { name = "pytest-asyncio" }, @@ -2132,6 +2180,7 @@ dev = [ { name = "black" }, { name = "mypy" }, { name = "nbval" }, + { name = "openapi-spec-validator", specifier = ">=0.7.2" }, { name = "pre-commit" }, { name = "pytest", specifier = ">=8.4" }, { name = "pytest-asyncio", specifier = ">=1.0" }, @@ -2985,6 +3034,35 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/14/f3/ebbd700d8dc1e6380a7a382969d96bc0cbea8717b52fb38ff0ca2a7653e8/openai-2.5.0-py3-none-any.whl", hash = "sha256:21380e5f52a71666dbadbf322dd518bdf2b9d11ed0bb3f96bea17310302d6280", size = 999851, upload-time = "2025-10-17T18:14:45.528Z" }, ] +[[package]] +name = "openapi-schema-validator" +version = "0.6.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "jsonschema" }, + { name = "jsonschema-specifications" }, + { name = "rfc3339-validator" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/8b/f3/5507ad3325169347cd8ced61c232ff3df70e2b250c49f0fe140edb4973c6/openapi_schema_validator-0.6.3.tar.gz", hash = "sha256:f37bace4fc2a5d96692f4f8b31dc0f8d7400fd04f3a937798eaf880d425de6ee", size = 11550, upload-time = "2025-01-10T18:08:22.268Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/21/c6/ad0fba32775ae749016829dace42ed80f4407b171da41313d1a3a5f102e4/openapi_schema_validator-0.6.3-py3-none-any.whl", hash = "sha256:f3b9870f4e556b5a62a1c39da72a6b4b16f3ad9c73dc80084b1b11e74ba148a3", size = 8755, upload-time = "2025-01-10T18:08:19.758Z" }, +] + +[[package]] +name = "openapi-spec-validator" +version = "0.7.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "jsonschema" }, + { name = "jsonschema-path" }, + { name = "lazy-object-proxy" }, + { name = "openapi-schema-validator" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/82/af/fe2d7618d6eae6fb3a82766a44ed87cd8d6d82b4564ed1c7cfb0f6378e91/openapi_spec_validator-0.7.2.tar.gz", hash = "sha256:cc029309b5c5dbc7859df0372d55e9d1ff43e96d678b9ba087f7c56fc586f734", size = 36855, upload-time = "2025-06-07T14:48:56.299Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/27/dd/b3fd642260cb17532f66cc1e8250f3507d1e580483e209dc1e9d13bd980d/openapi_spec_validator-0.7.2-py3-none-any.whl", hash = "sha256:4bbdc0894ec85f1d1bea1d6d9c8b2c3c8d7ccaa13577ef40da9c006c9fd0eb60", size = 39713, upload-time = "2025-06-07T14:48:54.077Z" }, +] + [[package]] name = "opentelemetry-api" version = "1.36.0" @@ -3221,6 +3299,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c6/ac/dac4a63f978e4dcb3c6d3a78c4d8e0192a113d288502a1216950c41b1027/parso-0.8.4-py2.py3-none-any.whl", hash = "sha256:a418670a20291dacd2dddc80c377c5c3791378ee1e8d12bffc35420643d43f18", size = 103650, upload-time = "2024-04-05T09:43:53.299Z" }, ] +[[package]] +name = "pathable" +version = "0.4.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/67/93/8f2c2075b180c12c1e9f6a09d1a985bc2036906b13dff1d8917e395f2048/pathable-0.4.4.tar.gz", hash = "sha256:6905a3cd17804edfac7875b5f6c9142a218c7caef78693c2dbbbfbac186d88b2", size = 8124, upload-time = "2025-01-10T18:43:13.247Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7d/eb/b6260b31b1a96386c0a880edebe26f89669098acea8e0318bff6adb378fd/pathable-0.4.4-py3-none-any.whl", hash = "sha256:5ae9e94793b6ef5a4cbe0a7ce9dbbefc1eec38df253763fd0aeeacf2762dbbc2", size = 9592, upload-time = "2025-01-10T18:43:11.88Z" }, +] + [[package]] name = "pathspec" version = "0.12.1" @@ -4378,6 +4465,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/1c/4c/cc276ce57e572c102d9542d383b2cfd551276581dc60004cb94fe8774c11/responses-0.25.8-py3-none-any.whl", hash = "sha256:0c710af92def29c8352ceadff0c3fe340ace27cf5af1bbe46fb71275bcd2831c", size = 34769, upload-time = "2025-08-08T19:01:45.018Z" }, ] +[[package]] +name = "rfc3339-validator" +version = "0.1.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "six" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/28/ea/a9387748e2d111c3c2b275ba970b735e04e15cdb1eb30693b6b5708c4dbd/rfc3339_validator-0.1.4.tar.gz", hash = "sha256:138a2abdf93304ad60530167e51d2dfb9549521a836871b88d7f4695d0022f6b", size = 5513, upload-time = "2021-05-12T16:37:54.178Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7b/44/4e421b96b67b2daff264473f7465db72fbdf36a07e05494f50300cc7b0c6/rfc3339_validator-0.1.4-py2.py3-none-any.whl", hash = "sha256:24f6ec1eda14ef823da9e36ec7113124b39c04d50a4d3d3a3c2859577e7791fa", size = 3490, upload-time = "2021-05-12T16:37:52.536Z" }, +] + [[package]] name = "rich" version = "14.1.0" From 357be98279e1f2dcb06e09b736a0dc9f91094d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Fri, 31 Oct 2025 12:03:39 +0100 Subject: [PATCH 4/6] wip2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sébastien Han --- client-sdks/stainless/openapi.yml | 916 +- docs/static/deprecated-llama-stack-spec.json | 18640 ++++++++++++++++ docs/static/deprecated-llama-stack-spec.yaml | 4 +- .../static/experimental-llama-stack-spec.json | 5135 +++++ .../static/experimental-llama-stack-spec.yaml | 891 +- docs/static/llama-stack-spec.json | 11541 ++++++++++ docs/static/llama-stack-spec.yaml | 2056 +- docs/static/stainless-llama-stack-spec.json | 16303 ++++++++++++++ docs/static/stainless-llama-stack-spec.yaml | 916 +- scripts/fastapi_generator.py | 313 +- 10 files changed, 53406 insertions(+), 3309 deletions(-) create mode 100644 docs/static/deprecated-llama-stack-spec.json create mode 100644 docs/static/experimental-llama-stack-spec.json create mode 100644 docs/static/llama-stack-spec.json create mode 100644 docs/static/stainless-llama-stack-spec.json diff --git a/client-sdks/stainless/openapi.yml b/client-sdks/stainless/openapi.yml index 118a887d6f..22f8d3d5d9 100644 --- a/client-sdks/stainless/openapi.yml +++ b/client-sdks/stainless/openapi.yml @@ -3476,7 +3476,7 @@ paths: post: tags: - V1Beta - summary: Append Rows + summary: Append rows to a dataset. description: Generic endpoint - this would be replaced with actual implementation. operationId: append_rows_v1beta_datasetio_append_rows__dataset_id__post parameters: @@ -3518,16 +3518,10 @@ paths: get: tags: - V1Beta - summary: Iterrows + summary: Get a paginated list of rows from a dataset. description: Query endpoint for proper schema generation. operationId: iterrows_v1beta_datasetio_iterrows__dataset_id__get parameters: - - name: dataset_id - in: path - required: true - schema: - type: string - title: Dataset Id - name: limit in: query required: true @@ -3540,6 +3534,12 @@ paths: schema: type: integer title: Start Index + - name: dataset_id + in: path + required: true + schema: + type: string + title: Dataset Id responses: '200': description: A PaginatedResponse. @@ -3563,7 +3563,7 @@ paths: get: tags: - V1Beta - summary: List Datasets + summary: List all datasets. description: Response-only endpoint for proper schema generation. operationId: list_datasets_v1beta_datasets_get responses: @@ -3588,7 +3588,7 @@ paths: post: tags: - V1Beta - summary: Register Dataset + summary: Register a new dataset. description: Typed endpoint for proper schema generation. operationId: register_dataset_v1beta_datasets_post requestBody: @@ -3620,7 +3620,7 @@ paths: delete: tags: - V1Beta - summary: Unregister Dataset + summary: Unregister a dataset by its ID. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_dataset_v1beta_datasets__dataset_id__delete parameters: @@ -3661,7 +3661,7 @@ paths: get: tags: - V1Beta - summary: Get Dataset + summary: Get a dataset by its ID. description: Query endpoint for proper schema generation. operationId: get_dataset_v1beta_datasets__dataset_id__get parameters: @@ -3694,7 +3694,7 @@ paths: get: tags: - V1Alpha - summary: List Agents + summary: List all agents. description: Query endpoint for proper schema generation. operationId: list_agents_v1alpha_agents_get parameters: @@ -3732,7 +3732,7 @@ paths: post: tags: - V1Alpha - summary: Create Agent + summary: Create an agent with the given configuration. description: Typed endpoint for proper schema generation. operationId: create_agent_v1alpha_agents_post requestBody: @@ -3764,7 +3764,7 @@ paths: delete: tags: - V1Alpha - summary: Delete Agent + summary: Delete an agent by its ID and its associated sessions and turns. description: Generic endpoint - this would be replaced with actual implementation. operationId: delete_agent_v1alpha_agents__agent_id__delete parameters: @@ -3783,7 +3783,7 @@ paths: required: true schema: type: string - description: 'Path parameter: agent_id' + description: The ID of the agent to delete. responses: '200': description: Successful Response @@ -3805,7 +3805,7 @@ paths: get: tags: - V1Alpha - summary: Get Agent + summary: Describe an agent by its ID. description: Query endpoint for proper schema generation. operationId: get_agent_v1alpha_agents__agent_id__get parameters: @@ -3815,6 +3815,7 @@ paths: schema: type: string title: Agent Id + description: ID of the agent. responses: '200': description: An Agent of the agent. @@ -3838,7 +3839,7 @@ paths: post: tags: - V1Alpha - summary: Create Agent Session + summary: Create a new session for an agent. description: Typed endpoint for proper schema generation. operationId: create_agent_session_v1alpha_agents__agent_id__session_post requestBody: @@ -3872,12 +3873,12 @@ paths: required: true schema: type: string - description: 'Path parameter: agent_id' + description: The ID of the agent to create the session for. /v1alpha/agents/{agent_id}/session/{session_id}: delete: tags: - V1Alpha - summary: Delete Agents Session + summary: Delete an agent session by its ID and its associated turns. description: Generic endpoint - this would be replaced with actual implementation. operationId: delete_agents_session_v1alpha_agents__agent_id__session__session_id__delete parameters: @@ -3891,18 +3892,18 @@ paths: required: true schema: title: Kwargs - - name: agent_id + - name: session_id in: path required: true schema: type: string - description: 'Path parameter: agent_id' - - name: session_id + description: The ID of the session to delete. + - name: agent_id in: path required: true schema: type: string - description: 'Path parameter: session_id' + description: The ID of the agent to delete the session for. responses: '200': description: Successful Response @@ -3924,28 +3925,30 @@ paths: get: tags: - V1Alpha - summary: Get Agents Session + summary: Retrieve an agent session by its ID. description: Query endpoint for proper schema generation. operationId: get_agents_session_v1alpha_agents__agent_id__session__session_id__get parameters: - - name: agent_id - in: path + - name: turn_ids + in: query required: true schema: type: string - title: Agent Id + title: Turn Ids - name: session_id in: path required: true schema: type: string title: Session Id - - name: turn_ids - in: query + description: The ID of the session to get. + - name: agent_id + in: path required: true schema: type: string - title: Turn Ids + title: Agent Id + description: The ID of the agent to get the session for. responses: '200': description: A Session. @@ -3969,7 +3972,7 @@ paths: post: tags: - V1Alpha - summary: Create Agent Turn + summary: Create a new turn for an agent. description: Typed endpoint for proper schema generation. operationId: create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post requestBody: @@ -4003,18 +4006,18 @@ paths: required: true schema: type: string - description: 'Path parameter: agent_id' + description: The ID of the agent to create the turn for. - name: session_id in: path required: true schema: type: string - description: 'Path parameter: session_id' + description: The ID of the session to create the turn for. /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}: get: tags: - V1Alpha - summary: Get Agents Turn + summary: Retrieve an agent turn by its ID. description: Query endpoint for proper schema generation. operationId: get_agents_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__get parameters: @@ -4024,18 +4027,21 @@ paths: schema: type: string title: Agent Id + description: The ID of the agent to get the turn for. - name: session_id in: path required: true schema: type: string title: Session Id + description: The ID of the session to get the turn for. - name: turn_id in: path required: true schema: type: string title: Turn Id + description: The ID of the turn to get. responses: '200': description: A Turn. @@ -4059,7 +4065,7 @@ paths: post: tags: - V1Alpha - summary: Resume Agent Turn + summary: Resume an agent turn with executed tool call responses. description: Typed endpoint for proper schema generation. operationId: resume_agent_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__resume_post requestBody: @@ -4093,24 +4099,24 @@ paths: required: true schema: type: string - description: 'Path parameter: agent_id' + description: The ID of the agent to resume. - name: session_id in: path required: true schema: type: string - description: 'Path parameter: session_id' + description: The ID of the session to resume. - name: turn_id in: path required: true schema: type: string - description: 'Path parameter: turn_id' + description: The ID of the turn to resume. /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}: get: tags: - V1Alpha - summary: Get Agents Step + summary: Retrieve an agent step by its ID. description: Query endpoint for proper schema generation. operationId: get_agents_step_v1alpha_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get parameters: @@ -4120,24 +4126,28 @@ paths: schema: type: string title: Agent Id + description: The ID of the agent to get the step for. - name: session_id in: path required: true schema: type: string title: Session Id - - name: step_id + description: The ID of the session to get the step for. + - name: turn_id in: path required: true schema: type: string - title: Step Id - - name: turn_id + title: Turn Id + description: The ID of the turn to get the step for. + - name: step_id in: path required: true schema: type: string - title: Turn Id + title: Step Id + description: The ID of the step to get. responses: '200': description: An AgentStepResponse. @@ -4161,16 +4171,10 @@ paths: get: tags: - V1Alpha - summary: List Agent Sessions + summary: List all session(s) of a given agent. description: Query endpoint for proper schema generation. operationId: list_agent_sessions_v1alpha_agents__agent_id__sessions_get parameters: - - name: agent_id - in: path - required: true - schema: - type: string - title: Agent Id - name: limit in: query required: true @@ -4183,6 +4187,13 @@ paths: schema: type: integer title: Start Index + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + description: The ID of the agent to list sessions for. responses: '200': description: A PaginatedResponse. @@ -4206,7 +4217,7 @@ paths: get: tags: - V1Alpha - summary: List Benchmarks + summary: List all benchmarks. description: Response-only endpoint for proper schema generation. operationId: list_benchmarks_v1alpha_eval_benchmarks_get responses: @@ -4231,7 +4242,7 @@ paths: post: tags: - V1Alpha - summary: Register Benchmark + summary: Register a benchmark. description: Generic endpoint - this would be replaced with actual implementation. operationId: register_benchmark_v1alpha_eval_benchmarks_post parameters: @@ -4267,7 +4278,7 @@ paths: delete: tags: - V1Alpha - summary: Unregister Benchmark + summary: Unregister a benchmark. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_benchmark_v1alpha_eval_benchmarks__benchmark_id__delete parameters: @@ -4286,7 +4297,7 @@ paths: required: true schema: type: string - description: 'Path parameter: benchmark_id' + description: The ID of the benchmark to unregister. responses: '200': description: Successful Response @@ -4308,7 +4319,7 @@ paths: get: tags: - V1Alpha - summary: Get Benchmark + summary: Get a benchmark by its ID. description: Query endpoint for proper schema generation. operationId: get_benchmark_v1alpha_eval_benchmarks__benchmark_id__get parameters: @@ -4318,6 +4329,7 @@ paths: schema: type: string title: Benchmark Id + description: The ID of the benchmark to get. responses: '200': description: A Benchmark. @@ -4341,7 +4353,7 @@ paths: post: tags: - V1Alpha - summary: Evaluate Rows + summary: Evaluate a list of rows on a benchmark. description: Typed endpoint for proper schema generation. operationId: evaluate_rows_v1alpha_eval_benchmarks__benchmark_id__evaluations_post requestBody: @@ -4375,12 +4387,12 @@ paths: required: true schema: type: string - description: 'Path parameter: benchmark_id' + description: The ID of the benchmark to run the evaluation on. /v1alpha/eval/benchmarks/{benchmark_id}/jobs: post: tags: - V1Alpha - summary: Run Eval + summary: Run an evaluation on a benchmark. description: Typed endpoint for proper schema generation. operationId: run_eval_v1alpha_eval_benchmarks__benchmark_id__jobs_post requestBody: @@ -4414,12 +4426,12 @@ paths: required: true schema: type: string - description: 'Path parameter: benchmark_id' + description: The ID of the benchmark to run the evaluation on. /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}: delete: tags: - V1Alpha - summary: Job Cancel + summary: Cancel a job. description: Generic endpoint - this would be replaced with actual implementation. operationId: job_cancel_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__delete parameters: @@ -4438,13 +4450,13 @@ paths: required: true schema: type: string - description: 'Path parameter: benchmark_id' + description: The ID of the benchmark to run the evaluation on. - name: job_id in: path required: true schema: type: string - description: 'Path parameter: job_id' + description: The ID of the job to cancel. responses: '200': description: Successful Response @@ -4466,7 +4478,7 @@ paths: get: tags: - V1Alpha - summary: Job Status + summary: Get the status of a job. description: Query endpoint for proper schema generation. operationId: job_status_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__get parameters: @@ -4476,12 +4488,14 @@ paths: schema: type: string title: Benchmark Id + description: The ID of the benchmark to run the evaluation on. - name: job_id in: path required: true schema: type: string title: Job Id + description: The ID of the job to get the status of. responses: '200': description: The status of the evaluation job. @@ -4505,7 +4519,7 @@ paths: get: tags: - V1Alpha - summary: Job Result + summary: Get the result of a job. description: Query endpoint for proper schema generation. operationId: job_result_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__result_get parameters: @@ -4515,12 +4529,14 @@ paths: schema: type: string title: Benchmark Id + description: The ID of the benchmark to run the evaluation on. - name: job_id in: path required: true schema: type: string title: Job Id + description: The ID of the job to get the result of. responses: '200': description: The result of the job. @@ -4544,7 +4560,7 @@ paths: post: tags: - V1Alpha - summary: Rerank + summary: Rerank a list of documents based on their relevance to a query. description: Typed endpoint for proper schema generation. operationId: rerank_v1alpha_inference_rerank_post requestBody: @@ -4576,7 +4592,7 @@ paths: get: tags: - V1Alpha - summary: Get Training Job Artifacts + summary: Get the artifacts of a training job. description: Query endpoint for proper schema generation. operationId: get_training_job_artifacts_v1alpha_post_training_job_artifacts_get parameters: @@ -4609,7 +4625,7 @@ paths: post: tags: - V1Alpha - summary: Cancel Training Job + summary: Cancel a training job. description: Generic endpoint - this would be replaced with actual implementation. operationId: cancel_training_job_v1alpha_post_training_job_cancel_post parameters: @@ -4645,7 +4661,7 @@ paths: get: tags: - V1Alpha - summary: Get Training Job Status + summary: Get the status of a training job. description: Query endpoint for proper schema generation. operationId: get_training_job_status_v1alpha_post_training_job_status_get parameters: @@ -4678,7 +4694,7 @@ paths: get: tags: - V1Alpha - summary: Get Training Jobs + summary: Get all training jobs. description: Response-only endpoint for proper schema generation. operationId: get_training_jobs_v1alpha_post_training_jobs_get responses: @@ -4704,7 +4720,7 @@ paths: post: tags: - V1Alpha - summary: Preference Optimize + summary: Run preference optimization of a model. description: Typed endpoint for proper schema generation. operationId: preference_optimize_v1alpha_post_training_preference_optimize_post requestBody: @@ -4736,7 +4752,7 @@ paths: post: tags: - V1Alpha - summary: Supervised Fine Tune + summary: Run supervised fine-tuning of a model. description: Typed endpoint for proper schema generation. operationId: supervised_fine_tune_v1alpha_post_training_supervised_fine_tune_post requestBody: @@ -4768,7 +4784,7 @@ paths: get: tags: - V1 - summary: List Batches + summary: List all batches for the current user. description: Query endpoint for proper schema generation. operationId: list_batches_v1_batches_get parameters: @@ -4807,7 +4823,7 @@ paths: post: tags: - V1 - summary: Create Batch + summary: Create a new batch for processing multiple API requests. description: Typed endpoint for proper schema generation. operationId: create_batch_v1_batches_post requestBody: @@ -4839,7 +4855,7 @@ paths: get: tags: - V1 - summary: Retrieve Batch + summary: Retrieve information about a specific batch. description: Query endpoint for proper schema generation. operationId: retrieve_batch_v1_batches__batch_id__get parameters: @@ -4849,6 +4865,7 @@ paths: schema: type: string title: Batch Id + description: The ID of the batch to retrieve. responses: '200': description: The batch object. @@ -4872,7 +4889,7 @@ paths: post: tags: - V1 - summary: Cancel Batch + summary: Cancel a batch that is in progress. description: Typed endpoint for proper schema generation. operationId: cancel_batch_v1_batches__batch_id__cancel_post requestBody: @@ -4906,12 +4923,12 @@ paths: required: true schema: type: string - description: 'Path parameter: batch_id' + description: The ID of the batch to cancel. /v1/chat/completions: get: tags: - V1 - summary: List Chat Completions + summary: List chat completions. description: Query endpoint for proper schema generation. operationId: list_chat_completions_v1_chat_completions_get parameters: @@ -4962,7 +4979,7 @@ paths: post: tags: - V1 - summary: Openai Chat Completion + summary: Create chat completions. description: Typed endpoint for proper schema generation. operationId: openai_chat_completion_v1_chat_completions_post requestBody: @@ -4994,7 +5011,7 @@ paths: get: tags: - V1 - summary: Get Chat Completion + summary: Get chat completion. description: Query endpoint for proper schema generation. operationId: get_chat_completion_v1_chat_completions__completion_id__get parameters: @@ -5004,6 +5021,7 @@ paths: schema: type: string title: Completion Id + description: ID of the chat completion. responses: '200': description: A OpenAICompletionWithInputMessages. @@ -5027,7 +5045,7 @@ paths: post: tags: - V1 - summary: Openai Completion + summary: Create completion. description: Typed endpoint for proper schema generation. operationId: openai_completion_v1_completions_post requestBody: @@ -5059,7 +5077,7 @@ paths: post: tags: - V1 - summary: Create Conversation + summary: Create a conversation. description: Typed endpoint for proper schema generation. operationId: create_conversation_v1_conversations_post requestBody: @@ -5091,7 +5109,7 @@ paths: delete: tags: - V1 - summary: Openai Delete Conversation + summary: Delete a conversation. description: Query endpoint for proper schema generation. operationId: openai_delete_conversation_v1_conversations__conversation_id__delete parameters: @@ -5101,6 +5119,7 @@ paths: schema: type: string title: Conversation Id + description: The conversation identifier. responses: '200': description: The deleted conversation resource. @@ -5123,7 +5142,7 @@ paths: get: tags: - V1 - summary: Get Conversation + summary: Retrieve a conversation. description: Query endpoint for proper schema generation. operationId: get_conversation_v1_conversations__conversation_id__get parameters: @@ -5133,6 +5152,7 @@ paths: schema: type: string title: Conversation Id + description: The conversation identifier. responses: '200': description: The conversation object. @@ -5155,7 +5175,7 @@ paths: post: tags: - V1 - summary: Update Conversation + summary: Update a conversation. description: Typed endpoint for proper schema generation. operationId: update_conversation_v1_conversations__conversation_id__post requestBody: @@ -5189,21 +5209,15 @@ paths: required: true schema: type: string - description: 'Path parameter: conversation_id' + description: The conversation identifier. /v1/conversations/{conversation_id}/items: get: tags: - V1 - summary: List Items + summary: List items. description: Query endpoint for proper schema generation. operationId: list_items_v1_conversations__conversation_id__items_get parameters: - - name: conversation_id - in: path - required: true - schema: - type: string - title: Conversation Id - name: after in: query required: true @@ -5227,6 +5241,13 @@ paths: schema: type: string title: Order + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id + description: The conversation identifier. responses: '200': description: List of conversation items. @@ -5249,7 +5270,7 @@ paths: post: tags: - V1 - summary: Add Items + summary: Create items. description: Typed endpoint for proper schema generation. operationId: add_items_v1_conversations__conversation_id__items_post requestBody: @@ -5283,12 +5304,12 @@ paths: required: true schema: type: string - description: 'Path parameter: conversation_id' + description: The conversation identifier. /v1/conversations/{conversation_id}/items/{item_id}: delete: tags: - V1 - summary: Openai Delete Conversation Item + summary: Delete an item. description: Query endpoint for proper schema generation. operationId: openai_delete_conversation_item_v1_conversations__conversation_id__items__item_id__delete parameters: @@ -5298,12 +5319,14 @@ paths: schema: type: string title: Conversation Id + description: The conversation identifier. - name: item_id in: path required: true schema: type: string title: Item Id + description: The item identifier. responses: '200': description: The deleted item resource. @@ -5326,7 +5349,7 @@ paths: get: tags: - V1 - summary: Retrieve + summary: Retrieve an item. description: Query endpoint for proper schema generation. operationId: retrieve_v1_conversations__conversation_id__items__item_id__get parameters: @@ -5336,12 +5359,14 @@ paths: schema: type: string title: Conversation Id + description: The conversation identifier. - name: item_id in: path required: true schema: type: string title: Item Id + description: The item identifier. responses: '200': description: The conversation item. @@ -5365,7 +5390,7 @@ paths: post: tags: - V1 - summary: Openai Embeddings + summary: Create embeddings. description: Typed endpoint for proper schema generation. operationId: openai_embeddings_v1_embeddings_post requestBody: @@ -5397,7 +5422,7 @@ paths: get: tags: - V1 - summary: Openai List Files + summary: List files. description: Query endpoint for proper schema generation. operationId: openai_list_files_v1_files_get parameters: @@ -5447,7 +5472,7 @@ paths: post: tags: - V1 - summary: Openai Upload File + summary: Upload file. description: Response-only endpoint for proper schema generation. operationId: openai_upload_file_v1_files_post responses: @@ -5473,7 +5498,7 @@ paths: delete: tags: - V1 - summary: Openai Delete File + summary: Delete file. description: Query endpoint for proper schema generation. operationId: openai_delete_file_v1_files__file_id__delete parameters: @@ -5483,6 +5508,7 @@ paths: schema: type: string title: File Id + description: The ID of the file to use for this request. responses: '200': description: An OpenAIFileDeleteResponse indicating successful deletion. @@ -5505,7 +5531,7 @@ paths: get: tags: - V1 - summary: Openai Retrieve File + summary: Retrieve file. description: Query endpoint for proper schema generation. operationId: openai_retrieve_file_v1_files__file_id__get parameters: @@ -5515,6 +5541,7 @@ paths: schema: type: string title: File Id + description: The ID of the file to use for this request. responses: '200': description: An OpenAIFileObject containing file information. @@ -5538,7 +5565,7 @@ paths: get: tags: - V1 - summary: Openai Retrieve File Content + summary: Retrieve file content. description: Generic endpoint - this would be replaced with actual implementation. operationId: openai_retrieve_file_content_v1_files__file_id__content_get parameters: @@ -5557,7 +5584,7 @@ paths: required: true schema: type: string - description: 'Path parameter: file_id' + description: The ID of the file to use for this request. responses: '200': description: The raw file content as a binary response. @@ -5580,7 +5607,7 @@ paths: get: tags: - V1 - summary: Health + summary: Get health status. description: Response-only endpoint for proper schema generation. operationId: health_v1_health_get responses: @@ -5606,7 +5633,7 @@ paths: get: tags: - V1 - summary: List Routes + summary: List routes. description: Response-only endpoint for proper schema generation. operationId: list_routes_v1_inspect_routes_get responses: @@ -5632,7 +5659,7 @@ paths: get: tags: - V1 - summary: List Models + summary: List all models. description: Response-only endpoint for proper schema generation. operationId: list_models_v1_models_get responses: @@ -5657,7 +5684,7 @@ paths: post: tags: - V1 - summary: Register Model + summary: Register model. description: Typed endpoint for proper schema generation. operationId: register_model_v1_models_post requestBody: @@ -5689,7 +5716,7 @@ paths: delete: tags: - V1 - summary: Unregister Model + summary: Unregister model. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_model_v1_models__model_id__delete parameters: @@ -5730,7 +5757,7 @@ paths: get: tags: - V1 - summary: Get Model + summary: Get model. description: Query endpoint for proper schema generation. operationId: get_model_v1_models__model_id__get parameters: @@ -5763,7 +5790,7 @@ paths: post: tags: - V1 - summary: Run Moderation + summary: Create moderation. description: Typed endpoint for proper schema generation. operationId: run_moderation_v1_moderations_post requestBody: @@ -5795,7 +5822,7 @@ paths: get: tags: - V1 - summary: List Prompts + summary: List all prompts. description: Response-only endpoint for proper schema generation. operationId: list_prompts_v1_prompts_get responses: @@ -5820,7 +5847,7 @@ paths: post: tags: - V1 - summary: Create Prompt + summary: Create prompt. description: Typed endpoint for proper schema generation. operationId: create_prompt_v1_prompts_post requestBody: @@ -5852,7 +5879,7 @@ paths: delete: tags: - V1 - summary: Delete Prompt + summary: Delete prompt. description: Generic endpoint - this would be replaced with actual implementation. operationId: delete_prompt_v1_prompts__prompt_id__delete parameters: @@ -5866,13 +5893,12 @@ paths: required: true schema: title: Kwargs - - &id001 - name: prompt_id + - name: prompt_id in: path required: true schema: type: string - description: 'Path parameter: prompt_id' + description: The identifier of the prompt to delete. responses: '200': description: Successful Response @@ -5894,22 +5920,23 @@ paths: get: tags: - V1 - summary: Get Prompt + summary: Get prompt. description: Query endpoint for proper schema generation. operationId: get_prompt_v1_prompts__prompt_id__get parameters: - - name: prompt_id - in: path - required: true - schema: - type: string - title: Prompt Id - name: version in: query required: true schema: type: integer title: Version + - name: prompt_id + in: path + required: true + schema: + type: string + title: Prompt Id + description: The identifier of the prompt to get. responses: '200': description: A Prompt resource. @@ -5932,7 +5959,7 @@ paths: post: tags: - V1 - summary: Update Prompt + summary: Update prompt. description: Typed endpoint for proper schema generation. operationId: update_prompt_v1_prompts__prompt_id__post requestBody: @@ -5961,12 +5988,17 @@ paths: $ref: '#/components/responses/DefaultError' description: Default Response parameters: - - *id001 + - name: prompt_id + in: path + required: true + schema: + type: string + description: The identifier of the prompt to update. /v1/prompts/{prompt_id}/set-default-version: post: tags: - V1 - summary: Set Default Version + summary: Set prompt version. description: Typed endpoint for proper schema generation. operationId: set_default_version_v1_prompts__prompt_id__set_default_version_post requestBody: @@ -6000,12 +6032,12 @@ paths: required: true schema: type: string - description: 'Path parameter: prompt_id' + description: The identifier of the prompt. /v1/prompts/{prompt_id}/versions: get: tags: - V1 - summary: List Prompt Versions + summary: List prompt versions. description: Query endpoint for proper schema generation. operationId: list_prompt_versions_v1_prompts__prompt_id__versions_get parameters: @@ -6015,6 +6047,7 @@ paths: schema: type: string title: Prompt Id + description: The identifier of the prompt to list versions for. responses: '200': description: A ListPromptsResponse containing all versions of the prompt. @@ -6038,7 +6071,7 @@ paths: get: tags: - V1 - summary: List Providers + summary: List providers. description: Response-only endpoint for proper schema generation. operationId: list_providers_v1_providers_get responses: @@ -6064,7 +6097,7 @@ paths: get: tags: - V1 - summary: Inspect Provider + summary: Get provider. description: Query endpoint for proper schema generation. operationId: inspect_provider_v1_providers__provider_id__get parameters: @@ -6074,6 +6107,7 @@ paths: schema: type: string title: Provider Id + description: The ID of the provider to inspect. responses: '200': description: A ProviderInfo object containing the provider's details. @@ -6097,7 +6131,7 @@ paths: get: tags: - V1 - summary: List Openai Responses + summary: List all responses. description: Query endpoint for proper schema generation. operationId: list_openai_responses_v1_responses_get parameters: @@ -6148,7 +6182,7 @@ paths: post: tags: - V1 - summary: Create Openai Response + summary: Create a model response. description: Typed endpoint for proper schema generation. operationId: create_openai_response_v1_responses_post requestBody: @@ -6180,7 +6214,7 @@ paths: delete: tags: - V1 - summary: Delete Openai Response + summary: Delete a response. description: Query endpoint for proper schema generation. operationId: delete_openai_response_v1_responses__response_id__delete parameters: @@ -6190,6 +6224,7 @@ paths: schema: type: string title: Response Id + description: The ID of the OpenAI response to delete. responses: '200': description: An OpenAIDeleteResponseObject @@ -6212,7 +6247,7 @@ paths: get: tags: - V1 - summary: Get Openai Response + summary: Get a model response. description: Query endpoint for proper schema generation. operationId: get_openai_response_v1_responses__response_id__get parameters: @@ -6222,6 +6257,7 @@ paths: schema: type: string title: Response Id + description: The ID of the OpenAI response to retrieve. responses: '200': description: An OpenAIResponseObject. @@ -6245,16 +6281,10 @@ paths: get: tags: - V1 - summary: List Openai Response Input Items + summary: List input items. description: Query endpoint for proper schema generation. operationId: list_openai_response_input_items_v1_responses__response_id__input_items_get parameters: - - name: response_id - in: path - required: true - schema: - type: string - title: Response Id - name: after in: query required: true @@ -6286,6 +6316,13 @@ paths: schema: $ref: '#/components/schemas/Order' default: desc + - name: response_id + in: path + required: true + schema: + type: string + title: Response Id + description: The ID of the response to retrieve input items for. responses: '200': description: An ListOpenAIResponseInputItem. @@ -6309,7 +6346,7 @@ paths: post: tags: - V1 - summary: Run Shield + summary: Run shield. description: Typed endpoint for proper schema generation. operationId: run_shield_v1_safety_run_shield_post requestBody: @@ -6341,7 +6378,7 @@ paths: get: tags: - V1 - summary: List Scoring Functions + summary: List all scoring functions. description: Response-only endpoint for proper schema generation. operationId: list_scoring_functions_v1_scoring_functions_get responses: @@ -6366,7 +6403,7 @@ paths: post: tags: - V1 - summary: Register Scoring Function + summary: Register a scoring function. description: Generic endpoint - this would be replaced with actual implementation. operationId: register_scoring_function_v1_scoring_functions_post parameters: @@ -6402,7 +6439,7 @@ paths: delete: tags: - V1 - summary: Unregister Scoring Function + summary: Unregister a scoring function. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_scoring_function_v1_scoring_functions__scoring_fn_id__delete parameters: @@ -6443,7 +6480,7 @@ paths: get: tags: - V1 - summary: Get Scoring Function + summary: Get a scoring function by its ID. description: Query endpoint for proper schema generation. operationId: get_scoring_function_v1_scoring_functions__scoring_fn_id__get parameters: @@ -6476,7 +6513,7 @@ paths: post: tags: - V1 - summary: Score + summary: Score a list of rows. description: Typed endpoint for proper schema generation. operationId: score_v1_scoring_score_post requestBody: @@ -6508,7 +6545,7 @@ paths: post: tags: - V1 - summary: Score Batch + summary: Score a batch of rows. description: Typed endpoint for proper schema generation. operationId: score_batch_v1_scoring_score_batch_post requestBody: @@ -6540,7 +6577,7 @@ paths: get: tags: - V1 - summary: List Shields + summary: List all shields. description: Response-only endpoint for proper schema generation. operationId: list_shields_v1_shields_get responses: @@ -6565,7 +6602,7 @@ paths: post: tags: - V1 - summary: Register Shield + summary: Register a shield. description: Typed endpoint for proper schema generation. operationId: register_shield_v1_shields_post requestBody: @@ -6597,7 +6634,7 @@ paths: delete: tags: - V1 - summary: Unregister Shield + summary: Unregister a shield. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_shield_v1_shields__identifier__delete parameters: @@ -6638,7 +6675,7 @@ paths: get: tags: - V1 - summary: Get Shield + summary: Get a shield by its identifier. description: Query endpoint for proper schema generation. operationId: get_shield_v1_shields__identifier__get parameters: @@ -6671,7 +6708,7 @@ paths: post: tags: - V1 - summary: Invoke Tool + summary: Run a tool with the given arguments. description: Typed endpoint for proper schema generation. operationId: invoke_tool_v1_tool_runtime_invoke_post requestBody: @@ -6703,7 +6740,7 @@ paths: get: tags: - V1 - summary: List Runtime Tools + summary: List all tools in the runtime. description: Query endpoint for proper schema generation. operationId: list_runtime_tools_v1_tool_runtime_list_tools_get parameters: @@ -6742,7 +6779,7 @@ paths: post: tags: - V1 - summary: Rag Tool.Insert + summary: Index documents so they can be used by the RAG system. description: Generic endpoint - this would be replaced with actual implementation. operationId: rag_tool_insert_v1_tool_runtime_rag_tool_insert_post parameters: @@ -6778,7 +6815,7 @@ paths: post: tags: - V1 - summary: Rag Tool.Query + summary: Query the RAG system for context; typically invoked by the agent. description: Typed endpoint for proper schema generation. operationId: rag_tool_query_v1_tool_runtime_rag_tool_query_post requestBody: @@ -6810,7 +6847,7 @@ paths: get: tags: - V1 - summary: List Tool Groups + summary: List tool groups with optional provider. description: Response-only endpoint for proper schema generation. operationId: list_tool_groups_v1_toolgroups_get responses: @@ -6835,7 +6872,7 @@ paths: post: tags: - V1 - summary: Register Tool Group + summary: Register a tool group. description: Generic endpoint - this would be replaced with actual implementation. operationId: register_tool_group_v1_toolgroups_post parameters: @@ -6871,7 +6908,7 @@ paths: delete: tags: - V1 - summary: Unregister Toolgroup + summary: Unregister a tool group. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_toolgroup_v1_toolgroups__toolgroup_id__delete parameters: @@ -6912,7 +6949,7 @@ paths: get: tags: - V1 - summary: Get Tool Group + summary: Get a tool group by its ID. description: Query endpoint for proper schema generation. operationId: get_tool_group_v1_toolgroups__toolgroup_id__get parameters: @@ -6945,7 +6982,7 @@ paths: get: tags: - V1 - summary: List Tools + summary: List tools with optional tool group. description: Query endpoint for proper schema generation. operationId: list_tools_v1_tools_get parameters: @@ -6978,7 +7015,7 @@ paths: get: tags: - V1 - summary: Get Tool + summary: Get a tool by its name. description: Query endpoint for proper schema generation. operationId: get_tool_v1_tools__tool_name__get parameters: @@ -7011,7 +7048,7 @@ paths: post: tags: - V1 - summary: Insert Chunks + summary: Insert chunks into a vector database. description: Generic endpoint - this would be replaced with actual implementation. operationId: insert_chunks_v1_vector_io_insert_post parameters: @@ -7047,7 +7084,7 @@ paths: post: tags: - V1 - summary: Query Chunks + summary: Query chunks from a vector database. description: Typed endpoint for proper schema generation. operationId: query_chunks_v1_vector_io_query_post requestBody: @@ -7079,7 +7116,7 @@ paths: get: tags: - V1 - summary: Openai List Vector Stores + summary: Returns a list of vector stores. description: Query endpoint for proper schema generation. operationId: openai_list_vector_stores_v1_vector_stores_get parameters: @@ -7131,7 +7168,7 @@ paths: post: tags: - V1 - summary: Openai Create Vector Store + summary: Creates a vector store. description: Typed endpoint for proper schema generation. operationId: openai_create_vector_store_v1_vector_stores_post requestBody: @@ -7163,7 +7200,7 @@ paths: delete: tags: - V1 - summary: Openai Delete Vector Store + summary: Delete a vector store. description: Query endpoint for proper schema generation. operationId: openai_delete_vector_store_v1_vector_stores__vector_store_id__delete parameters: @@ -7173,6 +7210,7 @@ paths: schema: type: string title: Vector Store Id + description: The ID of the vector store to delete. responses: '200': description: A VectorStoreDeleteResponse indicating the deletion status. @@ -7195,7 +7233,7 @@ paths: get: tags: - V1 - summary: Openai Retrieve Vector Store + summary: Retrieves a vector store. description: Query endpoint for proper schema generation. operationId: openai_retrieve_vector_store_v1_vector_stores__vector_store_id__get parameters: @@ -7205,6 +7243,7 @@ paths: schema: type: string title: Vector Store Id + description: The ID of the vector store to retrieve. responses: '200': description: A VectorStoreObject representing the vector store. @@ -7227,7 +7266,7 @@ paths: post: tags: - V1 - summary: Openai Update Vector Store + summary: Updates a vector store. description: Typed endpoint for proper schema generation. operationId: openai_update_vector_store_v1_vector_stores__vector_store_id__post requestBody: @@ -7261,12 +7300,12 @@ paths: required: true schema: type: string - description: 'Path parameter: vector_store_id' + description: The ID of the vector store to update. /v1/vector_stores/{vector_store_id}/file_batches: post: tags: - V1 - summary: Openai Create Vector Store File Batch + summary: Create a vector store file batch. description: Typed endpoint for proper schema generation. operationId: openai_create_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches_post requestBody: @@ -7300,12 +7339,12 @@ paths: required: true schema: type: string - description: 'Path parameter: vector_store_id' + description: The ID of the vector store to create the file batch for. /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: get: tags: - V1 - summary: Openai Retrieve Vector Store File Batch + summary: Retrieve a vector store file batch. description: Query endpoint for proper schema generation. operationId: openai_retrieve_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__get parameters: @@ -7315,12 +7354,14 @@ paths: schema: type: string title: Batch Id + description: The ID of the file batch to retrieve. - name: vector_store_id in: path required: true schema: type: string title: Vector Store Id + description: The ID of the vector store containing the file batch. responses: '200': description: A VectorStoreFileBatchObject representing the file batch. @@ -7344,7 +7385,7 @@ paths: post: tags: - V1 - summary: Openai Cancel Vector Store File Batch + summary: Cancels a vector store file batch. description: Typed endpoint for proper schema generation. operationId: openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post requestBody: @@ -7373,38 +7414,26 @@ paths: description: Default Response $ref: '#/components/responses/DefaultError' parameters: - - name: vector_store_id + - name: batch_id in: path required: true schema: type: string - description: 'Path parameter: vector_store_id' - - name: batch_id + description: The ID of the file batch to cancel. + - name: vector_store_id in: path required: true schema: type: string - description: 'Path parameter: batch_id' + description: The ID of the vector store containing the file batch. /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: get: tags: - V1 - summary: Openai List Files In Vector Store File Batch + summary: Returns a list of vector store files in a batch. description: Query endpoint for proper schema generation. operationId: openai_list_files_in_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get parameters: - - name: batch_id - in: path - required: true - schema: - type: string - title: Batch Id - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - name: after in: query required: true @@ -7437,6 +7466,20 @@ paths: type: string default: desc title: Order + - name: batch_id + in: path + required: true + schema: + type: string + title: Batch Id + description: The ID of the file batch to list files from. + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + description: The ID of the vector store containing the file batch. responses: '200': description: A VectorStoreFilesListInBatchResponse containing the list of files in the batch. @@ -7460,16 +7503,10 @@ paths: get: tags: - V1 - summary: Openai List Files In Vector Store + summary: List files in a vector store. description: Query endpoint for proper schema generation. operationId: openai_list_files_in_vector_store_v1_vector_stores__vector_store_id__files_get parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - name: after in: query required: true @@ -7502,6 +7539,13 @@ paths: type: string default: desc title: Order + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + description: The ID of the vector store to list files from. responses: '200': description: A VectorStoreListFilesResponse containing the list of files. @@ -7524,7 +7568,7 @@ paths: post: tags: - V1 - summary: Openai Attach File To Vector Store + summary: Attach a file to a vector store. description: Typed endpoint for proper schema generation. operationId: openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post requestBody: @@ -7558,27 +7602,29 @@ paths: required: true schema: type: string - description: 'Path parameter: vector_store_id' + description: The ID of the vector store to attach the file to. /v1/vector_stores/{vector_store_id}/files/{file_id}: delete: tags: - V1 - summary: Openai Delete Vector Store File + summary: Delete a vector store file. description: Query endpoint for proper schema generation. operationId: openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete parameters: - - name: file_id + - name: vector_store_id in: path required: true schema: type: string - title: File Id - - name: vector_store_id + title: Vector Store Id + description: The ID of the vector store containing the file to delete. + - name: file_id in: path required: true schema: type: string - title: Vector Store Id + title: File Id + description: The ID of the file to delete. responses: '200': description: A VectorStoreFileDeleteResponse indicating the deletion status. @@ -7601,22 +7647,24 @@ paths: get: tags: - V1 - summary: Openai Retrieve Vector Store File + summary: Retrieves a vector store file. description: Query endpoint for proper schema generation. operationId: openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get parameters: - - name: file_id + - name: vector_store_id in: path required: true schema: type: string - title: File Id - - name: vector_store_id + title: Vector Store Id + description: The ID of the vector store containing the file to retrieve. + - name: file_id in: path required: true schema: type: string - title: Vector Store Id + title: File Id + description: The ID of the file to retrieve. responses: '200': description: A VectorStoreFileObject representing the file. @@ -7639,7 +7687,7 @@ paths: post: tags: - V1 - summary: Openai Update Vector Store File + summary: Updates a vector store file. description: Typed endpoint for proper schema generation. operationId: openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post requestBody: @@ -7673,33 +7721,35 @@ paths: required: true schema: type: string - description: 'Path parameter: vector_store_id' + description: The ID of the vector store containing the file to update. - name: file_id in: path required: true schema: type: string - description: 'Path parameter: file_id' + description: The ID of the file to update. /v1/vector_stores/{vector_store_id}/files/{file_id}/content: get: tags: - V1 - summary: Openai Retrieve Vector Store File Contents + summary: Retrieves the contents of a vector store file. description: Query endpoint for proper schema generation. operationId: openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get parameters: - - name: file_id + - name: vector_store_id in: path required: true schema: type: string - title: File Id - - name: vector_store_id + title: Vector Store Id + description: The ID of the vector store containing the file to retrieve. + - name: file_id in: path required: true schema: type: string - title: Vector Store Id + title: File Id + description: The ID of the file to retrieve. responses: '200': description: A list of InterleavedContent representing the file contents. @@ -7723,7 +7773,7 @@ paths: post: tags: - V1 - summary: Openai Search Vector Store + summary: Search for chunks in a vector store. description: Typed endpoint for proper schema generation. operationId: openai_search_vector_store_v1_vector_stores__vector_store_id__search_post requestBody: @@ -7757,12 +7807,12 @@ paths: required: true schema: type: string - description: 'Path parameter: vector_store_id' + description: The ID of the vector store to search. /v1/version: get: tags: - V1 - summary: Version + summary: Get version. description: Response-only endpoint for proper schema generation. operationId: version_v1_version_get responses: @@ -7799,7 +7849,7 @@ components: required: - config title: AgentCandidate - description: "An agent candidate for evaluation.\n\n:param config: The configuration for the agent candidate." + description: An agent candidate for evaluation. AgentConfig: properties: sampling_params: @@ -7866,7 +7916,7 @@ components: - model - instructions title: AgentConfig - description: "Configuration for an agent.\n\n:param model: The model identifier to use for the agent\n:param instructions: The system instructions for the agent\n:param name: Optional name for the agent, used in telemetry and identification\n:param enable_session_persistence: Optional flag indicating whether session data has to be persisted\n:param response_format: Optional response format configuration" + description: Configuration for an agent. AgentCreateResponse: properties: agent_id: @@ -7876,7 +7926,7 @@ components: required: - agent_id title: AgentCreateResponse - description: "Response returned when creating a new agent.\n\n:param agent_id: Unique identifier for the created agent" + description: Response returned when creating a new agent. AgentSessionCreateResponse: properties: session_id: @@ -7886,7 +7936,7 @@ components: required: - session_id title: AgentSessionCreateResponse - description: "Response returned when creating a new agent session.\n\n:param session_id: Unique identifier for the created session" + description: Response returned when creating a new agent session. AgentToolGroupWithArgs: properties: name: @@ -7910,7 +7960,7 @@ components: default: agent_turn_input type: object title: AgentTurnInputType - description: "Parameter type for agent turn input.\n\n:param type: Discriminator type. Always \"agent_turn_input\"" + description: Parameter type for agent turn input. AggregationFunctionType: type: string enum: @@ -7920,7 +7970,7 @@ components: - categorical_count - accuracy title: AggregationFunctionType - description: "Types of aggregation functions for scoring results.\n:cvar average: Calculate the arithmetic mean of scores\n:cvar weighted_average: Calculate a weighted average of scores\n:cvar median: Calculate the median value of scores\n:cvar categorical_count: Count occurrences of categorical values\n:cvar accuracy: Calculate accuracy as the proportion of correct answers" + description: Types of aggregation functions for scoring results. AllowedToolsFilter: properties: tool_names: @@ -7930,7 +7980,7 @@ components: type: array type: object title: AllowedToolsFilter - description: "Filter configuration for restricting which MCP tools can be used.\n\n:param tool_names: (Optional) List of specific tool names that are allowed" + description: Filter configuration for restricting which MCP tools can be used. ApprovalFilter: properties: always: @@ -7945,7 +7995,7 @@ components: type: array type: object title: ApprovalFilter - description: "Filter configuration for MCP tool approval requirements.\n\n:param always: (Optional) List of tool names that always require approval\n:param never: (Optional) List of tool names that never require approval" + description: Filter configuration for MCP tool approval requirements. ArrayType: properties: type: @@ -7955,7 +8005,7 @@ components: default: array type: object title: ArrayType - description: "Parameter type for array values.\n\n:param type: Discriminator type. Always \"array\"" + description: Parameter type for array values. Attachment-Output: properties: content: @@ -7989,7 +8039,7 @@ components: - content - mime_type title: Attachment - description: "An attachment to an agent turn.\n\n:param content: The content of the attachment.\n:param mime_type: The MIME type of the attachment." + description: An attachment to an agent turn. BasicScoringFnParams: properties: type: @@ -8005,7 +8055,7 @@ components: description: Aggregation functions to apply to the scores of each row type: object title: BasicScoringFnParams - description: "Parameters for basic scoring function configuration.\n:param type: The type of scoring function parameters, always basic\n:param aggregation_functions: Aggregation functions to apply to the scores of each row" + description: Parameters for basic scoring function configuration. Batch: properties: id: @@ -8192,7 +8242,7 @@ components: - dataset_id - scoring_functions title: Benchmark - description: "A benchmark resource for evaluating model performance.\n\n:param dataset_id: Identifier of the dataset to use for the benchmark evaluation\n:param scoring_functions: List of scoring function identifiers to apply during evaluation\n:param metadata: Metadata for this evaluation task\n:param type: The resource type, always benchmark" + description: A benchmark resource for evaluating model performance. BenchmarkConfig: properties: eval_candidate: @@ -8228,7 +8278,7 @@ components: required: - eval_candidate title: BenchmarkConfig - description: "A benchmark configuration for evaluation.\n\n:param eval_candidate: The candidate to evaluate.\n:param scoring_params: Map between scoring function id and parameters for each scoring function you want to run\n:param num_examples: (Optional) The number of examples to evaluate. If not provided, all examples in the dataset will be evaluated" + description: A benchmark configuration for evaluation. BooleanType: properties: type: @@ -8238,7 +8288,7 @@ components: default: boolean type: object title: BooleanType - description: "Parameter type for boolean values.\n\n:param type: Discriminator type. Always \"boolean\"" + description: Parameter type for boolean values. BuiltinTool: type: string enum: @@ -8256,7 +8306,7 @@ components: default: chat_completion_input type: object title: ChatCompletionInputType - description: "Parameter type for chat completion input.\n\n:param type: Discriminator type. Always \"chat_completion_input\"" + description: Parameter type for chat completion input. Chunk-Output: properties: content: @@ -8300,7 +8350,7 @@ components: - content - chunk_id title: Chunk - description: "A chunk of content that can be inserted into a vector database.\n:param content: The content of the chunk, which can be interleaved text, images, or other types.\n:param chunk_id: Unique identifier for the chunk. Must be provided explicitly.\n:param metadata: Metadata associated with the chunk that will be used in the model context during inference.\n:param embedding: Optional embedding for the chunk. If not provided, it will be computed later.\n:param chunk_metadata: Metadata for the chunk that will NOT be used in the context during inference.\n The `chunk_metadata` is required backend functionality." + description: A chunk of content that can be inserted into a vector database. ChunkMetadata: properties: chunk_id: @@ -8338,7 +8388,7 @@ components: type: integer type: object title: ChunkMetadata - description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference.\n:param chunk_id: The ID of the chunk. If not set, it will be generated based on the document ID and content.\n:param document_id: The ID of the document this chunk belongs to.\n:param source: The source of the content, such as a URL, file path, or other identifier.\n:param created_timestamp: An optional timestamp indicating when the chunk was created.\n:param updated_timestamp: An optional timestamp indicating when the chunk was last updated.\n:param chunk_window: The window of the chunk, which can be used to group related chunks together.\n:param chunk_tokenizer: The tokenizer used to create the chunk. Default is Tiktoken.\n:param chunk_embedding_model: The embedding model used to create the chunk's embedding.\n:param chunk_embedding_dimension: The dimension of the embedding vector for the chunk.\n:param content_token_count: The number of tokens in the content of the chunk.\n:param metadata_token_count: The number of tokens in the metadata of the chunk." + description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." CompletionInputType: properties: type: @@ -8348,7 +8398,7 @@ components: default: completion_input type: object title: CompletionInputType - description: "Parameter type for completion input.\n\n:param type: Discriminator type. Always \"completion_input\"" + description: Parameter type for completion input. CompletionMessage-Output: properties: role: @@ -8390,7 +8440,7 @@ components: - content - stop_reason title: CompletionMessage - description: "A message containing the model's (assistant) response in a chat conversation.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param stop_reason: Reason why the model stopped generating. Options are:\n - `StopReason.end_of_turn`: The model finished generating the entire response.\n - `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n - `StopReason.out_of_tokens`: The model ran out of token budget.\n:param tool_calls: List of tool calls. Each tool call is a ToolCall object." + description: A message containing the model's (assistant) response in a chat conversation. Conversation: properties: id: @@ -8502,7 +8552,7 @@ components: required: - beta title: DPOAlignmentConfig - description: "Configuration for Direct Preference Optimization (DPO) alignment.\n\n:param beta: Temperature parameter for the DPO loss\n:param loss_type: The type of loss function to use for DPO" + description: Configuration for Direct Preference Optimization (DPO) alignment. DPOLossType: type: string enum: @@ -8542,7 +8592,7 @@ components: - shuffle - data_format title: DataConfig - description: "Configuration for training data and data loading.\n\n:param dataset_id: Unique identifier for the training dataset\n:param batch_size: Number of samples per training batch\n:param shuffle: Whether to shuffle the dataset during training\n:param data_format: Format of the dataset (instruct or dialog)\n:param validation_dataset_id: (Optional) Unique identifier for the validation dataset\n:param packed: (Optional) Whether to pack multiple samples into a single sequence for efficiency\n:param train_on_input: (Optional) Whether to compute loss on input tokens as well as output tokens" + description: Configuration for training data and data loading. Dataset: properties: identifier: @@ -8586,14 +8636,14 @@ components: - purpose - source title: Dataset - description: "Dataset resource for storing and accessing training or evaluation data.\n\n:param type: Type of resource, always 'dataset' for datasets" + description: Dataset resource for storing and accessing training or evaluation data. DatasetFormat: type: string enum: - instruct - dialog title: DatasetFormat - description: "Format of the training dataset.\n:cvar instruct: Instruction-following format with prompt and completion\n:cvar dialog: Multi-turn conversation format with messages" + description: Format of the training dataset. DatasetPurpose: type: string enum: @@ -8601,7 +8651,7 @@ components: - eval/question-answer - eval/messages-answer title: DatasetPurpose - description: "Purpose of the dataset. Each purpose has a required input data schema.\n\n:cvar post-training/messages: The dataset contains messages used for post-training.\n {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello, world!\"},\n {\"role\": \"assistant\", \"content\": \"Hello, world!\"},\n ]\n }\n:cvar eval/question-answer: The dataset contains a question column and an answer column.\n {\n \"question\": \"What is the capital of France?\",\n \"answer\": \"Paris\"\n }\n:cvar eval/messages-answer: The dataset contains a messages column with list of messages and an answer column.\n {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello, my name is John Doe.\"},\n {\"role\": \"assistant\", \"content\": \"Hello, John Doe. How can I help you today?\"},\n {\"role\": \"user\", \"content\": \"What's my name?\"},\n ],\n \"answer\": \"John Doe\"\n }" + description: Purpose of the dataset. Each purpose has a required input data schema. DefaultRAGQueryGeneratorConfig: properties: type: @@ -8615,7 +8665,7 @@ components: default: ' ' type: object title: DefaultRAGQueryGeneratorConfig - description: "Configuration for the default RAG query generator.\n\n:param type: Type of query generator, always 'default'\n:param separator: String separator used to join query terms" + description: Configuration for the default RAG query generator. Document: properties: content: @@ -8649,7 +8699,7 @@ components: - content - mime_type title: Document - description: "A document to be used by an agent.\n\n:param content: The content of the document.\n:param mime_type: The MIME type of the document." + description: A document to be used by an agent. EfficiencyConfig: properties: enable_activation_checkpointing: @@ -8670,7 +8720,7 @@ components: type: boolean type: object title: EfficiencyConfig - description: "Configuration for memory and compute efficiency optimizations.\n\n:param enable_activation_checkpointing: (Optional) Whether to use activation checkpointing to reduce memory usage\n:param enable_activation_offloading: (Optional) Whether to offload activations to CPU to save GPU memory\n:param memory_efficient_fsdp_wrap: (Optional) Whether to use memory-efficient FSDP wrapping\n:param fsdp_cpu_offload: (Optional) Whether to offload FSDP parameters to CPU" + description: Configuration for memory and compute efficiency optimizations. Errors: properties: data: @@ -8702,7 +8752,7 @@ components: - generations - scores title: EvaluateResponse - description: "The response from an evaluation.\n\n:param generations: The generations from the evaluation.\n:param scores: The scores from the evaluation." + description: The response from an evaluation. GrammarResponseFormat: properties: type: @@ -8718,7 +8768,7 @@ components: required: - bnf title: GrammarResponseFormat - description: "Configuration for grammar-guided response generation.\n\n:param type: Must be \"grammar\" to identify this format type\n:param bnf: The BNF grammar specification the response should conform to" + description: Configuration for grammar-guided response generation. GreedySamplingStrategy: properties: type: @@ -8728,7 +8778,7 @@ components: default: greedy type: object title: GreedySamplingStrategy - description: "Greedy sampling strategy that selects the highest probability token at each step.\n\n:param type: Must be \"greedy\" to identify this sampling strategy" + description: Greedy sampling strategy that selects the highest probability token at each step. HealthInfo: properties: status: @@ -8737,7 +8787,7 @@ components: required: - status title: HealthInfo - description: "Health status information for the service.\n\n:param status: Current health status of the service" + description: Health status information for the service. HealthStatus: type: string enum: @@ -8758,7 +8808,7 @@ components: required: - image title: ImageContentItem - description: "A image content item\n\n:param type: Discriminator type of the content item. Always \"image\"\n:param image: Image as a base64 encoded string or an URL" + description: A image content item ImageContentItem-Output: properties: type: @@ -8772,7 +8822,7 @@ components: required: - image title: ImageContentItem - description: "A image content item\n\n:param type: Discriminator type of the content item. Always \"image\"\n:param image: Image as a base64 encoded string or an URL" + description: A image content item InferenceStep-Output: properties: turn_id: @@ -8802,7 +8852,7 @@ components: - step_id - model_response title: InferenceStep - description: "An inference step in an agent turn.\n\n:param model_response: The response from the LLM." + description: An inference step in an agent turn. InputTokensDetails: properties: cached_tokens: @@ -8825,7 +8875,7 @@ components: - job_id - status title: Job - description: "A job execution instance with status tracking.\n\n:param job_id: Unique identifier for the job\n:param status: Current execution status of the job" + description: A job execution instance with status tracking. JobStatus: type: string enum: @@ -8835,7 +8885,7 @@ components: - scheduled - cancelled title: JobStatus - description: "Status of a job execution.\n:cvar completed: Job has finished successfully\n:cvar in_progress: Job is currently running\n:cvar failed: Job has failed during execution\n:cvar scheduled: Job is scheduled but not yet started\n:cvar cancelled: Job was cancelled before completion" + description: Status of a job execution. JsonSchemaResponseFormat: properties: type: @@ -8851,7 +8901,7 @@ components: required: - json_schema title: JsonSchemaResponseFormat - description: "Configuration for JSON schema-guided response generation.\n\n:param type: Must be \"json_schema\" to identify this format type\n:param json_schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model." + description: Configuration for JSON schema-guided response generation. JsonType: properties: type: @@ -8861,7 +8911,7 @@ components: default: json type: object title: JsonType - description: "Parameter type for JSON values.\n\n:param type: Discriminator type. Always \"json\"" + description: Parameter type for JSON values. LLMAsJudgeScoringFnParams: properties: type: @@ -8891,7 +8941,7 @@ components: required: - judge_model title: LLMAsJudgeScoringFnParams - description: "Parameters for LLM-as-judge scoring function configuration.\n:param type: The type of scoring function parameters, always llm_as_judge\n:param judge_model: Identifier of the LLM model to use as a judge for scoring\n:param prompt_template: (Optional) Custom prompt template for the judge model\n:param judge_score_regexes: Regexes to extract the answer from generated response\n:param aggregation_functions: Aggregation functions to apply to the scores of each row" + description: Parameters for LLM-as-judge scoring function configuration. LLMRAGQueryGeneratorConfig: properties: type: @@ -8910,7 +8960,7 @@ components: - model - template title: LLMRAGQueryGeneratorConfig - description: "Configuration for the LLM-based RAG query generator.\n\n:param type: Type of query generator, always 'llm'\n:param model: Name of the language model to use for query generation\n:param template: Template string for formatting the query generation prompt" + description: Configuration for the LLM-based RAG query generator. ListBenchmarksResponse: properties: data: @@ -8933,7 +8983,7 @@ components: required: - data title: ListDatasetsResponse - description: "Response from listing datasets.\n\n:param data: List of datasets" + description: Response from listing datasets. ListModelsResponse: properties: data: @@ -8979,7 +9029,7 @@ components: required: - data title: ListProvidersResponse - description: "Response containing a list of all available providers.\n\n:param data: List of provider information objects" + description: Response containing a list of all available providers. ListRoutesResponse: properties: data: @@ -8991,7 +9041,7 @@ components: required: - data title: ListRoutesResponse - description: "Response containing a list of all available API routes.\n\n:param data: List of available route information objects" + description: Response containing a list of all available API routes. ListScoringFunctionsResponse: properties: data: @@ -9025,7 +9075,7 @@ components: required: - data title: ListToolGroupsResponse - description: "Response containing a list of tool groups.\n\n:param data: List of tool groups" + description: Response containing a list of tool groups. MCPListToolsTool: properties: input_schema: @@ -9043,7 +9093,7 @@ components: - input_schema - name title: MCPListToolsTool - description: "Tool definition returned by MCP list tools operation.\n\n:param input_schema: JSON schema defining the tool's input parameters\n:param name: Name of the tool\n:param description: (Optional) Description of what the tool does" + description: Tool definition returned by MCP list tools operation. MemoryRetrievalStep-Output: properties: turn_id: @@ -9097,7 +9147,7 @@ components: - vector_store_ids - inserted_context title: MemoryRetrievalStep - description: "A memory retrieval step in an agent turn.\n\n:param vector_store_ids: The IDs of the vector databases to retrieve context from.\n:param inserted_context: The context retrieved from the vector databases." + description: A memory retrieval step in an agent turn. Model: properties: identifier: @@ -9130,7 +9180,7 @@ components: - identifier - provider_id title: Model - description: "A model resource representing an AI model registered in Llama Stack.\n\n:param type: The resource type, always 'model' for model resources\n:param model_type: The type of model (LLM or embedding model)\n:param metadata: Any additional metadata for this model\n:param identifier: Unique identifier for this resource in llama stack\n:param provider_resource_id: Unique identifier for this resource in the provider\n:param provider_id: ID of the provider that owns this resource" + description: A model resource representing an AI model registered in Llama Stack. ModelCandidate: properties: type: @@ -9150,7 +9200,7 @@ components: - model - sampling_params title: ModelCandidate - description: "A model candidate for evaluation.\n\n:param model: The model ID to evaluate.\n:param sampling_params: The sampling parameters for the model.\n:param system_message: (Optional) The system message providing instructions or context to the model." + description: A model candidate for evaluation. ModelType: type: string enum: @@ -9158,7 +9208,7 @@ components: - embedding - rerank title: ModelType - description: "Enumeration of supported model types in Llama Stack.\n:cvar llm: Large language model for text generation and completion\n:cvar embedding: Embedding model for converting text to vector representations\n:cvar rerank: Reranking model for reordering documents based on their relevance to a query" + description: Enumeration of supported model types in Llama Stack. ModerationObject: properties: id: @@ -9178,7 +9228,7 @@ components: - model - results title: ModerationObject - description: "A moderation object.\n:param id: The unique identifier for the moderation request.\n:param model: The model used to generate the moderation results.\n:param results: A list of moderation objects" + description: A moderation object. ModerationObjectResults: properties: flagged: @@ -9212,7 +9262,7 @@ components: required: - flagged title: ModerationObjectResults - description: "A moderation object.\n:param flagged: Whether any of the below categories are flagged.\n:param categories: A list of the categories, and whether they are flagged or not.\n:param category_applied_input_types: A list of the categories along with the input type(s) that the score applies to.\n:param category_scores: A list of the categories along with their scores as predicted by model." + description: A moderation object. NumberType: properties: type: @@ -9222,7 +9272,7 @@ components: default: number type: object title: NumberType - description: "Parameter type for numeric values.\n\n:param type: Discriminator type. Always \"number\"" + description: Parameter type for numeric values. ObjectType: properties: type: @@ -9232,7 +9282,7 @@ components: default: object type: object title: ObjectType - description: "Parameter type for object values.\n\n:param type: Discriminator type. Always \"object\"" + description: Parameter type for object values. OpenAIAssistantMessageParam-Input: properties: role: @@ -9257,7 +9307,7 @@ components: type: array type: object title: OpenAIAssistantMessageParam - description: "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param name: (Optional) The name of the assistant message participant.\n:param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object." + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. OpenAIAssistantMessageParam-Output: properties: role: @@ -9282,7 +9332,7 @@ components: type: array type: object title: OpenAIAssistantMessageParam - description: "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param name: (Optional) The name of the assistant message participant.\n:param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object." + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. OpenAIChatCompletion: properties: id: @@ -9313,7 +9363,7 @@ components: - created - model title: OpenAIChatCompletion - description: "Response from an OpenAI-compatible chat completion request.\n\n:param id: The ID of the chat completion\n:param choices: List of choices\n:param object: The object type, which will be \"chat.completion\"\n:param created: The Unix timestamp in seconds when the chat completion was created\n:param model: The model that was used to generate the chat completion\n:param usage: Token usage information for the completion" + description: Response from an OpenAI-compatible chat completion request. OpenAIChatCompletionContentPartImageParam: properties: type: @@ -9327,7 +9377,7 @@ components: required: - image_url title: OpenAIChatCompletionContentPartImageParam - description: "Image content part for OpenAI-compatible chat completion messages.\n\n:param type: Must be \"image_url\" to identify this as image content\n:param image_url: Image URL specification and processing details" + description: Image content part for OpenAI-compatible chat completion messages. OpenAIChatCompletionContentPartTextParam: properties: type: @@ -9342,7 +9392,7 @@ components: required: - text title: OpenAIChatCompletionContentPartTextParam - description: "Text content part for OpenAI-compatible chat completion messages.\n\n:param type: Must be \"text\" to identify this as text content\n:param text: The text content of the message" + description: Text content part for OpenAI-compatible chat completion messages. OpenAIChatCompletionRequestWithExtraBody: properties: model: @@ -9464,7 +9514,7 @@ components: - model - messages title: OpenAIChatCompletionRequestWithExtraBody - description: "Request parameters for OpenAI-compatible chat completion endpoint.\n\n:param model: The identifier of the model to use. The model must be registered with Llama Stack and available via the /models endpoint.\n:param messages: List of messages in the conversation.\n:param frequency_penalty: (Optional) The penalty for repeated tokens.\n:param function_call: (Optional) The function call to use.\n:param functions: (Optional) List of functions to use.\n:param logit_bias: (Optional) The logit bias to use.\n:param logprobs: (Optional) The log probabilities to use.\n:param max_completion_tokens: (Optional) The maximum number of tokens to generate.\n:param max_tokens: (Optional) The maximum number of tokens to generate.\n:param n: (Optional) The number of completions to generate.\n:param parallel_tool_calls: (Optional) Whether to parallelize tool calls.\n:param presence_penalty: (Optional) The penalty for repeated tokens.\n:param response_format: (Optional) The response format to use.\n:param seed: (Optional) The seed to use.\n:param stop: (Optional) The stop tokens to use.\n:param stream: (Optional) Whether to stream the response.\n:param stream_options: (Optional) The stream options to use.\n:param temperature: (Optional) The temperature to use.\n:param tool_choice: (Optional) The tool choice to use.\n:param tools: (Optional) The tools to use.\n:param top_logprobs: (Optional) The top log probabilities to use.\n:param top_p: (Optional) The top p to use.\n:param user: (Optional) The user to use." + description: Request parameters for OpenAI-compatible chat completion endpoint. OpenAIChatCompletionToolCall: properties: index: @@ -9482,7 +9532,7 @@ components: $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' type: object title: OpenAIChatCompletionToolCall - description: "Tool call specification for OpenAI-compatible chat completion responses.\n\n:param index: (Optional) Index of the tool call in the list\n:param id: (Optional) Unique identifier for the tool call\n:param type: Must be \"function\" to identify this as a function call\n:param function: (Optional) Function call details" + description: Tool call specification for OpenAI-compatible chat completion responses. OpenAIChatCompletionToolCallFunction: properties: name: @@ -9493,7 +9543,7 @@ components: type: string type: object title: OpenAIChatCompletionToolCallFunction - description: "Function call details for OpenAI-compatible tool calls.\n\n:param name: (Optional) Name of the function to call\n:param arguments: (Optional) Arguments to pass to the function as a JSON string" + description: Function call details for OpenAI-compatible tool calls. OpenAIChatCompletionUsage: properties: prompt_tokens: @@ -9515,7 +9565,7 @@ components: - completion_tokens - total_tokens title: OpenAIChatCompletionUsage - description: "Usage information for OpenAI chat completion.\n\n:param prompt_tokens: Number of tokens in the prompt\n:param completion_tokens: Number of tokens in the completion\n:param total_tokens: Total tokens used (prompt + completion)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + description: Usage information for OpenAI chat completion. OpenAIChatCompletionUsageCompletionTokensDetails: properties: reasoning_tokens: @@ -9523,7 +9573,7 @@ components: type: integer type: object title: OpenAIChatCompletionUsageCompletionTokensDetails - description: "Token details for output tokens in OpenAI chat completion usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + description: Token details for output tokens in OpenAI chat completion usage. OpenAIChatCompletionUsagePromptTokensDetails: properties: cached_tokens: @@ -9531,7 +9581,7 @@ components: type: integer type: object title: OpenAIChatCompletionUsagePromptTokensDetails - description: "Token details for prompt tokens in OpenAI chat completion usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + description: Token details for prompt tokens in OpenAI chat completion usage. OpenAIChoice-Output: properties: message: @@ -9564,7 +9614,7 @@ components: - finish_reason - index title: OpenAIChoice - description: "A choice from an OpenAI-compatible chat completion response.\n\n:param message: The message from the model\n:param finish_reason: The reason the model stopped generating\n:param index: The index of the choice\n:param logprobs: (Optional) The log probabilities for the tokens in the message" + description: A choice from an OpenAI-compatible chat completion response. OpenAIChoiceLogprobs-Output: properties: content: @@ -9579,7 +9629,7 @@ components: type: array type: object title: OpenAIChoiceLogprobs - description: "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response.\n\n:param content: (Optional) The log probabilities for the tokens in the message\n:param refusal: (Optional) The log probabilities for the tokens in the message" + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. OpenAICompletion: properties: id: @@ -9608,7 +9658,7 @@ components: - created - model title: OpenAICompletion - description: "Response from an OpenAI-compatible completion request.\n\n:id: The ID of the completion\n:choices: List of choices\n:created: The Unix timestamp in seconds when the completion was created\n:model: The model that was used to generate the completion\n:object: The object type, which will be \"text_completion\"" + description: Response from an OpenAI-compatible completion request. OpenAICompletionChoice-Output: properties: finish_reason: @@ -9628,7 +9678,7 @@ components: - text - index title: OpenAICompletionChoice - description: "A choice from an OpenAI-compatible completion response.\n\n:finish_reason: The reason the model stopped generating\n:text: The text of the choice\n:index: The index of the choice\n:logprobs: (Optional) The log probabilities for the tokens in the choice" + description: A choice from an OpenAI-compatible completion response. OpenAICompletionRequestWithExtraBody: properties: model: @@ -9710,7 +9760,7 @@ components: - model - prompt title: OpenAICompletionRequestWithExtraBody - description: "Request parameters for OpenAI-compatible completion endpoint.\n\n:param model: The identifier of the model to use. The model must be registered with Llama Stack and available via the /models endpoint.\n:param prompt: The prompt to generate a completion for.\n:param best_of: (Optional) The number of completions to generate.\n:param echo: (Optional) Whether to echo the prompt.\n:param frequency_penalty: (Optional) The penalty for repeated tokens.\n:param logit_bias: (Optional) The logit bias to use.\n:param logprobs: (Optional) The log probabilities to use.\n:param max_tokens: (Optional) The maximum number of tokens to generate.\n:param n: (Optional) The number of completions to generate.\n:param presence_penalty: (Optional) The penalty for repeated tokens.\n:param seed: (Optional) The seed to use.\n:param stop: (Optional) The stop tokens to use.\n:param stream: (Optional) Whether to stream the response.\n:param stream_options: (Optional) The stream options to use.\n:param temperature: (Optional) The temperature to use.\n:param top_p: (Optional) The top p to use.\n:param user: (Optional) The user to use.\n:param suffix: (Optional) The suffix that should be appended to the completion." + description: Request parameters for OpenAI-compatible completion endpoint. OpenAICreateVectorStoreFileBatchRequestWithExtraBody: properties: file_ids: @@ -9737,7 +9787,7 @@ components: required: - file_ids title: OpenAICreateVectorStoreFileBatchRequestWithExtraBody - description: "Request to create a vector store file batch with extra_body support.\n\n:param file_ids: A list of File IDs that the vector store should use\n:param attributes: (Optional) Key-value attributes to store with the files\n:param chunking_strategy: (Optional) The chunking strategy used to chunk the file(s). Defaults to auto" + description: Request to create a vector store file batch with extra_body support. OpenAICreateVectorStoreRequestWithExtraBody: properties: name: @@ -9763,7 +9813,7 @@ components: additionalProperties: true type: object title: OpenAICreateVectorStoreRequestWithExtraBody - description: "Request to create a vector store with extra_body support.\n\n:param name: (Optional) A name for the vector store\n:param file_ids: List of file IDs to include in the vector store\n:param expires_after: (Optional) Expiration policy for the vector store\n:param chunking_strategy: (Optional) Strategy for splitting files into chunks\n:param metadata: Set of key-value pairs that can be attached to the vector store" + description: Request to create a vector store with extra_body support. OpenAIDeveloperMessageParam: properties: role: @@ -9785,7 +9835,7 @@ components: required: - content title: OpenAIDeveloperMessageParam - description: "A message from the developer in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"developer\" to identify this as a developer message\n:param content: The content of the developer message\n:param name: (Optional) The name of the developer message participant." + description: A message from the developer in an OpenAI-compatible chat completion request. OpenAIEmbeddingData: properties: object: @@ -9808,7 +9858,7 @@ components: - embedding - index title: OpenAIEmbeddingData - description: "A single embedding data object from an OpenAI-compatible embeddings response.\n\n:param object: The object type, which will be \"embedding\"\n:param embedding: The embedding vector as a list of floats (when encoding_format=\"float\") or as a base64-encoded string (when encoding_format=\"base64\")\n:param index: The index of the embedding in the input list" + description: A single embedding data object from an OpenAI-compatible embeddings response. OpenAIEmbeddingUsage: properties: prompt_tokens: @@ -9822,7 +9872,7 @@ components: - prompt_tokens - total_tokens title: OpenAIEmbeddingUsage - description: "Usage information for an OpenAI-compatible embeddings response.\n\n:param prompt_tokens: The number of tokens in the input\n:param total_tokens: The total number of tokens used" + description: Usage information for an OpenAI-compatible embeddings response. OpenAIEmbeddingsRequestWithExtraBody: properties: model: @@ -9851,7 +9901,7 @@ components: - model - input title: OpenAIEmbeddingsRequestWithExtraBody - description: "Request parameters for OpenAI-compatible embeddings endpoint.\n\n:param model: The identifier of the model to use. The model must be an embedding model registered with Llama Stack and available via the /models endpoint.\n:param input: Input text to embed, encoded as a string or array of strings. To embed multiple inputs in a single request, pass an array of strings.\n:param encoding_format: (Optional) The format to return the embeddings in. Can be either \"float\" or \"base64\". Defaults to \"float\".\n:param dimensions: (Optional) The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.\n:param user: (Optional) A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse." + description: Request parameters for OpenAI-compatible embeddings endpoint. OpenAIEmbeddingsResponse: properties: object: @@ -9875,7 +9925,7 @@ components: - model - usage title: OpenAIEmbeddingsResponse - description: "Response from an OpenAI-compatible embeddings request.\n\n:param object: The object type, which will be \"list\"\n:param data: List of embedding data objects\n:param model: The model that was used to generate the embeddings\n:param usage: Usage information" + description: Response from an OpenAI-compatible embeddings request. OpenAIFile: properties: type: @@ -9935,7 +9985,7 @@ components: - filename - purpose title: OpenAIFileObject - description: "OpenAI File object as defined in the OpenAI Files API.\n\n:param object: The object type, which is always \"file\"\n:param id: The file identifier, which can be referenced in the API endpoints\n:param bytes: The size of the file, in bytes\n:param created_at: The Unix timestamp (in seconds) for when the file was created\n:param expires_at: The Unix timestamp (in seconds) for when the file expires\n:param filename: The name of the file\n:param purpose: The intended purpose of the file" + description: OpenAI File object as defined in the OpenAI Files API. OpenAIFilePurpose: type: string enum: @@ -9955,7 +10005,7 @@ components: required: - url title: OpenAIImageURL - description: "Image URL specification for OpenAI-compatible chat completion messages.\n\n:param url: URL of the image to include in the message\n:param detail: (Optional) Level of detail for image processing. Can be \"low\", \"high\", or \"auto\"" + description: Image URL specification for OpenAI-compatible chat completion messages. OpenAIJSONSchema: properties: name: @@ -9973,7 +10023,7 @@ components: type: object type: object title: OpenAIJSONSchema - description: "JSON schema specification for OpenAI-compatible structured response format.\n\n:param name: Name of the schema\n:param description: (Optional) Description of the schema\n:param strict: (Optional) Whether to enforce strict adherence to the schema\n:param schema: (Optional) The JSON schema definition" + description: JSON schema specification for OpenAI-compatible structured response format. OpenAIResponseAnnotationCitation: properties: type: @@ -10000,7 +10050,7 @@ components: - title - url title: OpenAIResponseAnnotationCitation - description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + description: URL citation annotation for referencing external web resources. OpenAIResponseAnnotationContainerFileCitation: properties: type: @@ -10053,7 +10103,7 @@ components: - filename - index title: OpenAIResponseAnnotationFileCitation - description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + description: File citation annotation for referencing specific files in response content. OpenAIResponseAnnotationFilePath: properties: type: @@ -10086,7 +10136,7 @@ components: required: - refusal title: OpenAIResponseContentPartRefusal - description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + description: Refusal content within a streamed response part. OpenAIResponseError: properties: code: @@ -10100,7 +10150,7 @@ components: - code - message title: OpenAIResponseError - description: "Error details for failed OpenAI response requests.\n\n:param code: Error code identifying the type of failure\n:param message: Human-readable error message describing the failure" + description: Error details for failed OpenAI response requests. OpenAIResponseFormatJSONObject: properties: type: @@ -10110,7 +10160,7 @@ components: default: json_object type: object title: OpenAIResponseFormatJSONObject - description: "JSON object response format for OpenAI-compatible chat completion requests.\n\n:param type: Must be \"json_object\" to indicate generic JSON object response format" + description: JSON object response format for OpenAI-compatible chat completion requests. OpenAIResponseFormatJSONSchema: properties: type: @@ -10124,7 +10174,7 @@ components: required: - json_schema title: OpenAIResponseFormatJSONSchema - description: "JSON schema response format for OpenAI-compatible chat completion requests.\n\n:param type: Must be \"json_schema\" to indicate structured JSON response format\n:param json_schema: The JSON schema specification for the response" + description: JSON schema response format for OpenAI-compatible chat completion requests. OpenAIResponseFormatText: properties: type: @@ -10134,7 +10184,7 @@ components: default: text type: object title: OpenAIResponseFormatText - description: "Text response format for OpenAI-compatible chat completion requests.\n\n:param type: Must be \"text\" to indicate plain text response format" + description: Text response format for OpenAI-compatible chat completion requests. OpenAIResponseInputFunctionToolCallOutput: properties: call_id: @@ -10181,7 +10231,7 @@ components: type: string type: object title: OpenAIResponseInputMessageContentFile - description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + description: File content for input messages in OpenAI response format. OpenAIResponseInputMessageContentImage: properties: detail: @@ -10207,7 +10257,7 @@ components: type: string type: object title: OpenAIResponseInputMessageContentImage - description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + description: Image content for input messages in OpenAI response format. OpenAIResponseInputMessageContentText: properties: text: @@ -10222,7 +10272,7 @@ components: required: - text title: OpenAIResponseInputMessageContentText - description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + description: Text content for input messages in OpenAI response format. OpenAIResponseInputToolFileSearch: properties: type: @@ -10251,7 +10301,7 @@ components: required: - vector_store_ids title: OpenAIResponseInputToolFileSearch - description: "File search tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"file_search\"\n:param vector_store_ids: List of vector store identifiers to search within\n:param filters: (Optional) Additional filters to apply to the search\n:param max_num_results: (Optional) Maximum number of search results to return (1-50)\n:param ranking_options: (Optional) Options for ranking and scoring search results" + description: File search tool configuration for OpenAI response inputs. OpenAIResponseInputToolFunction: properties: type: @@ -10277,7 +10327,7 @@ components: - name - parameters title: OpenAIResponseInputToolFunction - description: "Function tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"function\"\n:param name: Name of the function that can be called\n:param description: (Optional) Description of what the function does\n:param parameters: (Optional) JSON schema defining the function's parameters\n:param strict: (Optional) Whether to enforce strict parameter validation" + description: Function tool configuration for OpenAI response inputs. OpenAIResponseInputToolMCP: properties: type: @@ -10316,7 +10366,7 @@ components: - server_label - server_url title: OpenAIResponseInputToolMCP - description: "Model Context Protocol (MCP) tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param server_url: URL endpoint of the MCP server\n:param headers: (Optional) HTTP headers to include when connecting to the server\n:param require_approval: Approval requirement for tool calls (\"always\", \"never\", or filter)\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + description: Model Context Protocol (MCP) tool configuration for OpenAI response inputs. OpenAIResponseInputToolWebSearch: properties: type: @@ -10336,7 +10386,7 @@ components: pattern: ^low|medium|high$ type: object title: OpenAIResponseInputToolWebSearch - description: "Web search tool configuration for OpenAI response inputs.\n\n:param type: Web search tool type variant to use\n:param search_context_size: (Optional) Size of search context, must be \"low\", \"medium\", or \"high\"" + description: Web search tool configuration for OpenAI response inputs. OpenAIResponseMCPApprovalRequest: properties: arguments: @@ -10598,7 +10648,7 @@ components: - output - status title: OpenAIResponseObject - description: "Complete OpenAI response object containing generation results and metadata.\n\n:param created_at: Unix timestamp when the response was created\n:param error: (Optional) Error details if the response generation failed\n:param id: Unique identifier for this response\n:param model: Model identifier used for generation\n:param object: Object type identifier, always \"response\"\n:param output: List of generated output items (messages, tool calls, etc.)\n:param parallel_tool_calls: Whether tool calls can be executed in parallel\n:param previous_response_id: (Optional) ID of the previous response in a conversation\n:param prompt: (Optional) Reference to a prompt template and its variables.\n:param status: Current status of the response generation\n:param temperature: (Optional) Sampling temperature used for generation\n:param text: Text formatting configuration for the response\n:param top_p: (Optional) Nucleus sampling parameter used for generation\n:param tools: (Optional) An array of tools the model may call while generating a response.\n:param truncation: (Optional) Truncation strategy applied to the response\n:param usage: (Optional) Token usage information for the response\n:param instructions: (Optional) System message inserted into the model's context" + description: Complete OpenAI response object containing generation results and metadata. OpenAIResponseOutputMessageContentOutputText: properties: text: @@ -10658,7 +10708,7 @@ components: - queries - status title: OpenAIResponseOutputMessageFileSearchToolCall - description: "File search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param queries: List of search queries executed\n:param status: Current status of the file search operation\n:param type: Tool call type identifier, always \"file_search_call\"\n:param results: (Optional) Search results returned by the file search operation" + description: File search tool call output message for OpenAI responses. OpenAIResponseOutputMessageFileSearchToolCallResults: properties: attributes: @@ -10685,7 +10735,7 @@ components: - score - text title: OpenAIResponseOutputMessageFileSearchToolCallResults - description: "Search results returned by the file search operation.\n\n:param attributes: (Optional) Key-value attributes associated with the file\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result (between 0 and 1)\n:param text: Text content of the search result" + description: Search results returned by the file search operation. OpenAIResponseOutputMessageFunctionToolCall: properties: call_id: @@ -10714,7 +10764,7 @@ components: - name - arguments title: OpenAIResponseOutputMessageFunctionToolCall - description: "Function tool call output message for OpenAI responses.\n\n:param call_id: Unique identifier for the function call\n:param name: Name of the function being called\n:param arguments: JSON string containing the function arguments\n:param type: Tool call type identifier, always \"function_call\"\n:param id: (Optional) Additional identifier for the tool call\n:param status: (Optional) Current status of the function call execution" + description: Function tool call output message for OpenAI responses. OpenAIResponseOutputMessageMCPCall: properties: id: @@ -10747,7 +10797,7 @@ components: - name - server_label title: OpenAIResponseOutputMessageMCPCall - description: "Model Context Protocol (MCP) call output message for OpenAI responses.\n\n:param id: Unique identifier for this MCP call\n:param type: Tool call type identifier, always \"mcp_call\"\n:param arguments: JSON string containing the MCP call arguments\n:param name: Name of the MCP method being called\n:param server_label: Label identifying the MCP server handling the call\n:param error: (Optional) Error message if the MCP call failed\n:param output: (Optional) Output result from the successful MCP call" + description: Model Context Protocol (MCP) call output message for OpenAI responses. OpenAIResponseOutputMessageMCPListTools: properties: id: @@ -10772,7 +10822,7 @@ components: - server_label - tools title: OpenAIResponseOutputMessageMCPListTools - description: "MCP list tools output message containing available tools from an MCP server.\n\n:param id: Unique identifier for this MCP list tools operation\n:param type: Tool call type identifier, always \"mcp_list_tools\"\n:param server_label: Label identifying the MCP server providing the tools\n:param tools: List of available tools provided by the MCP server" + description: MCP list tools output message containing available tools from an MCP server. OpenAIResponseOutputMessageWebSearchToolCall: properties: id: @@ -10791,7 +10841,7 @@ components: - id - status title: OpenAIResponseOutputMessageWebSearchToolCall - description: "Web search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param status: Current status of the web search operation\n:param type: Tool call type identifier, always \"web_search_call\"" + description: Web search tool call output message for OpenAI responses. OpenAIResponsePrompt: properties: id: @@ -10818,14 +10868,14 @@ components: required: - id title: OpenAIResponsePrompt - description: "OpenAI compatible Prompt object that is used in OpenAI responses.\n\n:param id: Unique identifier of the prompt template\n:param variables: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types\nlike images or files.\n:param version: Version number of the prompt to use (defaults to latest if not specified)" + description: OpenAI compatible Prompt object that is used in OpenAI responses. OpenAIResponseText: properties: format: $ref: '#/components/schemas/OpenAIResponseTextFormat' type: object title: OpenAIResponseText - description: "Text response configuration for OpenAI responses.\n\n:param format: (Optional) Text format configuration specifying output format requirements" + description: Text response configuration for OpenAI responses. OpenAIResponseTextFormat: properties: type: @@ -10852,7 +10902,7 @@ components: type: boolean type: object title: OpenAIResponseTextFormat - description: "Configuration for Responses API text format.\n\n:param type: Must be \"text\", \"json_schema\", or \"json_object\" to identify the format type\n:param name: The name of the response format. Only used for json_schema.\n:param schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model. Only used for json_schema.\n:param description: (Optional) A description of the response format. Only used for json_schema.\n:param strict: (Optional) Whether to strictly enforce the JSON schema. If true, the response must match the schema exactly. Only used for json_schema." + description: Configuration for Responses API text format. OpenAIResponseToolMCP: properties: type: @@ -10874,7 +10924,7 @@ components: required: - server_label title: OpenAIResponseToolMCP - description: "Model Context Protocol (MCP) tool configuration for OpenAI response object.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + description: Model Context Protocol (MCP) tool configuration for OpenAI response object. OpenAIResponseUsage: properties: input_tokens: @@ -10896,7 +10946,7 @@ components: - output_tokens - total_tokens title: OpenAIResponseUsage - description: "Usage information for OpenAI response.\n\n:param input_tokens: Number of tokens in the input\n:param output_tokens: Number of tokens in the output\n:param total_tokens: Total tokens used (input + output)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + description: Usage information for OpenAI response. OpenAIResponseUsageInputTokensDetails: properties: cached_tokens: @@ -10904,7 +10954,7 @@ components: type: integer type: object title: OpenAIResponseUsageInputTokensDetails - description: "Token details for input tokens in OpenAI response usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + description: Token details for input tokens in OpenAI response usage. OpenAIResponseUsageOutputTokensDetails: properties: reasoning_tokens: @@ -10912,7 +10962,7 @@ components: type: integer type: object title: OpenAIResponseUsageOutputTokensDetails - description: "Token details for output tokens in OpenAI response usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + description: Token details for output tokens in OpenAI response usage. OpenAISystemMessageParam: properties: role: @@ -10934,7 +10984,7 @@ components: required: - content title: OpenAISystemMessageParam - description: "A system message providing instructions or context to the model.\n\n:param role: Must be \"system\" to identify this as a system message\n:param content: The content of the \"system prompt\". If multiple system messages are provided, they are concatenated. The underlying Llama Stack code may also add other system messages (for example, for formatting tool definitions).\n:param name: (Optional) The name of the system message participant." + description: A system message providing instructions or context to the model. OpenAITokenLogProb: properties: token: @@ -10959,7 +11009,7 @@ components: - logprob - top_logprobs title: OpenAITokenLogProb - description: "The log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token\n:top_logprobs: The top log probabilities for the token" + description: The log probability for a token from an OpenAI-compatible chat completion response. OpenAIToolMessageParam: properties: role: @@ -10982,7 +11032,7 @@ components: - tool_call_id - content title: OpenAIToolMessageParam - description: "A message representing the result of a tool invocation in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"tool\" to identify this as a tool response\n:param tool_call_id: Unique identifier for the tool call this response is for\n:param content: The response content from the tool" + description: A message representing the result of a tool invocation in an OpenAI-compatible chat completion request. OpenAITopLogProb: properties: token: @@ -11001,7 +11051,7 @@ components: - token - logprob title: OpenAITopLogProb - description: "The top log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token" + description: The top log probability for a token from an OpenAI-compatible chat completion response. OpenAIUserMessageParam-Input: properties: role: @@ -11032,7 +11082,7 @@ components: required: - content title: OpenAIUserMessageParam - description: "A message from the user in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param name: (Optional) The name of the user message participant." + description: A message from the user in an OpenAI-compatible chat completion request. OpenAIUserMessageParam-Output: properties: role: @@ -11063,7 +11113,7 @@ components: required: - content title: OpenAIUserMessageParam - description: "A message from the user in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param name: (Optional) The name of the user message participant." + description: A message from the user in an OpenAI-compatible chat completion request. OptimizerConfig: properties: optimizer_type: @@ -11084,7 +11134,7 @@ components: - weight_decay - num_warmup_steps title: OptimizerConfig - description: "Configuration parameters for the optimization algorithm.\n\n:param optimizer_type: Type of optimizer to use (adam, adamw, or sgd)\n:param lr: Learning rate for the optimizer\n:param weight_decay: Weight decay coefficient for regularization\n:param num_warmup_steps: Number of steps for learning rate warmup" + description: Configuration parameters for the optimization algorithm. OptimizerType: type: string enum: @@ -11092,14 +11142,14 @@ components: - adamw - sgd title: OptimizerType - description: "Available optimizer algorithms for training.\n:cvar adam: Adaptive Moment Estimation optimizer\n:cvar adamw: AdamW optimizer with weight decay\n:cvar sgd: Stochastic Gradient Descent optimizer" + description: Available optimizer algorithms for training. Order: type: string enum: - asc - desc title: Order - description: "Sort order for paginated responses.\n:cvar asc: Ascending order\n:cvar desc: Descending order" + description: Sort order for paginated responses. OutputTokensDetails: properties: reasoning_tokens: @@ -11150,7 +11200,7 @@ components: - version - prompt_id title: Prompt - description: "A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack.\n\n:param prompt: The system prompt text with variable placeholders. Variables are only supported when using the Responses API.\n:param version: Version (integer starting at 1, incremented on save)\n:param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>'\n:param variables: List of prompt variable names that can be used in the prompt template\n:param is_default: Boolean indicating whether this version is the default version for this prompt" + description: A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack. ProviderInfo: properties: api: @@ -11178,7 +11228,7 @@ components: - config - health title: ProviderInfo - description: "Information about a registered provider including its configuration and health status.\n\n:param api: The API name this provider implements\n:param provider_id: Unique identifier for the provider\n:param provider_type: The type of provider implementation\n:param config: Configuration parameters for the provider\n:param health: Current health status of the provider" + description: Information about a registered provider including its configuration and health status. QueryChunksResponse: properties: chunks: @@ -11196,7 +11246,7 @@ components: - chunks - scores title: QueryChunksResponse - description: "Response from querying chunks in a vector database.\n\n:param chunks: List of content chunks returned from the query\n:param scores: Relevance scores corresponding to each returned chunk" + description: Response from querying chunks in a vector database. RAGQueryConfig: properties: query_generator_config: @@ -11239,7 +11289,7 @@ components: weighted: '#/components/schemas/WeightedRanker' type: object title: RAGQueryConfig - description: "Configuration for the RAG query generation.\n\n:param query_generator_config: Configuration for the query generator.\n:param max_tokens_in_context: Maximum number of tokens in the context.\n:param max_chunks: Maximum number of chunks to retrieve.\n:param chunk_template: Template for formatting each retrieved chunk in the context.\n Available placeholders: {index} (1-based chunk ordinal), {chunk.content} (chunk content string), {metadata} (chunk metadata dict).\n Default: \"Result {index}\\nContent: {chunk.content}\\nMetadata: {metadata}\\n\"\n:param mode: Search mode for retrieval—either \"vector\", \"keyword\", or \"hybrid\". Default \"vector\".\n:param ranker: Configuration for the ranker to use in hybrid search. Defaults to RRF ranker." + description: Configuration for the RAG query generation. RAGQueryResult: properties: content: @@ -11270,7 +11320,7 @@ components: title: Metadata type: object title: RAGQueryResult - description: "Result of a RAG query containing retrieved content and metadata.\n\n:param content: (Optional) The retrieved content from the query\n:param metadata: Additional metadata about the query result" + description: Result of a RAG query containing retrieved content and metadata. RAGSearchMode: type: string enum: @@ -11293,7 +11343,7 @@ components: minimum: 0.0 type: object title: RRFRanker - description: "Reciprocal Rank Fusion (RRF) ranker configuration.\n\n:param type: The type of ranker, always \"rrf\"\n:param impact_factor: The impact factor for RRF scoring. Higher values give more weight to higher-ranked results.\n Must be greater than 0" + description: Reciprocal Rank Fusion (RRF) ranker configuration. RegexParserScoringFnParams: properties: type: @@ -11315,7 +11365,7 @@ components: description: Aggregation functions to apply to the scores of each row type: object title: RegexParserScoringFnParams - description: "Parameters for regex parser scoring function configuration.\n:param type: The type of scoring function parameters, always regex_parser\n:param parsing_regexes: Regex to extract the answer from generated response\n:param aggregation_functions: Aggregation functions to apply to the scores of each row" + description: Parameters for regex parser scoring function configuration. RerankData: properties: index: @@ -11329,7 +11379,7 @@ components: - index - relevance_score title: RerankData - description: "A single rerank result from a reranking response.\n\n:param index: The original index of the document in the input list\n:param relevance_score: The relevance score from the model output. Values are inverted when applicable so that higher scores indicate greater relevance." + description: A single rerank result from a reranking response. RerankResponse: properties: data: @@ -11341,7 +11391,7 @@ components: required: - data title: RerankResponse - description: "Response from a reranking request.\n\n:param data: List of rerank result objects, sorted by relevance score (descending)" + description: Response from a reranking request. RouteInfo: properties: route: @@ -11361,7 +11411,7 @@ components: - method - provider_types title: RouteInfo - description: "Information about an API route including its path, method, and implementing providers.\n\n:param route: The API endpoint path\n:param method: HTTP method for the route\n:param provider_types: List of provider types that implement this route" + description: Information about an API route including its path, method, and implementing providers. RowsDataSource: properties: type: @@ -11379,14 +11429,14 @@ components: required: - rows title: RowsDataSource - description: "A dataset stored in rows.\n:param rows: The dataset is stored in rows. E.g.\n - [\n {\"messages\": [{\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}]}\n ]" + description: A dataset stored in rows. RunShieldResponse: properties: violation: $ref: '#/components/schemas/SafetyViolation' type: object title: RunShieldResponse - description: "Response from running a safety shield.\n\n:param violation: (Optional) Safety violation detected by the shield, if any" + description: Response from running a safety shield. SafetyViolation: properties: violation_level: @@ -11402,7 +11452,7 @@ components: required: - violation_level title: SafetyViolation - description: "Details of a safety violation detected by content moderation.\n\n:param violation_level: Severity level of the violation\n:param user_message: (Optional) Message to convey to the user about the violation\n:param metadata: Additional metadata including specific violation codes for debugging and telemetry" + description: Details of a safety violation detected by content moderation. SamplingParams: properties: strategy: @@ -11431,7 +11481,7 @@ components: type: array type: object title: SamplingParams - description: "Sampling parameters.\n\n:param strategy: The sampling strategy.\n:param max_tokens: The maximum number of tokens that can be generated in the completion. The token count of\n your prompt plus max_tokens cannot exceed the model's context length.\n:param repetition_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens\n based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\n:param stop: Up to 4 sequences where the API will stop generating further tokens.\n The returned text will not contain the stop sequence." + description: Sampling parameters. ScoreBatchResponse: properties: dataset_id: @@ -11446,7 +11496,7 @@ components: required: - results title: ScoreBatchResponse - description: "Response from batch scoring operations on datasets.\n\n:param dataset_id: (Optional) The identifier of the dataset that was scored\n:param results: A map of scoring function name to ScoringResult" + description: Response from batch scoring operations on datasets. ScoreResponse: properties: results: @@ -11458,7 +11508,7 @@ components: required: - results title: ScoreResponse - description: "The response from scoring.\n\n:param results: A map of scoring function name to ScoringResult." + description: The response from scoring. ScoringFn-Output: properties: identifier: @@ -11532,7 +11582,7 @@ components: - provider_id - return_type title: ScoringFn - description: "A scoring function resource for evaluating model outputs.\n:param type: The resource type, always scoring_function" + description: A scoring function resource for evaluating model outputs. ScoringResult: properties: score_rows: @@ -11550,7 +11600,7 @@ components: - score_rows - aggregated_results title: ScoringResult - description: "A scoring result for a single row.\n\n:param score_rows: The scoring result for each row. Each row is a map of column name to value.\n:param aggregated_results: Map of metric name to aggregated value" + description: A scoring result for a single row. SearchRankingOptions: properties: ranker: @@ -11562,7 +11612,7 @@ components: type: number type: object title: SearchRankingOptions - description: "Options for ranking and filtering search results.\n\n:param ranker: (Optional) Name of the ranking algorithm to use\n:param score_threshold: (Optional) Minimum relevance score threshold for results" + description: Options for ranking and filtering search results. Shield: properties: identifier: @@ -11591,7 +11641,7 @@ components: - identifier - provider_id title: Shield - description: "A safety shield resource that can be used to check content.\n\n:param params: (Optional) Configuration parameters for the shield\n:param type: The resource type, always shield" + description: A safety shield resource that can be used to check content. ShieldCallStep-Output: properties: turn_id: @@ -11621,7 +11671,7 @@ components: - step_id - violation title: ShieldCallStep - description: "A shield call step in an agent turn.\n\n:param violation: The violation from the shield call." + description: A shield call step in an agent turn. StopReason: type: string enum: @@ -11638,7 +11688,7 @@ components: default: string type: object title: StringType - description: "Parameter type for string values.\n\n:param type: Discriminator type. Always \"string\"" + description: Parameter type for string values. SystemMessage: properties: role: @@ -11672,14 +11722,14 @@ components: required: - content title: SystemMessage - description: "A system message providing instructions or context to the model.\n\n:param role: Must be \"system\" to identify this as a system message\n:param content: The content of the \"system prompt\". If multiple system messages are provided, they are concatenated. The underlying Llama Stack code may also add other system messages (for example, for formatting tool definitions)." + description: A system message providing instructions or context to the model. SystemMessageBehavior: type: string enum: - append - replace title: SystemMessageBehavior - description: "Config for how to override the default system prompt.\n\n:cvar append: Appends the provided system message to the default system prompt:\n https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt-\n:cvar replace: Replaces the default system prompt with the provided system message. The system message can include the string\n '{{function_definitions}}' to indicate where the function definitions should be inserted." + description: Config for how to override the default system prompt. TextContentItem: properties: type: @@ -11694,7 +11744,7 @@ components: required: - text title: TextContentItem - description: "A text content item\n\n:param type: Discriminator type of the content item. Always \"text\"\n:param text: Text content" + description: A text content item ToolCall: properties: call_id: @@ -11721,7 +11771,7 @@ components: - required - none title: ToolChoice - description: "Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model.\n\n:cvar auto: The model may use tools if it determines that is appropriate.\n:cvar required: The model must use tools.\n:cvar none: The model must not use tools." + description: Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model. ToolConfig: properties: tool_choice: @@ -11737,7 +11787,7 @@ components: $ref: '#/components/schemas/SystemMessageBehavior' type: object title: ToolConfig - description: "Configuration for tool use.\n\n:param tool_choice: (Optional) Whether tool use is automatic, required, or none. Can also specify a tool name to use a specific tool. Defaults to ToolChoice.auto.\n:param tool_prompt_format: (Optional) Instructs the model how to format tool calls. By default, Llama Stack will attempt to use a format that is best adapted to the model.\n - `ToolPromptFormat.json`: The tool calls are formatted as a JSON object.\n - `ToolPromptFormat.function_tag`: The tool calls are enclosed in a tag.\n - `ToolPromptFormat.python_list`: The tool calls are output as Python syntax -- a list of function calls.\n:param system_message_behavior: (Optional) Config for how to override the default system prompt.\n - `SystemMessageBehavior.append`: Appends the provided system message to the default system prompt.\n - `SystemMessageBehavior.replace`: Replaces the default system prompt with the provided system message. The system message can include the string\n '{{function_definitions}}' to indicate where the function definitions should be inserted." + description: Configuration for tool use. ToolDef: properties: toolgroup_id: @@ -11765,7 +11815,7 @@ components: required: - name title: ToolDef - description: "Tool definition used in runtime contexts.\n\n:param name: Name of the tool\n:param description: (Optional) Human-readable description of what the tool does\n:param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema)\n:param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema)\n:param metadata: (Optional) Additional metadata about the tool\n:param toolgroup_id: (Optional) ID of the tool group this tool belongs to" + description: Tool definition used in runtime contexts. ToolExecutionStep-Output: properties: turn_id: @@ -11804,7 +11854,7 @@ components: - tool_calls - tool_responses title: ToolExecutionStep - description: "A tool execution step in an agent turn.\n\n:param tool_calls: The tool calls to execute.\n:param tool_responses: The tool responses from the tool calls." + description: A tool execution step in an agent turn. ToolGroup: properties: identifier: @@ -11835,7 +11885,7 @@ components: - identifier - provider_id title: ToolGroup - description: "A group of related tools managed together.\n\n:param type: Type of resource, always 'tool_group'\n:param mcp_endpoint: (Optional) Model Context Protocol endpoint for remote tools\n:param args: (Optional) Additional arguments for the tool group" + description: A group of related tools managed together. ToolInvocationResult: properties: content: @@ -11872,7 +11922,7 @@ components: type: object type: object title: ToolInvocationResult - description: "Result of a tool invocation.\n\n:param content: (Optional) The output content from the tool execution\n:param error_message: (Optional) Error message if the tool execution failed\n:param error_code: (Optional) Numeric error code if the tool execution failed\n:param metadata: (Optional) Additional metadata about the tool execution" + description: Result of a tool invocation. ToolPromptFormat: type: string enum: @@ -11880,7 +11930,7 @@ components: - function_tag - python_list title: ToolPromptFormat - description: "Prompt format for calling custom / zero shot tools.\n\n:cvar json: JSON format for calling tools. It takes the form:\n {\n \"type\": \"function\",\n \"function\" : {\n \"name\": \"function_name\",\n \"description\": \"function_description\",\n \"parameters\": {...}\n }\n }\n:cvar function_tag: Function tag format, pseudo-XML. This looks like:\n (parameters)\n\n:cvar python_list: Python list. The output is a valid Python expression that can be\n evaluated to a list. Each element in the list is a function call. Example:\n [\"function_name(param1, param2)\", \"function_name(param1, param2)\"]" + description: Prompt format for calling custom / zero shot tools. ToolResponse-Input: properties: call_id: @@ -11923,7 +11973,7 @@ components: - tool_name - content title: ToolResponse - description: "Response from a tool invocation.\n\n:param call_id: Unique identifier for the tool call this response is for\n:param tool_name: Name of the tool that was invoked\n:param content: The response content from the tool\n:param metadata: (Optional) Additional metadata about the tool response" + description: Response from a tool invocation. ToolResponse-Output: properties: call_id: @@ -11966,7 +12016,7 @@ components: - tool_name - content title: ToolResponse - description: "Response from a tool invocation.\n\n:param call_id: Unique identifier for the tool call this response is for\n:param tool_name: Name of the tool that was invoked\n:param content: The response content from the tool\n:param metadata: (Optional) Additional metadata about the tool response" + description: Response from a tool invocation. ToolResponseMessage-Output: properties: role: @@ -12004,7 +12054,7 @@ components: - call_id - content title: ToolResponseMessage - description: "A message representing the result of a tool invocation.\n\n:param role: Must be \"tool\" to identify this as a tool response\n:param call_id: Unique identifier for the tool call this response is for\n:param content: The response content from the tool" + description: A message representing the result of a tool invocation. TopKSamplingStrategy: properties: type: @@ -12020,7 +12070,7 @@ components: required: - top_k title: TopKSamplingStrategy - description: "Top-k sampling strategy that restricts sampling to the k most likely tokens.\n\n:param type: Must be \"top_k\" to identify this sampling strategy\n:param top_k: Number of top tokens to consider for sampling. Must be at least 1" + description: Top-k sampling strategy that restricts sampling to the k most likely tokens. TopPSamplingStrategy: properties: type: @@ -12040,7 +12090,7 @@ components: required: - temperature title: TopPSamplingStrategy - description: "Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p.\n\n:param type: Must be \"top_p\" to identify this sampling strategy\n:param temperature: Controls randomness in sampling. Higher values increase randomness\n:param top_p: Cumulative probability threshold for nucleus sampling. Defaults to 0.95" + description: Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p. TrainingConfig: properties: n_epochs: @@ -12072,7 +12122,7 @@ components: required: - n_epochs title: TrainingConfig - description: "Comprehensive configuration for the training process.\n\n:param n_epochs: Number of training epochs to run\n:param max_steps_per_epoch: Maximum number of steps to run per epoch\n:param gradient_accumulation_steps: Number of steps to accumulate gradients before updating\n:param max_validation_steps: (Optional) Maximum number of validation steps per epoch\n:param data_config: (Optional) Configuration for data loading and formatting\n:param optimizer_config: (Optional) Configuration for the optimization algorithm\n:param efficiency_config: (Optional) Configuration for memory and compute optimizations\n:param dtype: (Optional) Data type for model parameters (bf16, fp16, fp32)" + description: Comprehensive configuration for the training process. Turn: properties: turn_id: @@ -12128,7 +12178,7 @@ components: - output_message - started_at title: Turn - description: "A single turn in an interaction with an Agentic System.\n\n:param turn_id: Unique identifier for the turn within a session\n:param session_id: Unique identifier for the conversation session\n:param input_messages: List of messages that initiated this turn\n:param steps: Ordered list of processing steps executed during this turn\n:param output_message: The model's generated response containing content and metadata\n:param output_attachments: (Optional) Files or media attached to the agent's response\n:param started_at: Timestamp when the turn began\n:param completed_at: (Optional) Timestamp when the turn finished, if completed" + description: A single turn in an interaction with an Agentic System. URIDataSource: properties: type: @@ -12143,7 +12193,7 @@ components: required: - uri title: URIDataSource - description: "A dataset that can be obtained from a URI.\n:param uri: The dataset can be obtained from a URI. E.g.\n - \"https://mywebsite.com/mydata.jsonl\"\n - \"lsfs://mydata.jsonl\"\n - \"data:csv;base64,{base64_content}\"" + description: A dataset that can be obtained from a URI. URL: properties: uri: @@ -12153,7 +12203,7 @@ components: required: - uri title: URL - description: "A URL reference to external content.\n\n:param uri: The URL string pointing to the resource" + description: A URL reference to external content. UnionType: properties: type: @@ -12163,7 +12213,7 @@ components: default: union type: object title: UnionType - description: "Parameter type for union values.\n\n:param type: Discriminator type. Always \"union\"" + description: Parameter type for union values. UserMessage-Input: properties: role: @@ -12219,7 +12269,7 @@ components: required: - content title: UserMessage - description: "A message from the user in a chat conversation.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param context: (Optional) This field is used internally by Llama Stack to pass RAG context. This field may be removed in the API in the future." + description: A message from the user in a chat conversation. UserMessage-Output: properties: role: @@ -12275,7 +12325,7 @@ components: required: - content title: UserMessage - description: "A message from the user in a chat conversation.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param context: (Optional) This field is used internally by Llama Stack to pass RAG context. This field may be removed in the API in the future." + description: A message from the user in a chat conversation. VectorStoreChunkingStrategyAuto: properties: type: @@ -12285,7 +12335,7 @@ components: default: auto type: object title: VectorStoreChunkingStrategyAuto - description: "Automatic chunking strategy for vector store files.\n\n:param type: Strategy type, always \"auto\" for automatic chunking" + description: Automatic chunking strategy for vector store files. VectorStoreChunkingStrategyStatic: properties: type: @@ -12299,7 +12349,7 @@ components: required: - static title: VectorStoreChunkingStrategyStatic - description: "Static chunking strategy with configurable parameters.\n\n:param type: Strategy type, always \"static\" for static chunking\n:param static: Configuration parameters for the static chunking strategy" + description: Static chunking strategy with configurable parameters. VectorStoreChunkingStrategyStaticConfig: properties: chunk_overlap_tokens: @@ -12314,7 +12364,7 @@ components: default: 800 type: object title: VectorStoreChunkingStrategyStaticConfig - description: "Configuration for static chunking strategy.\n\n:param chunk_overlap_tokens: Number of tokens to overlap between adjacent chunks\n:param max_chunk_size_tokens: Maximum number of tokens per chunk, must be between 100 and 4096" + description: Configuration for static chunking strategy. VectorStoreContent: properties: type: @@ -12329,7 +12379,7 @@ components: - type - text title: VectorStoreContent - description: "Content item from a vector store file or search result.\n\n:param type: Content type, currently only \"text\" is supported\n:param text: The actual text content" + description: Content item from a vector store file or search result. VectorStoreFileBatchObject: properties: id: @@ -12366,7 +12416,7 @@ components: - status - file_counts title: VectorStoreFileBatchObject - description: "OpenAI Vector Store File Batch object.\n\n:param id: Unique identifier for the file batch\n:param object: Object type identifier, always \"vector_store.file_batch\"\n:param created_at: Timestamp when the file batch was created\n:param vector_store_id: ID of the vector store containing the file batch\n:param status: Current processing status of the file batch\n:param file_counts: File processing status counts for the batch" + description: OpenAI Vector Store File Batch object. VectorStoreFileCounts: properties: completed: @@ -12392,7 +12442,7 @@ components: - in_progress - total title: VectorStoreFileCounts - description: "File processing status counts for a vector store.\n\n:param completed: Number of files that have been successfully processed\n:param cancelled: Number of files that had their processing cancelled\n:param failed: Number of files that failed to process\n:param in_progress: Number of files currently being processed\n:param total: Total number of files in the vector store" + description: File processing status counts for a vector store. VectorStoreFileLastError: properties: code: @@ -12410,7 +12460,7 @@ components: - code - message title: VectorStoreFileLastError - description: "Error information for failed vector store file processing.\n\n:param code: Error code indicating the type of failure\n:param message: Human-readable error message describing the failure" + description: Error information for failed vector store file processing. VectorStoreFileObject: properties: id: @@ -12465,7 +12515,7 @@ components: - status - vector_store_id title: VectorStoreFileObject - description: "OpenAI Vector Store File object.\n\n:param id: Unique identifier for the file\n:param object: Object type identifier, always \"vector_store.file\"\n:param attributes: Key-value attributes associated with the file\n:param chunking_strategy: Strategy used for splitting the file into chunks\n:param created_at: Timestamp when the file was added to the vector store\n:param last_error: (Optional) Error information if file processing failed\n:param status: Current processing status of the file\n:param usage_bytes: Storage space used by this file in bytes\n:param vector_store_id: ID of the vector store containing this file" + description: OpenAI Vector Store File object. VectorStoreObject: properties: id: @@ -12511,7 +12561,7 @@ components: - created_at - file_counts title: VectorStoreObject - description: "OpenAI Vector Store object.\n\n:param id: Unique identifier for the vector store\n:param object: Object type identifier, always \"vector_store\"\n:param created_at: Timestamp when the vector store was created\n:param name: (Optional) Name of the vector store\n:param usage_bytes: Storage space used by the vector store in bytes\n:param file_counts: File processing status counts for the vector store\n:param status: Current status of the vector store\n:param expires_after: (Optional) Expiration policy for the vector store\n:param expires_at: (Optional) Timestamp when the vector store will expire\n:param last_active_at: (Optional) Timestamp of last activity on the vector store\n:param metadata: Set of key-value pairs that can be attached to the vector store" + description: OpenAI Vector Store object. VectorStoreSearchResponse: properties: file_id: @@ -12543,7 +12593,7 @@ components: - score - content title: VectorStoreSearchResponse - description: "Response from searching a vector store.\n\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result\n:param attributes: (Optional) Key-value attributes associated with the file\n:param content: List of content items matching the search query" + description: Response from searching a vector store. VectorStoreSearchResponsePage: properties: object: @@ -12570,7 +12620,7 @@ components: - search_query - data title: VectorStoreSearchResponsePage - description: "Paginated response from searching a vector store.\n\n:param object: Object type identifier for the search results page\n:param search_query: The original search query that was executed\n:param data: List of search result objects\n:param has_more: Whether there are more results available beyond this page\n:param next_page: (Optional) Token for retrieving the next page of results" + description: Paginated response from searching a vector store. VersionInfo: properties: version: @@ -12580,7 +12630,7 @@ components: required: - version title: VersionInfo - description: "Version information for the service.\n\n:param version: Version number of the service" + description: Version information for the service. ViolationLevel: type: string enum: @@ -12588,7 +12638,7 @@ components: - warn - error title: ViolationLevel - description: "Severity level of a safety violation.\n\n:cvar INFO: Informational level violation that does not require action\n:cvar WARN: Warning level violation that suggests caution but allows continuation\n:cvar ERROR: Error level violation that requires blocking or intervention" + description: Severity level of a safety violation. WeightedRanker: properties: type: @@ -12605,7 +12655,7 @@ components: default: 0.5 type: object title: WeightedRanker - description: "Weighted ranker configuration that combines vector and keyword scores.\n\n:param type: The type of ranker, always \"weighted\"\n:param alpha: Weight factor between 0 and 1.\n 0 means only use keyword scores,\n 1 means only use vector scores,\n values in between blend both scores." + description: Weighted ranker configuration that combines vector and keyword scores. _URLOrData: properties: url: @@ -12616,7 +12666,7 @@ components: type: string type: object title: _URLOrData - description: "A URL or a base64 encoded string\n\n:param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. Note that URL could have length limits.\n:param data: base64 encoded image data as string" + description: A URL or a base64 encoded string __main_____agents_agent_id_session_Request: properties: agent_id: @@ -13186,7 +13236,7 @@ components: - ranking_options title: _vector_stores_vector_store_id_search_Request Error: - description: "Error response from the API. Roughly follows RFC 7807.\n\n:param status: HTTP status code\n:param title: Error title, a short summary of the error which is invariant for an error type\n:param detail: Error detail, a longer human-readable description of the error\n:param instance: (Optional) A URL which can be used to retrieve more information about the specific occurrence of the error" + description: Error response from the API. Roughly follows RFC 7807. properties: status: title: Status @@ -13208,7 +13258,7 @@ components: title: Error type: object Agent: - description: "An agent instance with configuration and metadata.\n\n:param agent_id: Unique identifier for the agent\n:param agent_config: Configuration settings for the agent\n:param created_at: Timestamp when the agent was created" + description: An agent instance with configuration and metadata. properties: agent_id: title: Agent Id @@ -13226,7 +13276,7 @@ components: title: Agent type: object AgentStepResponse: - description: "Response containing details of a specific agent step.\n\n:param step: The complete step data and execution details" + description: Response containing details of a specific agent step. properties: step: discriminator: @@ -13247,7 +13297,7 @@ components: title: AgentStepResponse type: object CompletionMessage: - description: "A message containing the model's (assistant) response in a chat conversation.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param stop_reason: Reason why the model stopped generating. Options are:\n - `StopReason.end_of_turn`: The model finished generating the entire response.\n - `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n - `StopReason.out_of_tokens`: The model ran out of token budget.\n:param tool_calls: List of tool calls. Each tool call is a ToolCall object." + description: A message containing the model's (assistant) response in a chat conversation. properties: role: const: assistant @@ -13289,7 +13339,7 @@ components: title: CompletionMessage type: object InferenceStep: - description: "An inference step in an agent turn.\n\n:param model_response: The response from the LLM." + description: An inference step in an agent turn. properties: turn_id: title: Turn Id @@ -13321,7 +13371,7 @@ components: title: InferenceStep type: object ListOpenAIResponseInputItem: - description: "List container for OpenAI response input items.\n\n:param data: List of input items\n:param object: Object type identifier, always \"list\"" + description: List container for OpenAI response input items. properties: data: items: @@ -13359,7 +13409,7 @@ components: title: ListOpenAIResponseInputItem type: object ListOpenAIResponseObject: - description: "Paginated list of OpenAI response objects with navigation metadata.\n\n:param data: List of response objects with their input context\n:param has_more: Whether there are more results available beyond this page\n:param first_id: Identifier of the first item in this page\n:param last_id: Identifier of the last item in this page\n:param object: Object type identifier, always \"list\"" + description: Paginated list of OpenAI response objects with navigation metadata. properties: data: items: @@ -13388,7 +13438,7 @@ components: title: ListOpenAIResponseObject type: object MemoryRetrievalStep: - description: "A memory retrieval step in an agent turn.\n\n:param vector_store_ids: The IDs of the vector databases to retrieve context from.\n:param inserted_context: The context retrieved from the vector databases." + description: A memory retrieval step in an agent turn. properties: turn_id: title: Turn Id @@ -13444,7 +13494,7 @@ components: title: MemoryRetrievalStep type: object OpenAIDeleteResponseObject: - description: "Response object confirming deletion of an OpenAI response.\n\n:param id: Unique identifier of the deleted response\n:param object: Object type identifier, always \"response\"\n:param deleted: Deletion confirmation flag, always True" + description: Response object confirming deletion of an OpenAI response. properties: id: title: Id @@ -13463,7 +13513,7 @@ components: title: OpenAIDeleteResponseObject type: object PaginatedResponse: - description: "A generic paginated response that follows a simple format.\n\n:param data: The list of items for the current page\n:param has_more: Whether there are more items available after this set\n:param url: The URL for accessing this list" + description: A generic paginated response that follows a simple format. properties: data: items: @@ -13484,7 +13534,7 @@ components: title: PaginatedResponse type: object Session: - description: "A single session of an interaction with an Agentic System.\n\n:param session_id: Unique identifier for the conversation session\n:param session_name: Human-readable name for the session\n:param turns: List of all turns that have occurred in this session\n:param started_at: Timestamp when the session was created" + description: A single session of an interaction with an Agentic System. properties: session_id: title: Session Id @@ -13509,7 +13559,7 @@ components: title: Session type: object ShieldCallStep: - description: "A shield call step in an agent turn.\n\n:param violation: The violation from the shield call." + description: A shield call step in an agent turn. properties: turn_id: title: Turn Id @@ -13541,7 +13591,7 @@ components: title: ShieldCallStep type: object ToolExecutionStep: - description: "A tool execution step in an agent turn.\n\n:param tool_calls: The tool calls to execute.\n:param tool_responses: The tool responses from the tool calls." + description: A tool execution step in an agent turn. properties: turn_id: title: Turn Id @@ -13582,7 +13632,7 @@ components: title: ToolExecutionStep type: object ToolResponse: - description: "Response from a tool invocation.\n\n:param call_id: Unique identifier for the tool call this response is for\n:param tool_name: Name of the tool that was invoked\n:param content: The response content from the tool\n:param metadata: (Optional) Additional metadata about the tool response" + description: Response from a tool invocation. properties: call_id: title: Call Id @@ -13701,7 +13751,7 @@ components: title: ConversationItemDeletedResource type: object ListOpenAIFileResponse: - description: "Response for listing files in OpenAI Files API.\n\n:param data: List of file objects\n:param has_more: Whether there are more files available beyond this page\n:param first_id: ID of the first file in the list for pagination\n:param last_id: ID of the last file in the list for pagination\n:param object: The object type, which is always \"list\"" + description: Response for listing files in OpenAI Files API. properties: data: items: @@ -13730,7 +13780,7 @@ components: title: ListOpenAIFileResponse type: object OpenAIFileDeleteResponse: - description: "Response for deleting a file in OpenAI Files API.\n\n:param id: The file identifier that was deleted\n:param object: The object type, which is always \"file\"\n:param deleted: Whether the file was successfully deleted" + description: Response for deleting a file in OpenAI Files API. properties: id: title: Id @@ -13749,7 +13799,7 @@ components: title: OpenAIFileDeleteResponse type: object ListOpenAIChatCompletionResponse: - description: "Response from listing OpenAI-compatible chat completions.\n\n:param data: List of chat completion objects with their input messages\n:param has_more: Whether there are more completions available beyond this list\n:param first_id: ID of the first completion in this list\n:param last_id: ID of the last completion in this list\n:param object: Must be \"list\" to identify this as a list response" + description: Response from listing OpenAI-compatible chat completions. properties: data: items: @@ -15440,7 +15490,7 @@ components: title: ListOpenAIChatCompletionResponse type: object OpenAIAssistantMessageParam: - description: "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param name: (Optional) The name of the assistant message participant.\n:param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object." + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. properties: role: const: assistant @@ -15468,7 +15518,7 @@ components: title: OpenAIAssistantMessageParam type: object OpenAIChoice: - description: "A choice from an OpenAI-compatible chat completion response.\n\n:param message: The message from the model\n:param finish_reason: The reason the model stopped generating\n:param index: The index of the choice\n:param logprobs: (Optional) The log probabilities for the tokens in the message" + description: A choice from an OpenAI-compatible chat completion response. properties: message: discriminator: @@ -15502,7 +15552,7 @@ components: title: OpenAIChoice type: object OpenAIChoiceLogprobs: - description: "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response.\n\n:param content: (Optional) The log probabilities for the tokens in the message\n:param refusal: (Optional) The log probabilities for the tokens in the message" + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. properties: content: title: Content @@ -15569,7 +15619,7 @@ components: title: OpenAICompletionWithInputMessages type: object OpenAIUserMessageParam: - description: "A message from the user in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param name: (Optional) The name of the user message participant." + description: A message from the user in an OpenAI-compatible chat completion request. properties: role: const: user @@ -15601,7 +15651,7 @@ components: title: OpenAIUserMessageParam type: object Checkpoint: - description: "Checkpoint created during training runs.\n\n:param identifier: Unique identifier for the checkpoint\n:param created_at: Timestamp when the checkpoint was created\n:param epoch: Training epoch when the checkpoint was saved\n:param post_training_job_id: Identifier of the training job that created this checkpoint\n:param path: File system path where the checkpoint is stored\n:param training_metrics: (Optional) Training metrics associated with this checkpoint" + description: Checkpoint created during training runs. properties: identifier: title: Identifier @@ -15631,7 +15681,7 @@ components: title: Checkpoint type: object PostTrainingJobArtifactsResponse: - description: "Artifacts of a finetuning job.\n\n:param job_uuid: Unique identifier for the training job\n:param checkpoints: List of model checkpoints created during training" + description: Artifacts of a finetuning job. properties: job_uuid: title: Job Uuid @@ -15646,7 +15696,7 @@ components: title: PostTrainingJobArtifactsResponse type: object PostTrainingJobStatusResponse: - description: "Status of a finetuning job.\n\n:param job_uuid: Unique identifier for the training job\n:param status: Current status of the training job\n:param scheduled_at: (Optional) Timestamp when the job was scheduled\n:param started_at: (Optional) Timestamp when the job execution began\n:param completed_at: (Optional) Timestamp when the job finished, if completed\n:param resources_allocated: (Optional) Information about computational resources allocated to the job\n:param checkpoints: List of model checkpoints created during training" + description: Status of a finetuning job. properties: job_uuid: title: Job Uuid @@ -15684,7 +15734,7 @@ components: title: PostTrainingJobStatusResponse type: object ScoringFn: - description: "A scoring function resource for evaluating model outputs.\n:param type: The resource type, always scoring_function" + description: A scoring function resource for evaluating model outputs. properties: identifier: description: Unique identifier for this resource in llama stack @@ -16484,7 +16534,7 @@ components: title: URL type: object ListToolDefsResponse: - description: "Response containing a list of tool definitions.\n\n:param data: List of tool definitions" + description: Response containing a list of tool definitions. properties: data: items: @@ -16496,7 +16546,7 @@ components: title: ListToolDefsResponse type: object VectorStoreDeleteResponse: - description: "Response from deleting a vector store.\n\n:param id: Unique identifier of the deleted vector store\n:param object: Object type identifier for the deletion response\n:param deleted: Whether the deletion operation was successful" + description: Response from deleting a vector store. properties: id: title: Id @@ -16514,7 +16564,7 @@ components: title: VectorStoreDeleteResponse type: object VectorStoreFileContentsResponse: - description: "Response from retrieving the contents of a vector store file.\n\n:param file_id: Unique identifier for the file\n:param filename: Name of the file\n:param attributes: Key-value attributes associated with the file\n:param content: List of content items from the file" + description: Response from retrieving the contents of a vector store file. properties: file_id: title: File Id @@ -16539,7 +16589,7 @@ components: title: VectorStoreFileContentsResponse type: object VectorStoreFileDeleteResponse: - description: "Response from deleting a vector store file.\n\n:param id: Unique identifier of the deleted file\n:param object: Object type identifier for the deletion response\n:param deleted: Whether the deletion operation was successful" + description: Response from deleting a vector store file. properties: id: title: Id @@ -16557,7 +16607,7 @@ components: title: VectorStoreFileDeleteResponse type: object VectorStoreFilesListInBatchResponse: - description: "Response from listing files in a vector store file batch.\n\n:param object: Object type identifier, always \"list\"\n:param data: List of vector store file objects in the batch\n:param first_id: (Optional) ID of the first file in the list for pagination\n:param last_id: (Optional) ID of the last file in the list for pagination\n:param has_more: Whether there are more files available beyond this page" + description: Response from listing files in a vector store file batch. properties: object: default: list @@ -16585,7 +16635,7 @@ components: title: VectorStoreFilesListInBatchResponse type: object VectorStoreListFilesResponse: - description: "Response from listing files in a vector store.\n\n:param object: Object type identifier, always \"list\"\n:param data: List of vector store file objects\n:param first_id: (Optional) ID of the first file in the list for pagination\n:param last_id: (Optional) ID of the last file in the list for pagination\n:param has_more: Whether there are more files available beyond this page" + description: Response from listing files in a vector store. properties: object: default: list @@ -16613,7 +16663,7 @@ components: title: VectorStoreListFilesResponse type: object VectorStoreListResponse: - description: "Response from listing vector stores.\n\n:param object: Object type identifier, always \"list\"\n:param data: List of vector store objects\n:param first_id: (Optional) ID of the first vector store in the list for pagination\n:param last_id: (Optional) ID of the last vector store in the list for pagination\n:param has_more: Whether there are more vector stores available beyond this page" + description: Response from listing vector stores. properties: object: default: list @@ -16699,7 +16749,7 @@ components: title: OpenAIResponseMessage type: object OpenAIResponseObjectWithInput: - description: "OpenAI response object extended with input context information.\n\n:param input: List of input items that led to this response" + description: OpenAI response object extended with input context information. properties: created_at: title: Created At @@ -18473,7 +18523,7 @@ components: title: OpenAIResponseObjectWithInput type: object ImageContentItem: - description: "A image content item\n\n:param type: Discriminator type of the content item. Always \"image\"\n:param image: Image as a base64 encoded string or an URL" + description: A image content item properties: type: const: image @@ -18688,9 +18738,9 @@ components: example: status: 500 title: Internal Server Error - detail: An unexpected error occurred + detail: An unexpected error occurred. Our team has been notified. DefaultError: - description: An error occurred + description: An unexpected error occurred content: application/json: schema: diff --git a/docs/static/deprecated-llama-stack-spec.json b/docs/static/deprecated-llama-stack-spec.json new file mode 100644 index 0000000000..8614bd0b72 --- /dev/null +++ b/docs/static/deprecated-llama-stack-spec.json @@ -0,0 +1,18640 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Llama Stack API", + "description": "A comprehensive API for building and deploying AI applications", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://api.llamastack.com", + "description": "Production server" + }, + { + "url": "https://staging-api.llamastack.com", + "description": "Staging server" + } + ], + "paths": { + "/v1/agents": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all agents.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_agents_v1_agents_get", + "deprecated": true, + "parameters": [ + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Limit" + } + }, + { + "name": "start_index", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Start Index" + } + } + ], + "responses": { + "200": { + "description": "A PaginatedResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Create an agent with the given configuration.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_agent_v1_agents_post", + "deprecated": true, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentConfig" + } + } + } + }, + "responses": { + "200": { + "description": "An AgentCreateResponse with the agent ID.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentCreateResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/agents/{agent_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete an agent by its ID and its associated sessions and turns.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "delete_agent_v1_agents__agent_id__delete", + "deprecated": true, + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the agent to delete." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Describe an agent by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_agent_v1_agents__agent_id__get", + "deprecated": true, + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Agent Id" + }, + "description": "ID of the agent." + } + ], + "responses": { + "200": { + "description": "An Agent of the agent.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Agent" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/agents/{agent_id}/session": { + "post": { + "tags": [ + "V1" + ], + "summary": "Create a new session for an agent.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_agent_session_v1_agents__agent_id__session_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/__main_____agents_agent_id_session_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "An AgentSessionCreateResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentSessionCreateResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true, + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the agent to create the session for." + } + ] + } + }, + "/v1/agents/{agent_id}/session/{session_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete an agent session by its ID and its associated turns.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "delete_agents_session_v1_agents__agent_id__session__session_id__delete", + "deprecated": true, + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the session to delete." + }, + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the agent to delete the session for." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve an agent session by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_agents_session_v1_agents__agent_id__session__session_id__get", + "deprecated": true, + "parameters": [ + { + "name": "turn_ids", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Turn Ids" + } + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Session Id" + }, + "description": "The ID of the session to get." + }, + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Agent Id" + }, + "description": "The ID of the agent to get the session for." + } + ], + "responses": { + "200": { + "description": "A Session.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Session" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/agents/{agent_id}/session/{session_id}/turn": { + "post": { + "tags": [ + "V1" + ], + "summary": "Create a new turn for an agent.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_agent_turn_v1_agents__agent_id__session__session_id__turn_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/__main_____agents_agent_id_session_session_id_turn_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "If stream=False, returns a Turn object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Turn" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true, + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the agent to create the turn for." + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the session to create the turn for." + } + ] + } + }, + "/v1/agents/{agent_id}/session/{session_id}/turn/{turn_id}": { + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve an agent turn by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_agents_turn_v1_agents__agent_id__session__session_id__turn__turn_id__get", + "deprecated": true, + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Agent Id" + }, + "description": "The ID of the agent to get the turn for." + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Session Id" + }, + "description": "The ID of the session to get the turn for." + }, + { + "name": "turn_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Turn Id" + }, + "description": "The ID of the turn to get." + } + ], + "responses": { + "200": { + "description": "A Turn.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Turn" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume": { + "post": { + "tags": [ + "V1" + ], + "summary": "Resume an agent turn with executed tool call responses.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "resume_agent_turn_v1_agents__agent_id__session__session_id__turn__turn_id__resume_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A Turn object if stream is False, otherwise an AsyncIterator of AgentTurnResponseStreamChunk objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Turn" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true, + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the agent to resume." + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the session to resume." + }, + { + "name": "turn_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the turn to resume." + } + ] + } + }, + "/v1/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}": { + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve an agent step by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_agents_step_v1_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get", + "deprecated": true, + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Agent Id" + }, + "description": "The ID of the agent to get the step for." + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Session Id" + }, + "description": "The ID of the session to get the step for." + }, + { + "name": "turn_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Turn Id" + }, + "description": "The ID of the turn to get the step for." + }, + { + "name": "step_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Step Id" + }, + "description": "The ID of the step to get." + } + ], + "responses": { + "200": { + "description": "An AgentStepResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentStepResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/agents/{agent_id}/sessions": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all session(s) of a given agent.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_agent_sessions_v1_agents__agent_id__sessions_get", + "deprecated": true, + "parameters": [ + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Limit" + } + }, + { + "name": "start_index", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Start Index" + } + }, + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Agent Id" + }, + "description": "The ID of the agent to list sessions for." + } + ], + "responses": { + "200": { + "description": "A PaginatedResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/datasetio/append-rows/{dataset_id}": { + "post": { + "tags": [ + "V1" + ], + "summary": "Append rows to a dataset.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "append_rows_v1_datasetio_append_rows__dataset_id__post", + "deprecated": true, + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "dataset_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "Path parameter: dataset_id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/datasetio/iterrows/{dataset_id}": { + "get": { + "tags": [ + "V1" + ], + "summary": "Get a paginated list of rows from a dataset.", + "description": "Query endpoint for proper schema generation.", + "operationId": "iterrows_v1_datasetio_iterrows__dataset_id__get", + "deprecated": true, + "parameters": [ + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Limit" + } + }, + { + "name": "start_index", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Start Index" + } + }, + { + "name": "dataset_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Dataset Id" + } + } + ], + "responses": { + "200": { + "description": "A PaginatedResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/datasets": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all datasets.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_datasets_v1_datasets_get", + "responses": { + "200": { + "description": "A ListDatasetsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListDatasetsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Register a new dataset.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "register_dataset_v1_datasets_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/__main_____datasets_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A Dataset.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Dataset" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true + } + }, + "/v1/datasets/{dataset_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Unregister a dataset by its ID.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "unregister_dataset_v1_datasets__dataset_id__delete", + "deprecated": true, + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "dataset_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "Path parameter: dataset_id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Get a dataset by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_dataset_v1_datasets__dataset_id__get", + "deprecated": true, + "parameters": [ + { + "name": "dataset_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Dataset Id" + } + } + ], + "responses": { + "200": { + "description": "A Dataset.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Dataset" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/eval/benchmarks": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all benchmarks.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_benchmarks_v1_eval_benchmarks_get", + "deprecated": true, + "responses": { + "200": { + "description": "A ListBenchmarksResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBenchmarksResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Register a benchmark.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "register_benchmark_v1_eval_benchmarks_post", + "deprecated": true, + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/eval/benchmarks/{benchmark_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Unregister a benchmark.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "unregister_benchmark_v1_eval_benchmarks__benchmark_id__delete", + "deprecated": true, + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the benchmark to unregister." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Get a benchmark by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_benchmark_v1_eval_benchmarks__benchmark_id__get", + "deprecated": true, + "parameters": [ + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Benchmark Id" + }, + "description": "The ID of the benchmark to get." + } + ], + "responses": { + "200": { + "description": "A Benchmark.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Benchmark" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/eval/benchmarks/{benchmark_id}/evaluations": { + "post": { + "tags": [ + "V1" + ], + "summary": "Evaluate a list of rows on a benchmark.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "evaluate_rows_v1_eval_benchmarks__benchmark_id__evaluations_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BenchmarkConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "EvaluateResponse object containing generations and scores.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvaluateResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true, + "parameters": [ + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the benchmark to run the evaluation on." + } + ] + } + }, + "/v1/eval/benchmarks/{benchmark_id}/jobs": { + "post": { + "tags": [ + "V1" + ], + "summary": "Run an evaluation on a benchmark.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "run_eval_v1_eval_benchmarks__benchmark_id__jobs_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BenchmarkConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The job that was created to run the evaluation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Job" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true, + "parameters": [ + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the benchmark to run the evaluation on." + } + ] + } + }, + "/v1/eval/benchmarks/{benchmark_id}/jobs/{job_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Cancel a job.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "job_cancel_v1_eval_benchmarks__benchmark_id__jobs__job_id__delete", + "deprecated": true, + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the benchmark to run the evaluation on." + }, + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the job to cancel." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Get the status of a job.", + "description": "Query endpoint for proper schema generation.", + "operationId": "job_status_v1_eval_benchmarks__benchmark_id__jobs__job_id__get", + "deprecated": true, + "parameters": [ + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Benchmark Id" + }, + "description": "The ID of the benchmark to run the evaluation on." + }, + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Job Id" + }, + "description": "The ID of the job to get the status of." + } + ], + "responses": { + "200": { + "description": "The status of the evaluation job.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Job" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result": { + "get": { + "tags": [ + "V1" + ], + "summary": "Get the result of a job.", + "description": "Query endpoint for proper schema generation.", + "operationId": "job_result_v1_eval_benchmarks__benchmark_id__jobs__job_id__result_get", + "deprecated": true, + "parameters": [ + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Benchmark Id" + }, + "description": "The ID of the benchmark to run the evaluation on." + }, + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Job Id" + }, + "description": "The ID of the job to get the result of." + } + ], + "responses": { + "200": { + "description": "The result of the job.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvaluateResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/openai/v1/batches": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all batches for the current user.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_batches_v1_openai_v1_batches_get", + "deprecated": true, + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + } + ], + "responses": { + "200": { + "description": "A list of batch objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBatchesResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Create a new batch for processing multiple API requests.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_batch_v1_openai_v1_batches_post", + "deprecated": true, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_openai_v1_batches_Request" + } + } + } + }, + "responses": { + "200": { + "description": "The created batch object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Batch" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/openai/v1/batches/{batch_id}": { + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve information about a specific batch.", + "description": "Query endpoint for proper schema generation.", + "operationId": "retrieve_batch_v1_openai_v1_batches__batch_id__get", + "deprecated": true, + "parameters": [ + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Batch Id" + }, + "description": "The ID of the batch to retrieve." + } + ], + "responses": { + "200": { + "description": "The batch object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Batch" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/openai/v1/batches/{batch_id}/cancel": { + "post": { + "tags": [ + "V1" + ], + "summary": "Cancel a batch that is in progress.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "cancel_batch_v1_openai_v1_batches__batch_id__cancel_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_openai_v1_batches_batch_id_cancel_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The updated batch object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Batch" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true, + "parameters": [ + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the batch to cancel." + } + ] + } + }, + "/v1/openai/v1/chat/completions": { + "get": { + "tags": [ + "V1" + ], + "summary": "List chat completions.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_chat_completions_v1_openai_v1_chat_completions_get", + "deprecated": true, + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "model", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Model" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/Order", + "default": "desc" + } + } + ], + "responses": { + "200": { + "description": "A ListOpenAIChatCompletionResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOpenAIChatCompletionResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Create chat completions.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_chat_completion_v1_openai_v1_chat_completions_post", + "deprecated": true, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIChatCompletionRequestWithExtraBody" + } + } + } + }, + "responses": { + "200": { + "description": "An OpenAIChatCompletion.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIChatCompletion" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/openai/v1/chat/completions/{completion_id}": { + "get": { + "tags": [ + "V1" + ], + "summary": "Get chat completion.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_chat_completion_v1_openai_v1_chat_completions__completion_id__get", + "deprecated": true, + "parameters": [ + { + "name": "completion_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Completion Id" + }, + "description": "ID of the chat completion." + } + ], + "responses": { + "200": { + "description": "A OpenAICompletionWithInputMessages.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAICompletionWithInputMessages" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/openai/v1/completions": { + "post": { + "tags": [ + "V1" + ], + "summary": "Create completion.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_completion_v1_openai_v1_completions_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAICompletionRequestWithExtraBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "An OpenAICompletion.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAICompletion" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true + } + }, + "/v1/openai/v1/embeddings": { + "post": { + "tags": [ + "V1" + ], + "summary": "Create embeddings.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_embeddings_v1_openai_v1_embeddings_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "An OpenAIEmbeddingsResponse containing the embeddings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIEmbeddingsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true + } + }, + "/v1/openai/v1/files": { + "get": { + "tags": [ + "V1" + ], + "summary": "List files.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_list_files_v1_openai_v1_files_get", + "deprecated": true, + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "purpose", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/OpenAIFilePurpose" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 10000, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/Order", + "default": "desc" + } + } + ], + "responses": { + "200": { + "description": "An ListOpenAIFileResponse containing the list of files.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOpenAIFileResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Upload file.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "openai_upload_file_v1_openai_v1_files_post", + "deprecated": true, + "responses": { + "200": { + "description": "An OpenAIFileObject representing the uploaded file.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIFileObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/openai/v1/files/{file_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete file.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_delete_file_v1_openai_v1_files__file_id__delete", + "deprecated": true, + "parameters": [ + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + }, + "description": "The ID of the file to use for this request." + } + ], + "responses": { + "200": { + "description": "An OpenAIFileDeleteResponse indicating successful deletion.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIFileDeleteResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve file.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_retrieve_file_v1_openai_v1_files__file_id__get", + "deprecated": true, + "parameters": [ + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + }, + "description": "The ID of the file to use for this request." + } + ], + "responses": { + "200": { + "description": "An OpenAIFileObject containing file information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIFileObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/openai/v1/files/{file_id}/content": { + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve file content.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "openai_retrieve_file_content_v1_openai_v1_files__file_id__content_get", + "deprecated": true, + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the file to use for this request." + } + ], + "responses": { + "200": { + "description": "The raw file content as a binary response.", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/openai/v1/models": { + "get": { + "tags": [ + "V1" + ], + "summary": "List models using the OpenAI API.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "openai_list_models_v1_openai_v1_models_get", + "responses": { + "200": { + "description": "A OpenAIListModelsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIListModelsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true + } + }, + "/v1/openai/v1/moderations": { + "post": { + "tags": [ + "V1" + ], + "summary": "Create moderation.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "run_moderation_v1_openai_v1_moderations_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_openai_v1_moderations_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A moderation object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModerationObject" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true + } + }, + "/v1/openai/v1/responses": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all responses.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_openai_responses_v1_openai_v1_responses_get", + "deprecated": true, + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "model", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Model" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 50, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/Order", + "default": "desc" + } + } + ], + "responses": { + "200": { + "description": "A ListOpenAIResponseObject.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOpenAIResponseObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Create a model response.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_openai_response_v1_openai_v1_responses_post", + "deprecated": true, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_openai_v1_responses_Request" + } + } + } + }, + "responses": { + "200": { + "description": "An OpenAIResponseObject.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIResponseObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/openai/v1/responses/{response_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete a response.", + "description": "Query endpoint for proper schema generation.", + "operationId": "delete_openai_response_v1_openai_v1_responses__response_id__delete", + "deprecated": true, + "parameters": [ + { + "name": "response_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Response Id" + }, + "description": "The ID of the OpenAI response to delete." + } + ], + "responses": { + "200": { + "description": "An OpenAIDeleteResponseObject", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIDeleteResponseObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Get a model response.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_openai_response_v1_openai_v1_responses__response_id__get", + "deprecated": true, + "parameters": [ + { + "name": "response_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Response Id" + }, + "description": "The ID of the OpenAI response to retrieve." + } + ], + "responses": { + "200": { + "description": "An OpenAIResponseObject.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIResponseObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/openai/v1/responses/{response_id}/input_items": { + "get": { + "tags": [ + "V1" + ], + "summary": "List input items.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_openai_response_input_items_v1_openai_v1_responses__response_id__input_items_get", + "deprecated": true, + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "before", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Before" + } + }, + { + "name": "include", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Include" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/Order", + "default": "desc" + } + }, + { + "name": "response_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Response Id" + }, + "description": "The ID of the response to retrieve input items for." + } + ], + "responses": { + "200": { + "description": "An ListOpenAIResponseInputItem.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOpenAIResponseInputItem" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/openai/v1/vector_stores": { + "get": { + "tags": [ + "V1" + ], + "summary": "Returns a list of vector stores.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_list_vector_stores_v1_openai_v1_vector_stores_get", + "deprecated": true, + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "before", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Before" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "desc", + "title": "Order" + } + } + ], + "responses": { + "200": { + "description": "A VectorStoreListResponse containing the list of vector stores.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreListResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Creates a vector store.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_create_vector_store_v1_openai_v1_vector_stores_post", + "deprecated": true, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody" + } + } + } + }, + "responses": { + "200": { + "description": "A VectorStoreObject representing the created vector store.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/openai/v1/vector_stores/{vector_store_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete a vector store.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_delete_vector_store_v1_openai_v1_vector_stores__vector_store_id__delete", + "deprecated": true, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store to delete." + } + ], + "responses": { + "200": { + "description": "A VectorStoreDeleteResponse indicating the deletion status.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreDeleteResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieves a vector store.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_retrieve_vector_store_v1_openai_v1_vector_stores__vector_store_id__get", + "deprecated": true, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store to retrieve." + } + ], + "responses": { + "200": { + "description": "A VectorStoreObject representing the vector store.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Updates a vector store.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_update_vector_store_v1_openai_v1_vector_stores__vector_store_id__post", + "deprecated": true, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_openai_v1_vector_stores_vector_store_id_Request" + } + } + } + }, + "responses": { + "200": { + "description": "A VectorStoreObject representing the updated vector store.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + }, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store to update." + } + ] + } + }, + "/v1/openai/v1/vector_stores/{vector_store_id}/file_batches": { + "post": { + "tags": [ + "V1" + ], + "summary": "Create a vector store file batch.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_create_vector_store_file_batch_v1_openai_v1_vector_stores__vector_store_id__file_batches_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A VectorStoreFileBatchObject representing the created file batch.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileBatchObject" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store to create the file batch for." + } + ] + } + }, + "/v1/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}": { + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve a vector store file batch.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_retrieve_vector_store_file_batch_v1_openai_v1_vector_stores__vector_store_id__file_batches__batch_id__get", + "deprecated": true, + "parameters": [ + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Batch Id" + }, + "description": "The ID of the file batch to retrieve." + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store containing the file batch." + } + ], + "responses": { + "200": { + "description": "A VectorStoreFileBatchObject representing the file batch.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileBatchObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel": { + "post": { + "tags": [ + "V1" + ], + "summary": "Cancels a vector store file batch.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_cancel_vector_store_file_batch_v1_openai_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_openai_v1_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A VectorStoreFileBatchObject representing the cancelled file batch.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileBatchObject" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true, + "parameters": [ + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the file batch to cancel." + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store containing the file batch." + } + ] + } + }, + "/v1/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files": { + "get": { + "tags": [ + "V1" + ], + "summary": "Returns a list of vector store files in a batch.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_list_files_in_vector_store_file_batch_v1_openai_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get", + "deprecated": true, + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "before", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Before" + } + }, + { + "name": "filter", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Filter" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "desc", + "title": "Order" + } + }, + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Batch Id" + }, + "description": "The ID of the file batch to list files from." + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store containing the file batch." + } + ], + "responses": { + "200": { + "description": "A VectorStoreFilesListInBatchResponse containing the list of files in the batch.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFilesListInBatchResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/openai/v1/vector_stores/{vector_store_id}/files": { + "get": { + "tags": [ + "V1" + ], + "summary": "List files in a vector store.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_list_files_in_vector_store_v1_openai_v1_vector_stores__vector_store_id__files_get", + "deprecated": true, + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "before", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Before" + } + }, + { + "name": "filter", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Filter" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "desc", + "title": "Order" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store to list files from." + } + ], + "responses": { + "200": { + "description": "A VectorStoreListFilesResponse containing the list of files.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreListFilesResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Attach a file to a vector store.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_attach_file_to_vector_store_v1_openai_v1_vector_stores__vector_store_id__files_post", + "deprecated": true, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_openai_v1_vector_stores_vector_store_id_files_Request" + } + } + } + }, + "responses": { + "200": { + "description": "A VectorStoreFileObject representing the attached file.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + }, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store to attach the file to." + } + ] + } + }, + "/v1/openai/v1/vector_stores/{vector_store_id}/files/{file_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete a vector store file.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_delete_vector_store_file_v1_openai_v1_vector_stores__vector_store_id__files__file_id__delete", + "deprecated": true, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store containing the file to delete." + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + }, + "description": "The ID of the file to delete." + } + ], + "responses": { + "200": { + "description": "A VectorStoreFileDeleteResponse indicating the deletion status.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileDeleteResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieves a vector store file.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_retrieve_vector_store_file_v1_openai_v1_vector_stores__vector_store_id__files__file_id__get", + "deprecated": true, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store containing the file to retrieve." + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + }, + "description": "The ID of the file to retrieve." + } + ], + "responses": { + "200": { + "description": "A VectorStoreFileObject representing the file.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Updates a vector store file.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_update_vector_store_file_v1_openai_v1_vector_stores__vector_store_id__files__file_id__post", + "deprecated": true, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_openai_v1_vector_stores_vector_store_id_files_file_id_Request" + } + } + } + }, + "responses": { + "200": { + "description": "A VectorStoreFileObject representing the updated file.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + }, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store containing the file to update." + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the file to update." + } + ] + } + }, + "/v1/openai/v1/vector_stores/{vector_store_id}/files/{file_id}/content": { + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieves the contents of a vector store file.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_retrieve_vector_store_file_contents_v1_openai_v1_vector_stores__vector_store_id__files__file_id__content_get", + "deprecated": true, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store containing the file to retrieve." + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + }, + "description": "The ID of the file to retrieve." + } + ], + "responses": { + "200": { + "description": "A list of InterleavedContent representing the file contents.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileContentsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/openai/v1/vector_stores/{vector_store_id}/search": { + "post": { + "tags": [ + "V1" + ], + "summary": "Search for chunks in a vector store.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_search_vector_store_v1_openai_v1_vector_stores__vector_store_id__search_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_openai_v1_vector_stores_vector_store_id_search_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A VectorStoreSearchResponse containing the search results.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreSearchResponsePage" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store to search." + } + ] + } + }, + "/v1/post-training/job/artifacts": { + "get": { + "tags": [ + "V1" + ], + "summary": "Get the artifacts of a training job.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_training_job_artifacts_v1_post_training_job_artifacts_get", + "deprecated": true, + "parameters": [ + { + "name": "job_uuid", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Job Uuid" + } + } + ], + "responses": { + "200": { + "description": "A PostTrainingJobArtifactsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostTrainingJobArtifactsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/post-training/job/cancel": { + "post": { + "tags": [ + "V1" + ], + "summary": "Cancel a training job.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "cancel_training_job_v1_post_training_job_cancel_post", + "deprecated": true, + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/post-training/job/status": { + "get": { + "tags": [ + "V1" + ], + "summary": "Get the status of a training job.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_training_job_status_v1_post_training_job_status_get", + "deprecated": true, + "parameters": [ + { + "name": "job_uuid", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Job Uuid" + } + } + ], + "responses": { + "200": { + "description": "A PostTrainingJobStatusResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostTrainingJobStatusResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/post-training/jobs": { + "get": { + "tags": [ + "V1" + ], + "summary": "Get all training jobs.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "get_training_jobs_v1_post_training_jobs_get", + "responses": { + "200": { + "description": "A ListPostTrainingJobsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPostTrainingJobsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true + } + }, + "/v1/post-training/preference-optimize": { + "post": { + "tags": [ + "V1" + ], + "summary": "Run preference optimization of a model.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "preference_optimize_v1_post_training_preference_optimize_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DPOAlignmentConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A PostTrainingJob.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostTrainingJob" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true + } + }, + "/v1/post-training/supervised-fine-tune": { + "post": { + "tags": [ + "V1" + ], + "summary": "Run supervised fine-tuning of a model.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "supervised_fine_tune_v1_post_training_supervised_fine_tune_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrainingConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A PostTrainingJob.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostTrainingJob" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "deprecated": true + } + } + }, + "components": { + "schemas": { + "AgentCandidate": { + "properties": { + "type": { + "type": "string", + "const": "agent", + "title": "Type", + "default": "agent" + }, + "config": { + "$ref": "#/components/schemas/AgentConfig" + } + }, + "type": "object", + "required": [ + "config" + ], + "title": "AgentCandidate", + "description": "An agent candidate for evaluation." + }, + "AgentConfig": { + "properties": { + "sampling_params": { + "$ref": "#/components/schemas/SamplingParams" + }, + "input_shields": { + "title": "Input Shields", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_shields": { + "title": "Output Shields", + "items": { + "type": "string" + }, + "type": "array" + }, + "toolgroups": { + "title": "Toolgroups", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/AgentToolGroupWithArgs" + } + ] + }, + "type": "array" + }, + "client_tools": { + "title": "Client Tools", + "items": { + "$ref": "#/components/schemas/ToolDef" + }, + "type": "array" + }, + "tool_choice": { + "deprecated": true, + "$ref": "#/components/schemas/ToolChoice" + }, + "tool_prompt_format": { + "deprecated": true, + "$ref": "#/components/schemas/ToolPromptFormat" + }, + "tool_config": { + "$ref": "#/components/schemas/ToolConfig" + }, + "max_infer_iters": { + "title": "Max Infer Iters", + "default": 10, + "type": "integer" + }, + "model": { + "type": "string", + "title": "Model" + }, + "instructions": { + "type": "string", + "title": "Instructions" + }, + "name": { + "title": "Name", + "type": "string" + }, + "enable_session_persistence": { + "title": "Enable Session Persistence", + "default": false, + "type": "boolean" + }, + "response_format": { + "title": "Response Format", + "oneOf": [ + { + "$ref": "#/components/schemas/JsonSchemaResponseFormat" + }, + { + "$ref": "#/components/schemas/GrammarResponseFormat" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "grammar": "#/components/schemas/GrammarResponseFormat", + "json_schema": "#/components/schemas/JsonSchemaResponseFormat" + } + } + } + }, + "type": "object", + "required": [ + "model", + "instructions" + ], + "title": "AgentConfig", + "description": "Configuration for an agent." + }, + "AgentCreateResponse": { + "properties": { + "agent_id": { + "type": "string", + "title": "Agent Id" + } + }, + "type": "object", + "required": [ + "agent_id" + ], + "title": "AgentCreateResponse", + "description": "Response returned when creating a new agent." + }, + "AgentSessionCreateResponse": { + "properties": { + "session_id": { + "type": "string", + "title": "Session Id" + } + }, + "type": "object", + "required": [ + "session_id" + ], + "title": "AgentSessionCreateResponse", + "description": "Response returned when creating a new agent session." + }, + "AgentToolGroupWithArgs": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "args": { + "additionalProperties": true, + "type": "object", + "title": "Args" + } + }, + "type": "object", + "required": [ + "name", + "args" + ], + "title": "AgentToolGroupWithArgs" + }, + "AgentTurnInputType": { + "properties": { + "type": { + "type": "string", + "const": "agent_turn_input", + "title": "Type", + "default": "agent_turn_input" + } + }, + "type": "object", + "title": "AgentTurnInputType", + "description": "Parameter type for agent turn input." + }, + "AggregationFunctionType": { + "type": "string", + "enum": [ + "average", + "weighted_average", + "median", + "categorical_count", + "accuracy" + ], + "title": "AggregationFunctionType", + "description": "Types of aggregation functions for scoring results." + }, + "AllowedToolsFilter": { + "properties": { + "tool_names": { + "title": "Tool Names", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "title": "AllowedToolsFilter", + "description": "Filter configuration for restricting which MCP tools can be used." + }, + "ApprovalFilter": { + "properties": { + "always": { + "title": "Always", + "items": { + "type": "string" + }, + "type": "array" + }, + "never": { + "title": "Never", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "title": "ApprovalFilter", + "description": "Filter configuration for MCP tool approval requirements." + }, + "ArrayType": { + "properties": { + "type": { + "type": "string", + "const": "array", + "title": "Type", + "default": "array" + } + }, + "type": "object", + "title": "ArrayType", + "description": "Parameter type for array values." + }, + "Attachment-Input": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/URL" + } + ], + "title": "Content" + }, + "mime_type": { + "type": "string", + "title": "Mime Type" + } + }, + "type": "object", + "required": [ + "content", + "mime_type" + ], + "title": "Attachment", + "description": "An attachment to an agent turn." + }, + "Attachment-Output": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/URL" + } + ], + "title": "Content" + }, + "mime_type": { + "type": "string", + "title": "Mime Type" + } + }, + "type": "object", + "required": [ + "content", + "mime_type" + ], + "title": "Attachment", + "description": "An attachment to an agent turn." + }, + "BasicScoringFnParams": { + "properties": { + "type": { + "type": "string", + "const": "basic", + "title": "Type", + "default": "basic" + }, + "aggregation_functions": { + "items": { + "$ref": "#/components/schemas/AggregationFunctionType" + }, + "type": "array", + "title": "Aggregation Functions", + "description": "Aggregation functions to apply to the scores of each row" + } + }, + "type": "object", + "title": "BasicScoringFnParams", + "description": "Parameters for basic scoring function configuration." + }, + "Batch": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "completion_window": { + "type": "string", + "title": "Completion Window" + }, + "created_at": { + "type": "integer", + "title": "Created At" + }, + "endpoint": { + "type": "string", + "title": "Endpoint" + }, + "input_file_id": { + "type": "string", + "title": "Input File Id" + }, + "object": { + "type": "string", + "const": "batch", + "title": "Object" + }, + "status": { + "type": "string", + "enum": [ + "validating", + "failed", + "in_progress", + "finalizing", + "completed", + "expired", + "cancelling", + "cancelled" + ], + "title": "Status" + }, + "cancelled_at": { + "title": "Cancelled At", + "type": "integer" + }, + "cancelling_at": { + "title": "Cancelling At", + "type": "integer" + }, + "completed_at": { + "title": "Completed At", + "type": "integer" + }, + "error_file_id": { + "title": "Error File Id", + "type": "string" + }, + "errors": { + "$ref": "#/components/schemas/Errors" + }, + "expired_at": { + "title": "Expired At", + "type": "integer" + }, + "expires_at": { + "title": "Expires At", + "type": "integer" + }, + "failed_at": { + "title": "Failed At", + "type": "integer" + }, + "finalizing_at": { + "title": "Finalizing At", + "type": "integer" + }, + "in_progress_at": { + "title": "In Progress At", + "type": "integer" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "model": { + "title": "Model", + "type": "string" + }, + "output_file_id": { + "title": "Output File Id", + "type": "string" + }, + "request_counts": { + "$ref": "#/components/schemas/BatchRequestCounts" + }, + "usage": { + "$ref": "#/components/schemas/BatchUsage" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "completion_window", + "created_at", + "endpoint", + "input_file_id", + "object", + "status" + ], + "title": "Batch" + }, + "BatchError": { + "properties": { + "code": { + "title": "Code", + "type": "string" + }, + "line": { + "title": "Line", + "type": "integer" + }, + "message": { + "title": "Message", + "type": "string" + }, + "param": { + "title": "Param", + "type": "string" + } + }, + "additionalProperties": true, + "type": "object", + "title": "BatchError" + }, + "BatchRequestCounts": { + "properties": { + "completed": { + "type": "integer", + "title": "Completed" + }, + "failed": { + "type": "integer", + "title": "Failed" + }, + "total": { + "type": "integer", + "title": "Total" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "completed", + "failed", + "total" + ], + "title": "BatchRequestCounts" + }, + "BatchUsage": { + "properties": { + "input_tokens": { + "type": "integer", + "title": "Input Tokens" + }, + "input_tokens_details": { + "$ref": "#/components/schemas/InputTokensDetails" + }, + "output_tokens": { + "type": "integer", + "title": "Output Tokens" + }, + "output_tokens_details": { + "$ref": "#/components/schemas/OutputTokensDetails" + }, + "total_tokens": { + "type": "integer", + "title": "Total Tokens" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "input_tokens", + "input_tokens_details", + "output_tokens", + "output_tokens_details", + "total_tokens" + ], + "title": "BatchUsage" + }, + "Benchmark": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "benchmark", + "title": "Type", + "default": "benchmark" + }, + "dataset_id": { + "type": "string", + "title": "Dataset Id" + }, + "scoring_functions": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Scoring Functions" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata", + "description": "Metadata for this evaluation task" + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id", + "dataset_id", + "scoring_functions" + ], + "title": "Benchmark", + "description": "A benchmark resource for evaluating model performance." + }, + "BenchmarkConfig": { + "properties": { + "eval_candidate": { + "oneOf": [ + { + "$ref": "#/components/schemas/ModelCandidate" + }, + { + "$ref": "#/components/schemas/AgentCandidate" + } + ], + "title": "Eval Candidate", + "discriminator": { + "propertyName": "type", + "mapping": { + "agent": "#/components/schemas/AgentCandidate", + "model": "#/components/schemas/ModelCandidate" + } + } + }, + "scoring_params": { + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" + }, + { + "$ref": "#/components/schemas/RegexParserScoringFnParams" + }, + { + "$ref": "#/components/schemas/BasicScoringFnParams" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "basic": "#/components/schemas/BasicScoringFnParams", + "llm_as_judge": "#/components/schemas/LLMAsJudgeScoringFnParams", + "regex_parser": "#/components/schemas/RegexParserScoringFnParams" + } + } + }, + "type": "object", + "title": "Scoring Params", + "description": "Map between scoring function id and parameters for each scoring function you want to run" + }, + "num_examples": { + "title": "Num Examples", + "description": "Number of examples to evaluate (useful for testing), if not provided, all examples in the dataset will be evaluated", + "type": "integer" + } + }, + "type": "object", + "required": [ + "eval_candidate" + ], + "title": "BenchmarkConfig", + "description": "A benchmark configuration for evaluation." + }, + "BooleanType": { + "properties": { + "type": { + "type": "string", + "const": "boolean", + "title": "Type", + "default": "boolean" + } + }, + "type": "object", + "title": "BooleanType", + "description": "Parameter type for boolean values." + }, + "BuiltinTool": { + "type": "string", + "enum": [ + "brave_search", + "wolfram_alpha", + "photogen", + "code_interpreter" + ], + "title": "BuiltinTool" + }, + "ChatCompletionInputType": { + "properties": { + "type": { + "type": "string", + "const": "chat_completion_input", + "title": "Type", + "default": "chat_completion_input" + } + }, + "type": "object", + "title": "ChatCompletionInputType", + "description": "Parameter type for chat completion input." + }, + "Chunk-Input": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "chunk_id": { + "type": "string", + "title": "Chunk Id" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + }, + "embedding": { + "title": "Embedding", + "items": { + "type": "number" + }, + "type": "array" + }, + "chunk_metadata": { + "$ref": "#/components/schemas/ChunkMetadata" + } + }, + "type": "object", + "required": [ + "content", + "chunk_id" + ], + "title": "Chunk", + "description": "A chunk of content that can be inserted into a vector database." + }, + "Chunk-Output": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "chunk_id": { + "type": "string", + "title": "Chunk Id" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + }, + "embedding": { + "title": "Embedding", + "items": { + "type": "number" + }, + "type": "array" + }, + "chunk_metadata": { + "$ref": "#/components/schemas/ChunkMetadata" + } + }, + "type": "object", + "required": [ + "content", + "chunk_id" + ], + "title": "Chunk", + "description": "A chunk of content that can be inserted into a vector database." + }, + "ChunkMetadata": { + "properties": { + "chunk_id": { + "title": "Chunk Id", + "type": "string" + }, + "document_id": { + "title": "Document Id", + "type": "string" + }, + "source": { + "title": "Source", + "type": "string" + }, + "created_timestamp": { + "title": "Created Timestamp", + "type": "integer" + }, + "updated_timestamp": { + "title": "Updated Timestamp", + "type": "integer" + }, + "chunk_window": { + "title": "Chunk Window", + "type": "string" + }, + "chunk_tokenizer": { + "title": "Chunk Tokenizer", + "type": "string" + }, + "chunk_embedding_model": { + "title": "Chunk Embedding Model", + "type": "string" + }, + "chunk_embedding_dimension": { + "title": "Chunk Embedding Dimension", + "type": "integer" + }, + "content_token_count": { + "title": "Content Token Count", + "type": "integer" + }, + "metadata_token_count": { + "title": "Metadata Token Count", + "type": "integer" + } + }, + "type": "object", + "title": "ChunkMetadata", + "description": "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." + }, + "CompletionInputType": { + "properties": { + "type": { + "type": "string", + "const": "completion_input", + "title": "Type", + "default": "completion_input" + } + }, + "type": "object", + "title": "CompletionInputType", + "description": "Parameter type for completion input." + }, + "CompletionMessage-Input": { + "properties": { + "role": { + "type": "string", + "const": "assistant", + "title": "Role", + "default": "assistant" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "stop_reason": { + "$ref": "#/components/schemas/StopReason" + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/ToolCall" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "content", + "stop_reason" + ], + "title": "CompletionMessage", + "description": "A message containing the model's (assistant) response in a chat conversation." + }, + "CompletionMessage-Output": { + "properties": { + "role": { + "type": "string", + "const": "assistant", + "title": "Role", + "default": "assistant" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "stop_reason": { + "$ref": "#/components/schemas/StopReason" + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/ToolCall" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "content", + "stop_reason" + ], + "title": "CompletionMessage", + "description": "A message containing the model's (assistant) response in a chat conversation." + }, + "Conversation": { + "properties": { + "id": { + "type": "string", + "title": "Id", + "description": "The unique ID of the conversation." + }, + "object": { + "type": "string", + "const": "conversation", + "title": "Object", + "description": "The object type, which is always conversation.", + "default": "conversation" + }, + "created_at": { + "type": "integer", + "title": "Created At", + "description": "The time at which the conversation was created, measured in seconds since the Unix epoch." + }, + "metadata": { + "title": "Metadata", + "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.", + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "items": { + "title": "Items", + "description": "Initial items to include in the conversation context. You may add up to 20 items at a time.", + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "id", + "created_at" + ], + "title": "Conversation", + "description": "OpenAI-compatible conversation object." + }, + "ConversationItemInclude": { + "type": "string", + "enum": [ + "web_search_call.action.sources", + "code_interpreter_call.outputs", + "computer_call_output.output.image_url", + "file_search_call.results", + "message.input_image.image_url", + "message.output_text.logprobs", + "reasoning.encrypted_content" + ], + "title": "ConversationItemInclude", + "description": "Specify additional output data to include in the model response." + }, + "ConversationItemList": { + "properties": { + "object": { + "type": "string", + "title": "Object", + "description": "Object type", + "default": "list" + }, + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage-Output" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", + "function_call_output": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput", + "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", + "mcp_approval_response": "#/components/schemas/OpenAIResponseMCPApprovalResponse", + "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", + "message": "#/components/schemas/OpenAIResponseMessage-Output", + "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + } + } + }, + "type": "array", + "title": "Data", + "description": "List of conversation items" + }, + "first_id": { + "title": "First Id", + "description": "The ID of the first item in the list", + "type": "string" + }, + "last_id": { + "title": "Last Id", + "description": "The ID of the last item in the list", + "type": "string" + }, + "has_more": { + "type": "boolean", + "title": "Has More", + "description": "Whether there are more items available", + "default": false + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ConversationItemList", + "description": "List of conversation items with pagination." + }, + "DPOAlignmentConfig": { + "properties": { + "beta": { + "type": "number", + "title": "Beta" + }, + "loss_type": { + "$ref": "#/components/schemas/DPOLossType", + "default": "sigmoid" + } + }, + "type": "object", + "required": [ + "beta" + ], + "title": "DPOAlignmentConfig", + "description": "Configuration for Direct Preference Optimization (DPO) alignment." + }, + "DPOLossType": { + "type": "string", + "enum": [ + "sigmoid", + "hinge", + "ipo", + "kto_pair" + ], + "title": "DPOLossType" + }, + "DataConfig": { + "properties": { + "dataset_id": { + "type": "string", + "title": "Dataset Id" + }, + "batch_size": { + "type": "integer", + "title": "Batch Size" + }, + "shuffle": { + "type": "boolean", + "title": "Shuffle" + }, + "data_format": { + "$ref": "#/components/schemas/DatasetFormat" + }, + "validation_dataset_id": { + "title": "Validation Dataset Id", + "type": "string" + }, + "packed": { + "title": "Packed", + "default": false, + "type": "boolean" + }, + "train_on_input": { + "title": "Train On Input", + "default": false, + "type": "boolean" + } + }, + "type": "object", + "required": [ + "dataset_id", + "batch_size", + "shuffle", + "data_format" + ], + "title": "DataConfig", + "description": "Configuration for training data and data loading." + }, + "Dataset": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "dataset", + "title": "Type", + "default": "dataset" + }, + "purpose": { + "$ref": "#/components/schemas/DatasetPurpose" + }, + "source": { + "oneOf": [ + { + "$ref": "#/components/schemas/URIDataSource" + }, + { + "$ref": "#/components/schemas/RowsDataSource" + } + ], + "title": "Source", + "discriminator": { + "propertyName": "type", + "mapping": { + "rows": "#/components/schemas/RowsDataSource", + "uri": "#/components/schemas/URIDataSource" + } + } + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata", + "description": "Any additional metadata for this dataset" + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id", + "purpose", + "source" + ], + "title": "Dataset", + "description": "Dataset resource for storing and accessing training or evaluation data." + }, + "DatasetFormat": { + "type": "string", + "enum": [ + "instruct", + "dialog" + ], + "title": "DatasetFormat", + "description": "Format of the training dataset." + }, + "DatasetPurpose": { + "type": "string", + "enum": [ + "post-training/messages", + "eval/question-answer", + "eval/messages-answer" + ], + "title": "DatasetPurpose", + "description": "Purpose of the dataset. Each purpose has a required input data schema." + }, + "DefaultRAGQueryGeneratorConfig": { + "properties": { + "type": { + "type": "string", + "const": "default", + "title": "Type", + "default": "default" + }, + "separator": { + "type": "string", + "title": "Separator", + "default": " " + } + }, + "type": "object", + "title": "DefaultRAGQueryGeneratorConfig", + "description": "Configuration for the default RAG query generator." + }, + "Document": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/URL" + } + ], + "title": "Content" + }, + "mime_type": { + "type": "string", + "title": "Mime Type" + } + }, + "type": "object", + "required": [ + "content", + "mime_type" + ], + "title": "Document", + "description": "A document to be used by an agent." + }, + "EfficiencyConfig": { + "properties": { + "enable_activation_checkpointing": { + "title": "Enable Activation Checkpointing", + "default": false, + "type": "boolean" + }, + "enable_activation_offloading": { + "title": "Enable Activation Offloading", + "default": false, + "type": "boolean" + }, + "memory_efficient_fsdp_wrap": { + "title": "Memory Efficient Fsdp Wrap", + "default": false, + "type": "boolean" + }, + "fsdp_cpu_offload": { + "title": "Fsdp Cpu Offload", + "default": false, + "type": "boolean" + } + }, + "type": "object", + "title": "EfficiencyConfig", + "description": "Configuration for memory and compute efficiency optimizations." + }, + "Errors": { + "properties": { + "data": { + "title": "Data", + "items": { + "$ref": "#/components/schemas/BatchError" + }, + "type": "array" + }, + "object": { + "title": "Object", + "type": "string" + } + }, + "additionalProperties": true, + "type": "object", + "title": "Errors" + }, + "EvaluateResponse": { + "properties": { + "generations": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Generations" + }, + "scores": { + "additionalProperties": { + "$ref": "#/components/schemas/ScoringResult" + }, + "type": "object", + "title": "Scores" + } + }, + "type": "object", + "required": [ + "generations", + "scores" + ], + "title": "EvaluateResponse", + "description": "The response from an evaluation." + }, + "GrammarResponseFormat": { + "properties": { + "type": { + "type": "string", + "const": "grammar", + "title": "Type", + "default": "grammar" + }, + "bnf": { + "additionalProperties": true, + "type": "object", + "title": "Bnf" + } + }, + "type": "object", + "required": [ + "bnf" + ], + "title": "GrammarResponseFormat", + "description": "Configuration for grammar-guided response generation." + }, + "GreedySamplingStrategy": { + "properties": { + "type": { + "type": "string", + "const": "greedy", + "title": "Type", + "default": "greedy" + } + }, + "type": "object", + "title": "GreedySamplingStrategy", + "description": "Greedy sampling strategy that selects the highest probability token at each step." + }, + "HealthInfo": { + "properties": { + "status": { + "$ref": "#/components/schemas/HealthStatus" + } + }, + "type": "object", + "required": [ + "status" + ], + "title": "HealthInfo", + "description": "Health status information for the service." + }, + "HealthStatus": { + "type": "string", + "enum": [ + "OK", + "Error", + "Not Implemented" + ], + "title": "HealthStatus" + }, + "ImageContentItem-Input": { + "properties": { + "type": { + "type": "string", + "const": "image", + "title": "Type", + "default": "image" + }, + "image": { + "$ref": "#/components/schemas/_URLOrData" + } + }, + "type": "object", + "required": [ + "image" + ], + "title": "ImageContentItem", + "description": "A image content item" + }, + "ImageContentItem-Output": { + "properties": { + "type": { + "type": "string", + "const": "image", + "title": "Type", + "default": "image" + }, + "image": { + "$ref": "#/components/schemas/_URLOrData" + } + }, + "type": "object", + "required": [ + "image" + ], + "title": "ImageContentItem", + "description": "A image content item" + }, + "InferenceStep-Input": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "step_id": { + "type": "string", + "title": "Step Id" + }, + "started_at": { + "title": "Started At", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + }, + "step_type": { + "type": "string", + "const": "inference", + "title": "Step Type", + "default": "inference" + }, + "model_response": { + "$ref": "#/components/schemas/CompletionMessage-Input" + } + }, + "type": "object", + "required": [ + "turn_id", + "step_id", + "model_response" + ], + "title": "InferenceStep", + "description": "An inference step in an agent turn." + }, + "InferenceStep-Output": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "step_id": { + "type": "string", + "title": "Step Id" + }, + "started_at": { + "title": "Started At", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + }, + "step_type": { + "type": "string", + "const": "inference", + "title": "Step Type", + "default": "inference" + }, + "model_response": { + "$ref": "#/components/schemas/CompletionMessage-Output" + } + }, + "type": "object", + "required": [ + "turn_id", + "step_id", + "model_response" + ], + "title": "InferenceStep", + "description": "An inference step in an agent turn." + }, + "InputTokensDetails": { + "properties": { + "cached_tokens": { + "type": "integer", + "title": "Cached Tokens" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "cached_tokens" + ], + "title": "InputTokensDetails" + }, + "Job": { + "properties": { + "job_id": { + "type": "string", + "title": "Job Id" + }, + "status": { + "$ref": "#/components/schemas/JobStatus" + } + }, + "type": "object", + "required": [ + "job_id", + "status" + ], + "title": "Job", + "description": "A job execution instance with status tracking." + }, + "JobStatus": { + "type": "string", + "enum": [ + "completed", + "in_progress", + "failed", + "scheduled", + "cancelled" + ], + "title": "JobStatus", + "description": "Status of a job execution." + }, + "JsonSchemaResponseFormat": { + "properties": { + "type": { + "type": "string", + "const": "json_schema", + "title": "Type", + "default": "json_schema" + }, + "json_schema": { + "additionalProperties": true, + "type": "object", + "title": "Json Schema" + } + }, + "type": "object", + "required": [ + "json_schema" + ], + "title": "JsonSchemaResponseFormat", + "description": "Configuration for JSON schema-guided response generation." + }, + "JsonType": { + "properties": { + "type": { + "type": "string", + "const": "json", + "title": "Type", + "default": "json" + } + }, + "type": "object", + "title": "JsonType", + "description": "Parameter type for JSON values." + }, + "LLMAsJudgeScoringFnParams": { + "properties": { + "type": { + "type": "string", + "const": "llm_as_judge", + "title": "Type", + "default": "llm_as_judge" + }, + "judge_model": { + "type": "string", + "title": "Judge Model" + }, + "prompt_template": { + "title": "Prompt Template", + "type": "string" + }, + "judge_score_regexes": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Judge Score Regexes", + "description": "Regexes to extract the answer from generated response" + }, + "aggregation_functions": { + "items": { + "$ref": "#/components/schemas/AggregationFunctionType" + }, + "type": "array", + "title": "Aggregation Functions", + "description": "Aggregation functions to apply to the scores of each row" + } + }, + "type": "object", + "required": [ + "judge_model" + ], + "title": "LLMAsJudgeScoringFnParams", + "description": "Parameters for LLM-as-judge scoring function configuration." + }, + "LLMRAGQueryGeneratorConfig": { + "properties": { + "type": { + "type": "string", + "const": "llm", + "title": "Type", + "default": "llm" + }, + "model": { + "type": "string", + "title": "Model" + }, + "template": { + "type": "string", + "title": "Template" + } + }, + "type": "object", + "required": [ + "model", + "template" + ], + "title": "LLMRAGQueryGeneratorConfig", + "description": "Configuration for the LLM-based RAG query generator." + }, + "ListBenchmarksResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Benchmark" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListBenchmarksResponse" + }, + "ListDatasetsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Dataset" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListDatasetsResponse", + "description": "Response from listing datasets." + }, + "ListModelsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Model" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListModelsResponse" + }, + "ListPostTrainingJobsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/PostTrainingJob" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListPostTrainingJobsResponse" + }, + "ListPromptsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Prompt" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListPromptsResponse", + "description": "Response model to list prompts." + }, + "ListProvidersResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ProviderInfo" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListProvidersResponse", + "description": "Response containing a list of all available providers." + }, + "ListRoutesResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/RouteInfo" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListRoutesResponse", + "description": "Response containing a list of all available API routes." + }, + "ListScoringFunctionsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ScoringFn-Output" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListScoringFunctionsResponse" + }, + "ListShieldsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Shield" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListShieldsResponse" + }, + "ListToolGroupsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ToolGroup" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListToolGroupsResponse", + "description": "Response containing a list of tool groups." + }, + "MCPListToolsTool": { + "properties": { + "input_schema": { + "additionalProperties": true, + "type": "object", + "title": "Input Schema" + }, + "name": { + "type": "string", + "title": "Name" + }, + "description": { + "title": "Description", + "type": "string" + } + }, + "type": "object", + "required": [ + "input_schema", + "name" + ], + "title": "MCPListToolsTool", + "description": "Tool definition returned by MCP list tools operation." + }, + "MemoryRetrievalStep-Input": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "step_id": { + "type": "string", + "title": "Step Id" + }, + "started_at": { + "title": "Started At", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + }, + "step_type": { + "type": "string", + "const": "memory_retrieval", + "title": "Step Type", + "default": "memory_retrieval" + }, + "vector_store_ids": { + "type": "string", + "title": "Vector Store Ids" + }, + "inserted_context": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Inserted Context" + } + }, + "type": "object", + "required": [ + "turn_id", + "step_id", + "vector_store_ids", + "inserted_context" + ], + "title": "MemoryRetrievalStep", + "description": "A memory retrieval step in an agent turn." + }, + "MemoryRetrievalStep-Output": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "step_id": { + "type": "string", + "title": "Step Id" + }, + "started_at": { + "title": "Started At", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + }, + "step_type": { + "type": "string", + "const": "memory_retrieval", + "title": "Step Type", + "default": "memory_retrieval" + }, + "vector_store_ids": { + "type": "string", + "title": "Vector Store Ids" + }, + "inserted_context": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Inserted Context" + } + }, + "type": "object", + "required": [ + "turn_id", + "step_id", + "vector_store_ids", + "inserted_context" + ], + "title": "MemoryRetrievalStep", + "description": "A memory retrieval step in an agent turn." + }, + "Model": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "model", + "title": "Type", + "default": "model" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata", + "description": "Any additional metadata for this model" + }, + "model_type": { + "$ref": "#/components/schemas/ModelType", + "default": "llm" + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id" + ], + "title": "Model", + "description": "A model resource representing an AI model registered in Llama Stack." + }, + "ModelCandidate": { + "properties": { + "type": { + "type": "string", + "const": "model", + "title": "Type", + "default": "model" + }, + "model": { + "type": "string", + "title": "Model" + }, + "sampling_params": { + "$ref": "#/components/schemas/SamplingParams" + }, + "system_message": { + "$ref": "#/components/schemas/SystemMessage" + } + }, + "type": "object", + "required": [ + "model", + "sampling_params" + ], + "title": "ModelCandidate", + "description": "A model candidate for evaluation." + }, + "ModelType": { + "type": "string", + "enum": [ + "llm", + "embedding", + "rerank" + ], + "title": "ModelType", + "description": "Enumeration of supported model types in Llama Stack." + }, + "ModerationObject": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "model": { + "type": "string", + "title": "Model" + }, + "results": { + "items": { + "$ref": "#/components/schemas/ModerationObjectResults" + }, + "type": "array", + "title": "Results" + } + }, + "type": "object", + "required": [ + "id", + "model", + "results" + ], + "title": "ModerationObject", + "description": "A moderation object." + }, + "ModerationObjectResults": { + "properties": { + "flagged": { + "type": "boolean", + "title": "Flagged" + }, + "categories": { + "title": "Categories", + "additionalProperties": { + "type": "boolean" + }, + "type": "object" + }, + "category_applied_input_types": { + "title": "Category Applied Input Types", + "additionalProperties": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": "object" + }, + "category_scores": { + "title": "Category Scores", + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "user_message": { + "title": "User Message", + "type": "string" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "flagged" + ], + "title": "ModerationObjectResults", + "description": "A moderation object." + }, + "NumberType": { + "properties": { + "type": { + "type": "string", + "const": "number", + "title": "Type", + "default": "number" + } + }, + "type": "object", + "title": "NumberType", + "description": "Parameter type for numeric values." + }, + "ObjectType": { + "properties": { + "type": { + "type": "string", + "const": "object", + "title": "Type", + "default": "object" + } + }, + "type": "object", + "title": "ObjectType", + "description": "Parameter type for object values." + }, + "OpenAIAssistantMessageParam-Input": { + "properties": { + "role": { + "type": "string", + "const": "assistant", + "title": "Role", + "default": "assistant" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" + }, + "type": "array" + } + }, + "type": "object", + "title": "OpenAIAssistantMessageParam", + "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request." + }, + "OpenAIAssistantMessageParam-Output": { + "properties": { + "role": { + "type": "string", + "const": "assistant", + "title": "Role", + "default": "assistant" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" + }, + "type": "array" + } + }, + "type": "object", + "title": "OpenAIAssistantMessageParam", + "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request." + }, + "OpenAIChatCompletion": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "choices": { + "items": { + "$ref": "#/components/schemas/OpenAIChoice-Output" + }, + "type": "array", + "title": "Choices" + }, + "object": { + "type": "string", + "const": "chat.completion", + "title": "Object", + "default": "chat.completion" + }, + "created": { + "type": "integer", + "title": "Created" + }, + "model": { + "type": "string", + "title": "Model" + }, + "usage": { + "$ref": "#/components/schemas/OpenAIChatCompletionUsage" + } + }, + "type": "object", + "required": [ + "id", + "choices", + "created", + "model" + ], + "title": "OpenAIChatCompletion", + "description": "Response from an OpenAI-compatible chat completion request." + }, + "OpenAIChatCompletionContentPartImageParam": { + "properties": { + "type": { + "type": "string", + "const": "image_url", + "title": "Type", + "default": "image_url" + }, + "image_url": { + "$ref": "#/components/schemas/OpenAIImageURL" + } + }, + "type": "object", + "required": [ + "image_url" + ], + "title": "OpenAIChatCompletionContentPartImageParam", + "description": "Image content part for OpenAI-compatible chat completion messages." + }, + "OpenAIChatCompletionContentPartTextParam": { + "properties": { + "type": { + "type": "string", + "const": "text", + "title": "Type", + "default": "text" + }, + "text": { + "type": "string", + "title": "Text" + } + }, + "type": "object", + "required": [ + "text" + ], + "title": "OpenAIChatCompletionContentPartTextParam", + "description": "Text content part for OpenAI-compatible chat completion messages." + }, + "OpenAIChatCompletionRequestWithExtraBody": { + "properties": { + "model": { + "type": "string", + "title": "Model" + }, + "messages": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIUserMessageParam-Input" + }, + { + "$ref": "#/components/schemas/OpenAISystemMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIAssistantMessageParam-Input" + }, + { + "$ref": "#/components/schemas/OpenAIToolMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" + } + ], + "discriminator": { + "propertyName": "role", + "mapping": { + "assistant": "#/components/schemas/OpenAIAssistantMessageParam-Input", + "developer": "#/components/schemas/OpenAIDeveloperMessageParam", + "system": "#/components/schemas/OpenAISystemMessageParam", + "tool": "#/components/schemas/OpenAIToolMessageParam", + "user": "#/components/schemas/OpenAIUserMessageParam-Input" + } + } + }, + "type": "array", + "minItems": 1, + "title": "Messages" + }, + "frequency_penalty": { + "title": "Frequency Penalty", + "type": "number" + }, + "function_call": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": true, + "type": "object" + } + ], + "title": "Function Call" + }, + "functions": { + "title": "Functions", + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + "logit_bias": { + "title": "Logit Bias", + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "logprobs": { + "title": "Logprobs", + "type": "boolean" + }, + "max_completion_tokens": { + "title": "Max Completion Tokens", + "type": "integer" + }, + "max_tokens": { + "title": "Max Tokens", + "type": "integer" + }, + "n": { + "title": "N", + "type": "integer" + }, + "parallel_tool_calls": { + "title": "Parallel Tool Calls", + "type": "boolean" + }, + "presence_penalty": { + "title": "Presence Penalty", + "type": "number" + }, + "response_format": { + "title": "Response Format", + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseFormatText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseFormatJSONSchema" + }, + { + "$ref": "#/components/schemas/OpenAIResponseFormatJSONObject" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "json_object": "#/components/schemas/OpenAIResponseFormatJSONObject", + "json_schema": "#/components/schemas/OpenAIResponseFormatJSONSchema", + "text": "#/components/schemas/OpenAIResponseFormatText" + } + } + }, + "seed": { + "title": "Seed", + "type": "integer" + }, + "stop": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Stop" + }, + "stream": { + "title": "Stream", + "type": "boolean" + }, + "stream_options": { + "title": "Stream Options", + "additionalProperties": true, + "type": "object" + }, + "temperature": { + "title": "Temperature", + "type": "number" + }, + "tool_choice": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": true, + "type": "object" + } + ], + "title": "Tool Choice" + }, + "tools": { + "title": "Tools", + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + "top_logprobs": { + "title": "Top Logprobs", + "type": "integer" + }, + "top_p": { + "title": "Top P", + "type": "number" + }, + "user": { + "title": "User", + "type": "string" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "model", + "messages" + ], + "title": "OpenAIChatCompletionRequestWithExtraBody", + "description": "Request parameters for OpenAI-compatible chat completion endpoint." + }, + "OpenAIChatCompletionToolCall": { + "properties": { + "index": { + "title": "Index", + "type": "integer" + }, + "id": { + "title": "Id", + "type": "string" + }, + "type": { + "type": "string", + "const": "function", + "title": "Type", + "default": "function" + }, + "function": { + "$ref": "#/components/schemas/OpenAIChatCompletionToolCallFunction" + } + }, + "type": "object", + "title": "OpenAIChatCompletionToolCall", + "description": "Tool call specification for OpenAI-compatible chat completion responses." + }, + "OpenAIChatCompletionToolCallFunction": { + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "arguments": { + "title": "Arguments", + "type": "string" + } + }, + "type": "object", + "title": "OpenAIChatCompletionToolCallFunction", + "description": "Function call details for OpenAI-compatible tool calls." + }, + "OpenAIChatCompletionUsage": { + "properties": { + "prompt_tokens": { + "type": "integer", + "title": "Prompt Tokens" + }, + "completion_tokens": { + "type": "integer", + "title": "Completion Tokens" + }, + "total_tokens": { + "type": "integer", + "title": "Total Tokens" + }, + "prompt_tokens_details": { + "$ref": "#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails" + }, + "completion_tokens_details": { + "$ref": "#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails" + } + }, + "type": "object", + "required": [ + "prompt_tokens", + "completion_tokens", + "total_tokens" + ], + "title": "OpenAIChatCompletionUsage", + "description": "Usage information for OpenAI chat completion." + }, + "OpenAIChatCompletionUsageCompletionTokensDetails": { + "properties": { + "reasoning_tokens": { + "title": "Reasoning Tokens", + "type": "integer" + } + }, + "type": "object", + "title": "OpenAIChatCompletionUsageCompletionTokensDetails", + "description": "Token details for output tokens in OpenAI chat completion usage." + }, + "OpenAIChatCompletionUsagePromptTokensDetails": { + "properties": { + "cached_tokens": { + "title": "Cached Tokens", + "type": "integer" + } + }, + "type": "object", + "title": "OpenAIChatCompletionUsagePromptTokensDetails", + "description": "Token details for prompt tokens in OpenAI chat completion usage." + }, + "OpenAIChoice-Input": { + "properties": { + "message": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIUserMessageParam-Input" + }, + { + "$ref": "#/components/schemas/OpenAISystemMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIAssistantMessageParam-Input" + }, + { + "$ref": "#/components/schemas/OpenAIToolMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" + } + ], + "title": "Message", + "discriminator": { + "propertyName": "role", + "mapping": { + "assistant": "#/components/schemas/OpenAIAssistantMessageParam-Input", + "developer": "#/components/schemas/OpenAIDeveloperMessageParam", + "system": "#/components/schemas/OpenAISystemMessageParam", + "tool": "#/components/schemas/OpenAIToolMessageParam", + "user": "#/components/schemas/OpenAIUserMessageParam-Input" + } + } + }, + "finish_reason": { + "type": "string", + "title": "Finish Reason" + }, + "index": { + "type": "integer", + "title": "Index" + }, + "logprobs": { + "$ref": "#/components/schemas/OpenAIChoiceLogprobs-Input" + } + }, + "type": "object", + "required": [ + "message", + "finish_reason", + "index" + ], + "title": "OpenAIChoice", + "description": "A choice from an OpenAI-compatible chat completion response." + }, + "OpenAIChoice-Output": { + "properties": { + "message": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIUserMessageParam-Output" + }, + { + "$ref": "#/components/schemas/OpenAISystemMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIAssistantMessageParam-Output" + }, + { + "$ref": "#/components/schemas/OpenAIToolMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" + } + ], + "title": "Message", + "discriminator": { + "propertyName": "role", + "mapping": { + "assistant": "#/components/schemas/OpenAIAssistantMessageParam-Output", + "developer": "#/components/schemas/OpenAIDeveloperMessageParam", + "system": "#/components/schemas/OpenAISystemMessageParam", + "tool": "#/components/schemas/OpenAIToolMessageParam", + "user": "#/components/schemas/OpenAIUserMessageParam-Output" + } + } + }, + "finish_reason": { + "type": "string", + "title": "Finish Reason" + }, + "index": { + "type": "integer", + "title": "Index" + }, + "logprobs": { + "$ref": "#/components/schemas/OpenAIChoiceLogprobs-Output" + } + }, + "type": "object", + "required": [ + "message", + "finish_reason", + "index" + ], + "title": "OpenAIChoice", + "description": "A choice from an OpenAI-compatible chat completion response." + }, + "OpenAIChoiceLogprobs-Input": { + "properties": { + "content": { + "title": "Content", + "items": { + "$ref": "#/components/schemas/OpenAITokenLogProb" + }, + "type": "array" + }, + "refusal": { + "title": "Refusal", + "items": { + "$ref": "#/components/schemas/OpenAITokenLogProb" + }, + "type": "array" + } + }, + "type": "object", + "title": "OpenAIChoiceLogprobs", + "description": "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response." + }, + "OpenAIChoiceLogprobs-Output": { + "properties": { + "content": { + "title": "Content", + "items": { + "$ref": "#/components/schemas/OpenAITokenLogProb" + }, + "type": "array" + }, + "refusal": { + "title": "Refusal", + "items": { + "$ref": "#/components/schemas/OpenAITokenLogProb" + }, + "type": "array" + } + }, + "type": "object", + "title": "OpenAIChoiceLogprobs", + "description": "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response." + }, + "OpenAICompletion": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "choices": { + "items": { + "$ref": "#/components/schemas/OpenAICompletionChoice-Output" + }, + "type": "array", + "title": "Choices" + }, + "created": { + "type": "integer", + "title": "Created" + }, + "model": { + "type": "string", + "title": "Model" + }, + "object": { + "type": "string", + "const": "text_completion", + "title": "Object", + "default": "text_completion" + } + }, + "type": "object", + "required": [ + "id", + "choices", + "created", + "model" + ], + "title": "OpenAICompletion", + "description": "Response from an OpenAI-compatible completion request." + }, + "OpenAICompletionChoice-Input": { + "properties": { + "finish_reason": { + "type": "string", + "title": "Finish Reason" + }, + "text": { + "type": "string", + "title": "Text" + }, + "index": { + "type": "integer", + "title": "Index" + }, + "logprobs": { + "$ref": "#/components/schemas/OpenAIChoiceLogprobs-Input" + } + }, + "type": "object", + "required": [ + "finish_reason", + "text", + "index" + ], + "title": "OpenAICompletionChoice", + "description": "A choice from an OpenAI-compatible completion response." + }, + "OpenAICompletionChoice-Output": { + "properties": { + "finish_reason": { + "type": "string", + "title": "Finish Reason" + }, + "text": { + "type": "string", + "title": "Text" + }, + "index": { + "type": "integer", + "title": "Index" + }, + "logprobs": { + "$ref": "#/components/schemas/OpenAIChoiceLogprobs-Output" + } + }, + "type": "object", + "required": [ + "finish_reason", + "text", + "index" + ], + "title": "OpenAICompletionChoice", + "description": "A choice from an OpenAI-compatible completion response." + }, + "OpenAICompletionRequestWithExtraBody": { + "properties": { + "model": { + "type": "string", + "title": "Model" + }, + "prompt": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "integer" + }, + "type": "array" + }, + { + "items": { + "items": { + "type": "integer" + }, + "type": "array" + }, + "type": "array" + } + ], + "title": "Prompt" + }, + "best_of": { + "title": "Best Of", + "type": "integer" + }, + "echo": { + "title": "Echo", + "type": "boolean" + }, + "frequency_penalty": { + "title": "Frequency Penalty", + "type": "number" + }, + "logit_bias": { + "title": "Logit Bias", + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "logprobs": { + "title": "Logprobs", + "type": "boolean" + }, + "max_tokens": { + "title": "Max Tokens", + "type": "integer" + }, + "n": { + "title": "N", + "type": "integer" + }, + "presence_penalty": { + "title": "Presence Penalty", + "type": "number" + }, + "seed": { + "title": "Seed", + "type": "integer" + }, + "stop": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Stop" + }, + "stream": { + "title": "Stream", + "type": "boolean" + }, + "stream_options": { + "title": "Stream Options", + "additionalProperties": true, + "type": "object" + }, + "temperature": { + "title": "Temperature", + "type": "number" + }, + "top_p": { + "title": "Top P", + "type": "number" + }, + "user": { + "title": "User", + "type": "string" + }, + "suffix": { + "title": "Suffix", + "type": "string" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "model", + "prompt" + ], + "title": "OpenAICompletionRequestWithExtraBody", + "description": "Request parameters for OpenAI-compatible completion endpoint." + }, + "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": { + "properties": { + "file_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "File Ids" + }, + "attributes": { + "title": "Attributes", + "additionalProperties": true, + "type": "object" + }, + "chunking_strategy": { + "title": "Chunking Strategy", + "oneOf": [ + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" + }, + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "auto": "#/components/schemas/VectorStoreChunkingStrategyAuto", + "static": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + } + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "file_ids" + ], + "title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody", + "description": "Request to create a vector store file batch with extra_body support." + }, + "OpenAICreateVectorStoreRequestWithExtraBody": { + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "file_ids": { + "title": "File Ids", + "items": { + "type": "string" + }, + "type": "array" + }, + "expires_after": { + "title": "Expires After", + "additionalProperties": true, + "type": "object" + }, + "chunking_strategy": { + "title": "Chunking Strategy", + "additionalProperties": true, + "type": "object" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "additionalProperties": true, + "type": "object", + "title": "OpenAICreateVectorStoreRequestWithExtraBody", + "description": "Request to create a vector store with extra_body support." + }, + "OpenAIDeveloperMessageParam": { + "properties": { + "role": { + "type": "string", + "const": "developer", + "title": "Role", + "default": "developer" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "OpenAIDeveloperMessageParam", + "description": "A message from the developer in an OpenAI-compatible chat completion request." + }, + "OpenAIEmbeddingData": { + "properties": { + "object": { + "type": "string", + "const": "embedding", + "title": "Object", + "default": "embedding" + }, + "embedding": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "title": "Embedding" + }, + "index": { + "type": "integer", + "title": "Index" + } + }, + "type": "object", + "required": [ + "embedding", + "index" + ], + "title": "OpenAIEmbeddingData", + "description": "A single embedding data object from an OpenAI-compatible embeddings response." + }, + "OpenAIEmbeddingUsage": { + "properties": { + "prompt_tokens": { + "type": "integer", + "title": "Prompt Tokens" + }, + "total_tokens": { + "type": "integer", + "title": "Total Tokens" + } + }, + "type": "object", + "required": [ + "prompt_tokens", + "total_tokens" + ], + "title": "OpenAIEmbeddingUsage", + "description": "Usage information for an OpenAI-compatible embeddings response." + }, + "OpenAIEmbeddingsRequestWithExtraBody": { + "properties": { + "model": { + "type": "string", + "title": "Model" + }, + "input": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Input" + }, + "encoding_format": { + "title": "Encoding Format", + "default": "float", + "type": "string" + }, + "dimensions": { + "title": "Dimensions", + "type": "integer" + }, + "user": { + "title": "User", + "type": "string" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "model", + "input" + ], + "title": "OpenAIEmbeddingsRequestWithExtraBody", + "description": "Request parameters for OpenAI-compatible embeddings endpoint." + }, + "OpenAIEmbeddingsResponse": { + "properties": { + "object": { + "type": "string", + "const": "list", + "title": "Object", + "default": "list" + }, + "data": { + "items": { + "$ref": "#/components/schemas/OpenAIEmbeddingData" + }, + "type": "array", + "title": "Data" + }, + "model": { + "type": "string", + "title": "Model" + }, + "usage": { + "$ref": "#/components/schemas/OpenAIEmbeddingUsage" + } + }, + "type": "object", + "required": [ + "data", + "model", + "usage" + ], + "title": "OpenAIEmbeddingsResponse", + "description": "Response from an OpenAI-compatible embeddings request." + }, + "OpenAIFile": { + "properties": { + "type": { + "type": "string", + "const": "file", + "title": "Type", + "default": "file" + }, + "file": { + "$ref": "#/components/schemas/OpenAIFileFile" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "OpenAIFile" + }, + "OpenAIFileFile": { + "properties": { + "file_data": { + "title": "File Data", + "type": "string" + }, + "file_id": { + "title": "File Id", + "type": "string" + }, + "filename": { + "title": "Filename", + "type": "string" + } + }, + "type": "object", + "title": "OpenAIFileFile" + }, + "OpenAIFileObject": { + "properties": { + "object": { + "type": "string", + "const": "file", + "title": "Object", + "default": "file" + }, + "id": { + "type": "string", + "title": "Id" + }, + "bytes": { + "type": "integer", + "title": "Bytes" + }, + "created_at": { + "type": "integer", + "title": "Created At" + }, + "expires_at": { + "type": "integer", + "title": "Expires At" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "purpose": { + "$ref": "#/components/schemas/OpenAIFilePurpose" + } + }, + "type": "object", + "required": [ + "id", + "bytes", + "created_at", + "expires_at", + "filename", + "purpose" + ], + "title": "OpenAIFileObject", + "description": "OpenAI File object as defined in the OpenAI Files API." + }, + "OpenAIFilePurpose": { + "type": "string", + "enum": [ + "assistants", + "batch" + ], + "title": "OpenAIFilePurpose", + "description": "Valid purpose values for OpenAI Files API." + }, + "OpenAIImageURL": { + "properties": { + "url": { + "type": "string", + "title": "Url" + }, + "detail": { + "title": "Detail", + "type": "string" + } + }, + "type": "object", + "required": [ + "url" + ], + "title": "OpenAIImageURL", + "description": "Image URL specification for OpenAI-compatible chat completion messages." + }, + "OpenAIJSONSchema": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "description": { + "title": "Description", + "type": "string" + }, + "strict": { + "title": "Strict", + "type": "boolean" + }, + "schema": { + "title": "Schema", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "title": "OpenAIJSONSchema", + "description": "JSON schema specification for OpenAI-compatible structured response format." + }, + "OpenAIListModelsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/OpenAIModel" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "OpenAIListModelsResponse" + }, + "OpenAIModel": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "object": { + "type": "string", + "const": "model", + "title": "Object", + "default": "model" + }, + "created": { + "type": "integer", + "title": "Created" + }, + "owned_by": { + "type": "string", + "title": "Owned By" + } + }, + "type": "object", + "required": [ + "id", + "created", + "owned_by" + ], + "title": "OpenAIModel", + "description": "A model from OpenAI." + }, + "OpenAIResponseAnnotationCitation": { + "properties": { + "type": { + "type": "string", + "const": "url_citation", + "title": "Type", + "default": "url_citation" + }, + "end_index": { + "type": "integer", + "title": "End Index" + }, + "start_index": { + "type": "integer", + "title": "Start Index" + }, + "title": { + "type": "string", + "title": "Title" + }, + "url": { + "type": "string", + "title": "Url" + } + }, + "type": "object", + "required": [ + "end_index", + "start_index", + "title", + "url" + ], + "title": "OpenAIResponseAnnotationCitation", + "description": "URL citation annotation for referencing external web resources." + }, + "OpenAIResponseAnnotationContainerFileCitation": { + "properties": { + "type": { + "type": "string", + "const": "container_file_citation", + "title": "Type", + "default": "container_file_citation" + }, + "container_id": { + "type": "string", + "title": "Container Id" + }, + "end_index": { + "type": "integer", + "title": "End Index" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "start_index": { + "type": "integer", + "title": "Start Index" + } + }, + "type": "object", + "required": [ + "container_id", + "end_index", + "file_id", + "filename", + "start_index" + ], + "title": "OpenAIResponseAnnotationContainerFileCitation" + }, + "OpenAIResponseAnnotationFileCitation": { + "properties": { + "type": { + "type": "string", + "const": "file_citation", + "title": "Type", + "default": "file_citation" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "index": { + "type": "integer", + "title": "Index" + } + }, + "type": "object", + "required": [ + "file_id", + "filename", + "index" + ], + "title": "OpenAIResponseAnnotationFileCitation", + "description": "File citation annotation for referencing specific files in response content." + }, + "OpenAIResponseAnnotationFilePath": { + "properties": { + "type": { + "type": "string", + "const": "file_path", + "title": "Type", + "default": "file_path" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "index": { + "type": "integer", + "title": "Index" + } + }, + "type": "object", + "required": [ + "file_id", + "index" + ], + "title": "OpenAIResponseAnnotationFilePath" + }, + "OpenAIResponseContentPartRefusal": { + "properties": { + "type": { + "type": "string", + "const": "refusal", + "title": "Type", + "default": "refusal" + }, + "refusal": { + "type": "string", + "title": "Refusal" + } + }, + "type": "object", + "required": [ + "refusal" + ], + "title": "OpenAIResponseContentPartRefusal", + "description": "Refusal content within a streamed response part." + }, + "OpenAIResponseError": { + "properties": { + "code": { + "type": "string", + "title": "Code" + }, + "message": { + "type": "string", + "title": "Message" + } + }, + "type": "object", + "required": [ + "code", + "message" + ], + "title": "OpenAIResponseError", + "description": "Error details for failed OpenAI response requests." + }, + "OpenAIResponseFormatJSONObject": { + "properties": { + "type": { + "type": "string", + "const": "json_object", + "title": "Type", + "default": "json_object" + } + }, + "type": "object", + "title": "OpenAIResponseFormatJSONObject", + "description": "JSON object response format for OpenAI-compatible chat completion requests." + }, + "OpenAIResponseFormatJSONSchema": { + "properties": { + "type": { + "type": "string", + "const": "json_schema", + "title": "Type", + "default": "json_schema" + }, + "json_schema": { + "$ref": "#/components/schemas/OpenAIJSONSchema" + } + }, + "type": "object", + "required": [ + "json_schema" + ], + "title": "OpenAIResponseFormatJSONSchema", + "description": "JSON schema response format for OpenAI-compatible chat completion requests." + }, + "OpenAIResponseFormatText": { + "properties": { + "type": { + "type": "string", + "const": "text", + "title": "Type", + "default": "text" + } + }, + "type": "object", + "title": "OpenAIResponseFormatText", + "description": "Text response format for OpenAI-compatible chat completion requests." + }, + "OpenAIResponseInputFunctionToolCallOutput": { + "properties": { + "call_id": { + "type": "string", + "title": "Call Id" + }, + "output": { + "type": "string", + "title": "Output" + }, + "type": { + "type": "string", + "const": "function_call_output", + "title": "Type", + "default": "function_call_output" + }, + "id": { + "title": "Id", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "type": "object", + "required": [ + "call_id", + "output" + ], + "title": "OpenAIResponseInputFunctionToolCallOutput", + "description": "This represents the output of a function call that gets passed back to the model." + }, + "OpenAIResponseInputMessageContentFile": { + "properties": { + "type": { + "type": "string", + "const": "input_file", + "title": "Type", + "default": "input_file" + }, + "file_data": { + "title": "File Data", + "type": "string" + }, + "file_id": { + "title": "File Id", + "type": "string" + }, + "file_url": { + "title": "File Url", + "type": "string" + }, + "filename": { + "title": "Filename", + "type": "string" + } + }, + "type": "object", + "title": "OpenAIResponseInputMessageContentFile", + "description": "File content for input messages in OpenAI response format." + }, + "OpenAIResponseInputMessageContentImage": { + "properties": { + "detail": { + "anyOf": [ + { + "type": "string", + "const": "low" + }, + { + "type": "string", + "const": "high" + }, + { + "type": "string", + "const": "auto" + } + ], + "title": "Detail", + "default": "auto" + }, + "type": { + "type": "string", + "const": "input_image", + "title": "Type", + "default": "input_image" + }, + "file_id": { + "title": "File Id", + "type": "string" + }, + "image_url": { + "title": "Image Url", + "type": "string" + } + }, + "type": "object", + "title": "OpenAIResponseInputMessageContentImage", + "description": "Image content for input messages in OpenAI response format." + }, + "OpenAIResponseInputMessageContentText": { + "properties": { + "text": { + "type": "string", + "title": "Text" + }, + "type": { + "type": "string", + "const": "input_text", + "title": "Type", + "default": "input_text" + } + }, + "type": "object", + "required": [ + "text" + ], + "title": "OpenAIResponseInputMessageContentText", + "description": "Text content for input messages in OpenAI response format." + }, + "OpenAIResponseInputToolFileSearch": { + "properties": { + "type": { + "type": "string", + "const": "file_search", + "title": "Type", + "default": "file_search" + }, + "vector_store_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Vector Store Ids" + }, + "filters": { + "title": "Filters", + "additionalProperties": true, + "type": "object" + }, + "max_num_results": { + "title": "Max Num Results", + "default": 10, + "type": "integer", + "maximum": 50.0, + "minimum": 1.0 + }, + "ranking_options": { + "$ref": "#/components/schemas/SearchRankingOptions" + } + }, + "type": "object", + "required": [ + "vector_store_ids" + ], + "title": "OpenAIResponseInputToolFileSearch", + "description": "File search tool configuration for OpenAI response inputs." + }, + "OpenAIResponseInputToolFunction": { + "properties": { + "type": { + "type": "string", + "const": "function", + "title": "Type", + "default": "function" + }, + "name": { + "type": "string", + "title": "Name" + }, + "description": { + "title": "Description", + "type": "string" + }, + "parameters": { + "title": "Parameters", + "additionalProperties": true, + "type": "object" + }, + "strict": { + "title": "Strict", + "type": "boolean" + } + }, + "type": "object", + "required": [ + "name", + "parameters" + ], + "title": "OpenAIResponseInputToolFunction", + "description": "Function tool configuration for OpenAI response inputs." + }, + "OpenAIResponseInputToolMCP": { + "properties": { + "type": { + "type": "string", + "const": "mcp", + "title": "Type", + "default": "mcp" + }, + "server_label": { + "type": "string", + "title": "Server Label" + }, + "server_url": { + "type": "string", + "title": "Server Url" + }, + "headers": { + "title": "Headers", + "additionalProperties": true, + "type": "object" + }, + "require_approval": { + "anyOf": [ + { + "type": "string", + "const": "always" + }, + { + "type": "string", + "const": "never" + }, + { + "$ref": "#/components/schemas/ApprovalFilter" + } + ], + "title": "Require Approval", + "default": "never" + }, + "allowed_tools": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/AllowedToolsFilter" + } + ], + "title": "Allowed Tools" + } + }, + "type": "object", + "required": [ + "server_label", + "server_url" + ], + "title": "OpenAIResponseInputToolMCP", + "description": "Model Context Protocol (MCP) tool configuration for OpenAI response inputs." + }, + "OpenAIResponseInputToolWebSearch": { + "properties": { + "type": { + "anyOf": [ + { + "type": "string", + "const": "web_search" + }, + { + "type": "string", + "const": "web_search_preview" + }, + { + "type": "string", + "const": "web_search_preview_2025_03_11" + } + ], + "title": "Type", + "default": "web_search" + }, + "search_context_size": { + "title": "Search Context Size", + "default": "medium", + "type": "string", + "pattern": "^low|medium|high$" + } + }, + "type": "object", + "title": "OpenAIResponseInputToolWebSearch", + "description": "Web search tool configuration for OpenAI response inputs." + }, + "OpenAIResponseMCPApprovalRequest": { + "properties": { + "arguments": { + "type": "string", + "title": "Arguments" + }, + "id": { + "type": "string", + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "server_label": { + "type": "string", + "title": "Server Label" + }, + "type": { + "type": "string", + "const": "mcp_approval_request", + "title": "Type", + "default": "mcp_approval_request" + } + }, + "type": "object", + "required": [ + "arguments", + "id", + "name", + "server_label" + ], + "title": "OpenAIResponseMCPApprovalRequest", + "description": "A request for human approval of a tool invocation." + }, + "OpenAIResponseMCPApprovalResponse": { + "properties": { + "approval_request_id": { + "type": "string", + "title": "Approval Request Id" + }, + "approve": { + "type": "boolean", + "title": "Approve" + }, + "type": { + "type": "string", + "const": "mcp_approval_response", + "title": "Type", + "default": "mcp_approval_response" + }, + "id": { + "title": "Id", + "type": "string" + }, + "reason": { + "title": "Reason", + "type": "string" + } + }, + "type": "object", + "required": [ + "approval_request_id", + "approve" + ], + "title": "OpenAIResponseMCPApprovalResponse", + "description": "A response to an MCP approval request." + }, + "OpenAIResponseMessage-Input": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", + "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", + "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" + } + } + }, + "type": "array" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "output_text": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText", + "refusal": "#/components/schemas/OpenAIResponseContentPartRefusal" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "role": { + "anyOf": [ + { + "type": "string", + "const": "system" + }, + { + "type": "string", + "const": "developer" + }, + { + "type": "string", + "const": "user" + }, + { + "type": "string", + "const": "assistant" + } + ], + "title": "Role" + }, + "type": { + "type": "string", + "const": "message", + "title": "Type", + "default": "message" + }, + "id": { + "title": "Id", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "type": "object", + "required": [ + "content", + "role" + ], + "title": "OpenAIResponseMessage", + "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + }, + "OpenAIResponseMessage-Output": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", + "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", + "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" + } + } + }, + "type": "array" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "output_text": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText", + "refusal": "#/components/schemas/OpenAIResponseContentPartRefusal" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "role": { + "anyOf": [ + { + "type": "string", + "const": "system" + }, + { + "type": "string", + "const": "developer" + }, + { + "type": "string", + "const": "user" + }, + { + "type": "string", + "const": "assistant" + } + ], + "title": "Role" + }, + "type": { + "type": "string", + "const": "message", + "title": "Type", + "default": "message" + }, + "id": { + "title": "Id", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "type": "object", + "required": [ + "content", + "role" + ], + "title": "OpenAIResponseMessage", + "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + }, + "OpenAIResponseObject": { + "properties": { + "created_at": { + "type": "integer", + "title": "Created At" + }, + "error": { + "$ref": "#/components/schemas/OpenAIResponseError" + }, + "id": { + "type": "string", + "title": "Id" + }, + "model": { + "type": "string", + "title": "Model" + }, + "object": { + "type": "string", + "const": "response", + "title": "Object", + "default": "response" + }, + "output": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage-Output" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", + "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", + "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", + "message": "#/components/schemas/OpenAIResponseMessage-Output", + "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + } + } + }, + "type": "array", + "title": "Output" + }, + "parallel_tool_calls": { + "type": "boolean", + "title": "Parallel Tool Calls", + "default": false + }, + "previous_response_id": { + "title": "Previous Response Id", + "type": "string" + }, + "prompt": { + "$ref": "#/components/schemas/OpenAIResponsePrompt" + }, + "status": { + "type": "string", + "title": "Status" + }, + "temperature": { + "title": "Temperature", + "type": "number" + }, + "text": { + "$ref": "#/components/schemas/OpenAIResponseText", + "default": { + "format": { + "type": "text" + } + } + }, + "top_p": { + "title": "Top P", + "type": "number" + }, + "tools": { + "title": "Tools", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" + }, + { + "$ref": "#/components/schemas/OpenAIResponseToolMCP" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "file_search": "#/components/schemas/OpenAIResponseInputToolFileSearch", + "function": "#/components/schemas/OpenAIResponseInputToolFunction", + "mcp": "#/components/schemas/OpenAIResponseToolMCP", + "web_search": "#/components/schemas/OpenAIResponseInputToolWebSearch", + "web_search_preview": "#/components/schemas/OpenAIResponseInputToolWebSearch", + "web_search_preview_2025_03_11": "#/components/schemas/OpenAIResponseInputToolWebSearch" + } + } + }, + "type": "array" + }, + "truncation": { + "title": "Truncation", + "type": "string" + }, + "usage": { + "$ref": "#/components/schemas/OpenAIResponseUsage" + }, + "instructions": { + "title": "Instructions", + "type": "string" + } + }, + "type": "object", + "required": [ + "created_at", + "id", + "model", + "output", + "status" + ], + "title": "OpenAIResponseObject", + "description": "Complete OpenAI response object containing generation results and metadata." + }, + "OpenAIResponseOutputMessageContentOutputText": { + "properties": { + "text": { + "type": "string", + "title": "Text" + }, + "type": { + "type": "string", + "const": "output_text", + "title": "Type", + "default": "output_text" + }, + "annotations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationFileCitation" + }, + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationCitation" + }, + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation" + }, + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationFilePath" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "container_file_citation": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation", + "file_citation": "#/components/schemas/OpenAIResponseAnnotationFileCitation", + "file_path": "#/components/schemas/OpenAIResponseAnnotationFilePath", + "url_citation": "#/components/schemas/OpenAIResponseAnnotationCitation" + } + } + }, + "type": "array", + "title": "Annotations" + } + }, + "type": "object", + "required": [ + "text" + ], + "title": "OpenAIResponseOutputMessageContentOutputText" + }, + "OpenAIResponseOutputMessageFileSearchToolCall": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "queries": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Queries" + }, + "status": { + "type": "string", + "title": "Status" + }, + "type": { + "type": "string", + "const": "file_search_call", + "title": "Type", + "default": "file_search_call" + }, + "results": { + "title": "Results", + "items": { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "id", + "queries", + "status" + ], + "title": "OpenAIResponseOutputMessageFileSearchToolCall", + "description": "File search tool call output message for OpenAI responses." + }, + "OpenAIResponseOutputMessageFileSearchToolCallResults": { + "properties": { + "attributes": { + "additionalProperties": true, + "type": "object", + "title": "Attributes" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "score": { + "type": "number", + "title": "Score" + }, + "text": { + "type": "string", + "title": "Text" + } + }, + "type": "object", + "required": [ + "attributes", + "file_id", + "filename", + "score", + "text" + ], + "title": "OpenAIResponseOutputMessageFileSearchToolCallResults", + "description": "Search results returned by the file search operation." + }, + "OpenAIResponseOutputMessageFunctionToolCall": { + "properties": { + "call_id": { + "type": "string", + "title": "Call Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "arguments": { + "type": "string", + "title": "Arguments" + }, + "type": { + "type": "string", + "const": "function_call", + "title": "Type", + "default": "function_call" + }, + "id": { + "title": "Id", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "type": "object", + "required": [ + "call_id", + "name", + "arguments" + ], + "title": "OpenAIResponseOutputMessageFunctionToolCall", + "description": "Function tool call output message for OpenAI responses." + }, + "OpenAIResponseOutputMessageMCPCall": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "type": { + "type": "string", + "const": "mcp_call", + "title": "Type", + "default": "mcp_call" + }, + "arguments": { + "type": "string", + "title": "Arguments" + }, + "name": { + "type": "string", + "title": "Name" + }, + "server_label": { + "type": "string", + "title": "Server Label" + }, + "error": { + "title": "Error", + "type": "string" + }, + "output": { + "title": "Output", + "type": "string" + } + }, + "type": "object", + "required": [ + "id", + "arguments", + "name", + "server_label" + ], + "title": "OpenAIResponseOutputMessageMCPCall", + "description": "Model Context Protocol (MCP) call output message for OpenAI responses." + }, + "OpenAIResponseOutputMessageMCPListTools": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "type": { + "type": "string", + "const": "mcp_list_tools", + "title": "Type", + "default": "mcp_list_tools" + }, + "server_label": { + "type": "string", + "title": "Server Label" + }, + "tools": { + "items": { + "$ref": "#/components/schemas/MCPListToolsTool" + }, + "type": "array", + "title": "Tools" + } + }, + "type": "object", + "required": [ + "id", + "server_label", + "tools" + ], + "title": "OpenAIResponseOutputMessageMCPListTools", + "description": "MCP list tools output message containing available tools from an MCP server." + }, + "OpenAIResponseOutputMessageWebSearchToolCall": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "status": { + "type": "string", + "title": "Status" + }, + "type": { + "type": "string", + "const": "web_search_call", + "title": "Type", + "default": "web_search_call" + } + }, + "type": "object", + "required": [ + "id", + "status" + ], + "title": "OpenAIResponseOutputMessageWebSearchToolCall", + "description": "Web search tool call output message for OpenAI responses." + }, + "OpenAIResponsePrompt": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "variables": { + "title": "Variables", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", + "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", + "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" + } + } + }, + "type": "object" + }, + "version": { + "title": "Version", + "type": "string" + } + }, + "type": "object", + "required": [ + "id" + ], + "title": "OpenAIResponsePrompt", + "description": "OpenAI compatible Prompt object that is used in OpenAI responses." + }, + "OpenAIResponseText": { + "properties": { + "format": { + "$ref": "#/components/schemas/OpenAIResponseTextFormat" + } + }, + "type": "object", + "title": "OpenAIResponseText", + "description": "Text response configuration for OpenAI responses." + }, + "OpenAIResponseTextFormat": { + "properties": { + "type": { + "anyOf": [ + { + "type": "string", + "const": "text" + }, + { + "type": "string", + "const": "json_schema" + }, + { + "type": "string", + "const": "json_object" + } + ], + "title": "Type" + }, + "name": { + "title": "Name", + "type": "string" + }, + "schema": { + "title": "Schema", + "additionalProperties": true, + "type": "object" + }, + "description": { + "title": "Description", + "type": "string" + }, + "strict": { + "title": "Strict", + "type": "boolean" + } + }, + "type": "object", + "title": "OpenAIResponseTextFormat", + "description": "Configuration for Responses API text format." + }, + "OpenAIResponseToolMCP": { + "properties": { + "type": { + "type": "string", + "const": "mcp", + "title": "Type", + "default": "mcp" + }, + "server_label": { + "type": "string", + "title": "Server Label" + }, + "allowed_tools": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/AllowedToolsFilter" + } + ], + "title": "Allowed Tools" + } + }, + "type": "object", + "required": [ + "server_label" + ], + "title": "OpenAIResponseToolMCP", + "description": "Model Context Protocol (MCP) tool configuration for OpenAI response object." + }, + "OpenAIResponseUsage": { + "properties": { + "input_tokens": { + "type": "integer", + "title": "Input Tokens" + }, + "output_tokens": { + "type": "integer", + "title": "Output Tokens" + }, + "total_tokens": { + "type": "integer", + "title": "Total Tokens" + }, + "input_tokens_details": { + "$ref": "#/components/schemas/OpenAIResponseUsageInputTokensDetails" + }, + "output_tokens_details": { + "$ref": "#/components/schemas/OpenAIResponseUsageOutputTokensDetails" + } + }, + "type": "object", + "required": [ + "input_tokens", + "output_tokens", + "total_tokens" + ], + "title": "OpenAIResponseUsage", + "description": "Usage information for OpenAI response." + }, + "OpenAIResponseUsageInputTokensDetails": { + "properties": { + "cached_tokens": { + "title": "Cached Tokens", + "type": "integer" + } + }, + "type": "object", + "title": "OpenAIResponseUsageInputTokensDetails", + "description": "Token details for input tokens in OpenAI response usage." + }, + "OpenAIResponseUsageOutputTokensDetails": { + "properties": { + "reasoning_tokens": { + "title": "Reasoning Tokens", + "type": "integer" + } + }, + "type": "object", + "title": "OpenAIResponseUsageOutputTokensDetails", + "description": "Token details for output tokens in OpenAI response usage." + }, + "OpenAISystemMessageParam": { + "properties": { + "role": { + "type": "string", + "const": "system", + "title": "Role", + "default": "system" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "OpenAISystemMessageParam", + "description": "A system message providing instructions or context to the model." + }, + "OpenAITokenLogProb": { + "properties": { + "token": { + "type": "string", + "title": "Token" + }, + "bytes": { + "title": "Bytes", + "items": { + "type": "integer" + }, + "type": "array" + }, + "logprob": { + "type": "number", + "title": "Logprob" + }, + "top_logprobs": { + "items": { + "$ref": "#/components/schemas/OpenAITopLogProb" + }, + "type": "array", + "title": "Top Logprobs" + } + }, + "type": "object", + "required": [ + "token", + "logprob", + "top_logprobs" + ], + "title": "OpenAITokenLogProb", + "description": "The log probability for a token from an OpenAI-compatible chat completion response." + }, + "OpenAIToolMessageParam": { + "properties": { + "role": { + "type": "string", + "const": "tool", + "title": "Role", + "default": "tool" + }, + "tool_call_id": { + "type": "string", + "title": "Tool Call Id" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content" + } + }, + "type": "object", + "required": [ + "tool_call_id", + "content" + ], + "title": "OpenAIToolMessageParam", + "description": "A message representing the result of a tool invocation in an OpenAI-compatible chat completion request." + }, + "OpenAITopLogProb": { + "properties": { + "token": { + "type": "string", + "title": "Token" + }, + "bytes": { + "title": "Bytes", + "items": { + "type": "integer" + }, + "type": "array" + }, + "logprob": { + "type": "number", + "title": "Logprob" + } + }, + "type": "object", + "required": [ + "token", + "logprob" + ], + "title": "OpenAITopLogProb", + "description": "The top log probability for a token from an OpenAI-compatible chat completion response." + }, + "OpenAIUserMessageParam-Input": { + "properties": { + "role": { + "type": "string", + "const": "user", + "title": "Role", + "default": "user" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" + }, + { + "$ref": "#/components/schemas/OpenAIFile" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "file": "#/components/schemas/OpenAIFile", + "image_url": "#/components/schemas/OpenAIChatCompletionContentPartImageParam", + "text": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "OpenAIUserMessageParam", + "description": "A message from the user in an OpenAI-compatible chat completion request." + }, + "OpenAIUserMessageParam-Output": { + "properties": { + "role": { + "type": "string", + "const": "user", + "title": "Role", + "default": "user" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" + }, + { + "$ref": "#/components/schemas/OpenAIFile" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "file": "#/components/schemas/OpenAIFile", + "image_url": "#/components/schemas/OpenAIChatCompletionContentPartImageParam", + "text": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "OpenAIUserMessageParam", + "description": "A message from the user in an OpenAI-compatible chat completion request." + }, + "OptimizerConfig": { + "properties": { + "optimizer_type": { + "$ref": "#/components/schemas/OptimizerType" + }, + "lr": { + "type": "number", + "title": "Lr" + }, + "weight_decay": { + "type": "number", + "title": "Weight Decay" + }, + "num_warmup_steps": { + "type": "integer", + "title": "Num Warmup Steps" + } + }, + "type": "object", + "required": [ + "optimizer_type", + "lr", + "weight_decay", + "num_warmup_steps" + ], + "title": "OptimizerConfig", + "description": "Configuration parameters for the optimization algorithm." + }, + "OptimizerType": { + "type": "string", + "enum": [ + "adam", + "adamw", + "sgd" + ], + "title": "OptimizerType", + "description": "Available optimizer algorithms for training." + }, + "Order": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "title": "Order", + "description": "Sort order for paginated responses." + }, + "OutputTokensDetails": { + "properties": { + "reasoning_tokens": { + "type": "integer", + "title": "Reasoning Tokens" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "reasoning_tokens" + ], + "title": "OutputTokensDetails" + }, + "PostTrainingJob": { + "properties": { + "job_uuid": { + "type": "string", + "title": "Job Uuid" + } + }, + "type": "object", + "required": [ + "job_uuid" + ], + "title": "PostTrainingJob" + }, + "Prompt": { + "properties": { + "prompt": { + "title": "Prompt", + "description": "The system prompt with variable placeholders", + "type": "string" + }, + "version": { + "type": "integer", + "minimum": 1.0, + "title": "Version", + "description": "Version (integer starting at 1, incremented on save)" + }, + "prompt_id": { + "type": "string", + "title": "Prompt Id", + "description": "Unique identifier in format 'pmpt_<48-digit-hash>'" + }, + "variables": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Variables", + "description": "List of variable names that can be used in the prompt template" + }, + "is_default": { + "type": "boolean", + "title": "Is Default", + "description": "Boolean indicating whether this version is the default version", + "default": false + } + }, + "type": "object", + "required": [ + "version", + "prompt_id" + ], + "title": "Prompt", + "description": "A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack." + }, + "ProviderInfo": { + "properties": { + "api": { + "type": "string", + "title": "Api" + }, + "provider_id": { + "type": "string", + "title": "Provider Id" + }, + "provider_type": { + "type": "string", + "title": "Provider Type" + }, + "config": { + "additionalProperties": true, + "type": "object", + "title": "Config" + }, + "health": { + "additionalProperties": true, + "type": "object", + "title": "Health" + } + }, + "type": "object", + "required": [ + "api", + "provider_id", + "provider_type", + "config", + "health" + ], + "title": "ProviderInfo", + "description": "Information about a registered provider including its configuration and health status." + }, + "QueryChunksResponse": { + "properties": { + "chunks": { + "items": { + "$ref": "#/components/schemas/Chunk-Output" + }, + "type": "array", + "title": "Chunks" + }, + "scores": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Scores" + } + }, + "type": "object", + "required": [ + "chunks", + "scores" + ], + "title": "QueryChunksResponse", + "description": "Response from querying chunks in a vector database." + }, + "RAGQueryConfig": { + "properties": { + "query_generator_config": { + "oneOf": [ + { + "$ref": "#/components/schemas/DefaultRAGQueryGeneratorConfig" + }, + { + "$ref": "#/components/schemas/LLMRAGQueryGeneratorConfig" + } + ], + "title": "Query Generator Config", + "default": { + "type": "default", + "separator": " " + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "default": "#/components/schemas/DefaultRAGQueryGeneratorConfig", + "llm": "#/components/schemas/LLMRAGQueryGeneratorConfig" + } + } + }, + "max_tokens_in_context": { + "type": "integer", + "title": "Max Tokens In Context", + "default": 4096 + }, + "max_chunks": { + "type": "integer", + "title": "Max Chunks", + "default": 5 + }, + "chunk_template": { + "type": "string", + "title": "Chunk Template", + "default": "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n" + }, + "mode": { + "default": "vector", + "$ref": "#/components/schemas/RAGSearchMode" + }, + "ranker": { + "title": "Ranker", + "oneOf": [ + { + "$ref": "#/components/schemas/RRFRanker" + }, + { + "$ref": "#/components/schemas/WeightedRanker" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "rrf": "#/components/schemas/RRFRanker", + "weighted": "#/components/schemas/WeightedRanker" + } + } + } + }, + "type": "object", + "title": "RAGQueryConfig", + "description": "Configuration for the RAG query generation." + }, + "RAGQueryResult": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + } + }, + "type": "object", + "title": "RAGQueryResult", + "description": "Result of a RAG query containing retrieved content and metadata." + }, + "RAGSearchMode": { + "type": "string", + "enum": [ + "vector", + "keyword", + "hybrid" + ], + "title": "RAGSearchMode", + "description": "Search modes for RAG query retrieval:\n- VECTOR: Uses vector similarity search for semantic matching\n- KEYWORD: Uses keyword-based search for exact matching\n- HYBRID: Combines both vector and keyword search for better results" + }, + "RRFRanker": { + "properties": { + "type": { + "type": "string", + "const": "rrf", + "title": "Type", + "default": "rrf" + }, + "impact_factor": { + "type": "number", + "title": "Impact Factor", + "default": 60.0, + "minimum": 0.0 + } + }, + "type": "object", + "title": "RRFRanker", + "description": "Reciprocal Rank Fusion (RRF) ranker configuration." + }, + "RegexParserScoringFnParams": { + "properties": { + "type": { + "type": "string", + "const": "regex_parser", + "title": "Type", + "default": "regex_parser" + }, + "parsing_regexes": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Parsing Regexes", + "description": "Regex to extract the answer from generated response" + }, + "aggregation_functions": { + "items": { + "$ref": "#/components/schemas/AggregationFunctionType" + }, + "type": "array", + "title": "Aggregation Functions", + "description": "Aggregation functions to apply to the scores of each row" + } + }, + "type": "object", + "title": "RegexParserScoringFnParams", + "description": "Parameters for regex parser scoring function configuration." + }, + "RerankData": { + "properties": { + "index": { + "type": "integer", + "title": "Index" + }, + "relevance_score": { + "type": "number", + "title": "Relevance Score" + } + }, + "type": "object", + "required": [ + "index", + "relevance_score" + ], + "title": "RerankData", + "description": "A single rerank result from a reranking response." + }, + "RerankResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/RerankData" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "RerankResponse", + "description": "Response from a reranking request." + }, + "RouteInfo": { + "properties": { + "route": { + "type": "string", + "title": "Route" + }, + "method": { + "type": "string", + "title": "Method" + }, + "provider_types": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Provider Types" + } + }, + "type": "object", + "required": [ + "route", + "method", + "provider_types" + ], + "title": "RouteInfo", + "description": "Information about an API route including its path, method, and implementing providers." + }, + "RowsDataSource": { + "properties": { + "type": { + "type": "string", + "const": "rows", + "title": "Type", + "default": "rows" + }, + "rows": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Rows" + } + }, + "type": "object", + "required": [ + "rows" + ], + "title": "RowsDataSource", + "description": "A dataset stored in rows." + }, + "RunShieldResponse": { + "properties": { + "violation": { + "$ref": "#/components/schemas/SafetyViolation" + } + }, + "type": "object", + "title": "RunShieldResponse", + "description": "Response from running a safety shield." + }, + "SafetyViolation": { + "properties": { + "violation_level": { + "$ref": "#/components/schemas/ViolationLevel" + }, + "user_message": { + "title": "User Message", + "type": "string" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "violation_level" + ], + "title": "SafetyViolation", + "description": "Details of a safety violation detected by content moderation." + }, + "SamplingParams": { + "properties": { + "strategy": { + "oneOf": [ + { + "$ref": "#/components/schemas/GreedySamplingStrategy" + }, + { + "$ref": "#/components/schemas/TopPSamplingStrategy" + }, + { + "$ref": "#/components/schemas/TopKSamplingStrategy" + } + ], + "title": "Strategy", + "discriminator": { + "propertyName": "type", + "mapping": { + "greedy": "#/components/schemas/GreedySamplingStrategy", + "top_k": "#/components/schemas/TopKSamplingStrategy", + "top_p": "#/components/schemas/TopPSamplingStrategy" + } + } + }, + "max_tokens": { + "title": "Max Tokens", + "type": "integer" + }, + "repetition_penalty": { + "title": "Repetition Penalty", + "default": 1.0, + "type": "number" + }, + "stop": { + "title": "Stop", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "title": "SamplingParams", + "description": "Sampling parameters." + }, + "ScoreBatchResponse": { + "properties": { + "dataset_id": { + "title": "Dataset Id", + "type": "string" + }, + "results": { + "additionalProperties": { + "$ref": "#/components/schemas/ScoringResult" + }, + "type": "object", + "title": "Results" + } + }, + "type": "object", + "required": [ + "results" + ], + "title": "ScoreBatchResponse", + "description": "Response from batch scoring operations on datasets." + }, + "ScoreResponse": { + "properties": { + "results": { + "additionalProperties": { + "$ref": "#/components/schemas/ScoringResult" + }, + "type": "object", + "title": "Results" + } + }, + "type": "object", + "required": [ + "results" + ], + "title": "ScoreResponse", + "description": "The response from scoring." + }, + "ScoringFn-Input": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "scoring_function", + "title": "Type", + "default": "scoring_function" + }, + "description": { + "title": "Description", + "type": "string" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata", + "description": "Any additional metadata for this definition" + }, + "return_type": { + "oneOf": [ + { + "$ref": "#/components/schemas/StringType" + }, + { + "$ref": "#/components/schemas/NumberType" + }, + { + "$ref": "#/components/schemas/BooleanType" + }, + { + "$ref": "#/components/schemas/ArrayType" + }, + { + "$ref": "#/components/schemas/ObjectType" + }, + { + "$ref": "#/components/schemas/JsonType" + }, + { + "$ref": "#/components/schemas/UnionType" + }, + { + "$ref": "#/components/schemas/ChatCompletionInputType" + }, + { + "$ref": "#/components/schemas/CompletionInputType" + }, + { + "$ref": "#/components/schemas/AgentTurnInputType" + } + ], + "title": "Return Type", + "description": "The return type of the deterministic function", + "discriminator": { + "propertyName": "type", + "mapping": { + "agent_turn_input": "#/components/schemas/AgentTurnInputType", + "array": "#/components/schemas/ArrayType", + "boolean": "#/components/schemas/BooleanType", + "chat_completion_input": "#/components/schemas/ChatCompletionInputType", + "completion_input": "#/components/schemas/CompletionInputType", + "json": "#/components/schemas/JsonType", + "number": "#/components/schemas/NumberType", + "object": "#/components/schemas/ObjectType", + "string": "#/components/schemas/StringType", + "union": "#/components/schemas/UnionType" + } + } + }, + "params": { + "title": "Params", + "description": "The parameters for the scoring function for benchmark eval, these can be overridden for app eval", + "oneOf": [ + { + "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" + }, + { + "$ref": "#/components/schemas/RegexParserScoringFnParams" + }, + { + "$ref": "#/components/schemas/BasicScoringFnParams" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "basic": "#/components/schemas/BasicScoringFnParams", + "llm_as_judge": "#/components/schemas/LLMAsJudgeScoringFnParams", + "regex_parser": "#/components/schemas/RegexParserScoringFnParams" + } + } + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id", + "return_type" + ], + "title": "ScoringFn", + "description": "A scoring function resource for evaluating model outputs." + }, + "ScoringFn-Output": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "scoring_function", + "title": "Type", + "default": "scoring_function" + }, + "description": { + "title": "Description", + "type": "string" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata", + "description": "Any additional metadata for this definition" + }, + "return_type": { + "oneOf": [ + { + "$ref": "#/components/schemas/StringType" + }, + { + "$ref": "#/components/schemas/NumberType" + }, + { + "$ref": "#/components/schemas/BooleanType" + }, + { + "$ref": "#/components/schemas/ArrayType" + }, + { + "$ref": "#/components/schemas/ObjectType" + }, + { + "$ref": "#/components/schemas/JsonType" + }, + { + "$ref": "#/components/schemas/UnionType" + }, + { + "$ref": "#/components/schemas/ChatCompletionInputType" + }, + { + "$ref": "#/components/schemas/CompletionInputType" + }, + { + "$ref": "#/components/schemas/AgentTurnInputType" + } + ], + "title": "Return Type", + "description": "The return type of the deterministic function", + "discriminator": { + "propertyName": "type", + "mapping": { + "agent_turn_input": "#/components/schemas/AgentTurnInputType", + "array": "#/components/schemas/ArrayType", + "boolean": "#/components/schemas/BooleanType", + "chat_completion_input": "#/components/schemas/ChatCompletionInputType", + "completion_input": "#/components/schemas/CompletionInputType", + "json": "#/components/schemas/JsonType", + "number": "#/components/schemas/NumberType", + "object": "#/components/schemas/ObjectType", + "string": "#/components/schemas/StringType", + "union": "#/components/schemas/UnionType" + } + } + }, + "params": { + "title": "Params", + "description": "The parameters for the scoring function for benchmark eval, these can be overridden for app eval", + "oneOf": [ + { + "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" + }, + { + "$ref": "#/components/schemas/RegexParserScoringFnParams" + }, + { + "$ref": "#/components/schemas/BasicScoringFnParams" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "basic": "#/components/schemas/BasicScoringFnParams", + "llm_as_judge": "#/components/schemas/LLMAsJudgeScoringFnParams", + "regex_parser": "#/components/schemas/RegexParserScoringFnParams" + } + } + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id", + "return_type" + ], + "title": "ScoringFn", + "description": "A scoring function resource for evaluating model outputs." + }, + "ScoringResult": { + "properties": { + "score_rows": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Score Rows" + }, + "aggregated_results": { + "additionalProperties": true, + "type": "object", + "title": "Aggregated Results" + } + }, + "type": "object", + "required": [ + "score_rows", + "aggregated_results" + ], + "title": "ScoringResult", + "description": "A scoring result for a single row." + }, + "SearchRankingOptions": { + "properties": { + "ranker": { + "title": "Ranker", + "type": "string" + }, + "score_threshold": { + "title": "Score Threshold", + "default": 0.0, + "type": "number" + } + }, + "type": "object", + "title": "SearchRankingOptions", + "description": "Options for ranking and filtering search results." + }, + "Shield": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "shield", + "title": "Type", + "default": "shield" + }, + "params": { + "title": "Params", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id" + ], + "title": "Shield", + "description": "A safety shield resource that can be used to check content." + }, + "ShieldCallStep-Input": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "step_id": { + "type": "string", + "title": "Step Id" + }, + "started_at": { + "title": "Started At", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + }, + "step_type": { + "type": "string", + "const": "shield_call", + "title": "Step Type", + "default": "shield_call" + }, + "violation": { + "$ref": "#/components/schemas/SafetyViolation" + } + }, + "type": "object", + "required": [ + "turn_id", + "step_id", + "violation" + ], + "title": "ShieldCallStep", + "description": "A shield call step in an agent turn." + }, + "ShieldCallStep-Output": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "step_id": { + "type": "string", + "title": "Step Id" + }, + "started_at": { + "title": "Started At", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + }, + "step_type": { + "type": "string", + "const": "shield_call", + "title": "Step Type", + "default": "shield_call" + }, + "violation": { + "$ref": "#/components/schemas/SafetyViolation" + } + }, + "type": "object", + "required": [ + "turn_id", + "step_id", + "violation" + ], + "title": "ShieldCallStep", + "description": "A shield call step in an agent turn." + }, + "StopReason": { + "type": "string", + "enum": [ + "end_of_turn", + "end_of_message", + "out_of_tokens" + ], + "title": "StopReason" + }, + "StringType": { + "properties": { + "type": { + "type": "string", + "const": "string", + "title": "Type", + "default": "string" + } + }, + "type": "object", + "title": "StringType", + "description": "Parameter type for string values." + }, + "SystemMessage": { + "properties": { + "role": { + "type": "string", + "const": "system", + "title": "Role", + "default": "system" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "SystemMessage", + "description": "A system message providing instructions or context to the model." + }, + "SystemMessageBehavior": { + "type": "string", + "enum": [ + "append", + "replace" + ], + "title": "SystemMessageBehavior", + "description": "Config for how to override the default system prompt." + }, + "TextContentItem": { + "properties": { + "type": { + "type": "string", + "const": "text", + "title": "Type", + "default": "text" + }, + "text": { + "type": "string", + "title": "Text" + } + }, + "type": "object", + "required": [ + "text" + ], + "title": "TextContentItem", + "description": "A text content item" + }, + "ToolCall": { + "properties": { + "call_id": { + "type": "string", + "title": "Call Id" + }, + "tool_name": { + "anyOf": [ + { + "$ref": "#/components/schemas/BuiltinTool" + }, + { + "type": "string" + } + ], + "title": "Tool Name" + }, + "arguments": { + "type": "string", + "title": "Arguments" + } + }, + "type": "object", + "required": [ + "call_id", + "tool_name", + "arguments" + ], + "title": "ToolCall" + }, + "ToolChoice": { + "type": "string", + "enum": [ + "auto", + "required", + "none" + ], + "title": "ToolChoice", + "description": "Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model." + }, + "ToolConfig": { + "properties": { + "tool_choice": { + "anyOf": [ + { + "$ref": "#/components/schemas/ToolChoice" + }, + { + "type": "string" + } + ], + "title": "Tool Choice", + "default": "auto" + }, + "tool_prompt_format": { + "$ref": "#/components/schemas/ToolPromptFormat" + }, + "system_message_behavior": { + "default": "append", + "$ref": "#/components/schemas/SystemMessageBehavior" + } + }, + "type": "object", + "title": "ToolConfig", + "description": "Configuration for tool use." + }, + "ToolDef": { + "properties": { + "toolgroup_id": { + "title": "Toolgroup Id", + "type": "string" + }, + "name": { + "type": "string", + "title": "Name" + }, + "description": { + "title": "Description", + "type": "string" + }, + "input_schema": { + "title": "Input Schema", + "additionalProperties": true, + "type": "object" + }, + "output_schema": { + "title": "Output Schema", + "additionalProperties": true, + "type": "object" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "required": [ + "name" + ], + "title": "ToolDef", + "description": "Tool definition used in runtime contexts." + }, + "ToolExecutionStep-Input": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "step_id": { + "type": "string", + "title": "Step Id" + }, + "started_at": { + "title": "Started At", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + }, + "step_type": { + "type": "string", + "const": "tool_execution", + "title": "Step Type", + "default": "tool_execution" + }, + "tool_calls": { + "items": { + "$ref": "#/components/schemas/ToolCall" + }, + "type": "array", + "title": "Tool Calls" + }, + "tool_responses": { + "items": { + "$ref": "#/components/schemas/ToolResponse-Input" + }, + "type": "array", + "title": "Tool Responses" + } + }, + "type": "object", + "required": [ + "turn_id", + "step_id", + "tool_calls", + "tool_responses" + ], + "title": "ToolExecutionStep", + "description": "A tool execution step in an agent turn." + }, + "ToolExecutionStep-Output": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "step_id": { + "type": "string", + "title": "Step Id" + }, + "started_at": { + "title": "Started At", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + }, + "step_type": { + "type": "string", + "const": "tool_execution", + "title": "Step Type", + "default": "tool_execution" + }, + "tool_calls": { + "items": { + "$ref": "#/components/schemas/ToolCall" + }, + "type": "array", + "title": "Tool Calls" + }, + "tool_responses": { + "items": { + "$ref": "#/components/schemas/ToolResponse-Output" + }, + "type": "array", + "title": "Tool Responses" + } + }, + "type": "object", + "required": [ + "turn_id", + "step_id", + "tool_calls", + "tool_responses" + ], + "title": "ToolExecutionStep", + "description": "A tool execution step in an agent turn." + }, + "ToolGroup": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "tool_group", + "title": "Type", + "default": "tool_group" + }, + "mcp_endpoint": { + "$ref": "#/components/schemas/URL" + }, + "args": { + "title": "Args", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id" + ], + "title": "ToolGroup", + "description": "A group of related tools managed together." + }, + "ToolInvocationResult": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "error_message": { + "title": "Error Message", + "type": "string" + }, + "error_code": { + "title": "Error Code", + "type": "integer" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "title": "ToolInvocationResult", + "description": "Result of a tool invocation." + }, + "ToolPromptFormat": { + "type": "string", + "enum": [ + "json", + "function_tag", + "python_list" + ], + "title": "ToolPromptFormat", + "description": "Prompt format for calling custom / zero shot tools." + }, + "ToolResponse-Input": { + "properties": { + "call_id": { + "type": "string", + "title": "Call Id" + }, + "tool_name": { + "anyOf": [ + { + "$ref": "#/components/schemas/BuiltinTool" + }, + { + "type": "string" + } + ], + "title": "Tool Name" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "required": [ + "call_id", + "tool_name", + "content" + ], + "title": "ToolResponse", + "description": "Response from a tool invocation." + }, + "ToolResponse-Output": { + "properties": { + "call_id": { + "type": "string", + "title": "Call Id" + }, + "tool_name": { + "anyOf": [ + { + "$ref": "#/components/schemas/BuiltinTool" + }, + { + "type": "string" + } + ], + "title": "Tool Name" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "required": [ + "call_id", + "tool_name", + "content" + ], + "title": "ToolResponse", + "description": "Response from a tool invocation." + }, + "ToolResponseMessage-Input": { + "properties": { + "role": { + "type": "string", + "const": "tool", + "title": "Role", + "default": "tool" + }, + "call_id": { + "type": "string", + "title": "Call Id" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + } + }, + "type": "object", + "required": [ + "call_id", + "content" + ], + "title": "ToolResponseMessage", + "description": "A message representing the result of a tool invocation." + }, + "ToolResponseMessage-Output": { + "properties": { + "role": { + "type": "string", + "const": "tool", + "title": "Role", + "default": "tool" + }, + "call_id": { + "type": "string", + "title": "Call Id" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + } + }, + "type": "object", + "required": [ + "call_id", + "content" + ], + "title": "ToolResponseMessage", + "description": "A message representing the result of a tool invocation." + }, + "TopKSamplingStrategy": { + "properties": { + "type": { + "type": "string", + "const": "top_k", + "title": "Type", + "default": "top_k" + }, + "top_k": { + "type": "integer", + "minimum": 1.0, + "title": "Top K" + } + }, + "type": "object", + "required": [ + "top_k" + ], + "title": "TopKSamplingStrategy", + "description": "Top-k sampling strategy that restricts sampling to the k most likely tokens." + }, + "TopPSamplingStrategy": { + "properties": { + "type": { + "type": "string", + "const": "top_p", + "title": "Type", + "default": "top_p" + }, + "temperature": { + "title": "Temperature", + "type": "number", + "minimum": 0.0 + }, + "top_p": { + "title": "Top P", + "default": 0.95, + "type": "number" + } + }, + "type": "object", + "required": [ + "temperature" + ], + "title": "TopPSamplingStrategy", + "description": "Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p." + }, + "TrainingConfig": { + "properties": { + "n_epochs": { + "type": "integer", + "title": "N Epochs" + }, + "max_steps_per_epoch": { + "type": "integer", + "title": "Max Steps Per Epoch", + "default": 1 + }, + "gradient_accumulation_steps": { + "type": "integer", + "title": "Gradient Accumulation Steps", + "default": 1 + }, + "max_validation_steps": { + "title": "Max Validation Steps", + "default": 1, + "type": "integer" + }, + "data_config": { + "$ref": "#/components/schemas/DataConfig" + }, + "optimizer_config": { + "$ref": "#/components/schemas/OptimizerConfig" + }, + "efficiency_config": { + "$ref": "#/components/schemas/EfficiencyConfig" + }, + "dtype": { + "title": "Dtype", + "default": "bf16", + "type": "string" + } + }, + "type": "object", + "required": [ + "n_epochs" + ], + "title": "TrainingConfig", + "description": "Comprehensive configuration for the training process." + }, + "Turn": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "session_id": { + "type": "string", + "title": "Session Id" + }, + "input_messages": { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/UserMessage-Output" + }, + { + "$ref": "#/components/schemas/ToolResponseMessage-Output" + } + ] + }, + "type": "array", + "title": "Input Messages" + }, + "steps": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InferenceStep-Output" + }, + { + "$ref": "#/components/schemas/ToolExecutionStep-Output" + }, + { + "$ref": "#/components/schemas/ShieldCallStep-Output" + }, + { + "$ref": "#/components/schemas/MemoryRetrievalStep-Output" + } + ], + "discriminator": { + "propertyName": "step_type", + "mapping": { + "inference": "#/components/schemas/InferenceStep-Output", + "memory_retrieval": "#/components/schemas/MemoryRetrievalStep-Output", + "shield_call": "#/components/schemas/ShieldCallStep-Output", + "tool_execution": "#/components/schemas/ToolExecutionStep-Output" + } + } + }, + "type": "array", + "title": "Steps" + }, + "output_message": { + "$ref": "#/components/schemas/CompletionMessage-Output" + }, + "output_attachments": { + "title": "Output Attachments", + "items": { + "$ref": "#/components/schemas/Attachment-Output" + }, + "type": "array" + }, + "started_at": { + "type": "string", + "format": "date-time", + "title": "Started At" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + } + }, + "type": "object", + "required": [ + "turn_id", + "session_id", + "input_messages", + "steps", + "output_message", + "started_at" + ], + "title": "Turn", + "description": "A single turn in an interaction with an Agentic System." + }, + "URIDataSource": { + "properties": { + "type": { + "type": "string", + "const": "uri", + "title": "Type", + "default": "uri" + }, + "uri": { + "type": "string", + "title": "Uri" + } + }, + "type": "object", + "required": [ + "uri" + ], + "title": "URIDataSource", + "description": "A dataset that can be obtained from a URI." + }, + "URL": { + "properties": { + "uri": { + "type": "string", + "title": "Uri" + } + }, + "type": "object", + "required": [ + "uri" + ], + "title": "URL", + "description": "A URL reference to external content." + }, + "UnionType": { + "properties": { + "type": { + "type": "string", + "const": "union", + "title": "Type", + "default": "union" + } + }, + "type": "object", + "title": "UnionType", + "description": "Parameter type for union values." + }, + "UserMessage-Input": { + "properties": { + "role": { + "type": "string", + "const": "user", + "title": "Role", + "default": "user" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "context": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Context" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "UserMessage", + "description": "A message from the user in a chat conversation." + }, + "UserMessage-Output": { + "properties": { + "role": { + "type": "string", + "const": "user", + "title": "Role", + "default": "user" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "context": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Context" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "UserMessage", + "description": "A message from the user in a chat conversation." + }, + "VectorStoreChunkingStrategyAuto": { + "properties": { + "type": { + "type": "string", + "const": "auto", + "title": "Type", + "default": "auto" + } + }, + "type": "object", + "title": "VectorStoreChunkingStrategyAuto", + "description": "Automatic chunking strategy for vector store files." + }, + "VectorStoreChunkingStrategyStatic": { + "properties": { + "type": { + "type": "string", + "const": "static", + "title": "Type", + "default": "static" + }, + "static": { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyStaticConfig" + } + }, + "type": "object", + "required": [ + "static" + ], + "title": "VectorStoreChunkingStrategyStatic", + "description": "Static chunking strategy with configurable parameters." + }, + "VectorStoreChunkingStrategyStaticConfig": { + "properties": { + "chunk_overlap_tokens": { + "type": "integer", + "title": "Chunk Overlap Tokens", + "default": 400 + }, + "max_chunk_size_tokens": { + "type": "integer", + "maximum": 4096.0, + "minimum": 100.0, + "title": "Max Chunk Size Tokens", + "default": 800 + } + }, + "type": "object", + "title": "VectorStoreChunkingStrategyStaticConfig", + "description": "Configuration for static chunking strategy." + }, + "VectorStoreContent": { + "properties": { + "type": { + "type": "string", + "const": "text", + "title": "Type" + }, + "text": { + "type": "string", + "title": "Text" + } + }, + "type": "object", + "required": [ + "type", + "text" + ], + "title": "VectorStoreContent", + "description": "Content item from a vector store file or search result." + }, + "VectorStoreFileBatchObject": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "object": { + "type": "string", + "title": "Object", + "default": "vector_store.file_batch" + }, + "created_at": { + "type": "integer", + "title": "Created At" + }, + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "status": { + "anyOf": [ + { + "type": "string", + "const": "completed" + }, + { + "type": "string", + "const": "in_progress" + }, + { + "type": "string", + "const": "cancelled" + }, + { + "type": "string", + "const": "failed" + } + ], + "title": "Status" + }, + "file_counts": { + "$ref": "#/components/schemas/VectorStoreFileCounts" + } + }, + "type": "object", + "required": [ + "id", + "created_at", + "vector_store_id", + "status", + "file_counts" + ], + "title": "VectorStoreFileBatchObject", + "description": "OpenAI Vector Store File Batch object." + }, + "VectorStoreFileCounts": { + "properties": { + "completed": { + "type": "integer", + "title": "Completed" + }, + "cancelled": { + "type": "integer", + "title": "Cancelled" + }, + "failed": { + "type": "integer", + "title": "Failed" + }, + "in_progress": { + "type": "integer", + "title": "In Progress" + }, + "total": { + "type": "integer", + "title": "Total" + } + }, + "type": "object", + "required": [ + "completed", + "cancelled", + "failed", + "in_progress", + "total" + ], + "title": "VectorStoreFileCounts", + "description": "File processing status counts for a vector store." + }, + "VectorStoreFileLastError": { + "properties": { + "code": { + "anyOf": [ + { + "type": "string", + "const": "server_error" + }, + { + "type": "string", + "const": "rate_limit_exceeded" + } + ], + "title": "Code" + }, + "message": { + "type": "string", + "title": "Message" + } + }, + "type": "object", + "required": [ + "code", + "message" + ], + "title": "VectorStoreFileLastError", + "description": "Error information for failed vector store file processing." + }, + "VectorStoreFileObject": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "object": { + "type": "string", + "title": "Object", + "default": "vector_store.file" + }, + "attributes": { + "additionalProperties": true, + "type": "object", + "title": "Attributes" + }, + "chunking_strategy": { + "oneOf": [ + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" + }, + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + ], + "title": "Chunking Strategy", + "discriminator": { + "propertyName": "type", + "mapping": { + "auto": "#/components/schemas/VectorStoreChunkingStrategyAuto", + "static": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + } + }, + "created_at": { + "type": "integer", + "title": "Created At" + }, + "last_error": { + "$ref": "#/components/schemas/VectorStoreFileLastError" + }, + "status": { + "anyOf": [ + { + "type": "string", + "const": "completed" + }, + { + "type": "string", + "const": "in_progress" + }, + { + "type": "string", + "const": "cancelled" + }, + { + "type": "string", + "const": "failed" + } + ], + "title": "Status" + }, + "usage_bytes": { + "type": "integer", + "title": "Usage Bytes", + "default": 0 + }, + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + } + }, + "type": "object", + "required": [ + "id", + "chunking_strategy", + "created_at", + "status", + "vector_store_id" + ], + "title": "VectorStoreFileObject", + "description": "OpenAI Vector Store File object." + }, + "VectorStoreObject": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "object": { + "type": "string", + "title": "Object", + "default": "vector_store" + }, + "created_at": { + "type": "integer", + "title": "Created At" + }, + "name": { + "title": "Name", + "type": "string" + }, + "usage_bytes": { + "type": "integer", + "title": "Usage Bytes", + "default": 0 + }, + "file_counts": { + "$ref": "#/components/schemas/VectorStoreFileCounts" + }, + "status": { + "type": "string", + "title": "Status", + "default": "completed" + }, + "expires_after": { + "title": "Expires After", + "additionalProperties": true, + "type": "object" + }, + "expires_at": { + "title": "Expires At", + "type": "integer" + }, + "last_active_at": { + "title": "Last Active At", + "type": "integer" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "id", + "created_at", + "file_counts" + ], + "title": "VectorStoreObject", + "description": "OpenAI Vector Store object." + }, + "VectorStoreSearchResponse": { + "properties": { + "file_id": { + "type": "string", + "title": "File Id" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "score": { + "type": "number", + "title": "Score" + }, + "attributes": { + "title": "Attributes", + "additionalProperties": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "object" + }, + "content": { + "items": { + "$ref": "#/components/schemas/VectorStoreContent" + }, + "type": "array", + "title": "Content" + } + }, + "type": "object", + "required": [ + "file_id", + "filename", + "score", + "content" + ], + "title": "VectorStoreSearchResponse", + "description": "Response from searching a vector store." + }, + "VectorStoreSearchResponsePage": { + "properties": { + "object": { + "type": "string", + "title": "Object", + "default": "vector_store.search_results.page" + }, + "search_query": { + "type": "string", + "title": "Search Query" + }, + "data": { + "items": { + "$ref": "#/components/schemas/VectorStoreSearchResponse" + }, + "type": "array", + "title": "Data" + }, + "has_more": { + "type": "boolean", + "title": "Has More", + "default": false + }, + "next_page": { + "title": "Next Page", + "type": "string" + } + }, + "type": "object", + "required": [ + "search_query", + "data" + ], + "title": "VectorStoreSearchResponsePage", + "description": "Paginated response from searching a vector store." + }, + "VersionInfo": { + "properties": { + "version": { + "type": "string", + "title": "Version" + } + }, + "type": "object", + "required": [ + "version" + ], + "title": "VersionInfo", + "description": "Version information for the service." + }, + "ViolationLevel": { + "type": "string", + "enum": [ + "info", + "warn", + "error" + ], + "title": "ViolationLevel", + "description": "Severity level of a safety violation." + }, + "WeightedRanker": { + "properties": { + "type": { + "type": "string", + "const": "weighted", + "title": "Type", + "default": "weighted" + }, + "alpha": { + "type": "number", + "maximum": 1.0, + "minimum": 0.0, + "title": "Alpha", + "description": "Weight factor between 0 and 1. 0 means only keyword scores, 1 means only vector scores.", + "default": 0.5 + } + }, + "type": "object", + "title": "WeightedRanker", + "description": "Weighted ranker configuration that combines vector and keyword scores." + }, + "_URLOrData": { + "properties": { + "url": { + "$ref": "#/components/schemas/URL" + }, + "data": { + "contentEncoding": "base64", + "title": "Data", + "type": "string" + } + }, + "type": "object", + "title": "_URLOrData", + "description": "A URL or a base64 encoded string" + }, + "__main_____agents_agent_id_session_Request": { + "properties": { + "agent_id": { + "type": "string", + "title": "Agent Id" + }, + "session_name": { + "type": "string", + "title": "Session Name" + } + }, + "type": "object", + "required": [ + "agent_id", + "session_name" + ], + "title": "_agents_agent_id_session_Request" + }, + "__main_____agents_agent_id_session_session_id_turn_Request": { + "properties": { + "agent_id": { + "type": "string", + "title": "Agent Id" + }, + "session_id": { + "type": "string", + "title": "Session Id" + }, + "messages": { + "$ref": "#/components/schemas/UserMessage-Input" + }, + "stream": { + "type": "boolean", + "title": "Stream", + "default": false + }, + "documents": { + "$ref": "#/components/schemas/Document" + }, + "toolgroups": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/AgentToolGroupWithArgs" + } + ], + "title": "Toolgroups" + }, + "tool_config": { + "$ref": "#/components/schemas/ToolConfig" + } + }, + "type": "object", + "required": [ + "agent_id", + "session_id", + "messages", + "documents", + "toolgroups", + "tool_config" + ], + "title": "_agents_agent_id_session_session_id_turn_Request" + }, + "__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request": { + "properties": { + "agent_id": { + "type": "string", + "title": "Agent Id" + }, + "session_id": { + "type": "string", + "title": "Session Id" + }, + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "tool_responses": { + "$ref": "#/components/schemas/ToolResponse-Input" + }, + "stream": { + "type": "boolean", + "title": "Stream", + "default": false + } + }, + "type": "object", + "required": [ + "agent_id", + "session_id", + "turn_id", + "tool_responses" + ], + "title": "_agents_agent_id_session_session_id_turn_turn_id_resume_Request" + }, + "__main_____datasets_Request": { + "properties": { + "purpose": { + "$ref": "#/components/schemas/DatasetPurpose" + }, + "metadata": { + "type": "string", + "title": "Metadata" + }, + "dataset_id": { + "type": "string", + "title": "Dataset Id" + } + }, + "type": "object", + "required": [ + "purpose", + "metadata", + "dataset_id" + ], + "title": "_datasets_Request" + }, + "_batches_Request": { + "properties": { + "input_file_id": { + "type": "string", + "title": "Input File Id" + }, + "endpoint": { + "type": "string", + "title": "Endpoint" + }, + "completion_window": { + "type": "string", + "title": "Completion Window" + }, + "metadata": { + "type": "string", + "title": "Metadata" + }, + "idempotency_key": { + "type": "string", + "title": "Idempotency Key" + } + }, + "type": "object", + "required": [ + "input_file_id", + "endpoint", + "completion_window", + "metadata", + "idempotency_key" + ], + "title": "_batches_Request" + }, + "_batches_batch_id_cancel_Request": { + "properties": { + "batch_id": { + "type": "string", + "title": "Batch Id" + } + }, + "type": "object", + "required": [ + "batch_id" + ], + "title": "_batches_batch_id_cancel_Request" + }, + "_conversations_Request": { + "properties": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage-Input" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + } + ], + "title": "Items", + "discriminator": { + "propertyName": "type", + "mapping": { + "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", + "function_call_output": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput", + "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", + "mcp_approval_response": "#/components/schemas/OpenAIResponseMCPApprovalResponse", + "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", + "message": "#/components/schemas/OpenAIResponseMessage-Input", + "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + } + } + }, + "metadata": { + "type": "string", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "items", + "metadata" + ], + "title": "_conversations_Request" + }, + "_conversations_conversation_id_Request": { + "properties": { + "conversation_id": { + "type": "string", + "title": "Conversation Id" + }, + "metadata": { + "type": "string", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "conversation_id", + "metadata" + ], + "title": "_conversations_conversation_id_Request" + }, + "_conversations_conversation_id_items_Request": { + "properties": { + "conversation_id": { + "type": "string", + "title": "Conversation Id" + }, + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage-Input" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + } + ], + "title": "Items" + } + }, + "type": "object", + "required": [ + "conversation_id", + "items" + ], + "title": "_conversations_conversation_id_items_Request" + }, + "_inference_rerank_Request": { + "properties": { + "model": { + "type": "string", + "title": "Model" + }, + "query": { + "type": "string", + "title": "Query" + }, + "items": { + "type": "string", + "title": "Items" + }, + "max_num_results": { + "type": "integer", + "title": "Max Num Results" + } + }, + "type": "object", + "required": [ + "model", + "query", + "items", + "max_num_results" + ], + "title": "_inference_rerank_Request" + }, + "_models_Request": { + "properties": { + "model_id": { + "type": "string", + "title": "Model Id" + }, + "provider_model_id": { + "type": "string", + "title": "Provider Model Id" + }, + "provider_id": { + "type": "string", + "title": "Provider Id" + }, + "metadata": { + "type": "string", + "title": "Metadata" + }, + "model_type": { + "$ref": "#/components/schemas/ModelType" + } + }, + "type": "object", + "required": [ + "model_id", + "provider_model_id", + "provider_id", + "metadata", + "model_type" + ], + "title": "_models_Request" + }, + "_moderations_Request": { + "properties": { + "input": { + "type": "string", + "title": "Input" + }, + "model": { + "type": "string", + "title": "Model" + } + }, + "type": "object", + "required": [ + "input", + "model" + ], + "title": "_moderations_Request" + }, + "_openai_v1_batches_Request": { + "properties": { + "input_file_id": { + "type": "string", + "title": "Input File Id" + }, + "endpoint": { + "type": "string", + "title": "Endpoint" + }, + "completion_window": { + "type": "string", + "title": "Completion Window" + }, + "metadata": { + "type": "string", + "title": "Metadata" + }, + "idempotency_key": { + "type": "string", + "title": "Idempotency Key" + } + }, + "type": "object", + "required": [ + "input_file_id", + "endpoint", + "completion_window", + "metadata", + "idempotency_key" + ], + "title": "_openai_v1_batches_Request" + }, + "_openai_v1_batches_batch_id_cancel_Request": { + "properties": { + "batch_id": { + "type": "string", + "title": "Batch Id" + } + }, + "type": "object", + "required": [ + "batch_id" + ], + "title": "_openai_v1_batches_batch_id_cancel_Request" + }, + "_openai_v1_moderations_Request": { + "properties": { + "input": { + "type": "string", + "title": "Input" + }, + "model": { + "type": "string", + "title": "Model" + } + }, + "type": "object", + "required": [ + "input", + "model" + ], + "title": "_openai_v1_moderations_Request" + }, + "_openai_v1_responses_Request": { + "properties": { + "input": { + "type": "string", + "title": "Input" + }, + "model": { + "type": "string", + "title": "Model" + }, + "prompt": { + "$ref": "#/components/schemas/OpenAIResponsePrompt" + }, + "instructions": { + "type": "string", + "title": "Instructions" + }, + "previous_response_id": { + "type": "string", + "title": "Previous Response Id" + }, + "conversation": { + "type": "string", + "title": "Conversation" + }, + "store": { + "type": "boolean", + "title": "Store", + "default": true + }, + "stream": { + "type": "boolean", + "title": "Stream", + "default": false + }, + "temperature": { + "type": "number", + "title": "Temperature" + }, + "text": { + "$ref": "#/components/schemas/OpenAIResponseText" + }, + "tools": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolMCP" + } + ], + "title": "Tools", + "discriminator": { + "propertyName": "type", + "mapping": { + "file_search": "#/components/schemas/OpenAIResponseInputToolFileSearch", + "function": "#/components/schemas/OpenAIResponseInputToolFunction", + "mcp": "#/components/schemas/OpenAIResponseInputToolMCP", + "web_search": "#/components/schemas/OpenAIResponseInputToolWebSearch", + "web_search_preview": "#/components/schemas/OpenAIResponseInputToolWebSearch", + "web_search_preview_2025_03_11": "#/components/schemas/OpenAIResponseInputToolWebSearch" + } + } + }, + "include": { + "type": "string", + "title": "Include" + }, + "max_infer_iters": { + "type": "integer", + "title": "Max Infer Iters", + "default": 10 + } + }, + "type": "object", + "required": [ + "input", + "model", + "prompt", + "instructions", + "previous_response_id", + "conversation", + "temperature", + "text", + "tools", + "include" + ], + "title": "_openai_v1_responses_Request" + }, + "_openai_v1_vector_stores_vector_store_id_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "expires_after": { + "type": "string", + "title": "Expires After" + }, + "metadata": { + "type": "string", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "name", + "expires_after", + "metadata" + ], + "title": "_openai_v1_vector_stores_vector_store_id_Request" + }, + "_openai_v1_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request": { + "properties": { + "batch_id": { + "type": "string", + "title": "Batch Id" + }, + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + } + }, + "type": "object", + "required": [ + "batch_id", + "vector_store_id" + ], + "title": "_openai_v1_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request" + }, + "_openai_v1_vector_stores_vector_store_id_files_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "attributes": { + "type": "string", + "title": "Attributes" + }, + "chunking_strategy": { + "anyOf": [ + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" + }, + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + ], + "title": "Chunking Strategy" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "file_id", + "attributes", + "chunking_strategy" + ], + "title": "_openai_v1_vector_stores_vector_store_id_files_Request" + }, + "_openai_v1_vector_stores_vector_store_id_files_file_id_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "attributes": { + "type": "string", + "title": "Attributes" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "file_id", + "attributes" + ], + "title": "_openai_v1_vector_stores_vector_store_id_files_file_id_Request" + }, + "_openai_v1_vector_stores_vector_store_id_search_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "query": { + "type": "string", + "title": "Query" + }, + "filters": { + "type": "string", + "title": "Filters" + }, + "max_num_results": { + "type": "integer", + "title": "Max Num Results", + "default": 10 + }, + "ranking_options": { + "$ref": "#/components/schemas/SearchRankingOptions" + }, + "rewrite_query": { + "type": "boolean", + "title": "Rewrite Query", + "default": false + }, + "search_mode": { + "type": "string", + "title": "Search Mode", + "default": "vector" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "query", + "filters", + "ranking_options" + ], + "title": "_openai_v1_vector_stores_vector_store_id_search_Request" + }, + "_prompts_Request": { + "properties": { + "prompt": { + "type": "string", + "title": "Prompt" + }, + "variables": { + "type": "string", + "title": "Variables" + } + }, + "type": "object", + "required": [ + "prompt", + "variables" + ], + "title": "_prompts_Request" + }, + "_prompts_prompt_id_Request": { + "properties": { + "prompt_id": { + "type": "string", + "title": "Prompt Id" + }, + "prompt": { + "type": "string", + "title": "Prompt" + }, + "version": { + "type": "integer", + "title": "Version" + }, + "variables": { + "type": "string", + "title": "Variables" + }, + "set_as_default": { + "type": "boolean", + "title": "Set As Default", + "default": true + } + }, + "type": "object", + "required": [ + "prompt_id", + "prompt", + "version", + "variables" + ], + "title": "_prompts_prompt_id_Request" + }, + "_prompts_prompt_id_set_default_version_Request": { + "properties": { + "prompt_id": { + "type": "string", + "title": "Prompt Id" + }, + "version": { + "type": "integer", + "title": "Version" + } + }, + "type": "object", + "required": [ + "prompt_id", + "version" + ], + "title": "_prompts_prompt_id_set_default_version_Request" + }, + "_responses_Request": { + "properties": { + "input": { + "type": "string", + "title": "Input" + }, + "model": { + "type": "string", + "title": "Model" + }, + "prompt": { + "$ref": "#/components/schemas/OpenAIResponsePrompt" + }, + "instructions": { + "type": "string", + "title": "Instructions" + }, + "previous_response_id": { + "type": "string", + "title": "Previous Response Id" + }, + "conversation": { + "type": "string", + "title": "Conversation" + }, + "store": { + "type": "boolean", + "title": "Store", + "default": true + }, + "stream": { + "type": "boolean", + "title": "Stream", + "default": false + }, + "temperature": { + "type": "number", + "title": "Temperature" + }, + "text": { + "$ref": "#/components/schemas/OpenAIResponseText" + }, + "tools": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolMCP" + } + ], + "title": "Tools", + "discriminator": { + "propertyName": "type", + "mapping": { + "file_search": "#/components/schemas/OpenAIResponseInputToolFileSearch", + "function": "#/components/schemas/OpenAIResponseInputToolFunction", + "mcp": "#/components/schemas/OpenAIResponseInputToolMCP", + "web_search": "#/components/schemas/OpenAIResponseInputToolWebSearch", + "web_search_preview": "#/components/schemas/OpenAIResponseInputToolWebSearch", + "web_search_preview_2025_03_11": "#/components/schemas/OpenAIResponseInputToolWebSearch" + } + } + }, + "include": { + "type": "string", + "title": "Include" + }, + "max_infer_iters": { + "type": "integer", + "title": "Max Infer Iters", + "default": 10 + } + }, + "type": "object", + "required": [ + "input", + "model", + "prompt", + "instructions", + "previous_response_id", + "conversation", + "temperature", + "text", + "tools", + "include" + ], + "title": "_responses_Request" + }, + "_scoring_score_Request": { + "properties": { + "input_rows": { + "type": "string", + "title": "Input Rows" + }, + "scoring_functions": { + "type": "string", + "title": "Scoring Functions" + } + }, + "type": "object", + "required": [ + "input_rows", + "scoring_functions" + ], + "title": "_scoring_score_Request" + }, + "_scoring_score_batch_Request": { + "properties": { + "dataset_id": { + "type": "string", + "title": "Dataset Id" + }, + "scoring_functions": { + "type": "string", + "title": "Scoring Functions" + }, + "save_results_dataset": { + "type": "boolean", + "title": "Save Results Dataset", + "default": false + } + }, + "type": "object", + "required": [ + "dataset_id", + "scoring_functions" + ], + "title": "_scoring_score_batch_Request" + }, + "_shields_Request": { + "properties": { + "shield_id": { + "type": "string", + "title": "Shield Id" + }, + "provider_shield_id": { + "type": "string", + "title": "Provider Shield Id" + }, + "provider_id": { + "type": "string", + "title": "Provider Id" + }, + "params": { + "type": "string", + "title": "Params" + } + }, + "type": "object", + "required": [ + "shield_id", + "provider_shield_id", + "provider_id", + "params" + ], + "title": "_shields_Request" + }, + "_tool_runtime_invoke_Request": { + "properties": { + "tool_name": { + "type": "string", + "title": "Tool Name" + }, + "kwargs": { + "type": "string", + "title": "Kwargs" + } + }, + "type": "object", + "required": [ + "tool_name", + "kwargs" + ], + "title": "_tool_runtime_invoke_Request" + }, + "_tool_runtime_rag_tool_query_Request": { + "properties": { + "content": { + "type": "string", + "title": "Content" + }, + "vector_store_ids": { + "type": "string", + "title": "Vector Store Ids" + }, + "query_config": { + "$ref": "#/components/schemas/RAGQueryConfig" + } + }, + "type": "object", + "required": [ + "content", + "vector_store_ids", + "query_config" + ], + "title": "_tool_runtime_rag_tool_query_Request" + }, + "_vector_io_query_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "query": { + "type": "string", + "title": "Query" + }, + "params": { + "type": "string", + "title": "Params" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "query", + "params" + ], + "title": "_vector_io_query_Request" + }, + "_vector_stores_vector_store_id_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "expires_after": { + "type": "string", + "title": "Expires After" + }, + "metadata": { + "type": "string", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "name", + "expires_after", + "metadata" + ], + "title": "_vector_stores_vector_store_id_Request" + }, + "_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request": { + "properties": { + "batch_id": { + "type": "string", + "title": "Batch Id" + }, + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + } + }, + "type": "object", + "required": [ + "batch_id", + "vector_store_id" + ], + "title": "_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request" + }, + "_vector_stores_vector_store_id_files_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "attributes": { + "type": "string", + "title": "Attributes" + }, + "chunking_strategy": { + "anyOf": [ + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" + }, + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + ], + "title": "Chunking Strategy" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "file_id", + "attributes", + "chunking_strategy" + ], + "title": "_vector_stores_vector_store_id_files_Request" + }, + "_vector_stores_vector_store_id_files_file_id_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "attributes": { + "type": "string", + "title": "Attributes" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "file_id", + "attributes" + ], + "title": "_vector_stores_vector_store_id_files_file_id_Request" + }, + "_vector_stores_vector_store_id_search_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "query": { + "type": "string", + "title": "Query" + }, + "filters": { + "type": "string", + "title": "Filters" + }, + "max_num_results": { + "type": "integer", + "title": "Max Num Results", + "default": 10 + }, + "ranking_options": { + "$ref": "#/components/schemas/SearchRankingOptions" + }, + "rewrite_query": { + "type": "boolean", + "title": "Rewrite Query", + "default": false + }, + "search_mode": { + "type": "string", + "title": "Search Mode", + "default": "vector" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "query", + "filters", + "ranking_options" + ], + "title": "_vector_stores_vector_store_id_search_Request" + }, + "Error": { + "description": "Error response from the API. Roughly follows RFC 7807.", + "properties": { + "status": { + "title": "Status", + "type": "integer" + }, + "title": { + "title": "Title", + "type": "string" + }, + "detail": { + "title": "Detail", + "type": "string" + }, + "instance": { + "title": "Instance", + "type": "string", + "nullable": true + } + }, + "required": [ + "status", + "title", + "detail" + ], + "title": "Error", + "type": "object" + }, + "Agent": { + "description": "An agent instance with configuration and metadata.", + "properties": { + "agent_id": { + "title": "Agent Id", + "type": "string" + }, + "agent_config": { + "$ref": "#/components/schemas/AgentConfig" + }, + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + } + }, + "required": [ + "agent_id", + "agent_config", + "created_at" + ], + "title": "Agent", + "type": "object" + }, + "AgentStepResponse": { + "description": "Response containing details of a specific agent step.", + "properties": { + "step": { + "discriminator": { + "mapping": { + "inference": "#/$defs/InferenceStep", + "memory_retrieval": "#/$defs/MemoryRetrievalStep", + "shield_call": "#/$defs/ShieldCallStep", + "tool_execution": "#/$defs/ToolExecutionStep" + }, + "propertyName": "step_type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/InferenceStep" + }, + { + "$ref": "#/components/schemas/ToolExecutionStep" + }, + { + "$ref": "#/components/schemas/ShieldCallStep" + }, + { + "$ref": "#/components/schemas/MemoryRetrievalStep" + } + ], + "title": "Step" + } + }, + "required": [ + "step" + ], + "title": "AgentStepResponse", + "type": "object" + }, + "AgentTurnCreateRequest": { + "description": "Request to create a new turn for an agent.", + "properties": { + "sampling_params": { + "$ref": "#/components/schemas/SamplingParams" + }, + "input_shields": { + "title": "Input Shields", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_shields": { + "title": "Output Shields", + "items": { + "type": "string" + }, + "type": "array" + }, + "toolgroups": { + "title": "Toolgroups", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/AgentToolGroupWithArgs" + } + ] + }, + "type": "array" + }, + "client_tools": { + "title": "Client Tools", + "items": { + "$ref": "#/components/schemas/ToolDef" + }, + "type": "array" + }, + "tool_choice": { + "deprecated": true, + "$ref": "#/components/schemas/ToolChoice", + "nullable": true + }, + "tool_prompt_format": { + "deprecated": true, + "$ref": "#/components/schemas/ToolPromptFormat", + "nullable": true + }, + "tool_config": { + "$ref": "#/components/schemas/ToolConfig", + "nullable": true + }, + "max_infer_iters": { + "default": 10, + "title": "Max Infer Iters", + "type": "integer" + }, + "instructions": { + "title": "Instructions", + "type": "string", + "nullable": true + }, + "agent_id": { + "title": "Agent Id", + "type": "string" + }, + "session_id": { + "title": "Session Id", + "type": "string" + }, + "messages": { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/UserMessage" + }, + { + "$ref": "#/components/schemas/ToolResponseMessage" + } + ] + }, + "title": "Messages", + "type": "array" + }, + "documents": { + "title": "Documents", + "items": { + "$ref": "#/components/schemas/Document" + }, + "type": "array", + "nullable": true + }, + "stream": { + "default": false, + "title": "Stream", + "type": "boolean" + } + }, + "required": [ + "agent_id", + "session_id", + "messages" + ], + "title": "AgentTurnCreateRequest", + "type": "object" + }, + "AgentTurnResponseEvent": { + "description": "An event in an agent turn response stream.", + "properties": { + "payload": { + "discriminator": { + "mapping": { + "step_complete": "#/$defs/AgentTurnResponseStepCompletePayload", + "step_progress": "#/$defs/AgentTurnResponseStepProgressPayload", + "step_start": "#/$defs/AgentTurnResponseStepStartPayload", + "turn_awaiting_input": "#/$defs/AgentTurnResponseTurnAwaitingInputPayload", + "turn_complete": "#/$defs/AgentTurnResponseTurnCompletePayload", + "turn_start": "#/$defs/AgentTurnResponseTurnStartPayload" + }, + "propertyName": "event_type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/AgentTurnResponseStepStartPayload" + }, + { + "$ref": "#/components/schemas/AgentTurnResponseStepProgressPayload" + }, + { + "$ref": "#/components/schemas/AgentTurnResponseStepCompletePayload" + }, + { + "$ref": "#/components/schemas/AgentTurnResponseTurnStartPayload" + }, + { + "$ref": "#/components/schemas/AgentTurnResponseTurnCompletePayload" + }, + { + "$ref": "#/components/schemas/AgentTurnResponseTurnAwaitingInputPayload" + } + ], + "title": "Payload" + } + }, + "required": [ + "payload" + ], + "title": "AgentTurnResponseEvent", + "type": "object" + }, + "AgentTurnResponseStepCompletePayload": { + "description": "Payload for step completion events in agent turn responses.", + "properties": { + "event_type": { + "const": "step_complete", + "default": "step_complete", + "title": "Event Type", + "type": "string" + }, + "step_type": { + "$ref": "#/components/schemas/StepType" + }, + "step_id": { + "title": "Step Id", + "type": "string" + }, + "step_details": { + "discriminator": { + "mapping": { + "inference": "#/$defs/InferenceStep", + "memory_retrieval": "#/$defs/MemoryRetrievalStep", + "shield_call": "#/$defs/ShieldCallStep", + "tool_execution": "#/$defs/ToolExecutionStep" + }, + "propertyName": "step_type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/InferenceStep" + }, + { + "$ref": "#/components/schemas/ToolExecutionStep" + }, + { + "$ref": "#/components/schemas/ShieldCallStep" + }, + { + "$ref": "#/components/schemas/MemoryRetrievalStep" + } + ], + "title": "Step Details" + } + }, + "required": [ + "step_type", + "step_id", + "step_details" + ], + "title": "AgentTurnResponseStepCompletePayload", + "type": "object" + }, + "AgentTurnResponseStepProgressPayload": { + "description": "Payload for step progress events in agent turn responses.", + "properties": { + "event_type": { + "const": "step_progress", + "default": "step_progress", + "title": "Event Type", + "type": "string" + }, + "step_type": { + "$ref": "#/components/schemas/StepType" + }, + "step_id": { + "title": "Step Id", + "type": "string" + }, + "delta": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageDelta", + "text": "#/$defs/TextDelta", + "tool_call": "#/$defs/ToolCallDelta" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/TextDelta" + }, + { + "$ref": "#/components/schemas/ImageDelta" + }, + { + "$ref": "#/components/schemas/ToolCallDelta" + } + ], + "title": "Delta" + } + }, + "required": [ + "step_type", + "step_id", + "delta" + ], + "title": "AgentTurnResponseStepProgressPayload", + "type": "object" + }, + "AgentTurnResponseStepStartPayload": { + "description": "Payload for step start events in agent turn responses.", + "properties": { + "event_type": { + "const": "step_start", + "default": "step_start", + "title": "Event Type", + "type": "string" + }, + "step_type": { + "$ref": "#/components/schemas/StepType" + }, + "step_id": { + "title": "Step Id", + "type": "string" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "required": [ + "step_type", + "step_id" + ], + "title": "AgentTurnResponseStepStartPayload", + "type": "object" + }, + "AgentTurnResponseStreamChunk": { + "description": "Streamed agent turn completion response.", + "properties": { + "event": { + "$ref": "#/components/schemas/AgentTurnResponseEvent" + } + }, + "required": [ + "event" + ], + "title": "AgentTurnResponseStreamChunk", + "type": "object" + }, + "AgentTurnResponseTurnAwaitingInputPayload": { + "description": "Payload for turn awaiting input events in agent turn responses.", + "properties": { + "event_type": { + "const": "turn_awaiting_input", + "default": "turn_awaiting_input", + "title": "Event Type", + "type": "string" + }, + "turn": { + "$ref": "#/components/schemas/Turn" + } + }, + "required": [ + "turn" + ], + "title": "AgentTurnResponseTurnAwaitingInputPayload", + "type": "object" + }, + "AgentTurnResponseTurnCompletePayload": { + "description": "Payload for turn completion events in agent turn responses.", + "properties": { + "event_type": { + "const": "turn_complete", + "default": "turn_complete", + "title": "Event Type", + "type": "string" + }, + "turn": { + "$ref": "#/components/schemas/Turn" + } + }, + "required": [ + "turn" + ], + "title": "AgentTurnResponseTurnCompletePayload", + "type": "object" + }, + "AgentTurnResponseTurnStartPayload": { + "description": "Payload for turn start events in agent turn responses.", + "properties": { + "event_type": { + "const": "turn_start", + "default": "turn_start", + "title": "Event Type", + "type": "string" + }, + "turn_id": { + "title": "Turn Id", + "type": "string" + } + }, + "required": [ + "turn_id" + ], + "title": "AgentTurnResponseTurnStartPayload", + "type": "object" + }, + "AgentTurnResumeRequest": { + "description": "Request to resume an agent turn with tool responses.", + "properties": { + "agent_id": { + "title": "Agent Id", + "type": "string" + }, + "session_id": { + "title": "Session Id", + "type": "string" + }, + "turn_id": { + "title": "Turn Id", + "type": "string" + }, + "tool_responses": { + "items": { + "$ref": "#/components/schemas/ToolResponse" + }, + "title": "Tool Responses", + "type": "array" + }, + "stream": { + "default": false, + "title": "Stream", + "type": "boolean" + } + }, + "required": [ + "agent_id", + "session_id", + "turn_id", + "tool_responses" + ], + "title": "AgentTurnResumeRequest", + "type": "object" + }, + "CompletionMessage": { + "description": "A message containing the model's (assistant) response in a chat conversation.", + "properties": { + "role": { + "const": "assistant", + "default": "assistant", + "title": "Role", + "type": "string" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + { + "items": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + "type": "array" + } + ], + "title": "Content" + }, + "stop_reason": { + "$ref": "#/components/schemas/StopReason" + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/ToolCall" + }, + "type": "array" + } + }, + "required": [ + "content", + "stop_reason" + ], + "title": "CompletionMessage", + "type": "object" + }, + "InferenceStep": { + "description": "An inference step in an agent turn.", + "properties": { + "turn_id": { + "title": "Turn Id", + "type": "string" + }, + "step_id": { + "title": "Step Id", + "type": "string" + }, + "started_at": { + "title": "Started At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "completed_at": { + "title": "Completed At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "step_type": { + "const": "inference", + "default": "inference", + "title": "Step Type", + "type": "string" + }, + "model_response": { + "$ref": "#/components/schemas/CompletionMessage" + } + }, + "required": [ + "turn_id", + "step_id", + "model_response" + ], + "title": "InferenceStep", + "type": "object" + }, + "ListOpenAIResponseInputItem": { + "description": "List container for OpenAI response input items.", + "properties": { + "data": { + "items": { + "anyOf": [ + { + "discriminator": { + "mapping": { + "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", + "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", + "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", + "message": "#/$defs/OpenAIResponseMessage", + "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + } + ] + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + } + ] + }, + "title": "Data", + "type": "array" + }, + "object": { + "const": "list", + "default": "list", + "title": "Object", + "type": "string" + } + }, + "required": [ + "data" + ], + "title": "ListOpenAIResponseInputItem", + "type": "object" + }, + "ListOpenAIResponseObject": { + "description": "Paginated list of OpenAI response objects with navigation metadata.", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/OpenAIResponseObjectWithInput" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "first_id": { + "title": "First Id", + "type": "string" + }, + "last_id": { + "title": "Last Id", + "type": "string" + }, + "object": { + "const": "list", + "default": "list", + "title": "Object", + "type": "string" + } + }, + "required": [ + "data", + "has_more", + "first_id", + "last_id" + ], + "title": "ListOpenAIResponseObject", + "type": "object" + }, + "MemoryRetrievalStep": { + "description": "A memory retrieval step in an agent turn.", + "properties": { + "turn_id": { + "title": "Turn Id", + "type": "string" + }, + "step_id": { + "title": "Step Id", + "type": "string" + }, + "started_at": { + "title": "Started At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "completed_at": { + "title": "Completed At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "step_type": { + "const": "memory_retrieval", + "default": "memory_retrieval", + "title": "Step Type", + "type": "string" + }, + "vector_store_ids": { + "title": "Vector Store Ids", + "type": "string" + }, + "inserted_context": { + "anyOf": [ + { + "type": "string" + }, + { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + { + "items": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + "type": "array" + } + ], + "title": "Inserted Context" + } + }, + "required": [ + "turn_id", + "step_id", + "vector_store_ids", + "inserted_context" + ], + "title": "MemoryRetrievalStep", + "type": "object" + }, + "OpenAIDeleteResponseObject": { + "description": "Response object confirming deletion of an OpenAI response.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "object": { + "const": "response", + "default": "response", + "title": "Object", + "type": "string" + }, + "deleted": { + "default": true, + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id" + ], + "title": "OpenAIDeleteResponseObject", + "type": "object" + }, + "PaginatedResponse": { + "description": "A generic paginated response that follows a simple format.", + "properties": { + "data": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "url": { + "title": "Url", + "type": "string", + "nullable": true + } + }, + "required": [ + "data", + "has_more" + ], + "title": "PaginatedResponse", + "type": "object" + }, + "ResponseGuardrailSpec": { + "description": "Specification for a guardrail to apply during response generation.", + "properties": { + "type": { + "title": "Type", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "ResponseGuardrailSpec", + "type": "object" + }, + "Session": { + "description": "A single session of an interaction with an Agentic System.", + "properties": { + "session_id": { + "title": "Session Id", + "type": "string" + }, + "session_name": { + "title": "Session Name", + "type": "string" + }, + "turns": { + "items": { + "$ref": "#/components/schemas/Turn" + }, + "title": "Turns", + "type": "array" + }, + "started_at": { + "format": "date-time", + "title": "Started At", + "type": "string" + } + }, + "required": [ + "session_id", + "session_name", + "turns", + "started_at" + ], + "title": "Session", + "type": "object" + }, + "ShieldCallStep": { + "description": "A shield call step in an agent turn.", + "properties": { + "turn_id": { + "title": "Turn Id", + "type": "string" + }, + "step_id": { + "title": "Step Id", + "type": "string" + }, + "started_at": { + "title": "Started At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "completed_at": { + "title": "Completed At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "step_type": { + "const": "shield_call", + "default": "shield_call", + "title": "Step Type", + "type": "string" + }, + "violation": { + "$ref": "#/components/schemas/SafetyViolation" + } + }, + "required": [ + "turn_id", + "step_id", + "violation" + ], + "title": "ShieldCallStep", + "type": "object" + }, + "ToolExecutionStep": { + "description": "A tool execution step in an agent turn.", + "properties": { + "turn_id": { + "title": "Turn Id", + "type": "string" + }, + "step_id": { + "title": "Step Id", + "type": "string" + }, + "started_at": { + "title": "Started At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "completed_at": { + "title": "Completed At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "step_type": { + "const": "tool_execution", + "default": "tool_execution", + "title": "Step Type", + "type": "string" + }, + "tool_calls": { + "items": { + "$ref": "#/components/schemas/ToolCall" + }, + "title": "Tool Calls", + "type": "array" + }, + "tool_responses": { + "items": { + "$ref": "#/components/schemas/ToolResponse" + }, + "title": "Tool Responses", + "type": "array" + } + }, + "required": [ + "turn_id", + "step_id", + "tool_calls", + "tool_responses" + ], + "title": "ToolExecutionStep", + "type": "object" + }, + "ToolResponse": { + "description": "Response from a tool invocation.", + "properties": { + "call_id": { + "title": "Call Id", + "type": "string" + }, + "tool_name": { + "anyOf": [ + { + "$ref": "#/components/schemas/BuiltinTool" + }, + { + "type": "string" + } + ], + "title": "Tool Name" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + { + "items": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + "type": "array" + } + ], + "title": "Content" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object", + "nullable": true + } + }, + "required": [ + "call_id", + "tool_name", + "content" + ], + "title": "ToolResponse", + "type": "object" + }, + "ToolResponseMessage": { + "description": "A message representing the result of a tool invocation.", + "properties": { + "role": { + "const": "tool", + "default": "tool", + "title": "Role", + "type": "string" + }, + "call_id": { + "title": "Call Id", + "type": "string" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + { + "items": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + "type": "array" + } + ], + "title": "Content" + } + }, + "required": [ + "call_id", + "content" + ], + "title": "ToolResponseMessage", + "type": "object" + }, + "UserMessage": { + "description": "A message from the user in a chat conversation.", + "properties": { + "role": { + "const": "user", + "default": "user", + "title": "Role", + "type": "string" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + { + "items": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + "type": "array" + } + ], + "title": "Content" + }, + "context": { + "anyOf": [ + { + "type": "string" + }, + { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + { + "items": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + "type": "array" + } + ], + "title": "Context", + "nullable": true + } + }, + "required": [ + "content" + ], + "title": "UserMessage", + "type": "object" + }, + "ListBatchesResponse": { + "description": "Response containing a list of batch objects.", + "properties": { + "object": { + "const": "list", + "default": "list", + "title": "Object", + "type": "string" + }, + "data": { + "description": "List of batch objects", + "items": { + "$ref": "#/components/schemas/Batch" + }, + "title": "Data", + "type": "array" + }, + "first_id": { + "description": "ID of the first batch in the list", + "title": "First Id", + "type": "string", + "nullable": true + }, + "last_id": { + "description": "ID of the last batch in the list", + "title": "Last Id", + "type": "string", + "nullable": true + }, + "has_more": { + "default": false, + "description": "Whether there are more batches available", + "title": "Has More", + "type": "boolean" + } + }, + "required": [ + "data" + ], + "title": "ListBatchesResponse", + "type": "object" + }, + "ConversationCreateRequest": { + "description": "Request body for creating a conversation.", + "properties": { + "items": { + "default": [], + "description": "Initial items to include in the conversation context. You may add up to 20 items at a time.", + "title": "Items", + "items": { + "discriminator": { + "mapping": { + "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", + "function_call_output": "#/$defs/OpenAIResponseInputFunctionToolCallOutput", + "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", + "mcp_approval_response": "#/$defs/OpenAIResponseMCPApprovalResponse", + "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", + "message": "#/$defs/OpenAIResponseMessage", + "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + } + ] + }, + "maxItems": 20, + "type": "array" + }, + "metadata": { + "default": {}, + "description": "Set of 16 key-value pairs that can be attached to an object. Useful for storing additional information", + "title": "Metadata", + "additionalProperties": { + "type": "string" + }, + "maxProperties": 16, + "type": "object" + } + }, + "title": "ConversationCreateRequest", + "type": "object" + }, + "ConversationDeletedResource": { + "description": "Response for deleted conversation.", + "properties": { + "id": { + "description": "The deleted conversation identifier", + "title": "Id", + "type": "string" + }, + "object": { + "default": "conversation.deleted", + "description": "Object type", + "title": "Object", + "type": "string" + }, + "deleted": { + "default": true, + "description": "Whether the object was deleted", + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id" + ], + "title": "ConversationDeletedResource", + "type": "object" + }, + "ConversationItemCreateRequest": { + "description": "Request body for creating conversation items.", + "properties": { + "items": { + "description": "Items to include in the conversation context. You may add up to 20 items at a time.", + "items": { + "discriminator": { + "mapping": { + "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", + "function_call_output": "#/$defs/OpenAIResponseInputFunctionToolCallOutput", + "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", + "mcp_approval_response": "#/$defs/OpenAIResponseMCPApprovalResponse", + "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", + "message": "#/$defs/OpenAIResponseMessage", + "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + } + ] + }, + "maxItems": 20, + "title": "Items", + "type": "array" + } + }, + "required": [ + "items" + ], + "title": "ConversationItemCreateRequest", + "type": "object" + }, + "ConversationItemDeletedResource": { + "description": "Response for deleted conversation item.", + "properties": { + "id": { + "description": "The deleted item identifier", + "title": "Id", + "type": "string" + }, + "object": { + "default": "conversation.item.deleted", + "description": "Object type", + "title": "Object", + "type": "string" + }, + "deleted": { + "default": true, + "description": "Whether the object was deleted", + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id" + ], + "title": "ConversationItemDeletedResource", + "type": "object" + }, + "ConversationUpdateRequest": { + "description": "Request body for updating a conversation.", + "properties": { + "metadata": { + "additionalProperties": { + "type": "string" + }, + "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.", + "title": "Metadata", + "type": "object" + } + }, + "required": [ + "metadata" + ], + "title": "ConversationUpdateRequest", + "type": "object" + }, + "ExpiresAfter": { + "description": "Control expiration of uploaded files.\n\nParams:\n - anchor, must be \"created_at\"\n - seconds, must be int between 3600 and 2592000 (1 hour to 30 days)", + "properties": { + "anchor": { + "const": "created_at", + "title": "Anchor", + "type": "string" + }, + "seconds": { + "maximum": 2592000, + "minimum": 3600, + "title": "Seconds", + "type": "integer" + } + }, + "required": [ + "anchor", + "seconds" + ], + "title": "ExpiresAfter", + "type": "object" + }, + "ListOpenAIFileResponse": { + "description": "Response for listing files in OpenAI Files API.", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/OpenAIFileObject" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "first_id": { + "title": "First Id", + "type": "string" + }, + "last_id": { + "title": "Last Id", + "type": "string" + }, + "object": { + "const": "list", + "default": "list", + "title": "Object", + "type": "string" + } + }, + "required": [ + "data", + "has_more", + "first_id", + "last_id" + ], + "title": "ListOpenAIFileResponse", + "type": "object" + }, + "OpenAIFileDeleteResponse": { + "description": "Response for deleting a file in OpenAI Files API.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "object": { + "const": "file", + "default": "file", + "title": "Object", + "type": "string" + }, + "deleted": { + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id", + "deleted" + ], + "title": "OpenAIFileDeleteResponse", + "type": "object" + }, + "Bf16QuantizationConfig": { + "description": "Configuration for BFloat16 precision (typically no quantization).", + "properties": { + "type": { + "const": "bf16", + "default": "bf16", + "title": "Type", + "type": "string" + } + }, + "title": "Bf16QuantizationConfig", + "type": "object" + }, + "ChatCompletionRequest": { + "properties": { + "model": { + "title": "Model", + "type": "string" + }, + "messages": { + "items": { + "discriminator": { + "mapping": { + "assistant": "#/$defs/CompletionMessage", + "system": "#/$defs/SystemMessage", + "tool": "#/$defs/ToolResponseMessage", + "user": "#/$defs/UserMessage" + }, + "propertyName": "role" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/UserMessage" + }, + { + "$ref": "#/components/schemas/SystemMessage" + }, + { + "$ref": "#/components/schemas/ToolResponseMessage" + }, + { + "$ref": "#/components/schemas/CompletionMessage" + } + ] + }, + "title": "Messages", + "type": "array" + }, + "sampling_params": { + "$ref": "#/components/schemas/SamplingParams" + }, + "tools": { + "title": "Tools", + "items": { + "$ref": "#/components/schemas/ToolDefinition" + }, + "type": "array" + }, + "tool_config": { + "$ref": "#/components/schemas/ToolConfig" + }, + "response_format": { + "title": "Response Format", + "discriminator": { + "mapping": { + "grammar": "#/$defs/GrammarResponseFormat", + "json_schema": "#/$defs/JsonSchemaResponseFormat" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/JsonSchemaResponseFormat" + }, + { + "$ref": "#/components/schemas/GrammarResponseFormat" + } + ], + "nullable": true + }, + "stream": { + "default": false, + "title": "Stream", + "type": "boolean" + }, + "logprobs": { + "$ref": "#/components/schemas/LogProbConfig", + "nullable": true + } + }, + "required": [ + "model", + "messages" + ], + "title": "ChatCompletionRequest", + "type": "object" + }, + "ChatCompletionResponse": { + "description": "Response from a chat completion request.", + "properties": { + "metrics": { + "title": "Metrics", + "items": { + "$ref": "#/components/schemas/MetricInResponse" + }, + "type": "array", + "nullable": true + }, + "completion_message": { + "$ref": "#/components/schemas/CompletionMessage" + }, + "logprobs": { + "title": "Logprobs", + "items": { + "$ref": "#/components/schemas/TokenLogProbs" + }, + "type": "array", + "nullable": true + } + }, + "required": [ + "completion_message" + ], + "title": "ChatCompletionResponse", + "type": "object" + }, + "ChatCompletionResponseEvent": { + "description": "An event during chat completion generation.", + "properties": { + "event_type": { + "$ref": "#/components/schemas/ChatCompletionResponseEventType" + }, + "delta": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageDelta", + "text": "#/$defs/TextDelta", + "tool_call": "#/$defs/ToolCallDelta" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/TextDelta" + }, + { + "$ref": "#/components/schemas/ImageDelta" + }, + { + "$ref": "#/components/schemas/ToolCallDelta" + } + ], + "title": "Delta" + }, + "logprobs": { + "title": "Logprobs", + "items": { + "$ref": "#/components/schemas/TokenLogProbs" + }, + "type": "array", + "nullable": true + }, + "stop_reason": { + "$ref": "#/components/schemas/StopReason", + "nullable": true + } + }, + "required": [ + "event_type", + "delta" + ], + "title": "ChatCompletionResponseEvent", + "type": "object" + }, + "ChatCompletionResponseStreamChunk": { + "description": "A chunk of a streamed chat completion response.", + "properties": { + "metrics": { + "title": "Metrics", + "items": { + "$ref": "#/components/schemas/MetricInResponse" + }, + "type": "array", + "nullable": true + }, + "event": { + "$ref": "#/components/schemas/ChatCompletionResponseEvent" + } + }, + "required": [ + "event" + ], + "title": "ChatCompletionResponseStreamChunk", + "type": "object" + }, + "CompletionResponse": { + "description": "Response from a completion request.", + "properties": { + "metrics": { + "title": "Metrics", + "items": { + "$ref": "#/components/schemas/MetricInResponse" + }, + "type": "array", + "nullable": true + }, + "content": { + "title": "Content", + "type": "string" + }, + "stop_reason": { + "$ref": "#/components/schemas/StopReason" + }, + "logprobs": { + "title": "Logprobs", + "items": { + "$ref": "#/components/schemas/TokenLogProbs" + }, + "type": "array", + "nullable": true + } + }, + "required": [ + "content", + "stop_reason" + ], + "title": "CompletionResponse", + "type": "object" + }, + "CompletionResponseStreamChunk": { + "description": "A chunk of a streamed completion response.", + "properties": { + "metrics": { + "title": "Metrics", + "items": { + "$ref": "#/components/schemas/MetricInResponse" + }, + "type": "array", + "nullable": true + }, + "delta": { + "title": "Delta", + "type": "string" + }, + "stop_reason": { + "$ref": "#/components/schemas/StopReason", + "nullable": true + }, + "logprobs": { + "title": "Logprobs", + "items": { + "$ref": "#/components/schemas/TokenLogProbs" + }, + "type": "array", + "nullable": true + } + }, + "required": [ + "delta" + ], + "title": "CompletionResponseStreamChunk", + "type": "object" + }, + "EmbeddingsResponse": { + "description": "Response containing generated embeddings.", + "properties": { + "embeddings": { + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "title": "Embeddings", + "type": "array" + } + }, + "required": [ + "embeddings" + ], + "title": "EmbeddingsResponse", + "type": "object" + }, + "Fp8QuantizationConfig": { + "description": "Configuration for 8-bit floating point quantization.", + "properties": { + "type": { + "const": "fp8_mixed", + "default": "fp8_mixed", + "title": "Type", + "type": "string" + } + }, + "title": "Fp8QuantizationConfig", + "type": "object" + }, + "Int4QuantizationConfig": { + "description": "Configuration for 4-bit integer quantization.", + "properties": { + "type": { + "const": "int4_mixed", + "default": "int4_mixed", + "title": "Type", + "type": "string" + }, + "scheme": { + "default": "int4_weight_int8_dynamic_activation", + "title": "Scheme", + "type": "string" + } + }, + "title": "Int4QuantizationConfig", + "type": "object" + }, + "ListOpenAIChatCompletionResponse": { + "description": "Response from listing OpenAI-compatible chat completions.", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/OpenAICompletionWithInputMessages" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "first_id": { + "title": "First Id", + "type": "string" + }, + "last_id": { + "title": "Last Id", + "type": "string" + }, + "object": { + "const": "list", + "default": "list", + "title": "Object", + "type": "string" + } + }, + "required": [ + "data", + "has_more", + "first_id", + "last_id" + ], + "title": "ListOpenAIChatCompletionResponse", + "type": "object" + }, + "OpenAIAssistantMessageParam": { + "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.", + "properties": { + "role": { + "const": "assistant", + "default": "assistant", + "title": "Role", + "type": "string" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content", + "nullable": true + }, + "name": { + "title": "Name", + "type": "string", + "nullable": true + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" + }, + "type": "array", + "nullable": true + } + }, + "title": "OpenAIAssistantMessageParam", + "type": "object" + }, + "OpenAIChatCompletionChunk": { + "description": "Chunk from a streaming response to an OpenAI-compatible chat completion request.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "choices": { + "items": { + "$ref": "#/components/schemas/OpenAIChunkChoice" + }, + "title": "Choices", + "type": "array" + }, + "object": { + "const": "chat.completion.chunk", + "default": "chat.completion.chunk", + "title": "Object", + "type": "string" + }, + "created": { + "title": "Created", + "type": "integer" + }, + "model": { + "title": "Model", + "type": "string" + }, + "usage": { + "$ref": "#/components/schemas/OpenAIChatCompletionUsage", + "nullable": true + } + }, + "required": [ + "id", + "choices", + "created", + "model" + ], + "title": "OpenAIChatCompletionChunk", + "type": "object" + }, + "OpenAIChoice": { + "description": "A choice from an OpenAI-compatible chat completion response.", + "properties": { + "message": { + "discriminator": { + "mapping": { + "assistant": "#/$defs/OpenAIAssistantMessageParam", + "developer": "#/$defs/OpenAIDeveloperMessageParam", + "system": "#/$defs/OpenAISystemMessageParam", + "tool": "#/$defs/OpenAIToolMessageParam", + "user": "#/$defs/OpenAIUserMessageParam" + }, + "propertyName": "role" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIUserMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAISystemMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIAssistantMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIToolMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" + } + ], + "title": "Message" + }, + "finish_reason": { + "title": "Finish Reason", + "type": "string" + }, + "index": { + "title": "Index", + "type": "integer" + }, + "logprobs": { + "$ref": "#/components/schemas/OpenAIChoiceLogprobs", + "nullable": true + } + }, + "required": [ + "message", + "finish_reason", + "index" + ], + "title": "OpenAIChoice", + "type": "object" + }, + "OpenAIChoiceDelta": { + "description": "A delta from an OpenAI-compatible chat completion streaming response.", + "properties": { + "content": { + "title": "Content", + "type": "string", + "nullable": true + }, + "refusal": { + "title": "Refusal", + "type": "string", + "nullable": true + }, + "role": { + "title": "Role", + "type": "string", + "nullable": true + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" + }, + "type": "array", + "nullable": true + }, + "reasoning_content": { + "title": "Reasoning Content", + "type": "string", + "nullable": true + } + }, + "title": "OpenAIChoiceDelta", + "type": "object" + }, + "OpenAIChoiceLogprobs": { + "description": "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response.", + "properties": { + "content": { + "title": "Content", + "items": { + "$ref": "#/components/schemas/OpenAITokenLogProb" + }, + "type": "array", + "nullable": true + }, + "refusal": { + "title": "Refusal", + "items": { + "$ref": "#/components/schemas/OpenAITokenLogProb" + }, + "type": "array", + "nullable": true + } + }, + "title": "OpenAIChoiceLogprobs", + "type": "object" + }, + "OpenAIChunkChoice": { + "description": "A chunk choice from an OpenAI-compatible chat completion streaming response.", + "properties": { + "delta": { + "$ref": "#/components/schemas/OpenAIChoiceDelta" + }, + "finish_reason": { + "title": "Finish Reason", + "type": "string" + }, + "index": { + "title": "Index", + "type": "integer" + }, + "logprobs": { + "$ref": "#/components/schemas/OpenAIChoiceLogprobs", + "nullable": true + } + }, + "required": [ + "delta", + "finish_reason", + "index" + ], + "title": "OpenAIChunkChoice", + "type": "object" + }, + "OpenAICompletionChoice": { + "description": "A choice from an OpenAI-compatible completion response.", + "properties": { + "finish_reason": { + "title": "Finish Reason", + "type": "string" + }, + "text": { + "title": "Text", + "type": "string" + }, + "index": { + "title": "Index", + "type": "integer" + }, + "logprobs": { + "$ref": "#/components/schemas/OpenAIChoiceLogprobs", + "nullable": true + } + }, + "required": [ + "finish_reason", + "text", + "index" + ], + "title": "OpenAICompletionChoice", + "type": "object" + }, + "OpenAICompletionLogprobs": { + "description": "The log probabilities for the tokens in the message from an OpenAI-compatible completion response.", + "properties": { + "text_offset": { + "title": "Text Offset", + "items": { + "type": "integer" + }, + "type": "array", + "nullable": true + }, + "token_logprobs": { + "title": "Token Logprobs", + "items": { + "type": "number" + }, + "type": "array", + "nullable": true + }, + "tokens": { + "title": "Tokens", + "items": { + "type": "string" + }, + "type": "array", + "nullable": true + }, + "top_logprobs": { + "title": "Top Logprobs", + "items": { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "type": "array", + "nullable": true + } + }, + "title": "OpenAICompletionLogprobs", + "type": "object" + }, + "OpenAICompletionWithInputMessages": { + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "choices": { + "items": { + "$ref": "#/components/schemas/OpenAIChoice" + }, + "title": "Choices", + "type": "array" + }, + "object": { + "const": "chat.completion", + "default": "chat.completion", + "title": "Object", + "type": "string" + }, + "created": { + "title": "Created", + "type": "integer" + }, + "model": { + "title": "Model", + "type": "string" + }, + "usage": { + "$ref": "#/components/schemas/OpenAIChatCompletionUsage", + "nullable": true + }, + "input_messages": { + "items": { + "discriminator": { + "mapping": { + "assistant": "#/$defs/OpenAIAssistantMessageParam", + "developer": "#/$defs/OpenAIDeveloperMessageParam", + "system": "#/$defs/OpenAISystemMessageParam", + "tool": "#/$defs/OpenAIToolMessageParam", + "user": "#/$defs/OpenAIUserMessageParam" + }, + "propertyName": "role" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIUserMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAISystemMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIAssistantMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIToolMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" + } + ] + }, + "title": "Input Messages", + "type": "array" + } + }, + "required": [ + "id", + "choices", + "created", + "model", + "input_messages" + ], + "title": "OpenAICompletionWithInputMessages", + "type": "object" + }, + "OpenAIUserMessageParam": { + "description": "A message from the user in an OpenAI-compatible chat completion request.", + "properties": { + "role": { + "const": "user", + "default": "user", + "title": "Role", + "type": "string" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "discriminator": { + "mapping": { + "file": "#/$defs/OpenAIFile", + "image_url": "#/$defs/OpenAIChatCompletionContentPartImageParam", + "text": "#/$defs/OpenAIChatCompletionContentPartTextParam" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" + }, + { + "$ref": "#/components/schemas/OpenAIFile" + } + ] + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string", + "nullable": true + } + }, + "required": [ + "content" + ], + "title": "OpenAIUserMessageParam", + "type": "object" + }, + "TokenLogProbs": { + "description": "Log probabilities for generated tokens.", + "properties": { + "logprobs_by_token": { + "additionalProperties": { + "type": "number" + }, + "title": "Logprobs By Token", + "type": "object" + } + }, + "required": [ + "logprobs_by_token" + ], + "title": "TokenLogProbs", + "type": "object" + }, + "Checkpoint": { + "description": "Checkpoint created during training runs.", + "properties": { + "identifier": { + "title": "Identifier", + "type": "string" + }, + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "epoch": { + "title": "Epoch", + "type": "integer" + }, + "post_training_job_id": { + "title": "Post Training Job Id", + "type": "string" + }, + "path": { + "title": "Path", + "type": "string" + }, + "training_metrics": { + "$ref": "#/components/schemas/PostTrainingMetric", + "nullable": true + } + }, + "required": [ + "identifier", + "created_at", + "epoch", + "post_training_job_id", + "path" + ], + "title": "Checkpoint", + "type": "object" + }, + "LoraFinetuningConfig": { + "description": "Configuration for Low-Rank Adaptation (LoRA) fine-tuning.", + "properties": { + "type": { + "const": "LoRA", + "default": "LoRA", + "title": "Type", + "type": "string" + }, + "lora_attn_modules": { + "items": { + "type": "string" + }, + "title": "Lora Attn Modules", + "type": "array" + }, + "apply_lora_to_mlp": { + "title": "Apply Lora To Mlp", + "type": "boolean" + }, + "apply_lora_to_output": { + "title": "Apply Lora To Output", + "type": "boolean" + }, + "rank": { + "title": "Rank", + "type": "integer" + }, + "alpha": { + "title": "Alpha", + "type": "integer" + }, + "use_dora": { + "default": false, + "title": "Use Dora", + "type": "boolean" + }, + "quantize_base": { + "default": false, + "title": "Quantize Base", + "type": "boolean" + } + }, + "required": [ + "lora_attn_modules", + "apply_lora_to_mlp", + "apply_lora_to_output", + "rank", + "alpha" + ], + "title": "LoraFinetuningConfig", + "type": "object" + }, + "PostTrainingJobArtifactsResponse": { + "description": "Artifacts of a finetuning job.", + "properties": { + "job_uuid": { + "title": "Job Uuid", + "type": "string" + }, + "checkpoints": { + "items": { + "$ref": "#/components/schemas/Checkpoint" + }, + "title": "Checkpoints", + "type": "array" + } + }, + "required": [ + "job_uuid" + ], + "title": "PostTrainingJobArtifactsResponse", + "type": "object" + }, + "PostTrainingJobLogStream": { + "description": "Stream of logs from a finetuning job.", + "properties": { + "job_uuid": { + "title": "Job Uuid", + "type": "string" + }, + "log_lines": { + "items": { + "type": "string" + }, + "title": "Log Lines", + "type": "array" + } + }, + "required": [ + "job_uuid", + "log_lines" + ], + "title": "PostTrainingJobLogStream", + "type": "object" + }, + "PostTrainingJobStatusResponse": { + "description": "Status of a finetuning job.", + "properties": { + "job_uuid": { + "title": "Job Uuid", + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/JobStatus" + }, + "scheduled_at": { + "title": "Scheduled At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "started_at": { + "title": "Started At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "completed_at": { + "title": "Completed At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "resources_allocated": { + "title": "Resources Allocated", + "additionalProperties": true, + "type": "object", + "nullable": true + }, + "checkpoints": { + "items": { + "$ref": "#/components/schemas/Checkpoint" + }, + "title": "Checkpoints", + "type": "array" + } + }, + "required": [ + "job_uuid", + "status" + ], + "title": "PostTrainingJobStatusResponse", + "type": "object" + }, + "PostTrainingRLHFRequest": { + "description": "Request to finetune a model using reinforcement learning from human feedback.", + "properties": { + "job_uuid": { + "title": "Job Uuid", + "type": "string" + }, + "finetuned_model": { + "$ref": "#/components/schemas/URL" + }, + "dataset_id": { + "title": "Dataset Id", + "type": "string" + }, + "validation_dataset_id": { + "title": "Validation Dataset Id", + "type": "string" + }, + "algorithm": { + "$ref": "#/components/schemas/RLHFAlgorithm" + }, + "algorithm_config": { + "$ref": "#/components/schemas/DPOAlignmentConfig" + }, + "optimizer_config": { + "$ref": "#/components/schemas/OptimizerConfig" + }, + "training_config": { + "$ref": "#/components/schemas/TrainingConfig" + }, + "hyperparam_search_config": { + "additionalProperties": true, + "title": "Hyperparam Search Config", + "type": "object" + }, + "logger_config": { + "additionalProperties": true, + "title": "Logger Config", + "type": "object" + } + }, + "required": [ + "job_uuid", + "finetuned_model", + "dataset_id", + "validation_dataset_id", + "algorithm", + "algorithm_config", + "optimizer_config", + "training_config", + "hyperparam_search_config", + "logger_config" + ], + "title": "PostTrainingRLHFRequest", + "type": "object" + }, + "QATFinetuningConfig": { + "description": "Configuration for Quantization-Aware Training (QAT) fine-tuning.", + "properties": { + "type": { + "const": "QAT", + "default": "QAT", + "title": "Type", + "type": "string" + }, + "quantizer_name": { + "title": "Quantizer Name", + "type": "string" + }, + "group_size": { + "title": "Group Size", + "type": "integer" + } + }, + "required": [ + "quantizer_name", + "group_size" + ], + "title": "QATFinetuningConfig", + "type": "object" + }, + "ScoringFn": { + "description": "A scoring function resource for evaluating model outputs.", + "properties": { + "identifier": { + "description": "Unique identifier for this resource in llama stack", + "title": "Identifier", + "type": "string" + }, + "provider_resource_id": { + "description": "Unique identifier for this resource in the provider", + "title": "Provider Resource Id", + "type": "string", + "nullable": true + }, + "provider_id": { + "description": "ID of the provider that owns this resource", + "title": "Provider Id", + "type": "string" + }, + "type": { + "const": "scoring_function", + "default": "scoring_function", + "title": "Type", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string", + "nullable": true + }, + "metadata": { + "additionalProperties": true, + "description": "Any additional metadata for this definition", + "title": "Metadata", + "type": "object" + }, + "return_type": { + "description": "The return type of the deterministic function", + "discriminator": { + "mapping": { + "agent_turn_input": "#/$defs/AgentTurnInputType", + "array": "#/$defs/ArrayType", + "boolean": "#/$defs/BooleanType", + "chat_completion_input": "#/$defs/ChatCompletionInputType", + "completion_input": "#/$defs/CompletionInputType", + "json": "#/$defs/JsonType", + "number": "#/$defs/NumberType", + "object": "#/$defs/ObjectType", + "string": "#/$defs/StringType", + "union": "#/$defs/UnionType" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/StringType" + }, + { + "$ref": "#/components/schemas/NumberType" + }, + { + "$ref": "#/components/schemas/BooleanType" + }, + { + "$ref": "#/components/schemas/ArrayType" + }, + { + "$ref": "#/components/schemas/ObjectType" + }, + { + "$ref": "#/components/schemas/JsonType" + }, + { + "$ref": "#/components/schemas/UnionType" + }, + { + "$ref": "#/components/schemas/ChatCompletionInputType" + }, + { + "$ref": "#/components/schemas/CompletionInputType" + }, + { + "$ref": "#/components/schemas/AgentTurnInputType" + } + ], + "title": "Return Type" + }, + "params": { + "description": "The parameters for the scoring function for benchmark eval, these can be overridden for app eval", + "title": "Params", + "discriminator": { + "mapping": { + "basic": "#/$defs/BasicScoringFnParams", + "llm_as_judge": "#/$defs/LLMAsJudgeScoringFnParams", + "regex_parser": "#/$defs/RegexParserScoringFnParams" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" + }, + { + "$ref": "#/components/schemas/RegexParserScoringFnParams" + }, + { + "$ref": "#/components/schemas/BasicScoringFnParams" + } + ], + "nullable": true + } + }, + "required": [ + "identifier", + "provider_id", + "return_type" + ], + "title": "ScoringFn", + "type": "object" + }, + "SyntheticDataGenerationRequest": { + "description": "Request to generate synthetic data. A small batch of prompts and a filtering function", + "properties": { + "dialogs": { + "items": { + "discriminator": { + "mapping": { + "assistant": "#/$defs/CompletionMessage", + "system": "#/$defs/SystemMessage", + "tool": "#/$defs/ToolResponseMessage", + "user": "#/$defs/UserMessage" + }, + "propertyName": "role" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/UserMessage" + }, + { + "$ref": "#/components/schemas/SystemMessage" + }, + { + "$ref": "#/components/schemas/ToolResponseMessage" + }, + { + "$ref": "#/components/schemas/CompletionMessage" + } + ] + }, + "title": "Dialogs", + "type": "array" + }, + "filtering_function": { + "$ref": "#/components/schemas/FilteringFunction", + "default": "none" + }, + "model": { + "title": "Model", + "type": "string", + "nullable": true + } + }, + "required": [ + "dialogs" + ], + "title": "SyntheticDataGenerationRequest", + "type": "object" + }, + "SyntheticDataGenerationResponse": { + "description": "Response from the synthetic data generation. Batch of (prompt, response, score) tuples that pass the threshold.", + "properties": { + "synthetic_data": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "title": "Synthetic Data", + "type": "array" + }, + "statistics": { + "title": "Statistics", + "additionalProperties": true, + "type": "object", + "nullable": true + } + }, + "required": [ + "synthetic_data" + ], + "title": "SyntheticDataGenerationResponse", + "type": "object" + }, + "ListToolDefsResponse": { + "description": "Response containing a list of tool definitions.", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ToolDef" + }, + "title": "Data", + "type": "array" + } + }, + "required": [ + "data" + ], + "title": "ListToolDefsResponse", + "type": "object" + }, + "RAGDocument": { + "description": "A document to be used for document ingestion in the RAG Tool.", + "properties": { + "document_id": { + "title": "Document Id", + "type": "string" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + { + "items": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/URL" + } + ], + "title": "Content" + }, + "mime_type": { + "title": "Mime Type", + "type": "string", + "nullable": true + }, + "metadata": { + "additionalProperties": true, + "title": "Metadata", + "type": "object" + } + }, + "required": [ + "document_id", + "content" + ], + "title": "RAGDocument", + "type": "object" + }, + "ToolGroupInput": { + "description": "Input data for registering a tool group.", + "properties": { + "toolgroup_id": { + "title": "Toolgroup Id", + "type": "string" + }, + "provider_id": { + "title": "Provider Id", + "type": "string" + }, + "args": { + "title": "Args", + "additionalProperties": true, + "type": "object", + "nullable": true + }, + "mcp_endpoint": { + "$ref": "#/components/schemas/URL", + "nullable": true + } + }, + "required": [ + "toolgroup_id", + "provider_id" + ], + "title": "ToolGroupInput", + "type": "object" + }, + "Chunk": { + "description": "A chunk of content that can be inserted into a vector database.", + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + { + "items": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + "type": "array" + } + ], + "title": "Content" + }, + "chunk_id": { + "title": "Chunk Id", + "type": "string" + }, + "metadata": { + "additionalProperties": true, + "title": "Metadata", + "type": "object" + }, + "embedding": { + "title": "Embedding", + "items": { + "type": "number" + }, + "type": "array", + "nullable": true + }, + "chunk_metadata": { + "$ref": "#/components/schemas/ChunkMetadata", + "nullable": true + } + }, + "required": [ + "content", + "chunk_id" + ], + "title": "Chunk", + "type": "object" + }, + "VectorStoreCreateRequest": { + "description": "Request to create a vector store.", + "properties": { + "name": { + "title": "Name", + "type": "string", + "nullable": true + }, + "file_ids": { + "items": { + "type": "string" + }, + "title": "File Ids", + "type": "array" + }, + "expires_after": { + "title": "Expires After", + "additionalProperties": true, + "type": "object", + "nullable": true + }, + "chunking_strategy": { + "title": "Chunking Strategy", + "additionalProperties": true, + "type": "object", + "nullable": true + }, + "metadata": { + "additionalProperties": true, + "title": "Metadata", + "type": "object" + } + }, + "title": "VectorStoreCreateRequest", + "type": "object" + }, + "VectorStoreDeleteResponse": { + "description": "Response from deleting a vector store.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "object": { + "default": "vector_store.deleted", + "title": "Object", + "type": "string" + }, + "deleted": { + "default": true, + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id" + ], + "title": "VectorStoreDeleteResponse", + "type": "object" + }, + "VectorStoreFileContentsResponse": { + "description": "Response from retrieving the contents of a vector store file.", + "properties": { + "file_id": { + "title": "File Id", + "type": "string" + }, + "filename": { + "title": "Filename", + "type": "string" + }, + "attributes": { + "additionalProperties": true, + "title": "Attributes", + "type": "object" + }, + "content": { + "items": { + "$ref": "#/components/schemas/VectorStoreContent" + }, + "title": "Content", + "type": "array" + } + }, + "required": [ + "file_id", + "filename", + "attributes", + "content" + ], + "title": "VectorStoreFileContentsResponse", + "type": "object" + }, + "VectorStoreFileDeleteResponse": { + "description": "Response from deleting a vector store file.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "object": { + "default": "vector_store.file.deleted", + "title": "Object", + "type": "string" + }, + "deleted": { + "default": true, + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id" + ], + "title": "VectorStoreFileDeleteResponse", + "type": "object" + }, + "VectorStoreFilesListInBatchResponse": { + "description": "Response from listing files in a vector store file batch.", + "properties": { + "object": { + "default": "list", + "title": "Object", + "type": "string" + }, + "data": { + "items": { + "$ref": "#/components/schemas/VectorStoreFileObject" + }, + "title": "Data", + "type": "array" + }, + "first_id": { + "title": "First Id", + "type": "string", + "nullable": true + }, + "last_id": { + "title": "Last Id", + "type": "string", + "nullable": true + }, + "has_more": { + "default": false, + "title": "Has More", + "type": "boolean" + } + }, + "required": [ + "data" + ], + "title": "VectorStoreFilesListInBatchResponse", + "type": "object" + }, + "VectorStoreListFilesResponse": { + "description": "Response from listing files in a vector store.", + "properties": { + "object": { + "default": "list", + "title": "Object", + "type": "string" + }, + "data": { + "items": { + "$ref": "#/components/schemas/VectorStoreFileObject" + }, + "title": "Data", + "type": "array" + }, + "first_id": { + "title": "First Id", + "type": "string", + "nullable": true + }, + "last_id": { + "title": "Last Id", + "type": "string", + "nullable": true + }, + "has_more": { + "default": false, + "title": "Has More", + "type": "boolean" + } + }, + "required": [ + "data" + ], + "title": "VectorStoreListFilesResponse", + "type": "object" + }, + "VectorStoreListResponse": { + "description": "Response from listing vector stores.", + "properties": { + "object": { + "default": "list", + "title": "Object", + "type": "string" + }, + "data": { + "items": { + "$ref": "#/components/schemas/VectorStoreObject" + }, + "title": "Data", + "type": "array" + }, + "first_id": { + "title": "First Id", + "type": "string", + "nullable": true + }, + "last_id": { + "title": "Last Id", + "type": "string", + "nullable": true + }, + "has_more": { + "default": false, + "title": "Has More", + "type": "boolean" + } + }, + "required": [ + "data" + ], + "title": "VectorStoreListResponse", + "type": "object" + }, + "VectorStoreModifyRequest": { + "description": "Request to modify a vector store.", + "properties": { + "name": { + "title": "Name", + "type": "string", + "nullable": true + }, + "expires_after": { + "title": "Expires After", + "additionalProperties": true, + "type": "object", + "nullable": true + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object", + "nullable": true + } + }, + "title": "VectorStoreModifyRequest", + "type": "object" + }, + "VectorStoreSearchRequest": { + "description": "Request to search a vector store.", + "properties": { + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Query" + }, + "filters": { + "title": "Filters", + "additionalProperties": true, + "type": "object", + "nullable": true + }, + "max_num_results": { + "default": 10, + "title": "Max Num Results", + "type": "integer" + }, + "ranking_options": { + "title": "Ranking Options", + "additionalProperties": true, + "type": "object", + "nullable": true + }, + "rewrite_query": { + "default": false, + "title": "Rewrite Query", + "type": "boolean" + } + }, + "required": [ + "query" + ], + "title": "VectorStoreSearchRequest", + "type": "object" + }, + "OpenAIResponseContentPartOutputText": { + "description": "Text content within a streamed response part.", + "properties": { + "type": { + "const": "output_text", + "default": "output_text", + "title": "Type", + "type": "string" + }, + "text": { + "title": "Text", + "type": "string" + }, + "annotations": { + "items": { + "discriminator": { + "mapping": { + "container_file_citation": "#/$defs/OpenAIResponseAnnotationContainerFileCitation", + "file_citation": "#/$defs/OpenAIResponseAnnotationFileCitation", + "file_path": "#/$defs/OpenAIResponseAnnotationFilePath", + "url_citation": "#/$defs/OpenAIResponseAnnotationCitation" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationFileCitation" + }, + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationCitation" + }, + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation" + }, + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationFilePath" + } + ] + }, + "title": "Annotations", + "type": "array" + }, + "logprobs": { + "title": "Logprobs", + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "nullable": true + } + }, + "required": [ + "text" + ], + "title": "OpenAIResponseContentPartOutputText", + "type": "object" + }, + "OpenAIResponseContentPartReasoningSummary": { + "description": "Reasoning summary part in a streamed response.", + "properties": { + "type": { + "const": "summary_text", + "default": "summary_text", + "title": "Type", + "type": "string" + }, + "text": { + "title": "Text", + "type": "string" + } + }, + "required": [ + "text" + ], + "title": "OpenAIResponseContentPartReasoningSummary", + "type": "object" + }, + "OpenAIResponseContentPartReasoningText": { + "description": "Reasoning text emitted as part of a streamed response.", + "properties": { + "type": { + "const": "reasoning_text", + "default": "reasoning_text", + "title": "Type", + "type": "string" + }, + "text": { + "title": "Text", + "type": "string" + } + }, + "required": [ + "text" + ], + "title": "OpenAIResponseContentPartReasoningText", + "type": "object" + }, + "OpenAIResponseMessage": { + "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios.", + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "discriminator": { + "mapping": { + "input_file": "#/$defs/OpenAIResponseInputMessageContentFile", + "input_image": "#/$defs/OpenAIResponseInputMessageContentImage", + "input_text": "#/$defs/OpenAIResponseInputMessageContentText" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" + } + ] + }, + "type": "array" + }, + { + "items": { + "discriminator": { + "mapping": { + "output_text": "#/$defs/OpenAIResponseOutputMessageContentOutputText", + "refusal": "#/$defs/OpenAIResponseContentPartRefusal" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" + } + ] + }, + "type": "array" + } + ], + "title": "Content" + }, + "role": { + "anyOf": [ + { + "const": "system", + "type": "string" + }, + { + "const": "developer", + "type": "string" + }, + { + "const": "user", + "type": "string" + }, + { + "const": "assistant", + "type": "string" + } + ], + "title": "Role" + }, + "type": { + "const": "message", + "default": "message", + "title": "Type", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string", + "nullable": true + }, + "status": { + "title": "Status", + "type": "string", + "nullable": true + } + }, + "required": [ + "content", + "role" + ], + "title": "OpenAIResponseMessage", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseCompleted": { + "description": "Streaming event indicating a response has been completed.", + "properties": { + "response": { + "$ref": "#/components/schemas/OpenAIResponseObject" + }, + "type": { + "const": "response.completed", + "default": "response.completed", + "title": "Type", + "type": "string" + } + }, + "required": [ + "response" + ], + "title": "OpenAIResponseObjectStreamResponseCompleted", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseContentPartAdded": { + "description": "Streaming event for when a new content part is added to a response item.", + "properties": { + "content_index": { + "title": "Content Index", + "type": "integer" + }, + "response_id": { + "title": "Response Id", + "type": "string" + }, + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "part": { + "discriminator": { + "mapping": { + "output_text": "#/$defs/OpenAIResponseContentPartOutputText", + "reasoning_text": "#/$defs/OpenAIResponseContentPartReasoningText", + "refusal": "#/$defs/OpenAIResponseContentPartRefusal" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseContentPartOutputText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" + }, + { + "$ref": "#/components/schemas/OpenAIResponseContentPartReasoningText" + } + ], + "title": "Part" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.content_part.added", + "default": "response.content_part.added", + "title": "Type", + "type": "string" + } + }, + "required": [ + "content_index", + "response_id", + "item_id", + "output_index", + "part", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseContentPartAdded", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseContentPartDone": { + "description": "Streaming event for when a content part is completed.", + "properties": { + "content_index": { + "title": "Content Index", + "type": "integer" + }, + "response_id": { + "title": "Response Id", + "type": "string" + }, + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "part": { + "discriminator": { + "mapping": { + "output_text": "#/$defs/OpenAIResponseContentPartOutputText", + "reasoning_text": "#/$defs/OpenAIResponseContentPartReasoningText", + "refusal": "#/$defs/OpenAIResponseContentPartRefusal" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseContentPartOutputText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" + }, + { + "$ref": "#/components/schemas/OpenAIResponseContentPartReasoningText" + } + ], + "title": "Part" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.content_part.done", + "default": "response.content_part.done", + "title": "Type", + "type": "string" + } + }, + "required": [ + "content_index", + "response_id", + "item_id", + "output_index", + "part", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseContentPartDone", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseCreated": { + "description": "Streaming event indicating a new response has been created.", + "properties": { + "response": { + "$ref": "#/components/schemas/OpenAIResponseObject" + }, + "type": { + "const": "response.created", + "default": "response.created", + "title": "Type", + "type": "string" + } + }, + "required": [ + "response" + ], + "title": "OpenAIResponseObjectStreamResponseCreated", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseFailed": { + "description": "Streaming event emitted when a response fails.", + "properties": { + "response": { + "$ref": "#/components/schemas/OpenAIResponseObject" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.failed", + "default": "response.failed", + "title": "Type", + "type": "string" + } + }, + "required": [ + "response", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseFailed", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseFileSearchCallCompleted": { + "description": "Streaming event for completed file search calls.", + "properties": { + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.file_search_call.completed", + "default": "response.file_search_call.completed", + "title": "Type", + "type": "string" + } + }, + "required": [ + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseFileSearchCallCompleted", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseFileSearchCallInProgress": { + "description": "Streaming event for file search calls in progress.", + "properties": { + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.file_search_call.in_progress", + "default": "response.file_search_call.in_progress", + "title": "Type", + "type": "string" + } + }, + "required": [ + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseFileSearchCallInProgress", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseFileSearchCallSearching": { + "description": "Streaming event for file search currently searching.", + "properties": { + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.file_search_call.searching", + "default": "response.file_search_call.searching", + "title": "Type", + "type": "string" + } + }, + "required": [ + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseFileSearchCallSearching", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": { + "description": "Streaming event for incremental function call argument updates.", + "properties": { + "delta": { + "title": "Delta", + "type": "string" + }, + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.function_call_arguments.delta", + "default": "response.function_call_arguments.delta", + "title": "Type", + "type": "string" + } + }, + "required": [ + "delta", + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone": { + "description": "Streaming event for when function call arguments are completed.", + "properties": { + "arguments": { + "title": "Arguments", + "type": "string" + }, + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.function_call_arguments.done", + "default": "response.function_call_arguments.done", + "title": "Type", + "type": "string" + } + }, + "required": [ + "arguments", + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseInProgress": { + "description": "Streaming event indicating the response remains in progress.", + "properties": { + "response": { + "$ref": "#/components/schemas/OpenAIResponseObject" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.in_progress", + "default": "response.in_progress", + "title": "Type", + "type": "string" + } + }, + "required": [ + "response", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseInProgress", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseIncomplete": { + "description": "Streaming event emitted when a response ends in an incomplete state.", + "properties": { + "response": { + "$ref": "#/components/schemas/OpenAIResponseObject" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.incomplete", + "default": "response.incomplete", + "title": "Type", + "type": "string" + } + }, + "required": [ + "response", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseIncomplete", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta": { + "properties": { + "delta": { + "title": "Delta", + "type": "string" + }, + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.mcp_call.arguments.delta", + "default": "response.mcp_call.arguments.delta", + "title": "Type", + "type": "string" + } + }, + "required": [ + "delta", + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseMcpCallArgumentsDone": { + "properties": { + "arguments": { + "title": "Arguments", + "type": "string" + }, + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.mcp_call.arguments.done", + "default": "response.mcp_call.arguments.done", + "title": "Type", + "type": "string" + } + }, + "required": [ + "arguments", + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseMcpCallArgumentsDone", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseMcpCallCompleted": { + "description": "Streaming event for completed MCP calls.", + "properties": { + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.mcp_call.completed", + "default": "response.mcp_call.completed", + "title": "Type", + "type": "string" + } + }, + "required": [ + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseMcpCallCompleted", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseMcpCallFailed": { + "description": "Streaming event for failed MCP calls.", + "properties": { + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.mcp_call.failed", + "default": "response.mcp_call.failed", + "title": "Type", + "type": "string" + } + }, + "required": [ + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseMcpCallFailed", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseMcpCallInProgress": { + "description": "Streaming event for MCP calls in progress.", + "properties": { + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.mcp_call.in_progress", + "default": "response.mcp_call.in_progress", + "title": "Type", + "type": "string" + } + }, + "required": [ + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseMcpCallInProgress", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseMcpListToolsCompleted": { + "properties": { + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.mcp_list_tools.completed", + "default": "response.mcp_list_tools.completed", + "title": "Type", + "type": "string" + } + }, + "required": [ + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseMcpListToolsCompleted", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseMcpListToolsFailed": { + "properties": { + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.mcp_list_tools.failed", + "default": "response.mcp_list_tools.failed", + "title": "Type", + "type": "string" + } + }, + "required": [ + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseMcpListToolsFailed", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseMcpListToolsInProgress": { + "properties": { + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.mcp_list_tools.in_progress", + "default": "response.mcp_list_tools.in_progress", + "title": "Type", + "type": "string" + } + }, + "required": [ + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseMcpListToolsInProgress", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseOutputItemAdded": { + "description": "Streaming event for when a new output item is added to the response.", + "properties": { + "response_id": { + "title": "Response Id", + "type": "string" + }, + "item": { + "discriminator": { + "mapping": { + "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", + "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", + "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", + "message": "#/$defs/OpenAIResponseMessage", + "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + } + ], + "title": "Item" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.output_item.added", + "default": "response.output_item.added", + "title": "Type", + "type": "string" + } + }, + "required": [ + "response_id", + "item", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseOutputItemAdded", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseOutputItemDone": { + "description": "Streaming event for when an output item is completed.", + "properties": { + "response_id": { + "title": "Response Id", + "type": "string" + }, + "item": { + "discriminator": { + "mapping": { + "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", + "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", + "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", + "message": "#/$defs/OpenAIResponseMessage", + "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + } + ], + "title": "Item" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.output_item.done", + "default": "response.output_item.done", + "title": "Type", + "type": "string" + } + }, + "required": [ + "response_id", + "item", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseOutputItemDone", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded": { + "description": "Streaming event for when an annotation is added to output text.", + "properties": { + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "content_index": { + "title": "Content Index", + "type": "integer" + }, + "annotation_index": { + "title": "Annotation Index", + "type": "integer" + }, + "annotation": { + "discriminator": { + "mapping": { + "container_file_citation": "#/$defs/OpenAIResponseAnnotationContainerFileCitation", + "file_citation": "#/$defs/OpenAIResponseAnnotationFileCitation", + "file_path": "#/$defs/OpenAIResponseAnnotationFilePath", + "url_citation": "#/$defs/OpenAIResponseAnnotationCitation" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationFileCitation" + }, + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationCitation" + }, + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation" + }, + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationFilePath" + } + ], + "title": "Annotation" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.output_text.annotation.added", + "default": "response.output_text.annotation.added", + "title": "Type", + "type": "string" + } + }, + "required": [ + "item_id", + "output_index", + "content_index", + "annotation_index", + "annotation", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseOutputTextDelta": { + "description": "Streaming event for incremental text content updates.", + "properties": { + "content_index": { + "title": "Content Index", + "type": "integer" + }, + "delta": { + "title": "Delta", + "type": "string" + }, + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.output_text.delta", + "default": "response.output_text.delta", + "title": "Type", + "type": "string" + } + }, + "required": [ + "content_index", + "delta", + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseOutputTextDelta", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseOutputTextDone": { + "description": "Streaming event for when text output is completed.", + "properties": { + "content_index": { + "title": "Content Index", + "type": "integer" + }, + "text": { + "title": "Text", + "type": "string" + }, + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.output_text.done", + "default": "response.output_text.done", + "title": "Type", + "type": "string" + } + }, + "required": [ + "content_index", + "text", + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseOutputTextDone", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded": { + "description": "Streaming event for when a new reasoning summary part is added.", + "properties": { + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "part": { + "$ref": "#/components/schemas/OpenAIResponseContentPartReasoningSummary" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "summary_index": { + "title": "Summary Index", + "type": "integer" + }, + "type": { + "const": "response.reasoning_summary_part.added", + "default": "response.reasoning_summary_part.added", + "title": "Type", + "type": "string" + } + }, + "required": [ + "item_id", + "output_index", + "part", + "sequence_number", + "summary_index" + ], + "title": "OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseReasoningSummaryPartDone": { + "description": "Streaming event for when a reasoning summary part is completed.", + "properties": { + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "part": { + "$ref": "#/components/schemas/OpenAIResponseContentPartReasoningSummary" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "summary_index": { + "title": "Summary Index", + "type": "integer" + }, + "type": { + "const": "response.reasoning_summary_part.done", + "default": "response.reasoning_summary_part.done", + "title": "Type", + "type": "string" + } + }, + "required": [ + "item_id", + "output_index", + "part", + "sequence_number", + "summary_index" + ], + "title": "OpenAIResponseObjectStreamResponseReasoningSummaryPartDone", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta": { + "description": "Streaming event for incremental reasoning summary text updates.", + "properties": { + "delta": { + "title": "Delta", + "type": "string" + }, + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "summary_index": { + "title": "Summary Index", + "type": "integer" + }, + "type": { + "const": "response.reasoning_summary_text.delta", + "default": "response.reasoning_summary_text.delta", + "title": "Type", + "type": "string" + } + }, + "required": [ + "delta", + "item_id", + "output_index", + "sequence_number", + "summary_index" + ], + "title": "OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseReasoningSummaryTextDone": { + "description": "Streaming event for when reasoning summary text is completed.", + "properties": { + "text": { + "title": "Text", + "type": "string" + }, + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "summary_index": { + "title": "Summary Index", + "type": "integer" + }, + "type": { + "const": "response.reasoning_summary_text.done", + "default": "response.reasoning_summary_text.done", + "title": "Type", + "type": "string" + } + }, + "required": [ + "text", + "item_id", + "output_index", + "sequence_number", + "summary_index" + ], + "title": "OpenAIResponseObjectStreamResponseReasoningSummaryTextDone", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseReasoningTextDelta": { + "description": "Streaming event for incremental reasoning text updates.", + "properties": { + "content_index": { + "title": "Content Index", + "type": "integer" + }, + "delta": { + "title": "Delta", + "type": "string" + }, + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.reasoning_text.delta", + "default": "response.reasoning_text.delta", + "title": "Type", + "type": "string" + } + }, + "required": [ + "content_index", + "delta", + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseReasoningTextDelta", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseReasoningTextDone": { + "description": "Streaming event for when reasoning text is completed.", + "properties": { + "content_index": { + "title": "Content Index", + "type": "integer" + }, + "text": { + "title": "Text", + "type": "string" + }, + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.reasoning_text.done", + "default": "response.reasoning_text.done", + "title": "Type", + "type": "string" + } + }, + "required": [ + "content_index", + "text", + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseReasoningTextDone", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseRefusalDelta": { + "description": "Streaming event for incremental refusal text updates.", + "properties": { + "content_index": { + "title": "Content Index", + "type": "integer" + }, + "delta": { + "title": "Delta", + "type": "string" + }, + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.refusal.delta", + "default": "response.refusal.delta", + "title": "Type", + "type": "string" + } + }, + "required": [ + "content_index", + "delta", + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseRefusalDelta", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseRefusalDone": { + "description": "Streaming event for when refusal text is completed.", + "properties": { + "content_index": { + "title": "Content Index", + "type": "integer" + }, + "refusal": { + "title": "Refusal", + "type": "string" + }, + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.refusal.done", + "default": "response.refusal.done", + "title": "Type", + "type": "string" + } + }, + "required": [ + "content_index", + "refusal", + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseRefusalDone", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseWebSearchCallCompleted": { + "description": "Streaming event for completed web search calls.", + "properties": { + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.web_search_call.completed", + "default": "response.web_search_call.completed", + "title": "Type", + "type": "string" + } + }, + "required": [ + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseWebSearchCallCompleted", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseWebSearchCallInProgress": { + "description": "Streaming event for web search calls in progress.", + "properties": { + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.web_search_call.in_progress", + "default": "response.web_search_call.in_progress", + "title": "Type", + "type": "string" + } + }, + "required": [ + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseWebSearchCallInProgress", + "type": "object" + }, + "OpenAIResponseObjectStreamResponseWebSearchCallSearching": { + "properties": { + "item_id": { + "title": "Item Id", + "type": "string" + }, + "output_index": { + "title": "Output Index", + "type": "integer" + }, + "sequence_number": { + "title": "Sequence Number", + "type": "integer" + }, + "type": { + "const": "response.web_search_call.searching", + "default": "response.web_search_call.searching", + "title": "Type", + "type": "string" + } + }, + "required": [ + "item_id", + "output_index", + "sequence_number" + ], + "title": "OpenAIResponseObjectStreamResponseWebSearchCallSearching", + "type": "object" + }, + "OpenAIResponseObjectWithInput": { + "description": "OpenAI response object extended with input context information.", + "properties": { + "created_at": { + "title": "Created At", + "type": "integer" + }, + "error": { + "$ref": "#/components/schemas/OpenAIResponseError", + "nullable": true + }, + "id": { + "title": "Id", + "type": "string" + }, + "model": { + "title": "Model", + "type": "string" + }, + "object": { + "const": "response", + "default": "response", + "title": "Object", + "type": "string" + }, + "output": { + "items": { + "discriminator": { + "mapping": { + "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", + "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", + "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", + "message": "#/$defs/OpenAIResponseMessage", + "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + } + ] + }, + "title": "Output", + "type": "array" + }, + "parallel_tool_calls": { + "default": false, + "title": "Parallel Tool Calls", + "type": "boolean" + }, + "previous_response_id": { + "title": "Previous Response Id", + "type": "string", + "nullable": true + }, + "prompt": { + "$ref": "#/components/schemas/OpenAIResponsePrompt", + "nullable": true + }, + "status": { + "title": "Status", + "type": "string" + }, + "temperature": { + "title": "Temperature", + "type": "number", + "nullable": true + }, + "text": { + "$ref": "#/components/schemas/OpenAIResponseText", + "default": { + "format": { + "type": "text" + } + } + }, + "top_p": { + "title": "Top P", + "type": "number", + "nullable": true + }, + "tools": { + "title": "Tools", + "items": { + "discriminator": { + "mapping": { + "file_search": "#/$defs/OpenAIResponseInputToolFileSearch", + "function": "#/$defs/OpenAIResponseInputToolFunction", + "mcp": "#/$defs/OpenAIResponseToolMCP", + "web_search": "#/$defs/OpenAIResponseInputToolWebSearch", + "web_search_preview": "#/$defs/OpenAIResponseInputToolWebSearch", + "web_search_preview_2025_03_11": "#/$defs/OpenAIResponseInputToolWebSearch" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" + }, + { + "$ref": "#/components/schemas/OpenAIResponseToolMCP" + } + ] + }, + "type": "array", + "nullable": true + }, + "truncation": { + "title": "Truncation", + "type": "string", + "nullable": true + }, + "usage": { + "$ref": "#/components/schemas/OpenAIResponseUsage", + "nullable": true + }, + "instructions": { + "title": "Instructions", + "type": "string", + "nullable": true + }, + "input": { + "items": { + "anyOf": [ + { + "discriminator": { + "mapping": { + "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", + "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", + "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", + "message": "#/$defs/OpenAIResponseMessage", + "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + } + ] + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + } + ] + }, + "title": "Input", + "type": "array" + } + }, + "required": [ + "created_at", + "id", + "model", + "output", + "status", + "input" + ], + "title": "OpenAIResponseObjectWithInput", + "type": "object" + }, + "ImageContentItem": { + "description": "A image content item", + "properties": { + "type": { + "const": "image", + "default": "image", + "title": "Type", + "type": "string" + }, + "image": { + "$ref": "#/components/schemas/_URLOrData" + } + }, + "required": [ + "image" + ], + "title": "ImageContentItem", + "type": "object" + }, + "ImageDelta": { + "description": "An image content delta for streaming responses.", + "properties": { + "type": { + "const": "image", + "default": "image", + "title": "Type", + "type": "string" + }, + "image": { + "format": "binary", + "title": "Image", + "type": "string" + } + }, + "required": [ + "image" + ], + "title": "ImageDelta", + "type": "object" + }, + "TextDelta": { + "description": "A text content delta for streaming responses.", + "properties": { + "type": { + "const": "text", + "default": "text", + "title": "Type", + "type": "string" + }, + "text": { + "title": "Text", + "type": "string" + } + }, + "required": [ + "text" + ], + "title": "TextDelta", + "type": "object" + }, + "ToolCallDelta": { + "description": "A tool call content delta for streaming responses.", + "properties": { + "type": { + "const": "tool_call", + "default": "tool_call", + "title": "Type", + "type": "string" + }, + "tool_call": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/ToolCall" + } + ], + "title": "Tool Call" + }, + "parse_status": { + "$ref": "#/components/schemas/ToolCallParseStatus" + } + }, + "required": [ + "tool_call", + "parse_status" + ], + "title": "ToolCallDelta", + "type": "object" + }, + "PostTrainingMetric": { + "description": "Training metrics captured during post-training jobs.", + "properties": { + "epoch": { + "title": "Epoch", + "type": "integer" + }, + "train_loss": { + "title": "Train Loss", + "type": "number" + }, + "validation_loss": { + "title": "Validation Loss", + "type": "number" + }, + "perplexity": { + "title": "Perplexity", + "type": "number" + } + }, + "required": [ + "epoch", + "train_loss", + "validation_loss", + "perplexity" + ], + "title": "PostTrainingMetric", + "type": "object" + }, + "DialogType": { + "description": "Parameter type for dialog data with semantic output labels.", + "properties": { + "type": { + "const": "dialog", + "default": "dialog", + "title": "Type", + "type": "string" + } + }, + "title": "DialogType", + "type": "object" + }, + "ConversationMessage": { + "description": "OpenAI-compatible message item for conversations.", + "properties": { + "id": { + "description": "unique identifier for this message", + "title": "Id", + "type": "string" + }, + "content": { + "description": "message content", + "items": { + "additionalProperties": true, + "type": "object" + }, + "title": "Content", + "type": "array" + }, + "role": { + "description": "message role", + "title": "Role", + "type": "string" + }, + "status": { + "description": "message status", + "title": "Status", + "type": "string" + }, + "type": { + "const": "message", + "default": "message", + "title": "Type", + "type": "string" + }, + "object": { + "const": "message", + "default": "message", + "title": "Object", + "type": "string" + } + }, + "required": [ + "id", + "content", + "role", + "status" + ], + "title": "ConversationMessage", + "type": "object" + }, + "_agents_agent_id_session_Request": { + "properties": { + "agent_id": { + "title": "Agent Id", + "type": "string" + }, + "session_name": { + "title": "Session Name", + "type": "string" + } + }, + "required": [ + "agent_id", + "session_name" + ], + "title": "_agents_agent_id_session_Request", + "type": "object" + }, + "_agents_agent_id_session_session_id_turn_Request": { + "properties": { + "agent_id": { + "title": "Agent Id", + "type": "string" + }, + "session_id": { + "title": "Session Id", + "type": "string" + }, + "messages": { + "$ref": "#/components/schemas/UserMessage" + }, + "stream": { + "default": false, + "title": "Stream", + "type": "boolean" + }, + "documents": { + "$ref": "#/components/schemas/Document" + }, + "toolgroups": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/AgentToolGroupWithArgs" + } + ], + "title": "Toolgroups" + }, + "tool_config": { + "$ref": "#/components/schemas/ToolConfig" + } + }, + "required": [ + "agent_id", + "session_id", + "messages", + "documents", + "toolgroups", + "tool_config" + ], + "title": "_agents_agent_id_session_session_id_turn_Request", + "type": "object" + }, + "_agents_agent_id_session_session_id_turn_turn_id_resume_Request": { + "properties": { + "agent_id": { + "title": "Agent Id", + "type": "string" + }, + "session_id": { + "title": "Session Id", + "type": "string" + }, + "turn_id": { + "title": "Turn Id", + "type": "string" + }, + "tool_responses": { + "$ref": "#/components/schemas/ToolResponse" + }, + "stream": { + "default": false, + "title": "Stream", + "type": "boolean" + } + }, + "required": [ + "agent_id", + "session_id", + "turn_id", + "tool_responses" + ], + "title": "_agents_agent_id_session_session_id_turn_turn_id_resume_Request", + "type": "object" + }, + "_safety_run_shield_Request": { + "properties": { + "shield_id": { + "title": "Shield Id", + "type": "string" + }, + "messages": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAIUserMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAISystemMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIAssistantMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIToolMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" + } + ], + "title": "Messages" + }, + "params": { + "title": "Params", + "type": "string" + } + }, + "required": [ + "shield_id", + "messages", + "params" + ], + "title": "_safety_run_shield_Request", + "type": "object" + }, + "_datasets_Request": { + "properties": { + "purpose": { + "$ref": "#/components/schemas/DatasetPurpose" + }, + "metadata": { + "title": "Metadata", + "type": "string" + }, + "dataset_id": { + "title": "Dataset Id", + "type": "string" + } + }, + "required": [ + "purpose", + "metadata", + "dataset_id" + ], + "title": "_datasets_Request", + "type": "object" + }, + "Attachment": { + "description": "An attachment to an agent turn.", + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + { + "items": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/URL" + } + ], + "title": "Content" + }, + "mime_type": { + "title": "Mime Type", + "type": "string" + } + }, + "required": [ + "content", + "mime_type" + ], + "title": "Attachment", + "type": "object" + }, + "StepType": { + "description": "Type of the step in an agent turn.", + "enum": [ + "inference", + "tool_execution", + "shield_call", + "memory_retrieval" + ], + "title": "StepType", + "type": "string" + }, + "ToolCallParseStatus": { + "description": "Status of tool call parsing during streaming.", + "enum": [ + "started", + "in_progress", + "failed", + "succeeded" + ], + "title": "ToolCallParseStatus", + "type": "string" + }, + "LogProbConfig": { + "description": ":param top_k: How many tokens (for each position) to return log probabilities for.", + "properties": { + "top_k": { + "default": 0, + "title": "Top K", + "type": "integer" + } + }, + "title": "LogProbConfig", + "type": "object" + }, + "ToolDefinition": { + "properties": { + "tool_name": { + "anyOf": [ + { + "$ref": "#/components/schemas/BuiltinTool" + }, + { + "type": "string" + } + ], + "title": "Tool Name" + }, + "description": { + "title": "Description", + "type": "string", + "nullable": true + }, + "input_schema": { + "title": "Input Schema", + "additionalProperties": true, + "type": "object", + "nullable": true + }, + "output_schema": { + "title": "Output Schema", + "additionalProperties": true, + "type": "object", + "nullable": true + } + }, + "required": [ + "tool_name" + ], + "title": "ToolDefinition", + "type": "object" + }, + "MetricInResponse": { + "description": "A metric value included in API responses.", + "properties": { + "metric": { + "title": "Metric", + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "number" + } + ], + "title": "Value" + }, + "unit": { + "title": "Unit", + "type": "string", + "nullable": true + } + }, + "required": [ + "metric", + "value" + ], + "title": "MetricInResponse", + "type": "object" + }, + "ChatCompletionResponseEventType": { + "description": "Types of events that can occur during chat completion.", + "enum": [ + "start", + "complete", + "progress" + ], + "title": "ChatCompletionResponseEventType", + "type": "string" + }, + "RLHFAlgorithm": { + "description": "Available reinforcement learning from human feedback algorithms.", + "enum": [ + "dpo" + ], + "title": "RLHFAlgorithm", + "type": "string" + }, + "FilteringFunction": { + "description": "The type of filtering function.", + "enum": [ + "none", + "random", + "top_k", + "top_p", + "top_k_top_p", + "sigmoid" + ], + "title": "FilteringFunction", + "type": "string" + } + }, + "responses": { + "BadRequest400": { + "description": "The request was invalid or malformed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "status": 400, + "title": "Bad Request", + "detail": "The request was invalid or malformed" + } + } + } + }, + "TooManyRequests429": { + "description": "The client has sent too many requests in a given amount of time", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "status": 429, + "title": "Too Many Requests", + "detail": "You have exceeded the rate limit. Please try again later." + } + } + } + }, + "InternalServerError500": { + "description": "The server encountered an unexpected error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "status": 500, + "title": "Internal Server Error", + "detail": "An unexpected error occurred. Our team has been notified." + } + } + } + }, + "DefaultError": { + "description": "An unexpected error occurred", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/docs/static/deprecated-llama-stack-spec.yaml b/docs/static/deprecated-llama-stack-spec.yaml index d77423732c..0526e24df9 100644 --- a/docs/static/deprecated-llama-stack-spec.yaml +++ b/docs/static/deprecated-llama-stack-spec.yaml @@ -68,9 +68,9 @@ components: example: status: 500 title: Internal Server Error - detail: An unexpected error occurred + detail: An unexpected error occurred. Our team has been notified. DefaultError: - description: An error occurred + description: An unexpected error occurred content: application/json: schema: diff --git a/docs/static/experimental-llama-stack-spec.json b/docs/static/experimental-llama-stack-spec.json new file mode 100644 index 0000000000..cf426d9682 --- /dev/null +++ b/docs/static/experimental-llama-stack-spec.json @@ -0,0 +1,5135 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Llama Stack API", + "description": "A comprehensive API for building and deploying AI applications", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://api.llamastack.com", + "description": "Production server" + }, + { + "url": "https://staging-api.llamastack.com", + "description": "Staging server" + } + ], + "paths": { + "/v1beta/datasetio/append-rows/{dataset_id}": { + "post": { + "tags": [ + "V1Beta" + ], + "summary": "Append rows to a dataset.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "append_rows_v1beta_datasetio_append_rows__dataset_id__post", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "dataset_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "Path parameter: dataset_id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1beta/datasetio/iterrows/{dataset_id}": { + "get": { + "tags": [ + "V1Beta" + ], + "summary": "Get a paginated list of rows from a dataset.", + "description": "Query endpoint for proper schema generation.", + "operationId": "iterrows_v1beta_datasetio_iterrows__dataset_id__get", + "parameters": [ + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Limit" + } + }, + { + "name": "start_index", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Start Index" + } + }, + { + "name": "dataset_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Dataset Id" + } + } + ], + "responses": { + "200": { + "description": "A PaginatedResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1beta/datasets": { + "get": { + "tags": [ + "V1Beta" + ], + "summary": "List all datasets.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_datasets_v1beta_datasets_get", + "responses": { + "200": { + "description": "A ListDatasetsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListDatasetsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + }, + "post": { + "tags": [ + "V1Beta" + ], + "summary": "Register a new dataset.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "register_dataset_v1beta_datasets_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/__main_____datasets_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A Dataset.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Dataset" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1beta/datasets/{dataset_id}": { + "delete": { + "tags": [ + "V1Beta" + ], + "summary": "Unregister a dataset by its ID.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "unregister_dataset_v1beta_datasets__dataset_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "dataset_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "Path parameter: dataset_id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1Beta" + ], + "summary": "Get a dataset by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_dataset_v1beta_datasets__dataset_id__get", + "parameters": [ + { + "name": "dataset_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Dataset Id" + } + } + ], + "responses": { + "200": { + "description": "A Dataset.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Dataset" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/agents": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "List all agents.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_agents_v1alpha_agents_get", + "parameters": [ + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Limit" + } + }, + { + "name": "start_index", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Start Index" + } + } + ], + "responses": { + "200": { + "description": "A PaginatedResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Create an agent with the given configuration.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_agent_v1alpha_agents_post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentConfig" + } + } + } + }, + "responses": { + "200": { + "description": "An AgentCreateResponse with the agent ID.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentCreateResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/agents/{agent_id}": { + "delete": { + "tags": [ + "V1Alpha" + ], + "summary": "Delete an agent by its ID and its associated sessions and turns.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "delete_agent_v1alpha_agents__agent_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the agent to delete." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Describe an agent by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_agent_v1alpha_agents__agent_id__get", + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Agent Id" + }, + "description": "ID of the agent." + } + ], + "responses": { + "200": { + "description": "An Agent of the agent.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Agent" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/agents/{agent_id}/session": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Create a new session for an agent.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_agent_session_v1alpha_agents__agent_id__session_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/__main_____agents_agent_id_session_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "An AgentSessionCreateResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentSessionCreateResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the agent to create the session for." + } + ] + } + }, + "/v1alpha/agents/{agent_id}/session/{session_id}": { + "delete": { + "tags": [ + "V1Alpha" + ], + "summary": "Delete an agent session by its ID and its associated turns.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "delete_agents_session_v1alpha_agents__agent_id__session__session_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the session to delete." + }, + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the agent to delete the session for." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Retrieve an agent session by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_agents_session_v1alpha_agents__agent_id__session__session_id__get", + "parameters": [ + { + "name": "turn_ids", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Turn Ids" + } + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Session Id" + }, + "description": "The ID of the session to get." + }, + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Agent Id" + }, + "description": "The ID of the agent to get the session for." + } + ], + "responses": { + "200": { + "description": "A Session.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Session" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/agents/{agent_id}/session/{session_id}/turn": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Create a new turn for an agent.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/__main_____agents_agent_id_session_session_id_turn_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "If stream=False, returns a Turn object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Turn" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the agent to create the turn for." + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the session to create the turn for." + } + ] + } + }, + "/v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Retrieve an agent turn by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_agents_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__get", + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Agent Id" + }, + "description": "The ID of the agent to get the turn for." + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Session Id" + }, + "description": "The ID of the session to get the turn for." + }, + { + "name": "turn_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Turn Id" + }, + "description": "The ID of the turn to get." + } + ], + "responses": { + "200": { + "description": "A Turn.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Turn" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Resume an agent turn with executed tool call responses.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "resume_agent_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__resume_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A Turn object if stream is False, otherwise an AsyncIterator of AgentTurnResponseStreamChunk objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Turn" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the agent to resume." + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the session to resume." + }, + { + "name": "turn_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the turn to resume." + } + ] + } + }, + "/v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Retrieve an agent step by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_agents_step_v1alpha_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get", + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Agent Id" + }, + "description": "The ID of the agent to get the step for." + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Session Id" + }, + "description": "The ID of the session to get the step for." + }, + { + "name": "turn_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Turn Id" + }, + "description": "The ID of the turn to get the step for." + }, + { + "name": "step_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Step Id" + }, + "description": "The ID of the step to get." + } + ], + "responses": { + "200": { + "description": "An AgentStepResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentStepResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/agents/{agent_id}/sessions": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "List all session(s) of a given agent.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_agent_sessions_v1alpha_agents__agent_id__sessions_get", + "parameters": [ + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Limit" + } + }, + { + "name": "start_index", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Start Index" + } + }, + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Agent Id" + }, + "description": "The ID of the agent to list sessions for." + } + ], + "responses": { + "200": { + "description": "A PaginatedResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/eval/benchmarks": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "List all benchmarks.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_benchmarks_v1alpha_eval_benchmarks_get", + "responses": { + "200": { + "description": "A ListBenchmarksResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBenchmarksResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Register a benchmark.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "register_benchmark_v1alpha_eval_benchmarks_post", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/eval/benchmarks/{benchmark_id}": { + "delete": { + "tags": [ + "V1Alpha" + ], + "summary": "Unregister a benchmark.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "unregister_benchmark_v1alpha_eval_benchmarks__benchmark_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the benchmark to unregister." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Get a benchmark by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_benchmark_v1alpha_eval_benchmarks__benchmark_id__get", + "parameters": [ + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Benchmark Id" + }, + "description": "The ID of the benchmark to get." + } + ], + "responses": { + "200": { + "description": "A Benchmark.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Benchmark" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/eval/benchmarks/{benchmark_id}/evaluations": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Evaluate a list of rows on a benchmark.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "evaluate_rows_v1alpha_eval_benchmarks__benchmark_id__evaluations_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BenchmarkConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "EvaluateResponse object containing generations and scores.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvaluateResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the benchmark to run the evaluation on." + } + ] + } + }, + "/v1alpha/eval/benchmarks/{benchmark_id}/jobs": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Run an evaluation on a benchmark.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "run_eval_v1alpha_eval_benchmarks__benchmark_id__jobs_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BenchmarkConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The job that was created to run the evaluation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Job" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the benchmark to run the evaluation on." + } + ] + } + }, + "/v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}": { + "delete": { + "tags": [ + "V1Alpha" + ], + "summary": "Cancel a job.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "job_cancel_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the benchmark to run the evaluation on." + }, + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the job to cancel." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Get the status of a job.", + "description": "Query endpoint for proper schema generation.", + "operationId": "job_status_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__get", + "parameters": [ + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Benchmark Id" + }, + "description": "The ID of the benchmark to run the evaluation on." + }, + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Job Id" + }, + "description": "The ID of the job to get the status of." + } + ], + "responses": { + "200": { + "description": "The status of the evaluation job.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Job" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Get the result of a job.", + "description": "Query endpoint for proper schema generation.", + "operationId": "job_result_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__result_get", + "parameters": [ + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Benchmark Id" + }, + "description": "The ID of the benchmark to run the evaluation on." + }, + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Job Id" + }, + "description": "The ID of the job to get the result of." + } + ], + "responses": { + "200": { + "description": "The result of the job.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvaluateResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/inference/rerank": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Rerank a list of documents based on their relevance to a query.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "rerank_v1alpha_inference_rerank_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_inference_rerank_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "RerankResponse with indices sorted by relevance score (descending).", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RerankResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1alpha/post-training/job/artifacts": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Get the artifacts of a training job.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_training_job_artifacts_v1alpha_post_training_job_artifacts_get", + "parameters": [ + { + "name": "job_uuid", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Job Uuid" + } + } + ], + "responses": { + "200": { + "description": "A PostTrainingJobArtifactsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostTrainingJobArtifactsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/post-training/job/cancel": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Cancel a training job.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "cancel_training_job_v1alpha_post_training_job_cancel_post", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/post-training/job/status": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Get the status of a training job.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_training_job_status_v1alpha_post_training_job_status_get", + "parameters": [ + { + "name": "job_uuid", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Job Uuid" + } + } + ], + "responses": { + "200": { + "description": "A PostTrainingJobStatusResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostTrainingJobStatusResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/post-training/jobs": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Get all training jobs.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "get_training_jobs_v1alpha_post_training_jobs_get", + "responses": { + "200": { + "description": "A ListPostTrainingJobsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPostTrainingJobsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1alpha/post-training/preference-optimize": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Run preference optimization of a model.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "preference_optimize_v1alpha_post_training_preference_optimize_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DPOAlignmentConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A PostTrainingJob.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostTrainingJob" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1alpha/post-training/supervised-fine-tune": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Run supervised fine-tuning of a model.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "supervised_fine_tune_v1alpha_post_training_supervised_fine_tune_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrainingConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A PostTrainingJob.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostTrainingJob" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + } + }, + "components": { + "schemas": { + "AgentCandidate": { + "properties": { + "type": { + "type": "string", + "const": "agent", + "title": "Type", + "default": "agent" + }, + "config": { + "$ref": "#/components/schemas/AgentConfig" + } + }, + "type": "object", + "required": [ + "config" + ], + "title": "AgentCandidate", + "description": "An agent candidate for evaluation." + }, + "AgentConfig": { + "properties": { + "sampling_params": { + "$ref": "#/components/schemas/SamplingParams" + }, + "input_shields": { + "title": "Input Shields", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_shields": { + "title": "Output Shields", + "items": { + "type": "string" + }, + "type": "array" + }, + "toolgroups": { + "title": "Toolgroups", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/AgentToolGroupWithArgs" + } + ] + }, + "type": "array" + }, + "client_tools": { + "title": "Client Tools", + "items": { + "$ref": "#/components/schemas/ToolDef" + }, + "type": "array" + }, + "tool_choice": { + "deprecated": true, + "$ref": "#/components/schemas/ToolChoice" + }, + "tool_prompt_format": { + "deprecated": true, + "$ref": "#/components/schemas/ToolPromptFormat" + }, + "tool_config": { + "$ref": "#/components/schemas/ToolConfig" + }, + "max_infer_iters": { + "title": "Max Infer Iters", + "default": 10, + "type": "integer" + }, + "model": { + "type": "string", + "title": "Model" + }, + "instructions": { + "type": "string", + "title": "Instructions" + }, + "name": { + "title": "Name", + "type": "string" + }, + "enable_session_persistence": { + "title": "Enable Session Persistence", + "default": false, + "type": "boolean" + }, + "response_format": { + "title": "Response Format", + "oneOf": [ + { + "$ref": "#/components/schemas/JsonSchemaResponseFormat" + }, + { + "$ref": "#/components/schemas/GrammarResponseFormat" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "grammar": "#/components/schemas/GrammarResponseFormat", + "json_schema": "#/components/schemas/JsonSchemaResponseFormat" + } + } + } + }, + "type": "object", + "required": [ + "model", + "instructions" + ], + "title": "AgentConfig", + "description": "Configuration for an agent." + }, + "AgentCreateResponse": { + "properties": { + "agent_id": { + "type": "string", + "title": "Agent Id" + } + }, + "type": "object", + "required": [ + "agent_id" + ], + "title": "AgentCreateResponse", + "description": "Response returned when creating a new agent." + }, + "AgentSessionCreateResponse": { + "properties": { + "session_id": { + "type": "string", + "title": "Session Id" + } + }, + "type": "object", + "required": [ + "session_id" + ], + "title": "AgentSessionCreateResponse", + "description": "Response returned when creating a new agent session." + }, + "AgentToolGroupWithArgs": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "args": { + "additionalProperties": true, + "type": "object", + "title": "Args" + } + }, + "type": "object", + "required": [ + "name", + "args" + ], + "title": "AgentToolGroupWithArgs" + }, + "AggregationFunctionType": { + "type": "string", + "enum": [ + "average", + "weighted_average", + "median", + "categorical_count", + "accuracy" + ], + "title": "AggregationFunctionType", + "description": "Types of aggregation functions for scoring results." + }, + "Attachment-Output": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/URL" + } + ], + "title": "Content" + }, + "mime_type": { + "type": "string", + "title": "Mime Type" + } + }, + "type": "object", + "required": [ + "content", + "mime_type" + ], + "title": "Attachment", + "description": "An attachment to an agent turn." + }, + "BasicScoringFnParams": { + "properties": { + "type": { + "type": "string", + "const": "basic", + "title": "Type", + "default": "basic" + }, + "aggregation_functions": { + "items": { + "$ref": "#/components/schemas/AggregationFunctionType" + }, + "type": "array", + "title": "Aggregation Functions", + "description": "Aggregation functions to apply to the scores of each row" + } + }, + "type": "object", + "title": "BasicScoringFnParams", + "description": "Parameters for basic scoring function configuration." + }, + "Benchmark": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "benchmark", + "title": "Type", + "default": "benchmark" + }, + "dataset_id": { + "type": "string", + "title": "Dataset Id" + }, + "scoring_functions": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Scoring Functions" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata", + "description": "Metadata for this evaluation task" + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id", + "dataset_id", + "scoring_functions" + ], + "title": "Benchmark", + "description": "A benchmark resource for evaluating model performance." + }, + "BenchmarkConfig": { + "properties": { + "eval_candidate": { + "oneOf": [ + { + "$ref": "#/components/schemas/ModelCandidate" + }, + { + "$ref": "#/components/schemas/AgentCandidate" + } + ], + "title": "Eval Candidate", + "discriminator": { + "propertyName": "type", + "mapping": { + "agent": "#/components/schemas/AgentCandidate", + "model": "#/components/schemas/ModelCandidate" + } + } + }, + "scoring_params": { + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" + }, + { + "$ref": "#/components/schemas/RegexParserScoringFnParams" + }, + { + "$ref": "#/components/schemas/BasicScoringFnParams" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "basic": "#/components/schemas/BasicScoringFnParams", + "llm_as_judge": "#/components/schemas/LLMAsJudgeScoringFnParams", + "regex_parser": "#/components/schemas/RegexParserScoringFnParams" + } + } + }, + "type": "object", + "title": "Scoring Params", + "description": "Map between scoring function id and parameters for each scoring function you want to run" + }, + "num_examples": { + "title": "Num Examples", + "description": "Number of examples to evaluate (useful for testing), if not provided, all examples in the dataset will be evaluated", + "type": "integer" + } + }, + "type": "object", + "required": [ + "eval_candidate" + ], + "title": "BenchmarkConfig", + "description": "A benchmark configuration for evaluation." + }, + "BuiltinTool": { + "type": "string", + "enum": [ + "brave_search", + "wolfram_alpha", + "photogen", + "code_interpreter" + ], + "title": "BuiltinTool" + }, + "CompletionMessage-Output": { + "properties": { + "role": { + "type": "string", + "const": "assistant", + "title": "Role", + "default": "assistant" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "stop_reason": { + "$ref": "#/components/schemas/StopReason" + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/ToolCall" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "content", + "stop_reason" + ], + "title": "CompletionMessage", + "description": "A message containing the model's (assistant) response in a chat conversation." + }, + "DPOAlignmentConfig": { + "properties": { + "beta": { + "type": "number", + "title": "Beta" + }, + "loss_type": { + "$ref": "#/components/schemas/DPOLossType", + "default": "sigmoid" + } + }, + "type": "object", + "required": [ + "beta" + ], + "title": "DPOAlignmentConfig", + "description": "Configuration for Direct Preference Optimization (DPO) alignment." + }, + "DPOLossType": { + "type": "string", + "enum": [ + "sigmoid", + "hinge", + "ipo", + "kto_pair" + ], + "title": "DPOLossType" + }, + "DataConfig": { + "properties": { + "dataset_id": { + "type": "string", + "title": "Dataset Id" + }, + "batch_size": { + "type": "integer", + "title": "Batch Size" + }, + "shuffle": { + "type": "boolean", + "title": "Shuffle" + }, + "data_format": { + "$ref": "#/components/schemas/DatasetFormat" + }, + "validation_dataset_id": { + "title": "Validation Dataset Id", + "type": "string" + }, + "packed": { + "title": "Packed", + "default": false, + "type": "boolean" + }, + "train_on_input": { + "title": "Train On Input", + "default": false, + "type": "boolean" + } + }, + "type": "object", + "required": [ + "dataset_id", + "batch_size", + "shuffle", + "data_format" + ], + "title": "DataConfig", + "description": "Configuration for training data and data loading." + }, + "Dataset": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "dataset", + "title": "Type", + "default": "dataset" + }, + "purpose": { + "$ref": "#/components/schemas/DatasetPurpose" + }, + "source": { + "oneOf": [ + { + "$ref": "#/components/schemas/URIDataSource" + }, + { + "$ref": "#/components/schemas/RowsDataSource" + } + ], + "title": "Source", + "discriminator": { + "propertyName": "type", + "mapping": { + "rows": "#/components/schemas/RowsDataSource", + "uri": "#/components/schemas/URIDataSource" + } + } + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata", + "description": "Any additional metadata for this dataset" + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id", + "purpose", + "source" + ], + "title": "Dataset", + "description": "Dataset resource for storing and accessing training or evaluation data." + }, + "DatasetFormat": { + "type": "string", + "enum": [ + "instruct", + "dialog" + ], + "title": "DatasetFormat", + "description": "Format of the training dataset." + }, + "DatasetPurpose": { + "type": "string", + "enum": [ + "post-training/messages", + "eval/question-answer", + "eval/messages-answer" + ], + "title": "DatasetPurpose", + "description": "Purpose of the dataset. Each purpose has a required input data schema." + }, + "Document": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/URL" + } + ], + "title": "Content" + }, + "mime_type": { + "type": "string", + "title": "Mime Type" + } + }, + "type": "object", + "required": [ + "content", + "mime_type" + ], + "title": "Document", + "description": "A document to be used by an agent." + }, + "EfficiencyConfig": { + "properties": { + "enable_activation_checkpointing": { + "title": "Enable Activation Checkpointing", + "default": false, + "type": "boolean" + }, + "enable_activation_offloading": { + "title": "Enable Activation Offloading", + "default": false, + "type": "boolean" + }, + "memory_efficient_fsdp_wrap": { + "title": "Memory Efficient Fsdp Wrap", + "default": false, + "type": "boolean" + }, + "fsdp_cpu_offload": { + "title": "Fsdp Cpu Offload", + "default": false, + "type": "boolean" + } + }, + "type": "object", + "title": "EfficiencyConfig", + "description": "Configuration for memory and compute efficiency optimizations." + }, + "EvaluateResponse": { + "properties": { + "generations": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Generations" + }, + "scores": { + "additionalProperties": { + "$ref": "#/components/schemas/ScoringResult" + }, + "type": "object", + "title": "Scores" + } + }, + "type": "object", + "required": [ + "generations", + "scores" + ], + "title": "EvaluateResponse", + "description": "The response from an evaluation." + }, + "GrammarResponseFormat": { + "properties": { + "type": { + "type": "string", + "const": "grammar", + "title": "Type", + "default": "grammar" + }, + "bnf": { + "additionalProperties": true, + "type": "object", + "title": "Bnf" + } + }, + "type": "object", + "required": [ + "bnf" + ], + "title": "GrammarResponseFormat", + "description": "Configuration for grammar-guided response generation." + }, + "GreedySamplingStrategy": { + "properties": { + "type": { + "type": "string", + "const": "greedy", + "title": "Type", + "default": "greedy" + } + }, + "type": "object", + "title": "GreedySamplingStrategy", + "description": "Greedy sampling strategy that selects the highest probability token at each step." + }, + "ImageContentItem-Input": { + "properties": { + "type": { + "type": "string", + "const": "image", + "title": "Type", + "default": "image" + }, + "image": { + "$ref": "#/components/schemas/_URLOrData" + } + }, + "type": "object", + "required": [ + "image" + ], + "title": "ImageContentItem", + "description": "A image content item" + }, + "ImageContentItem-Output": { + "properties": { + "type": { + "type": "string", + "const": "image", + "title": "Type", + "default": "image" + }, + "image": { + "$ref": "#/components/schemas/_URLOrData" + } + }, + "type": "object", + "required": [ + "image" + ], + "title": "ImageContentItem", + "description": "A image content item" + }, + "InferenceStep-Output": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "step_id": { + "type": "string", + "title": "Step Id" + }, + "started_at": { + "title": "Started At", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + }, + "step_type": { + "type": "string", + "const": "inference", + "title": "Step Type", + "default": "inference" + }, + "model_response": { + "$ref": "#/components/schemas/CompletionMessage-Output" + } + }, + "type": "object", + "required": [ + "turn_id", + "step_id", + "model_response" + ], + "title": "InferenceStep", + "description": "An inference step in an agent turn." + }, + "Job": { + "properties": { + "job_id": { + "type": "string", + "title": "Job Id" + }, + "status": { + "$ref": "#/components/schemas/JobStatus" + } + }, + "type": "object", + "required": [ + "job_id", + "status" + ], + "title": "Job", + "description": "A job execution instance with status tracking." + }, + "JobStatus": { + "type": "string", + "enum": [ + "completed", + "in_progress", + "failed", + "scheduled", + "cancelled" + ], + "title": "JobStatus", + "description": "Status of a job execution." + }, + "JsonSchemaResponseFormat": { + "properties": { + "type": { + "type": "string", + "const": "json_schema", + "title": "Type", + "default": "json_schema" + }, + "json_schema": { + "additionalProperties": true, + "type": "object", + "title": "Json Schema" + } + }, + "type": "object", + "required": [ + "json_schema" + ], + "title": "JsonSchemaResponseFormat", + "description": "Configuration for JSON schema-guided response generation." + }, + "LLMAsJudgeScoringFnParams": { + "properties": { + "type": { + "type": "string", + "const": "llm_as_judge", + "title": "Type", + "default": "llm_as_judge" + }, + "judge_model": { + "type": "string", + "title": "Judge Model" + }, + "prompt_template": { + "title": "Prompt Template", + "type": "string" + }, + "judge_score_regexes": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Judge Score Regexes", + "description": "Regexes to extract the answer from generated response" + }, + "aggregation_functions": { + "items": { + "$ref": "#/components/schemas/AggregationFunctionType" + }, + "type": "array", + "title": "Aggregation Functions", + "description": "Aggregation functions to apply to the scores of each row" + } + }, + "type": "object", + "required": [ + "judge_model" + ], + "title": "LLMAsJudgeScoringFnParams", + "description": "Parameters for LLM-as-judge scoring function configuration." + }, + "ListBenchmarksResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Benchmark" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListBenchmarksResponse" + }, + "ListDatasetsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Dataset" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListDatasetsResponse", + "description": "Response from listing datasets." + }, + "ListPostTrainingJobsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/PostTrainingJob" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListPostTrainingJobsResponse" + }, + "MemoryRetrievalStep-Output": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "step_id": { + "type": "string", + "title": "Step Id" + }, + "started_at": { + "title": "Started At", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + }, + "step_type": { + "type": "string", + "const": "memory_retrieval", + "title": "Step Type", + "default": "memory_retrieval" + }, + "vector_store_ids": { + "type": "string", + "title": "Vector Store Ids" + }, + "inserted_context": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Inserted Context" + } + }, + "type": "object", + "required": [ + "turn_id", + "step_id", + "vector_store_ids", + "inserted_context" + ], + "title": "MemoryRetrievalStep", + "description": "A memory retrieval step in an agent turn." + }, + "ModelCandidate": { + "properties": { + "type": { + "type": "string", + "const": "model", + "title": "Type", + "default": "model" + }, + "model": { + "type": "string", + "title": "Model" + }, + "sampling_params": { + "$ref": "#/components/schemas/SamplingParams" + }, + "system_message": { + "$ref": "#/components/schemas/SystemMessage" + } + }, + "type": "object", + "required": [ + "model", + "sampling_params" + ], + "title": "ModelCandidate", + "description": "A model candidate for evaluation." + }, + "OptimizerConfig": { + "properties": { + "optimizer_type": { + "$ref": "#/components/schemas/OptimizerType" + }, + "lr": { + "type": "number", + "title": "Lr" + }, + "weight_decay": { + "type": "number", + "title": "Weight Decay" + }, + "num_warmup_steps": { + "type": "integer", + "title": "Num Warmup Steps" + } + }, + "type": "object", + "required": [ + "optimizer_type", + "lr", + "weight_decay", + "num_warmup_steps" + ], + "title": "OptimizerConfig", + "description": "Configuration parameters for the optimization algorithm." + }, + "OptimizerType": { + "type": "string", + "enum": [ + "adam", + "adamw", + "sgd" + ], + "title": "OptimizerType", + "description": "Available optimizer algorithms for training." + }, + "PostTrainingJob": { + "properties": { + "job_uuid": { + "type": "string", + "title": "Job Uuid" + } + }, + "type": "object", + "required": [ + "job_uuid" + ], + "title": "PostTrainingJob" + }, + "RegexParserScoringFnParams": { + "properties": { + "type": { + "type": "string", + "const": "regex_parser", + "title": "Type", + "default": "regex_parser" + }, + "parsing_regexes": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Parsing Regexes", + "description": "Regex to extract the answer from generated response" + }, + "aggregation_functions": { + "items": { + "$ref": "#/components/schemas/AggregationFunctionType" + }, + "type": "array", + "title": "Aggregation Functions", + "description": "Aggregation functions to apply to the scores of each row" + } + }, + "type": "object", + "title": "RegexParserScoringFnParams", + "description": "Parameters for regex parser scoring function configuration." + }, + "RerankData": { + "properties": { + "index": { + "type": "integer", + "title": "Index" + }, + "relevance_score": { + "type": "number", + "title": "Relevance Score" + } + }, + "type": "object", + "required": [ + "index", + "relevance_score" + ], + "title": "RerankData", + "description": "A single rerank result from a reranking response." + }, + "RerankResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/RerankData" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "RerankResponse", + "description": "Response from a reranking request." + }, + "RowsDataSource": { + "properties": { + "type": { + "type": "string", + "const": "rows", + "title": "Type", + "default": "rows" + }, + "rows": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Rows" + } + }, + "type": "object", + "required": [ + "rows" + ], + "title": "RowsDataSource", + "description": "A dataset stored in rows." + }, + "SafetyViolation": { + "properties": { + "violation_level": { + "$ref": "#/components/schemas/ViolationLevel" + }, + "user_message": { + "title": "User Message", + "type": "string" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "violation_level" + ], + "title": "SafetyViolation", + "description": "Details of a safety violation detected by content moderation." + }, + "SamplingParams": { + "properties": { + "strategy": { + "oneOf": [ + { + "$ref": "#/components/schemas/GreedySamplingStrategy" + }, + { + "$ref": "#/components/schemas/TopPSamplingStrategy" + }, + { + "$ref": "#/components/schemas/TopKSamplingStrategy" + } + ], + "title": "Strategy", + "discriminator": { + "propertyName": "type", + "mapping": { + "greedy": "#/components/schemas/GreedySamplingStrategy", + "top_k": "#/components/schemas/TopKSamplingStrategy", + "top_p": "#/components/schemas/TopPSamplingStrategy" + } + } + }, + "max_tokens": { + "title": "Max Tokens", + "type": "integer" + }, + "repetition_penalty": { + "title": "Repetition Penalty", + "default": 1.0, + "type": "number" + }, + "stop": { + "title": "Stop", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "title": "SamplingParams", + "description": "Sampling parameters." + }, + "ScoringResult": { + "properties": { + "score_rows": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Score Rows" + }, + "aggregated_results": { + "additionalProperties": true, + "type": "object", + "title": "Aggregated Results" + } + }, + "type": "object", + "required": [ + "score_rows", + "aggregated_results" + ], + "title": "ScoringResult", + "description": "A scoring result for a single row." + }, + "ShieldCallStep-Output": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "step_id": { + "type": "string", + "title": "Step Id" + }, + "started_at": { + "title": "Started At", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + }, + "step_type": { + "type": "string", + "const": "shield_call", + "title": "Step Type", + "default": "shield_call" + }, + "violation": { + "$ref": "#/components/schemas/SafetyViolation" + } + }, + "type": "object", + "required": [ + "turn_id", + "step_id", + "violation" + ], + "title": "ShieldCallStep", + "description": "A shield call step in an agent turn." + }, + "StopReason": { + "type": "string", + "enum": [ + "end_of_turn", + "end_of_message", + "out_of_tokens" + ], + "title": "StopReason" + }, + "SystemMessage": { + "properties": { + "role": { + "type": "string", + "const": "system", + "title": "Role", + "default": "system" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "SystemMessage", + "description": "A system message providing instructions or context to the model." + }, + "SystemMessageBehavior": { + "type": "string", + "enum": [ + "append", + "replace" + ], + "title": "SystemMessageBehavior", + "description": "Config for how to override the default system prompt." + }, + "TextContentItem": { + "properties": { + "type": { + "type": "string", + "const": "text", + "title": "Type", + "default": "text" + }, + "text": { + "type": "string", + "title": "Text" + } + }, + "type": "object", + "required": [ + "text" + ], + "title": "TextContentItem", + "description": "A text content item" + }, + "ToolCall": { + "properties": { + "call_id": { + "type": "string", + "title": "Call Id" + }, + "tool_name": { + "anyOf": [ + { + "$ref": "#/components/schemas/BuiltinTool" + }, + { + "type": "string" + } + ], + "title": "Tool Name" + }, + "arguments": { + "type": "string", + "title": "Arguments" + } + }, + "type": "object", + "required": [ + "call_id", + "tool_name", + "arguments" + ], + "title": "ToolCall" + }, + "ToolChoice": { + "type": "string", + "enum": [ + "auto", + "required", + "none" + ], + "title": "ToolChoice", + "description": "Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model." + }, + "ToolConfig": { + "properties": { + "tool_choice": { + "anyOf": [ + { + "$ref": "#/components/schemas/ToolChoice" + }, + { + "type": "string" + } + ], + "title": "Tool Choice", + "default": "auto" + }, + "tool_prompt_format": { + "$ref": "#/components/schemas/ToolPromptFormat" + }, + "system_message_behavior": { + "default": "append", + "$ref": "#/components/schemas/SystemMessageBehavior" + } + }, + "type": "object", + "title": "ToolConfig", + "description": "Configuration for tool use." + }, + "ToolDef": { + "properties": { + "toolgroup_id": { + "title": "Toolgroup Id", + "type": "string" + }, + "name": { + "type": "string", + "title": "Name" + }, + "description": { + "title": "Description", + "type": "string" + }, + "input_schema": { + "title": "Input Schema", + "additionalProperties": true, + "type": "object" + }, + "output_schema": { + "title": "Output Schema", + "additionalProperties": true, + "type": "object" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "required": [ + "name" + ], + "title": "ToolDef", + "description": "Tool definition used in runtime contexts." + }, + "ToolExecutionStep-Output": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "step_id": { + "type": "string", + "title": "Step Id" + }, + "started_at": { + "title": "Started At", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + }, + "step_type": { + "type": "string", + "const": "tool_execution", + "title": "Step Type", + "default": "tool_execution" + }, + "tool_calls": { + "items": { + "$ref": "#/components/schemas/ToolCall" + }, + "type": "array", + "title": "Tool Calls" + }, + "tool_responses": { + "items": { + "$ref": "#/components/schemas/ToolResponse-Output" + }, + "type": "array", + "title": "Tool Responses" + } + }, + "type": "object", + "required": [ + "turn_id", + "step_id", + "tool_calls", + "tool_responses" + ], + "title": "ToolExecutionStep", + "description": "A tool execution step in an agent turn." + }, + "ToolPromptFormat": { + "type": "string", + "enum": [ + "json", + "function_tag", + "python_list" + ], + "title": "ToolPromptFormat", + "description": "Prompt format for calling custom / zero shot tools." + }, + "ToolResponse-Input": { + "properties": { + "call_id": { + "type": "string", + "title": "Call Id" + }, + "tool_name": { + "anyOf": [ + { + "$ref": "#/components/schemas/BuiltinTool" + }, + { + "type": "string" + } + ], + "title": "Tool Name" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "required": [ + "call_id", + "tool_name", + "content" + ], + "title": "ToolResponse", + "description": "Response from a tool invocation." + }, + "ToolResponse-Output": { + "properties": { + "call_id": { + "type": "string", + "title": "Call Id" + }, + "tool_name": { + "anyOf": [ + { + "$ref": "#/components/schemas/BuiltinTool" + }, + { + "type": "string" + } + ], + "title": "Tool Name" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "required": [ + "call_id", + "tool_name", + "content" + ], + "title": "ToolResponse", + "description": "Response from a tool invocation." + }, + "ToolResponseMessage-Output": { + "properties": { + "role": { + "type": "string", + "const": "tool", + "title": "Role", + "default": "tool" + }, + "call_id": { + "type": "string", + "title": "Call Id" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + } + }, + "type": "object", + "required": [ + "call_id", + "content" + ], + "title": "ToolResponseMessage", + "description": "A message representing the result of a tool invocation." + }, + "TopKSamplingStrategy": { + "properties": { + "type": { + "type": "string", + "const": "top_k", + "title": "Type", + "default": "top_k" + }, + "top_k": { + "type": "integer", + "minimum": 1.0, + "title": "Top K" + } + }, + "type": "object", + "required": [ + "top_k" + ], + "title": "TopKSamplingStrategy", + "description": "Top-k sampling strategy that restricts sampling to the k most likely tokens." + }, + "TopPSamplingStrategy": { + "properties": { + "type": { + "type": "string", + "const": "top_p", + "title": "Type", + "default": "top_p" + }, + "temperature": { + "title": "Temperature", + "type": "number", + "minimum": 0.0 + }, + "top_p": { + "title": "Top P", + "default": 0.95, + "type": "number" + } + }, + "type": "object", + "required": [ + "temperature" + ], + "title": "TopPSamplingStrategy", + "description": "Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p." + }, + "TrainingConfig": { + "properties": { + "n_epochs": { + "type": "integer", + "title": "N Epochs" + }, + "max_steps_per_epoch": { + "type": "integer", + "title": "Max Steps Per Epoch", + "default": 1 + }, + "gradient_accumulation_steps": { + "type": "integer", + "title": "Gradient Accumulation Steps", + "default": 1 + }, + "max_validation_steps": { + "title": "Max Validation Steps", + "default": 1, + "type": "integer" + }, + "data_config": { + "$ref": "#/components/schemas/DataConfig" + }, + "optimizer_config": { + "$ref": "#/components/schemas/OptimizerConfig" + }, + "efficiency_config": { + "$ref": "#/components/schemas/EfficiencyConfig" + }, + "dtype": { + "title": "Dtype", + "default": "bf16", + "type": "string" + } + }, + "type": "object", + "required": [ + "n_epochs" + ], + "title": "TrainingConfig", + "description": "Comprehensive configuration for the training process." + }, + "Turn": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "session_id": { + "type": "string", + "title": "Session Id" + }, + "input_messages": { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/UserMessage-Output" + }, + { + "$ref": "#/components/schemas/ToolResponseMessage-Output" + } + ] + }, + "type": "array", + "title": "Input Messages" + }, + "steps": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InferenceStep-Output" + }, + { + "$ref": "#/components/schemas/ToolExecutionStep-Output" + }, + { + "$ref": "#/components/schemas/ShieldCallStep-Output" + }, + { + "$ref": "#/components/schemas/MemoryRetrievalStep-Output" + } + ], + "discriminator": { + "propertyName": "step_type", + "mapping": { + "inference": "#/components/schemas/InferenceStep-Output", + "memory_retrieval": "#/components/schemas/MemoryRetrievalStep-Output", + "shield_call": "#/components/schemas/ShieldCallStep-Output", + "tool_execution": "#/components/schemas/ToolExecutionStep-Output" + } + } + }, + "type": "array", + "title": "Steps" + }, + "output_message": { + "$ref": "#/components/schemas/CompletionMessage-Output" + }, + "output_attachments": { + "title": "Output Attachments", + "items": { + "$ref": "#/components/schemas/Attachment-Output" + }, + "type": "array" + }, + "started_at": { + "type": "string", + "format": "date-time", + "title": "Started At" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + } + }, + "type": "object", + "required": [ + "turn_id", + "session_id", + "input_messages", + "steps", + "output_message", + "started_at" + ], + "title": "Turn", + "description": "A single turn in an interaction with an Agentic System." + }, + "URIDataSource": { + "properties": { + "type": { + "type": "string", + "const": "uri", + "title": "Type", + "default": "uri" + }, + "uri": { + "type": "string", + "title": "Uri" + } + }, + "type": "object", + "required": [ + "uri" + ], + "title": "URIDataSource", + "description": "A dataset that can be obtained from a URI." + }, + "URL": { + "properties": { + "uri": { + "type": "string", + "title": "Uri" + } + }, + "type": "object", + "required": [ + "uri" + ], + "title": "URL", + "description": "A URL reference to external content." + }, + "UserMessage-Input": { + "properties": { + "role": { + "type": "string", + "const": "user", + "title": "Role", + "default": "user" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "context": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Context" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "UserMessage", + "description": "A message from the user in a chat conversation." + }, + "UserMessage-Output": { + "properties": { + "role": { + "type": "string", + "const": "user", + "title": "Role", + "default": "user" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "context": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Context" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "UserMessage", + "description": "A message from the user in a chat conversation." + }, + "ViolationLevel": { + "type": "string", + "enum": [ + "info", + "warn", + "error" + ], + "title": "ViolationLevel", + "description": "Severity level of a safety violation." + }, + "_URLOrData": { + "properties": { + "url": { + "$ref": "#/components/schemas/URL" + }, + "data": { + "contentEncoding": "base64", + "title": "Data", + "type": "string" + } + }, + "type": "object", + "title": "_URLOrData", + "description": "A URL or a base64 encoded string" + }, + "__main_____agents_agent_id_session_Request": { + "properties": { + "agent_id": { + "type": "string", + "title": "Agent Id" + }, + "session_name": { + "type": "string", + "title": "Session Name" + } + }, + "type": "object", + "required": [ + "agent_id", + "session_name" + ], + "title": "_agents_agent_id_session_Request" + }, + "__main_____agents_agent_id_session_session_id_turn_Request": { + "properties": { + "agent_id": { + "type": "string", + "title": "Agent Id" + }, + "session_id": { + "type": "string", + "title": "Session Id" + }, + "messages": { + "$ref": "#/components/schemas/UserMessage-Input" + }, + "stream": { + "type": "boolean", + "title": "Stream", + "default": false + }, + "documents": { + "$ref": "#/components/schemas/Document" + }, + "toolgroups": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/AgentToolGroupWithArgs" + } + ], + "title": "Toolgroups" + }, + "tool_config": { + "$ref": "#/components/schemas/ToolConfig" + } + }, + "type": "object", + "required": [ + "agent_id", + "session_id", + "messages", + "documents", + "toolgroups", + "tool_config" + ], + "title": "_agents_agent_id_session_session_id_turn_Request" + }, + "__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request": { + "properties": { + "agent_id": { + "type": "string", + "title": "Agent Id" + }, + "session_id": { + "type": "string", + "title": "Session Id" + }, + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "tool_responses": { + "$ref": "#/components/schemas/ToolResponse-Input" + }, + "stream": { + "type": "boolean", + "title": "Stream", + "default": false + } + }, + "type": "object", + "required": [ + "agent_id", + "session_id", + "turn_id", + "tool_responses" + ], + "title": "_agents_agent_id_session_session_id_turn_turn_id_resume_Request" + }, + "__main_____datasets_Request": { + "properties": { + "purpose": { + "$ref": "#/components/schemas/DatasetPurpose" + }, + "metadata": { + "type": "string", + "title": "Metadata" + }, + "dataset_id": { + "type": "string", + "title": "Dataset Id" + } + }, + "type": "object", + "required": [ + "purpose", + "metadata", + "dataset_id" + ], + "title": "_datasets_Request" + }, + "_inference_rerank_Request": { + "properties": { + "model": { + "type": "string", + "title": "Model" + }, + "query": { + "type": "string", + "title": "Query" + }, + "items": { + "type": "string", + "title": "Items" + }, + "max_num_results": { + "type": "integer", + "title": "Max Num Results" + } + }, + "type": "object", + "required": [ + "model", + "query", + "items", + "max_num_results" + ], + "title": "_inference_rerank_Request" + }, + "Error": { + "description": "Error response from the API. Roughly follows RFC 7807.", + "properties": { + "status": { + "title": "Status", + "type": "integer" + }, + "title": { + "title": "Title", + "type": "string" + }, + "detail": { + "title": "Detail", + "type": "string" + }, + "instance": { + "title": "Instance", + "type": "string", + "nullable": true + } + }, + "required": [ + "status", + "title", + "detail" + ], + "title": "Error", + "type": "object" + }, + "Agent": { + "description": "An agent instance with configuration and metadata.", + "properties": { + "agent_id": { + "title": "Agent Id", + "type": "string" + }, + "agent_config": { + "$ref": "#/components/schemas/AgentConfig" + }, + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + } + }, + "required": [ + "agent_id", + "agent_config", + "created_at" + ], + "title": "Agent", + "type": "object" + }, + "AgentStepResponse": { + "description": "Response containing details of a specific agent step.", + "properties": { + "step": { + "discriminator": { + "mapping": { + "inference": "#/$defs/InferenceStep", + "memory_retrieval": "#/$defs/MemoryRetrievalStep", + "shield_call": "#/$defs/ShieldCallStep", + "tool_execution": "#/$defs/ToolExecutionStep" + }, + "propertyName": "step_type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/InferenceStep" + }, + { + "$ref": "#/components/schemas/ToolExecutionStep" + }, + { + "$ref": "#/components/schemas/ShieldCallStep" + }, + { + "$ref": "#/components/schemas/MemoryRetrievalStep" + } + ], + "title": "Step" + } + }, + "required": [ + "step" + ], + "title": "AgentStepResponse", + "type": "object" + }, + "CompletionMessage": { + "description": "A message containing the model's (assistant) response in a chat conversation.", + "properties": { + "role": { + "const": "assistant", + "default": "assistant", + "title": "Role", + "type": "string" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + { + "items": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + "type": "array" + } + ], + "title": "Content" + }, + "stop_reason": { + "$ref": "#/components/schemas/StopReason" + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/ToolCall" + }, + "type": "array" + } + }, + "required": [ + "content", + "stop_reason" + ], + "title": "CompletionMessage", + "type": "object" + }, + "InferenceStep": { + "description": "An inference step in an agent turn.", + "properties": { + "turn_id": { + "title": "Turn Id", + "type": "string" + }, + "step_id": { + "title": "Step Id", + "type": "string" + }, + "started_at": { + "title": "Started At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "completed_at": { + "title": "Completed At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "step_type": { + "const": "inference", + "default": "inference", + "title": "Step Type", + "type": "string" + }, + "model_response": { + "$ref": "#/components/schemas/CompletionMessage" + } + }, + "required": [ + "turn_id", + "step_id", + "model_response" + ], + "title": "InferenceStep", + "type": "object" + }, + "MemoryRetrievalStep": { + "description": "A memory retrieval step in an agent turn.", + "properties": { + "turn_id": { + "title": "Turn Id", + "type": "string" + }, + "step_id": { + "title": "Step Id", + "type": "string" + }, + "started_at": { + "title": "Started At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "completed_at": { + "title": "Completed At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "step_type": { + "const": "memory_retrieval", + "default": "memory_retrieval", + "title": "Step Type", + "type": "string" + }, + "vector_store_ids": { + "title": "Vector Store Ids", + "type": "string" + }, + "inserted_context": { + "anyOf": [ + { + "type": "string" + }, + { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + { + "items": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + "type": "array" + } + ], + "title": "Inserted Context" + } + }, + "required": [ + "turn_id", + "step_id", + "vector_store_ids", + "inserted_context" + ], + "title": "MemoryRetrievalStep", + "type": "object" + }, + "PaginatedResponse": { + "description": "A generic paginated response that follows a simple format.", + "properties": { + "data": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "url": { + "title": "Url", + "type": "string", + "nullable": true + } + }, + "required": [ + "data", + "has_more" + ], + "title": "PaginatedResponse", + "type": "object" + }, + "Session": { + "description": "A single session of an interaction with an Agentic System.", + "properties": { + "session_id": { + "title": "Session Id", + "type": "string" + }, + "session_name": { + "title": "Session Name", + "type": "string" + }, + "turns": { + "items": { + "$ref": "#/components/schemas/Turn" + }, + "title": "Turns", + "type": "array" + }, + "started_at": { + "format": "date-time", + "title": "Started At", + "type": "string" + } + }, + "required": [ + "session_id", + "session_name", + "turns", + "started_at" + ], + "title": "Session", + "type": "object" + }, + "ShieldCallStep": { + "description": "A shield call step in an agent turn.", + "properties": { + "turn_id": { + "title": "Turn Id", + "type": "string" + }, + "step_id": { + "title": "Step Id", + "type": "string" + }, + "started_at": { + "title": "Started At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "completed_at": { + "title": "Completed At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "step_type": { + "const": "shield_call", + "default": "shield_call", + "title": "Step Type", + "type": "string" + }, + "violation": { + "$ref": "#/components/schemas/SafetyViolation" + } + }, + "required": [ + "turn_id", + "step_id", + "violation" + ], + "title": "ShieldCallStep", + "type": "object" + }, + "ToolExecutionStep": { + "description": "A tool execution step in an agent turn.", + "properties": { + "turn_id": { + "title": "Turn Id", + "type": "string" + }, + "step_id": { + "title": "Step Id", + "type": "string" + }, + "started_at": { + "title": "Started At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "completed_at": { + "title": "Completed At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "step_type": { + "const": "tool_execution", + "default": "tool_execution", + "title": "Step Type", + "type": "string" + }, + "tool_calls": { + "items": { + "$ref": "#/components/schemas/ToolCall" + }, + "title": "Tool Calls", + "type": "array" + }, + "tool_responses": { + "items": { + "$ref": "#/components/schemas/ToolResponse" + }, + "title": "Tool Responses", + "type": "array" + } + }, + "required": [ + "turn_id", + "step_id", + "tool_calls", + "tool_responses" + ], + "title": "ToolExecutionStep", + "type": "object" + }, + "ToolResponse": { + "description": "Response from a tool invocation.", + "properties": { + "call_id": { + "title": "Call Id", + "type": "string" + }, + "tool_name": { + "anyOf": [ + { + "$ref": "#/components/schemas/BuiltinTool" + }, + { + "type": "string" + } + ], + "title": "Tool Name" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + { + "items": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + "type": "array" + } + ], + "title": "Content" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object", + "nullable": true + } + }, + "required": [ + "call_id", + "tool_name", + "content" + ], + "title": "ToolResponse", + "type": "object" + }, + "Checkpoint": { + "description": "Checkpoint created during training runs.", + "properties": { + "identifier": { + "title": "Identifier", + "type": "string" + }, + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "epoch": { + "title": "Epoch", + "type": "integer" + }, + "post_training_job_id": { + "title": "Post Training Job Id", + "type": "string" + }, + "path": { + "title": "Path", + "type": "string" + }, + "training_metrics": { + "$ref": "#/components/schemas/PostTrainingMetric", + "nullable": true + } + }, + "required": [ + "identifier", + "created_at", + "epoch", + "post_training_job_id", + "path" + ], + "title": "Checkpoint", + "type": "object" + }, + "PostTrainingJobArtifactsResponse": { + "description": "Artifacts of a finetuning job.", + "properties": { + "job_uuid": { + "title": "Job Uuid", + "type": "string" + }, + "checkpoints": { + "items": { + "$ref": "#/components/schemas/Checkpoint" + }, + "title": "Checkpoints", + "type": "array" + } + }, + "required": [ + "job_uuid" + ], + "title": "PostTrainingJobArtifactsResponse", + "type": "object" + }, + "PostTrainingJobStatusResponse": { + "description": "Status of a finetuning job.", + "properties": { + "job_uuid": { + "title": "Job Uuid", + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/JobStatus" + }, + "scheduled_at": { + "title": "Scheduled At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "started_at": { + "title": "Started At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "completed_at": { + "title": "Completed At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "resources_allocated": { + "title": "Resources Allocated", + "additionalProperties": true, + "type": "object", + "nullable": true + }, + "checkpoints": { + "items": { + "$ref": "#/components/schemas/Checkpoint" + }, + "title": "Checkpoints", + "type": "array" + } + }, + "required": [ + "job_uuid", + "status" + ], + "title": "PostTrainingJobStatusResponse", + "type": "object" + }, + "ImageContentItem": { + "description": "A image content item", + "properties": { + "type": { + "const": "image", + "default": "image", + "title": "Type", + "type": "string" + }, + "image": { + "$ref": "#/components/schemas/_URLOrData" + } + }, + "required": [ + "image" + ], + "title": "ImageContentItem", + "type": "object" + }, + "PostTrainingMetric": { + "description": "Training metrics captured during post-training jobs.", + "properties": { + "epoch": { + "title": "Epoch", + "type": "integer" + }, + "train_loss": { + "title": "Train Loss", + "type": "number" + }, + "validation_loss": { + "title": "Validation Loss", + "type": "number" + }, + "perplexity": { + "title": "Perplexity", + "type": "number" + } + }, + "required": [ + "epoch", + "train_loss", + "validation_loss", + "perplexity" + ], + "title": "PostTrainingMetric", + "type": "object" + } + }, + "responses": { + "BadRequest400": { + "description": "The request was invalid or malformed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "status": 400, + "title": "Bad Request", + "detail": "The request was invalid or malformed" + } + } + } + }, + "TooManyRequests429": { + "description": "The client has sent too many requests in a given amount of time", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "status": 429, + "title": "Too Many Requests", + "detail": "You have exceeded the rate limit. Please try again later." + } + } + } + }, + "InternalServerError500": { + "description": "The server encountered an unexpected error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "status": 500, + "title": "Internal Server Error", + "detail": "An unexpected error occurred. Our team has been notified." + } + } + } + }, + "DefaultError": { + "description": "An unexpected error occurred", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/docs/static/experimental-llama-stack-spec.yaml b/docs/static/experimental-llama-stack-spec.yaml index 204cc9e02d..cd7cbdb23c 100644 --- a/docs/static/experimental-llama-stack-spec.yaml +++ b/docs/static/experimental-llama-stack-spec.yaml @@ -13,7 +13,7 @@ paths: post: tags: - V1Beta - summary: Append Rows + summary: Append rows to a dataset. description: Generic endpoint - this would be replaced with actual implementation. operationId: append_rows_v1beta_datasetio_append_rows__dataset_id__post parameters: @@ -55,16 +55,10 @@ paths: get: tags: - V1Beta - summary: Iterrows + summary: Get a paginated list of rows from a dataset. description: Query endpoint for proper schema generation. operationId: iterrows_v1beta_datasetio_iterrows__dataset_id__get parameters: - - name: dataset_id - in: path - required: true - schema: - type: string - title: Dataset Id - name: limit in: query required: true @@ -77,6 +71,12 @@ paths: schema: type: integer title: Start Index + - name: dataset_id + in: path + required: true + schema: + type: string + title: Dataset Id responses: '200': description: A PaginatedResponse. @@ -100,7 +100,7 @@ paths: get: tags: - V1Beta - summary: List Datasets + summary: List all datasets. description: Response-only endpoint for proper schema generation. operationId: list_datasets_v1beta_datasets_get responses: @@ -125,7 +125,7 @@ paths: post: tags: - V1Beta - summary: Register Dataset + summary: Register a new dataset. description: Typed endpoint for proper schema generation. operationId: register_dataset_v1beta_datasets_post requestBody: @@ -157,7 +157,7 @@ paths: delete: tags: - V1Beta - summary: Unregister Dataset + summary: Unregister a dataset by its ID. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_dataset_v1beta_datasets__dataset_id__delete parameters: @@ -198,7 +198,7 @@ paths: get: tags: - V1Beta - summary: Get Dataset + summary: Get a dataset by its ID. description: Query endpoint for proper schema generation. operationId: get_dataset_v1beta_datasets__dataset_id__get parameters: @@ -231,7 +231,7 @@ paths: get: tags: - V1Alpha - summary: List Agents + summary: List all agents. description: Query endpoint for proper schema generation. operationId: list_agents_v1alpha_agents_get parameters: @@ -269,7 +269,7 @@ paths: post: tags: - V1Alpha - summary: Create Agent + summary: Create an agent with the given configuration. description: Typed endpoint for proper schema generation. operationId: create_agent_v1alpha_agents_post requestBody: @@ -301,7 +301,7 @@ paths: delete: tags: - V1Alpha - summary: Delete Agent + summary: Delete an agent by its ID and its associated sessions and turns. description: Generic endpoint - this would be replaced with actual implementation. operationId: delete_agent_v1alpha_agents__agent_id__delete parameters: @@ -320,7 +320,7 @@ paths: required: true schema: type: string - description: 'Path parameter: agent_id' + description: The ID of the agent to delete. responses: '200': description: Successful Response @@ -342,7 +342,7 @@ paths: get: tags: - V1Alpha - summary: Get Agent + summary: Describe an agent by its ID. description: Query endpoint for proper schema generation. operationId: get_agent_v1alpha_agents__agent_id__get parameters: @@ -352,6 +352,7 @@ paths: schema: type: string title: Agent Id + description: ID of the agent. responses: '200': description: An Agent of the agent. @@ -375,7 +376,7 @@ paths: post: tags: - V1Alpha - summary: Create Agent Session + summary: Create a new session for an agent. description: Typed endpoint for proper schema generation. operationId: create_agent_session_v1alpha_agents__agent_id__session_post requestBody: @@ -409,12 +410,12 @@ paths: required: true schema: type: string - description: 'Path parameter: agent_id' + description: The ID of the agent to create the session for. /v1alpha/agents/{agent_id}/session/{session_id}: delete: tags: - V1Alpha - summary: Delete Agents Session + summary: Delete an agent session by its ID and its associated turns. description: Generic endpoint - this would be replaced with actual implementation. operationId: delete_agents_session_v1alpha_agents__agent_id__session__session_id__delete parameters: @@ -428,18 +429,18 @@ paths: required: true schema: title: Kwargs - - name: agent_id + - name: session_id in: path required: true schema: type: string - description: 'Path parameter: agent_id' - - name: session_id + description: The ID of the session to delete. + - name: agent_id in: path required: true schema: type: string - description: 'Path parameter: session_id' + description: The ID of the agent to delete the session for. responses: '200': description: Successful Response @@ -461,28 +462,30 @@ paths: get: tags: - V1Alpha - summary: Get Agents Session + summary: Retrieve an agent session by its ID. description: Query endpoint for proper schema generation. operationId: get_agents_session_v1alpha_agents__agent_id__session__session_id__get parameters: - - name: agent_id - in: path + - name: turn_ids + in: query required: true schema: type: string - title: Agent Id + title: Turn Ids - name: session_id in: path required: true schema: type: string title: Session Id - - name: turn_ids - in: query + description: The ID of the session to get. + - name: agent_id + in: path required: true schema: type: string - title: Turn Ids + title: Agent Id + description: The ID of the agent to get the session for. responses: '200': description: A Session. @@ -506,7 +509,7 @@ paths: post: tags: - V1Alpha - summary: Create Agent Turn + summary: Create a new turn for an agent. description: Typed endpoint for proper schema generation. operationId: create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post requestBody: @@ -540,18 +543,18 @@ paths: required: true schema: type: string - description: 'Path parameter: agent_id' + description: The ID of the agent to create the turn for. - name: session_id in: path required: true schema: type: string - description: 'Path parameter: session_id' + description: The ID of the session to create the turn for. /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}: get: tags: - V1Alpha - summary: Get Agents Turn + summary: Retrieve an agent turn by its ID. description: Query endpoint for proper schema generation. operationId: get_agents_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__get parameters: @@ -561,18 +564,21 @@ paths: schema: type: string title: Agent Id + description: The ID of the agent to get the turn for. - name: session_id in: path required: true schema: type: string title: Session Id + description: The ID of the session to get the turn for. - name: turn_id in: path required: true schema: type: string title: Turn Id + description: The ID of the turn to get. responses: '200': description: A Turn. @@ -596,7 +602,7 @@ paths: post: tags: - V1Alpha - summary: Resume Agent Turn + summary: Resume an agent turn with executed tool call responses. description: Typed endpoint for proper schema generation. operationId: resume_agent_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__resume_post requestBody: @@ -631,24 +637,24 @@ paths: required: true schema: type: string - description: 'Path parameter: agent_id' + description: The ID of the agent to resume. - name: session_id in: path required: true schema: type: string - description: 'Path parameter: session_id' + description: The ID of the session to resume. - name: turn_id in: path required: true schema: type: string - description: 'Path parameter: turn_id' + description: The ID of the turn to resume. /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}: get: tags: - V1Alpha - summary: Get Agents Step + summary: Retrieve an agent step by its ID. description: Query endpoint for proper schema generation. operationId: get_agents_step_v1alpha_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get parameters: @@ -658,24 +664,28 @@ paths: schema: type: string title: Agent Id + description: The ID of the agent to get the step for. - name: session_id in: path required: true schema: type: string title: Session Id - - name: step_id + description: The ID of the session to get the step for. + - name: turn_id in: path required: true schema: type: string - title: Step Id - - name: turn_id + title: Turn Id + description: The ID of the turn to get the step for. + - name: step_id in: path required: true schema: type: string - title: Turn Id + title: Step Id + description: The ID of the step to get. responses: '200': description: An AgentStepResponse. @@ -699,16 +709,10 @@ paths: get: tags: - V1Alpha - summary: List Agent Sessions + summary: List all session(s) of a given agent. description: Query endpoint for proper schema generation. operationId: list_agent_sessions_v1alpha_agents__agent_id__sessions_get parameters: - - name: agent_id - in: path - required: true - schema: - type: string - title: Agent Id - name: limit in: query required: true @@ -721,6 +725,13 @@ paths: schema: type: integer title: Start Index + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + description: The ID of the agent to list sessions for. responses: '200': description: A PaginatedResponse. @@ -744,7 +755,7 @@ paths: get: tags: - V1Alpha - summary: List Benchmarks + summary: List all benchmarks. description: Response-only endpoint for proper schema generation. operationId: list_benchmarks_v1alpha_eval_benchmarks_get responses: @@ -769,7 +780,7 @@ paths: post: tags: - V1Alpha - summary: Register Benchmark + summary: Register a benchmark. description: Generic endpoint - this would be replaced with actual implementation. operationId: register_benchmark_v1alpha_eval_benchmarks_post parameters: @@ -805,7 +816,7 @@ paths: delete: tags: - V1Alpha - summary: Unregister Benchmark + summary: Unregister a benchmark. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_benchmark_v1alpha_eval_benchmarks__benchmark_id__delete parameters: @@ -824,7 +835,7 @@ paths: required: true schema: type: string - description: 'Path parameter: benchmark_id' + description: The ID of the benchmark to unregister. responses: '200': description: Successful Response @@ -846,7 +857,7 @@ paths: get: tags: - V1Alpha - summary: Get Benchmark + summary: Get a benchmark by its ID. description: Query endpoint for proper schema generation. operationId: get_benchmark_v1alpha_eval_benchmarks__benchmark_id__get parameters: @@ -856,6 +867,7 @@ paths: schema: type: string title: Benchmark Id + description: The ID of the benchmark to get. responses: '200': description: A Benchmark. @@ -879,7 +891,7 @@ paths: post: tags: - V1Alpha - summary: Evaluate Rows + summary: Evaluate a list of rows on a benchmark. description: Typed endpoint for proper schema generation. operationId: evaluate_rows_v1alpha_eval_benchmarks__benchmark_id__evaluations_post requestBody: @@ -913,12 +925,12 @@ paths: required: true schema: type: string - description: 'Path parameter: benchmark_id' + description: The ID of the benchmark to run the evaluation on. /v1alpha/eval/benchmarks/{benchmark_id}/jobs: post: tags: - V1Alpha - summary: Run Eval + summary: Run an evaluation on a benchmark. description: Typed endpoint for proper schema generation. operationId: run_eval_v1alpha_eval_benchmarks__benchmark_id__jobs_post requestBody: @@ -952,12 +964,12 @@ paths: required: true schema: type: string - description: 'Path parameter: benchmark_id' + description: The ID of the benchmark to run the evaluation on. /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}: delete: tags: - V1Alpha - summary: Job Cancel + summary: Cancel a job. description: Generic endpoint - this would be replaced with actual implementation. operationId: job_cancel_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__delete parameters: @@ -976,13 +988,13 @@ paths: required: true schema: type: string - description: 'Path parameter: benchmark_id' + description: The ID of the benchmark to run the evaluation on. - name: job_id in: path required: true schema: type: string - description: 'Path parameter: job_id' + description: The ID of the job to cancel. responses: '200': description: Successful Response @@ -1004,7 +1016,7 @@ paths: get: tags: - V1Alpha - summary: Job Status + summary: Get the status of a job. description: Query endpoint for proper schema generation. operationId: job_status_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__get parameters: @@ -1014,12 +1026,14 @@ paths: schema: type: string title: Benchmark Id + description: The ID of the benchmark to run the evaluation on. - name: job_id in: path required: true schema: type: string title: Job Id + description: The ID of the job to get the status of. responses: '200': description: The status of the evaluation job. @@ -1043,7 +1057,7 @@ paths: get: tags: - V1Alpha - summary: Job Result + summary: Get the result of a job. description: Query endpoint for proper schema generation. operationId: job_result_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__result_get parameters: @@ -1053,12 +1067,14 @@ paths: schema: type: string title: Benchmark Id + description: The ID of the benchmark to run the evaluation on. - name: job_id in: path required: true schema: type: string title: Job Id + description: The ID of the job to get the result of. responses: '200': description: The result of the job. @@ -1082,7 +1098,7 @@ paths: post: tags: - V1Alpha - summary: Rerank + summary: Rerank a list of documents based on their relevance to a query. description: Typed endpoint for proper schema generation. operationId: rerank_v1alpha_inference_rerank_post requestBody: @@ -1114,7 +1130,7 @@ paths: get: tags: - V1Alpha - summary: Get Training Job Artifacts + summary: Get the artifacts of a training job. description: Query endpoint for proper schema generation. operationId: get_training_job_artifacts_v1alpha_post_training_job_artifacts_get parameters: @@ -1147,7 +1163,7 @@ paths: post: tags: - V1Alpha - summary: Cancel Training Job + summary: Cancel a training job. description: Generic endpoint - this would be replaced with actual implementation. operationId: cancel_training_job_v1alpha_post_training_job_cancel_post parameters: @@ -1183,7 +1199,7 @@ paths: get: tags: - V1Alpha - summary: Get Training Job Status + summary: Get the status of a training job. description: Query endpoint for proper schema generation. operationId: get_training_job_status_v1alpha_post_training_job_status_get parameters: @@ -1216,7 +1232,7 @@ paths: get: tags: - V1Alpha - summary: Get Training Jobs + summary: Get all training jobs. description: Response-only endpoint for proper schema generation. operationId: get_training_jobs_v1alpha_post_training_jobs_get responses: @@ -1242,7 +1258,7 @@ paths: post: tags: - V1Alpha - summary: Preference Optimize + summary: Run preference optimization of a model. description: Typed endpoint for proper schema generation. operationId: preference_optimize_v1alpha_post_training_preference_optimize_post requestBody: @@ -1274,7 +1290,7 @@ paths: post: tags: - V1Alpha - summary: Supervised Fine Tune + summary: Run supervised fine-tuning of a model. description: Typed endpoint for proper schema generation. operationId: supervised_fine_tune_v1alpha_post_training_supervised_fine_tune_post requestBody: @@ -1317,10 +1333,7 @@ components: required: - config title: AgentCandidate - description: 'An agent candidate for evaluation. - - - :param config: The configuration for the agent candidate.' + description: An agent candidate for evaluation. AgentConfig: properties: sampling_params: @@ -1387,19 +1400,7 @@ components: - model - instructions title: AgentConfig - description: 'Configuration for an agent. - - - :param model: The model identifier to use for the agent - - :param instructions: The system instructions for the agent - - :param name: Optional name for the agent, used in telemetry and identification - - :param enable_session_persistence: Optional flag indicating whether session - data has to be persisted - - :param response_format: Optional response format configuration' + description: Configuration for an agent. AgentCreateResponse: properties: agent_id: @@ -1409,10 +1410,7 @@ components: required: - agent_id title: AgentCreateResponse - description: 'Response returned when creating a new agent. - - - :param agent_id: Unique identifier for the created agent' + description: Response returned when creating a new agent. AgentSessionCreateResponse: properties: session_id: @@ -1422,10 +1420,7 @@ components: required: - session_id title: AgentSessionCreateResponse - description: 'Response returned when creating a new agent session. - - - :param session_id: Unique identifier for the created session' + description: Response returned when creating a new agent session. AgentToolGroupWithArgs: properties: name: @@ -1449,17 +1444,7 @@ components: - categorical_count - accuracy title: AggregationFunctionType - description: 'Types of aggregation functions for scoring results. - - :cvar average: Calculate the arithmetic mean of scores - - :cvar weighted_average: Calculate a weighted average of scores - - :cvar median: Calculate the median value of scores - - :cvar categorical_count: Count occurrences of categorical values - - :cvar accuracy: Calculate accuracy as the proportion of correct answers' + description: Types of aggregation functions for scoring results. Attachment-Output: properties: content: @@ -1493,12 +1478,7 @@ components: - content - mime_type title: Attachment - description: 'An attachment to an agent turn. - - - :param content: The content of the attachment. - - :param mime_type: The MIME type of the attachment.' + description: An attachment to an agent turn. BasicScoringFnParams: properties: type: @@ -1514,12 +1494,7 @@ components: description: Aggregation functions to apply to the scores of each row type: object title: BasicScoringFnParams - description: 'Parameters for basic scoring function configuration. - - :param type: The type of scoring function parameters, always basic - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row' + description: Parameters for basic scoring function configuration. Benchmark: properties: identifier: @@ -1559,17 +1534,7 @@ components: - dataset_id - scoring_functions title: Benchmark - description: 'A benchmark resource for evaluating model performance. - - - :param dataset_id: Identifier of the dataset to use for the benchmark evaluation - - :param scoring_functions: List of scoring function identifiers to apply during - evaluation - - :param metadata: Metadata for this evaluation task - - :param type: The resource type, always benchmark' + description: A benchmark resource for evaluating model performance. BenchmarkConfig: properties: eval_candidate: @@ -1607,16 +1572,7 @@ components: required: - eval_candidate title: BenchmarkConfig - description: 'A benchmark configuration for evaluation. - - - :param eval_candidate: The candidate to evaluate. - - :param scoring_params: Map between scoring function id and parameters for - each scoring function you want to run - - :param num_examples: (Optional) The number of examples to evaluate. If not - provided, all examples in the dataset will be evaluated' + description: A benchmark configuration for evaluation. BuiltinTool: type: string enum: @@ -1666,16 +1622,8 @@ components: - content - stop_reason title: CompletionMessage - description: "A message containing the model's (assistant) response in a chat\ - \ conversation.\n\n:param role: Must be \"assistant\" to identify this as\ - \ the model's response\n:param content: The content of the model's response\n\ - :param stop_reason: Reason why the model stopped generating. Options are:\n\ - \ - `StopReason.end_of_turn`: The model finished generating the entire\ - \ response.\n - `StopReason.end_of_message`: The model finished generating\ - \ but generated a partial response -- usually, a tool call. The user may call\ - \ the tool and continue the conversation with the tool's response.\n -\ - \ `StopReason.out_of_tokens`: The model ran out of token budget.\n:param tool_calls:\ - \ List of tool calls. Each tool call is a ToolCall object." + description: A message containing the model's (assistant) response in a chat + conversation. DPOAlignmentConfig: properties: beta: @@ -1688,12 +1636,7 @@ components: required: - beta title: DPOAlignmentConfig - description: 'Configuration for Direct Preference Optimization (DPO) alignment. - - - :param beta: Temperature parameter for the DPO loss - - :param loss_type: The type of loss function to use for DPO' + description: Configuration for Direct Preference Optimization (DPO) alignment. DPOLossType: type: string enum: @@ -1733,25 +1676,7 @@ components: - shuffle - data_format title: DataConfig - description: 'Configuration for training data and data loading. - - - :param dataset_id: Unique identifier for the training dataset - - :param batch_size: Number of samples per training batch - - :param shuffle: Whether to shuffle the dataset during training - - :param data_format: Format of the dataset (instruct or dialog) - - :param validation_dataset_id: (Optional) Unique identifier for the validation - dataset - - :param packed: (Optional) Whether to pack multiple samples into a single sequence - for efficiency - - :param train_on_input: (Optional) Whether to compute loss on input tokens - as well as output tokens' + description: Configuration for training data and data loading. Dataset: properties: identifier: @@ -1795,22 +1720,15 @@ components: - purpose - source title: Dataset - description: 'Dataset resource for storing and accessing training or evaluation + description: Dataset resource for storing and accessing training or evaluation data. - - - :param type: Type of resource, always ''dataset'' for datasets' DatasetFormat: type: string enum: - instruct - dialog title: DatasetFormat - description: 'Format of the training dataset. - - :cvar instruct: Instruction-following format with prompt and completion - - :cvar dialog: Multi-turn conversation format with messages' + description: Format of the training dataset. DatasetPurpose: type: string enum: @@ -1818,20 +1736,8 @@ components: - eval/question-answer - eval/messages-answer title: DatasetPurpose - description: "Purpose of the dataset. Each purpose has a required input data\ - \ schema.\n\n:cvar post-training/messages: The dataset contains messages used\ - \ for post-training.\n {\n \"messages\": [\n {\"role\"\ - : \"user\", \"content\": \"Hello, world!\"},\n {\"role\": \"assistant\"\ - , \"content\": \"Hello, world!\"},\n ]\n }\n:cvar eval/question-answer:\ - \ The dataset contains a question column and an answer column.\n {\n \ - \ \"question\": \"What is the capital of France?\",\n \"answer\"\ - : \"Paris\"\n }\n:cvar eval/messages-answer: The dataset contains a messages\ - \ column with list of messages and an answer column.\n {\n \"messages\"\ - : [\n {\"role\": \"user\", \"content\": \"Hello, my name is John\ - \ Doe.\"},\n {\"role\": \"assistant\", \"content\": \"Hello, John\ - \ Doe. How can I help you today?\"},\n {\"role\": \"user\", \"\ - content\": \"What's my name?\"},\n ],\n \"answer\": \"John Doe\"\ - \n }" + description: Purpose of the dataset. Each purpose has a required input data + schema. Document: properties: content: @@ -1865,12 +1771,7 @@ components: - content - mime_type title: Document - description: 'A document to be used by an agent. - - - :param content: The content of the document. - - :param mime_type: The MIME type of the document.' + description: A document to be used by an agent. EfficiencyConfig: properties: enable_activation_checkpointing: @@ -1891,20 +1792,7 @@ components: type: boolean type: object title: EfficiencyConfig - description: 'Configuration for memory and compute efficiency optimizations. - - - :param enable_activation_checkpointing: (Optional) Whether to use activation - checkpointing to reduce memory usage - - :param enable_activation_offloading: (Optional) Whether to offload activations - to CPU to save GPU memory - - :param memory_efficient_fsdp_wrap: (Optional) Whether to use memory-efficient - FSDP wrapping - - :param fsdp_cpu_offload: (Optional) Whether to offload FSDP parameters to - CPU' + description: Configuration for memory and compute efficiency optimizations. EvaluateResponse: properties: generations: @@ -1923,12 +1811,7 @@ components: - generations - scores title: EvaluateResponse - description: 'The response from an evaluation. - - - :param generations: The generations from the evaluation. - - :param scores: The scores from the evaluation.' + description: The response from an evaluation. GrammarResponseFormat: properties: type: @@ -1944,12 +1827,7 @@ components: required: - bnf title: GrammarResponseFormat - description: 'Configuration for grammar-guided response generation. - - - :param type: Must be "grammar" to identify this format type - - :param bnf: The BNF grammar specification the response should conform to' + description: Configuration for grammar-guided response generation. GreedySamplingStrategy: properties: type: @@ -1959,11 +1837,8 @@ components: default: greedy type: object title: GreedySamplingStrategy - description: 'Greedy sampling strategy that selects the highest probability - token at each step. - - - :param type: Must be "greedy" to identify this sampling strategy' + description: Greedy sampling strategy that selects the highest probability token + at each step. ImageContentItem-Input: properties: type: @@ -1977,12 +1852,7 @@ components: required: - image title: ImageContentItem - description: 'A image content item - - - :param type: Discriminator type of the content item. Always "image" - - :param image: Image as a base64 encoded string or an URL' + description: A image content item ImageContentItem-Output: properties: type: @@ -1996,12 +1866,7 @@ components: required: - image title: ImageContentItem - description: 'A image content item - - - :param type: Discriminator type of the content item. Always "image" - - :param image: Image as a base64 encoded string or an URL' + description: A image content item InferenceStep-Output: properties: turn_id: @@ -2031,10 +1896,7 @@ components: - step_id - model_response title: InferenceStep - description: 'An inference step in an agent turn. - - - :param model_response: The response from the LLM.' + description: An inference step in an agent turn. Job: properties: job_id: @@ -2047,12 +1909,7 @@ components: - job_id - status title: Job - description: 'A job execution instance with status tracking. - - - :param job_id: Unique identifier for the job - - :param status: Current execution status of the job' + description: A job execution instance with status tracking. JobStatus: type: string enum: @@ -2062,17 +1919,7 @@ components: - scheduled - cancelled title: JobStatus - description: 'Status of a job execution. - - :cvar completed: Job has finished successfully - - :cvar in_progress: Job is currently running - - :cvar failed: Job has failed during execution - - :cvar scheduled: Job is scheduled but not yet started - - :cvar cancelled: Job was cancelled before completion' + description: Status of a job execution. JsonSchemaResponseFormat: properties: type: @@ -2088,13 +1935,7 @@ components: required: - json_schema title: JsonSchemaResponseFormat - description: 'Configuration for JSON schema-guided response generation. - - - :param type: Must be "json_schema" to identify this format type - - :param json_schema: The JSON schema the response should conform to. In a Python - SDK, this is often a `pydantic` model.' + description: Configuration for JSON schema-guided response generation. LLMAsJudgeScoringFnParams: properties: type: @@ -2124,18 +1965,7 @@ components: required: - judge_model title: LLMAsJudgeScoringFnParams - description: 'Parameters for LLM-as-judge scoring function configuration. - - :param type: The type of scoring function parameters, always llm_as_judge - - :param judge_model: Identifier of the LLM model to use as a judge for scoring - - :param prompt_template: (Optional) Custom prompt template for the judge model - - :param judge_score_regexes: Regexes to extract the answer from generated response - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row' + description: Parameters for LLM-as-judge scoring function configuration. ListBenchmarksResponse: properties: data: @@ -2158,10 +1988,7 @@ components: required: - data title: ListDatasetsResponse - description: 'Response from listing datasets. - - - :param data: List of datasets' + description: Response from listing datasets. ListPostTrainingJobsResponse: properties: data: @@ -2226,13 +2053,7 @@ components: - vector_store_ids - inserted_context title: MemoryRetrievalStep - description: 'A memory retrieval step in an agent turn. - - - :param vector_store_ids: The IDs of the vector databases to retrieve context - from. - - :param inserted_context: The context retrieved from the vector databases.' + description: A memory retrieval step in an agent turn. ModelCandidate: properties: type: @@ -2252,15 +2073,7 @@ components: - model - sampling_params title: ModelCandidate - description: 'A model candidate for evaluation. - - - :param model: The model ID to evaluate. - - :param sampling_params: The sampling parameters for the model. - - :param system_message: (Optional) The system message providing instructions - or context to the model.' + description: A model candidate for evaluation. OptimizerConfig: properties: optimizer_type: @@ -2281,16 +2094,7 @@ components: - weight_decay - num_warmup_steps title: OptimizerConfig - description: 'Configuration parameters for the optimization algorithm. - - - :param optimizer_type: Type of optimizer to use (adam, adamw, or sgd) - - :param lr: Learning rate for the optimizer - - :param weight_decay: Weight decay coefficient for regularization - - :param num_warmup_steps: Number of steps for learning rate warmup' + description: Configuration parameters for the optimization algorithm. OptimizerType: type: string enum: @@ -2298,13 +2102,7 @@ components: - adamw - sgd title: OptimizerType - description: 'Available optimizer algorithms for training. - - :cvar adam: Adaptive Moment Estimation optimizer - - :cvar adamw: AdamW optimizer with weight decay - - :cvar sgd: Stochastic Gradient Descent optimizer' + description: Available optimizer algorithms for training. PostTrainingJob: properties: job_uuid: @@ -2335,14 +2133,7 @@ components: description: Aggregation functions to apply to the scores of each row type: object title: RegexParserScoringFnParams - description: 'Parameters for regex parser scoring function configuration. - - :param type: The type of scoring function parameters, always regex_parser - - :param parsing_regexes: Regex to extract the answer from generated response - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row' + description: Parameters for regex parser scoring function configuration. RerankData: properties: index: @@ -2356,13 +2147,7 @@ components: - index - relevance_score title: RerankData - description: 'A single rerank result from a reranking response. - - - :param index: The original index of the document in the input list - - :param relevance_score: The relevance score from the model output. Values - are inverted when applicable so that higher scores indicate greater relevance.' + description: A single rerank result from a reranking response. RerankResponse: properties: data: @@ -2374,10 +2159,7 @@ components: required: - data title: RerankResponse - description: 'Response from a reranking request. - - - :param data: List of rerank result objects, sorted by relevance score (descending)' + description: Response from a reranking request. RowsDataSource: properties: type: @@ -2395,10 +2177,7 @@ components: required: - rows title: RowsDataSource - description: "A dataset stored in rows.\n:param rows: The dataset is stored\ - \ in rows. E.g.\n - [\n {\"messages\": [{\"role\": \"user\", \"\ - content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello,\ - \ world!\"}]}\n ]" + description: A dataset stored in rows. SafetyViolation: properties: violation_level: @@ -2414,15 +2193,7 @@ components: required: - violation_level title: SafetyViolation - description: 'Details of a safety violation detected by content moderation. - - - :param violation_level: Severity level of the violation - - :param user_message: (Optional) Message to convey to the user about the violation - - :param metadata: Additional metadata including specific violation codes for - debugging and telemetry' + description: Details of a safety violation detected by content moderation. SamplingParams: properties: strategy: @@ -2451,14 +2222,7 @@ components: type: array type: object title: SamplingParams - description: "Sampling parameters.\n\n:param strategy: The sampling strategy.\n\ - :param max_tokens: The maximum number of tokens that can be generated in the\ - \ completion. The token count of\n your prompt plus max_tokens cannot exceed\ - \ the model's context length.\n:param repetition_penalty: Number between -2.0\ - \ and 2.0. Positive values penalize new tokens\n based on whether they\ - \ appear in the text so far, increasing the model's likelihood to talk about\ - \ new topics.\n:param stop: Up to 4 sequences where the API will stop generating\ - \ further tokens.\n The returned text will not contain the stop sequence." + description: Sampling parameters. ScoringResult: properties: score_rows: @@ -2476,13 +2240,7 @@ components: - score_rows - aggregated_results title: ScoringResult - description: 'A scoring result for a single row. - - - :param score_rows: The scoring result for each row. Each row is a map of column - name to value. - - :param aggregated_results: Map of metric name to aggregated value' + description: A scoring result for a single row. ShieldCallStep-Output: properties: turn_id: @@ -2512,10 +2270,7 @@ components: - step_id - violation title: ShieldCallStep - description: 'A shield call step in an agent turn. - - - :param violation: The violation from the shield call.' + description: A shield call step in an agent turn. StopReason: type: string enum: @@ -2556,26 +2311,14 @@ components: required: - content title: SystemMessage - description: 'A system message providing instructions or context to the model. - - - :param role: Must be "system" to identify this as a system message - - :param content: The content of the "system prompt". If multiple system messages - are provided, they are concatenated. The underlying Llama Stack code may also - add other system messages (for example, for formatting tool definitions).' + description: A system message providing instructions or context to the model. SystemMessageBehavior: type: string enum: - append - replace title: SystemMessageBehavior - description: "Config for how to override the default system prompt.\n\n:cvar\ - \ append: Appends the provided system message to the default system prompt:\n\ - \ https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt-\n\ - :cvar replace: Replaces the default system prompt with the provided system\ - \ message. The system message can include the string\n '{{function_definitions}}'\ - \ to indicate where the function definitions should be inserted." + description: Config for how to override the default system prompt. TextContentItem: properties: type: @@ -2590,12 +2333,7 @@ components: required: - text title: TextContentItem - description: 'A text content item - - - :param type: Discriminator type of the content item. Always "text" - - :param text: Text content' + description: A text content item ToolCall: properties: call_id: @@ -2622,16 +2360,9 @@ components: - required - none title: ToolChoice - description: 'Whether tool use is required or automatic. This is a hint to the + description: Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model. - - - :cvar auto: The model may use tools if it determines that is appropriate. - - :cvar required: The model must use tools. - - :cvar none: The model must not use tools.' ToolConfig: properties: tool_choice: @@ -2647,21 +2378,7 @@ components: $ref: '#/components/schemas/SystemMessageBehavior' type: object title: ToolConfig - description: "Configuration for tool use.\n\n:param tool_choice: (Optional)\ - \ Whether tool use is automatic, required, or none. Can also specify a tool\ - \ name to use a specific tool. Defaults to ToolChoice.auto.\n:param tool_prompt_format:\ - \ (Optional) Instructs the model how to format tool calls. By default, Llama\ - \ Stack will attempt to use a format that is best adapted to the model.\n\ - \ - `ToolPromptFormat.json`: The tool calls are formatted as a JSON object.\n\ - \ - `ToolPromptFormat.function_tag`: The tool calls are enclosed in a \ - \ tag.\n - `ToolPromptFormat.python_list`: The tool calls are output as\ - \ Python syntax -- a list of function calls.\n:param system_message_behavior:\ - \ (Optional) Config for how to override the default system prompt.\n -\ - \ `SystemMessageBehavior.append`: Appends the provided system message to the\ - \ default system prompt.\n - `SystemMessageBehavior.replace`: Replaces\ - \ the default system prompt with the provided system message. The system message\ - \ can include the string\n '{{function_definitions}}' to indicate where\ - \ the function definitions should be inserted." + description: Configuration for tool use. ToolDef: properties: toolgroup_id: @@ -2689,21 +2406,7 @@ components: required: - name title: ToolDef - description: 'Tool definition used in runtime contexts. - - - :param name: Name of the tool - - :param description: (Optional) Human-readable description of what the tool - does - - :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) - - :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) - - :param metadata: (Optional) Additional metadata about the tool - - :param toolgroup_id: (Optional) ID of the tool group this tool belongs to' + description: Tool definition used in runtime contexts. ToolExecutionStep-Output: properties: turn_id: @@ -2742,12 +2445,7 @@ components: - tool_calls - tool_responses title: ToolExecutionStep - description: 'A tool execution step in an agent turn. - - - :param tool_calls: The tool calls to execute. - - :param tool_responses: The tool responses from the tool calls.' + description: A tool execution step in an agent turn. ToolPromptFormat: type: string enum: @@ -2755,16 +2453,7 @@ components: - function_tag - python_list title: ToolPromptFormat - description: "Prompt format for calling custom / zero shot tools.\n\n:cvar json:\ - \ JSON format for calling tools. It takes the form:\n {\n \"type\"\ - : \"function\",\n \"function\" : {\n \"name\": \"function_name\"\ - ,\n \"description\": \"function_description\",\n \"\ - parameters\": {...}\n }\n }\n:cvar function_tag: Function tag format,\ - \ pseudo-XML. This looks like:\n (parameters)\n\ - \n:cvar python_list: Python list. The output is a valid Python expression\ - \ that can be\n evaluated to a list. Each element in the list is a function\ - \ call. Example:\n [\"function_name(param1, param2)\", \"function_name(param1,\ - \ param2)\"]" + description: Prompt format for calling custom / zero shot tools. ToolResponse-Input: properties: call_id: @@ -2807,16 +2496,7 @@ components: - tool_name - content title: ToolResponse - description: 'Response from a tool invocation. - - - :param call_id: Unique identifier for the tool call this response is for - - :param tool_name: Name of the tool that was invoked - - :param content: The response content from the tool - - :param metadata: (Optional) Additional metadata about the tool response' + description: Response from a tool invocation. ToolResponse-Output: properties: call_id: @@ -2859,16 +2539,7 @@ components: - tool_name - content title: ToolResponse - description: 'Response from a tool invocation. - - - :param call_id: Unique identifier for the tool call this response is for - - :param tool_name: Name of the tool that was invoked - - :param content: The response content from the tool - - :param metadata: (Optional) Additional metadata about the tool response' + description: Response from a tool invocation. ToolResponseMessage-Output: properties: role: @@ -2906,14 +2577,7 @@ components: - call_id - content title: ToolResponseMessage - description: 'A message representing the result of a tool invocation. - - - :param role: Must be "tool" to identify this as a tool response - - :param call_id: Unique identifier for the tool call this response is for - - :param content: The response content from the tool' + description: A message representing the result of a tool invocation. TopKSamplingStrategy: properties: type: @@ -2929,14 +2593,8 @@ components: required: - top_k title: TopKSamplingStrategy - description: 'Top-k sampling strategy that restricts sampling to the k most - likely tokens. - - - :param type: Must be "top_k" to identify this sampling strategy - - :param top_k: Number of top tokens to consider for sampling. Must be at least - 1' + description: Top-k sampling strategy that restricts sampling to the k most likely + tokens. TopPSamplingStrategy: properties: type: @@ -2956,17 +2614,8 @@ components: required: - temperature title: TopPSamplingStrategy - description: 'Top-p (nucleus) sampling strategy that samples from the smallest + description: Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p. - - - :param type: Must be "top_p" to identify this sampling strategy - - :param temperature: Controls randomness in sampling. Higher values increase - randomness - - :param top_p: Cumulative probability threshold for nucleus sampling. Defaults - to 0.95' TrainingConfig: properties: n_epochs: @@ -2998,27 +2647,7 @@ components: required: - n_epochs title: TrainingConfig - description: 'Comprehensive configuration for the training process. - - - :param n_epochs: Number of training epochs to run - - :param max_steps_per_epoch: Maximum number of steps to run per epoch - - :param gradient_accumulation_steps: Number of steps to accumulate gradients - before updating - - :param max_validation_steps: (Optional) Maximum number of validation steps - per epoch - - :param data_config: (Optional) Configuration for data loading and formatting - - :param optimizer_config: (Optional) Configuration for the optimization algorithm - - :param efficiency_config: (Optional) Configuration for memory and compute - optimizations - - :param dtype: (Optional) Data type for model parameters (bf16, fp16, fp32)' + description: Comprehensive configuration for the training process. Turn: properties: turn_id: @@ -3074,26 +2703,7 @@ components: - output_message - started_at title: Turn - description: 'A single turn in an interaction with an Agentic System. - - - :param turn_id: Unique identifier for the turn within a session - - :param session_id: Unique identifier for the conversation session - - :param input_messages: List of messages that initiated this turn - - :param steps: Ordered list of processing steps executed during this turn - - :param output_message: The model''s generated response containing content - and metadata - - :param output_attachments: (Optional) Files or media attached to the agent''s - response - - :param started_at: Timestamp when the turn began - - :param completed_at: (Optional) Timestamp when the turn finished, if completed' + description: A single turn in an interaction with an Agentic System. URIDataSource: properties: type: @@ -3108,9 +2718,7 @@ components: required: - uri title: URIDataSource - description: "A dataset that can be obtained from a URI.\n:param uri: The dataset\ - \ can be obtained from a URI. E.g.\n - \"https://mywebsite.com/mydata.jsonl\"\ - \n - \"lsfs://mydata.jsonl\"\n - \"data:csv;base64,{base64_content}\"" + description: A dataset that can be obtained from a URI. URL: properties: uri: @@ -3120,10 +2728,7 @@ components: required: - uri title: URL - description: 'A URL reference to external content. - - - :param uri: The URL string pointing to the resource' + description: A URL reference to external content. UserMessage-Input: properties: role: @@ -3179,16 +2784,7 @@ components: required: - content title: UserMessage - description: 'A message from the user in a chat conversation. - - - :param role: Must be "user" to identify this as a user message - - :param content: The content of the message, which can include text and other - media - - :param context: (Optional) This field is used internally by Llama Stack to - pass RAG context. This field may be removed in the API in the future.' + description: A message from the user in a chat conversation. UserMessage-Output: properties: role: @@ -3244,16 +2840,7 @@ components: required: - content title: UserMessage - description: 'A message from the user in a chat conversation. - - - :param role: Must be "user" to identify this as a user message - - :param content: The content of the message, which can include text and other - media - - :param context: (Optional) This field is used internally by Llama Stack to - pass RAG context. This field may be removed in the API in the future.' + description: A message from the user in a chat conversation. ViolationLevel: type: string enum: @@ -3261,14 +2848,7 @@ components: - warn - error title: ViolationLevel - description: 'Severity level of a safety violation. - - - :cvar INFO: Informational level violation that does not require action - - :cvar WARN: Warning level violation that suggests caution but allows continuation - - :cvar ERROR: Error level violation that requires blocking or intervention' + description: Severity level of a safety violation. _URLOrData: properties: url: @@ -3279,13 +2859,7 @@ components: type: string type: object title: _URLOrData - description: 'A URL or a base64 encoded string - - - :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - - :param data: base64 encoded image data as string' + description: A URL or a base64 encoded string __main_____agents_agent_id_session_Request: properties: agent_id: @@ -3393,18 +2967,7 @@ components: - max_num_results title: _inference_rerank_Request Error: - description: 'Error response from the API. Roughly follows RFC 7807. - - - :param status: HTTP status code - - :param title: Error title, a short summary of the error which is invariant - for an error type - - :param detail: Error detail, a longer human-readable description of the error - - :param instance: (Optional) A URL which can be used to retrieve more information - about the specific occurrence of the error' + description: Error response from the API. Roughly follows RFC 7807. properties: status: title: Status @@ -3426,14 +2989,7 @@ components: title: Error type: object Agent: - description: 'An agent instance with configuration and metadata. - - - :param agent_id: Unique identifier for the agent - - :param agent_config: Configuration settings for the agent - - :param created_at: Timestamp when the agent was created' + description: An agent instance with configuration and metadata. properties: agent_id: title: Agent Id @@ -3451,10 +3007,7 @@ components: title: Agent type: object AgentStepResponse: - description: 'Response containing details of a specific agent step. - - - :param step: The complete step data and execution details' + description: Response containing details of a specific agent step. properties: step: discriminator: @@ -3475,16 +3028,8 @@ components: title: AgentStepResponse type: object CompletionMessage: - description: "A message containing the model's (assistant) response in a chat\ - \ conversation.\n\n:param role: Must be \"assistant\" to identify this as\ - \ the model's response\n:param content: The content of the model's response\n\ - :param stop_reason: Reason why the model stopped generating. Options are:\n\ - \ - `StopReason.end_of_turn`: The model finished generating the entire\ - \ response.\n - `StopReason.end_of_message`: The model finished generating\ - \ but generated a partial response -- usually, a tool call. The user may call\ - \ the tool and continue the conversation with the tool's response.\n -\ - \ `StopReason.out_of_tokens`: The model ran out of token budget.\n:param tool_calls:\ - \ List of tool calls. Each tool call is a ToolCall object." + description: A message containing the model's (assistant) response in a chat + conversation. properties: role: const: assistant @@ -3526,10 +3071,7 @@ components: title: CompletionMessage type: object InferenceStep: - description: 'An inference step in an agent turn. - - - :param model_response: The response from the LLM.' + description: An inference step in an agent turn. properties: turn_id: title: Turn Id @@ -3561,13 +3103,7 @@ components: title: InferenceStep type: object MemoryRetrievalStep: - description: 'A memory retrieval step in an agent turn. - - - :param vector_store_ids: The IDs of the vector databases to retrieve context - from. - - :param inserted_context: The context retrieved from the vector databases.' + description: A memory retrieval step in an agent turn. properties: turn_id: title: Turn Id @@ -3623,14 +3159,7 @@ components: title: MemoryRetrievalStep type: object PaginatedResponse: - description: 'A generic paginated response that follows a simple format. - - - :param data: The list of items for the current page - - :param has_more: Whether there are more items available after this set - - :param url: The URL for accessing this list' + description: A generic paginated response that follows a simple format. properties: data: items: @@ -3651,16 +3180,7 @@ components: title: PaginatedResponse type: object Session: - description: 'A single session of an interaction with an Agentic System. - - - :param session_id: Unique identifier for the conversation session - - :param session_name: Human-readable name for the session - - :param turns: List of all turns that have occurred in this session - - :param started_at: Timestamp when the session was created' + description: A single session of an interaction with an Agentic System. properties: session_id: title: Session Id @@ -3685,10 +3205,7 @@ components: title: Session type: object ShieldCallStep: - description: 'A shield call step in an agent turn. - - - :param violation: The violation from the shield call.' + description: A shield call step in an agent turn. properties: turn_id: title: Turn Id @@ -3720,12 +3237,7 @@ components: title: ShieldCallStep type: object ToolExecutionStep: - description: 'A tool execution step in an agent turn. - - - :param tool_calls: The tool calls to execute. - - :param tool_responses: The tool responses from the tool calls.' + description: A tool execution step in an agent turn. properties: turn_id: title: Turn Id @@ -3766,16 +3278,7 @@ components: title: ToolExecutionStep type: object ToolResponse: - description: 'Response from a tool invocation. - - - :param call_id: Unique identifier for the tool call this response is for - - :param tool_name: Name of the tool that was invoked - - :param content: The response content from the tool - - :param metadata: (Optional) Additional metadata about the tool response' + description: Response from a tool invocation. properties: call_id: title: Call Id @@ -3819,22 +3322,7 @@ components: title: ToolResponse type: object Checkpoint: - description: 'Checkpoint created during training runs. - - - :param identifier: Unique identifier for the checkpoint - - :param created_at: Timestamp when the checkpoint was created - - :param epoch: Training epoch when the checkpoint was saved - - :param post_training_job_id: Identifier of the training job that created this - checkpoint - - :param path: File system path where the checkpoint is stored - - :param training_metrics: (Optional) Training metrics associated with this - checkpoint' + description: Checkpoint created during training runs. properties: identifier: title: Identifier @@ -3864,12 +3352,7 @@ components: title: Checkpoint type: object PostTrainingJobArtifactsResponse: - description: 'Artifacts of a finetuning job. - - - :param job_uuid: Unique identifier for the training job - - :param checkpoints: List of model checkpoints created during training' + description: Artifacts of a finetuning job. properties: job_uuid: title: Job Uuid @@ -3884,23 +3367,7 @@ components: title: PostTrainingJobArtifactsResponse type: object PostTrainingJobStatusResponse: - description: 'Status of a finetuning job. - - - :param job_uuid: Unique identifier for the training job - - :param status: Current status of the training job - - :param scheduled_at: (Optional) Timestamp when the job was scheduled - - :param started_at: (Optional) Timestamp when the job execution began - - :param completed_at: (Optional) Timestamp when the job finished, if completed - - :param resources_allocated: (Optional) Information about computational resources - allocated to the job - - :param checkpoints: List of model checkpoints created during training' + description: Status of a finetuning job. properties: job_uuid: title: Job Uuid @@ -3938,12 +3405,7 @@ components: title: PostTrainingJobStatusResponse type: object ImageContentItem: - description: 'A image content item - - - :param type: Discriminator type of the content item. Always "image" - - :param image: Image as a base64 encoded string or an URL' + description: A image content item properties: type: const: image @@ -3957,16 +3419,7 @@ components: title: ImageContentItem type: object PostTrainingMetric: - description: 'Training metrics captured during post-training jobs. - - - :param epoch: Training epoch number - - :param train_loss: Loss value on the training dataset - - :param validation_loss: Loss value on the validation dataset - - :param perplexity: Perplexity metric indicating model confidence' + description: Training metrics captured during post-training jobs. properties: epoch: title: Epoch @@ -4017,9 +3470,9 @@ components: example: status: 500 title: Internal Server Error - detail: An unexpected error occurred + detail: An unexpected error occurred. Our team has been notified. DefaultError: - description: An error occurred + description: An unexpected error occurred content: application/json: schema: diff --git a/docs/static/llama-stack-spec.json b/docs/static/llama-stack-spec.json new file mode 100644 index 0000000000..396640dab0 --- /dev/null +++ b/docs/static/llama-stack-spec.json @@ -0,0 +1,11541 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Llama Stack API", + "description": "A comprehensive API for building and deploying AI applications", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://api.llamastack.com", + "description": "Production server" + }, + { + "url": "https://staging-api.llamastack.com", + "description": "Staging server" + } + ], + "paths": { + "/v1/batches": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all batches for the current user.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_batches_v1_batches_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + } + ], + "responses": { + "200": { + "description": "A list of batch objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBatchesResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Create a new batch for processing multiple API requests.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_batch_v1_batches_post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_batches_Request" + } + } + } + }, + "responses": { + "200": { + "description": "The created batch object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Batch" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/batches/{batch_id}": { + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve information about a specific batch.", + "description": "Query endpoint for proper schema generation.", + "operationId": "retrieve_batch_v1_batches__batch_id__get", + "parameters": [ + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Batch Id" + }, + "description": "The ID of the batch to retrieve." + } + ], + "responses": { + "200": { + "description": "The batch object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Batch" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/batches/{batch_id}/cancel": { + "post": { + "tags": [ + "V1" + ], + "summary": "Cancel a batch that is in progress.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "cancel_batch_v1_batches__batch_id__cancel_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_batches_batch_id_cancel_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The updated batch object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Batch" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the batch to cancel." + } + ] + } + }, + "/v1/chat/completions": { + "get": { + "tags": [ + "V1" + ], + "summary": "List chat completions.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_chat_completions_v1_chat_completions_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "model", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Model" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/Order", + "default": "desc" + } + } + ], + "responses": { + "200": { + "description": "A ListOpenAIChatCompletionResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOpenAIChatCompletionResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Create chat completions.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_chat_completion_v1_chat_completions_post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIChatCompletionRequestWithExtraBody" + } + } + } + }, + "responses": { + "200": { + "description": "An OpenAIChatCompletion.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIChatCompletion" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/chat/completions/{completion_id}": { + "get": { + "tags": [ + "V1" + ], + "summary": "Get chat completion.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_chat_completion_v1_chat_completions__completion_id__get", + "parameters": [ + { + "name": "completion_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Completion Id" + }, + "description": "ID of the chat completion." + } + ], + "responses": { + "200": { + "description": "A OpenAICompletionWithInputMessages.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAICompletionWithInputMessages" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/completions": { + "post": { + "tags": [ + "V1" + ], + "summary": "Create completion.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_completion_v1_completions_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAICompletionRequestWithExtraBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "An OpenAICompletion.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAICompletion" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/conversations": { + "post": { + "tags": [ + "V1" + ], + "summary": "Create a conversation.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_conversation_v1_conversations_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_conversations_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The created conversation object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Conversation" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/conversations/{conversation_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete a conversation.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_delete_conversation_v1_conversations__conversation_id__delete", + "parameters": [ + { + "name": "conversation_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Conversation Id" + }, + "description": "The conversation identifier." + } + ], + "responses": { + "200": { + "description": "The deleted conversation resource.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConversationDeletedResource" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve a conversation.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_conversation_v1_conversations__conversation_id__get", + "parameters": [ + { + "name": "conversation_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Conversation Id" + }, + "description": "The conversation identifier." + } + ], + "responses": { + "200": { + "description": "The conversation object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Conversation" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Update a conversation.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "update_conversation_v1_conversations__conversation_id__post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_conversations_conversation_id_Request" + } + } + } + }, + "responses": { + "200": { + "description": "The updated conversation object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Conversation" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + }, + "parameters": [ + { + "name": "conversation_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The conversation identifier." + } + ] + } + }, + "/v1/conversations/{conversation_id}/items": { + "get": { + "tags": [ + "V1" + ], + "summary": "List items.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_items_v1_conversations__conversation_id__items_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "include", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/ConversationItemInclude" + } + }, + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Order" + } + }, + { + "name": "conversation_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Conversation Id" + }, + "description": "The conversation identifier." + } + ], + "responses": { + "200": { + "description": "List of conversation items.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConversationItemList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Create items.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "add_items_v1_conversations__conversation_id__items_post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_conversations_conversation_id_items_Request" + } + } + } + }, + "responses": { + "200": { + "description": "List of created items.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConversationItemList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + }, + "parameters": [ + { + "name": "conversation_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The conversation identifier." + } + ] + } + }, + "/v1/conversations/{conversation_id}/items/{item_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete an item.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_delete_conversation_item_v1_conversations__conversation_id__items__item_id__delete", + "parameters": [ + { + "name": "conversation_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Conversation Id" + }, + "description": "The conversation identifier." + }, + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + }, + "description": "The item identifier." + } + ], + "responses": { + "200": { + "description": "The deleted item resource.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConversationItemDeletedResource" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve an item.", + "description": "Query endpoint for proper schema generation.", + "operationId": "retrieve_v1_conversations__conversation_id__items__item_id__get", + "parameters": [ + { + "name": "conversation_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Conversation Id" + }, + "description": "The conversation identifier." + }, + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + }, + "description": "The item identifier." + } + ], + "responses": { + "200": { + "description": "The conversation item.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIResponseMessage" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/embeddings": { + "post": { + "tags": [ + "V1" + ], + "summary": "Create embeddings.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_embeddings_v1_embeddings_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "An OpenAIEmbeddingsResponse containing the embeddings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIEmbeddingsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/files": { + "get": { + "tags": [ + "V1" + ], + "summary": "List files.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_list_files_v1_files_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "purpose", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/OpenAIFilePurpose" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 10000, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/Order", + "default": "desc" + } + } + ], + "responses": { + "200": { + "description": "An ListOpenAIFileResponse containing the list of files.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOpenAIFileResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Upload file.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "openai_upload_file_v1_files_post", + "responses": { + "200": { + "description": "An OpenAIFileObject representing the uploaded file.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIFileObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/files/{file_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete file.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_delete_file_v1_files__file_id__delete", + "parameters": [ + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + }, + "description": "The ID of the file to use for this request." + } + ], + "responses": { + "200": { + "description": "An OpenAIFileDeleteResponse indicating successful deletion.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIFileDeleteResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve file.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_retrieve_file_v1_files__file_id__get", + "parameters": [ + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + }, + "description": "The ID of the file to use for this request." + } + ], + "responses": { + "200": { + "description": "An OpenAIFileObject containing file information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIFileObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/files/{file_id}/content": { + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve file content.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "openai_retrieve_file_content_v1_files__file_id__content_get", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the file to use for this request." + } + ], + "responses": { + "200": { + "description": "The raw file content as a binary response.", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/health": { + "get": { + "tags": [ + "V1" + ], + "summary": "Get health status.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "health_v1_health_get", + "responses": { + "200": { + "description": "Health information indicating if the service is operational.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HealthInfo" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/inspect/routes": { + "get": { + "tags": [ + "V1" + ], + "summary": "List routes.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_routes_v1_inspect_routes_get", + "responses": { + "200": { + "description": "Response containing information about all available routes.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListRoutesResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/models": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all models.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_models_v1_models_get", + "responses": { + "200": { + "description": "A ListModelsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListModelsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Register model.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "register_model_v1_models_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_models_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A Model.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Model" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/models/{model_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Unregister model.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "unregister_model_v1_models__model_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "model_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "Path parameter: model_id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Get model.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_model_v1_models__model_id__get", + "parameters": [ + { + "name": "model_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Model Id" + } + } + ], + "responses": { + "200": { + "description": "A Model.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Model" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/moderations": { + "post": { + "tags": [ + "V1" + ], + "summary": "Create moderation.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "run_moderation_v1_moderations_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_moderations_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A moderation object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModerationObject" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/prompts": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all prompts.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_prompts_v1_prompts_get", + "responses": { + "200": { + "description": "A ListPromptsResponse containing all prompts.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPromptsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Create prompt.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_prompt_v1_prompts_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_prompts_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The created Prompt resource.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Prompt" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/prompts/{prompt_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete prompt.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "delete_prompt_v1_prompts__prompt_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "prompt_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The identifier of the prompt to delete." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Get prompt.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_prompt_v1_prompts__prompt_id__get", + "parameters": [ + { + "name": "version", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Version" + } + }, + { + "name": "prompt_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Prompt Id" + }, + "description": "The identifier of the prompt to get." + } + ], + "responses": { + "200": { + "description": "A Prompt resource.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Prompt" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Update prompt.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "update_prompt_v1_prompts__prompt_id__post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_prompts_prompt_id_Request" + } + } + } + }, + "responses": { + "200": { + "description": "The updated Prompt resource with incremented version.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Prompt" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + }, + "parameters": [ + { + "name": "prompt_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The identifier of the prompt to update." + } + ] + } + }, + "/v1/prompts/{prompt_id}/set-default-version": { + "post": { + "tags": [ + "V1" + ], + "summary": "Set prompt version.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "set_default_version_v1_prompts__prompt_id__set_default_version_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_prompts_prompt_id_set_default_version_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The prompt with the specified version now set as default.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Prompt" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "prompt_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The identifier of the prompt." + } + ] + } + }, + "/v1/prompts/{prompt_id}/versions": { + "get": { + "tags": [ + "V1" + ], + "summary": "List prompt versions.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_prompt_versions_v1_prompts__prompt_id__versions_get", + "parameters": [ + { + "name": "prompt_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Prompt Id" + }, + "description": "The identifier of the prompt to list versions for." + } + ], + "responses": { + "200": { + "description": "A ListPromptsResponse containing all versions of the prompt.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPromptsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/providers": { + "get": { + "tags": [ + "V1" + ], + "summary": "List providers.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_providers_v1_providers_get", + "responses": { + "200": { + "description": "A ListProvidersResponse containing information about all providers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListProvidersResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/providers/{provider_id}": { + "get": { + "tags": [ + "V1" + ], + "summary": "Get provider.", + "description": "Query endpoint for proper schema generation.", + "operationId": "inspect_provider_v1_providers__provider_id__get", + "parameters": [ + { + "name": "provider_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Provider Id" + }, + "description": "The ID of the provider to inspect." + } + ], + "responses": { + "200": { + "description": "A ProviderInfo object containing the provider's details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProviderInfo" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/responses": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all responses.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_openai_responses_v1_responses_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "model", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Model" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 50, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/Order", + "default": "desc" + } + } + ], + "responses": { + "200": { + "description": "A ListOpenAIResponseObject.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOpenAIResponseObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Create a model response.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_openai_response_v1_responses_post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_responses_Request" + } + } + } + }, + "responses": { + "200": { + "description": "An OpenAIResponseObject.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIResponseObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/responses/{response_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete a response.", + "description": "Query endpoint for proper schema generation.", + "operationId": "delete_openai_response_v1_responses__response_id__delete", + "parameters": [ + { + "name": "response_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Response Id" + }, + "description": "The ID of the OpenAI response to delete." + } + ], + "responses": { + "200": { + "description": "An OpenAIDeleteResponseObject", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIDeleteResponseObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Get a model response.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_openai_response_v1_responses__response_id__get", + "parameters": [ + { + "name": "response_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Response Id" + }, + "description": "The ID of the OpenAI response to retrieve." + } + ], + "responses": { + "200": { + "description": "An OpenAIResponseObject.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIResponseObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/responses/{response_id}/input_items": { + "get": { + "tags": [ + "V1" + ], + "summary": "List input items.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_openai_response_input_items_v1_responses__response_id__input_items_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "before", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Before" + } + }, + { + "name": "include", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Include" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/Order", + "default": "desc" + } + }, + { + "name": "response_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Response Id" + }, + "description": "The ID of the response to retrieve input items for." + } + ], + "responses": { + "200": { + "description": "An ListOpenAIResponseInputItem.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOpenAIResponseInputItem" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/safety/run-shield": { + "post": { + "tags": [ + "V1" + ], + "summary": "Run shield.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "run_shield_v1_safety_run_shield_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_safety_run_shield_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A RunShieldResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunShieldResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/scoring-functions": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all scoring functions.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_scoring_functions_v1_scoring_functions_get", + "responses": { + "200": { + "description": "A ListScoringFunctionsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListScoringFunctionsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Register a scoring function.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "register_scoring_function_v1_scoring_functions_post", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/scoring-functions/{scoring_fn_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Unregister a scoring function.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "unregister_scoring_function_v1_scoring_functions__scoring_fn_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "scoring_fn_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "Path parameter: scoring_fn_id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Get a scoring function by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_scoring_function_v1_scoring_functions__scoring_fn_id__get", + "parameters": [ + { + "name": "scoring_fn_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Scoring Fn Id" + } + } + ], + "responses": { + "200": { + "description": "A ScoringFn.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScoringFn" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/scoring/score": { + "post": { + "tags": [ + "V1" + ], + "summary": "Score a list of rows.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "score_v1_scoring_score_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_scoring_score_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A ScoreResponse object containing rows and aggregated results.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScoreResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/scoring/score-batch": { + "post": { + "tags": [ + "V1" + ], + "summary": "Score a batch of rows.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "score_batch_v1_scoring_score_batch_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_scoring_score_batch_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A ScoreBatchResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScoreBatchResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/shields": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all shields.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_shields_v1_shields_get", + "responses": { + "200": { + "description": "A ListShieldsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListShieldsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Register a shield.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "register_shield_v1_shields_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_shields_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A Shield.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Shield" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/shields/{identifier}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Unregister a shield.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "unregister_shield_v1_shields__identifier__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "identifier", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "Path parameter: identifier" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Get a shield by its identifier.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_shield_v1_shields__identifier__get", + "parameters": [ + { + "name": "identifier", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Identifier" + } + } + ], + "responses": { + "200": { + "description": "A Shield.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Shield" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/tool-runtime/invoke": { + "post": { + "tags": [ + "V1" + ], + "summary": "Run a tool with the given arguments.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "invoke_tool_v1_tool_runtime_invoke_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_tool_runtime_invoke_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A ToolInvocationResult.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ToolInvocationResult" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/tool-runtime/list-tools": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all tools in the runtime.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_runtime_tools_v1_tool_runtime_list_tools_get", + "parameters": [ + { + "name": "tool_group_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Tool Group Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/URL" + } + } + } + }, + "responses": { + "200": { + "description": "A ListToolDefsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListToolDefsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/tool-runtime/rag-tool/insert": { + "post": { + "tags": [ + "V1" + ], + "summary": "Index documents so they can be used by the RAG system.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "rag_tool_insert_v1_tool_runtime_rag_tool_insert_post", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/tool-runtime/rag-tool/query": { + "post": { + "tags": [ + "V1" + ], + "summary": "Query the RAG system for context; typically invoked by the agent.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "rag_tool_query_v1_tool_runtime_rag_tool_query_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_tool_runtime_rag_tool_query_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "RAGQueryResult containing the retrieved content and metadata", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RAGQueryResult" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/toolgroups": { + "get": { + "tags": [ + "V1" + ], + "summary": "List tool groups with optional provider.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_tool_groups_v1_toolgroups_get", + "responses": { + "200": { + "description": "A ListToolGroupsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListToolGroupsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Register a tool group.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "register_tool_group_v1_toolgroups_post", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/toolgroups/{toolgroup_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Unregister a tool group.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "unregister_toolgroup_v1_toolgroups__toolgroup_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "toolgroup_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "Path parameter: toolgroup_id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Get a tool group by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_tool_group_v1_toolgroups__toolgroup_id__get", + "parameters": [ + { + "name": "toolgroup_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Toolgroup Id" + } + } + ], + "responses": { + "200": { + "description": "A ToolGroup.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ToolGroup" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/tools": { + "get": { + "tags": [ + "V1" + ], + "summary": "List tools with optional tool group.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_tools_v1_tools_get", + "parameters": [ + { + "name": "toolgroup_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Toolgroup Id" + } + } + ], + "responses": { + "200": { + "description": "A ListToolDefsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListToolDefsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/tools/{tool_name}": { + "get": { + "tags": [ + "V1" + ], + "summary": "Get a tool by its name.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_tool_v1_tools__tool_name__get", + "parameters": [ + { + "name": "tool_name", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Tool Name" + } + } + ], + "responses": { + "200": { + "description": "A ToolDef.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ToolDef" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/vector-io/insert": { + "post": { + "tags": [ + "V1" + ], + "summary": "Insert chunks into a vector database.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "insert_chunks_v1_vector_io_insert_post", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/vector-io/query": { + "post": { + "tags": [ + "V1" + ], + "summary": "Query chunks from a vector database.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "query_chunks_v1_vector_io_query_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_vector_io_query_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A QueryChunksResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueryChunksResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/vector_stores": { + "get": { + "tags": [ + "V1" + ], + "summary": "Returns a list of vector stores.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_list_vector_stores_v1_vector_stores_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "before", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Before" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "desc", + "title": "Order" + } + } + ], + "responses": { + "200": { + "description": "A VectorStoreListResponse containing the list of vector stores.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreListResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Creates a vector store.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_create_vector_store_v1_vector_stores_post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody" + } + } + } + }, + "responses": { + "200": { + "description": "A VectorStoreObject representing the created vector store.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/vector_stores/{vector_store_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete a vector store.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_delete_vector_store_v1_vector_stores__vector_store_id__delete", + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store to delete." + } + ], + "responses": { + "200": { + "description": "A VectorStoreDeleteResponse indicating the deletion status.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreDeleteResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieves a vector store.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_retrieve_vector_store_v1_vector_stores__vector_store_id__get", + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store to retrieve." + } + ], + "responses": { + "200": { + "description": "A VectorStoreObject representing the vector store.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Updates a vector store.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_update_vector_store_v1_vector_stores__vector_store_id__post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_vector_stores_vector_store_id_Request" + } + } + } + }, + "responses": { + "200": { + "description": "A VectorStoreObject representing the updated vector store.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + }, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store to update." + } + ] + } + }, + "/v1/vector_stores/{vector_store_id}/file_batches": { + "post": { + "tags": [ + "V1" + ], + "summary": "Create a vector store file batch.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_create_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A VectorStoreFileBatchObject representing the created file batch.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileBatchObject" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store to create the file batch for." + } + ] + } + }, + "/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}": { + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve a vector store file batch.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_retrieve_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__get", + "parameters": [ + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Batch Id" + }, + "description": "The ID of the file batch to retrieve." + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store containing the file batch." + } + ], + "responses": { + "200": { + "description": "A VectorStoreFileBatchObject representing the file batch.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileBatchObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel": { + "post": { + "tags": [ + "V1" + ], + "summary": "Cancels a vector store file batch.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A VectorStoreFileBatchObject representing the cancelled file batch.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileBatchObject" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the file batch to cancel." + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store containing the file batch." + } + ] + } + }, + "/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files": { + "get": { + "tags": [ + "V1" + ], + "summary": "Returns a list of vector store files in a batch.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_list_files_in_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "before", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Before" + } + }, + { + "name": "filter", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Filter" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "desc", + "title": "Order" + } + }, + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Batch Id" + }, + "description": "The ID of the file batch to list files from." + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store containing the file batch." + } + ], + "responses": { + "200": { + "description": "A VectorStoreFilesListInBatchResponse containing the list of files in the batch.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFilesListInBatchResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/vector_stores/{vector_store_id}/files": { + "get": { + "tags": [ + "V1" + ], + "summary": "List files in a vector store.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_list_files_in_vector_store_v1_vector_stores__vector_store_id__files_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "before", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Before" + } + }, + { + "name": "filter", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Filter" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "desc", + "title": "Order" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store to list files from." + } + ], + "responses": { + "200": { + "description": "A VectorStoreListFilesResponse containing the list of files.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreListFilesResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Attach a file to a vector store.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_vector_stores_vector_store_id_files_Request" + } + } + } + }, + "responses": { + "200": { + "description": "A VectorStoreFileObject representing the attached file.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + }, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store to attach the file to." + } + ] + } + }, + "/v1/vector_stores/{vector_store_id}/files/{file_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete a vector store file.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete", + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store containing the file to delete." + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + }, + "description": "The ID of the file to delete." + } + ], + "responses": { + "200": { + "description": "A VectorStoreFileDeleteResponse indicating the deletion status.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileDeleteResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieves a vector store file.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get", + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store containing the file to retrieve." + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + }, + "description": "The ID of the file to retrieve." + } + ], + "responses": { + "200": { + "description": "A VectorStoreFileObject representing the file.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Updates a vector store file.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_vector_stores_vector_store_id_files_file_id_Request" + } + } + } + }, + "responses": { + "200": { + "description": "A VectorStoreFileObject representing the updated file.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + }, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store containing the file to update." + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the file to update." + } + ] + } + }, + "/v1/vector_stores/{vector_store_id}/files/{file_id}/content": { + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieves the contents of a vector store file.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get", + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store containing the file to retrieve." + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + }, + "description": "The ID of the file to retrieve." + } + ], + "responses": { + "200": { + "description": "A list of InterleavedContent representing the file contents.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileContentsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/vector_stores/{vector_store_id}/search": { + "post": { + "tags": [ + "V1" + ], + "summary": "Search for chunks in a vector store.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_search_vector_store_v1_vector_stores__vector_store_id__search_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_vector_stores_vector_store_id_search_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A VectorStoreSearchResponse containing the search results.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreSearchResponsePage" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store to search." + } + ] + } + }, + "/v1/version": { + "get": { + "tags": [ + "V1" + ], + "summary": "Get version.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "version_v1_version_get", + "responses": { + "200": { + "description": "Version information containing the service version number.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VersionInfo" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + } + }, + "components": { + "schemas": { + "AgentTurnInputType": { + "properties": { + "type": { + "type": "string", + "const": "agent_turn_input", + "title": "Type", + "default": "agent_turn_input" + } + }, + "type": "object", + "title": "AgentTurnInputType", + "description": "Parameter type for agent turn input." + }, + "AggregationFunctionType": { + "type": "string", + "enum": [ + "average", + "weighted_average", + "median", + "categorical_count", + "accuracy" + ], + "title": "AggregationFunctionType", + "description": "Types of aggregation functions for scoring results." + }, + "AllowedToolsFilter": { + "properties": { + "tool_names": { + "title": "Tool Names", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "title": "AllowedToolsFilter", + "description": "Filter configuration for restricting which MCP tools can be used." + }, + "ApprovalFilter": { + "properties": { + "always": { + "title": "Always", + "items": { + "type": "string" + }, + "type": "array" + }, + "never": { + "title": "Never", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "title": "ApprovalFilter", + "description": "Filter configuration for MCP tool approval requirements." + }, + "ArrayType": { + "properties": { + "type": { + "type": "string", + "const": "array", + "title": "Type", + "default": "array" + } + }, + "type": "object", + "title": "ArrayType", + "description": "Parameter type for array values." + }, + "BasicScoringFnParams": { + "properties": { + "type": { + "type": "string", + "const": "basic", + "title": "Type", + "default": "basic" + }, + "aggregation_functions": { + "items": { + "$ref": "#/components/schemas/AggregationFunctionType" + }, + "type": "array", + "title": "Aggregation Functions", + "description": "Aggregation functions to apply to the scores of each row" + } + }, + "type": "object", + "title": "BasicScoringFnParams", + "description": "Parameters for basic scoring function configuration." + }, + "Batch": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "completion_window": { + "type": "string", + "title": "Completion Window" + }, + "created_at": { + "type": "integer", + "title": "Created At" + }, + "endpoint": { + "type": "string", + "title": "Endpoint" + }, + "input_file_id": { + "type": "string", + "title": "Input File Id" + }, + "object": { + "type": "string", + "const": "batch", + "title": "Object" + }, + "status": { + "type": "string", + "enum": [ + "validating", + "failed", + "in_progress", + "finalizing", + "completed", + "expired", + "cancelling", + "cancelled" + ], + "title": "Status" + }, + "cancelled_at": { + "title": "Cancelled At", + "type": "integer" + }, + "cancelling_at": { + "title": "Cancelling At", + "type": "integer" + }, + "completed_at": { + "title": "Completed At", + "type": "integer" + }, + "error_file_id": { + "title": "Error File Id", + "type": "string" + }, + "errors": { + "$ref": "#/components/schemas/Errors" + }, + "expired_at": { + "title": "Expired At", + "type": "integer" + }, + "expires_at": { + "title": "Expires At", + "type": "integer" + }, + "failed_at": { + "title": "Failed At", + "type": "integer" + }, + "finalizing_at": { + "title": "Finalizing At", + "type": "integer" + }, + "in_progress_at": { + "title": "In Progress At", + "type": "integer" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "model": { + "title": "Model", + "type": "string" + }, + "output_file_id": { + "title": "Output File Id", + "type": "string" + }, + "request_counts": { + "$ref": "#/components/schemas/BatchRequestCounts" + }, + "usage": { + "$ref": "#/components/schemas/BatchUsage" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "completion_window", + "created_at", + "endpoint", + "input_file_id", + "object", + "status" + ], + "title": "Batch" + }, + "BatchError": { + "properties": { + "code": { + "title": "Code", + "type": "string" + }, + "line": { + "title": "Line", + "type": "integer" + }, + "message": { + "title": "Message", + "type": "string" + }, + "param": { + "title": "Param", + "type": "string" + } + }, + "additionalProperties": true, + "type": "object", + "title": "BatchError" + }, + "BatchRequestCounts": { + "properties": { + "completed": { + "type": "integer", + "title": "Completed" + }, + "failed": { + "type": "integer", + "title": "Failed" + }, + "total": { + "type": "integer", + "title": "Total" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "completed", + "failed", + "total" + ], + "title": "BatchRequestCounts" + }, + "BatchUsage": { + "properties": { + "input_tokens": { + "type": "integer", + "title": "Input Tokens" + }, + "input_tokens_details": { + "$ref": "#/components/schemas/InputTokensDetails" + }, + "output_tokens": { + "type": "integer", + "title": "Output Tokens" + }, + "output_tokens_details": { + "$ref": "#/components/schemas/OutputTokensDetails" + }, + "total_tokens": { + "type": "integer", + "title": "Total Tokens" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "input_tokens", + "input_tokens_details", + "output_tokens", + "output_tokens_details", + "total_tokens" + ], + "title": "BatchUsage" + }, + "BooleanType": { + "properties": { + "type": { + "type": "string", + "const": "boolean", + "title": "Type", + "default": "boolean" + } + }, + "type": "object", + "title": "BooleanType", + "description": "Parameter type for boolean values." + }, + "ChatCompletionInputType": { + "properties": { + "type": { + "type": "string", + "const": "chat_completion_input", + "title": "Type", + "default": "chat_completion_input" + } + }, + "type": "object", + "title": "ChatCompletionInputType", + "description": "Parameter type for chat completion input." + }, + "Chunk-Output": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "chunk_id": { + "type": "string", + "title": "Chunk Id" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + }, + "embedding": { + "title": "Embedding", + "items": { + "type": "number" + }, + "type": "array" + }, + "chunk_metadata": { + "$ref": "#/components/schemas/ChunkMetadata" + } + }, + "type": "object", + "required": [ + "content", + "chunk_id" + ], + "title": "Chunk", + "description": "A chunk of content that can be inserted into a vector database." + }, + "ChunkMetadata": { + "properties": { + "chunk_id": { + "title": "Chunk Id", + "type": "string" + }, + "document_id": { + "title": "Document Id", + "type": "string" + }, + "source": { + "title": "Source", + "type": "string" + }, + "created_timestamp": { + "title": "Created Timestamp", + "type": "integer" + }, + "updated_timestamp": { + "title": "Updated Timestamp", + "type": "integer" + }, + "chunk_window": { + "title": "Chunk Window", + "type": "string" + }, + "chunk_tokenizer": { + "title": "Chunk Tokenizer", + "type": "string" + }, + "chunk_embedding_model": { + "title": "Chunk Embedding Model", + "type": "string" + }, + "chunk_embedding_dimension": { + "title": "Chunk Embedding Dimension", + "type": "integer" + }, + "content_token_count": { + "title": "Content Token Count", + "type": "integer" + }, + "metadata_token_count": { + "title": "Metadata Token Count", + "type": "integer" + } + }, + "type": "object", + "title": "ChunkMetadata", + "description": "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." + }, + "CompletionInputType": { + "properties": { + "type": { + "type": "string", + "const": "completion_input", + "title": "Type", + "default": "completion_input" + } + }, + "type": "object", + "title": "CompletionInputType", + "description": "Parameter type for completion input." + }, + "Conversation": { + "properties": { + "id": { + "type": "string", + "title": "Id", + "description": "The unique ID of the conversation." + }, + "object": { + "type": "string", + "const": "conversation", + "title": "Object", + "description": "The object type, which is always conversation.", + "default": "conversation" + }, + "created_at": { + "type": "integer", + "title": "Created At", + "description": "The time at which the conversation was created, measured in seconds since the Unix epoch." + }, + "metadata": { + "title": "Metadata", + "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.", + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "items": { + "title": "Items", + "description": "Initial items to include in the conversation context. You may add up to 20 items at a time.", + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "id", + "created_at" + ], + "title": "Conversation", + "description": "OpenAI-compatible conversation object." + }, + "ConversationItemInclude": { + "type": "string", + "enum": [ + "web_search_call.action.sources", + "code_interpreter_call.outputs", + "computer_call_output.output.image_url", + "file_search_call.results", + "message.input_image.image_url", + "message.output_text.logprobs", + "reasoning.encrypted_content" + ], + "title": "ConversationItemInclude", + "description": "Specify additional output data to include in the model response." + }, + "ConversationItemList": { + "properties": { + "object": { + "type": "string", + "title": "Object", + "description": "Object type", + "default": "list" + }, + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage-Output" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", + "function_call_output": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput", + "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", + "mcp_approval_response": "#/components/schemas/OpenAIResponseMCPApprovalResponse", + "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", + "message": "#/components/schemas/OpenAIResponseMessage-Output", + "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + } + } + }, + "type": "array", + "title": "Data", + "description": "List of conversation items" + }, + "first_id": { + "title": "First Id", + "description": "The ID of the first item in the list", + "type": "string" + }, + "last_id": { + "title": "Last Id", + "description": "The ID of the last item in the list", + "type": "string" + }, + "has_more": { + "type": "boolean", + "title": "Has More", + "description": "Whether there are more items available", + "default": false + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ConversationItemList", + "description": "List of conversation items with pagination." + }, + "DefaultRAGQueryGeneratorConfig": { + "properties": { + "type": { + "type": "string", + "const": "default", + "title": "Type", + "default": "default" + }, + "separator": { + "type": "string", + "title": "Separator", + "default": " " + } + }, + "type": "object", + "title": "DefaultRAGQueryGeneratorConfig", + "description": "Configuration for the default RAG query generator." + }, + "Errors": { + "properties": { + "data": { + "title": "Data", + "items": { + "$ref": "#/components/schemas/BatchError" + }, + "type": "array" + }, + "object": { + "title": "Object", + "type": "string" + } + }, + "additionalProperties": true, + "type": "object", + "title": "Errors" + }, + "HealthInfo": { + "properties": { + "status": { + "$ref": "#/components/schemas/HealthStatus" + } + }, + "type": "object", + "required": [ + "status" + ], + "title": "HealthInfo", + "description": "Health status information for the service." + }, + "HealthStatus": { + "type": "string", + "enum": [ + "OK", + "Error", + "Not Implemented" + ], + "title": "HealthStatus" + }, + "ImageContentItem-Output": { + "properties": { + "type": { + "type": "string", + "const": "image", + "title": "Type", + "default": "image" + }, + "image": { + "$ref": "#/components/schemas/_URLOrData" + } + }, + "type": "object", + "required": [ + "image" + ], + "title": "ImageContentItem", + "description": "A image content item" + }, + "InputTokensDetails": { + "properties": { + "cached_tokens": { + "type": "integer", + "title": "Cached Tokens" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "cached_tokens" + ], + "title": "InputTokensDetails" + }, + "JsonType": { + "properties": { + "type": { + "type": "string", + "const": "json", + "title": "Type", + "default": "json" + } + }, + "type": "object", + "title": "JsonType", + "description": "Parameter type for JSON values." + }, + "LLMAsJudgeScoringFnParams": { + "properties": { + "type": { + "type": "string", + "const": "llm_as_judge", + "title": "Type", + "default": "llm_as_judge" + }, + "judge_model": { + "type": "string", + "title": "Judge Model" + }, + "prompt_template": { + "title": "Prompt Template", + "type": "string" + }, + "judge_score_regexes": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Judge Score Regexes", + "description": "Regexes to extract the answer from generated response" + }, + "aggregation_functions": { + "items": { + "$ref": "#/components/schemas/AggregationFunctionType" + }, + "type": "array", + "title": "Aggregation Functions", + "description": "Aggregation functions to apply to the scores of each row" + } + }, + "type": "object", + "required": [ + "judge_model" + ], + "title": "LLMAsJudgeScoringFnParams", + "description": "Parameters for LLM-as-judge scoring function configuration." + }, + "LLMRAGQueryGeneratorConfig": { + "properties": { + "type": { + "type": "string", + "const": "llm", + "title": "Type", + "default": "llm" + }, + "model": { + "type": "string", + "title": "Model" + }, + "template": { + "type": "string", + "title": "Template" + } + }, + "type": "object", + "required": [ + "model", + "template" + ], + "title": "LLMRAGQueryGeneratorConfig", + "description": "Configuration for the LLM-based RAG query generator." + }, + "ListModelsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Model" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListModelsResponse" + }, + "ListPromptsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Prompt" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListPromptsResponse", + "description": "Response model to list prompts." + }, + "ListProvidersResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ProviderInfo" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListProvidersResponse", + "description": "Response containing a list of all available providers." + }, + "ListRoutesResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/RouteInfo" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListRoutesResponse", + "description": "Response containing a list of all available API routes." + }, + "ListScoringFunctionsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ScoringFn-Output" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListScoringFunctionsResponse" + }, + "ListShieldsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Shield" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListShieldsResponse" + }, + "ListToolGroupsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ToolGroup" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListToolGroupsResponse", + "description": "Response containing a list of tool groups." + }, + "MCPListToolsTool": { + "properties": { + "input_schema": { + "additionalProperties": true, + "type": "object", + "title": "Input Schema" + }, + "name": { + "type": "string", + "title": "Name" + }, + "description": { + "title": "Description", + "type": "string" + } + }, + "type": "object", + "required": [ + "input_schema", + "name" + ], + "title": "MCPListToolsTool", + "description": "Tool definition returned by MCP list tools operation." + }, + "Model": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "model", + "title": "Type", + "default": "model" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata", + "description": "Any additional metadata for this model" + }, + "model_type": { + "$ref": "#/components/schemas/ModelType", + "default": "llm" + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id" + ], + "title": "Model", + "description": "A model resource representing an AI model registered in Llama Stack." + }, + "ModelType": { + "type": "string", + "enum": [ + "llm", + "embedding", + "rerank" + ], + "title": "ModelType", + "description": "Enumeration of supported model types in Llama Stack." + }, + "ModerationObject": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "model": { + "type": "string", + "title": "Model" + }, + "results": { + "items": { + "$ref": "#/components/schemas/ModerationObjectResults" + }, + "type": "array", + "title": "Results" + } + }, + "type": "object", + "required": [ + "id", + "model", + "results" + ], + "title": "ModerationObject", + "description": "A moderation object." + }, + "ModerationObjectResults": { + "properties": { + "flagged": { + "type": "boolean", + "title": "Flagged" + }, + "categories": { + "title": "Categories", + "additionalProperties": { + "type": "boolean" + }, + "type": "object" + }, + "category_applied_input_types": { + "title": "Category Applied Input Types", + "additionalProperties": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": "object" + }, + "category_scores": { + "title": "Category Scores", + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "user_message": { + "title": "User Message", + "type": "string" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "flagged" + ], + "title": "ModerationObjectResults", + "description": "A moderation object." + }, + "NumberType": { + "properties": { + "type": { + "type": "string", + "const": "number", + "title": "Type", + "default": "number" + } + }, + "type": "object", + "title": "NumberType", + "description": "Parameter type for numeric values." + }, + "ObjectType": { + "properties": { + "type": { + "type": "string", + "const": "object", + "title": "Type", + "default": "object" + } + }, + "type": "object", + "title": "ObjectType", + "description": "Parameter type for object values." + }, + "OpenAIAssistantMessageParam-Input": { + "properties": { + "role": { + "type": "string", + "const": "assistant", + "title": "Role", + "default": "assistant" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" + }, + "type": "array" + } + }, + "type": "object", + "title": "OpenAIAssistantMessageParam", + "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request." + }, + "OpenAIAssistantMessageParam-Output": { + "properties": { + "role": { + "type": "string", + "const": "assistant", + "title": "Role", + "default": "assistant" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" + }, + "type": "array" + } + }, + "type": "object", + "title": "OpenAIAssistantMessageParam", + "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request." + }, + "OpenAIChatCompletion": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "choices": { + "items": { + "$ref": "#/components/schemas/OpenAIChoice-Output" + }, + "type": "array", + "title": "Choices" + }, + "object": { + "type": "string", + "const": "chat.completion", + "title": "Object", + "default": "chat.completion" + }, + "created": { + "type": "integer", + "title": "Created" + }, + "model": { + "type": "string", + "title": "Model" + }, + "usage": { + "$ref": "#/components/schemas/OpenAIChatCompletionUsage" + } + }, + "type": "object", + "required": [ + "id", + "choices", + "created", + "model" + ], + "title": "OpenAIChatCompletion", + "description": "Response from an OpenAI-compatible chat completion request." + }, + "OpenAIChatCompletionContentPartImageParam": { + "properties": { + "type": { + "type": "string", + "const": "image_url", + "title": "Type", + "default": "image_url" + }, + "image_url": { + "$ref": "#/components/schemas/OpenAIImageURL" + } + }, + "type": "object", + "required": [ + "image_url" + ], + "title": "OpenAIChatCompletionContentPartImageParam", + "description": "Image content part for OpenAI-compatible chat completion messages." + }, + "OpenAIChatCompletionContentPartTextParam": { + "properties": { + "type": { + "type": "string", + "const": "text", + "title": "Type", + "default": "text" + }, + "text": { + "type": "string", + "title": "Text" + } + }, + "type": "object", + "required": [ + "text" + ], + "title": "OpenAIChatCompletionContentPartTextParam", + "description": "Text content part for OpenAI-compatible chat completion messages." + }, + "OpenAIChatCompletionRequestWithExtraBody": { + "properties": { + "model": { + "type": "string", + "title": "Model" + }, + "messages": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIUserMessageParam-Input" + }, + { + "$ref": "#/components/schemas/OpenAISystemMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIAssistantMessageParam-Input" + }, + { + "$ref": "#/components/schemas/OpenAIToolMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" + } + ], + "discriminator": { + "propertyName": "role", + "mapping": { + "assistant": "#/components/schemas/OpenAIAssistantMessageParam-Input", + "developer": "#/components/schemas/OpenAIDeveloperMessageParam", + "system": "#/components/schemas/OpenAISystemMessageParam", + "tool": "#/components/schemas/OpenAIToolMessageParam", + "user": "#/components/schemas/OpenAIUserMessageParam-Input" + } + } + }, + "type": "array", + "minItems": 1, + "title": "Messages" + }, + "frequency_penalty": { + "title": "Frequency Penalty", + "type": "number" + }, + "function_call": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": true, + "type": "object" + } + ], + "title": "Function Call" + }, + "functions": { + "title": "Functions", + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + "logit_bias": { + "title": "Logit Bias", + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "logprobs": { + "title": "Logprobs", + "type": "boolean" + }, + "max_completion_tokens": { + "title": "Max Completion Tokens", + "type": "integer" + }, + "max_tokens": { + "title": "Max Tokens", + "type": "integer" + }, + "n": { + "title": "N", + "type": "integer" + }, + "parallel_tool_calls": { + "title": "Parallel Tool Calls", + "type": "boolean" + }, + "presence_penalty": { + "title": "Presence Penalty", + "type": "number" + }, + "response_format": { + "title": "Response Format", + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseFormatText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseFormatJSONSchema" + }, + { + "$ref": "#/components/schemas/OpenAIResponseFormatJSONObject" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "json_object": "#/components/schemas/OpenAIResponseFormatJSONObject", + "json_schema": "#/components/schemas/OpenAIResponseFormatJSONSchema", + "text": "#/components/schemas/OpenAIResponseFormatText" + } + } + }, + "seed": { + "title": "Seed", + "type": "integer" + }, + "stop": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Stop" + }, + "stream": { + "title": "Stream", + "type": "boolean" + }, + "stream_options": { + "title": "Stream Options", + "additionalProperties": true, + "type": "object" + }, + "temperature": { + "title": "Temperature", + "type": "number" + }, + "tool_choice": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": true, + "type": "object" + } + ], + "title": "Tool Choice" + }, + "tools": { + "title": "Tools", + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + "top_logprobs": { + "title": "Top Logprobs", + "type": "integer" + }, + "top_p": { + "title": "Top P", + "type": "number" + }, + "user": { + "title": "User", + "type": "string" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "model", + "messages" + ], + "title": "OpenAIChatCompletionRequestWithExtraBody", + "description": "Request parameters for OpenAI-compatible chat completion endpoint." + }, + "OpenAIChatCompletionToolCall": { + "properties": { + "index": { + "title": "Index", + "type": "integer" + }, + "id": { + "title": "Id", + "type": "string" + }, + "type": { + "type": "string", + "const": "function", + "title": "Type", + "default": "function" + }, + "function": { + "$ref": "#/components/schemas/OpenAIChatCompletionToolCallFunction" + } + }, + "type": "object", + "title": "OpenAIChatCompletionToolCall", + "description": "Tool call specification for OpenAI-compatible chat completion responses." + }, + "OpenAIChatCompletionToolCallFunction": { + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "arguments": { + "title": "Arguments", + "type": "string" + } + }, + "type": "object", + "title": "OpenAIChatCompletionToolCallFunction", + "description": "Function call details for OpenAI-compatible tool calls." + }, + "OpenAIChatCompletionUsage": { + "properties": { + "prompt_tokens": { + "type": "integer", + "title": "Prompt Tokens" + }, + "completion_tokens": { + "type": "integer", + "title": "Completion Tokens" + }, + "total_tokens": { + "type": "integer", + "title": "Total Tokens" + }, + "prompt_tokens_details": { + "$ref": "#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails" + }, + "completion_tokens_details": { + "$ref": "#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails" + } + }, + "type": "object", + "required": [ + "prompt_tokens", + "completion_tokens", + "total_tokens" + ], + "title": "OpenAIChatCompletionUsage", + "description": "Usage information for OpenAI chat completion." + }, + "OpenAIChatCompletionUsageCompletionTokensDetails": { + "properties": { + "reasoning_tokens": { + "title": "Reasoning Tokens", + "type": "integer" + } + }, + "type": "object", + "title": "OpenAIChatCompletionUsageCompletionTokensDetails", + "description": "Token details for output tokens in OpenAI chat completion usage." + }, + "OpenAIChatCompletionUsagePromptTokensDetails": { + "properties": { + "cached_tokens": { + "title": "Cached Tokens", + "type": "integer" + } + }, + "type": "object", + "title": "OpenAIChatCompletionUsagePromptTokensDetails", + "description": "Token details for prompt tokens in OpenAI chat completion usage." + }, + "OpenAIChoice-Output": { + "properties": { + "message": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIUserMessageParam-Output" + }, + { + "$ref": "#/components/schemas/OpenAISystemMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIAssistantMessageParam-Output" + }, + { + "$ref": "#/components/schemas/OpenAIToolMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" + } + ], + "title": "Message", + "discriminator": { + "propertyName": "role", + "mapping": { + "assistant": "#/components/schemas/OpenAIAssistantMessageParam-Output", + "developer": "#/components/schemas/OpenAIDeveloperMessageParam", + "system": "#/components/schemas/OpenAISystemMessageParam", + "tool": "#/components/schemas/OpenAIToolMessageParam", + "user": "#/components/schemas/OpenAIUserMessageParam-Output" + } + } + }, + "finish_reason": { + "type": "string", + "title": "Finish Reason" + }, + "index": { + "type": "integer", + "title": "Index" + }, + "logprobs": { + "$ref": "#/components/schemas/OpenAIChoiceLogprobs-Output" + } + }, + "type": "object", + "required": [ + "message", + "finish_reason", + "index" + ], + "title": "OpenAIChoice", + "description": "A choice from an OpenAI-compatible chat completion response." + }, + "OpenAIChoiceLogprobs-Output": { + "properties": { + "content": { + "title": "Content", + "items": { + "$ref": "#/components/schemas/OpenAITokenLogProb" + }, + "type": "array" + }, + "refusal": { + "title": "Refusal", + "items": { + "$ref": "#/components/schemas/OpenAITokenLogProb" + }, + "type": "array" + } + }, + "type": "object", + "title": "OpenAIChoiceLogprobs", + "description": "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response." + }, + "OpenAICompletion": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "choices": { + "items": { + "$ref": "#/components/schemas/OpenAICompletionChoice-Output" + }, + "type": "array", + "title": "Choices" + }, + "created": { + "type": "integer", + "title": "Created" + }, + "model": { + "type": "string", + "title": "Model" + }, + "object": { + "type": "string", + "const": "text_completion", + "title": "Object", + "default": "text_completion" + } + }, + "type": "object", + "required": [ + "id", + "choices", + "created", + "model" + ], + "title": "OpenAICompletion", + "description": "Response from an OpenAI-compatible completion request." + }, + "OpenAICompletionChoice-Output": { + "properties": { + "finish_reason": { + "type": "string", + "title": "Finish Reason" + }, + "text": { + "type": "string", + "title": "Text" + }, + "index": { + "type": "integer", + "title": "Index" + }, + "logprobs": { + "$ref": "#/components/schemas/OpenAIChoiceLogprobs-Output" + } + }, + "type": "object", + "required": [ + "finish_reason", + "text", + "index" + ], + "title": "OpenAICompletionChoice", + "description": "A choice from an OpenAI-compatible completion response." + }, + "OpenAICompletionRequestWithExtraBody": { + "properties": { + "model": { + "type": "string", + "title": "Model" + }, + "prompt": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "integer" + }, + "type": "array" + }, + { + "items": { + "items": { + "type": "integer" + }, + "type": "array" + }, + "type": "array" + } + ], + "title": "Prompt" + }, + "best_of": { + "title": "Best Of", + "type": "integer" + }, + "echo": { + "title": "Echo", + "type": "boolean" + }, + "frequency_penalty": { + "title": "Frequency Penalty", + "type": "number" + }, + "logit_bias": { + "title": "Logit Bias", + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "logprobs": { + "title": "Logprobs", + "type": "boolean" + }, + "max_tokens": { + "title": "Max Tokens", + "type": "integer" + }, + "n": { + "title": "N", + "type": "integer" + }, + "presence_penalty": { + "title": "Presence Penalty", + "type": "number" + }, + "seed": { + "title": "Seed", + "type": "integer" + }, + "stop": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Stop" + }, + "stream": { + "title": "Stream", + "type": "boolean" + }, + "stream_options": { + "title": "Stream Options", + "additionalProperties": true, + "type": "object" + }, + "temperature": { + "title": "Temperature", + "type": "number" + }, + "top_p": { + "title": "Top P", + "type": "number" + }, + "user": { + "title": "User", + "type": "string" + }, + "suffix": { + "title": "Suffix", + "type": "string" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "model", + "prompt" + ], + "title": "OpenAICompletionRequestWithExtraBody", + "description": "Request parameters for OpenAI-compatible completion endpoint." + }, + "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": { + "properties": { + "file_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "File Ids" + }, + "attributes": { + "title": "Attributes", + "additionalProperties": true, + "type": "object" + }, + "chunking_strategy": { + "title": "Chunking Strategy", + "oneOf": [ + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" + }, + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "auto": "#/components/schemas/VectorStoreChunkingStrategyAuto", + "static": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + } + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "file_ids" + ], + "title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody", + "description": "Request to create a vector store file batch with extra_body support." + }, + "OpenAICreateVectorStoreRequestWithExtraBody": { + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "file_ids": { + "title": "File Ids", + "items": { + "type": "string" + }, + "type": "array" + }, + "expires_after": { + "title": "Expires After", + "additionalProperties": true, + "type": "object" + }, + "chunking_strategy": { + "title": "Chunking Strategy", + "additionalProperties": true, + "type": "object" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "additionalProperties": true, + "type": "object", + "title": "OpenAICreateVectorStoreRequestWithExtraBody", + "description": "Request to create a vector store with extra_body support." + }, + "OpenAIDeveloperMessageParam": { + "properties": { + "role": { + "type": "string", + "const": "developer", + "title": "Role", + "default": "developer" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "OpenAIDeveloperMessageParam", + "description": "A message from the developer in an OpenAI-compatible chat completion request." + }, + "OpenAIEmbeddingData": { + "properties": { + "object": { + "type": "string", + "const": "embedding", + "title": "Object", + "default": "embedding" + }, + "embedding": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "title": "Embedding" + }, + "index": { + "type": "integer", + "title": "Index" + } + }, + "type": "object", + "required": [ + "embedding", + "index" + ], + "title": "OpenAIEmbeddingData", + "description": "A single embedding data object from an OpenAI-compatible embeddings response." + }, + "OpenAIEmbeddingUsage": { + "properties": { + "prompt_tokens": { + "type": "integer", + "title": "Prompt Tokens" + }, + "total_tokens": { + "type": "integer", + "title": "Total Tokens" + } + }, + "type": "object", + "required": [ + "prompt_tokens", + "total_tokens" + ], + "title": "OpenAIEmbeddingUsage", + "description": "Usage information for an OpenAI-compatible embeddings response." + }, + "OpenAIEmbeddingsRequestWithExtraBody": { + "properties": { + "model": { + "type": "string", + "title": "Model" + }, + "input": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Input" + }, + "encoding_format": { + "title": "Encoding Format", + "default": "float", + "type": "string" + }, + "dimensions": { + "title": "Dimensions", + "type": "integer" + }, + "user": { + "title": "User", + "type": "string" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "model", + "input" + ], + "title": "OpenAIEmbeddingsRequestWithExtraBody", + "description": "Request parameters for OpenAI-compatible embeddings endpoint." + }, + "OpenAIEmbeddingsResponse": { + "properties": { + "object": { + "type": "string", + "const": "list", + "title": "Object", + "default": "list" + }, + "data": { + "items": { + "$ref": "#/components/schemas/OpenAIEmbeddingData" + }, + "type": "array", + "title": "Data" + }, + "model": { + "type": "string", + "title": "Model" + }, + "usage": { + "$ref": "#/components/schemas/OpenAIEmbeddingUsage" + } + }, + "type": "object", + "required": [ + "data", + "model", + "usage" + ], + "title": "OpenAIEmbeddingsResponse", + "description": "Response from an OpenAI-compatible embeddings request." + }, + "OpenAIFile": { + "properties": { + "type": { + "type": "string", + "const": "file", + "title": "Type", + "default": "file" + }, + "file": { + "$ref": "#/components/schemas/OpenAIFileFile" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "OpenAIFile" + }, + "OpenAIFileFile": { + "properties": { + "file_data": { + "title": "File Data", + "type": "string" + }, + "file_id": { + "title": "File Id", + "type": "string" + }, + "filename": { + "title": "Filename", + "type": "string" + } + }, + "type": "object", + "title": "OpenAIFileFile" + }, + "OpenAIFileObject": { + "properties": { + "object": { + "type": "string", + "const": "file", + "title": "Object", + "default": "file" + }, + "id": { + "type": "string", + "title": "Id" + }, + "bytes": { + "type": "integer", + "title": "Bytes" + }, + "created_at": { + "type": "integer", + "title": "Created At" + }, + "expires_at": { + "type": "integer", + "title": "Expires At" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "purpose": { + "$ref": "#/components/schemas/OpenAIFilePurpose" + } + }, + "type": "object", + "required": [ + "id", + "bytes", + "created_at", + "expires_at", + "filename", + "purpose" + ], + "title": "OpenAIFileObject", + "description": "OpenAI File object as defined in the OpenAI Files API." + }, + "OpenAIFilePurpose": { + "type": "string", + "enum": [ + "assistants", + "batch" + ], + "title": "OpenAIFilePurpose", + "description": "Valid purpose values for OpenAI Files API." + }, + "OpenAIImageURL": { + "properties": { + "url": { + "type": "string", + "title": "Url" + }, + "detail": { + "title": "Detail", + "type": "string" + } + }, + "type": "object", + "required": [ + "url" + ], + "title": "OpenAIImageURL", + "description": "Image URL specification for OpenAI-compatible chat completion messages." + }, + "OpenAIJSONSchema": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "description": { + "title": "Description", + "type": "string" + }, + "strict": { + "title": "Strict", + "type": "boolean" + }, + "schema": { + "title": "Schema", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "title": "OpenAIJSONSchema", + "description": "JSON schema specification for OpenAI-compatible structured response format." + }, + "OpenAIResponseAnnotationCitation": { + "properties": { + "type": { + "type": "string", + "const": "url_citation", + "title": "Type", + "default": "url_citation" + }, + "end_index": { + "type": "integer", + "title": "End Index" + }, + "start_index": { + "type": "integer", + "title": "Start Index" + }, + "title": { + "type": "string", + "title": "Title" + }, + "url": { + "type": "string", + "title": "Url" + } + }, + "type": "object", + "required": [ + "end_index", + "start_index", + "title", + "url" + ], + "title": "OpenAIResponseAnnotationCitation", + "description": "URL citation annotation for referencing external web resources." + }, + "OpenAIResponseAnnotationContainerFileCitation": { + "properties": { + "type": { + "type": "string", + "const": "container_file_citation", + "title": "Type", + "default": "container_file_citation" + }, + "container_id": { + "type": "string", + "title": "Container Id" + }, + "end_index": { + "type": "integer", + "title": "End Index" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "start_index": { + "type": "integer", + "title": "Start Index" + } + }, + "type": "object", + "required": [ + "container_id", + "end_index", + "file_id", + "filename", + "start_index" + ], + "title": "OpenAIResponseAnnotationContainerFileCitation" + }, + "OpenAIResponseAnnotationFileCitation": { + "properties": { + "type": { + "type": "string", + "const": "file_citation", + "title": "Type", + "default": "file_citation" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "index": { + "type": "integer", + "title": "Index" + } + }, + "type": "object", + "required": [ + "file_id", + "filename", + "index" + ], + "title": "OpenAIResponseAnnotationFileCitation", + "description": "File citation annotation for referencing specific files in response content." + }, + "OpenAIResponseAnnotationFilePath": { + "properties": { + "type": { + "type": "string", + "const": "file_path", + "title": "Type", + "default": "file_path" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "index": { + "type": "integer", + "title": "Index" + } + }, + "type": "object", + "required": [ + "file_id", + "index" + ], + "title": "OpenAIResponseAnnotationFilePath" + }, + "OpenAIResponseContentPartRefusal": { + "properties": { + "type": { + "type": "string", + "const": "refusal", + "title": "Type", + "default": "refusal" + }, + "refusal": { + "type": "string", + "title": "Refusal" + } + }, + "type": "object", + "required": [ + "refusal" + ], + "title": "OpenAIResponseContentPartRefusal", + "description": "Refusal content within a streamed response part." + }, + "OpenAIResponseError": { + "properties": { + "code": { + "type": "string", + "title": "Code" + }, + "message": { + "type": "string", + "title": "Message" + } + }, + "type": "object", + "required": [ + "code", + "message" + ], + "title": "OpenAIResponseError", + "description": "Error details for failed OpenAI response requests." + }, + "OpenAIResponseFormatJSONObject": { + "properties": { + "type": { + "type": "string", + "const": "json_object", + "title": "Type", + "default": "json_object" + } + }, + "type": "object", + "title": "OpenAIResponseFormatJSONObject", + "description": "JSON object response format for OpenAI-compatible chat completion requests." + }, + "OpenAIResponseFormatJSONSchema": { + "properties": { + "type": { + "type": "string", + "const": "json_schema", + "title": "Type", + "default": "json_schema" + }, + "json_schema": { + "$ref": "#/components/schemas/OpenAIJSONSchema" + } + }, + "type": "object", + "required": [ + "json_schema" + ], + "title": "OpenAIResponseFormatJSONSchema", + "description": "JSON schema response format for OpenAI-compatible chat completion requests." + }, + "OpenAIResponseFormatText": { + "properties": { + "type": { + "type": "string", + "const": "text", + "title": "Type", + "default": "text" + } + }, + "type": "object", + "title": "OpenAIResponseFormatText", + "description": "Text response format for OpenAI-compatible chat completion requests." + }, + "OpenAIResponseInputFunctionToolCallOutput": { + "properties": { + "call_id": { + "type": "string", + "title": "Call Id" + }, + "output": { + "type": "string", + "title": "Output" + }, + "type": { + "type": "string", + "const": "function_call_output", + "title": "Type", + "default": "function_call_output" + }, + "id": { + "title": "Id", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "type": "object", + "required": [ + "call_id", + "output" + ], + "title": "OpenAIResponseInputFunctionToolCallOutput", + "description": "This represents the output of a function call that gets passed back to the model." + }, + "OpenAIResponseInputMessageContentFile": { + "properties": { + "type": { + "type": "string", + "const": "input_file", + "title": "Type", + "default": "input_file" + }, + "file_data": { + "title": "File Data", + "type": "string" + }, + "file_id": { + "title": "File Id", + "type": "string" + }, + "file_url": { + "title": "File Url", + "type": "string" + }, + "filename": { + "title": "Filename", + "type": "string" + } + }, + "type": "object", + "title": "OpenAIResponseInputMessageContentFile", + "description": "File content for input messages in OpenAI response format." + }, + "OpenAIResponseInputMessageContentImage": { + "properties": { + "detail": { + "anyOf": [ + { + "type": "string", + "const": "low" + }, + { + "type": "string", + "const": "high" + }, + { + "type": "string", + "const": "auto" + } + ], + "title": "Detail", + "default": "auto" + }, + "type": { + "type": "string", + "const": "input_image", + "title": "Type", + "default": "input_image" + }, + "file_id": { + "title": "File Id", + "type": "string" + }, + "image_url": { + "title": "Image Url", + "type": "string" + } + }, + "type": "object", + "title": "OpenAIResponseInputMessageContentImage", + "description": "Image content for input messages in OpenAI response format." + }, + "OpenAIResponseInputMessageContentText": { + "properties": { + "text": { + "type": "string", + "title": "Text" + }, + "type": { + "type": "string", + "const": "input_text", + "title": "Type", + "default": "input_text" + } + }, + "type": "object", + "required": [ + "text" + ], + "title": "OpenAIResponseInputMessageContentText", + "description": "Text content for input messages in OpenAI response format." + }, + "OpenAIResponseInputToolFileSearch": { + "properties": { + "type": { + "type": "string", + "const": "file_search", + "title": "Type", + "default": "file_search" + }, + "vector_store_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Vector Store Ids" + }, + "filters": { + "title": "Filters", + "additionalProperties": true, + "type": "object" + }, + "max_num_results": { + "title": "Max Num Results", + "default": 10, + "type": "integer", + "maximum": 50.0, + "minimum": 1.0 + }, + "ranking_options": { + "$ref": "#/components/schemas/SearchRankingOptions" + } + }, + "type": "object", + "required": [ + "vector_store_ids" + ], + "title": "OpenAIResponseInputToolFileSearch", + "description": "File search tool configuration for OpenAI response inputs." + }, + "OpenAIResponseInputToolFunction": { + "properties": { + "type": { + "type": "string", + "const": "function", + "title": "Type", + "default": "function" + }, + "name": { + "type": "string", + "title": "Name" + }, + "description": { + "title": "Description", + "type": "string" + }, + "parameters": { + "title": "Parameters", + "additionalProperties": true, + "type": "object" + }, + "strict": { + "title": "Strict", + "type": "boolean" + } + }, + "type": "object", + "required": [ + "name", + "parameters" + ], + "title": "OpenAIResponseInputToolFunction", + "description": "Function tool configuration for OpenAI response inputs." + }, + "OpenAIResponseInputToolMCP": { + "properties": { + "type": { + "type": "string", + "const": "mcp", + "title": "Type", + "default": "mcp" + }, + "server_label": { + "type": "string", + "title": "Server Label" + }, + "server_url": { + "type": "string", + "title": "Server Url" + }, + "headers": { + "title": "Headers", + "additionalProperties": true, + "type": "object" + }, + "require_approval": { + "anyOf": [ + { + "type": "string", + "const": "always" + }, + { + "type": "string", + "const": "never" + }, + { + "$ref": "#/components/schemas/ApprovalFilter" + } + ], + "title": "Require Approval", + "default": "never" + }, + "allowed_tools": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/AllowedToolsFilter" + } + ], + "title": "Allowed Tools" + } + }, + "type": "object", + "required": [ + "server_label", + "server_url" + ], + "title": "OpenAIResponseInputToolMCP", + "description": "Model Context Protocol (MCP) tool configuration for OpenAI response inputs." + }, + "OpenAIResponseInputToolWebSearch": { + "properties": { + "type": { + "anyOf": [ + { + "type": "string", + "const": "web_search" + }, + { + "type": "string", + "const": "web_search_preview" + }, + { + "type": "string", + "const": "web_search_preview_2025_03_11" + } + ], + "title": "Type", + "default": "web_search" + }, + "search_context_size": { + "title": "Search Context Size", + "default": "medium", + "type": "string", + "pattern": "^low|medium|high$" + } + }, + "type": "object", + "title": "OpenAIResponseInputToolWebSearch", + "description": "Web search tool configuration for OpenAI response inputs." + }, + "OpenAIResponseMCPApprovalRequest": { + "properties": { + "arguments": { + "type": "string", + "title": "Arguments" + }, + "id": { + "type": "string", + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "server_label": { + "type": "string", + "title": "Server Label" + }, + "type": { + "type": "string", + "const": "mcp_approval_request", + "title": "Type", + "default": "mcp_approval_request" + } + }, + "type": "object", + "required": [ + "arguments", + "id", + "name", + "server_label" + ], + "title": "OpenAIResponseMCPApprovalRequest", + "description": "A request for human approval of a tool invocation." + }, + "OpenAIResponseMCPApprovalResponse": { + "properties": { + "approval_request_id": { + "type": "string", + "title": "Approval Request Id" + }, + "approve": { + "type": "boolean", + "title": "Approve" + }, + "type": { + "type": "string", + "const": "mcp_approval_response", + "title": "Type", + "default": "mcp_approval_response" + }, + "id": { + "title": "Id", + "type": "string" + }, + "reason": { + "title": "Reason", + "type": "string" + } + }, + "type": "object", + "required": [ + "approval_request_id", + "approve" + ], + "title": "OpenAIResponseMCPApprovalResponse", + "description": "A response to an MCP approval request." + }, + "OpenAIResponseMessage-Input": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", + "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", + "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" + } + } + }, + "type": "array" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "output_text": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText", + "refusal": "#/components/schemas/OpenAIResponseContentPartRefusal" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "role": { + "anyOf": [ + { + "type": "string", + "const": "system" + }, + { + "type": "string", + "const": "developer" + }, + { + "type": "string", + "const": "user" + }, + { + "type": "string", + "const": "assistant" + } + ], + "title": "Role" + }, + "type": { + "type": "string", + "const": "message", + "title": "Type", + "default": "message" + }, + "id": { + "title": "Id", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "type": "object", + "required": [ + "content", + "role" + ], + "title": "OpenAIResponseMessage", + "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + }, + "OpenAIResponseMessage-Output": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", + "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", + "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" + } + } + }, + "type": "array" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "output_text": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText", + "refusal": "#/components/schemas/OpenAIResponseContentPartRefusal" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "role": { + "anyOf": [ + { + "type": "string", + "const": "system" + }, + { + "type": "string", + "const": "developer" + }, + { + "type": "string", + "const": "user" + }, + { + "type": "string", + "const": "assistant" + } + ], + "title": "Role" + }, + "type": { + "type": "string", + "const": "message", + "title": "Type", + "default": "message" + }, + "id": { + "title": "Id", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "type": "object", + "required": [ + "content", + "role" + ], + "title": "OpenAIResponseMessage", + "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + }, + "OpenAIResponseObject": { + "properties": { + "created_at": { + "type": "integer", + "title": "Created At" + }, + "error": { + "$ref": "#/components/schemas/OpenAIResponseError" + }, + "id": { + "type": "string", + "title": "Id" + }, + "model": { + "type": "string", + "title": "Model" + }, + "object": { + "type": "string", + "const": "response", + "title": "Object", + "default": "response" + }, + "output": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage-Output" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", + "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", + "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", + "message": "#/components/schemas/OpenAIResponseMessage-Output", + "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + } + } + }, + "type": "array", + "title": "Output" + }, + "parallel_tool_calls": { + "type": "boolean", + "title": "Parallel Tool Calls", + "default": false + }, + "previous_response_id": { + "title": "Previous Response Id", + "type": "string" + }, + "prompt": { + "$ref": "#/components/schemas/OpenAIResponsePrompt" + }, + "status": { + "type": "string", + "title": "Status" + }, + "temperature": { + "title": "Temperature", + "type": "number" + }, + "text": { + "$ref": "#/components/schemas/OpenAIResponseText", + "default": { + "format": { + "type": "text" + } + } + }, + "top_p": { + "title": "Top P", + "type": "number" + }, + "tools": { + "title": "Tools", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" + }, + { + "$ref": "#/components/schemas/OpenAIResponseToolMCP" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "file_search": "#/components/schemas/OpenAIResponseInputToolFileSearch", + "function": "#/components/schemas/OpenAIResponseInputToolFunction", + "mcp": "#/components/schemas/OpenAIResponseToolMCP", + "web_search": "#/components/schemas/OpenAIResponseInputToolWebSearch", + "web_search_preview": "#/components/schemas/OpenAIResponseInputToolWebSearch", + "web_search_preview_2025_03_11": "#/components/schemas/OpenAIResponseInputToolWebSearch" + } + } + }, + "type": "array" + }, + "truncation": { + "title": "Truncation", + "type": "string" + }, + "usage": { + "$ref": "#/components/schemas/OpenAIResponseUsage" + }, + "instructions": { + "title": "Instructions", + "type": "string" + } + }, + "type": "object", + "required": [ + "created_at", + "id", + "model", + "output", + "status" + ], + "title": "OpenAIResponseObject", + "description": "Complete OpenAI response object containing generation results and metadata." + }, + "OpenAIResponseOutputMessageContentOutputText": { + "properties": { + "text": { + "type": "string", + "title": "Text" + }, + "type": { + "type": "string", + "const": "output_text", + "title": "Type", + "default": "output_text" + }, + "annotations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationFileCitation" + }, + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationCitation" + }, + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation" + }, + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationFilePath" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "container_file_citation": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation", + "file_citation": "#/components/schemas/OpenAIResponseAnnotationFileCitation", + "file_path": "#/components/schemas/OpenAIResponseAnnotationFilePath", + "url_citation": "#/components/schemas/OpenAIResponseAnnotationCitation" + } + } + }, + "type": "array", + "title": "Annotations" + } + }, + "type": "object", + "required": [ + "text" + ], + "title": "OpenAIResponseOutputMessageContentOutputText" + }, + "OpenAIResponseOutputMessageFileSearchToolCall": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "queries": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Queries" + }, + "status": { + "type": "string", + "title": "Status" + }, + "type": { + "type": "string", + "const": "file_search_call", + "title": "Type", + "default": "file_search_call" + }, + "results": { + "title": "Results", + "items": { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "id", + "queries", + "status" + ], + "title": "OpenAIResponseOutputMessageFileSearchToolCall", + "description": "File search tool call output message for OpenAI responses." + }, + "OpenAIResponseOutputMessageFileSearchToolCallResults": { + "properties": { + "attributes": { + "additionalProperties": true, + "type": "object", + "title": "Attributes" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "score": { + "type": "number", + "title": "Score" + }, + "text": { + "type": "string", + "title": "Text" + } + }, + "type": "object", + "required": [ + "attributes", + "file_id", + "filename", + "score", + "text" + ], + "title": "OpenAIResponseOutputMessageFileSearchToolCallResults", + "description": "Search results returned by the file search operation." + }, + "OpenAIResponseOutputMessageFunctionToolCall": { + "properties": { + "call_id": { + "type": "string", + "title": "Call Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "arguments": { + "type": "string", + "title": "Arguments" + }, + "type": { + "type": "string", + "const": "function_call", + "title": "Type", + "default": "function_call" + }, + "id": { + "title": "Id", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "type": "object", + "required": [ + "call_id", + "name", + "arguments" + ], + "title": "OpenAIResponseOutputMessageFunctionToolCall", + "description": "Function tool call output message for OpenAI responses." + }, + "OpenAIResponseOutputMessageMCPCall": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "type": { + "type": "string", + "const": "mcp_call", + "title": "Type", + "default": "mcp_call" + }, + "arguments": { + "type": "string", + "title": "Arguments" + }, + "name": { + "type": "string", + "title": "Name" + }, + "server_label": { + "type": "string", + "title": "Server Label" + }, + "error": { + "title": "Error", + "type": "string" + }, + "output": { + "title": "Output", + "type": "string" + } + }, + "type": "object", + "required": [ + "id", + "arguments", + "name", + "server_label" + ], + "title": "OpenAIResponseOutputMessageMCPCall", + "description": "Model Context Protocol (MCP) call output message for OpenAI responses." + }, + "OpenAIResponseOutputMessageMCPListTools": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "type": { + "type": "string", + "const": "mcp_list_tools", + "title": "Type", + "default": "mcp_list_tools" + }, + "server_label": { + "type": "string", + "title": "Server Label" + }, + "tools": { + "items": { + "$ref": "#/components/schemas/MCPListToolsTool" + }, + "type": "array", + "title": "Tools" + } + }, + "type": "object", + "required": [ + "id", + "server_label", + "tools" + ], + "title": "OpenAIResponseOutputMessageMCPListTools", + "description": "MCP list tools output message containing available tools from an MCP server." + }, + "OpenAIResponseOutputMessageWebSearchToolCall": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "status": { + "type": "string", + "title": "Status" + }, + "type": { + "type": "string", + "const": "web_search_call", + "title": "Type", + "default": "web_search_call" + } + }, + "type": "object", + "required": [ + "id", + "status" + ], + "title": "OpenAIResponseOutputMessageWebSearchToolCall", + "description": "Web search tool call output message for OpenAI responses." + }, + "OpenAIResponsePrompt": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "variables": { + "title": "Variables", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", + "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", + "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" + } + } + }, + "type": "object" + }, + "version": { + "title": "Version", + "type": "string" + } + }, + "type": "object", + "required": [ + "id" + ], + "title": "OpenAIResponsePrompt", + "description": "OpenAI compatible Prompt object that is used in OpenAI responses." + }, + "OpenAIResponseText": { + "properties": { + "format": { + "$ref": "#/components/schemas/OpenAIResponseTextFormat" + } + }, + "type": "object", + "title": "OpenAIResponseText", + "description": "Text response configuration for OpenAI responses." + }, + "OpenAIResponseTextFormat": { + "properties": { + "type": { + "anyOf": [ + { + "type": "string", + "const": "text" + }, + { + "type": "string", + "const": "json_schema" + }, + { + "type": "string", + "const": "json_object" + } + ], + "title": "Type" + }, + "name": { + "title": "Name", + "type": "string" + }, + "schema": { + "title": "Schema", + "additionalProperties": true, + "type": "object" + }, + "description": { + "title": "Description", + "type": "string" + }, + "strict": { + "title": "Strict", + "type": "boolean" + } + }, + "type": "object", + "title": "OpenAIResponseTextFormat", + "description": "Configuration for Responses API text format." + }, + "OpenAIResponseToolMCP": { + "properties": { + "type": { + "type": "string", + "const": "mcp", + "title": "Type", + "default": "mcp" + }, + "server_label": { + "type": "string", + "title": "Server Label" + }, + "allowed_tools": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/AllowedToolsFilter" + } + ], + "title": "Allowed Tools" + } + }, + "type": "object", + "required": [ + "server_label" + ], + "title": "OpenAIResponseToolMCP", + "description": "Model Context Protocol (MCP) tool configuration for OpenAI response object." + }, + "OpenAIResponseUsage": { + "properties": { + "input_tokens": { + "type": "integer", + "title": "Input Tokens" + }, + "output_tokens": { + "type": "integer", + "title": "Output Tokens" + }, + "total_tokens": { + "type": "integer", + "title": "Total Tokens" + }, + "input_tokens_details": { + "$ref": "#/components/schemas/OpenAIResponseUsageInputTokensDetails" + }, + "output_tokens_details": { + "$ref": "#/components/schemas/OpenAIResponseUsageOutputTokensDetails" + } + }, + "type": "object", + "required": [ + "input_tokens", + "output_tokens", + "total_tokens" + ], + "title": "OpenAIResponseUsage", + "description": "Usage information for OpenAI response." + }, + "OpenAIResponseUsageInputTokensDetails": { + "properties": { + "cached_tokens": { + "title": "Cached Tokens", + "type": "integer" + } + }, + "type": "object", + "title": "OpenAIResponseUsageInputTokensDetails", + "description": "Token details for input tokens in OpenAI response usage." + }, + "OpenAIResponseUsageOutputTokensDetails": { + "properties": { + "reasoning_tokens": { + "title": "Reasoning Tokens", + "type": "integer" + } + }, + "type": "object", + "title": "OpenAIResponseUsageOutputTokensDetails", + "description": "Token details for output tokens in OpenAI response usage." + }, + "OpenAISystemMessageParam": { + "properties": { + "role": { + "type": "string", + "const": "system", + "title": "Role", + "default": "system" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "OpenAISystemMessageParam", + "description": "A system message providing instructions or context to the model." + }, + "OpenAITokenLogProb": { + "properties": { + "token": { + "type": "string", + "title": "Token" + }, + "bytes": { + "title": "Bytes", + "items": { + "type": "integer" + }, + "type": "array" + }, + "logprob": { + "type": "number", + "title": "Logprob" + }, + "top_logprobs": { + "items": { + "$ref": "#/components/schemas/OpenAITopLogProb" + }, + "type": "array", + "title": "Top Logprobs" + } + }, + "type": "object", + "required": [ + "token", + "logprob", + "top_logprobs" + ], + "title": "OpenAITokenLogProb", + "description": "The log probability for a token from an OpenAI-compatible chat completion response." + }, + "OpenAIToolMessageParam": { + "properties": { + "role": { + "type": "string", + "const": "tool", + "title": "Role", + "default": "tool" + }, + "tool_call_id": { + "type": "string", + "title": "Tool Call Id" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content" + } + }, + "type": "object", + "required": [ + "tool_call_id", + "content" + ], + "title": "OpenAIToolMessageParam", + "description": "A message representing the result of a tool invocation in an OpenAI-compatible chat completion request." + }, + "OpenAITopLogProb": { + "properties": { + "token": { + "type": "string", + "title": "Token" + }, + "bytes": { + "title": "Bytes", + "items": { + "type": "integer" + }, + "type": "array" + }, + "logprob": { + "type": "number", + "title": "Logprob" + } + }, + "type": "object", + "required": [ + "token", + "logprob" + ], + "title": "OpenAITopLogProb", + "description": "The top log probability for a token from an OpenAI-compatible chat completion response." + }, + "OpenAIUserMessageParam-Input": { + "properties": { + "role": { + "type": "string", + "const": "user", + "title": "Role", + "default": "user" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" + }, + { + "$ref": "#/components/schemas/OpenAIFile" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "file": "#/components/schemas/OpenAIFile", + "image_url": "#/components/schemas/OpenAIChatCompletionContentPartImageParam", + "text": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "OpenAIUserMessageParam", + "description": "A message from the user in an OpenAI-compatible chat completion request." + }, + "OpenAIUserMessageParam-Output": { + "properties": { + "role": { + "type": "string", + "const": "user", + "title": "Role", + "default": "user" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" + }, + { + "$ref": "#/components/schemas/OpenAIFile" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "file": "#/components/schemas/OpenAIFile", + "image_url": "#/components/schemas/OpenAIChatCompletionContentPartImageParam", + "text": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "OpenAIUserMessageParam", + "description": "A message from the user in an OpenAI-compatible chat completion request." + }, + "Order": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "title": "Order", + "description": "Sort order for paginated responses." + }, + "OutputTokensDetails": { + "properties": { + "reasoning_tokens": { + "type": "integer", + "title": "Reasoning Tokens" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "reasoning_tokens" + ], + "title": "OutputTokensDetails" + }, + "Prompt": { + "properties": { + "prompt": { + "title": "Prompt", + "description": "The system prompt with variable placeholders", + "type": "string" + }, + "version": { + "type": "integer", + "minimum": 1.0, + "title": "Version", + "description": "Version (integer starting at 1, incremented on save)" + }, + "prompt_id": { + "type": "string", + "title": "Prompt Id", + "description": "Unique identifier in format 'pmpt_<48-digit-hash>'" + }, + "variables": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Variables", + "description": "List of variable names that can be used in the prompt template" + }, + "is_default": { + "type": "boolean", + "title": "Is Default", + "description": "Boolean indicating whether this version is the default version", + "default": false + } + }, + "type": "object", + "required": [ + "version", + "prompt_id" + ], + "title": "Prompt", + "description": "A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack." + }, + "ProviderInfo": { + "properties": { + "api": { + "type": "string", + "title": "Api" + }, + "provider_id": { + "type": "string", + "title": "Provider Id" + }, + "provider_type": { + "type": "string", + "title": "Provider Type" + }, + "config": { + "additionalProperties": true, + "type": "object", + "title": "Config" + }, + "health": { + "additionalProperties": true, + "type": "object", + "title": "Health" + } + }, + "type": "object", + "required": [ + "api", + "provider_id", + "provider_type", + "config", + "health" + ], + "title": "ProviderInfo", + "description": "Information about a registered provider including its configuration and health status." + }, + "QueryChunksResponse": { + "properties": { + "chunks": { + "items": { + "$ref": "#/components/schemas/Chunk-Output" + }, + "type": "array", + "title": "Chunks" + }, + "scores": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Scores" + } + }, + "type": "object", + "required": [ + "chunks", + "scores" + ], + "title": "QueryChunksResponse", + "description": "Response from querying chunks in a vector database." + }, + "RAGQueryConfig": { + "properties": { + "query_generator_config": { + "oneOf": [ + { + "$ref": "#/components/schemas/DefaultRAGQueryGeneratorConfig" + }, + { + "$ref": "#/components/schemas/LLMRAGQueryGeneratorConfig" + } + ], + "title": "Query Generator Config", + "default": { + "type": "default", + "separator": " " + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "default": "#/components/schemas/DefaultRAGQueryGeneratorConfig", + "llm": "#/components/schemas/LLMRAGQueryGeneratorConfig" + } + } + }, + "max_tokens_in_context": { + "type": "integer", + "title": "Max Tokens In Context", + "default": 4096 + }, + "max_chunks": { + "type": "integer", + "title": "Max Chunks", + "default": 5 + }, + "chunk_template": { + "type": "string", + "title": "Chunk Template", + "default": "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n" + }, + "mode": { + "default": "vector", + "$ref": "#/components/schemas/RAGSearchMode" + }, + "ranker": { + "title": "Ranker", + "oneOf": [ + { + "$ref": "#/components/schemas/RRFRanker" + }, + { + "$ref": "#/components/schemas/WeightedRanker" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "rrf": "#/components/schemas/RRFRanker", + "weighted": "#/components/schemas/WeightedRanker" + } + } + } + }, + "type": "object", + "title": "RAGQueryConfig", + "description": "Configuration for the RAG query generation." + }, + "RAGQueryResult": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + } + }, + "type": "object", + "title": "RAGQueryResult", + "description": "Result of a RAG query containing retrieved content and metadata." + }, + "RAGSearchMode": { + "type": "string", + "enum": [ + "vector", + "keyword", + "hybrid" + ], + "title": "RAGSearchMode", + "description": "Search modes for RAG query retrieval:\n- VECTOR: Uses vector similarity search for semantic matching\n- KEYWORD: Uses keyword-based search for exact matching\n- HYBRID: Combines both vector and keyword search for better results" + }, + "RRFRanker": { + "properties": { + "type": { + "type": "string", + "const": "rrf", + "title": "Type", + "default": "rrf" + }, + "impact_factor": { + "type": "number", + "title": "Impact Factor", + "default": 60.0, + "minimum": 0.0 + } + }, + "type": "object", + "title": "RRFRanker", + "description": "Reciprocal Rank Fusion (RRF) ranker configuration." + }, + "RegexParserScoringFnParams": { + "properties": { + "type": { + "type": "string", + "const": "regex_parser", + "title": "Type", + "default": "regex_parser" + }, + "parsing_regexes": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Parsing Regexes", + "description": "Regex to extract the answer from generated response" + }, + "aggregation_functions": { + "items": { + "$ref": "#/components/schemas/AggregationFunctionType" + }, + "type": "array", + "title": "Aggregation Functions", + "description": "Aggregation functions to apply to the scores of each row" + } + }, + "type": "object", + "title": "RegexParserScoringFnParams", + "description": "Parameters for regex parser scoring function configuration." + }, + "RouteInfo": { + "properties": { + "route": { + "type": "string", + "title": "Route" + }, + "method": { + "type": "string", + "title": "Method" + }, + "provider_types": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Provider Types" + } + }, + "type": "object", + "required": [ + "route", + "method", + "provider_types" + ], + "title": "RouteInfo", + "description": "Information about an API route including its path, method, and implementing providers." + }, + "RunShieldResponse": { + "properties": { + "violation": { + "$ref": "#/components/schemas/SafetyViolation" + } + }, + "type": "object", + "title": "RunShieldResponse", + "description": "Response from running a safety shield." + }, + "SafetyViolation": { + "properties": { + "violation_level": { + "$ref": "#/components/schemas/ViolationLevel" + }, + "user_message": { + "title": "User Message", + "type": "string" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "violation_level" + ], + "title": "SafetyViolation", + "description": "Details of a safety violation detected by content moderation." + }, + "ScoreBatchResponse": { + "properties": { + "dataset_id": { + "title": "Dataset Id", + "type": "string" + }, + "results": { + "additionalProperties": { + "$ref": "#/components/schemas/ScoringResult" + }, + "type": "object", + "title": "Results" + } + }, + "type": "object", + "required": [ + "results" + ], + "title": "ScoreBatchResponse", + "description": "Response from batch scoring operations on datasets." + }, + "ScoreResponse": { + "properties": { + "results": { + "additionalProperties": { + "$ref": "#/components/schemas/ScoringResult" + }, + "type": "object", + "title": "Results" + } + }, + "type": "object", + "required": [ + "results" + ], + "title": "ScoreResponse", + "description": "The response from scoring." + }, + "ScoringFn-Output": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "scoring_function", + "title": "Type", + "default": "scoring_function" + }, + "description": { + "title": "Description", + "type": "string" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata", + "description": "Any additional metadata for this definition" + }, + "return_type": { + "oneOf": [ + { + "$ref": "#/components/schemas/StringType" + }, + { + "$ref": "#/components/schemas/NumberType" + }, + { + "$ref": "#/components/schemas/BooleanType" + }, + { + "$ref": "#/components/schemas/ArrayType" + }, + { + "$ref": "#/components/schemas/ObjectType" + }, + { + "$ref": "#/components/schemas/JsonType" + }, + { + "$ref": "#/components/schemas/UnionType" + }, + { + "$ref": "#/components/schemas/ChatCompletionInputType" + }, + { + "$ref": "#/components/schemas/CompletionInputType" + }, + { + "$ref": "#/components/schemas/AgentTurnInputType" + } + ], + "title": "Return Type", + "description": "The return type of the deterministic function", + "discriminator": { + "propertyName": "type", + "mapping": { + "agent_turn_input": "#/components/schemas/AgentTurnInputType", + "array": "#/components/schemas/ArrayType", + "boolean": "#/components/schemas/BooleanType", + "chat_completion_input": "#/components/schemas/ChatCompletionInputType", + "completion_input": "#/components/schemas/CompletionInputType", + "json": "#/components/schemas/JsonType", + "number": "#/components/schemas/NumberType", + "object": "#/components/schemas/ObjectType", + "string": "#/components/schemas/StringType", + "union": "#/components/schemas/UnionType" + } + } + }, + "params": { + "title": "Params", + "description": "The parameters for the scoring function for benchmark eval, these can be overridden for app eval", + "oneOf": [ + { + "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" + }, + { + "$ref": "#/components/schemas/RegexParserScoringFnParams" + }, + { + "$ref": "#/components/schemas/BasicScoringFnParams" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "basic": "#/components/schemas/BasicScoringFnParams", + "llm_as_judge": "#/components/schemas/LLMAsJudgeScoringFnParams", + "regex_parser": "#/components/schemas/RegexParserScoringFnParams" + } + } + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id", + "return_type" + ], + "title": "ScoringFn", + "description": "A scoring function resource for evaluating model outputs." + }, + "ScoringResult": { + "properties": { + "score_rows": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Score Rows" + }, + "aggregated_results": { + "additionalProperties": true, + "type": "object", + "title": "Aggregated Results" + } + }, + "type": "object", + "required": [ + "score_rows", + "aggregated_results" + ], + "title": "ScoringResult", + "description": "A scoring result for a single row." + }, + "SearchRankingOptions": { + "properties": { + "ranker": { + "title": "Ranker", + "type": "string" + }, + "score_threshold": { + "title": "Score Threshold", + "default": 0.0, + "type": "number" + } + }, + "type": "object", + "title": "SearchRankingOptions", + "description": "Options for ranking and filtering search results." + }, + "Shield": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "shield", + "title": "Type", + "default": "shield" + }, + "params": { + "title": "Params", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id" + ], + "title": "Shield", + "description": "A safety shield resource that can be used to check content." + }, + "StringType": { + "properties": { + "type": { + "type": "string", + "const": "string", + "title": "Type", + "default": "string" + } + }, + "type": "object", + "title": "StringType", + "description": "Parameter type for string values." + }, + "TextContentItem": { + "properties": { + "type": { + "type": "string", + "const": "text", + "title": "Type", + "default": "text" + }, + "text": { + "type": "string", + "title": "Text" + } + }, + "type": "object", + "required": [ + "text" + ], + "title": "TextContentItem", + "description": "A text content item" + }, + "ToolDef": { + "properties": { + "toolgroup_id": { + "title": "Toolgroup Id", + "type": "string" + }, + "name": { + "type": "string", + "title": "Name" + }, + "description": { + "title": "Description", + "type": "string" + }, + "input_schema": { + "title": "Input Schema", + "additionalProperties": true, + "type": "object" + }, + "output_schema": { + "title": "Output Schema", + "additionalProperties": true, + "type": "object" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "required": [ + "name" + ], + "title": "ToolDef", + "description": "Tool definition used in runtime contexts." + }, + "ToolGroup": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "tool_group", + "title": "Type", + "default": "tool_group" + }, + "mcp_endpoint": { + "$ref": "#/components/schemas/URL" + }, + "args": { + "title": "Args", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id" + ], + "title": "ToolGroup", + "description": "A group of related tools managed together." + }, + "ToolInvocationResult": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "error_message": { + "title": "Error Message", + "type": "string" + }, + "error_code": { + "title": "Error Code", + "type": "integer" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "title": "ToolInvocationResult", + "description": "Result of a tool invocation." + }, + "URL": { + "properties": { + "uri": { + "type": "string", + "title": "Uri" + } + }, + "type": "object", + "required": [ + "uri" + ], + "title": "URL", + "description": "A URL reference to external content." + }, + "UnionType": { + "properties": { + "type": { + "type": "string", + "const": "union", + "title": "Type", + "default": "union" + } + }, + "type": "object", + "title": "UnionType", + "description": "Parameter type for union values." + }, + "VectorStoreChunkingStrategyAuto": { + "properties": { + "type": { + "type": "string", + "const": "auto", + "title": "Type", + "default": "auto" + } + }, + "type": "object", + "title": "VectorStoreChunkingStrategyAuto", + "description": "Automatic chunking strategy for vector store files." + }, + "VectorStoreChunkingStrategyStatic": { + "properties": { + "type": { + "type": "string", + "const": "static", + "title": "Type", + "default": "static" + }, + "static": { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyStaticConfig" + } + }, + "type": "object", + "required": [ + "static" + ], + "title": "VectorStoreChunkingStrategyStatic", + "description": "Static chunking strategy with configurable parameters." + }, + "VectorStoreChunkingStrategyStaticConfig": { + "properties": { + "chunk_overlap_tokens": { + "type": "integer", + "title": "Chunk Overlap Tokens", + "default": 400 + }, + "max_chunk_size_tokens": { + "type": "integer", + "maximum": 4096.0, + "minimum": 100.0, + "title": "Max Chunk Size Tokens", + "default": 800 + } + }, + "type": "object", + "title": "VectorStoreChunkingStrategyStaticConfig", + "description": "Configuration for static chunking strategy." + }, + "VectorStoreContent": { + "properties": { + "type": { + "type": "string", + "const": "text", + "title": "Type" + }, + "text": { + "type": "string", + "title": "Text" + } + }, + "type": "object", + "required": [ + "type", + "text" + ], + "title": "VectorStoreContent", + "description": "Content item from a vector store file or search result." + }, + "VectorStoreFileBatchObject": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "object": { + "type": "string", + "title": "Object", + "default": "vector_store.file_batch" + }, + "created_at": { + "type": "integer", + "title": "Created At" + }, + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "status": { + "anyOf": [ + { + "type": "string", + "const": "completed" + }, + { + "type": "string", + "const": "in_progress" + }, + { + "type": "string", + "const": "cancelled" + }, + { + "type": "string", + "const": "failed" + } + ], + "title": "Status" + }, + "file_counts": { + "$ref": "#/components/schemas/VectorStoreFileCounts" + } + }, + "type": "object", + "required": [ + "id", + "created_at", + "vector_store_id", + "status", + "file_counts" + ], + "title": "VectorStoreFileBatchObject", + "description": "OpenAI Vector Store File Batch object." + }, + "VectorStoreFileCounts": { + "properties": { + "completed": { + "type": "integer", + "title": "Completed" + }, + "cancelled": { + "type": "integer", + "title": "Cancelled" + }, + "failed": { + "type": "integer", + "title": "Failed" + }, + "in_progress": { + "type": "integer", + "title": "In Progress" + }, + "total": { + "type": "integer", + "title": "Total" + } + }, + "type": "object", + "required": [ + "completed", + "cancelled", + "failed", + "in_progress", + "total" + ], + "title": "VectorStoreFileCounts", + "description": "File processing status counts for a vector store." + }, + "VectorStoreFileLastError": { + "properties": { + "code": { + "anyOf": [ + { + "type": "string", + "const": "server_error" + }, + { + "type": "string", + "const": "rate_limit_exceeded" + } + ], + "title": "Code" + }, + "message": { + "type": "string", + "title": "Message" + } + }, + "type": "object", + "required": [ + "code", + "message" + ], + "title": "VectorStoreFileLastError", + "description": "Error information for failed vector store file processing." + }, + "VectorStoreFileObject": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "object": { + "type": "string", + "title": "Object", + "default": "vector_store.file" + }, + "attributes": { + "additionalProperties": true, + "type": "object", + "title": "Attributes" + }, + "chunking_strategy": { + "oneOf": [ + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" + }, + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + ], + "title": "Chunking Strategy", + "discriminator": { + "propertyName": "type", + "mapping": { + "auto": "#/components/schemas/VectorStoreChunkingStrategyAuto", + "static": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + } + }, + "created_at": { + "type": "integer", + "title": "Created At" + }, + "last_error": { + "$ref": "#/components/schemas/VectorStoreFileLastError" + }, + "status": { + "anyOf": [ + { + "type": "string", + "const": "completed" + }, + { + "type": "string", + "const": "in_progress" + }, + { + "type": "string", + "const": "cancelled" + }, + { + "type": "string", + "const": "failed" + } + ], + "title": "Status" + }, + "usage_bytes": { + "type": "integer", + "title": "Usage Bytes", + "default": 0 + }, + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + } + }, + "type": "object", + "required": [ + "id", + "chunking_strategy", + "created_at", + "status", + "vector_store_id" + ], + "title": "VectorStoreFileObject", + "description": "OpenAI Vector Store File object." + }, + "VectorStoreObject": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "object": { + "type": "string", + "title": "Object", + "default": "vector_store" + }, + "created_at": { + "type": "integer", + "title": "Created At" + }, + "name": { + "title": "Name", + "type": "string" + }, + "usage_bytes": { + "type": "integer", + "title": "Usage Bytes", + "default": 0 + }, + "file_counts": { + "$ref": "#/components/schemas/VectorStoreFileCounts" + }, + "status": { + "type": "string", + "title": "Status", + "default": "completed" + }, + "expires_after": { + "title": "Expires After", + "additionalProperties": true, + "type": "object" + }, + "expires_at": { + "title": "Expires At", + "type": "integer" + }, + "last_active_at": { + "title": "Last Active At", + "type": "integer" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "id", + "created_at", + "file_counts" + ], + "title": "VectorStoreObject", + "description": "OpenAI Vector Store object." + }, + "VectorStoreSearchResponse": { + "properties": { + "file_id": { + "type": "string", + "title": "File Id" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "score": { + "type": "number", + "title": "Score" + }, + "attributes": { + "title": "Attributes", + "additionalProperties": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "object" + }, + "content": { + "items": { + "$ref": "#/components/schemas/VectorStoreContent" + }, + "type": "array", + "title": "Content" + } + }, + "type": "object", + "required": [ + "file_id", + "filename", + "score", + "content" + ], + "title": "VectorStoreSearchResponse", + "description": "Response from searching a vector store." + }, + "VectorStoreSearchResponsePage": { + "properties": { + "object": { + "type": "string", + "title": "Object", + "default": "vector_store.search_results.page" + }, + "search_query": { + "type": "string", + "title": "Search Query" + }, + "data": { + "items": { + "$ref": "#/components/schemas/VectorStoreSearchResponse" + }, + "type": "array", + "title": "Data" + }, + "has_more": { + "type": "boolean", + "title": "Has More", + "default": false + }, + "next_page": { + "title": "Next Page", + "type": "string" + } + }, + "type": "object", + "required": [ + "search_query", + "data" + ], + "title": "VectorStoreSearchResponsePage", + "description": "Paginated response from searching a vector store." + }, + "VersionInfo": { + "properties": { + "version": { + "type": "string", + "title": "Version" + } + }, + "type": "object", + "required": [ + "version" + ], + "title": "VersionInfo", + "description": "Version information for the service." + }, + "ViolationLevel": { + "type": "string", + "enum": [ + "info", + "warn", + "error" + ], + "title": "ViolationLevel", + "description": "Severity level of a safety violation." + }, + "WeightedRanker": { + "properties": { + "type": { + "type": "string", + "const": "weighted", + "title": "Type", + "default": "weighted" + }, + "alpha": { + "type": "number", + "maximum": 1.0, + "minimum": 0.0, + "title": "Alpha", + "description": "Weight factor between 0 and 1. 0 means only keyword scores, 1 means only vector scores.", + "default": 0.5 + } + }, + "type": "object", + "title": "WeightedRanker", + "description": "Weighted ranker configuration that combines vector and keyword scores." + }, + "_URLOrData": { + "properties": { + "url": { + "$ref": "#/components/schemas/URL" + }, + "data": { + "contentEncoding": "base64", + "title": "Data", + "type": "string" + } + }, + "type": "object", + "title": "_URLOrData", + "description": "A URL or a base64 encoded string" + }, + "_batches_Request": { + "properties": { + "input_file_id": { + "type": "string", + "title": "Input File Id" + }, + "endpoint": { + "type": "string", + "title": "Endpoint" + }, + "completion_window": { + "type": "string", + "title": "Completion Window" + }, + "metadata": { + "type": "string", + "title": "Metadata" + }, + "idempotency_key": { + "type": "string", + "title": "Idempotency Key" + } + }, + "type": "object", + "required": [ + "input_file_id", + "endpoint", + "completion_window", + "metadata", + "idempotency_key" + ], + "title": "_batches_Request" + }, + "_batches_batch_id_cancel_Request": { + "properties": { + "batch_id": { + "type": "string", + "title": "Batch Id" + } + }, + "type": "object", + "required": [ + "batch_id" + ], + "title": "_batches_batch_id_cancel_Request" + }, + "_conversations_Request": { + "properties": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage-Input" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + } + ], + "title": "Items", + "discriminator": { + "propertyName": "type", + "mapping": { + "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", + "function_call_output": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput", + "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", + "mcp_approval_response": "#/components/schemas/OpenAIResponseMCPApprovalResponse", + "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", + "message": "#/components/schemas/OpenAIResponseMessage-Input", + "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + } + } + }, + "metadata": { + "type": "string", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "items", + "metadata" + ], + "title": "_conversations_Request" + }, + "_conversations_conversation_id_Request": { + "properties": { + "conversation_id": { + "type": "string", + "title": "Conversation Id" + }, + "metadata": { + "type": "string", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "conversation_id", + "metadata" + ], + "title": "_conversations_conversation_id_Request" + }, + "_conversations_conversation_id_items_Request": { + "properties": { + "conversation_id": { + "type": "string", + "title": "Conversation Id" + }, + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage-Input" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + } + ], + "title": "Items" + } + }, + "type": "object", + "required": [ + "conversation_id", + "items" + ], + "title": "_conversations_conversation_id_items_Request" + }, + "_models_Request": { + "properties": { + "model_id": { + "type": "string", + "title": "Model Id" + }, + "provider_model_id": { + "type": "string", + "title": "Provider Model Id" + }, + "provider_id": { + "type": "string", + "title": "Provider Id" + }, + "metadata": { + "type": "string", + "title": "Metadata" + }, + "model_type": { + "$ref": "#/components/schemas/ModelType" + } + }, + "type": "object", + "required": [ + "model_id", + "provider_model_id", + "provider_id", + "metadata", + "model_type" + ], + "title": "_models_Request" + }, + "_moderations_Request": { + "properties": { + "input": { + "type": "string", + "title": "Input" + }, + "model": { + "type": "string", + "title": "Model" + } + }, + "type": "object", + "required": [ + "input", + "model" + ], + "title": "_moderations_Request" + }, + "_prompts_Request": { + "properties": { + "prompt": { + "type": "string", + "title": "Prompt" + }, + "variables": { + "type": "string", + "title": "Variables" + } + }, + "type": "object", + "required": [ + "prompt", + "variables" + ], + "title": "_prompts_Request" + }, + "_prompts_prompt_id_Request": { + "properties": { + "prompt_id": { + "type": "string", + "title": "Prompt Id" + }, + "prompt": { + "type": "string", + "title": "Prompt" + }, + "version": { + "type": "integer", + "title": "Version" + }, + "variables": { + "type": "string", + "title": "Variables" + }, + "set_as_default": { + "type": "boolean", + "title": "Set As Default", + "default": true + } + }, + "type": "object", + "required": [ + "prompt_id", + "prompt", + "version", + "variables" + ], + "title": "_prompts_prompt_id_Request" + }, + "_prompts_prompt_id_set_default_version_Request": { + "properties": { + "prompt_id": { + "type": "string", + "title": "Prompt Id" + }, + "version": { + "type": "integer", + "title": "Version" + } + }, + "type": "object", + "required": [ + "prompt_id", + "version" + ], + "title": "_prompts_prompt_id_set_default_version_Request" + }, + "_responses_Request": { + "properties": { + "input": { + "type": "string", + "title": "Input" + }, + "model": { + "type": "string", + "title": "Model" + }, + "prompt": { + "$ref": "#/components/schemas/OpenAIResponsePrompt" + }, + "instructions": { + "type": "string", + "title": "Instructions" + }, + "previous_response_id": { + "type": "string", + "title": "Previous Response Id" + }, + "conversation": { + "type": "string", + "title": "Conversation" + }, + "store": { + "type": "boolean", + "title": "Store", + "default": true + }, + "stream": { + "type": "boolean", + "title": "Stream", + "default": false + }, + "temperature": { + "type": "number", + "title": "Temperature" + }, + "text": { + "$ref": "#/components/schemas/OpenAIResponseText" + }, + "tools": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolMCP" + } + ], + "title": "Tools", + "discriminator": { + "propertyName": "type", + "mapping": { + "file_search": "#/components/schemas/OpenAIResponseInputToolFileSearch", + "function": "#/components/schemas/OpenAIResponseInputToolFunction", + "mcp": "#/components/schemas/OpenAIResponseInputToolMCP", + "web_search": "#/components/schemas/OpenAIResponseInputToolWebSearch", + "web_search_preview": "#/components/schemas/OpenAIResponseInputToolWebSearch", + "web_search_preview_2025_03_11": "#/components/schemas/OpenAIResponseInputToolWebSearch" + } + } + }, + "include": { + "type": "string", + "title": "Include" + }, + "max_infer_iters": { + "type": "integer", + "title": "Max Infer Iters", + "default": 10 + } + }, + "type": "object", + "required": [ + "input", + "model", + "prompt", + "instructions", + "previous_response_id", + "conversation", + "temperature", + "text", + "tools", + "include" + ], + "title": "_responses_Request" + }, + "_scoring_score_Request": { + "properties": { + "input_rows": { + "type": "string", + "title": "Input Rows" + }, + "scoring_functions": { + "type": "string", + "title": "Scoring Functions" + } + }, + "type": "object", + "required": [ + "input_rows", + "scoring_functions" + ], + "title": "_scoring_score_Request" + }, + "_scoring_score_batch_Request": { + "properties": { + "dataset_id": { + "type": "string", + "title": "Dataset Id" + }, + "scoring_functions": { + "type": "string", + "title": "Scoring Functions" + }, + "save_results_dataset": { + "type": "boolean", + "title": "Save Results Dataset", + "default": false + } + }, + "type": "object", + "required": [ + "dataset_id", + "scoring_functions" + ], + "title": "_scoring_score_batch_Request" + }, + "_shields_Request": { + "properties": { + "shield_id": { + "type": "string", + "title": "Shield Id" + }, + "provider_shield_id": { + "type": "string", + "title": "Provider Shield Id" + }, + "provider_id": { + "type": "string", + "title": "Provider Id" + }, + "params": { + "type": "string", + "title": "Params" + } + }, + "type": "object", + "required": [ + "shield_id", + "provider_shield_id", + "provider_id", + "params" + ], + "title": "_shields_Request" + }, + "_tool_runtime_invoke_Request": { + "properties": { + "tool_name": { + "type": "string", + "title": "Tool Name" + }, + "kwargs": { + "type": "string", + "title": "Kwargs" + } + }, + "type": "object", + "required": [ + "tool_name", + "kwargs" + ], + "title": "_tool_runtime_invoke_Request" + }, + "_tool_runtime_rag_tool_query_Request": { + "properties": { + "content": { + "type": "string", + "title": "Content" + }, + "vector_store_ids": { + "type": "string", + "title": "Vector Store Ids" + }, + "query_config": { + "$ref": "#/components/schemas/RAGQueryConfig" + } + }, + "type": "object", + "required": [ + "content", + "vector_store_ids", + "query_config" + ], + "title": "_tool_runtime_rag_tool_query_Request" + }, + "_vector_io_query_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "query": { + "type": "string", + "title": "Query" + }, + "params": { + "type": "string", + "title": "Params" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "query", + "params" + ], + "title": "_vector_io_query_Request" + }, + "_vector_stores_vector_store_id_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "expires_after": { + "type": "string", + "title": "Expires After" + }, + "metadata": { + "type": "string", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "name", + "expires_after", + "metadata" + ], + "title": "_vector_stores_vector_store_id_Request" + }, + "_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request": { + "properties": { + "batch_id": { + "type": "string", + "title": "Batch Id" + }, + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + } + }, + "type": "object", + "required": [ + "batch_id", + "vector_store_id" + ], + "title": "_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request" + }, + "_vector_stores_vector_store_id_files_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "attributes": { + "type": "string", + "title": "Attributes" + }, + "chunking_strategy": { + "anyOf": [ + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" + }, + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + ], + "title": "Chunking Strategy" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "file_id", + "attributes", + "chunking_strategy" + ], + "title": "_vector_stores_vector_store_id_files_Request" + }, + "_vector_stores_vector_store_id_files_file_id_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "attributes": { + "type": "string", + "title": "Attributes" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "file_id", + "attributes" + ], + "title": "_vector_stores_vector_store_id_files_file_id_Request" + }, + "_vector_stores_vector_store_id_search_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "query": { + "type": "string", + "title": "Query" + }, + "filters": { + "type": "string", + "title": "Filters" + }, + "max_num_results": { + "type": "integer", + "title": "Max Num Results", + "default": 10 + }, + "ranking_options": { + "$ref": "#/components/schemas/SearchRankingOptions" + }, + "rewrite_query": { + "type": "boolean", + "title": "Rewrite Query", + "default": false + }, + "search_mode": { + "type": "string", + "title": "Search Mode", + "default": "vector" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "query", + "filters", + "ranking_options" + ], + "title": "_vector_stores_vector_store_id_search_Request" + }, + "Error": { + "description": "Error response from the API. Roughly follows RFC 7807.", + "properties": { + "status": { + "title": "Status", + "type": "integer" + }, + "title": { + "title": "Title", + "type": "string" + }, + "detail": { + "title": "Detail", + "type": "string" + }, + "instance": { + "title": "Instance", + "type": "string", + "nullable": true + } + }, + "required": [ + "status", + "title", + "detail" + ], + "title": "Error", + "type": "object" + }, + "ListOpenAIResponseInputItem": { + "description": "List container for OpenAI response input items.", + "properties": { + "data": { + "items": { + "anyOf": [ + { + "discriminator": { + "mapping": { + "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", + "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", + "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", + "message": "#/$defs/OpenAIResponseMessage", + "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + } + ] + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + } + ] + }, + "title": "Data", + "type": "array" + }, + "object": { + "const": "list", + "default": "list", + "title": "Object", + "type": "string" + } + }, + "required": [ + "data" + ], + "title": "ListOpenAIResponseInputItem", + "type": "object" + }, + "ListOpenAIResponseObject": { + "description": "Paginated list of OpenAI response objects with navigation metadata.", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/OpenAIResponseObjectWithInput" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "first_id": { + "title": "First Id", + "type": "string" + }, + "last_id": { + "title": "Last Id", + "type": "string" + }, + "object": { + "const": "list", + "default": "list", + "title": "Object", + "type": "string" + } + }, + "required": [ + "data", + "has_more", + "first_id", + "last_id" + ], + "title": "ListOpenAIResponseObject", + "type": "object" + }, + "OpenAIDeleteResponseObject": { + "description": "Response object confirming deletion of an OpenAI response.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "object": { + "const": "response", + "default": "response", + "title": "Object", + "type": "string" + }, + "deleted": { + "default": true, + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id" + ], + "title": "OpenAIDeleteResponseObject", + "type": "object" + }, + "ListBatchesResponse": { + "description": "Response containing a list of batch objects.", + "properties": { + "object": { + "const": "list", + "default": "list", + "title": "Object", + "type": "string" + }, + "data": { + "description": "List of batch objects", + "items": { + "$ref": "#/components/schemas/Batch" + }, + "title": "Data", + "type": "array" + }, + "first_id": { + "description": "ID of the first batch in the list", + "title": "First Id", + "type": "string", + "nullable": true + }, + "last_id": { + "description": "ID of the last batch in the list", + "title": "Last Id", + "type": "string", + "nullable": true + }, + "has_more": { + "default": false, + "description": "Whether there are more batches available", + "title": "Has More", + "type": "boolean" + } + }, + "required": [ + "data" + ], + "title": "ListBatchesResponse", + "type": "object" + }, + "ConversationDeletedResource": { + "description": "Response for deleted conversation.", + "properties": { + "id": { + "description": "The deleted conversation identifier", + "title": "Id", + "type": "string" + }, + "object": { + "default": "conversation.deleted", + "description": "Object type", + "title": "Object", + "type": "string" + }, + "deleted": { + "default": true, + "description": "Whether the object was deleted", + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id" + ], + "title": "ConversationDeletedResource", + "type": "object" + }, + "ConversationItemDeletedResource": { + "description": "Response for deleted conversation item.", + "properties": { + "id": { + "description": "The deleted item identifier", + "title": "Id", + "type": "string" + }, + "object": { + "default": "conversation.item.deleted", + "description": "Object type", + "title": "Object", + "type": "string" + }, + "deleted": { + "default": true, + "description": "Whether the object was deleted", + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id" + ], + "title": "ConversationItemDeletedResource", + "type": "object" + }, + "ListOpenAIFileResponse": { + "description": "Response for listing files in OpenAI Files API.", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/OpenAIFileObject" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "first_id": { + "title": "First Id", + "type": "string" + }, + "last_id": { + "title": "Last Id", + "type": "string" + }, + "object": { + "const": "list", + "default": "list", + "title": "Object", + "type": "string" + } + }, + "required": [ + "data", + "has_more", + "first_id", + "last_id" + ], + "title": "ListOpenAIFileResponse", + "type": "object" + }, + "OpenAIFileDeleteResponse": { + "description": "Response for deleting a file in OpenAI Files API.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "object": { + "const": "file", + "default": "file", + "title": "Object", + "type": "string" + }, + "deleted": { + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id", + "deleted" + ], + "title": "OpenAIFileDeleteResponse", + "type": "object" + }, + "ListOpenAIChatCompletionResponse": { + "description": "Response from listing OpenAI-compatible chat completions.", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/OpenAICompletionWithInputMessages" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "first_id": { + "title": "First Id", + "type": "string" + }, + "last_id": { + "title": "Last Id", + "type": "string" + }, + "object": { + "const": "list", + "default": "list", + "title": "Object", + "type": "string" + } + }, + "required": [ + "data", + "has_more", + "first_id", + "last_id" + ], + "title": "ListOpenAIChatCompletionResponse", + "type": "object" + }, + "OpenAIAssistantMessageParam": { + "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.", + "properties": { + "role": { + "const": "assistant", + "default": "assistant", + "title": "Role", + "type": "string" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content", + "nullable": true + }, + "name": { + "title": "Name", + "type": "string", + "nullable": true + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" + }, + "type": "array", + "nullable": true + } + }, + "title": "OpenAIAssistantMessageParam", + "type": "object" + }, + "OpenAIChoice": { + "description": "A choice from an OpenAI-compatible chat completion response.", + "properties": { + "message": { + "discriminator": { + "mapping": { + "assistant": "#/$defs/OpenAIAssistantMessageParam", + "developer": "#/$defs/OpenAIDeveloperMessageParam", + "system": "#/$defs/OpenAISystemMessageParam", + "tool": "#/$defs/OpenAIToolMessageParam", + "user": "#/$defs/OpenAIUserMessageParam" + }, + "propertyName": "role" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIUserMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAISystemMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIAssistantMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIToolMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" + } + ], + "title": "Message" + }, + "finish_reason": { + "title": "Finish Reason", + "type": "string" + }, + "index": { + "title": "Index", + "type": "integer" + }, + "logprobs": { + "$ref": "#/components/schemas/OpenAIChoiceLogprobs", + "nullable": true + } + }, + "required": [ + "message", + "finish_reason", + "index" + ], + "title": "OpenAIChoice", + "type": "object" + }, + "OpenAIChoiceLogprobs": { + "description": "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response.", + "properties": { + "content": { + "title": "Content", + "items": { + "$ref": "#/components/schemas/OpenAITokenLogProb" + }, + "type": "array", + "nullable": true + }, + "refusal": { + "title": "Refusal", + "items": { + "$ref": "#/components/schemas/OpenAITokenLogProb" + }, + "type": "array", + "nullable": true + } + }, + "title": "OpenAIChoiceLogprobs", + "type": "object" + }, + "OpenAICompletionWithInputMessages": { + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "choices": { + "items": { + "$ref": "#/components/schemas/OpenAIChoice" + }, + "title": "Choices", + "type": "array" + }, + "object": { + "const": "chat.completion", + "default": "chat.completion", + "title": "Object", + "type": "string" + }, + "created": { + "title": "Created", + "type": "integer" + }, + "model": { + "title": "Model", + "type": "string" + }, + "usage": { + "$ref": "#/components/schemas/OpenAIChatCompletionUsage", + "nullable": true + }, + "input_messages": { + "items": { + "discriminator": { + "mapping": { + "assistant": "#/$defs/OpenAIAssistantMessageParam", + "developer": "#/$defs/OpenAIDeveloperMessageParam", + "system": "#/$defs/OpenAISystemMessageParam", + "tool": "#/$defs/OpenAIToolMessageParam", + "user": "#/$defs/OpenAIUserMessageParam" + }, + "propertyName": "role" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIUserMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAISystemMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIAssistantMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIToolMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" + } + ] + }, + "title": "Input Messages", + "type": "array" + } + }, + "required": [ + "id", + "choices", + "created", + "model", + "input_messages" + ], + "title": "OpenAICompletionWithInputMessages", + "type": "object" + }, + "OpenAIUserMessageParam": { + "description": "A message from the user in an OpenAI-compatible chat completion request.", + "properties": { + "role": { + "const": "user", + "default": "user", + "title": "Role", + "type": "string" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "discriminator": { + "mapping": { + "file": "#/$defs/OpenAIFile", + "image_url": "#/$defs/OpenAIChatCompletionContentPartImageParam", + "text": "#/$defs/OpenAIChatCompletionContentPartTextParam" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" + }, + { + "$ref": "#/components/schemas/OpenAIFile" + } + ] + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string", + "nullable": true + } + }, + "required": [ + "content" + ], + "title": "OpenAIUserMessageParam", + "type": "object" + }, + "ScoringFn": { + "description": "A scoring function resource for evaluating model outputs.", + "properties": { + "identifier": { + "description": "Unique identifier for this resource in llama stack", + "title": "Identifier", + "type": "string" + }, + "provider_resource_id": { + "description": "Unique identifier for this resource in the provider", + "title": "Provider Resource Id", + "type": "string", + "nullable": true + }, + "provider_id": { + "description": "ID of the provider that owns this resource", + "title": "Provider Id", + "type": "string" + }, + "type": { + "const": "scoring_function", + "default": "scoring_function", + "title": "Type", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string", + "nullable": true + }, + "metadata": { + "additionalProperties": true, + "description": "Any additional metadata for this definition", + "title": "Metadata", + "type": "object" + }, + "return_type": { + "description": "The return type of the deterministic function", + "discriminator": { + "mapping": { + "agent_turn_input": "#/$defs/AgentTurnInputType", + "array": "#/$defs/ArrayType", + "boolean": "#/$defs/BooleanType", + "chat_completion_input": "#/$defs/ChatCompletionInputType", + "completion_input": "#/$defs/CompletionInputType", + "json": "#/$defs/JsonType", + "number": "#/$defs/NumberType", + "object": "#/$defs/ObjectType", + "string": "#/$defs/StringType", + "union": "#/$defs/UnionType" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/StringType" + }, + { + "$ref": "#/components/schemas/NumberType" + }, + { + "$ref": "#/components/schemas/BooleanType" + }, + { + "$ref": "#/components/schemas/ArrayType" + }, + { + "$ref": "#/components/schemas/ObjectType" + }, + { + "$ref": "#/components/schemas/JsonType" + }, + { + "$ref": "#/components/schemas/UnionType" + }, + { + "$ref": "#/components/schemas/ChatCompletionInputType" + }, + { + "$ref": "#/components/schemas/CompletionInputType" + }, + { + "$ref": "#/components/schemas/AgentTurnInputType" + } + ], + "title": "Return Type" + }, + "params": { + "description": "The parameters for the scoring function for benchmark eval, these can be overridden for app eval", + "title": "Params", + "discriminator": { + "mapping": { + "basic": "#/$defs/BasicScoringFnParams", + "llm_as_judge": "#/$defs/LLMAsJudgeScoringFnParams", + "regex_parser": "#/$defs/RegexParserScoringFnParams" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" + }, + { + "$ref": "#/components/schemas/RegexParserScoringFnParams" + }, + { + "$ref": "#/components/schemas/BasicScoringFnParams" + } + ], + "nullable": true + } + }, + "required": [ + "identifier", + "provider_id", + "return_type" + ], + "title": "ScoringFn", + "type": "object" + }, + "ListToolDefsResponse": { + "description": "Response containing a list of tool definitions.", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ToolDef" + }, + "title": "Data", + "type": "array" + } + }, + "required": [ + "data" + ], + "title": "ListToolDefsResponse", + "type": "object" + }, + "VectorStoreDeleteResponse": { + "description": "Response from deleting a vector store.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "object": { + "default": "vector_store.deleted", + "title": "Object", + "type": "string" + }, + "deleted": { + "default": true, + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id" + ], + "title": "VectorStoreDeleteResponse", + "type": "object" + }, + "VectorStoreFileContentsResponse": { + "description": "Response from retrieving the contents of a vector store file.", + "properties": { + "file_id": { + "title": "File Id", + "type": "string" + }, + "filename": { + "title": "Filename", + "type": "string" + }, + "attributes": { + "additionalProperties": true, + "title": "Attributes", + "type": "object" + }, + "content": { + "items": { + "$ref": "#/components/schemas/VectorStoreContent" + }, + "title": "Content", + "type": "array" + } + }, + "required": [ + "file_id", + "filename", + "attributes", + "content" + ], + "title": "VectorStoreFileContentsResponse", + "type": "object" + }, + "VectorStoreFileDeleteResponse": { + "description": "Response from deleting a vector store file.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "object": { + "default": "vector_store.file.deleted", + "title": "Object", + "type": "string" + }, + "deleted": { + "default": true, + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id" + ], + "title": "VectorStoreFileDeleteResponse", + "type": "object" + }, + "VectorStoreFilesListInBatchResponse": { + "description": "Response from listing files in a vector store file batch.", + "properties": { + "object": { + "default": "list", + "title": "Object", + "type": "string" + }, + "data": { + "items": { + "$ref": "#/components/schemas/VectorStoreFileObject" + }, + "title": "Data", + "type": "array" + }, + "first_id": { + "title": "First Id", + "type": "string", + "nullable": true + }, + "last_id": { + "title": "Last Id", + "type": "string", + "nullable": true + }, + "has_more": { + "default": false, + "title": "Has More", + "type": "boolean" + } + }, + "required": [ + "data" + ], + "title": "VectorStoreFilesListInBatchResponse", + "type": "object" + }, + "VectorStoreListFilesResponse": { + "description": "Response from listing files in a vector store.", + "properties": { + "object": { + "default": "list", + "title": "Object", + "type": "string" + }, + "data": { + "items": { + "$ref": "#/components/schemas/VectorStoreFileObject" + }, + "title": "Data", + "type": "array" + }, + "first_id": { + "title": "First Id", + "type": "string", + "nullable": true + }, + "last_id": { + "title": "Last Id", + "type": "string", + "nullable": true + }, + "has_more": { + "default": false, + "title": "Has More", + "type": "boolean" + } + }, + "required": [ + "data" + ], + "title": "VectorStoreListFilesResponse", + "type": "object" + }, + "VectorStoreListResponse": { + "description": "Response from listing vector stores.", + "properties": { + "object": { + "default": "list", + "title": "Object", + "type": "string" + }, + "data": { + "items": { + "$ref": "#/components/schemas/VectorStoreObject" + }, + "title": "Data", + "type": "array" + }, + "first_id": { + "title": "First Id", + "type": "string", + "nullable": true + }, + "last_id": { + "title": "Last Id", + "type": "string", + "nullable": true + }, + "has_more": { + "default": false, + "title": "Has More", + "type": "boolean" + } + }, + "required": [ + "data" + ], + "title": "VectorStoreListResponse", + "type": "object" + }, + "OpenAIResponseMessage": { + "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios.", + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "discriminator": { + "mapping": { + "input_file": "#/$defs/OpenAIResponseInputMessageContentFile", + "input_image": "#/$defs/OpenAIResponseInputMessageContentImage", + "input_text": "#/$defs/OpenAIResponseInputMessageContentText" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" + } + ] + }, + "type": "array" + }, + { + "items": { + "discriminator": { + "mapping": { + "output_text": "#/$defs/OpenAIResponseOutputMessageContentOutputText", + "refusal": "#/$defs/OpenAIResponseContentPartRefusal" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" + } + ] + }, + "type": "array" + } + ], + "title": "Content" + }, + "role": { + "anyOf": [ + { + "const": "system", + "type": "string" + }, + { + "const": "developer", + "type": "string" + }, + { + "const": "user", + "type": "string" + }, + { + "const": "assistant", + "type": "string" + } + ], + "title": "Role" + }, + "type": { + "const": "message", + "default": "message", + "title": "Type", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string", + "nullable": true + }, + "status": { + "title": "Status", + "type": "string", + "nullable": true + } + }, + "required": [ + "content", + "role" + ], + "title": "OpenAIResponseMessage", + "type": "object" + }, + "OpenAIResponseObjectWithInput": { + "description": "OpenAI response object extended with input context information.", + "properties": { + "created_at": { + "title": "Created At", + "type": "integer" + }, + "error": { + "$ref": "#/components/schemas/OpenAIResponseError", + "nullable": true + }, + "id": { + "title": "Id", + "type": "string" + }, + "model": { + "title": "Model", + "type": "string" + }, + "object": { + "const": "response", + "default": "response", + "title": "Object", + "type": "string" + }, + "output": { + "items": { + "discriminator": { + "mapping": { + "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", + "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", + "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", + "message": "#/$defs/OpenAIResponseMessage", + "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + } + ] + }, + "title": "Output", + "type": "array" + }, + "parallel_tool_calls": { + "default": false, + "title": "Parallel Tool Calls", + "type": "boolean" + }, + "previous_response_id": { + "title": "Previous Response Id", + "type": "string", + "nullable": true + }, + "prompt": { + "$ref": "#/components/schemas/OpenAIResponsePrompt", + "nullable": true + }, + "status": { + "title": "Status", + "type": "string" + }, + "temperature": { + "title": "Temperature", + "type": "number", + "nullable": true + }, + "text": { + "$ref": "#/components/schemas/OpenAIResponseText", + "default": { + "format": { + "type": "text" + } + } + }, + "top_p": { + "title": "Top P", + "type": "number", + "nullable": true + }, + "tools": { + "title": "Tools", + "items": { + "discriminator": { + "mapping": { + "file_search": "#/$defs/OpenAIResponseInputToolFileSearch", + "function": "#/$defs/OpenAIResponseInputToolFunction", + "mcp": "#/$defs/OpenAIResponseToolMCP", + "web_search": "#/$defs/OpenAIResponseInputToolWebSearch", + "web_search_preview": "#/$defs/OpenAIResponseInputToolWebSearch", + "web_search_preview_2025_03_11": "#/$defs/OpenAIResponseInputToolWebSearch" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" + }, + { + "$ref": "#/components/schemas/OpenAIResponseToolMCP" + } + ] + }, + "type": "array", + "nullable": true + }, + "truncation": { + "title": "Truncation", + "type": "string", + "nullable": true + }, + "usage": { + "$ref": "#/components/schemas/OpenAIResponseUsage", + "nullable": true + }, + "instructions": { + "title": "Instructions", + "type": "string", + "nullable": true + }, + "input": { + "items": { + "anyOf": [ + { + "discriminator": { + "mapping": { + "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", + "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", + "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", + "message": "#/$defs/OpenAIResponseMessage", + "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + } + ] + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + } + ] + }, + "title": "Input", + "type": "array" + } + }, + "required": [ + "created_at", + "id", + "model", + "output", + "status", + "input" + ], + "title": "OpenAIResponseObjectWithInput", + "type": "object" + }, + "_safety_run_shield_Request": { + "properties": { + "shield_id": { + "title": "Shield Id", + "type": "string" + }, + "messages": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAIUserMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAISystemMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIAssistantMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIToolMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" + } + ], + "title": "Messages" + }, + "params": { + "title": "Params", + "type": "string" + } + }, + "required": [ + "shield_id", + "messages", + "params" + ], + "title": "_safety_run_shield_Request", + "type": "object" + } + }, + "responses": { + "BadRequest400": { + "description": "The request was invalid or malformed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "status": 400, + "title": "Bad Request", + "detail": "The request was invalid or malformed" + } + } + } + }, + "TooManyRequests429": { + "description": "The client has sent too many requests in a given amount of time", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "status": 429, + "title": "Too Many Requests", + "detail": "You have exceeded the rate limit. Please try again later." + } + } + } + }, + "InternalServerError500": { + "description": "The server encountered an unexpected error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "status": 500, + "title": "Internal Server Error", + "detail": "An unexpected error occurred. Our team has been notified." + } + } + } + }, + "DefaultError": { + "description": "An unexpected error occurred", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/docs/static/llama-stack-spec.yaml b/docs/static/llama-stack-spec.yaml index dd2fe12cfb..b1b3ca8cda 100644 --- a/docs/static/llama-stack-spec.yaml +++ b/docs/static/llama-stack-spec.yaml @@ -13,7 +13,7 @@ paths: get: tags: - V1 - summary: List Batches + summary: List all batches for the current user. description: Query endpoint for proper schema generation. operationId: list_batches_v1_batches_get parameters: @@ -52,7 +52,7 @@ paths: post: tags: - V1 - summary: Create Batch + summary: Create a new batch for processing multiple API requests. description: Typed endpoint for proper schema generation. operationId: create_batch_v1_batches_post requestBody: @@ -84,7 +84,7 @@ paths: get: tags: - V1 - summary: Retrieve Batch + summary: Retrieve information about a specific batch. description: Query endpoint for proper schema generation. operationId: retrieve_batch_v1_batches__batch_id__get parameters: @@ -94,6 +94,7 @@ paths: schema: type: string title: Batch Id + description: The ID of the batch to retrieve. responses: '200': description: The batch object. @@ -117,7 +118,7 @@ paths: post: tags: - V1 - summary: Cancel Batch + summary: Cancel a batch that is in progress. description: Typed endpoint for proper schema generation. operationId: cancel_batch_v1_batches__batch_id__cancel_post requestBody: @@ -151,12 +152,12 @@ paths: required: true schema: type: string - description: 'Path parameter: batch_id' + description: The ID of the batch to cancel. /v1/chat/completions: get: tags: - V1 - summary: List Chat Completions + summary: List chat completions. description: Query endpoint for proper schema generation. operationId: list_chat_completions_v1_chat_completions_get parameters: @@ -207,7 +208,7 @@ paths: post: tags: - V1 - summary: Openai Chat Completion + summary: Create chat completions. description: Typed endpoint for proper schema generation. operationId: openai_chat_completion_v1_chat_completions_post requestBody: @@ -239,7 +240,7 @@ paths: get: tags: - V1 - summary: Get Chat Completion + summary: Get chat completion. description: Query endpoint for proper schema generation. operationId: get_chat_completion_v1_chat_completions__completion_id__get parameters: @@ -249,6 +250,7 @@ paths: schema: type: string title: Completion Id + description: ID of the chat completion. responses: '200': description: A OpenAICompletionWithInputMessages. @@ -272,7 +274,7 @@ paths: post: tags: - V1 - summary: Openai Completion + summary: Create completion. description: Typed endpoint for proper schema generation. operationId: openai_completion_v1_completions_post requestBody: @@ -304,7 +306,7 @@ paths: post: tags: - V1 - summary: Create Conversation + summary: Create a conversation. description: Typed endpoint for proper schema generation. operationId: create_conversation_v1_conversations_post requestBody: @@ -336,7 +338,7 @@ paths: delete: tags: - V1 - summary: Openai Delete Conversation + summary: Delete a conversation. description: Query endpoint for proper schema generation. operationId: openai_delete_conversation_v1_conversations__conversation_id__delete parameters: @@ -346,6 +348,7 @@ paths: schema: type: string title: Conversation Id + description: The conversation identifier. responses: '200': description: The deleted conversation resource. @@ -368,7 +371,7 @@ paths: get: tags: - V1 - summary: Get Conversation + summary: Retrieve a conversation. description: Query endpoint for proper schema generation. operationId: get_conversation_v1_conversations__conversation_id__get parameters: @@ -378,6 +381,7 @@ paths: schema: type: string title: Conversation Id + description: The conversation identifier. responses: '200': description: The conversation object. @@ -400,7 +404,7 @@ paths: post: tags: - V1 - summary: Update Conversation + summary: Update a conversation. description: Typed endpoint for proper schema generation. operationId: update_conversation_v1_conversations__conversation_id__post requestBody: @@ -434,21 +438,15 @@ paths: required: true schema: type: string - description: 'Path parameter: conversation_id' + description: The conversation identifier. /v1/conversations/{conversation_id}/items: get: tags: - V1 - summary: List Items + summary: List items. description: Query endpoint for proper schema generation. operationId: list_items_v1_conversations__conversation_id__items_get parameters: - - name: conversation_id - in: path - required: true - schema: - type: string - title: Conversation Id - name: after in: query required: true @@ -472,6 +470,13 @@ paths: schema: type: string title: Order + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id + description: The conversation identifier. responses: '200': description: List of conversation items. @@ -494,7 +499,7 @@ paths: post: tags: - V1 - summary: Add Items + summary: Create items. description: Typed endpoint for proper schema generation. operationId: add_items_v1_conversations__conversation_id__items_post requestBody: @@ -528,12 +533,12 @@ paths: required: true schema: type: string - description: 'Path parameter: conversation_id' + description: The conversation identifier. /v1/conversations/{conversation_id}/items/{item_id}: delete: tags: - V1 - summary: Openai Delete Conversation Item + summary: Delete an item. description: Query endpoint for proper schema generation. operationId: openai_delete_conversation_item_v1_conversations__conversation_id__items__item_id__delete parameters: @@ -543,12 +548,14 @@ paths: schema: type: string title: Conversation Id + description: The conversation identifier. - name: item_id in: path required: true schema: type: string title: Item Id + description: The item identifier. responses: '200': description: The deleted item resource. @@ -571,7 +578,7 @@ paths: get: tags: - V1 - summary: Retrieve + summary: Retrieve an item. description: Query endpoint for proper schema generation. operationId: retrieve_v1_conversations__conversation_id__items__item_id__get parameters: @@ -581,12 +588,14 @@ paths: schema: type: string title: Conversation Id + description: The conversation identifier. - name: item_id in: path required: true schema: type: string title: Item Id + description: The item identifier. responses: '200': description: The conversation item. @@ -610,7 +619,7 @@ paths: post: tags: - V1 - summary: Openai Embeddings + summary: Create embeddings. description: Typed endpoint for proper schema generation. operationId: openai_embeddings_v1_embeddings_post requestBody: @@ -642,7 +651,7 @@ paths: get: tags: - V1 - summary: Openai List Files + summary: List files. description: Query endpoint for proper schema generation. operationId: openai_list_files_v1_files_get parameters: @@ -692,7 +701,7 @@ paths: post: tags: - V1 - summary: Openai Upload File + summary: Upload file. description: Response-only endpoint for proper schema generation. operationId: openai_upload_file_v1_files_post responses: @@ -718,7 +727,7 @@ paths: delete: tags: - V1 - summary: Openai Delete File + summary: Delete file. description: Query endpoint for proper schema generation. operationId: openai_delete_file_v1_files__file_id__delete parameters: @@ -728,6 +737,7 @@ paths: schema: type: string title: File Id + description: The ID of the file to use for this request. responses: '200': description: An OpenAIFileDeleteResponse indicating successful deletion. @@ -750,7 +760,7 @@ paths: get: tags: - V1 - summary: Openai Retrieve File + summary: Retrieve file. description: Query endpoint for proper schema generation. operationId: openai_retrieve_file_v1_files__file_id__get parameters: @@ -760,6 +770,7 @@ paths: schema: type: string title: File Id + description: The ID of the file to use for this request. responses: '200': description: An OpenAIFileObject containing file information. @@ -783,7 +794,7 @@ paths: get: tags: - V1 - summary: Openai Retrieve File Content + summary: Retrieve file content. description: Generic endpoint - this would be replaced with actual implementation. operationId: openai_retrieve_file_content_v1_files__file_id__content_get parameters: @@ -802,7 +813,7 @@ paths: required: true schema: type: string - description: 'Path parameter: file_id' + description: The ID of the file to use for this request. responses: '200': description: The raw file content as a binary response. @@ -825,7 +836,7 @@ paths: get: tags: - V1 - summary: Health + summary: Get health status. description: Response-only endpoint for proper schema generation. operationId: health_v1_health_get responses: @@ -851,7 +862,7 @@ paths: get: tags: - V1 - summary: List Routes + summary: List routes. description: Response-only endpoint for proper schema generation. operationId: list_routes_v1_inspect_routes_get responses: @@ -901,7 +912,7 @@ paths: get: tags: - V1 - summary: List Models + summary: List all models. description: Response-only endpoint for proper schema generation. operationId: list_models_v1_models_get responses: @@ -931,7 +942,7 @@ paths: post: tags: - V1 - summary: Register Model + summary: Register model. description: Typed endpoint for proper schema generation. operationId: register_model_v1_models_post requestBody: @@ -963,7 +974,7 @@ paths: delete: tags: - V1 - summary: Unregister Model + summary: Unregister model. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_model_v1_models__model_id__delete parameters: @@ -1004,7 +1015,7 @@ paths: get: tags: - V1 - summary: Get Model + summary: Get model. description: Query endpoint for proper schema generation. operationId: get_model_v1_models__model_id__get parameters: @@ -1037,7 +1048,7 @@ paths: post: tags: - V1 - summary: Run Moderation + summary: Create moderation. description: Typed endpoint for proper schema generation. operationId: run_moderation_v1_moderations_post requestBody: @@ -1069,7 +1080,7 @@ paths: get: tags: - V1 - summary: List Prompts + summary: List all prompts. description: Response-only endpoint for proper schema generation. operationId: list_prompts_v1_prompts_get responses: @@ -1094,7 +1105,7 @@ paths: post: tags: - V1 - summary: Create Prompt + summary: Create prompt. description: Typed endpoint for proper schema generation. operationId: create_prompt_v1_prompts_post requestBody: @@ -1126,7 +1137,7 @@ paths: delete: tags: - V1 - summary: Delete Prompt + summary: Delete prompt. description: Generic endpoint - this would be replaced with actual implementation. operationId: delete_prompt_v1_prompts__prompt_id__delete parameters: @@ -1140,13 +1151,12 @@ paths: required: true schema: title: Kwargs - - &id001 - name: prompt_id + - name: prompt_id in: path required: true schema: type: string - description: 'Path parameter: prompt_id' + description: The identifier of the prompt to delete. responses: '200': description: Successful Response @@ -1168,22 +1178,23 @@ paths: get: tags: - V1 - summary: Get Prompt + summary: Get prompt. description: Query endpoint for proper schema generation. operationId: get_prompt_v1_prompts__prompt_id__get parameters: - - name: prompt_id - in: path - required: true - schema: - type: string - title: Prompt Id - name: version in: query required: true schema: type: integer title: Version + - name: prompt_id + in: path + required: true + schema: + type: string + title: Prompt Id + description: The identifier of the prompt to get. responses: '200': description: A Prompt resource. @@ -1206,7 +1217,7 @@ paths: post: tags: - V1 - summary: Update Prompt + summary: Update prompt. description: Typed endpoint for proper schema generation. operationId: update_prompt_v1_prompts__prompt_id__post requestBody: @@ -1235,12 +1246,17 @@ paths: $ref: '#/components/responses/DefaultError' description: Default Response parameters: - - *id001 + - name: prompt_id + in: path + required: true + schema: + type: string + description: The identifier of the prompt to update. /v1/prompts/{prompt_id}/set-default-version: post: tags: - V1 - summary: Set Default Version + summary: Set prompt version. description: Typed endpoint for proper schema generation. operationId: set_default_version_v1_prompts__prompt_id__set_default_version_post requestBody: @@ -1274,12 +1290,12 @@ paths: required: true schema: type: string - description: 'Path parameter: prompt_id' + description: The identifier of the prompt. /v1/prompts/{prompt_id}/versions: get: tags: - V1 - summary: List Prompt Versions + summary: List prompt versions. description: Query endpoint for proper schema generation. operationId: list_prompt_versions_v1_prompts__prompt_id__versions_get parameters: @@ -1289,6 +1305,7 @@ paths: schema: type: string title: Prompt Id + description: The identifier of the prompt to list versions for. responses: '200': description: A ListPromptsResponse containing all versions of the prompt. @@ -1312,7 +1329,7 @@ paths: get: tags: - V1 - summary: List Providers + summary: List providers. description: Response-only endpoint for proper schema generation. operationId: list_providers_v1_providers_get responses: @@ -1338,7 +1355,7 @@ paths: get: tags: - V1 - summary: Inspect Provider + summary: Get provider. description: Query endpoint for proper schema generation. operationId: inspect_provider_v1_providers__provider_id__get parameters: @@ -1348,6 +1365,7 @@ paths: schema: type: string title: Provider Id + description: The ID of the provider to inspect. responses: '200': description: A ProviderInfo object containing the provider's details. @@ -1371,7 +1389,7 @@ paths: get: tags: - V1 - summary: List Openai Responses + summary: List all responses. description: Query endpoint for proper schema generation. operationId: list_openai_responses_v1_responses_get parameters: @@ -1422,7 +1440,7 @@ paths: post: tags: - V1 - summary: Create Openai Response + summary: Create a model response. description: Typed endpoint for proper schema generation. operationId: create_openai_response_v1_responses_post requestBody: @@ -1454,7 +1472,7 @@ paths: delete: tags: - V1 - summary: Delete Openai Response + summary: Delete a response. description: Query endpoint for proper schema generation. operationId: delete_openai_response_v1_responses__response_id__delete parameters: @@ -1464,6 +1482,7 @@ paths: schema: type: string title: Response Id + description: The ID of the OpenAI response to delete. responses: '200': description: An OpenAIDeleteResponseObject @@ -1486,7 +1505,7 @@ paths: get: tags: - V1 - summary: Get Openai Response + summary: Get a model response. description: Query endpoint for proper schema generation. operationId: get_openai_response_v1_responses__response_id__get parameters: @@ -1496,6 +1515,7 @@ paths: schema: type: string title: Response Id + description: The ID of the OpenAI response to retrieve. responses: '200': description: An OpenAIResponseObject. @@ -1519,16 +1539,10 @@ paths: get: tags: - V1 - summary: List Openai Response Input Items + summary: List input items. description: Query endpoint for proper schema generation. operationId: list_openai_response_input_items_v1_responses__response_id__input_items_get parameters: - - name: response_id - in: path - required: true - schema: - type: string - title: Response Id - name: after in: query required: true @@ -1560,6 +1574,13 @@ paths: schema: $ref: '#/components/schemas/Order' default: desc + - name: response_id + in: path + required: true + schema: + type: string + title: Response Id + description: The ID of the response to retrieve input items for. responses: '200': description: An ListOpenAIResponseInputItem. @@ -1583,7 +1604,7 @@ paths: post: tags: - V1 - summary: Run Shield + summary: Run shield. description: Typed endpoint for proper schema generation. operationId: run_shield_v1_safety_run_shield_post requestBody: @@ -1615,7 +1636,7 @@ paths: get: tags: - V1 - summary: List Scoring Functions + summary: List all scoring functions. description: Response-only endpoint for proper schema generation. operationId: list_scoring_functions_v1_scoring_functions_get responses: @@ -1640,7 +1661,7 @@ paths: post: tags: - V1 - summary: Register Scoring Function + summary: Register a scoring function. description: Generic endpoint - this would be replaced with actual implementation. operationId: register_scoring_function_v1_scoring_functions_post parameters: @@ -1676,7 +1697,7 @@ paths: delete: tags: - V1 - summary: Unregister Scoring Function + summary: Unregister a scoring function. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_scoring_function_v1_scoring_functions__scoring_fn_id__delete parameters: @@ -1717,7 +1738,7 @@ paths: get: tags: - V1 - summary: Get Scoring Function + summary: Get a scoring function by its ID. description: Query endpoint for proper schema generation. operationId: get_scoring_function_v1_scoring_functions__scoring_fn_id__get parameters: @@ -1750,7 +1771,7 @@ paths: post: tags: - V1 - summary: Score + summary: Score a list of rows. description: Typed endpoint for proper schema generation. operationId: score_v1_scoring_score_post requestBody: @@ -1782,7 +1803,7 @@ paths: post: tags: - V1 - summary: Score Batch + summary: Score a batch of rows. description: Typed endpoint for proper schema generation. operationId: score_batch_v1_scoring_score_batch_post requestBody: @@ -1814,7 +1835,7 @@ paths: get: tags: - V1 - summary: List Shields + summary: List all shields. description: Response-only endpoint for proper schema generation. operationId: list_shields_v1_shields_get responses: @@ -1839,7 +1860,7 @@ paths: post: tags: - V1 - summary: Register Shield + summary: Register a shield. description: Typed endpoint for proper schema generation. operationId: register_shield_v1_shields_post requestBody: @@ -1871,7 +1892,7 @@ paths: delete: tags: - V1 - summary: Unregister Shield + summary: Unregister a shield. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_shield_v1_shields__identifier__delete parameters: @@ -1912,7 +1933,7 @@ paths: get: tags: - V1 - summary: Get Shield + summary: Get a shield by its identifier. description: Query endpoint for proper schema generation. operationId: get_shield_v1_shields__identifier__get parameters: @@ -1983,7 +2004,7 @@ paths: post: tags: - V1 - summary: Invoke Tool + summary: Run a tool with the given arguments. description: Typed endpoint for proper schema generation. operationId: invoke_tool_v1_tool_runtime_invoke_post requestBody: @@ -2015,7 +2036,7 @@ paths: get: tags: - V1 - summary: List Runtime Tools + summary: List all tools in the runtime. description: Query endpoint for proper schema generation. operationId: list_runtime_tools_v1_tool_runtime_list_tools_get parameters: @@ -2054,7 +2075,7 @@ paths: post: tags: - V1 - summary: Rag Tool.Insert + summary: Index documents so they can be used by the RAG system. description: Generic endpoint - this would be replaced with actual implementation. operationId: rag_tool_insert_v1_tool_runtime_rag_tool_insert_post parameters: @@ -2090,7 +2111,7 @@ paths: post: tags: - V1 - summary: Rag Tool.Query + summary: Query the RAG system for context; typically invoked by the agent. description: Typed endpoint for proper schema generation. operationId: rag_tool_query_v1_tool_runtime_rag_tool_query_post requestBody: @@ -2122,7 +2143,7 @@ paths: get: tags: - V1 - summary: List Tool Groups + summary: List tool groups with optional provider. description: Response-only endpoint for proper schema generation. operationId: list_tool_groups_v1_toolgroups_get responses: @@ -2147,7 +2168,7 @@ paths: post: tags: - V1 - summary: Register Tool Group + summary: Register a tool group. description: Generic endpoint - this would be replaced with actual implementation. operationId: register_tool_group_v1_toolgroups_post parameters: @@ -2183,7 +2204,7 @@ paths: delete: tags: - V1 - summary: Unregister Toolgroup + summary: Unregister a tool group. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_toolgroup_v1_toolgroups__toolgroup_id__delete parameters: @@ -2224,7 +2245,7 @@ paths: get: tags: - V1 - summary: Get Tool Group + summary: Get a tool group by its ID. description: Query endpoint for proper schema generation. operationId: get_tool_group_v1_toolgroups__toolgroup_id__get parameters: @@ -2257,7 +2278,7 @@ paths: get: tags: - V1 - summary: List Tools + summary: List tools with optional tool group. description: Query endpoint for proper schema generation. operationId: list_tools_v1_tools_get parameters: @@ -2290,7 +2311,7 @@ paths: get: tags: - V1 - summary: Get Tool + summary: Get a tool by its name. description: Query endpoint for proper schema generation. operationId: get_tool_v1_tools__tool_name__get parameters: @@ -2323,7 +2344,7 @@ paths: post: tags: - V1 - summary: Insert Chunks + summary: Insert chunks into a vector database. description: Generic endpoint - this would be replaced with actual implementation. operationId: insert_chunks_v1_vector_io_insert_post parameters: @@ -2359,7 +2380,7 @@ paths: post: tags: - V1 - summary: Query Chunks + summary: Query chunks from a vector database. description: Typed endpoint for proper schema generation. operationId: query_chunks_v1_vector_io_query_post requestBody: @@ -2391,7 +2412,7 @@ paths: get: tags: - V1 - summary: Openai List Vector Stores + summary: Returns a list of vector stores. description: Query endpoint for proper schema generation. operationId: openai_list_vector_stores_v1_vector_stores_get parameters: @@ -2443,7 +2464,7 @@ paths: post: tags: - V1 - summary: Openai Create Vector Store + summary: Creates a vector store. description: Typed endpoint for proper schema generation. operationId: openai_create_vector_store_v1_vector_stores_post requestBody: @@ -2475,7 +2496,7 @@ paths: delete: tags: - V1 - summary: Openai Delete Vector Store + summary: Delete a vector store. description: Query endpoint for proper schema generation. operationId: openai_delete_vector_store_v1_vector_stores__vector_store_id__delete parameters: @@ -2485,6 +2506,7 @@ paths: schema: type: string title: Vector Store Id + description: The ID of the vector store to delete. responses: '200': description: A VectorStoreDeleteResponse indicating the deletion status. @@ -2507,7 +2529,7 @@ paths: get: tags: - V1 - summary: Openai Retrieve Vector Store + summary: Retrieves a vector store. description: Query endpoint for proper schema generation. operationId: openai_retrieve_vector_store_v1_vector_stores__vector_store_id__get parameters: @@ -2517,6 +2539,7 @@ paths: schema: type: string title: Vector Store Id + description: The ID of the vector store to retrieve. responses: '200': description: A VectorStoreObject representing the vector store. @@ -2539,7 +2562,7 @@ paths: post: tags: - V1 - summary: Openai Update Vector Store + summary: Updates a vector store. description: Typed endpoint for proper schema generation. operationId: openai_update_vector_store_v1_vector_stores__vector_store_id__post requestBody: @@ -2573,12 +2596,12 @@ paths: required: true schema: type: string - description: 'Path parameter: vector_store_id' + description: The ID of the vector store to update. /v1/vector_stores/{vector_store_id}/file_batches: post: tags: - V1 - summary: Openai Create Vector Store File Batch + summary: Create a vector store file batch. description: Typed endpoint for proper schema generation. operationId: openai_create_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches_post requestBody: @@ -2589,8 +2612,7 @@ paths: required: true responses: '200': - description: A VectorStoreFileBatchObject representing the created file - batch. + description: A VectorStoreFileBatchObject representing the created file batch. content: application/json: schema: @@ -2613,12 +2635,12 @@ paths: required: true schema: type: string - description: 'Path parameter: vector_store_id' + description: The ID of the vector store to create the file batch for. /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: get: tags: - V1 - summary: Openai Retrieve Vector Store File Batch + summary: Retrieve a vector store file batch. description: Query endpoint for proper schema generation. operationId: openai_retrieve_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__get parameters: @@ -2628,12 +2650,14 @@ paths: schema: type: string title: Batch Id + description: The ID of the file batch to retrieve. - name: vector_store_id in: path required: true schema: type: string title: Vector Store Id + description: The ID of the vector store containing the file batch. responses: '200': description: A VectorStoreFileBatchObject representing the file batch. @@ -2657,7 +2681,7 @@ paths: post: tags: - V1 - summary: Openai Cancel Vector Store File Batch + summary: Cancels a vector store file batch. description: Typed endpoint for proper schema generation. operationId: openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post requestBody: @@ -2668,8 +2692,7 @@ paths: required: true responses: '200': - description: A VectorStoreFileBatchObject representing the cancelled file - batch. + description: A VectorStoreFileBatchObject representing the cancelled file batch. content: application/json: schema: @@ -2687,38 +2710,26 @@ paths: description: Default Response $ref: '#/components/responses/DefaultError' parameters: - - name: vector_store_id + - name: batch_id in: path required: true schema: type: string - description: 'Path parameter: vector_store_id' - - name: batch_id + description: The ID of the file batch to cancel. + - name: vector_store_id in: path required: true schema: type: string - description: 'Path parameter: batch_id' + description: The ID of the vector store containing the file batch. /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: get: tags: - V1 - summary: Openai List Files In Vector Store File Batch + summary: Returns a list of vector store files in a batch. description: Query endpoint for proper schema generation. operationId: openai_list_files_in_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get parameters: - - name: batch_id - in: path - required: true - schema: - type: string - title: Batch Id - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - name: after in: query required: true @@ -2751,10 +2762,23 @@ paths: type: string default: desc title: Order + - name: batch_id + in: path + required: true + schema: + type: string + title: Batch Id + description: The ID of the file batch to list files from. + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + description: The ID of the vector store containing the file batch. responses: '200': - description: A VectorStoreFilesListInBatchResponse containing the list of - files in the batch. + description: A VectorStoreFilesListInBatchResponse containing the list of files in the batch. content: application/json: schema: @@ -2775,16 +2799,10 @@ paths: get: tags: - V1 - summary: Openai List Files In Vector Store + summary: List files in a vector store. description: Query endpoint for proper schema generation. operationId: openai_list_files_in_vector_store_v1_vector_stores__vector_store_id__files_get parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - name: after in: query required: true @@ -2817,6 +2835,13 @@ paths: type: string default: desc title: Order + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + description: The ID of the vector store to list files from. responses: '200': description: A VectorStoreListFilesResponse containing the list of files. @@ -2839,7 +2864,7 @@ paths: post: tags: - V1 - summary: Openai Attach File To Vector Store + summary: Attach a file to a vector store. description: Typed endpoint for proper schema generation. operationId: openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post requestBody: @@ -2873,27 +2898,29 @@ paths: required: true schema: type: string - description: 'Path parameter: vector_store_id' + description: The ID of the vector store to attach the file to. /v1/vector_stores/{vector_store_id}/files/{file_id}: delete: tags: - V1 - summary: Openai Delete Vector Store File + summary: Delete a vector store file. description: Query endpoint for proper schema generation. operationId: openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete parameters: - - name: file_id + - name: vector_store_id in: path required: true schema: type: string - title: File Id - - name: vector_store_id + title: Vector Store Id + description: The ID of the vector store containing the file to delete. + - name: file_id in: path required: true schema: type: string - title: Vector Store Id + title: File Id + description: The ID of the file to delete. responses: '200': description: A VectorStoreFileDeleteResponse indicating the deletion status. @@ -2916,22 +2943,24 @@ paths: get: tags: - V1 - summary: Openai Retrieve Vector Store File + summary: Retrieves a vector store file. description: Query endpoint for proper schema generation. operationId: openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get parameters: - - name: file_id + - name: vector_store_id in: path required: true schema: type: string - title: File Id - - name: vector_store_id + title: Vector Store Id + description: The ID of the vector store containing the file to retrieve. + - name: file_id in: path required: true schema: type: string - title: Vector Store Id + title: File Id + description: The ID of the file to retrieve. responses: '200': description: A VectorStoreFileObject representing the file. @@ -2954,7 +2983,7 @@ paths: post: tags: - V1 - summary: Openai Update Vector Store File + summary: Updates a vector store file. description: Typed endpoint for proper schema generation. operationId: openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post requestBody: @@ -2988,33 +3017,35 @@ paths: required: true schema: type: string - description: 'Path parameter: vector_store_id' + description: The ID of the vector store containing the file to update. - name: file_id in: path required: true schema: type: string - description: 'Path parameter: file_id' + description: The ID of the file to update. /v1/vector_stores/{vector_store_id}/files/{file_id}/content: get: tags: - V1 - summary: Openai Retrieve Vector Store File Contents + summary: Retrieves the contents of a vector store file. description: Query endpoint for proper schema generation. operationId: openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get parameters: - - name: file_id + - name: vector_store_id in: path required: true schema: type: string - title: File Id - - name: vector_store_id + title: Vector Store Id + description: The ID of the vector store containing the file to retrieve. + - name: file_id in: path required: true schema: type: string - title: Vector Store Id + title: File Id + description: The ID of the file to retrieve. responses: '200': description: A list of InterleavedContent representing the file contents. @@ -3038,7 +3069,7 @@ paths: post: tags: - V1 - summary: Openai Search Vector Store + summary: Search for chunks in a vector store. description: Typed endpoint for proper schema generation. operationId: openai_search_vector_store_v1_vector_stores__vector_store_id__search_post requestBody: @@ -3072,12 +3103,12 @@ paths: required: true schema: type: string - description: 'Path parameter: vector_store_id' + description: The ID of the vector store to search. /v1/version: get: tags: - V1 - summary: Version + summary: Get version. description: Response-only endpoint for proper schema generation. operationId: version_v1_version_get responses: @@ -8160,10 +8191,7 @@ components: default: agent_turn_input type: object title: AgentTurnInputType - description: 'Parameter type for agent turn input. - - - :param type: Discriminator type. Always "agent_turn_input"' + description: Parameter type for agent turn input. AggregationFunctionType: type: string enum: @@ -8173,17 +8201,7 @@ components: - categorical_count - accuracy title: AggregationFunctionType - description: 'Types of aggregation functions for scoring results. - - :cvar average: Calculate the arithmetic mean of scores - - :cvar weighted_average: Calculate a weighted average of scores - - :cvar median: Calculate the median value of scores - - :cvar categorical_count: Count occurrences of categorical values - - :cvar accuracy: Calculate accuracy as the proportion of correct answers' + description: Types of aggregation functions for scoring results. AllowedToolsFilter: properties: tool_names: @@ -8193,10 +8211,7 @@ components: type: array type: object title: AllowedToolsFilter - description: 'Filter configuration for restricting which MCP tools can be used. - - - :param tool_names: (Optional) List of specific tool names that are allowed' + description: Filter configuration for restricting which MCP tools can be used. ApprovalFilter: properties: always: @@ -8211,12 +8226,7 @@ components: type: array type: object title: ApprovalFilter - description: 'Filter configuration for MCP tool approval requirements. - - - :param always: (Optional) List of tool names that always require approval - - :param never: (Optional) List of tool names that never require approval' + description: Filter configuration for MCP tool approval requirements. ArrayType: properties: type: @@ -8226,10 +8236,7 @@ components: default: array type: object title: ArrayType - description: 'Parameter type for array values. - - - :param type: Discriminator type. Always "array"' + description: Parameter type for array values. BasicScoringFnParams: properties: type: @@ -8245,12 +8252,7 @@ components: description: Aggregation functions to apply to the scores of each row type: object title: BasicScoringFnParams - description: 'Parameters for basic scoring function configuration. - - :param type: The type of scoring function parameters, always basic - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row' + description: Parameters for basic scoring function configuration. Batch: properties: id: @@ -8407,10 +8409,7 @@ components: default: boolean type: object title: BooleanType - description: 'Parameter type for boolean values. - - - :param type: Discriminator type. Always "boolean"' + description: Parameter type for boolean values. ChatCompletionInputType: properties: type: @@ -8420,10 +8419,7 @@ components: default: chat_completion_input type: object title: ChatCompletionInputType - description: 'Parameter type for chat completion input. - - - :param type: Discriminator type. Always "chat_completion_input"' + description: Parameter type for chat completion input. Chunk-Output: properties: content: @@ -8467,15 +8463,7 @@ components: - content - chunk_id title: Chunk - description: "A chunk of content that can be inserted into a vector database.\n\ - :param content: The content of the chunk, which can be interleaved text, images,\ - \ or other types.\n:param chunk_id: Unique identifier for the chunk. Must\ - \ be provided explicitly.\n:param metadata: Metadata associated with the chunk\ - \ that will be used in the model context during inference.\n:param embedding:\ - \ Optional embedding for the chunk. If not provided, it will be computed later.\n\ - :param chunk_metadata: Metadata for the chunk that will NOT be used in the\ - \ context during inference.\n The `chunk_metadata` is required backend\ - \ functionality." + description: A chunk of content that can be inserted into a vector database. ChunkMetadata: properties: chunk_id: @@ -8513,25 +8501,7 @@ components: type: integer type: object title: ChunkMetadata - description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used\ - \ to store additional information about the chunk that\n will not be used\ - \ in the context during inference, but is required for backend functionality.\ - \ The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and\ - \ is not expected to change after.\n Use `Chunk.metadata` for metadata\ - \ that will be used in the context during inference.\n:param chunk_id: The\ - \ ID of the chunk. If not set, it will be generated based on the document\ - \ ID and content.\n:param document_id: The ID of the document this chunk belongs\ - \ to.\n:param source: The source of the content, such as a URL, file path,\ - \ or other identifier.\n:param created_timestamp: An optional timestamp indicating\ - \ when the chunk was created.\n:param updated_timestamp: An optional timestamp\ - \ indicating when the chunk was last updated.\n:param chunk_window: The window\ - \ of the chunk, which can be used to group related chunks together.\n:param\ - \ chunk_tokenizer: The tokenizer used to create the chunk. Default is Tiktoken.\n\ - :param chunk_embedding_model: The embedding model used to create the chunk's\ - \ embedding.\n:param chunk_embedding_dimension: The dimension of the embedding\ - \ vector for the chunk.\n:param content_token_count: The number of tokens\ - \ in the content of the chunk.\n:param metadata_token_count: The number of\ - \ tokens in the metadata of the chunk." + description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." CompletionInputType: properties: type: @@ -8541,10 +8511,7 @@ components: default: completion_input type: object title: CompletionInputType - description: 'Parameter type for completion input. - - - :param type: Discriminator type. Always "completion_input"' + description: Parameter type for completion input. Conversation: properties: id: @@ -8560,20 +8527,16 @@ components: created_at: type: integer title: Created At - description: The time at which the conversation was created, measured in - seconds since the Unix epoch. + description: The time at which the conversation was created, measured in seconds since the Unix epoch. metadata: title: Metadata - description: Set of 16 key-value pairs that can be attached to an object. - This can be useful for storing additional information about the object - in a structured format, and querying for objects via API or the dashboard. + description: Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. additionalProperties: type: string type: object items: title: Items - description: Initial items to include in the conversation context. You may - add up to 20 items at a time. + description: Initial items to include in the conversation context. You may add up to 20 items at a time. items: additionalProperties: true type: object @@ -9162,12 +9125,7 @@ components: default: ' ' type: object title: DefaultRAGQueryGeneratorConfig - description: 'Configuration for the default RAG query generator. - - - :param type: Type of query generator, always ''default'' - - :param separator: String separator used to join query terms' + description: Configuration for the default RAG query generator. Errors: properties: data: @@ -9189,10 +9147,7 @@ components: required: - status title: HealthInfo - description: 'Health status information for the service. - - - :param status: Current health status of the service' + description: Health status information for the service. HealthStatus: type: string enum: @@ -9213,12 +9168,7 @@ components: required: - image title: ImageContentItem - description: 'A image content item - - - :param type: Discriminator type of the content item. Always "image" - - :param image: Image as a base64 encoded string or an URL' + description: A image content item InputTokensDetails: properties: cached_tokens: @@ -9238,10 +9188,7 @@ components: default: json type: object title: JsonType - description: 'Parameter type for JSON values. - - - :param type: Discriminator type. Always "json"' + description: Parameter type for JSON values. LLMAsJudgeScoringFnParams: properties: type: @@ -9271,18 +9218,7 @@ components: required: - judge_model title: LLMAsJudgeScoringFnParams - description: 'Parameters for LLM-as-judge scoring function configuration. - - :param type: The type of scoring function parameters, always llm_as_judge - - :param judge_model: Identifier of the LLM model to use as a judge for scoring - - :param prompt_template: (Optional) Custom prompt template for the judge model - - :param judge_score_regexes: Regexes to extract the answer from generated response - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row' + description: Parameters for LLM-as-judge scoring function configuration. LLMRAGQueryGeneratorConfig: properties: type: @@ -9301,14 +9237,7 @@ components: - model - template title: LLMRAGQueryGeneratorConfig - description: 'Configuration for the LLM-based RAG query generator. - - - :param type: Type of query generator, always ''llm'' - - :param model: Name of the language model to use for query generation - - :param template: Template string for formatting the query generation prompt' + description: Configuration for the LLM-based RAG query generator. ListModelsResponse: properties: data: @@ -9343,10 +9272,7 @@ components: required: - data title: ListProvidersResponse - description: 'Response containing a list of all available providers. - - - :param data: List of provider information objects' + description: Response containing a list of all available providers. ListRoutesResponse: properties: data: @@ -9358,10 +9284,7 @@ components: required: - data title: ListRoutesResponse - description: 'Response containing a list of all available API routes. - - - :param data: List of available route information objects' + description: Response containing a list of all available API routes. ListScoringFunctionsResponse: properties: data: @@ -9395,10 +9318,7 @@ components: required: - data title: ListToolGroupsResponse - description: 'Response containing a list of tool groups. - - - :param data: List of tool groups' + description: Response containing a list of tool groups. MCPListToolsTool: properties: input_schema: @@ -9416,14 +9336,7 @@ components: - input_schema - name title: MCPListToolsTool - description: 'Tool definition returned by MCP list tools operation. - - - :param input_schema: JSON schema defining the tool''s input parameters - - :param name: Name of the tool - - :param description: (Optional) Description of what the tool does' + description: Tool definition returned by MCP list tools operation. Model: properties: identifier: @@ -9456,21 +9369,7 @@ components: - identifier - provider_id title: Model - description: 'A model resource representing an AI model registered in Llama - Stack. - - - :param type: The resource type, always ''model'' for model resources - - :param model_type: The type of model (LLM or embedding model) - - :param metadata: Any additional metadata for this model - - :param identifier: Unique identifier for this resource in llama stack - - :param provider_resource_id: Unique identifier for this resource in the provider - - :param provider_id: ID of the provider that owns this resource' + description: A model resource representing an AI model registered in Llama Stack. ModelType: type: string enum: @@ -9478,14 +9377,7 @@ components: - embedding - rerank title: ModelType - description: 'Enumeration of supported model types in Llama Stack. - - :cvar llm: Large language model for text generation and completion - - :cvar embedding: Embedding model for converting text to vector representations - - :cvar rerank: Reranking model for reordering documents based on their relevance - to a query' + description: Enumeration of supported model types in Llama Stack. ModerationObject: properties: id: @@ -9505,13 +9397,7 @@ components: - model - results title: ModerationObject - description: 'A moderation object. - - :param id: The unique identifier for the moderation request. - - :param model: The model used to generate the moderation results. - - :param results: A list of moderation objects' + description: A moderation object. ModerationObjectResults: properties: flagged: @@ -9545,18 +9431,7 @@ components: required: - flagged title: ModerationObjectResults - description: 'A moderation object. - - :param flagged: Whether any of the below categories are flagged. - - :param categories: A list of the categories, and whether they are flagged - or not. - - :param category_applied_input_types: A list of the categories along with the - input type(s) that the score applies to. - - :param category_scores: A list of the categories along with their scores as - predicted by model.' + description: A moderation object. NumberType: properties: type: @@ -9566,10 +9441,7 @@ components: default: number type: object title: NumberType - description: 'Parameter type for numeric values. - - - :param type: Discriminator type. Always "number"' + description: Parameter type for numeric values. ObjectType: properties: type: @@ -9579,10 +9451,7 @@ components: default: object type: object title: ObjectType - description: 'Parameter type for object values. - - - :param type: Discriminator type. Always "object"' + description: Parameter type for object values. OpenAIAssistantMessageParam-Input: properties: role: @@ -9607,18 +9476,7 @@ components: type: array type: object title: OpenAIAssistantMessageParam - description: 'A message containing the model''s (assistant) response in an OpenAI-compatible - chat completion request. - - - :param role: Must be "assistant" to identify this as the model''s response - - :param content: The content of the model''s response - - :param name: (Optional) The name of the assistant message participant. - - :param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall - object.' + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. OpenAIAssistantMessageParam-Output: properties: role: @@ -9643,18 +9501,7 @@ components: type: array type: object title: OpenAIAssistantMessageParam - description: 'A message containing the model''s (assistant) response in an OpenAI-compatible - chat completion request. - - - :param role: Must be "assistant" to identify this as the model''s response - - :param content: The content of the model''s response - - :param name: (Optional) The name of the assistant message participant. - - :param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall - object.' + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. OpenAIChatCompletion: properties: id: @@ -9685,21 +9532,7 @@ components: - created - model title: OpenAIChatCompletion - description: 'Response from an OpenAI-compatible chat completion request. - - - :param id: The ID of the chat completion - - :param choices: List of choices - - :param object: The object type, which will be "chat.completion" - - :param created: The Unix timestamp in seconds when the chat completion was - created - - :param model: The model that was used to generate the chat completion - - :param usage: Token usage information for the completion' + description: Response from an OpenAI-compatible chat completion request. OpenAIChatCompletionContentPartImageParam: properties: type: @@ -9713,12 +9546,7 @@ components: required: - image_url title: OpenAIChatCompletionContentPartImageParam - description: 'Image content part for OpenAI-compatible chat completion messages. - - - :param type: Must be "image_url" to identify this as image content - - :param image_url: Image URL specification and processing details' + description: Image content part for OpenAI-compatible chat completion messages. OpenAIChatCompletionContentPartTextParam: properties: type: @@ -9733,12 +9561,7 @@ components: required: - text title: OpenAIChatCompletionContentPartTextParam - description: 'Text content part for OpenAI-compatible chat completion messages. - - - :param type: Must be "text" to identify this as text content - - :param text: The text content of the message' + description: Text content part for OpenAI-compatible chat completion messages. OpenAIChatCompletionRequestWithExtraBody: properties: model: @@ -9860,55 +9683,7 @@ components: - model - messages title: OpenAIChatCompletionRequestWithExtraBody - description: 'Request parameters for OpenAI-compatible chat completion endpoint. - - - :param model: The identifier of the model to use. The model must be registered - with Llama Stack and available via the /models endpoint. - - :param messages: List of messages in the conversation. - - :param frequency_penalty: (Optional) The penalty for repeated tokens. - - :param function_call: (Optional) The function call to use. - - :param functions: (Optional) List of functions to use. - - :param logit_bias: (Optional) The logit bias to use. - - :param logprobs: (Optional) The log probabilities to use. - - :param max_completion_tokens: (Optional) The maximum number of tokens to generate. - - :param max_tokens: (Optional) The maximum number of tokens to generate. - - :param n: (Optional) The number of completions to generate. - - :param parallel_tool_calls: (Optional) Whether to parallelize tool calls. - - :param presence_penalty: (Optional) The penalty for repeated tokens. - - :param response_format: (Optional) The response format to use. - - :param seed: (Optional) The seed to use. - - :param stop: (Optional) The stop tokens to use. - - :param stream: (Optional) Whether to stream the response. - - :param stream_options: (Optional) The stream options to use. - - :param temperature: (Optional) The temperature to use. - - :param tool_choice: (Optional) The tool choice to use. - - :param tools: (Optional) The tools to use. - - :param top_logprobs: (Optional) The top log probabilities to use. - - :param top_p: (Optional) The top p to use. - - :param user: (Optional) The user to use.' + description: Request parameters for OpenAI-compatible chat completion endpoint. OpenAIChatCompletionToolCall: properties: index: @@ -9926,17 +9701,7 @@ components: $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' type: object title: OpenAIChatCompletionToolCall - description: 'Tool call specification for OpenAI-compatible chat completion - responses. - - - :param index: (Optional) Index of the tool call in the list - - :param id: (Optional) Unique identifier for the tool call - - :param type: Must be "function" to identify this as a function call - - :param function: (Optional) Function call details' + description: Tool call specification for OpenAI-compatible chat completion responses. OpenAIChatCompletionToolCallFunction: properties: name: @@ -9947,12 +9712,7 @@ components: type: string type: object title: OpenAIChatCompletionToolCallFunction - description: 'Function call details for OpenAI-compatible tool calls. - - - :param name: (Optional) Name of the function to call - - :param arguments: (Optional) Arguments to pass to the function as a JSON string' + description: Function call details for OpenAI-compatible tool calls. OpenAIChatCompletionUsage: properties: prompt_tokens: @@ -9974,18 +9734,7 @@ components: - completion_tokens - total_tokens title: OpenAIChatCompletionUsage - description: 'Usage information for OpenAI chat completion. - - - :param prompt_tokens: Number of tokens in the prompt - - :param completion_tokens: Number of tokens in the completion - - :param total_tokens: Total tokens used (prompt + completion) - - :param input_tokens_details: Detailed breakdown of input token usage - - :param output_tokens_details: Detailed breakdown of output token usage' + description: Usage information for OpenAI chat completion. OpenAIChatCompletionUsageCompletionTokensDetails: properties: reasoning_tokens: @@ -9993,10 +9742,7 @@ components: type: integer type: object title: OpenAIChatCompletionUsageCompletionTokensDetails - description: 'Token details for output tokens in OpenAI chat completion usage. - - - :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)' + description: Token details for output tokens in OpenAI chat completion usage. OpenAIChatCompletionUsagePromptTokensDetails: properties: cached_tokens: @@ -10004,10 +9750,7 @@ components: type: integer type: object title: OpenAIChatCompletionUsagePromptTokensDetails - description: 'Token details for prompt tokens in OpenAI chat completion usage. - - - :param cached_tokens: Number of tokens retrieved from cache' + description: Token details for prompt tokens in OpenAI chat completion usage. OpenAIChoice-Output: properties: message: @@ -10040,16 +9783,7 @@ components: - finish_reason - index title: OpenAIChoice - description: 'A choice from an OpenAI-compatible chat completion response. - - - :param message: The message from the model - - :param finish_reason: The reason the model stopped generating - - :param index: The index of the choice - - :param logprobs: (Optional) The log probabilities for the tokens in the message' + description: A choice from an OpenAI-compatible chat completion response. OpenAIChoiceLogprobs-Output: properties: content: @@ -10064,13 +9798,7 @@ components: type: array type: object title: OpenAIChoiceLogprobs - description: 'The log probabilities for the tokens in the message from an OpenAI-compatible - chat completion response. - - - :param content: (Optional) The log probabilities for the tokens in the message - - :param refusal: (Optional) The log probabilities for the tokens in the message' + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. OpenAICompletion: properties: id: @@ -10099,18 +9827,7 @@ components: - created - model title: OpenAICompletion - description: 'Response from an OpenAI-compatible completion request. - - - :id: The ID of the completion - - :choices: List of choices - - :created: The Unix timestamp in seconds when the completion was created - - :model: The model that was used to generate the completion - - :object: The object type, which will be "text_completion"' + description: Response from an OpenAI-compatible completion request. OpenAICompletionChoice-Output: properties: finish_reason: @@ -10130,16 +9847,7 @@ components: - text - index title: OpenAICompletionChoice - description: 'A choice from an OpenAI-compatible completion response. - - - :finish_reason: The reason the model stopped generating - - :text: The text of the choice - - :index: The index of the choice - - :logprobs: (Optional) The log probabilities for the tokens in the choice' + description: A choice from an OpenAI-compatible completion response. OpenAICompletionRequestWithExtraBody: properties: model: @@ -10221,45 +9929,7 @@ components: - model - prompt title: OpenAICompletionRequestWithExtraBody - description: 'Request parameters for OpenAI-compatible completion endpoint. - - - :param model: The identifier of the model to use. The model must be registered - with Llama Stack and available via the /models endpoint. - - :param prompt: The prompt to generate a completion for. - - :param best_of: (Optional) The number of completions to generate. - - :param echo: (Optional) Whether to echo the prompt. - - :param frequency_penalty: (Optional) The penalty for repeated tokens. - - :param logit_bias: (Optional) The logit bias to use. - - :param logprobs: (Optional) The log probabilities to use. - - :param max_tokens: (Optional) The maximum number of tokens to generate. - - :param n: (Optional) The number of completions to generate. - - :param presence_penalty: (Optional) The penalty for repeated tokens. - - :param seed: (Optional) The seed to use. - - :param stop: (Optional) The stop tokens to use. - - :param stream: (Optional) Whether to stream the response. - - :param stream_options: (Optional) The stream options to use. - - :param temperature: (Optional) The temperature to use. - - :param top_p: (Optional) The top p to use. - - :param user: (Optional) The user to use. - - :param suffix: (Optional) The suffix that should be appended to the completion.' + description: Request parameters for OpenAI-compatible completion endpoint. OpenAICreateVectorStoreFileBatchRequestWithExtraBody: properties: file_ids: @@ -10286,15 +9956,7 @@ components: required: - file_ids title: OpenAICreateVectorStoreFileBatchRequestWithExtraBody - description: 'Request to create a vector store file batch with extra_body support. - - - :param file_ids: A list of File IDs that the vector store should use - - :param attributes: (Optional) Key-value attributes to store with the files - - :param chunking_strategy: (Optional) The chunking strategy used to chunk the - file(s). Defaults to auto' + description: Request to create a vector store file batch with extra_body support. OpenAICreateVectorStoreRequestWithExtraBody: properties: name: @@ -10320,19 +9982,7 @@ components: additionalProperties: true type: object title: OpenAICreateVectorStoreRequestWithExtraBody - description: 'Request to create a vector store with extra_body support. - - - :param name: (Optional) A name for the vector store - - :param file_ids: List of file IDs to include in the vector store - - :param expires_after: (Optional) Expiration policy for the vector store - - :param chunking_strategy: (Optional) Strategy for splitting files into chunks - - :param metadata: Set of key-value pairs that can be attached to the vector - store' + description: Request to create a vector store with extra_body support. OpenAIDeveloperMessageParam: properties: role: @@ -10354,15 +10004,7 @@ components: required: - content title: OpenAIDeveloperMessageParam - description: 'A message from the developer in an OpenAI-compatible chat completion - request. - - - :param role: Must be "developer" to identify this as a developer message - - :param content: The content of the developer message - - :param name: (Optional) The name of the developer message participant.' + description: A message from the developer in an OpenAI-compatible chat completion request. OpenAIEmbeddingData: properties: object: @@ -10385,16 +10027,7 @@ components: - embedding - index title: OpenAIEmbeddingData - description: 'A single embedding data object from an OpenAI-compatible embeddings - response. - - - :param object: The object type, which will be "embedding" - - :param embedding: The embedding vector as a list of floats (when encoding_format="float") - or as a base64-encoded string (when encoding_format="base64") - - :param index: The index of the embedding in the input list' + description: A single embedding data object from an OpenAI-compatible embeddings response. OpenAIEmbeddingUsage: properties: prompt_tokens: @@ -10408,12 +10041,7 @@ components: - prompt_tokens - total_tokens title: OpenAIEmbeddingUsage - description: 'Usage information for an OpenAI-compatible embeddings response. - - - :param prompt_tokens: The number of tokens in the input - - :param total_tokens: The total number of tokens used' + description: Usage information for an OpenAI-compatible embeddings response. OpenAIEmbeddingsRequestWithExtraBody: properties: model: @@ -10442,23 +10070,7 @@ components: - model - input title: OpenAIEmbeddingsRequestWithExtraBody - description: 'Request parameters for OpenAI-compatible embeddings endpoint. - - - :param model: The identifier of the model to use. The model must be an embedding - model registered with Llama Stack and available via the /models endpoint. - - :param input: Input text to embed, encoded as a string or array of strings. - To embed multiple inputs in a single request, pass an array of strings. - - :param encoding_format: (Optional) The format to return the embeddings in. - Can be either "float" or "base64". Defaults to "float". - - :param dimensions: (Optional) The number of dimensions the resulting output - embeddings should have. Only supported in text-embedding-3 and later models. - - :param user: (Optional) A unique identifier representing your end-user, which - can help OpenAI to monitor and detect abuse.' + description: Request parameters for OpenAI-compatible embeddings endpoint. OpenAIEmbeddingsResponse: properties: object: @@ -10482,16 +10094,7 @@ components: - model - usage title: OpenAIEmbeddingsResponse - description: 'Response from an OpenAI-compatible embeddings request. - - - :param object: The object type, which will be "list" - - :param data: List of embedding data objects - - :param model: The model that was used to generate the embeddings - - :param usage: Usage information' + description: Response from an OpenAI-compatible embeddings request. OpenAIFile: properties: type: @@ -10551,22 +10154,7 @@ components: - filename - purpose title: OpenAIFileObject - description: 'OpenAI File object as defined in the OpenAI Files API. - - - :param object: The object type, which is always "file" - - :param id: The file identifier, which can be referenced in the API endpoints - - :param bytes: The size of the file, in bytes - - :param created_at: The Unix timestamp (in seconds) for when the file was created - - :param expires_at: The Unix timestamp (in seconds) for when the file expires - - :param filename: The name of the file - - :param purpose: The intended purpose of the file' + description: OpenAI File object as defined in the OpenAI Files API. OpenAIFilePurpose: type: string enum: @@ -10586,14 +10174,7 @@ components: required: - url title: OpenAIImageURL - description: 'Image URL specification for OpenAI-compatible chat completion - messages. - - - :param url: URL of the image to include in the message - - :param detail: (Optional) Level of detail for image processing. Can be "low", - "high", or "auto"' + description: Image URL specification for OpenAI-compatible chat completion messages. OpenAIJSONSchema: properties: name: @@ -10611,17 +10192,7 @@ components: type: object type: object title: OpenAIJSONSchema - description: 'JSON schema specification for OpenAI-compatible structured response - format. - - - :param name: Name of the schema - - :param description: (Optional) Description of the schema - - :param strict: (Optional) Whether to enforce strict adherence to the schema - - :param schema: (Optional) The JSON schema definition' + description: JSON schema specification for OpenAI-compatible structured response format. OpenAIResponseAnnotationCitation: properties: type: @@ -10648,18 +10219,7 @@ components: - title - url title: OpenAIResponseAnnotationCitation - description: 'URL citation annotation for referencing external web resources. - - - :param type: Annotation type identifier, always "url_citation" - - :param end_index: End position of the citation span in the content - - :param start_index: Start position of the citation span in the content - - :param title: Title of the referenced web resource - - :param url: URL of the referenced web resource' + description: URL citation annotation for referencing external web resources. OpenAIResponseAnnotationContainerFileCitation: properties: type: @@ -10712,17 +10272,7 @@ components: - filename - index title: OpenAIResponseAnnotationFileCitation - description: 'File citation annotation for referencing specific files in response - content. - - - :param type: Annotation type identifier, always "file_citation" - - :param file_id: Unique identifier of the referenced file - - :param filename: Name of the referenced file - - :param index: Position index of the citation within the content' + description: File citation annotation for referencing specific files in response content. OpenAIResponseAnnotationFilePath: properties: type: @@ -10755,12 +10305,7 @@ components: required: - refusal title: OpenAIResponseContentPartRefusal - description: 'Refusal content within a streamed response part. - - - :param type: Content part type identifier, always "refusal" - - :param refusal: Refusal text supplied by the model' + description: Refusal content within a streamed response part. OpenAIResponseError: properties: code: @@ -10774,12 +10319,7 @@ components: - code - message title: OpenAIResponseError - description: 'Error details for failed OpenAI response requests. - - - :param code: Error code identifying the type of failure - - :param message: Human-readable error message describing the failure' + description: Error details for failed OpenAI response requests. OpenAIResponseFormatJSONObject: properties: type: @@ -10789,12 +10329,7 @@ components: default: json_object type: object title: OpenAIResponseFormatJSONObject - description: 'JSON object response format for OpenAI-compatible chat completion - requests. - - - :param type: Must be "json_object" to indicate generic JSON object response - format' + description: JSON object response format for OpenAI-compatible chat completion requests. OpenAIResponseFormatJSONSchema: properties: type: @@ -10808,13 +10343,7 @@ components: required: - json_schema title: OpenAIResponseFormatJSONSchema - description: 'JSON schema response format for OpenAI-compatible chat completion - requests. - - - :param type: Must be "json_schema" to indicate structured JSON response format - - :param json_schema: The JSON schema specification for the response' + description: JSON schema response format for OpenAI-compatible chat completion requests. OpenAIResponseFormatText: properties: type: @@ -10824,10 +10353,7 @@ components: default: text type: object title: OpenAIResponseFormatText - description: 'Text response format for OpenAI-compatible chat completion requests. - - - :param type: Must be "text" to indicate plain text response format' + description: Text response format for OpenAI-compatible chat completion requests. OpenAIResponseInputFunctionToolCallOutput: properties: call_id: @@ -10852,8 +10378,7 @@ components: - call_id - output title: OpenAIResponseInputFunctionToolCallOutput - description: This represents the output of a function call that gets passed - back to the model. + description: This represents the output of a function call that gets passed back to the model. OpenAIResponseInputMessageContentFile: properties: type: @@ -10875,18 +10400,7 @@ components: type: string type: object title: OpenAIResponseInputMessageContentFile - description: 'File content for input messages in OpenAI response format. - - - :param type: The type of the input item. Always `input_file`. - - :param file_data: The data of the file to be sent to the model. - - :param file_id: (Optional) The ID of the file to be sent to the model. - - :param file_url: The URL of the file to be sent to the model. - - :param filename: The name of the file to be sent to the model.' + description: File content for input messages in OpenAI response format. OpenAIResponseInputMessageContentImage: properties: detail: @@ -10912,17 +10426,7 @@ components: type: string type: object title: OpenAIResponseInputMessageContentImage - description: 'Image content for input messages in OpenAI response format. - - - :param detail: Level of detail for image processing, can be "low", "high", - or "auto" - - :param type: Content type identifier, always "input_image" - - :param file_id: (Optional) The ID of the file to be sent to the model. - - :param image_url: (Optional) URL of the image content' + description: Image content for input messages in OpenAI response format. OpenAIResponseInputMessageContentText: properties: text: @@ -10937,12 +10441,7 @@ components: required: - text title: OpenAIResponseInputMessageContentText - description: 'Text content for input messages in OpenAI response format. - - - :param text: The text content of the input message - - :param type: Content type identifier, always "input_text"' + description: Text content for input messages in OpenAI response format. OpenAIResponseInputToolFileSearch: properties: type: @@ -10971,20 +10470,7 @@ components: required: - vector_store_ids title: OpenAIResponseInputToolFileSearch - description: 'File search tool configuration for OpenAI response inputs. - - - :param type: Tool type identifier, always "file_search" - - :param vector_store_ids: List of vector store identifiers to search within - - :param filters: (Optional) Additional filters to apply to the search - - :param max_num_results: (Optional) Maximum number of search results to return - (1-50) - - :param ranking_options: (Optional) Options for ranking and scoring search - results' + description: File search tool configuration for OpenAI response inputs. OpenAIResponseInputToolFunction: properties: type: @@ -11010,18 +10496,7 @@ components: - name - parameters title: OpenAIResponseInputToolFunction - description: 'Function tool configuration for OpenAI response inputs. - - - :param type: Tool type identifier, always "function" - - :param name: Name of the function that can be called - - :param description: (Optional) Description of what the function does - - :param parameters: (Optional) JSON schema defining the function''s parameters - - :param strict: (Optional) Whether to enforce strict parameter validation' + description: Function tool configuration for OpenAI response inputs. OpenAIResponseInputToolMCP: properties: type: @@ -11060,24 +10535,7 @@ components: - server_label - server_url title: OpenAIResponseInputToolMCP - description: 'Model Context Protocol (MCP) tool configuration for OpenAI response - inputs. - - - :param type: Tool type identifier, always "mcp" - - :param server_label: Label to identify this MCP server - - :param server_url: URL endpoint of the MCP server - - :param headers: (Optional) HTTP headers to include when connecting to the - server - - :param require_approval: Approval requirement for tool calls ("always", "never", - or filter) - - :param allowed_tools: (Optional) Restriction on which tools can be used from - this server' + description: Model Context Protocol (MCP) tool configuration for OpenAI response inputs. OpenAIResponseInputToolWebSearch: properties: type: @@ -11097,13 +10555,7 @@ components: pattern: ^low|medium|high$ type: object title: OpenAIResponseInputToolWebSearch - description: 'Web search tool configuration for OpenAI response inputs. - - - :param type: Web search tool type variant to use - - :param search_context_size: (Optional) Size of search context, must be "low", - "medium", or "high"' + description: Web search tool configuration for OpenAI response inputs. OpenAIResponseMCPApprovalRequest: properties: arguments: @@ -11211,13 +10663,7 @@ components: - content - role title: OpenAIResponseMessage - description: 'Corresponds to the various Message types in the Responses API. - - They are all under one type because the Responses API gives them all - - the same "type" value, and there is no way to tell them apart in certain - - scenarios.' + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." OpenAIResponseMessage-Output: properties: content: @@ -11273,13 +10719,7 @@ components: - content - role title: OpenAIResponseMessage - description: 'Corresponds to the various Message types in the Responses API. - - They are all under one type because the Responses API gives them all - - the same "type" value, and there is no way to tell them apart in certain - - scenarios.' + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." OpenAIResponseObject: properties: created_at: @@ -11377,45 +10817,7 @@ components: - output - status title: OpenAIResponseObject - description: 'Complete OpenAI response object containing generation results - and metadata. - - - :param created_at: Unix timestamp when the response was created - - :param error: (Optional) Error details if the response generation failed - - :param id: Unique identifier for this response - - :param model: Model identifier used for generation - - :param object: Object type identifier, always "response" - - :param output: List of generated output items (messages, tool calls, etc.) - - :param parallel_tool_calls: Whether tool calls can be executed in parallel - - :param previous_response_id: (Optional) ID of the previous response in a conversation - - :param prompt: (Optional) Reference to a prompt template and its variables. - - :param status: Current status of the response generation - - :param temperature: (Optional) Sampling temperature used for generation - - :param text: Text formatting configuration for the response - - :param top_p: (Optional) Nucleus sampling parameter used for generation - - :param tools: (Optional) An array of tools the model may call while generating - a response. - - :param truncation: (Optional) Truncation strategy applied to the response - - :param usage: (Optional) Token usage information for the response - - :param instructions: (Optional) System message inserted into the model''s - context' + description: Complete OpenAI response object containing generation results and metadata. OpenAIResponseOutputMessageContentOutputText: properties: text: @@ -11475,18 +10877,7 @@ components: - queries - status title: OpenAIResponseOutputMessageFileSearchToolCall - description: 'File search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param queries: List of search queries executed - - :param status: Current status of the file search operation - - :param type: Tool call type identifier, always "file_search_call" - - :param results: (Optional) Search results returned by the file search operation' + description: File search tool call output message for OpenAI responses. OpenAIResponseOutputMessageFileSearchToolCallResults: properties: attributes: @@ -11513,18 +10904,7 @@ components: - score - text title: OpenAIResponseOutputMessageFileSearchToolCallResults - description: 'Search results returned by the file search operation. - - - :param attributes: (Optional) Key-value attributes associated with the file - - :param file_id: Unique identifier of the file containing the result - - :param filename: Name of the file containing the result - - :param score: Relevance score for this search result (between 0 and 1) - - :param text: Text content of the search result' + description: Search results returned by the file search operation. OpenAIResponseOutputMessageFunctionToolCall: properties: call_id: @@ -11553,20 +10933,7 @@ components: - name - arguments title: OpenAIResponseOutputMessageFunctionToolCall - description: 'Function tool call output message for OpenAI responses. - - - :param call_id: Unique identifier for the function call - - :param name: Name of the function being called - - :param arguments: JSON string containing the function arguments - - :param type: Tool call type identifier, always "function_call" - - :param id: (Optional) Additional identifier for the tool call - - :param status: (Optional) Current status of the function call execution' + description: Function tool call output message for OpenAI responses. OpenAIResponseOutputMessageMCPCall: properties: id: @@ -11599,22 +10966,7 @@ components: - name - server_label title: OpenAIResponseOutputMessageMCPCall - description: 'Model Context Protocol (MCP) call output message for OpenAI responses. - - - :param id: Unique identifier for this MCP call - - :param type: Tool call type identifier, always "mcp_call" - - :param arguments: JSON string containing the MCP call arguments - - :param name: Name of the MCP method being called - - :param server_label: Label identifying the MCP server handling the call - - :param error: (Optional) Error message if the MCP call failed - - :param output: (Optional) Output result from the successful MCP call' + description: Model Context Protocol (MCP) call output message for OpenAI responses. OpenAIResponseOutputMessageMCPListTools: properties: id: @@ -11639,17 +10991,7 @@ components: - server_label - tools title: OpenAIResponseOutputMessageMCPListTools - description: 'MCP list tools output message containing available tools from - an MCP server. - - - :param id: Unique identifier for this MCP list tools operation - - :param type: Tool call type identifier, always "mcp_list_tools" - - :param server_label: Label identifying the MCP server providing the tools - - :param tools: List of available tools provided by the MCP server' + description: MCP list tools output message containing available tools from an MCP server. OpenAIResponseOutputMessageWebSearchToolCall: properties: id: @@ -11668,14 +11010,7 @@ components: - id - status title: OpenAIResponseOutputMessageWebSearchToolCall - description: 'Web search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param status: Current status of the web search operation - - :param type: Tool call type identifier, always "web_search_call"' + description: Web search tool call output message for OpenAI responses. OpenAIResponsePrompt: properties: id: @@ -11702,30 +11037,14 @@ components: required: - id title: OpenAIResponsePrompt - description: 'OpenAI compatible Prompt object that is used in OpenAI responses. - - - :param id: Unique identifier of the prompt template - - :param variables: Dictionary of variable names to OpenAIResponseInputMessageContent - structure for template substitution. The substitution values can either be - strings, or other Response input types - - like images or files. - - :param version: Version number of the prompt to use (defaults to latest if - not specified)' + description: OpenAI compatible Prompt object that is used in OpenAI responses. OpenAIResponseText: properties: format: $ref: '#/components/schemas/OpenAIResponseTextFormat' type: object title: OpenAIResponseText - description: 'Text response configuration for OpenAI responses. - - - :param format: (Optional) Text format configuration specifying output format - requirements' + description: Text response configuration for OpenAI responses. OpenAIResponseTextFormat: properties: type: @@ -11752,22 +11071,7 @@ components: type: boolean type: object title: OpenAIResponseTextFormat - description: 'Configuration for Responses API text format. - - - :param type: Must be "text", "json_schema", or "json_object" to identify the - format type - - :param name: The name of the response format. Only used for json_schema. - - :param schema: The JSON schema the response should conform to. In a Python - SDK, this is often a `pydantic` model. Only used for json_schema. - - :param description: (Optional) A description of the response format. Only - used for json_schema. - - :param strict: (Optional) Whether to strictly enforce the JSON schema. If - true, the response must match the schema exactly. Only used for json_schema.' + description: Configuration for Responses API text format. OpenAIResponseToolMCP: properties: type: @@ -11789,16 +11093,7 @@ components: required: - server_label title: OpenAIResponseToolMCP - description: 'Model Context Protocol (MCP) tool configuration for OpenAI response - object. - - - :param type: Tool type identifier, always "mcp" - - :param server_label: Label to identify this MCP server - - :param allowed_tools: (Optional) Restriction on which tools can be used from - this server' + description: Model Context Protocol (MCP) tool configuration for OpenAI response object. OpenAIResponseUsage: properties: input_tokens: @@ -11820,18 +11115,7 @@ components: - output_tokens - total_tokens title: OpenAIResponseUsage - description: 'Usage information for OpenAI response. - - - :param input_tokens: Number of tokens in the input - - :param output_tokens: Number of tokens in the output - - :param total_tokens: Total tokens used (input + output) - - :param input_tokens_details: Detailed breakdown of input token usage - - :param output_tokens_details: Detailed breakdown of output token usage' + description: Usage information for OpenAI response. OpenAIResponseUsageInputTokensDetails: properties: cached_tokens: @@ -11839,10 +11123,7 @@ components: type: integer type: object title: OpenAIResponseUsageInputTokensDetails - description: 'Token details for input tokens in OpenAI response usage. - - - :param cached_tokens: Number of tokens retrieved from cache' + description: Token details for input tokens in OpenAI response usage. OpenAIResponseUsageOutputTokensDetails: properties: reasoning_tokens: @@ -11850,10 +11131,7 @@ components: type: integer type: object title: OpenAIResponseUsageOutputTokensDetails - description: 'Token details for output tokens in OpenAI response usage. - - - :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)' + description: Token details for output tokens in OpenAI response usage. OpenAISystemMessageParam: properties: role: @@ -11875,16 +11153,7 @@ components: required: - content title: OpenAISystemMessageParam - description: 'A system message providing instructions or context to the model. - - - :param role: Must be "system" to identify this as a system message - - :param content: The content of the "system prompt". If multiple system messages - are provided, they are concatenated. The underlying Llama Stack code may also - add other system messages (for example, for formatting tool definitions). - - :param name: (Optional) The name of the system message participant.' + description: A system message providing instructions or context to the model. OpenAITokenLogProb: properties: token: @@ -11909,17 +11178,7 @@ components: - logprob - top_logprobs title: OpenAITokenLogProb - description: 'The log probability for a token from an OpenAI-compatible chat - completion response. - - - :token: The token - - :bytes: (Optional) The bytes for the token - - :logprob: The log probability of the token - - :top_logprobs: The top log probabilities for the token' + description: The log probability for a token from an OpenAI-compatible chat completion response. OpenAIToolMessageParam: properties: role: @@ -11942,16 +11201,7 @@ components: - tool_call_id - content title: OpenAIToolMessageParam - description: 'A message representing the result of a tool invocation in an OpenAI-compatible - chat completion request. - - - :param role: Must be "tool" to identify this as a tool response - - :param tool_call_id: Unique identifier for the tool call this response is - for - - :param content: The response content from the tool' + description: A message representing the result of a tool invocation in an OpenAI-compatible chat completion request. OpenAITopLogProb: properties: token: @@ -11970,15 +11220,7 @@ components: - token - logprob title: OpenAITopLogProb - description: 'The top log probability for a token from an OpenAI-compatible - chat completion response. - - - :token: The token - - :bytes: (Optional) The bytes for the token - - :logprob: The log probability of the token' + description: The top log probability for a token from an OpenAI-compatible chat completion response. OpenAIUserMessageParam-Input: properties: role: @@ -12009,16 +11251,7 @@ components: required: - content title: OpenAIUserMessageParam - description: 'A message from the user in an OpenAI-compatible chat completion - request. - - - :param role: Must be "user" to identify this as a user message - - :param content: The content of the message, which can include text and other - media - - :param name: (Optional) The name of the user message participant.' + description: A message from the user in an OpenAI-compatible chat completion request. OpenAIUserMessageParam-Output: properties: role: @@ -12049,27 +11282,14 @@ components: required: - content title: OpenAIUserMessageParam - description: 'A message from the user in an OpenAI-compatible chat completion - request. - - - :param role: Must be "user" to identify this as a user message - - :param content: The content of the message, which can include text and other - media - - :param name: (Optional) The name of the user message participant.' + description: A message from the user in an OpenAI-compatible chat completion request. Order: type: string enum: - asc - desc title: Order - description: 'Sort order for paginated responses. - - :cvar asc: Ascending order - - :cvar desc: Descending order' + description: Sort order for paginated responses. OutputTokensDetails: properties: reasoning_tokens: @@ -12111,22 +11331,7 @@ components: - version - prompt_id title: Prompt - description: 'A prompt resource representing a stored OpenAI Compatible prompt - template in Llama Stack. - - - :param prompt: The system prompt text with variable placeholders. Variables - are only supported when using the Responses API. - - :param version: Version (integer starting at 1, incremented on save) - - :param prompt_id: Unique identifier formatted as ''pmpt_<48-digit-hash>'' - - :param variables: List of prompt variable names that can be used in the prompt - template - - :param is_default: Boolean indicating whether this version is the default - version for this prompt' + description: A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack. ProviderInfo: properties: api: @@ -12154,19 +11359,7 @@ components: - config - health title: ProviderInfo - description: 'Information about a registered provider including its configuration - and health status. - - - :param api: The API name this provider implements - - :param provider_id: Unique identifier for the provider - - :param provider_type: The type of provider implementation - - :param config: Configuration parameters for the provider - - :param health: Current health status of the provider' + description: Information about a registered provider including its configuration and health status. QueryChunksResponse: properties: chunks: @@ -12184,12 +11377,7 @@ components: - chunks - scores title: QueryChunksResponse - description: 'Response from querying chunks in a vector database. - - - :param chunks: List of content chunks returned from the query - - :param scores: Relevance scores corresponding to each returned chunk' + description: Response from querying chunks in a vector database. RAGQueryConfig: properties: query_generator_config: @@ -12216,13 +11404,7 @@ components: chunk_template: type: string title: Chunk Template - default: 'Result {index} - - Content: {chunk.content} - - Metadata: {metadata} - - ' + default: "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n" mode: default: vector $ref: '#/components/schemas/RAGSearchMode' @@ -12238,16 +11420,7 @@ components: weighted: '#/components/schemas/WeightedRanker' type: object title: RAGQueryConfig - description: "Configuration for the RAG query generation.\n\n:param query_generator_config:\ - \ Configuration for the query generator.\n:param max_tokens_in_context: Maximum\ - \ number of tokens in the context.\n:param max_chunks: Maximum number of chunks\ - \ to retrieve.\n:param chunk_template: Template for formatting each retrieved\ - \ chunk in the context.\n Available placeholders: {index} (1-based chunk\ - \ ordinal), {chunk.content} (chunk content string), {metadata} (chunk metadata\ - \ dict).\n Default: \"Result {index}\\nContent: {chunk.content}\\nMetadata:\ - \ {metadata}\\n\"\n:param mode: Search mode for retrieval\u2014either \"vector\"\ - , \"keyword\", or \"hybrid\". Default \"vector\".\n:param ranker: Configuration\ - \ for the ranker to use in hybrid search. Defaults to RRF ranker." + description: Configuration for the RAG query generation. RAGQueryResult: properties: content: @@ -12278,12 +11451,7 @@ components: title: Metadata type: object title: RAGQueryResult - description: 'Result of a RAG query containing retrieved content and metadata. - - - :param content: (Optional) The retrieved content from the query - - :param metadata: Additional metadata about the query result' + description: Result of a RAG query containing retrieved content and metadata. RAGSearchMode: type: string enum: @@ -12291,13 +11459,7 @@ components: - keyword - hybrid title: RAGSearchMode - description: 'Search modes for RAG query retrieval: - - - VECTOR: Uses vector similarity search for semantic matching - - - KEYWORD: Uses keyword-based search for exact matching - - - HYBRID: Combines both vector and keyword search for better results' + description: "Search modes for RAG query retrieval:\n- VECTOR: Uses vector similarity search for semantic matching\n- KEYWORD: Uses keyword-based search for exact matching\n- HYBRID: Combines both vector and keyword search for better results" RRFRanker: properties: type: @@ -12312,10 +11474,7 @@ components: minimum: 0.0 type: object title: RRFRanker - description: "Reciprocal Rank Fusion (RRF) ranker configuration.\n\n:param type:\ - \ The type of ranker, always \"rrf\"\n:param impact_factor: The impact factor\ - \ for RRF scoring. Higher values give more weight to higher-ranked results.\n\ - \ Must be greater than 0" + description: Reciprocal Rank Fusion (RRF) ranker configuration. RegexParserScoringFnParams: properties: type: @@ -12337,14 +11496,7 @@ components: description: Aggregation functions to apply to the scores of each row type: object title: RegexParserScoringFnParams - description: 'Parameters for regex parser scoring function configuration. - - :param type: The type of scoring function parameters, always regex_parser - - :param parsing_regexes: Regex to extract the answer from generated response - - :param aggregation_functions: Aggregation functions to apply to the scores - of each row' + description: Parameters for regex parser scoring function configuration. RouteInfo: properties: route: @@ -12364,25 +11516,14 @@ components: - method - provider_types title: RouteInfo - description: 'Information about an API route including its path, method, and - implementing providers. - - - :param route: The API endpoint path - - :param method: HTTP method for the route - - :param provider_types: List of provider types that implement this route' + description: Information about an API route including its path, method, and implementing providers. RunShieldResponse: properties: violation: $ref: '#/components/schemas/SafetyViolation' type: object title: RunShieldResponse - description: 'Response from running a safety shield. - - - :param violation: (Optional) Safety violation detected by the shield, if any' + description: Response from running a safety shield. SafetyViolation: properties: violation_level: @@ -12398,15 +11539,7 @@ components: required: - violation_level title: SafetyViolation - description: 'Details of a safety violation detected by content moderation. - - - :param violation_level: Severity level of the violation - - :param user_message: (Optional) Message to convey to the user about the violation - - :param metadata: Additional metadata including specific violation codes for - debugging and telemetry' + description: Details of a safety violation detected by content moderation. ScoreBatchResponse: properties: dataset_id: @@ -12421,12 +11554,7 @@ components: required: - results title: ScoreBatchResponse - description: 'Response from batch scoring operations on datasets. - - - :param dataset_id: (Optional) The identifier of the dataset that was scored - - :param results: A map of scoring function name to ScoringResult' + description: Response from batch scoring operations on datasets. ScoreResponse: properties: results: @@ -12438,10 +11566,7 @@ components: required: - results title: ScoreResponse - description: 'The response from scoring. - - - :param results: A map of scoring function name to ScoringResult.' + description: The response from scoring. ScoringFn-Output: properties: identifier: @@ -12498,8 +11623,7 @@ components: union: '#/components/schemas/UnionType' params: title: Params - description: The parameters for the scoring function for benchmark eval, - these can be overridden for app eval + description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval oneOf: - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - $ref: '#/components/schemas/RegexParserScoringFnParams' @@ -12516,9 +11640,7 @@ components: - provider_id - return_type title: ScoringFn - description: 'A scoring function resource for evaluating model outputs. - - :param type: The resource type, always scoring_function' + description: A scoring function resource for evaluating model outputs. ScoringResult: properties: score_rows: @@ -12536,13 +11658,7 @@ components: - score_rows - aggregated_results title: ScoringResult - description: 'A scoring result for a single row. - - - :param score_rows: The scoring result for each row. Each row is a map of column - name to value. - - :param aggregated_results: Map of metric name to aggregated value' + description: A scoring result for a single row. SearchRankingOptions: properties: ranker: @@ -12554,12 +11670,7 @@ components: type: number type: object title: SearchRankingOptions - description: 'Options for ranking and filtering search results. - - - :param ranker: (Optional) Name of the ranking algorithm to use - - :param score_threshold: (Optional) Minimum relevance score threshold for results' + description: Options for ranking and filtering search results. Shield: properties: identifier: @@ -12588,12 +11699,7 @@ components: - identifier - provider_id title: Shield - description: 'A safety shield resource that can be used to check content. - - - :param params: (Optional) Configuration parameters for the shield - - :param type: The resource type, always shield' + description: A safety shield resource that can be used to check content. StringType: properties: type: @@ -12603,10 +11709,7 @@ components: default: string type: object title: StringType - description: 'Parameter type for string values. - - - :param type: Discriminator type. Always "string"' + description: Parameter type for string values. TextContentItem: properties: type: @@ -12621,12 +11724,7 @@ components: required: - text title: TextContentItem - description: 'A text content item - - - :param type: Discriminator type of the content item. Always "text" - - :param text: Text content' + description: A text content item ToolDef: properties: toolgroup_id: @@ -12654,21 +11752,7 @@ components: required: - name title: ToolDef - description: 'Tool definition used in runtime contexts. - - - :param name: Name of the tool - - :param description: (Optional) Human-readable description of what the tool - does - - :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) - - :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) - - :param metadata: (Optional) Additional metadata about the tool - - :param toolgroup_id: (Optional) ID of the tool group this tool belongs to' + description: Tool definition used in runtime contexts. ToolGroup: properties: identifier: @@ -12699,15 +11783,7 @@ components: - identifier - provider_id title: ToolGroup - description: 'A group of related tools managed together. - - - :param type: Type of resource, always ''tool_group'' - - :param mcp_endpoint: (Optional) Model Context Protocol endpoint for remote - tools - - :param args: (Optional) Additional arguments for the tool group' + description: A group of related tools managed together. ToolInvocationResult: properties: content: @@ -12744,16 +11820,7 @@ components: type: object type: object title: ToolInvocationResult - description: 'Result of a tool invocation. - - - :param content: (Optional) The output content from the tool execution - - :param error_message: (Optional) Error message if the tool execution failed - - :param error_code: (Optional) Numeric error code if the tool execution failed - - :param metadata: (Optional) Additional metadata about the tool execution' + description: Result of a tool invocation. URL: properties: uri: @@ -12763,10 +11830,7 @@ components: required: - uri title: URL - description: 'A URL reference to external content. - - - :param uri: The URL string pointing to the resource' + description: A URL reference to external content. UnionType: properties: type: @@ -12776,10 +11840,7 @@ components: default: union type: object title: UnionType - description: 'Parameter type for union values. - - - :param type: Discriminator type. Always "union"' + description: Parameter type for union values. VectorStoreChunkingStrategyAuto: properties: type: @@ -12789,10 +11850,7 @@ components: default: auto type: object title: VectorStoreChunkingStrategyAuto - description: 'Automatic chunking strategy for vector store files. - - - :param type: Strategy type, always "auto" for automatic chunking' + description: Automatic chunking strategy for vector store files. VectorStoreChunkingStrategyStatic: properties: type: @@ -12806,12 +11864,7 @@ components: required: - static title: VectorStoreChunkingStrategyStatic - description: 'Static chunking strategy with configurable parameters. - - - :param type: Strategy type, always "static" for static chunking - - :param static: Configuration parameters for the static chunking strategy' + description: Static chunking strategy with configurable parameters. VectorStoreChunkingStrategyStaticConfig: properties: chunk_overlap_tokens: @@ -12826,14 +11879,7 @@ components: default: 800 type: object title: VectorStoreChunkingStrategyStaticConfig - description: 'Configuration for static chunking strategy. - - - :param chunk_overlap_tokens: Number of tokens to overlap between adjacent - chunks - - :param max_chunk_size_tokens: Maximum number of tokens per chunk, must be - between 100 and 4096' + description: Configuration for static chunking strategy. VectorStoreContent: properties: type: @@ -12848,12 +11894,7 @@ components: - type - text title: VectorStoreContent - description: 'Content item from a vector store file or search result. - - - :param type: Content type, currently only "text" is supported - - :param text: The actual text content' + description: Content item from a vector store file or search result. VectorStoreFileBatchObject: properties: id: @@ -12890,20 +11931,7 @@ components: - status - file_counts title: VectorStoreFileBatchObject - description: 'OpenAI Vector Store File Batch object. - - - :param id: Unique identifier for the file batch - - :param object: Object type identifier, always "vector_store.file_batch" - - :param created_at: Timestamp when the file batch was created - - :param vector_store_id: ID of the vector store containing the file batch - - :param status: Current processing status of the file batch - - :param file_counts: File processing status counts for the batch' + description: OpenAI Vector Store File Batch object. VectorStoreFileCounts: properties: completed: @@ -12929,18 +11957,7 @@ components: - in_progress - total title: VectorStoreFileCounts - description: 'File processing status counts for a vector store. - - - :param completed: Number of files that have been successfully processed - - :param cancelled: Number of files that had their processing cancelled - - :param failed: Number of files that failed to process - - :param in_progress: Number of files currently being processed - - :param total: Total number of files in the vector store' + description: File processing status counts for a vector store. VectorStoreFileLastError: properties: code: @@ -12958,12 +11975,7 @@ components: - code - message title: VectorStoreFileLastError - description: 'Error information for failed vector store file processing. - - - :param code: Error code indicating the type of failure - - :param message: Human-readable error message describing the failure' + description: Error information for failed vector store file processing. VectorStoreFileObject: properties: id: @@ -13018,26 +12030,7 @@ components: - status - vector_store_id title: VectorStoreFileObject - description: 'OpenAI Vector Store File object. - - - :param id: Unique identifier for the file - - :param object: Object type identifier, always "vector_store.file" - - :param attributes: Key-value attributes associated with the file - - :param chunking_strategy: Strategy used for splitting the file into chunks - - :param created_at: Timestamp when the file was added to the vector store - - :param last_error: (Optional) Error information if file processing failed - - :param status: Current processing status of the file - - :param usage_bytes: Storage space used by this file in bytes - - :param vector_store_id: ID of the vector store containing this file' + description: OpenAI Vector Store File object. VectorStoreObject: properties: id: @@ -13083,32 +12076,7 @@ components: - created_at - file_counts title: VectorStoreObject - description: 'OpenAI Vector Store object. - - - :param id: Unique identifier for the vector store - - :param object: Object type identifier, always "vector_store" - - :param created_at: Timestamp when the vector store was created - - :param name: (Optional) Name of the vector store - - :param usage_bytes: Storage space used by the vector store in bytes - - :param file_counts: File processing status counts for the vector store - - :param status: Current status of the vector store - - :param expires_after: (Optional) Expiration policy for the vector store - - :param expires_at: (Optional) Timestamp when the vector store will expire - - :param last_active_at: (Optional) Timestamp of last activity on the vector - store - - :param metadata: Set of key-value pairs that can be attached to the vector - store' + description: OpenAI Vector Store object. VectorStoreSearchResponse: properties: file_id: @@ -13140,18 +12108,7 @@ components: - score - content title: VectorStoreSearchResponse - description: 'Response from searching a vector store. - - - :param file_id: Unique identifier of the file containing the result - - :param filename: Name of the file containing the result - - :param score: Relevance score for this search result - - :param attributes: (Optional) Key-value attributes associated with the file - - :param content: List of content items matching the search query' + description: Response from searching a vector store. VectorStoreSearchResponsePage: properties: object: @@ -13178,18 +12135,7 @@ components: - search_query - data title: VectorStoreSearchResponsePage - description: 'Paginated response from searching a vector store. - - - :param object: Object type identifier for the search results page - - :param search_query: The original search query that was executed - - :param data: List of search result objects - - :param has_more: Whether there are more results available beyond this page - - :param next_page: (Optional) Token for retrieving the next page of results' + description: Paginated response from searching a vector store. VersionInfo: properties: version: @@ -13199,10 +12145,7 @@ components: required: - version title: VersionInfo - description: 'Version information for the service. - - - :param version: Version number of the service' + description: Version information for the service. ViolationLevel: type: string enum: @@ -13210,14 +12153,7 @@ components: - warn - error title: ViolationLevel - description: 'Severity level of a safety violation. - - - :cvar INFO: Informational level violation that does not require action - - :cvar WARN: Warning level violation that suggests caution but allows continuation - - :cvar ERROR: Error level violation that requires blocking or intervention' + description: Severity level of a safety violation. WeightedRanker: properties: type: @@ -13230,16 +12166,11 @@ components: maximum: 1.0 minimum: 0.0 title: Alpha - description: Weight factor between 0 and 1. 0 means only keyword scores, - 1 means only vector scores. + description: Weight factor between 0 and 1. 0 means only keyword scores, 1 means only vector scores. default: 0.5 type: object title: WeightedRanker - description: "Weighted ranker configuration that combines vector and keyword\ - \ scores.\n\n:param type: The type of ranker, always \"weighted\"\n:param\ - \ alpha: Weight factor between 0 and 1.\n 0 means only use keyword\ - \ scores,\n 1 means only use vector scores,\n values\ - \ in between blend both scores." + description: Weighted ranker configuration that combines vector and keyword scores. _URLOrData: properties: url: @@ -13250,13 +12181,7 @@ components: type: string type: object title: _URLOrData - description: 'A URL or a base64 encoded string - - - :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - - :param data: base64 encoded image data as string' + description: A URL or a base64 encoded string _batches_Request: properties: input_file_id: @@ -13720,18 +12645,7 @@ components: - ranking_options title: _vector_stores_vector_store_id_search_Request Error: - description: 'Error response from the API. Roughly follows RFC 7807. - - - :param status: HTTP status code - - :param title: Error title, a short summary of the error which is invariant - for an error type - - :param detail: Error detail, a longer human-readable description of the error - - :param instance: (Optional) A URL which can be used to retrieve more information - about the specific occurrence of the error' + description: Error response from the API. Roughly follows RFC 7807. properties: status: title: Status @@ -13753,25 +12667,20 @@ components: title: Error type: object ListOpenAIResponseInputItem: - description: 'List container for OpenAI response input items. - - - :param data: List of input items - - :param object: Object type identifier, always "list"' + description: List container for OpenAI response input items. properties: data: items: anyOf: - discriminator: mapping: - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' propertyName: type oneOf: - $ref: '#/components/schemas/OpenAIResponseMessage' @@ -13796,18 +12705,7 @@ components: title: ListOpenAIResponseInputItem type: object ListOpenAIResponseObject: - description: 'Paginated list of OpenAI response objects with navigation metadata. - - - :param data: List of response objects with their input context - - :param has_more: Whether there are more results available beyond this page - - :param first_id: Identifier of the first item in this page - - :param last_id: Identifier of the last item in this page - - :param object: Object type identifier, always "list"' + description: Paginated list of OpenAI response objects with navigation metadata. properties: data: items: @@ -13836,14 +12734,7 @@ components: title: ListOpenAIResponseObject type: object OpenAIDeleteResponseObject: - description: 'Response object confirming deletion of an OpenAI response. - - - :param id: Unique identifier of the deleted response - - :param object: Object type identifier, always "response" - - :param deleted: Deletion confirmation flag, always True' + description: Response object confirming deletion of an OpenAI response. properties: id: title: Id @@ -13937,18 +12828,7 @@ components: title: ConversationItemDeletedResource type: object ListOpenAIFileResponse: - description: 'Response for listing files in OpenAI Files API. - - - :param data: List of file objects - - :param has_more: Whether there are more files available beyond this page - - :param first_id: ID of the first file in the list for pagination - - :param last_id: ID of the last file in the list for pagination - - :param object: The object type, which is always "list"' + description: Response for listing files in OpenAI Files API. properties: data: items: @@ -13977,14 +12857,7 @@ components: title: ListOpenAIFileResponse type: object OpenAIFileDeleteResponse: - description: 'Response for deleting a file in OpenAI Files API. - - - :param id: The file identifier that was deleted - - :param object: The object type, which is always "file" - - :param deleted: Whether the file was successfully deleted' + description: Response for deleting a file in OpenAI Files API. properties: id: title: Id @@ -14003,19 +12876,7 @@ components: title: OpenAIFileDeleteResponse type: object ListOpenAIChatCompletionResponse: - description: 'Response from listing OpenAI-compatible chat completions. - - - :param data: List of chat completion objects with their input messages - - :param has_more: Whether there are more completions available beyond this - list - - :param first_id: ID of the first completion in this list - - :param last_id: ID of the last completion in this list - - :param object: Must be "list" to identify this as a list response' + description: Response from listing OpenAI-compatible chat completions. properties: data: items: @@ -14044,18 +12905,7 @@ components: title: ListOpenAIChatCompletionResponse type: object OpenAIAssistantMessageParam: - description: 'A message containing the model''s (assistant) response in an OpenAI-compatible - chat completion request. - - - :param role: Must be "assistant" to identify this as the model''s response - - :param content: The content of the model''s response - - :param name: (Optional) The name of the assistant message participant. - - :param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall - object.' + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. properties: role: const: assistant @@ -14083,25 +12933,16 @@ components: title: OpenAIAssistantMessageParam type: object OpenAIChoice: - description: 'A choice from an OpenAI-compatible chat completion response. - - - :param message: The message from the model - - :param finish_reason: The reason the model stopped generating - - :param index: The index of the choice - - :param logprobs: (Optional) The log probabilities for the tokens in the message' + description: A choice from an OpenAI-compatible chat completion response. properties: message: discriminator: mapping: - assistant: '#/components/schemas/OpenAIAssistantMessageParam' - developer: '#/components/schemas/OpenAIDeveloperMessageParam' - system: '#/components/schemas/OpenAISystemMessageParam' - tool: '#/components/schemas/OpenAIToolMessageParam' - user: '#/components/schemas/OpenAIUserMessageParam' + assistant: '#/$defs/OpenAIAssistantMessageParam' + developer: '#/$defs/OpenAIDeveloperMessageParam' + system: '#/$defs/OpenAISystemMessageParam' + tool: '#/$defs/OpenAIToolMessageParam' + user: '#/$defs/OpenAIUserMessageParam' propertyName: role oneOf: - $ref: '#/components/schemas/OpenAIUserMessageParam' @@ -14126,13 +12967,7 @@ components: title: OpenAIChoice type: object OpenAIChoiceLogprobs: - description: 'The log probabilities for the tokens in the message from an OpenAI-compatible - chat completion response. - - - :param content: (Optional) The log probabilities for the tokens in the message - - :param refusal: (Optional) The log probabilities for the tokens in the message' + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. properties: content: title: Content @@ -14176,11 +13011,11 @@ components: items: discriminator: mapping: - assistant: '#/components/schemas/OpenAIAssistantMessageParam' - developer: '#/components/schemas/OpenAIDeveloperMessageParam' - system: '#/components/schemas/OpenAISystemMessageParam' - tool: '#/components/schemas/OpenAIToolMessageParam' - user: '#/components/schemas/OpenAIUserMessageParam' + assistant: '#/$defs/OpenAIAssistantMessageParam' + developer: '#/$defs/OpenAIDeveloperMessageParam' + system: '#/$defs/OpenAISystemMessageParam' + tool: '#/$defs/OpenAIToolMessageParam' + user: '#/$defs/OpenAIUserMessageParam' propertyName: role oneOf: - $ref: '#/components/schemas/OpenAIUserMessageParam' @@ -14199,16 +13034,7 @@ components: title: OpenAICompletionWithInputMessages type: object OpenAIUserMessageParam: - description: 'A message from the user in an OpenAI-compatible chat completion - request. - - - :param role: Must be "user" to identify this as a user message - - :param content: The content of the message, which can include text and other - media - - :param name: (Optional) The name of the user message participant.' + description: A message from the user in an OpenAI-compatible chat completion request. properties: role: const: user @@ -14221,9 +13047,9 @@ components: - items: discriminator: mapping: - file: '#/components/schemas/OpenAIFile' - image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + file: '#/$defs/OpenAIFile' + image_url: '#/$defs/OpenAIChatCompletionContentPartImageParam' + text: '#/$defs/OpenAIChatCompletionContentPartTextParam' propertyName: type oneOf: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' @@ -14240,9 +13066,7 @@ components: title: OpenAIUserMessageParam type: object ScoringFn: - description: 'A scoring function resource for evaluating model outputs. - - :param type: The resource type, always scoring_function' + description: A scoring function resource for evaluating model outputs. properties: identifier: description: Unique identifier for this resource in llama stack @@ -14275,16 +13099,16 @@ components: description: The return type of the deterministic function discriminator: mapping: - agent_turn_input: '#/components/schemas/AgentTurnInputType' - array: '#/components/schemas/ArrayType' - boolean: '#/components/schemas/BooleanType' - chat_completion_input: '#/components/schemas/ChatCompletionInputType' - completion_input: '#/components/schemas/CompletionInputType' - json: '#/components/schemas/JsonType' - number: '#/components/schemas/NumberType' - object: '#/components/schemas/ObjectType' - string: '#/components/schemas/StringType' - union: '#/components/schemas/UnionType' + agent_turn_input: '#/$defs/AgentTurnInputType' + array: '#/$defs/ArrayType' + boolean: '#/$defs/BooleanType' + chat_completion_input: '#/$defs/ChatCompletionInputType' + completion_input: '#/$defs/CompletionInputType' + json: '#/$defs/JsonType' + number: '#/$defs/NumberType' + object: '#/$defs/ObjectType' + string: '#/$defs/StringType' + union: '#/$defs/UnionType' propertyName: type oneOf: - $ref: '#/components/schemas/StringType' @@ -14299,14 +13123,13 @@ components: - $ref: '#/components/schemas/AgentTurnInputType' title: Return Type params: - description: The parameters for the scoring function for benchmark eval, - these can be overridden for app eval + description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval title: Params discriminator: mapping: - basic: '#/components/schemas/BasicScoringFnParams' - llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' - regex_parser: '#/components/schemas/RegexParserScoringFnParams' + basic: '#/$defs/BasicScoringFnParams' + llm_as_judge: '#/$defs/LLMAsJudgeScoringFnParams' + regex_parser: '#/$defs/RegexParserScoringFnParams' propertyName: type oneOf: - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' @@ -14320,10 +13143,7 @@ components: title: ScoringFn type: object ListToolDefsResponse: - description: 'Response containing a list of tool definitions. - - - :param data: List of tool definitions' + description: Response containing a list of tool definitions. properties: data: items: @@ -14335,14 +13155,7 @@ components: title: ListToolDefsResponse type: object VectorStoreDeleteResponse: - description: 'Response from deleting a vector store. - - - :param id: Unique identifier of the deleted vector store - - :param object: Object type identifier for the deletion response - - :param deleted: Whether the deletion operation was successful' + description: Response from deleting a vector store. properties: id: title: Id @@ -14360,16 +13173,7 @@ components: title: VectorStoreDeleteResponse type: object VectorStoreFileContentsResponse: - description: 'Response from retrieving the contents of a vector store file. - - - :param file_id: Unique identifier for the file - - :param filename: Name of the file - - :param attributes: Key-value attributes associated with the file - - :param content: List of content items from the file' + description: Response from retrieving the contents of a vector store file. properties: file_id: title: File Id @@ -14394,14 +13198,7 @@ components: title: VectorStoreFileContentsResponse type: object VectorStoreFileDeleteResponse: - description: 'Response from deleting a vector store file. - - - :param id: Unique identifier of the deleted file - - :param object: Object type identifier for the deletion response - - :param deleted: Whether the deletion operation was successful' + description: Response from deleting a vector store file. properties: id: title: Id @@ -14419,18 +13216,7 @@ components: title: VectorStoreFileDeleteResponse type: object VectorStoreFilesListInBatchResponse: - description: 'Response from listing files in a vector store file batch. - - - :param object: Object type identifier, always "list" - - :param data: List of vector store file objects in the batch - - :param first_id: (Optional) ID of the first file in the list for pagination - - :param last_id: (Optional) ID of the last file in the list for pagination - - :param has_more: Whether there are more files available beyond this page' + description: Response from listing files in a vector store file batch. properties: object: default: list @@ -14458,18 +13244,7 @@ components: title: VectorStoreFilesListInBatchResponse type: object VectorStoreListFilesResponse: - description: 'Response from listing files in a vector store. - - - :param object: Object type identifier, always "list" - - :param data: List of vector store file objects - - :param first_id: (Optional) ID of the first file in the list for pagination - - :param last_id: (Optional) ID of the last file in the list for pagination - - :param has_more: Whether there are more files available beyond this page' + description: Response from listing files in a vector store. properties: object: default: list @@ -14497,19 +13272,7 @@ components: title: VectorStoreListFilesResponse type: object VectorStoreListResponse: - description: 'Response from listing vector stores. - - - :param object: Object type identifier, always "list" - - :param data: List of vector store objects - - :param first_id: (Optional) ID of the first vector store in the list for pagination - - :param last_id: (Optional) ID of the last vector store in the list for pagination - - :param has_more: Whether there are more vector stores available beyond this - page' + description: Response from listing vector stores. properties: object: default: list @@ -14537,13 +13300,7 @@ components: title: VectorStoreListResponse type: object OpenAIResponseMessage: - description: 'Corresponds to the various Message types in the Responses API. - - They are all under one type because the Responses API gives them all - - the same "type" value, and there is no way to tell them apart in certain - - scenarios.' + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." properties: content: anyOf: @@ -14551,9 +13308,9 @@ components: - items: discriminator: mapping: - input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' - input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' - input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' propertyName: type oneOf: - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' @@ -14563,8 +13320,8 @@ components: - items: discriminator: mapping: - output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + output_text: '#/$defs/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/$defs/OpenAIResponseContentPartRefusal' propertyName: type oneOf: - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' @@ -14601,10 +13358,7 @@ components: title: OpenAIResponseMessage type: object OpenAIResponseObjectWithInput: - description: 'OpenAI response object extended with input context information. - - - :param input: List of input items that led to this response' + description: OpenAI response object extended with input context information. properties: created_at: title: Created At @@ -14627,13 +13381,13 @@ components: items: discriminator: mapping: - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' propertyName: type oneOf: - $ref: '#/components/schemas/OpenAIResponseMessage' @@ -14677,12 +13431,12 @@ components: items: discriminator: mapping: - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseToolMCP' - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' - web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + file_search: '#/$defs/OpenAIResponseInputToolFileSearch' + function: '#/$defs/OpenAIResponseInputToolFunction' + mcp: '#/$defs/OpenAIResponseToolMCP' + web_search: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' propertyName: type oneOf: - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' @@ -14707,13 +13461,13 @@ components: anyOf: - discriminator: mapping: - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' propertyName: type oneOf: - $ref: '#/components/schemas/OpenAIResponseMessage' @@ -14789,9 +13543,9 @@ components: example: status: 500 title: Internal Server Error - detail: An unexpected error occurred + detail: An unexpected error occurred. Our team has been notified. DefaultError: - description: An error occurred + description: An unexpected error occurred content: application/json: schema: diff --git a/docs/static/stainless-llama-stack-spec.json b/docs/static/stainless-llama-stack-spec.json new file mode 100644 index 0000000000..07e051f530 --- /dev/null +++ b/docs/static/stainless-llama-stack-spec.json @@ -0,0 +1,16303 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Llama Stack API - Stable & Experimental APIs", + "description": "A comprehensive API for building and deploying AI applications\n\n**\ud83d\udd17 COMBINED**: This specification includes both stable production-ready APIs and experimental pre-release APIs. Use stable APIs for production deployments and experimental APIs for testing new features.", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://api.llamastack.com", + "description": "Production server" + }, + { + "url": "https://staging-api.llamastack.com", + "description": "Staging server" + } + ], + "paths": { + "/v1beta/datasetio/append-rows/{dataset_id}": { + "post": { + "tags": [ + "V1Beta" + ], + "summary": "Append rows to a dataset.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "append_rows_v1beta_datasetio_append_rows__dataset_id__post", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "dataset_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "Path parameter: dataset_id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1beta/datasetio/iterrows/{dataset_id}": { + "get": { + "tags": [ + "V1Beta" + ], + "summary": "Get a paginated list of rows from a dataset.", + "description": "Query endpoint for proper schema generation.", + "operationId": "iterrows_v1beta_datasetio_iterrows__dataset_id__get", + "parameters": [ + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Limit" + } + }, + { + "name": "start_index", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Start Index" + } + }, + { + "name": "dataset_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Dataset Id" + } + } + ], + "responses": { + "200": { + "description": "A PaginatedResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1beta/datasets": { + "get": { + "tags": [ + "V1Beta" + ], + "summary": "List all datasets.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_datasets_v1beta_datasets_get", + "responses": { + "200": { + "description": "A ListDatasetsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListDatasetsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + }, + "post": { + "tags": [ + "V1Beta" + ], + "summary": "Register a new dataset.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "register_dataset_v1beta_datasets_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/__main_____datasets_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A Dataset.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Dataset" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1beta/datasets/{dataset_id}": { + "delete": { + "tags": [ + "V1Beta" + ], + "summary": "Unregister a dataset by its ID.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "unregister_dataset_v1beta_datasets__dataset_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "dataset_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "Path parameter: dataset_id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1Beta" + ], + "summary": "Get a dataset by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_dataset_v1beta_datasets__dataset_id__get", + "parameters": [ + { + "name": "dataset_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Dataset Id" + } + } + ], + "responses": { + "200": { + "description": "A Dataset.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Dataset" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/agents": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "List all agents.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_agents_v1alpha_agents_get", + "parameters": [ + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Limit" + } + }, + { + "name": "start_index", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Start Index" + } + } + ], + "responses": { + "200": { + "description": "A PaginatedResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Create an agent with the given configuration.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_agent_v1alpha_agents_post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentConfig" + } + } + } + }, + "responses": { + "200": { + "description": "An AgentCreateResponse with the agent ID.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentCreateResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/agents/{agent_id}": { + "delete": { + "tags": [ + "V1Alpha" + ], + "summary": "Delete an agent by its ID and its associated sessions and turns.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "delete_agent_v1alpha_agents__agent_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the agent to delete." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Describe an agent by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_agent_v1alpha_agents__agent_id__get", + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Agent Id" + }, + "description": "ID of the agent." + } + ], + "responses": { + "200": { + "description": "An Agent of the agent.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Agent" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/agents/{agent_id}/session": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Create a new session for an agent.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_agent_session_v1alpha_agents__agent_id__session_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/__main_____agents_agent_id_session_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "An AgentSessionCreateResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentSessionCreateResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the agent to create the session for." + } + ] + } + }, + "/v1alpha/agents/{agent_id}/session/{session_id}": { + "delete": { + "tags": [ + "V1Alpha" + ], + "summary": "Delete an agent session by its ID and its associated turns.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "delete_agents_session_v1alpha_agents__agent_id__session__session_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the session to delete." + }, + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the agent to delete the session for." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Retrieve an agent session by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_agents_session_v1alpha_agents__agent_id__session__session_id__get", + "parameters": [ + { + "name": "turn_ids", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Turn Ids" + } + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Session Id" + }, + "description": "The ID of the session to get." + }, + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Agent Id" + }, + "description": "The ID of the agent to get the session for." + } + ], + "responses": { + "200": { + "description": "A Session.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Session" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/agents/{agent_id}/session/{session_id}/turn": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Create a new turn for an agent.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/__main_____agents_agent_id_session_session_id_turn_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "If stream=False, returns a Turn object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Turn" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the agent to create the turn for." + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the session to create the turn for." + } + ] + } + }, + "/v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Retrieve an agent turn by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_agents_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__get", + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Agent Id" + }, + "description": "The ID of the agent to get the turn for." + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Session Id" + }, + "description": "The ID of the session to get the turn for." + }, + { + "name": "turn_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Turn Id" + }, + "description": "The ID of the turn to get." + } + ], + "responses": { + "200": { + "description": "A Turn.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Turn" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Resume an agent turn with executed tool call responses.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "resume_agent_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__resume_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A Turn object if stream is False, otherwise an AsyncIterator of AgentTurnResponseStreamChunk objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Turn" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the agent to resume." + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the session to resume." + }, + { + "name": "turn_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the turn to resume." + } + ] + } + }, + "/v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Retrieve an agent step by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_agents_step_v1alpha_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get", + "parameters": [ + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Agent Id" + }, + "description": "The ID of the agent to get the step for." + }, + { + "name": "session_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Session Id" + }, + "description": "The ID of the session to get the step for." + }, + { + "name": "turn_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Turn Id" + }, + "description": "The ID of the turn to get the step for." + }, + { + "name": "step_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Step Id" + }, + "description": "The ID of the step to get." + } + ], + "responses": { + "200": { + "description": "An AgentStepResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentStepResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/agents/{agent_id}/sessions": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "List all session(s) of a given agent.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_agent_sessions_v1alpha_agents__agent_id__sessions_get", + "parameters": [ + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Limit" + } + }, + { + "name": "start_index", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Start Index" + } + }, + { + "name": "agent_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Agent Id" + }, + "description": "The ID of the agent to list sessions for." + } + ], + "responses": { + "200": { + "description": "A PaginatedResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaginatedResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/eval/benchmarks": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "List all benchmarks.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_benchmarks_v1alpha_eval_benchmarks_get", + "responses": { + "200": { + "description": "A ListBenchmarksResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBenchmarksResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Register a benchmark.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "register_benchmark_v1alpha_eval_benchmarks_post", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/eval/benchmarks/{benchmark_id}": { + "delete": { + "tags": [ + "V1Alpha" + ], + "summary": "Unregister a benchmark.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "unregister_benchmark_v1alpha_eval_benchmarks__benchmark_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the benchmark to unregister." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Get a benchmark by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_benchmark_v1alpha_eval_benchmarks__benchmark_id__get", + "parameters": [ + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Benchmark Id" + }, + "description": "The ID of the benchmark to get." + } + ], + "responses": { + "200": { + "description": "A Benchmark.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Benchmark" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/eval/benchmarks/{benchmark_id}/evaluations": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Evaluate a list of rows on a benchmark.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "evaluate_rows_v1alpha_eval_benchmarks__benchmark_id__evaluations_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BenchmarkConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "EvaluateResponse object containing generations and scores.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvaluateResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the benchmark to run the evaluation on." + } + ] + } + }, + "/v1alpha/eval/benchmarks/{benchmark_id}/jobs": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Run an evaluation on a benchmark.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "run_eval_v1alpha_eval_benchmarks__benchmark_id__jobs_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BenchmarkConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The job that was created to run the evaluation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Job" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the benchmark to run the evaluation on." + } + ] + } + }, + "/v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}": { + "delete": { + "tags": [ + "V1Alpha" + ], + "summary": "Cancel a job.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "job_cancel_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the benchmark to run the evaluation on." + }, + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the job to cancel." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Get the status of a job.", + "description": "Query endpoint for proper schema generation.", + "operationId": "job_status_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__get", + "parameters": [ + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Benchmark Id" + }, + "description": "The ID of the benchmark to run the evaluation on." + }, + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Job Id" + }, + "description": "The ID of the job to get the status of." + } + ], + "responses": { + "200": { + "description": "The status of the evaluation job.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Job" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Get the result of a job.", + "description": "Query endpoint for proper schema generation.", + "operationId": "job_result_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__result_get", + "parameters": [ + { + "name": "benchmark_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Benchmark Id" + }, + "description": "The ID of the benchmark to run the evaluation on." + }, + { + "name": "job_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Job Id" + }, + "description": "The ID of the job to get the result of." + } + ], + "responses": { + "200": { + "description": "The result of the job.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EvaluateResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/inference/rerank": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Rerank a list of documents based on their relevance to a query.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "rerank_v1alpha_inference_rerank_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_inference_rerank_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "RerankResponse with indices sorted by relevance score (descending).", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RerankResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1alpha/post-training/job/artifacts": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Get the artifacts of a training job.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_training_job_artifacts_v1alpha_post_training_job_artifacts_get", + "parameters": [ + { + "name": "job_uuid", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Job Uuid" + } + } + ], + "responses": { + "200": { + "description": "A PostTrainingJobArtifactsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostTrainingJobArtifactsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/post-training/job/cancel": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Cancel a training job.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "cancel_training_job_v1alpha_post_training_job_cancel_post", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/post-training/job/status": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Get the status of a training job.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_training_job_status_v1alpha_post_training_job_status_get", + "parameters": [ + { + "name": "job_uuid", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Job Uuid" + } + } + ], + "responses": { + "200": { + "description": "A PostTrainingJobStatusResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostTrainingJobStatusResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1alpha/post-training/jobs": { + "get": { + "tags": [ + "V1Alpha" + ], + "summary": "Get all training jobs.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "get_training_jobs_v1alpha_post_training_jobs_get", + "responses": { + "200": { + "description": "A ListPostTrainingJobsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPostTrainingJobsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1alpha/post-training/preference-optimize": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Run preference optimization of a model.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "preference_optimize_v1alpha_post_training_preference_optimize_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DPOAlignmentConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A PostTrainingJob.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostTrainingJob" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1alpha/post-training/supervised-fine-tune": { + "post": { + "tags": [ + "V1Alpha" + ], + "summary": "Run supervised fine-tuning of a model.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "supervised_fine_tune_v1alpha_post_training_supervised_fine_tune_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrainingConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A PostTrainingJob.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostTrainingJob" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/batches": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all batches for the current user.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_batches_v1_batches_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + } + ], + "responses": { + "200": { + "description": "A list of batch objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListBatchesResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Create a new batch for processing multiple API requests.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_batch_v1_batches_post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_batches_Request" + } + } + } + }, + "responses": { + "200": { + "description": "The created batch object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Batch" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/batches/{batch_id}": { + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve information about a specific batch.", + "description": "Query endpoint for proper schema generation.", + "operationId": "retrieve_batch_v1_batches__batch_id__get", + "parameters": [ + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Batch Id" + }, + "description": "The ID of the batch to retrieve." + } + ], + "responses": { + "200": { + "description": "The batch object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Batch" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/batches/{batch_id}/cancel": { + "post": { + "tags": [ + "V1" + ], + "summary": "Cancel a batch that is in progress.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "cancel_batch_v1_batches__batch_id__cancel_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_batches_batch_id_cancel_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The updated batch object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Batch" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the batch to cancel." + } + ] + } + }, + "/v1/chat/completions": { + "get": { + "tags": [ + "V1" + ], + "summary": "List chat completions.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_chat_completions_v1_chat_completions_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "model", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Model" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/Order", + "default": "desc" + } + } + ], + "responses": { + "200": { + "description": "A ListOpenAIChatCompletionResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOpenAIChatCompletionResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Create chat completions.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_chat_completion_v1_chat_completions_post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIChatCompletionRequestWithExtraBody" + } + } + } + }, + "responses": { + "200": { + "description": "An OpenAIChatCompletion.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIChatCompletion" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/chat/completions/{completion_id}": { + "get": { + "tags": [ + "V1" + ], + "summary": "Get chat completion.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_chat_completion_v1_chat_completions__completion_id__get", + "parameters": [ + { + "name": "completion_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Completion Id" + }, + "description": "ID of the chat completion." + } + ], + "responses": { + "200": { + "description": "A OpenAICompletionWithInputMessages.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAICompletionWithInputMessages" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/completions": { + "post": { + "tags": [ + "V1" + ], + "summary": "Create completion.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_completion_v1_completions_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAICompletionRequestWithExtraBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "An OpenAICompletion.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAICompletion" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/conversations": { + "post": { + "tags": [ + "V1" + ], + "summary": "Create a conversation.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_conversation_v1_conversations_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_conversations_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The created conversation object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Conversation" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/conversations/{conversation_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete a conversation.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_delete_conversation_v1_conversations__conversation_id__delete", + "parameters": [ + { + "name": "conversation_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Conversation Id" + }, + "description": "The conversation identifier." + } + ], + "responses": { + "200": { + "description": "The deleted conversation resource.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConversationDeletedResource" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve a conversation.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_conversation_v1_conversations__conversation_id__get", + "parameters": [ + { + "name": "conversation_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Conversation Id" + }, + "description": "The conversation identifier." + } + ], + "responses": { + "200": { + "description": "The conversation object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Conversation" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Update a conversation.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "update_conversation_v1_conversations__conversation_id__post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_conversations_conversation_id_Request" + } + } + } + }, + "responses": { + "200": { + "description": "The updated conversation object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Conversation" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + }, + "parameters": [ + { + "name": "conversation_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The conversation identifier." + } + ] + } + }, + "/v1/conversations/{conversation_id}/items": { + "get": { + "tags": [ + "V1" + ], + "summary": "List items.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_items_v1_conversations__conversation_id__items_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "include", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/ConversationItemInclude" + } + }, + { + "name": "limit", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Order" + } + }, + { + "name": "conversation_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Conversation Id" + }, + "description": "The conversation identifier." + } + ], + "responses": { + "200": { + "description": "List of conversation items.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConversationItemList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Create items.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "add_items_v1_conversations__conversation_id__items_post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_conversations_conversation_id_items_Request" + } + } + } + }, + "responses": { + "200": { + "description": "List of created items.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConversationItemList" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + }, + "parameters": [ + { + "name": "conversation_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The conversation identifier." + } + ] + } + }, + "/v1/conversations/{conversation_id}/items/{item_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete an item.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_delete_conversation_item_v1_conversations__conversation_id__items__item_id__delete", + "parameters": [ + { + "name": "conversation_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Conversation Id" + }, + "description": "The conversation identifier." + }, + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + }, + "description": "The item identifier." + } + ], + "responses": { + "200": { + "description": "The deleted item resource.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConversationItemDeletedResource" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve an item.", + "description": "Query endpoint for proper schema generation.", + "operationId": "retrieve_v1_conversations__conversation_id__items__item_id__get", + "parameters": [ + { + "name": "conversation_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Conversation Id" + }, + "description": "The conversation identifier." + }, + { + "name": "item_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Item Id" + }, + "description": "The item identifier." + } + ], + "responses": { + "200": { + "description": "The conversation item.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIResponseMessage" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/embeddings": { + "post": { + "tags": [ + "V1" + ], + "summary": "Create embeddings.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_embeddings_v1_embeddings_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "An OpenAIEmbeddingsResponse containing the embeddings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIEmbeddingsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/files": { + "get": { + "tags": [ + "V1" + ], + "summary": "List files.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_list_files_v1_files_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "purpose", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/OpenAIFilePurpose" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 10000, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/Order", + "default": "desc" + } + } + ], + "responses": { + "200": { + "description": "An ListOpenAIFileResponse containing the list of files.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOpenAIFileResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Upload file.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "openai_upload_file_v1_files_post", + "responses": { + "200": { + "description": "An OpenAIFileObject representing the uploaded file.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIFileObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/files/{file_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete file.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_delete_file_v1_files__file_id__delete", + "parameters": [ + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + }, + "description": "The ID of the file to use for this request." + } + ], + "responses": { + "200": { + "description": "An OpenAIFileDeleteResponse indicating successful deletion.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIFileDeleteResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve file.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_retrieve_file_v1_files__file_id__get", + "parameters": [ + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + }, + "description": "The ID of the file to use for this request." + } + ], + "responses": { + "200": { + "description": "An OpenAIFileObject containing file information.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIFileObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/files/{file_id}/content": { + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve file content.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "openai_retrieve_file_content_v1_files__file_id__content_get", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the file to use for this request." + } + ], + "responses": { + "200": { + "description": "The raw file content as a binary response.", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/health": { + "get": { + "tags": [ + "V1" + ], + "summary": "Get health status.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "health_v1_health_get", + "responses": { + "200": { + "description": "Health information indicating if the service is operational.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HealthInfo" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/inspect/routes": { + "get": { + "tags": [ + "V1" + ], + "summary": "List routes.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_routes_v1_inspect_routes_get", + "responses": { + "200": { + "description": "Response containing information about all available routes.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListRoutesResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/models": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all models.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_models_v1_models_get", + "responses": { + "200": { + "description": "A ListModelsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListModelsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Register model.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "register_model_v1_models_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_models_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A Model.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Model" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/models/{model_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Unregister model.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "unregister_model_v1_models__model_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "model_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "Path parameter: model_id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Get model.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_model_v1_models__model_id__get", + "parameters": [ + { + "name": "model_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Model Id" + } + } + ], + "responses": { + "200": { + "description": "A Model.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Model" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/moderations": { + "post": { + "tags": [ + "V1" + ], + "summary": "Create moderation.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "run_moderation_v1_moderations_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_moderations_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A moderation object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModerationObject" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/prompts": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all prompts.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_prompts_v1_prompts_get", + "responses": { + "200": { + "description": "A ListPromptsResponse containing all prompts.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPromptsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Create prompt.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_prompt_v1_prompts_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_prompts_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The created Prompt resource.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Prompt" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/prompts/{prompt_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete prompt.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "delete_prompt_v1_prompts__prompt_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "prompt_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The identifier of the prompt to delete." + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Get prompt.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_prompt_v1_prompts__prompt_id__get", + "parameters": [ + { + "name": "version", + "in": "query", + "required": true, + "schema": { + "type": "integer", + "title": "Version" + } + }, + { + "name": "prompt_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Prompt Id" + }, + "description": "The identifier of the prompt to get." + } + ], + "responses": { + "200": { + "description": "A Prompt resource.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Prompt" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Update prompt.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "update_prompt_v1_prompts__prompt_id__post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_prompts_prompt_id_Request" + } + } + } + }, + "responses": { + "200": { + "description": "The updated Prompt resource with incremented version.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Prompt" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + }, + "parameters": [ + { + "name": "prompt_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The identifier of the prompt to update." + } + ] + } + }, + "/v1/prompts/{prompt_id}/set-default-version": { + "post": { + "tags": [ + "V1" + ], + "summary": "Set prompt version.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "set_default_version_v1_prompts__prompt_id__set_default_version_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_prompts_prompt_id_set_default_version_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "The prompt with the specified version now set as default.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Prompt" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "prompt_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The identifier of the prompt." + } + ] + } + }, + "/v1/prompts/{prompt_id}/versions": { + "get": { + "tags": [ + "V1" + ], + "summary": "List prompt versions.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_prompt_versions_v1_prompts__prompt_id__versions_get", + "parameters": [ + { + "name": "prompt_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Prompt Id" + }, + "description": "The identifier of the prompt to list versions for." + } + ], + "responses": { + "200": { + "description": "A ListPromptsResponse containing all versions of the prompt.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPromptsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/providers": { + "get": { + "tags": [ + "V1" + ], + "summary": "List providers.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_providers_v1_providers_get", + "responses": { + "200": { + "description": "A ListProvidersResponse containing information about all providers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListProvidersResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/providers/{provider_id}": { + "get": { + "tags": [ + "V1" + ], + "summary": "Get provider.", + "description": "Query endpoint for proper schema generation.", + "operationId": "inspect_provider_v1_providers__provider_id__get", + "parameters": [ + { + "name": "provider_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Provider Id" + }, + "description": "The ID of the provider to inspect." + } + ], + "responses": { + "200": { + "description": "A ProviderInfo object containing the provider's details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProviderInfo" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/responses": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all responses.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_openai_responses_v1_responses_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "model", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Model" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 50, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/Order", + "default": "desc" + } + } + ], + "responses": { + "200": { + "description": "A ListOpenAIResponseObject.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOpenAIResponseObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Create a model response.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "create_openai_response_v1_responses_post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_responses_Request" + } + } + } + }, + "responses": { + "200": { + "description": "An OpenAIResponseObject.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIResponseObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/responses/{response_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete a response.", + "description": "Query endpoint for proper schema generation.", + "operationId": "delete_openai_response_v1_responses__response_id__delete", + "parameters": [ + { + "name": "response_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Response Id" + }, + "description": "The ID of the OpenAI response to delete." + } + ], + "responses": { + "200": { + "description": "An OpenAIDeleteResponseObject", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIDeleteResponseObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Get a model response.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_openai_response_v1_responses__response_id__get", + "parameters": [ + { + "name": "response_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Response Id" + }, + "description": "The ID of the OpenAI response to retrieve." + } + ], + "responses": { + "200": { + "description": "An OpenAIResponseObject.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAIResponseObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/responses/{response_id}/input_items": { + "get": { + "tags": [ + "V1" + ], + "summary": "List input items.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_openai_response_input_items_v1_responses__response_id__input_items_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "before", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Before" + } + }, + { + "name": "include", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Include" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/Order", + "default": "desc" + } + }, + { + "name": "response_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Response Id" + }, + "description": "The ID of the response to retrieve input items for." + } + ], + "responses": { + "200": { + "description": "An ListOpenAIResponseInputItem.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListOpenAIResponseInputItem" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/safety/run-shield": { + "post": { + "tags": [ + "V1" + ], + "summary": "Run shield.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "run_shield_v1_safety_run_shield_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_safety_run_shield_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A RunShieldResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunShieldResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/scoring-functions": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all scoring functions.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_scoring_functions_v1_scoring_functions_get", + "responses": { + "200": { + "description": "A ListScoringFunctionsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListScoringFunctionsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Register a scoring function.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "register_scoring_function_v1_scoring_functions_post", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/scoring-functions/{scoring_fn_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Unregister a scoring function.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "unregister_scoring_function_v1_scoring_functions__scoring_fn_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "scoring_fn_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "Path parameter: scoring_fn_id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Get a scoring function by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_scoring_function_v1_scoring_functions__scoring_fn_id__get", + "parameters": [ + { + "name": "scoring_fn_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Scoring Fn Id" + } + } + ], + "responses": { + "200": { + "description": "A ScoringFn.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScoringFn" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/scoring/score": { + "post": { + "tags": [ + "V1" + ], + "summary": "Score a list of rows.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "score_v1_scoring_score_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_scoring_score_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A ScoreResponse object containing rows and aggregated results.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScoreResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/scoring/score-batch": { + "post": { + "tags": [ + "V1" + ], + "summary": "Score a batch of rows.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "score_batch_v1_scoring_score_batch_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_scoring_score_batch_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A ScoreBatchResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScoreBatchResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/shields": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all shields.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_shields_v1_shields_get", + "responses": { + "200": { + "description": "A ListShieldsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListShieldsResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Register a shield.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "register_shield_v1_shields_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_shields_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A Shield.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Shield" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/shields/{identifier}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Unregister a shield.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "unregister_shield_v1_shields__identifier__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "identifier", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "Path parameter: identifier" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Get a shield by its identifier.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_shield_v1_shields__identifier__get", + "parameters": [ + { + "name": "identifier", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Identifier" + } + } + ], + "responses": { + "200": { + "description": "A Shield.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Shield" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/tool-runtime/invoke": { + "post": { + "tags": [ + "V1" + ], + "summary": "Run a tool with the given arguments.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "invoke_tool_v1_tool_runtime_invoke_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_tool_runtime_invoke_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A ToolInvocationResult.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ToolInvocationResult" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/tool-runtime/list-tools": { + "get": { + "tags": [ + "V1" + ], + "summary": "List all tools in the runtime.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_runtime_tools_v1_tool_runtime_list_tools_get", + "parameters": [ + { + "name": "tool_group_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Tool Group Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/URL" + } + } + } + }, + "responses": { + "200": { + "description": "A ListToolDefsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListToolDefsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/tool-runtime/rag-tool/insert": { + "post": { + "tags": [ + "V1" + ], + "summary": "Index documents so they can be used by the RAG system.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "rag_tool_insert_v1_tool_runtime_rag_tool_insert_post", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/tool-runtime/rag-tool/query": { + "post": { + "tags": [ + "V1" + ], + "summary": "Query the RAG system for context; typically invoked by the agent.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "rag_tool_query_v1_tool_runtime_rag_tool_query_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_tool_runtime_rag_tool_query_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "RAGQueryResult containing the retrieved content and metadata", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RAGQueryResult" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/toolgroups": { + "get": { + "tags": [ + "V1" + ], + "summary": "List tool groups with optional provider.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "list_tool_groups_v1_toolgroups_get", + "responses": { + "200": { + "description": "A ListToolGroupsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListToolGroupsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Register a tool group.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "register_tool_group_v1_toolgroups_post", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/toolgroups/{toolgroup_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Unregister a tool group.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "unregister_toolgroup_v1_toolgroups__toolgroup_id__delete", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + }, + { + "name": "toolgroup_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "Path parameter: toolgroup_id" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Get a tool group by its ID.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_tool_group_v1_toolgroups__toolgroup_id__get", + "parameters": [ + { + "name": "toolgroup_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Toolgroup Id" + } + } + ], + "responses": { + "200": { + "description": "A ToolGroup.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ToolGroup" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/tools": { + "get": { + "tags": [ + "V1" + ], + "summary": "List tools with optional tool group.", + "description": "Query endpoint for proper schema generation.", + "operationId": "list_tools_v1_tools_get", + "parameters": [ + { + "name": "toolgroup_id", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Toolgroup Id" + } + } + ], + "responses": { + "200": { + "description": "A ListToolDefsResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListToolDefsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/tools/{tool_name}": { + "get": { + "tags": [ + "V1" + ], + "summary": "Get a tool by its name.", + "description": "Query endpoint for proper schema generation.", + "operationId": "get_tool_v1_tools__tool_name__get", + "parameters": [ + { + "name": "tool_name", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Tool Name" + } + } + ], + "responses": { + "200": { + "description": "A ToolDef.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ToolDef" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/vector-io/insert": { + "post": { + "tags": [ + "V1" + ], + "summary": "Insert chunks into a vector database.", + "description": "Generic endpoint - this would be replaced with actual implementation.", + "operationId": "insert_chunks_v1_vector_io_insert_post", + "parameters": [ + { + "name": "args", + "in": "query", + "required": true, + "schema": { + "title": "Args" + } + }, + { + "name": "kwargs", + "in": "query", + "required": true, + "schema": { + "title": "Kwargs" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/vector-io/query": { + "post": { + "tags": [ + "V1" + ], + "summary": "Query chunks from a vector database.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "query_chunks_v1_vector_io_query_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_vector_io_query_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A QueryChunksResponse.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QueryChunksResponse" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + }, + "/v1/vector_stores": { + "get": { + "tags": [ + "V1" + ], + "summary": "Returns a list of vector stores.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_list_vector_stores_v1_vector_stores_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "before", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Before" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "desc", + "title": "Order" + } + } + ], + "responses": { + "200": { + "description": "A VectorStoreListResponse containing the list of vector stores.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreListResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Creates a vector store.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_create_vector_store_v1_vector_stores_post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody" + } + } + } + }, + "responses": { + "200": { + "description": "A VectorStoreObject representing the created vector store.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/vector_stores/{vector_store_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete a vector store.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_delete_vector_store_v1_vector_stores__vector_store_id__delete", + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store to delete." + } + ], + "responses": { + "200": { + "description": "A VectorStoreDeleteResponse indicating the deletion status.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreDeleteResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieves a vector store.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_retrieve_vector_store_v1_vector_stores__vector_store_id__get", + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store to retrieve." + } + ], + "responses": { + "200": { + "description": "A VectorStoreObject representing the vector store.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Updates a vector store.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_update_vector_store_v1_vector_stores__vector_store_id__post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_vector_stores_vector_store_id_Request" + } + } + } + }, + "responses": { + "200": { + "description": "A VectorStoreObject representing the updated vector store.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + }, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store to update." + } + ] + } + }, + "/v1/vector_stores/{vector_store_id}/file_batches": { + "post": { + "tags": [ + "V1" + ], + "summary": "Create a vector store file batch.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_create_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A VectorStoreFileBatchObject representing the created file batch.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileBatchObject" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store to create the file batch for." + } + ] + } + }, + "/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}": { + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieve a vector store file batch.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_retrieve_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__get", + "parameters": [ + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Batch Id" + }, + "description": "The ID of the file batch to retrieve." + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store containing the file batch." + } + ], + "responses": { + "200": { + "description": "A VectorStoreFileBatchObject representing the file batch.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileBatchObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel": { + "post": { + "tags": [ + "V1" + ], + "summary": "Cancels a vector store file batch.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A VectorStoreFileBatchObject representing the cancelled file batch.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileBatchObject" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the file batch to cancel." + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store containing the file batch." + } + ] + } + }, + "/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files": { + "get": { + "tags": [ + "V1" + ], + "summary": "Returns a list of vector store files in a batch.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_list_files_in_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "before", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Before" + } + }, + { + "name": "filter", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Filter" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "desc", + "title": "Order" + } + }, + { + "name": "batch_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Batch Id" + }, + "description": "The ID of the file batch to list files from." + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store containing the file batch." + } + ], + "responses": { + "200": { + "description": "A VectorStoreFilesListInBatchResponse containing the list of files in the batch.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFilesListInBatchResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/vector_stores/{vector_store_id}/files": { + "get": { + "tags": [ + "V1" + ], + "summary": "List files in a vector store.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_list_files_in_vector_store_v1_vector_stores__vector_store_id__files_get", + "parameters": [ + { + "name": "after", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "After" + } + }, + { + "name": "before", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Before" + } + }, + { + "name": "filter", + "in": "query", + "required": true, + "schema": { + "type": "string", + "title": "Filter" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20, + "title": "Limit" + } + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "desc", + "title": "Order" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store to list files from." + } + ], + "responses": { + "200": { + "description": "A VectorStoreListFilesResponse containing the list of files.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreListFilesResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Attach a file to a vector store.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_vector_stores_vector_store_id_files_Request" + } + } + } + }, + "responses": { + "200": { + "description": "A VectorStoreFileObject representing the attached file.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + }, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store to attach the file to." + } + ] + } + }, + "/v1/vector_stores/{vector_store_id}/files/{file_id}": { + "delete": { + "tags": [ + "V1" + ], + "summary": "Delete a vector store file.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete", + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store containing the file to delete." + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + }, + "description": "The ID of the file to delete." + } + ], + "responses": { + "200": { + "description": "A VectorStoreFileDeleteResponse indicating the deletion status.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileDeleteResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieves a vector store file.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get", + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store containing the file to retrieve." + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + }, + "description": "The ID of the file to retrieve." + } + ], + "responses": { + "200": { + "description": "A VectorStoreFileObject representing the file.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + }, + "post": { + "tags": [ + "V1" + ], + "summary": "Updates a vector store file.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_vector_stores_vector_store_id_files_file_id_Request" + } + } + } + }, + "responses": { + "200": { + "description": "A VectorStoreFileObject representing the updated file.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileObject" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + }, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store containing the file to update." + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the file to update." + } + ] + } + }, + "/v1/vector_stores/{vector_store_id}/files/{file_id}/content": { + "get": { + "tags": [ + "V1" + ], + "summary": "Retrieves the contents of a vector store file.", + "description": "Query endpoint for proper schema generation.", + "operationId": "openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get", + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Vector Store Id" + }, + "description": "The ID of the vector store containing the file to retrieve." + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "File Id" + }, + "description": "The ID of the file to retrieve." + } + ], + "responses": { + "200": { + "description": "A list of InterleavedContent representing the file contents.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreFileContentsResponse" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest400", + "description": "Bad Request" + }, + "429": { + "$ref": "#/components/responses/TooManyRequests429", + "description": "Too Many Requests" + }, + "500": { + "$ref": "#/components/responses/InternalServerError500", + "description": "Internal Server Error" + }, + "default": { + "$ref": "#/components/responses/DefaultError", + "description": "Default Response" + } + } + } + }, + "/v1/vector_stores/{vector_store_id}/search": { + "post": { + "tags": [ + "V1" + ], + "summary": "Search for chunks in a vector store.", + "description": "Typed endpoint for proper schema generation.", + "operationId": "openai_search_vector_store_v1_vector_stores__vector_store_id__search_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_vector_stores_vector_store_id_search_Request" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "A VectorStoreSearchResponse containing the search results.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreSearchResponsePage" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + }, + "parameters": [ + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + }, + "description": "The ID of the vector store to search." + } + ] + } + }, + "/v1/version": { + "get": { + "tags": [ + "V1" + ], + "summary": "Get version.", + "description": "Response-only endpoint for proper schema generation.", + "operationId": "version_v1_version_get", + "responses": { + "200": { + "description": "Version information containing the service version number.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VersionInfo" + } + } + } + }, + "400": { + "description": "Bad Request", + "$ref": "#/components/responses/BadRequest400" + }, + "429": { + "description": "Too Many Requests", + "$ref": "#/components/responses/TooManyRequests429" + }, + "500": { + "description": "Internal Server Error", + "$ref": "#/components/responses/InternalServerError500" + }, + "default": { + "description": "Default Response", + "$ref": "#/components/responses/DefaultError" + } + } + } + } + }, + "components": { + "schemas": { + "AgentCandidate": { + "properties": { + "type": { + "type": "string", + "const": "agent", + "title": "Type", + "default": "agent" + }, + "config": { + "$ref": "#/components/schemas/AgentConfig" + } + }, + "type": "object", + "required": [ + "config" + ], + "title": "AgentCandidate", + "description": "An agent candidate for evaluation." + }, + "AgentConfig": { + "properties": { + "sampling_params": { + "$ref": "#/components/schemas/SamplingParams" + }, + "input_shields": { + "title": "Input Shields", + "items": { + "type": "string" + }, + "type": "array" + }, + "output_shields": { + "title": "Output Shields", + "items": { + "type": "string" + }, + "type": "array" + }, + "toolgroups": { + "title": "Toolgroups", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/AgentToolGroupWithArgs" + } + ] + }, + "type": "array" + }, + "client_tools": { + "title": "Client Tools", + "items": { + "$ref": "#/components/schemas/ToolDef" + }, + "type": "array" + }, + "tool_choice": { + "deprecated": true, + "$ref": "#/components/schemas/ToolChoice" + }, + "tool_prompt_format": { + "deprecated": true, + "$ref": "#/components/schemas/ToolPromptFormat" + }, + "tool_config": { + "$ref": "#/components/schemas/ToolConfig" + }, + "max_infer_iters": { + "title": "Max Infer Iters", + "default": 10, + "type": "integer" + }, + "model": { + "type": "string", + "title": "Model" + }, + "instructions": { + "type": "string", + "title": "Instructions" + }, + "name": { + "title": "Name", + "type": "string" + }, + "enable_session_persistence": { + "title": "Enable Session Persistence", + "default": false, + "type": "boolean" + }, + "response_format": { + "title": "Response Format", + "oneOf": [ + { + "$ref": "#/components/schemas/JsonSchemaResponseFormat" + }, + { + "$ref": "#/components/schemas/GrammarResponseFormat" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "grammar": "#/components/schemas/GrammarResponseFormat", + "json_schema": "#/components/schemas/JsonSchemaResponseFormat" + } + } + } + }, + "type": "object", + "required": [ + "model", + "instructions" + ], + "title": "AgentConfig", + "description": "Configuration for an agent." + }, + "AgentCreateResponse": { + "properties": { + "agent_id": { + "type": "string", + "title": "Agent Id" + } + }, + "type": "object", + "required": [ + "agent_id" + ], + "title": "AgentCreateResponse", + "description": "Response returned when creating a new agent." + }, + "AgentSessionCreateResponse": { + "properties": { + "session_id": { + "type": "string", + "title": "Session Id" + } + }, + "type": "object", + "required": [ + "session_id" + ], + "title": "AgentSessionCreateResponse", + "description": "Response returned when creating a new agent session." + }, + "AgentToolGroupWithArgs": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "args": { + "additionalProperties": true, + "type": "object", + "title": "Args" + } + }, + "type": "object", + "required": [ + "name", + "args" + ], + "title": "AgentToolGroupWithArgs" + }, + "AgentTurnInputType": { + "properties": { + "type": { + "type": "string", + "const": "agent_turn_input", + "title": "Type", + "default": "agent_turn_input" + } + }, + "type": "object", + "title": "AgentTurnInputType", + "description": "Parameter type for agent turn input." + }, + "AggregationFunctionType": { + "type": "string", + "enum": [ + "average", + "weighted_average", + "median", + "categorical_count", + "accuracy" + ], + "title": "AggregationFunctionType", + "description": "Types of aggregation functions for scoring results." + }, + "AllowedToolsFilter": { + "properties": { + "tool_names": { + "title": "Tool Names", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "title": "AllowedToolsFilter", + "description": "Filter configuration for restricting which MCP tools can be used." + }, + "ApprovalFilter": { + "properties": { + "always": { + "title": "Always", + "items": { + "type": "string" + }, + "type": "array" + }, + "never": { + "title": "Never", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "title": "ApprovalFilter", + "description": "Filter configuration for MCP tool approval requirements." + }, + "ArrayType": { + "properties": { + "type": { + "type": "string", + "const": "array", + "title": "Type", + "default": "array" + } + }, + "type": "object", + "title": "ArrayType", + "description": "Parameter type for array values." + }, + "Attachment-Output": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/URL" + } + ], + "title": "Content" + }, + "mime_type": { + "type": "string", + "title": "Mime Type" + } + }, + "type": "object", + "required": [ + "content", + "mime_type" + ], + "title": "Attachment", + "description": "An attachment to an agent turn." + }, + "BasicScoringFnParams": { + "properties": { + "type": { + "type": "string", + "const": "basic", + "title": "Type", + "default": "basic" + }, + "aggregation_functions": { + "items": { + "$ref": "#/components/schemas/AggregationFunctionType" + }, + "type": "array", + "title": "Aggregation Functions", + "description": "Aggregation functions to apply to the scores of each row" + } + }, + "type": "object", + "title": "BasicScoringFnParams", + "description": "Parameters for basic scoring function configuration." + }, + "Batch": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "completion_window": { + "type": "string", + "title": "Completion Window" + }, + "created_at": { + "type": "integer", + "title": "Created At" + }, + "endpoint": { + "type": "string", + "title": "Endpoint" + }, + "input_file_id": { + "type": "string", + "title": "Input File Id" + }, + "object": { + "type": "string", + "const": "batch", + "title": "Object" + }, + "status": { + "type": "string", + "enum": [ + "validating", + "failed", + "in_progress", + "finalizing", + "completed", + "expired", + "cancelling", + "cancelled" + ], + "title": "Status" + }, + "cancelled_at": { + "title": "Cancelled At", + "type": "integer" + }, + "cancelling_at": { + "title": "Cancelling At", + "type": "integer" + }, + "completed_at": { + "title": "Completed At", + "type": "integer" + }, + "error_file_id": { + "title": "Error File Id", + "type": "string" + }, + "errors": { + "$ref": "#/components/schemas/Errors" + }, + "expired_at": { + "title": "Expired At", + "type": "integer" + }, + "expires_at": { + "title": "Expires At", + "type": "integer" + }, + "failed_at": { + "title": "Failed At", + "type": "integer" + }, + "finalizing_at": { + "title": "Finalizing At", + "type": "integer" + }, + "in_progress_at": { + "title": "In Progress At", + "type": "integer" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "model": { + "title": "Model", + "type": "string" + }, + "output_file_id": { + "title": "Output File Id", + "type": "string" + }, + "request_counts": { + "$ref": "#/components/schemas/BatchRequestCounts" + }, + "usage": { + "$ref": "#/components/schemas/BatchUsage" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "completion_window", + "created_at", + "endpoint", + "input_file_id", + "object", + "status" + ], + "title": "Batch" + }, + "BatchError": { + "properties": { + "code": { + "title": "Code", + "type": "string" + }, + "line": { + "title": "Line", + "type": "integer" + }, + "message": { + "title": "Message", + "type": "string" + }, + "param": { + "title": "Param", + "type": "string" + } + }, + "additionalProperties": true, + "type": "object", + "title": "BatchError" + }, + "BatchRequestCounts": { + "properties": { + "completed": { + "type": "integer", + "title": "Completed" + }, + "failed": { + "type": "integer", + "title": "Failed" + }, + "total": { + "type": "integer", + "title": "Total" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "completed", + "failed", + "total" + ], + "title": "BatchRequestCounts" + }, + "BatchUsage": { + "properties": { + "input_tokens": { + "type": "integer", + "title": "Input Tokens" + }, + "input_tokens_details": { + "$ref": "#/components/schemas/InputTokensDetails" + }, + "output_tokens": { + "type": "integer", + "title": "Output Tokens" + }, + "output_tokens_details": { + "$ref": "#/components/schemas/OutputTokensDetails" + }, + "total_tokens": { + "type": "integer", + "title": "Total Tokens" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "input_tokens", + "input_tokens_details", + "output_tokens", + "output_tokens_details", + "total_tokens" + ], + "title": "BatchUsage" + }, + "Benchmark": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "benchmark", + "title": "Type", + "default": "benchmark" + }, + "dataset_id": { + "type": "string", + "title": "Dataset Id" + }, + "scoring_functions": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Scoring Functions" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata", + "description": "Metadata for this evaluation task" + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id", + "dataset_id", + "scoring_functions" + ], + "title": "Benchmark", + "description": "A benchmark resource for evaluating model performance." + }, + "BenchmarkConfig": { + "properties": { + "eval_candidate": { + "oneOf": [ + { + "$ref": "#/components/schemas/ModelCandidate" + }, + { + "$ref": "#/components/schemas/AgentCandidate" + } + ], + "title": "Eval Candidate", + "discriminator": { + "propertyName": "type", + "mapping": { + "agent": "#/components/schemas/AgentCandidate", + "model": "#/components/schemas/ModelCandidate" + } + } + }, + "scoring_params": { + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" + }, + { + "$ref": "#/components/schemas/RegexParserScoringFnParams" + }, + { + "$ref": "#/components/schemas/BasicScoringFnParams" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "basic": "#/components/schemas/BasicScoringFnParams", + "llm_as_judge": "#/components/schemas/LLMAsJudgeScoringFnParams", + "regex_parser": "#/components/schemas/RegexParserScoringFnParams" + } + } + }, + "type": "object", + "title": "Scoring Params", + "description": "Map between scoring function id and parameters for each scoring function you want to run" + }, + "num_examples": { + "title": "Num Examples", + "description": "Number of examples to evaluate (useful for testing), if not provided, all examples in the dataset will be evaluated", + "type": "integer" + } + }, + "type": "object", + "required": [ + "eval_candidate" + ], + "title": "BenchmarkConfig", + "description": "A benchmark configuration for evaluation." + }, + "BooleanType": { + "properties": { + "type": { + "type": "string", + "const": "boolean", + "title": "Type", + "default": "boolean" + } + }, + "type": "object", + "title": "BooleanType", + "description": "Parameter type for boolean values." + }, + "BuiltinTool": { + "type": "string", + "enum": [ + "brave_search", + "wolfram_alpha", + "photogen", + "code_interpreter" + ], + "title": "BuiltinTool" + }, + "ChatCompletionInputType": { + "properties": { + "type": { + "type": "string", + "const": "chat_completion_input", + "title": "Type", + "default": "chat_completion_input" + } + }, + "type": "object", + "title": "ChatCompletionInputType", + "description": "Parameter type for chat completion input." + }, + "Chunk-Output": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "chunk_id": { + "type": "string", + "title": "Chunk Id" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + }, + "embedding": { + "title": "Embedding", + "items": { + "type": "number" + }, + "type": "array" + }, + "chunk_metadata": { + "$ref": "#/components/schemas/ChunkMetadata" + } + }, + "type": "object", + "required": [ + "content", + "chunk_id" + ], + "title": "Chunk", + "description": "A chunk of content that can be inserted into a vector database." + }, + "ChunkMetadata": { + "properties": { + "chunk_id": { + "title": "Chunk Id", + "type": "string" + }, + "document_id": { + "title": "Document Id", + "type": "string" + }, + "source": { + "title": "Source", + "type": "string" + }, + "created_timestamp": { + "title": "Created Timestamp", + "type": "integer" + }, + "updated_timestamp": { + "title": "Updated Timestamp", + "type": "integer" + }, + "chunk_window": { + "title": "Chunk Window", + "type": "string" + }, + "chunk_tokenizer": { + "title": "Chunk Tokenizer", + "type": "string" + }, + "chunk_embedding_model": { + "title": "Chunk Embedding Model", + "type": "string" + }, + "chunk_embedding_dimension": { + "title": "Chunk Embedding Dimension", + "type": "integer" + }, + "content_token_count": { + "title": "Content Token Count", + "type": "integer" + }, + "metadata_token_count": { + "title": "Metadata Token Count", + "type": "integer" + } + }, + "type": "object", + "title": "ChunkMetadata", + "description": "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." + }, + "CompletionInputType": { + "properties": { + "type": { + "type": "string", + "const": "completion_input", + "title": "Type", + "default": "completion_input" + } + }, + "type": "object", + "title": "CompletionInputType", + "description": "Parameter type for completion input." + }, + "CompletionMessage-Output": { + "properties": { + "role": { + "type": "string", + "const": "assistant", + "title": "Role", + "default": "assistant" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "stop_reason": { + "$ref": "#/components/schemas/StopReason" + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/ToolCall" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "content", + "stop_reason" + ], + "title": "CompletionMessage", + "description": "A message containing the model's (assistant) response in a chat conversation." + }, + "Conversation": { + "properties": { + "id": { + "type": "string", + "title": "Id", + "description": "The unique ID of the conversation." + }, + "object": { + "type": "string", + "const": "conversation", + "title": "Object", + "description": "The object type, which is always conversation.", + "default": "conversation" + }, + "created_at": { + "type": "integer", + "title": "Created At", + "description": "The time at which the conversation was created, measured in seconds since the Unix epoch." + }, + "metadata": { + "title": "Metadata", + "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.", + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "items": { + "title": "Items", + "description": "Initial items to include in the conversation context. You may add up to 20 items at a time.", + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "id", + "created_at" + ], + "title": "Conversation", + "description": "OpenAI-compatible conversation object." + }, + "ConversationItemInclude": { + "type": "string", + "enum": [ + "web_search_call.action.sources", + "code_interpreter_call.outputs", + "computer_call_output.output.image_url", + "file_search_call.results", + "message.input_image.image_url", + "message.output_text.logprobs", + "reasoning.encrypted_content" + ], + "title": "ConversationItemInclude", + "description": "Specify additional output data to include in the model response." + }, + "ConversationItemList": { + "properties": { + "object": { + "type": "string", + "title": "Object", + "description": "Object type", + "default": "list" + }, + "data": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage-Output" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", + "function_call_output": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput", + "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", + "mcp_approval_response": "#/components/schemas/OpenAIResponseMCPApprovalResponse", + "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", + "message": "#/components/schemas/OpenAIResponseMessage-Output", + "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + } + } + }, + "type": "array", + "title": "Data", + "description": "List of conversation items" + }, + "first_id": { + "title": "First Id", + "description": "The ID of the first item in the list", + "type": "string" + }, + "last_id": { + "title": "Last Id", + "description": "The ID of the last item in the list", + "type": "string" + }, + "has_more": { + "type": "boolean", + "title": "Has More", + "description": "Whether there are more items available", + "default": false + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ConversationItemList", + "description": "List of conversation items with pagination." + }, + "DPOAlignmentConfig": { + "properties": { + "beta": { + "type": "number", + "title": "Beta" + }, + "loss_type": { + "$ref": "#/components/schemas/DPOLossType", + "default": "sigmoid" + } + }, + "type": "object", + "required": [ + "beta" + ], + "title": "DPOAlignmentConfig", + "description": "Configuration for Direct Preference Optimization (DPO) alignment." + }, + "DPOLossType": { + "type": "string", + "enum": [ + "sigmoid", + "hinge", + "ipo", + "kto_pair" + ], + "title": "DPOLossType" + }, + "DataConfig": { + "properties": { + "dataset_id": { + "type": "string", + "title": "Dataset Id" + }, + "batch_size": { + "type": "integer", + "title": "Batch Size" + }, + "shuffle": { + "type": "boolean", + "title": "Shuffle" + }, + "data_format": { + "$ref": "#/components/schemas/DatasetFormat" + }, + "validation_dataset_id": { + "title": "Validation Dataset Id", + "type": "string" + }, + "packed": { + "title": "Packed", + "default": false, + "type": "boolean" + }, + "train_on_input": { + "title": "Train On Input", + "default": false, + "type": "boolean" + } + }, + "type": "object", + "required": [ + "dataset_id", + "batch_size", + "shuffle", + "data_format" + ], + "title": "DataConfig", + "description": "Configuration for training data and data loading." + }, + "Dataset": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "dataset", + "title": "Type", + "default": "dataset" + }, + "purpose": { + "$ref": "#/components/schemas/DatasetPurpose" + }, + "source": { + "oneOf": [ + { + "$ref": "#/components/schemas/URIDataSource" + }, + { + "$ref": "#/components/schemas/RowsDataSource" + } + ], + "title": "Source", + "discriminator": { + "propertyName": "type", + "mapping": { + "rows": "#/components/schemas/RowsDataSource", + "uri": "#/components/schemas/URIDataSource" + } + } + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata", + "description": "Any additional metadata for this dataset" + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id", + "purpose", + "source" + ], + "title": "Dataset", + "description": "Dataset resource for storing and accessing training or evaluation data." + }, + "DatasetFormat": { + "type": "string", + "enum": [ + "instruct", + "dialog" + ], + "title": "DatasetFormat", + "description": "Format of the training dataset." + }, + "DatasetPurpose": { + "type": "string", + "enum": [ + "post-training/messages", + "eval/question-answer", + "eval/messages-answer" + ], + "title": "DatasetPurpose", + "description": "Purpose of the dataset. Each purpose has a required input data schema." + }, + "DefaultRAGQueryGeneratorConfig": { + "properties": { + "type": { + "type": "string", + "const": "default", + "title": "Type", + "default": "default" + }, + "separator": { + "type": "string", + "title": "Separator", + "default": " " + } + }, + "type": "object", + "title": "DefaultRAGQueryGeneratorConfig", + "description": "Configuration for the default RAG query generator." + }, + "Document": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/URL" + } + ], + "title": "Content" + }, + "mime_type": { + "type": "string", + "title": "Mime Type" + } + }, + "type": "object", + "required": [ + "content", + "mime_type" + ], + "title": "Document", + "description": "A document to be used by an agent." + }, + "EfficiencyConfig": { + "properties": { + "enable_activation_checkpointing": { + "title": "Enable Activation Checkpointing", + "default": false, + "type": "boolean" + }, + "enable_activation_offloading": { + "title": "Enable Activation Offloading", + "default": false, + "type": "boolean" + }, + "memory_efficient_fsdp_wrap": { + "title": "Memory Efficient Fsdp Wrap", + "default": false, + "type": "boolean" + }, + "fsdp_cpu_offload": { + "title": "Fsdp Cpu Offload", + "default": false, + "type": "boolean" + } + }, + "type": "object", + "title": "EfficiencyConfig", + "description": "Configuration for memory and compute efficiency optimizations." + }, + "Errors": { + "properties": { + "data": { + "title": "Data", + "items": { + "$ref": "#/components/schemas/BatchError" + }, + "type": "array" + }, + "object": { + "title": "Object", + "type": "string" + } + }, + "additionalProperties": true, + "type": "object", + "title": "Errors" + }, + "EvaluateResponse": { + "properties": { + "generations": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Generations" + }, + "scores": { + "additionalProperties": { + "$ref": "#/components/schemas/ScoringResult" + }, + "type": "object", + "title": "Scores" + } + }, + "type": "object", + "required": [ + "generations", + "scores" + ], + "title": "EvaluateResponse", + "description": "The response from an evaluation." + }, + "GrammarResponseFormat": { + "properties": { + "type": { + "type": "string", + "const": "grammar", + "title": "Type", + "default": "grammar" + }, + "bnf": { + "additionalProperties": true, + "type": "object", + "title": "Bnf" + } + }, + "type": "object", + "required": [ + "bnf" + ], + "title": "GrammarResponseFormat", + "description": "Configuration for grammar-guided response generation." + }, + "GreedySamplingStrategy": { + "properties": { + "type": { + "type": "string", + "const": "greedy", + "title": "Type", + "default": "greedy" + } + }, + "type": "object", + "title": "GreedySamplingStrategy", + "description": "Greedy sampling strategy that selects the highest probability token at each step." + }, + "HealthInfo": { + "properties": { + "status": { + "$ref": "#/components/schemas/HealthStatus" + } + }, + "type": "object", + "required": [ + "status" + ], + "title": "HealthInfo", + "description": "Health status information for the service." + }, + "HealthStatus": { + "type": "string", + "enum": [ + "OK", + "Error", + "Not Implemented" + ], + "title": "HealthStatus" + }, + "ImageContentItem-Input": { + "properties": { + "type": { + "type": "string", + "const": "image", + "title": "Type", + "default": "image" + }, + "image": { + "$ref": "#/components/schemas/_URLOrData" + } + }, + "type": "object", + "required": [ + "image" + ], + "title": "ImageContentItem", + "description": "A image content item" + }, + "ImageContentItem-Output": { + "properties": { + "type": { + "type": "string", + "const": "image", + "title": "Type", + "default": "image" + }, + "image": { + "$ref": "#/components/schemas/_URLOrData" + } + }, + "type": "object", + "required": [ + "image" + ], + "title": "ImageContentItem", + "description": "A image content item" + }, + "InferenceStep-Output": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "step_id": { + "type": "string", + "title": "Step Id" + }, + "started_at": { + "title": "Started At", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + }, + "step_type": { + "type": "string", + "const": "inference", + "title": "Step Type", + "default": "inference" + }, + "model_response": { + "$ref": "#/components/schemas/CompletionMessage-Output" + } + }, + "type": "object", + "required": [ + "turn_id", + "step_id", + "model_response" + ], + "title": "InferenceStep", + "description": "An inference step in an agent turn." + }, + "InputTokensDetails": { + "properties": { + "cached_tokens": { + "type": "integer", + "title": "Cached Tokens" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "cached_tokens" + ], + "title": "InputTokensDetails" + }, + "Job": { + "properties": { + "job_id": { + "type": "string", + "title": "Job Id" + }, + "status": { + "$ref": "#/components/schemas/JobStatus" + } + }, + "type": "object", + "required": [ + "job_id", + "status" + ], + "title": "Job", + "description": "A job execution instance with status tracking." + }, + "JobStatus": { + "type": "string", + "enum": [ + "completed", + "in_progress", + "failed", + "scheduled", + "cancelled" + ], + "title": "JobStatus", + "description": "Status of a job execution." + }, + "JsonSchemaResponseFormat": { + "properties": { + "type": { + "type": "string", + "const": "json_schema", + "title": "Type", + "default": "json_schema" + }, + "json_schema": { + "additionalProperties": true, + "type": "object", + "title": "Json Schema" + } + }, + "type": "object", + "required": [ + "json_schema" + ], + "title": "JsonSchemaResponseFormat", + "description": "Configuration for JSON schema-guided response generation." + }, + "JsonType": { + "properties": { + "type": { + "type": "string", + "const": "json", + "title": "Type", + "default": "json" + } + }, + "type": "object", + "title": "JsonType", + "description": "Parameter type for JSON values." + }, + "LLMAsJudgeScoringFnParams": { + "properties": { + "type": { + "type": "string", + "const": "llm_as_judge", + "title": "Type", + "default": "llm_as_judge" + }, + "judge_model": { + "type": "string", + "title": "Judge Model" + }, + "prompt_template": { + "title": "Prompt Template", + "type": "string" + }, + "judge_score_regexes": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Judge Score Regexes", + "description": "Regexes to extract the answer from generated response" + }, + "aggregation_functions": { + "items": { + "$ref": "#/components/schemas/AggregationFunctionType" + }, + "type": "array", + "title": "Aggregation Functions", + "description": "Aggregation functions to apply to the scores of each row" + } + }, + "type": "object", + "required": [ + "judge_model" + ], + "title": "LLMAsJudgeScoringFnParams", + "description": "Parameters for LLM-as-judge scoring function configuration." + }, + "LLMRAGQueryGeneratorConfig": { + "properties": { + "type": { + "type": "string", + "const": "llm", + "title": "Type", + "default": "llm" + }, + "model": { + "type": "string", + "title": "Model" + }, + "template": { + "type": "string", + "title": "Template" + } + }, + "type": "object", + "required": [ + "model", + "template" + ], + "title": "LLMRAGQueryGeneratorConfig", + "description": "Configuration for the LLM-based RAG query generator." + }, + "ListBenchmarksResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Benchmark" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListBenchmarksResponse" + }, + "ListDatasetsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Dataset" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListDatasetsResponse", + "description": "Response from listing datasets." + }, + "ListModelsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Model" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListModelsResponse" + }, + "ListPostTrainingJobsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/PostTrainingJob" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListPostTrainingJobsResponse" + }, + "ListPromptsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Prompt" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListPromptsResponse", + "description": "Response model to list prompts." + }, + "ListProvidersResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ProviderInfo" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListProvidersResponse", + "description": "Response containing a list of all available providers." + }, + "ListRoutesResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/RouteInfo" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListRoutesResponse", + "description": "Response containing a list of all available API routes." + }, + "ListScoringFunctionsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ScoringFn-Output" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListScoringFunctionsResponse" + }, + "ListShieldsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Shield" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListShieldsResponse" + }, + "ListToolGroupsResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ToolGroup" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "ListToolGroupsResponse", + "description": "Response containing a list of tool groups." + }, + "MCPListToolsTool": { + "properties": { + "input_schema": { + "additionalProperties": true, + "type": "object", + "title": "Input Schema" + }, + "name": { + "type": "string", + "title": "Name" + }, + "description": { + "title": "Description", + "type": "string" + } + }, + "type": "object", + "required": [ + "input_schema", + "name" + ], + "title": "MCPListToolsTool", + "description": "Tool definition returned by MCP list tools operation." + }, + "MemoryRetrievalStep-Output": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "step_id": { + "type": "string", + "title": "Step Id" + }, + "started_at": { + "title": "Started At", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + }, + "step_type": { + "type": "string", + "const": "memory_retrieval", + "title": "Step Type", + "default": "memory_retrieval" + }, + "vector_store_ids": { + "type": "string", + "title": "Vector Store Ids" + }, + "inserted_context": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Inserted Context" + } + }, + "type": "object", + "required": [ + "turn_id", + "step_id", + "vector_store_ids", + "inserted_context" + ], + "title": "MemoryRetrievalStep", + "description": "A memory retrieval step in an agent turn." + }, + "Model": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "model", + "title": "Type", + "default": "model" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata", + "description": "Any additional metadata for this model" + }, + "model_type": { + "$ref": "#/components/schemas/ModelType", + "default": "llm" + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id" + ], + "title": "Model", + "description": "A model resource representing an AI model registered in Llama Stack." + }, + "ModelCandidate": { + "properties": { + "type": { + "type": "string", + "const": "model", + "title": "Type", + "default": "model" + }, + "model": { + "type": "string", + "title": "Model" + }, + "sampling_params": { + "$ref": "#/components/schemas/SamplingParams" + }, + "system_message": { + "$ref": "#/components/schemas/SystemMessage" + } + }, + "type": "object", + "required": [ + "model", + "sampling_params" + ], + "title": "ModelCandidate", + "description": "A model candidate for evaluation." + }, + "ModelType": { + "type": "string", + "enum": [ + "llm", + "embedding", + "rerank" + ], + "title": "ModelType", + "description": "Enumeration of supported model types in Llama Stack." + }, + "ModerationObject": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "model": { + "type": "string", + "title": "Model" + }, + "results": { + "items": { + "$ref": "#/components/schemas/ModerationObjectResults" + }, + "type": "array", + "title": "Results" + } + }, + "type": "object", + "required": [ + "id", + "model", + "results" + ], + "title": "ModerationObject", + "description": "A moderation object." + }, + "ModerationObjectResults": { + "properties": { + "flagged": { + "type": "boolean", + "title": "Flagged" + }, + "categories": { + "title": "Categories", + "additionalProperties": { + "type": "boolean" + }, + "type": "object" + }, + "category_applied_input_types": { + "title": "Category Applied Input Types", + "additionalProperties": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": "object" + }, + "category_scores": { + "title": "Category Scores", + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "user_message": { + "title": "User Message", + "type": "string" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "flagged" + ], + "title": "ModerationObjectResults", + "description": "A moderation object." + }, + "NumberType": { + "properties": { + "type": { + "type": "string", + "const": "number", + "title": "Type", + "default": "number" + } + }, + "type": "object", + "title": "NumberType", + "description": "Parameter type for numeric values." + }, + "ObjectType": { + "properties": { + "type": { + "type": "string", + "const": "object", + "title": "Type", + "default": "object" + } + }, + "type": "object", + "title": "ObjectType", + "description": "Parameter type for object values." + }, + "OpenAIAssistantMessageParam-Input": { + "properties": { + "role": { + "type": "string", + "const": "assistant", + "title": "Role", + "default": "assistant" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" + }, + "type": "array" + } + }, + "type": "object", + "title": "OpenAIAssistantMessageParam", + "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request." + }, + "OpenAIAssistantMessageParam-Output": { + "properties": { + "role": { + "type": "string", + "const": "assistant", + "title": "Role", + "default": "assistant" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" + }, + "type": "array" + } + }, + "type": "object", + "title": "OpenAIAssistantMessageParam", + "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request." + }, + "OpenAIChatCompletion": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "choices": { + "items": { + "$ref": "#/components/schemas/OpenAIChoice-Output" + }, + "type": "array", + "title": "Choices" + }, + "object": { + "type": "string", + "const": "chat.completion", + "title": "Object", + "default": "chat.completion" + }, + "created": { + "type": "integer", + "title": "Created" + }, + "model": { + "type": "string", + "title": "Model" + }, + "usage": { + "$ref": "#/components/schemas/OpenAIChatCompletionUsage" + } + }, + "type": "object", + "required": [ + "id", + "choices", + "created", + "model" + ], + "title": "OpenAIChatCompletion", + "description": "Response from an OpenAI-compatible chat completion request." + }, + "OpenAIChatCompletionContentPartImageParam": { + "properties": { + "type": { + "type": "string", + "const": "image_url", + "title": "Type", + "default": "image_url" + }, + "image_url": { + "$ref": "#/components/schemas/OpenAIImageURL" + } + }, + "type": "object", + "required": [ + "image_url" + ], + "title": "OpenAIChatCompletionContentPartImageParam", + "description": "Image content part for OpenAI-compatible chat completion messages." + }, + "OpenAIChatCompletionContentPartTextParam": { + "properties": { + "type": { + "type": "string", + "const": "text", + "title": "Type", + "default": "text" + }, + "text": { + "type": "string", + "title": "Text" + } + }, + "type": "object", + "required": [ + "text" + ], + "title": "OpenAIChatCompletionContentPartTextParam", + "description": "Text content part for OpenAI-compatible chat completion messages." + }, + "OpenAIChatCompletionRequestWithExtraBody": { + "properties": { + "model": { + "type": "string", + "title": "Model" + }, + "messages": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIUserMessageParam-Input" + }, + { + "$ref": "#/components/schemas/OpenAISystemMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIAssistantMessageParam-Input" + }, + { + "$ref": "#/components/schemas/OpenAIToolMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" + } + ], + "discriminator": { + "propertyName": "role", + "mapping": { + "assistant": "#/components/schemas/OpenAIAssistantMessageParam-Input", + "developer": "#/components/schemas/OpenAIDeveloperMessageParam", + "system": "#/components/schemas/OpenAISystemMessageParam", + "tool": "#/components/schemas/OpenAIToolMessageParam", + "user": "#/components/schemas/OpenAIUserMessageParam-Input" + } + } + }, + "type": "array", + "minItems": 1, + "title": "Messages" + }, + "frequency_penalty": { + "title": "Frequency Penalty", + "type": "number" + }, + "function_call": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": true, + "type": "object" + } + ], + "title": "Function Call" + }, + "functions": { + "title": "Functions", + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + "logit_bias": { + "title": "Logit Bias", + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "logprobs": { + "title": "Logprobs", + "type": "boolean" + }, + "max_completion_tokens": { + "title": "Max Completion Tokens", + "type": "integer" + }, + "max_tokens": { + "title": "Max Tokens", + "type": "integer" + }, + "n": { + "title": "N", + "type": "integer" + }, + "parallel_tool_calls": { + "title": "Parallel Tool Calls", + "type": "boolean" + }, + "presence_penalty": { + "title": "Presence Penalty", + "type": "number" + }, + "response_format": { + "title": "Response Format", + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseFormatText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseFormatJSONSchema" + }, + { + "$ref": "#/components/schemas/OpenAIResponseFormatJSONObject" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "json_object": "#/components/schemas/OpenAIResponseFormatJSONObject", + "json_schema": "#/components/schemas/OpenAIResponseFormatJSONSchema", + "text": "#/components/schemas/OpenAIResponseFormatText" + } + } + }, + "seed": { + "title": "Seed", + "type": "integer" + }, + "stop": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Stop" + }, + "stream": { + "title": "Stream", + "type": "boolean" + }, + "stream_options": { + "title": "Stream Options", + "additionalProperties": true, + "type": "object" + }, + "temperature": { + "title": "Temperature", + "type": "number" + }, + "tool_choice": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": true, + "type": "object" + } + ], + "title": "Tool Choice" + }, + "tools": { + "title": "Tools", + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + "top_logprobs": { + "title": "Top Logprobs", + "type": "integer" + }, + "top_p": { + "title": "Top P", + "type": "number" + }, + "user": { + "title": "User", + "type": "string" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "model", + "messages" + ], + "title": "OpenAIChatCompletionRequestWithExtraBody", + "description": "Request parameters for OpenAI-compatible chat completion endpoint." + }, + "OpenAIChatCompletionToolCall": { + "properties": { + "index": { + "title": "Index", + "type": "integer" + }, + "id": { + "title": "Id", + "type": "string" + }, + "type": { + "type": "string", + "const": "function", + "title": "Type", + "default": "function" + }, + "function": { + "$ref": "#/components/schemas/OpenAIChatCompletionToolCallFunction" + } + }, + "type": "object", + "title": "OpenAIChatCompletionToolCall", + "description": "Tool call specification for OpenAI-compatible chat completion responses." + }, + "OpenAIChatCompletionToolCallFunction": { + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "arguments": { + "title": "Arguments", + "type": "string" + } + }, + "type": "object", + "title": "OpenAIChatCompletionToolCallFunction", + "description": "Function call details for OpenAI-compatible tool calls." + }, + "OpenAIChatCompletionUsage": { + "properties": { + "prompt_tokens": { + "type": "integer", + "title": "Prompt Tokens" + }, + "completion_tokens": { + "type": "integer", + "title": "Completion Tokens" + }, + "total_tokens": { + "type": "integer", + "title": "Total Tokens" + }, + "prompt_tokens_details": { + "$ref": "#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails" + }, + "completion_tokens_details": { + "$ref": "#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails" + } + }, + "type": "object", + "required": [ + "prompt_tokens", + "completion_tokens", + "total_tokens" + ], + "title": "OpenAIChatCompletionUsage", + "description": "Usage information for OpenAI chat completion." + }, + "OpenAIChatCompletionUsageCompletionTokensDetails": { + "properties": { + "reasoning_tokens": { + "title": "Reasoning Tokens", + "type": "integer" + } + }, + "type": "object", + "title": "OpenAIChatCompletionUsageCompletionTokensDetails", + "description": "Token details for output tokens in OpenAI chat completion usage." + }, + "OpenAIChatCompletionUsagePromptTokensDetails": { + "properties": { + "cached_tokens": { + "title": "Cached Tokens", + "type": "integer" + } + }, + "type": "object", + "title": "OpenAIChatCompletionUsagePromptTokensDetails", + "description": "Token details for prompt tokens in OpenAI chat completion usage." + }, + "OpenAIChoice-Output": { + "properties": { + "message": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIUserMessageParam-Output" + }, + { + "$ref": "#/components/schemas/OpenAISystemMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIAssistantMessageParam-Output" + }, + { + "$ref": "#/components/schemas/OpenAIToolMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" + } + ], + "title": "Message", + "discriminator": { + "propertyName": "role", + "mapping": { + "assistant": "#/components/schemas/OpenAIAssistantMessageParam-Output", + "developer": "#/components/schemas/OpenAIDeveloperMessageParam", + "system": "#/components/schemas/OpenAISystemMessageParam", + "tool": "#/components/schemas/OpenAIToolMessageParam", + "user": "#/components/schemas/OpenAIUserMessageParam-Output" + } + } + }, + "finish_reason": { + "type": "string", + "title": "Finish Reason" + }, + "index": { + "type": "integer", + "title": "Index" + }, + "logprobs": { + "$ref": "#/components/schemas/OpenAIChoiceLogprobs-Output" + } + }, + "type": "object", + "required": [ + "message", + "finish_reason", + "index" + ], + "title": "OpenAIChoice", + "description": "A choice from an OpenAI-compatible chat completion response." + }, + "OpenAIChoiceLogprobs-Output": { + "properties": { + "content": { + "title": "Content", + "items": { + "$ref": "#/components/schemas/OpenAITokenLogProb" + }, + "type": "array" + }, + "refusal": { + "title": "Refusal", + "items": { + "$ref": "#/components/schemas/OpenAITokenLogProb" + }, + "type": "array" + } + }, + "type": "object", + "title": "OpenAIChoiceLogprobs", + "description": "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response." + }, + "OpenAICompletion": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "choices": { + "items": { + "$ref": "#/components/schemas/OpenAICompletionChoice-Output" + }, + "type": "array", + "title": "Choices" + }, + "created": { + "type": "integer", + "title": "Created" + }, + "model": { + "type": "string", + "title": "Model" + }, + "object": { + "type": "string", + "const": "text_completion", + "title": "Object", + "default": "text_completion" + } + }, + "type": "object", + "required": [ + "id", + "choices", + "created", + "model" + ], + "title": "OpenAICompletion", + "description": "Response from an OpenAI-compatible completion request." + }, + "OpenAICompletionChoice-Output": { + "properties": { + "finish_reason": { + "type": "string", + "title": "Finish Reason" + }, + "text": { + "type": "string", + "title": "Text" + }, + "index": { + "type": "integer", + "title": "Index" + }, + "logprobs": { + "$ref": "#/components/schemas/OpenAIChoiceLogprobs-Output" + } + }, + "type": "object", + "required": [ + "finish_reason", + "text", + "index" + ], + "title": "OpenAICompletionChoice", + "description": "A choice from an OpenAI-compatible completion response." + }, + "OpenAICompletionRequestWithExtraBody": { + "properties": { + "model": { + "type": "string", + "title": "Model" + }, + "prompt": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "integer" + }, + "type": "array" + }, + { + "items": { + "items": { + "type": "integer" + }, + "type": "array" + }, + "type": "array" + } + ], + "title": "Prompt" + }, + "best_of": { + "title": "Best Of", + "type": "integer" + }, + "echo": { + "title": "Echo", + "type": "boolean" + }, + "frequency_penalty": { + "title": "Frequency Penalty", + "type": "number" + }, + "logit_bias": { + "title": "Logit Bias", + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + "logprobs": { + "title": "Logprobs", + "type": "boolean" + }, + "max_tokens": { + "title": "Max Tokens", + "type": "integer" + }, + "n": { + "title": "N", + "type": "integer" + }, + "presence_penalty": { + "title": "Presence Penalty", + "type": "number" + }, + "seed": { + "title": "Seed", + "type": "integer" + }, + "stop": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Stop" + }, + "stream": { + "title": "Stream", + "type": "boolean" + }, + "stream_options": { + "title": "Stream Options", + "additionalProperties": true, + "type": "object" + }, + "temperature": { + "title": "Temperature", + "type": "number" + }, + "top_p": { + "title": "Top P", + "type": "number" + }, + "user": { + "title": "User", + "type": "string" + }, + "suffix": { + "title": "Suffix", + "type": "string" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "model", + "prompt" + ], + "title": "OpenAICompletionRequestWithExtraBody", + "description": "Request parameters for OpenAI-compatible completion endpoint." + }, + "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": { + "properties": { + "file_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "File Ids" + }, + "attributes": { + "title": "Attributes", + "additionalProperties": true, + "type": "object" + }, + "chunking_strategy": { + "title": "Chunking Strategy", + "oneOf": [ + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" + }, + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "auto": "#/components/schemas/VectorStoreChunkingStrategyAuto", + "static": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + } + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "file_ids" + ], + "title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody", + "description": "Request to create a vector store file batch with extra_body support." + }, + "OpenAICreateVectorStoreRequestWithExtraBody": { + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "file_ids": { + "title": "File Ids", + "items": { + "type": "string" + }, + "type": "array" + }, + "expires_after": { + "title": "Expires After", + "additionalProperties": true, + "type": "object" + }, + "chunking_strategy": { + "title": "Chunking Strategy", + "additionalProperties": true, + "type": "object" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "additionalProperties": true, + "type": "object", + "title": "OpenAICreateVectorStoreRequestWithExtraBody", + "description": "Request to create a vector store with extra_body support." + }, + "OpenAIDeveloperMessageParam": { + "properties": { + "role": { + "type": "string", + "const": "developer", + "title": "Role", + "default": "developer" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "OpenAIDeveloperMessageParam", + "description": "A message from the developer in an OpenAI-compatible chat completion request." + }, + "OpenAIEmbeddingData": { + "properties": { + "object": { + "type": "string", + "const": "embedding", + "title": "Object", + "default": "embedding" + }, + "embedding": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "title": "Embedding" + }, + "index": { + "type": "integer", + "title": "Index" + } + }, + "type": "object", + "required": [ + "embedding", + "index" + ], + "title": "OpenAIEmbeddingData", + "description": "A single embedding data object from an OpenAI-compatible embeddings response." + }, + "OpenAIEmbeddingUsage": { + "properties": { + "prompt_tokens": { + "type": "integer", + "title": "Prompt Tokens" + }, + "total_tokens": { + "type": "integer", + "title": "Total Tokens" + } + }, + "type": "object", + "required": [ + "prompt_tokens", + "total_tokens" + ], + "title": "OpenAIEmbeddingUsage", + "description": "Usage information for an OpenAI-compatible embeddings response." + }, + "OpenAIEmbeddingsRequestWithExtraBody": { + "properties": { + "model": { + "type": "string", + "title": "Model" + }, + "input": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Input" + }, + "encoding_format": { + "title": "Encoding Format", + "default": "float", + "type": "string" + }, + "dimensions": { + "title": "Dimensions", + "type": "integer" + }, + "user": { + "title": "User", + "type": "string" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "model", + "input" + ], + "title": "OpenAIEmbeddingsRequestWithExtraBody", + "description": "Request parameters for OpenAI-compatible embeddings endpoint." + }, + "OpenAIEmbeddingsResponse": { + "properties": { + "object": { + "type": "string", + "const": "list", + "title": "Object", + "default": "list" + }, + "data": { + "items": { + "$ref": "#/components/schemas/OpenAIEmbeddingData" + }, + "type": "array", + "title": "Data" + }, + "model": { + "type": "string", + "title": "Model" + }, + "usage": { + "$ref": "#/components/schemas/OpenAIEmbeddingUsage" + } + }, + "type": "object", + "required": [ + "data", + "model", + "usage" + ], + "title": "OpenAIEmbeddingsResponse", + "description": "Response from an OpenAI-compatible embeddings request." + }, + "OpenAIFile": { + "properties": { + "type": { + "type": "string", + "const": "file", + "title": "Type", + "default": "file" + }, + "file": { + "$ref": "#/components/schemas/OpenAIFileFile" + } + }, + "type": "object", + "required": [ + "file" + ], + "title": "OpenAIFile" + }, + "OpenAIFileFile": { + "properties": { + "file_data": { + "title": "File Data", + "type": "string" + }, + "file_id": { + "title": "File Id", + "type": "string" + }, + "filename": { + "title": "Filename", + "type": "string" + } + }, + "type": "object", + "title": "OpenAIFileFile" + }, + "OpenAIFileObject": { + "properties": { + "object": { + "type": "string", + "const": "file", + "title": "Object", + "default": "file" + }, + "id": { + "type": "string", + "title": "Id" + }, + "bytes": { + "type": "integer", + "title": "Bytes" + }, + "created_at": { + "type": "integer", + "title": "Created At" + }, + "expires_at": { + "type": "integer", + "title": "Expires At" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "purpose": { + "$ref": "#/components/schemas/OpenAIFilePurpose" + } + }, + "type": "object", + "required": [ + "id", + "bytes", + "created_at", + "expires_at", + "filename", + "purpose" + ], + "title": "OpenAIFileObject", + "description": "OpenAI File object as defined in the OpenAI Files API." + }, + "OpenAIFilePurpose": { + "type": "string", + "enum": [ + "assistants", + "batch" + ], + "title": "OpenAIFilePurpose", + "description": "Valid purpose values for OpenAI Files API." + }, + "OpenAIImageURL": { + "properties": { + "url": { + "type": "string", + "title": "Url" + }, + "detail": { + "title": "Detail", + "type": "string" + } + }, + "type": "object", + "required": [ + "url" + ], + "title": "OpenAIImageURL", + "description": "Image URL specification for OpenAI-compatible chat completion messages." + }, + "OpenAIJSONSchema": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "description": { + "title": "Description", + "type": "string" + }, + "strict": { + "title": "Strict", + "type": "boolean" + }, + "schema": { + "title": "Schema", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "title": "OpenAIJSONSchema", + "description": "JSON schema specification for OpenAI-compatible structured response format." + }, + "OpenAIResponseAnnotationCitation": { + "properties": { + "type": { + "type": "string", + "const": "url_citation", + "title": "Type", + "default": "url_citation" + }, + "end_index": { + "type": "integer", + "title": "End Index" + }, + "start_index": { + "type": "integer", + "title": "Start Index" + }, + "title": { + "type": "string", + "title": "Title" + }, + "url": { + "type": "string", + "title": "Url" + } + }, + "type": "object", + "required": [ + "end_index", + "start_index", + "title", + "url" + ], + "title": "OpenAIResponseAnnotationCitation", + "description": "URL citation annotation for referencing external web resources." + }, + "OpenAIResponseAnnotationContainerFileCitation": { + "properties": { + "type": { + "type": "string", + "const": "container_file_citation", + "title": "Type", + "default": "container_file_citation" + }, + "container_id": { + "type": "string", + "title": "Container Id" + }, + "end_index": { + "type": "integer", + "title": "End Index" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "start_index": { + "type": "integer", + "title": "Start Index" + } + }, + "type": "object", + "required": [ + "container_id", + "end_index", + "file_id", + "filename", + "start_index" + ], + "title": "OpenAIResponseAnnotationContainerFileCitation" + }, + "OpenAIResponseAnnotationFileCitation": { + "properties": { + "type": { + "type": "string", + "const": "file_citation", + "title": "Type", + "default": "file_citation" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "index": { + "type": "integer", + "title": "Index" + } + }, + "type": "object", + "required": [ + "file_id", + "filename", + "index" + ], + "title": "OpenAIResponseAnnotationFileCitation", + "description": "File citation annotation for referencing specific files in response content." + }, + "OpenAIResponseAnnotationFilePath": { + "properties": { + "type": { + "type": "string", + "const": "file_path", + "title": "Type", + "default": "file_path" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "index": { + "type": "integer", + "title": "Index" + } + }, + "type": "object", + "required": [ + "file_id", + "index" + ], + "title": "OpenAIResponseAnnotationFilePath" + }, + "OpenAIResponseContentPartRefusal": { + "properties": { + "type": { + "type": "string", + "const": "refusal", + "title": "Type", + "default": "refusal" + }, + "refusal": { + "type": "string", + "title": "Refusal" + } + }, + "type": "object", + "required": [ + "refusal" + ], + "title": "OpenAIResponseContentPartRefusal", + "description": "Refusal content within a streamed response part." + }, + "OpenAIResponseError": { + "properties": { + "code": { + "type": "string", + "title": "Code" + }, + "message": { + "type": "string", + "title": "Message" + } + }, + "type": "object", + "required": [ + "code", + "message" + ], + "title": "OpenAIResponseError", + "description": "Error details for failed OpenAI response requests." + }, + "OpenAIResponseFormatJSONObject": { + "properties": { + "type": { + "type": "string", + "const": "json_object", + "title": "Type", + "default": "json_object" + } + }, + "type": "object", + "title": "OpenAIResponseFormatJSONObject", + "description": "JSON object response format for OpenAI-compatible chat completion requests." + }, + "OpenAIResponseFormatJSONSchema": { + "properties": { + "type": { + "type": "string", + "const": "json_schema", + "title": "Type", + "default": "json_schema" + }, + "json_schema": { + "$ref": "#/components/schemas/OpenAIJSONSchema" + } + }, + "type": "object", + "required": [ + "json_schema" + ], + "title": "OpenAIResponseFormatJSONSchema", + "description": "JSON schema response format for OpenAI-compatible chat completion requests." + }, + "OpenAIResponseFormatText": { + "properties": { + "type": { + "type": "string", + "const": "text", + "title": "Type", + "default": "text" + } + }, + "type": "object", + "title": "OpenAIResponseFormatText", + "description": "Text response format for OpenAI-compatible chat completion requests." + }, + "OpenAIResponseInputFunctionToolCallOutput": { + "properties": { + "call_id": { + "type": "string", + "title": "Call Id" + }, + "output": { + "type": "string", + "title": "Output" + }, + "type": { + "type": "string", + "const": "function_call_output", + "title": "Type", + "default": "function_call_output" + }, + "id": { + "title": "Id", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "type": "object", + "required": [ + "call_id", + "output" + ], + "title": "OpenAIResponseInputFunctionToolCallOutput", + "description": "This represents the output of a function call that gets passed back to the model." + }, + "OpenAIResponseInputMessageContentFile": { + "properties": { + "type": { + "type": "string", + "const": "input_file", + "title": "Type", + "default": "input_file" + }, + "file_data": { + "title": "File Data", + "type": "string" + }, + "file_id": { + "title": "File Id", + "type": "string" + }, + "file_url": { + "title": "File Url", + "type": "string" + }, + "filename": { + "title": "Filename", + "type": "string" + } + }, + "type": "object", + "title": "OpenAIResponseInputMessageContentFile", + "description": "File content for input messages in OpenAI response format." + }, + "OpenAIResponseInputMessageContentImage": { + "properties": { + "detail": { + "anyOf": [ + { + "type": "string", + "const": "low" + }, + { + "type": "string", + "const": "high" + }, + { + "type": "string", + "const": "auto" + } + ], + "title": "Detail", + "default": "auto" + }, + "type": { + "type": "string", + "const": "input_image", + "title": "Type", + "default": "input_image" + }, + "file_id": { + "title": "File Id", + "type": "string" + }, + "image_url": { + "title": "Image Url", + "type": "string" + } + }, + "type": "object", + "title": "OpenAIResponseInputMessageContentImage", + "description": "Image content for input messages in OpenAI response format." + }, + "OpenAIResponseInputMessageContentText": { + "properties": { + "text": { + "type": "string", + "title": "Text" + }, + "type": { + "type": "string", + "const": "input_text", + "title": "Type", + "default": "input_text" + } + }, + "type": "object", + "required": [ + "text" + ], + "title": "OpenAIResponseInputMessageContentText", + "description": "Text content for input messages in OpenAI response format." + }, + "OpenAIResponseInputToolFileSearch": { + "properties": { + "type": { + "type": "string", + "const": "file_search", + "title": "Type", + "default": "file_search" + }, + "vector_store_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Vector Store Ids" + }, + "filters": { + "title": "Filters", + "additionalProperties": true, + "type": "object" + }, + "max_num_results": { + "title": "Max Num Results", + "default": 10, + "type": "integer", + "maximum": 50.0, + "minimum": 1.0 + }, + "ranking_options": { + "$ref": "#/components/schemas/SearchRankingOptions" + } + }, + "type": "object", + "required": [ + "vector_store_ids" + ], + "title": "OpenAIResponseInputToolFileSearch", + "description": "File search tool configuration for OpenAI response inputs." + }, + "OpenAIResponseInputToolFunction": { + "properties": { + "type": { + "type": "string", + "const": "function", + "title": "Type", + "default": "function" + }, + "name": { + "type": "string", + "title": "Name" + }, + "description": { + "title": "Description", + "type": "string" + }, + "parameters": { + "title": "Parameters", + "additionalProperties": true, + "type": "object" + }, + "strict": { + "title": "Strict", + "type": "boolean" + } + }, + "type": "object", + "required": [ + "name", + "parameters" + ], + "title": "OpenAIResponseInputToolFunction", + "description": "Function tool configuration for OpenAI response inputs." + }, + "OpenAIResponseInputToolMCP": { + "properties": { + "type": { + "type": "string", + "const": "mcp", + "title": "Type", + "default": "mcp" + }, + "server_label": { + "type": "string", + "title": "Server Label" + }, + "server_url": { + "type": "string", + "title": "Server Url" + }, + "headers": { + "title": "Headers", + "additionalProperties": true, + "type": "object" + }, + "require_approval": { + "anyOf": [ + { + "type": "string", + "const": "always" + }, + { + "type": "string", + "const": "never" + }, + { + "$ref": "#/components/schemas/ApprovalFilter" + } + ], + "title": "Require Approval", + "default": "never" + }, + "allowed_tools": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/AllowedToolsFilter" + } + ], + "title": "Allowed Tools" + } + }, + "type": "object", + "required": [ + "server_label", + "server_url" + ], + "title": "OpenAIResponseInputToolMCP", + "description": "Model Context Protocol (MCP) tool configuration for OpenAI response inputs." + }, + "OpenAIResponseInputToolWebSearch": { + "properties": { + "type": { + "anyOf": [ + { + "type": "string", + "const": "web_search" + }, + { + "type": "string", + "const": "web_search_preview" + }, + { + "type": "string", + "const": "web_search_preview_2025_03_11" + } + ], + "title": "Type", + "default": "web_search" + }, + "search_context_size": { + "title": "Search Context Size", + "default": "medium", + "type": "string", + "pattern": "^low|medium|high$" + } + }, + "type": "object", + "title": "OpenAIResponseInputToolWebSearch", + "description": "Web search tool configuration for OpenAI response inputs." + }, + "OpenAIResponseMCPApprovalRequest": { + "properties": { + "arguments": { + "type": "string", + "title": "Arguments" + }, + "id": { + "type": "string", + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "server_label": { + "type": "string", + "title": "Server Label" + }, + "type": { + "type": "string", + "const": "mcp_approval_request", + "title": "Type", + "default": "mcp_approval_request" + } + }, + "type": "object", + "required": [ + "arguments", + "id", + "name", + "server_label" + ], + "title": "OpenAIResponseMCPApprovalRequest", + "description": "A request for human approval of a tool invocation." + }, + "OpenAIResponseMCPApprovalResponse": { + "properties": { + "approval_request_id": { + "type": "string", + "title": "Approval Request Id" + }, + "approve": { + "type": "boolean", + "title": "Approve" + }, + "type": { + "type": "string", + "const": "mcp_approval_response", + "title": "Type", + "default": "mcp_approval_response" + }, + "id": { + "title": "Id", + "type": "string" + }, + "reason": { + "title": "Reason", + "type": "string" + } + }, + "type": "object", + "required": [ + "approval_request_id", + "approve" + ], + "title": "OpenAIResponseMCPApprovalResponse", + "description": "A response to an MCP approval request." + }, + "OpenAIResponseMessage-Input": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", + "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", + "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" + } + } + }, + "type": "array" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "output_text": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText", + "refusal": "#/components/schemas/OpenAIResponseContentPartRefusal" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "role": { + "anyOf": [ + { + "type": "string", + "const": "system" + }, + { + "type": "string", + "const": "developer" + }, + { + "type": "string", + "const": "user" + }, + { + "type": "string", + "const": "assistant" + } + ], + "title": "Role" + }, + "type": { + "type": "string", + "const": "message", + "title": "Type", + "default": "message" + }, + "id": { + "title": "Id", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "type": "object", + "required": [ + "content", + "role" + ], + "title": "OpenAIResponseMessage", + "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + }, + "OpenAIResponseMessage-Output": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", + "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", + "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" + } + } + }, + "type": "array" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "output_text": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText", + "refusal": "#/components/schemas/OpenAIResponseContentPartRefusal" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "role": { + "anyOf": [ + { + "type": "string", + "const": "system" + }, + { + "type": "string", + "const": "developer" + }, + { + "type": "string", + "const": "user" + }, + { + "type": "string", + "const": "assistant" + } + ], + "title": "Role" + }, + "type": { + "type": "string", + "const": "message", + "title": "Type", + "default": "message" + }, + "id": { + "title": "Id", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "type": "object", + "required": [ + "content", + "role" + ], + "title": "OpenAIResponseMessage", + "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + }, + "OpenAIResponseObject": { + "properties": { + "created_at": { + "type": "integer", + "title": "Created At" + }, + "error": { + "$ref": "#/components/schemas/OpenAIResponseError" + }, + "id": { + "type": "string", + "title": "Id" + }, + "model": { + "type": "string", + "title": "Model" + }, + "object": { + "type": "string", + "const": "response", + "title": "Object", + "default": "response" + }, + "output": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage-Output" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", + "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", + "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", + "message": "#/components/schemas/OpenAIResponseMessage-Output", + "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + } + } + }, + "type": "array", + "title": "Output" + }, + "parallel_tool_calls": { + "type": "boolean", + "title": "Parallel Tool Calls", + "default": false + }, + "previous_response_id": { + "title": "Previous Response Id", + "type": "string" + }, + "prompt": { + "$ref": "#/components/schemas/OpenAIResponsePrompt" + }, + "status": { + "type": "string", + "title": "Status" + }, + "temperature": { + "title": "Temperature", + "type": "number" + }, + "text": { + "$ref": "#/components/schemas/OpenAIResponseText", + "default": { + "format": { + "type": "text" + } + } + }, + "top_p": { + "title": "Top P", + "type": "number" + }, + "tools": { + "title": "Tools", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" + }, + { + "$ref": "#/components/schemas/OpenAIResponseToolMCP" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "file_search": "#/components/schemas/OpenAIResponseInputToolFileSearch", + "function": "#/components/schemas/OpenAIResponseInputToolFunction", + "mcp": "#/components/schemas/OpenAIResponseToolMCP", + "web_search": "#/components/schemas/OpenAIResponseInputToolWebSearch", + "web_search_preview": "#/components/schemas/OpenAIResponseInputToolWebSearch", + "web_search_preview_2025_03_11": "#/components/schemas/OpenAIResponseInputToolWebSearch" + } + } + }, + "type": "array" + }, + "truncation": { + "title": "Truncation", + "type": "string" + }, + "usage": { + "$ref": "#/components/schemas/OpenAIResponseUsage" + }, + "instructions": { + "title": "Instructions", + "type": "string" + } + }, + "type": "object", + "required": [ + "created_at", + "id", + "model", + "output", + "status" + ], + "title": "OpenAIResponseObject", + "description": "Complete OpenAI response object containing generation results and metadata." + }, + "OpenAIResponseOutputMessageContentOutputText": { + "properties": { + "text": { + "type": "string", + "title": "Text" + }, + "type": { + "type": "string", + "const": "output_text", + "title": "Type", + "default": "output_text" + }, + "annotations": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationFileCitation" + }, + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationCitation" + }, + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation" + }, + { + "$ref": "#/components/schemas/OpenAIResponseAnnotationFilePath" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "container_file_citation": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation", + "file_citation": "#/components/schemas/OpenAIResponseAnnotationFileCitation", + "file_path": "#/components/schemas/OpenAIResponseAnnotationFilePath", + "url_citation": "#/components/schemas/OpenAIResponseAnnotationCitation" + } + } + }, + "type": "array", + "title": "Annotations" + } + }, + "type": "object", + "required": [ + "text" + ], + "title": "OpenAIResponseOutputMessageContentOutputText" + }, + "OpenAIResponseOutputMessageFileSearchToolCall": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "queries": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Queries" + }, + "status": { + "type": "string", + "title": "Status" + }, + "type": { + "type": "string", + "const": "file_search_call", + "title": "Type", + "default": "file_search_call" + }, + "results": { + "title": "Results", + "items": { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults" + }, + "type": "array" + } + }, + "type": "object", + "required": [ + "id", + "queries", + "status" + ], + "title": "OpenAIResponseOutputMessageFileSearchToolCall", + "description": "File search tool call output message for OpenAI responses." + }, + "OpenAIResponseOutputMessageFileSearchToolCallResults": { + "properties": { + "attributes": { + "additionalProperties": true, + "type": "object", + "title": "Attributes" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "score": { + "type": "number", + "title": "Score" + }, + "text": { + "type": "string", + "title": "Text" + } + }, + "type": "object", + "required": [ + "attributes", + "file_id", + "filename", + "score", + "text" + ], + "title": "OpenAIResponseOutputMessageFileSearchToolCallResults", + "description": "Search results returned by the file search operation." + }, + "OpenAIResponseOutputMessageFunctionToolCall": { + "properties": { + "call_id": { + "type": "string", + "title": "Call Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "arguments": { + "type": "string", + "title": "Arguments" + }, + "type": { + "type": "string", + "const": "function_call", + "title": "Type", + "default": "function_call" + }, + "id": { + "title": "Id", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "type": "object", + "required": [ + "call_id", + "name", + "arguments" + ], + "title": "OpenAIResponseOutputMessageFunctionToolCall", + "description": "Function tool call output message for OpenAI responses." + }, + "OpenAIResponseOutputMessageMCPCall": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "type": { + "type": "string", + "const": "mcp_call", + "title": "Type", + "default": "mcp_call" + }, + "arguments": { + "type": "string", + "title": "Arguments" + }, + "name": { + "type": "string", + "title": "Name" + }, + "server_label": { + "type": "string", + "title": "Server Label" + }, + "error": { + "title": "Error", + "type": "string" + }, + "output": { + "title": "Output", + "type": "string" + } + }, + "type": "object", + "required": [ + "id", + "arguments", + "name", + "server_label" + ], + "title": "OpenAIResponseOutputMessageMCPCall", + "description": "Model Context Protocol (MCP) call output message for OpenAI responses." + }, + "OpenAIResponseOutputMessageMCPListTools": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "type": { + "type": "string", + "const": "mcp_list_tools", + "title": "Type", + "default": "mcp_list_tools" + }, + "server_label": { + "type": "string", + "title": "Server Label" + }, + "tools": { + "items": { + "$ref": "#/components/schemas/MCPListToolsTool" + }, + "type": "array", + "title": "Tools" + } + }, + "type": "object", + "required": [ + "id", + "server_label", + "tools" + ], + "title": "OpenAIResponseOutputMessageMCPListTools", + "description": "MCP list tools output message containing available tools from an MCP server." + }, + "OpenAIResponseOutputMessageWebSearchToolCall": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "status": { + "type": "string", + "title": "Status" + }, + "type": { + "type": "string", + "const": "web_search_call", + "title": "Type", + "default": "web_search_call" + } + }, + "type": "object", + "required": [ + "id", + "status" + ], + "title": "OpenAIResponseOutputMessageWebSearchToolCall", + "description": "Web search tool call output message for OpenAI responses." + }, + "OpenAIResponsePrompt": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "variables": { + "title": "Variables", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", + "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", + "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" + } + } + }, + "type": "object" + }, + "version": { + "title": "Version", + "type": "string" + } + }, + "type": "object", + "required": [ + "id" + ], + "title": "OpenAIResponsePrompt", + "description": "OpenAI compatible Prompt object that is used in OpenAI responses." + }, + "OpenAIResponseText": { + "properties": { + "format": { + "$ref": "#/components/schemas/OpenAIResponseTextFormat" + } + }, + "type": "object", + "title": "OpenAIResponseText", + "description": "Text response configuration for OpenAI responses." + }, + "OpenAIResponseTextFormat": { + "properties": { + "type": { + "anyOf": [ + { + "type": "string", + "const": "text" + }, + { + "type": "string", + "const": "json_schema" + }, + { + "type": "string", + "const": "json_object" + } + ], + "title": "Type" + }, + "name": { + "title": "Name", + "type": "string" + }, + "schema": { + "title": "Schema", + "additionalProperties": true, + "type": "object" + }, + "description": { + "title": "Description", + "type": "string" + }, + "strict": { + "title": "Strict", + "type": "boolean" + } + }, + "type": "object", + "title": "OpenAIResponseTextFormat", + "description": "Configuration for Responses API text format." + }, + "OpenAIResponseToolMCP": { + "properties": { + "type": { + "type": "string", + "const": "mcp", + "title": "Type", + "default": "mcp" + }, + "server_label": { + "type": "string", + "title": "Server Label" + }, + "allowed_tools": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/AllowedToolsFilter" + } + ], + "title": "Allowed Tools" + } + }, + "type": "object", + "required": [ + "server_label" + ], + "title": "OpenAIResponseToolMCP", + "description": "Model Context Protocol (MCP) tool configuration for OpenAI response object." + }, + "OpenAIResponseUsage": { + "properties": { + "input_tokens": { + "type": "integer", + "title": "Input Tokens" + }, + "output_tokens": { + "type": "integer", + "title": "Output Tokens" + }, + "total_tokens": { + "type": "integer", + "title": "Total Tokens" + }, + "input_tokens_details": { + "$ref": "#/components/schemas/OpenAIResponseUsageInputTokensDetails" + }, + "output_tokens_details": { + "$ref": "#/components/schemas/OpenAIResponseUsageOutputTokensDetails" + } + }, + "type": "object", + "required": [ + "input_tokens", + "output_tokens", + "total_tokens" + ], + "title": "OpenAIResponseUsage", + "description": "Usage information for OpenAI response." + }, + "OpenAIResponseUsageInputTokensDetails": { + "properties": { + "cached_tokens": { + "title": "Cached Tokens", + "type": "integer" + } + }, + "type": "object", + "title": "OpenAIResponseUsageInputTokensDetails", + "description": "Token details for input tokens in OpenAI response usage." + }, + "OpenAIResponseUsageOutputTokensDetails": { + "properties": { + "reasoning_tokens": { + "title": "Reasoning Tokens", + "type": "integer" + } + }, + "type": "object", + "title": "OpenAIResponseUsageOutputTokensDetails", + "description": "Token details for output tokens in OpenAI response usage." + }, + "OpenAISystemMessageParam": { + "properties": { + "role": { + "type": "string", + "const": "system", + "title": "Role", + "default": "system" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "OpenAISystemMessageParam", + "description": "A system message providing instructions or context to the model." + }, + "OpenAITokenLogProb": { + "properties": { + "token": { + "type": "string", + "title": "Token" + }, + "bytes": { + "title": "Bytes", + "items": { + "type": "integer" + }, + "type": "array" + }, + "logprob": { + "type": "number", + "title": "Logprob" + }, + "top_logprobs": { + "items": { + "$ref": "#/components/schemas/OpenAITopLogProb" + }, + "type": "array", + "title": "Top Logprobs" + } + }, + "type": "object", + "required": [ + "token", + "logprob", + "top_logprobs" + ], + "title": "OpenAITokenLogProb", + "description": "The log probability for a token from an OpenAI-compatible chat completion response." + }, + "OpenAIToolMessageParam": { + "properties": { + "role": { + "type": "string", + "const": "tool", + "title": "Role", + "default": "tool" + }, + "tool_call_id": { + "type": "string", + "title": "Tool Call Id" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content" + } + }, + "type": "object", + "required": [ + "tool_call_id", + "content" + ], + "title": "OpenAIToolMessageParam", + "description": "A message representing the result of a tool invocation in an OpenAI-compatible chat completion request." + }, + "OpenAITopLogProb": { + "properties": { + "token": { + "type": "string", + "title": "Token" + }, + "bytes": { + "title": "Bytes", + "items": { + "type": "integer" + }, + "type": "array" + }, + "logprob": { + "type": "number", + "title": "Logprob" + } + }, + "type": "object", + "required": [ + "token", + "logprob" + ], + "title": "OpenAITopLogProb", + "description": "The top log probability for a token from an OpenAI-compatible chat completion response." + }, + "OpenAIUserMessageParam-Input": { + "properties": { + "role": { + "type": "string", + "const": "user", + "title": "Role", + "default": "user" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" + }, + { + "$ref": "#/components/schemas/OpenAIFile" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "file": "#/components/schemas/OpenAIFile", + "image_url": "#/components/schemas/OpenAIChatCompletionContentPartImageParam", + "text": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "OpenAIUserMessageParam", + "description": "A message from the user in an OpenAI-compatible chat completion request." + }, + "OpenAIUserMessageParam-Output": { + "properties": { + "role": { + "type": "string", + "const": "user", + "title": "Role", + "default": "user" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" + }, + { + "$ref": "#/components/schemas/OpenAIFile" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "file": "#/components/schemas/OpenAIFile", + "image_url": "#/components/schemas/OpenAIChatCompletionContentPartImageParam", + "text": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "OpenAIUserMessageParam", + "description": "A message from the user in an OpenAI-compatible chat completion request." + }, + "OptimizerConfig": { + "properties": { + "optimizer_type": { + "$ref": "#/components/schemas/OptimizerType" + }, + "lr": { + "type": "number", + "title": "Lr" + }, + "weight_decay": { + "type": "number", + "title": "Weight Decay" + }, + "num_warmup_steps": { + "type": "integer", + "title": "Num Warmup Steps" + } + }, + "type": "object", + "required": [ + "optimizer_type", + "lr", + "weight_decay", + "num_warmup_steps" + ], + "title": "OptimizerConfig", + "description": "Configuration parameters for the optimization algorithm." + }, + "OptimizerType": { + "type": "string", + "enum": [ + "adam", + "adamw", + "sgd" + ], + "title": "OptimizerType", + "description": "Available optimizer algorithms for training." + }, + "Order": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "title": "Order", + "description": "Sort order for paginated responses." + }, + "OutputTokensDetails": { + "properties": { + "reasoning_tokens": { + "type": "integer", + "title": "Reasoning Tokens" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "reasoning_tokens" + ], + "title": "OutputTokensDetails" + }, + "PostTrainingJob": { + "properties": { + "job_uuid": { + "type": "string", + "title": "Job Uuid" + } + }, + "type": "object", + "required": [ + "job_uuid" + ], + "title": "PostTrainingJob" + }, + "Prompt": { + "properties": { + "prompt": { + "title": "Prompt", + "description": "The system prompt with variable placeholders", + "type": "string" + }, + "version": { + "type": "integer", + "minimum": 1.0, + "title": "Version", + "description": "Version (integer starting at 1, incremented on save)" + }, + "prompt_id": { + "type": "string", + "title": "Prompt Id", + "description": "Unique identifier in format 'pmpt_<48-digit-hash>'" + }, + "variables": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Variables", + "description": "List of variable names that can be used in the prompt template" + }, + "is_default": { + "type": "boolean", + "title": "Is Default", + "description": "Boolean indicating whether this version is the default version", + "default": false + } + }, + "type": "object", + "required": [ + "version", + "prompt_id" + ], + "title": "Prompt", + "description": "A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack." + }, + "ProviderInfo": { + "properties": { + "api": { + "type": "string", + "title": "Api" + }, + "provider_id": { + "type": "string", + "title": "Provider Id" + }, + "provider_type": { + "type": "string", + "title": "Provider Type" + }, + "config": { + "additionalProperties": true, + "type": "object", + "title": "Config" + }, + "health": { + "additionalProperties": true, + "type": "object", + "title": "Health" + } + }, + "type": "object", + "required": [ + "api", + "provider_id", + "provider_type", + "config", + "health" + ], + "title": "ProviderInfo", + "description": "Information about a registered provider including its configuration and health status." + }, + "QueryChunksResponse": { + "properties": { + "chunks": { + "items": { + "$ref": "#/components/schemas/Chunk-Output" + }, + "type": "array", + "title": "Chunks" + }, + "scores": { + "items": { + "type": "number" + }, + "type": "array", + "title": "Scores" + } + }, + "type": "object", + "required": [ + "chunks", + "scores" + ], + "title": "QueryChunksResponse", + "description": "Response from querying chunks in a vector database." + }, + "RAGQueryConfig": { + "properties": { + "query_generator_config": { + "oneOf": [ + { + "$ref": "#/components/schemas/DefaultRAGQueryGeneratorConfig" + }, + { + "$ref": "#/components/schemas/LLMRAGQueryGeneratorConfig" + } + ], + "title": "Query Generator Config", + "default": { + "type": "default", + "separator": " " + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "default": "#/components/schemas/DefaultRAGQueryGeneratorConfig", + "llm": "#/components/schemas/LLMRAGQueryGeneratorConfig" + } + } + }, + "max_tokens_in_context": { + "type": "integer", + "title": "Max Tokens In Context", + "default": 4096 + }, + "max_chunks": { + "type": "integer", + "title": "Max Chunks", + "default": 5 + }, + "chunk_template": { + "type": "string", + "title": "Chunk Template", + "default": "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n" + }, + "mode": { + "default": "vector", + "$ref": "#/components/schemas/RAGSearchMode" + }, + "ranker": { + "title": "Ranker", + "oneOf": [ + { + "$ref": "#/components/schemas/RRFRanker" + }, + { + "$ref": "#/components/schemas/WeightedRanker" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "rrf": "#/components/schemas/RRFRanker", + "weighted": "#/components/schemas/WeightedRanker" + } + } + } + }, + "type": "object", + "title": "RAGQueryConfig", + "description": "Configuration for the RAG query generation." + }, + "RAGQueryResult": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + } + }, + "type": "object", + "title": "RAGQueryResult", + "description": "Result of a RAG query containing retrieved content and metadata." + }, + "RAGSearchMode": { + "type": "string", + "enum": [ + "vector", + "keyword", + "hybrid" + ], + "title": "RAGSearchMode", + "description": "Search modes for RAG query retrieval:\n- VECTOR: Uses vector similarity search for semantic matching\n- KEYWORD: Uses keyword-based search for exact matching\n- HYBRID: Combines both vector and keyword search for better results" + }, + "RRFRanker": { + "properties": { + "type": { + "type": "string", + "const": "rrf", + "title": "Type", + "default": "rrf" + }, + "impact_factor": { + "type": "number", + "title": "Impact Factor", + "default": 60.0, + "minimum": 0.0 + } + }, + "type": "object", + "title": "RRFRanker", + "description": "Reciprocal Rank Fusion (RRF) ranker configuration." + }, + "RegexParserScoringFnParams": { + "properties": { + "type": { + "type": "string", + "const": "regex_parser", + "title": "Type", + "default": "regex_parser" + }, + "parsing_regexes": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Parsing Regexes", + "description": "Regex to extract the answer from generated response" + }, + "aggregation_functions": { + "items": { + "$ref": "#/components/schemas/AggregationFunctionType" + }, + "type": "array", + "title": "Aggregation Functions", + "description": "Aggregation functions to apply to the scores of each row" + } + }, + "type": "object", + "title": "RegexParserScoringFnParams", + "description": "Parameters for regex parser scoring function configuration." + }, + "RerankData": { + "properties": { + "index": { + "type": "integer", + "title": "Index" + }, + "relevance_score": { + "type": "number", + "title": "Relevance Score" + } + }, + "type": "object", + "required": [ + "index", + "relevance_score" + ], + "title": "RerankData", + "description": "A single rerank result from a reranking response." + }, + "RerankResponse": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/RerankData" + }, + "type": "array", + "title": "Data" + } + }, + "type": "object", + "required": [ + "data" + ], + "title": "RerankResponse", + "description": "Response from a reranking request." + }, + "RouteInfo": { + "properties": { + "route": { + "type": "string", + "title": "Route" + }, + "method": { + "type": "string", + "title": "Method" + }, + "provider_types": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Provider Types" + } + }, + "type": "object", + "required": [ + "route", + "method", + "provider_types" + ], + "title": "RouteInfo", + "description": "Information about an API route including its path, method, and implementing providers." + }, + "RowsDataSource": { + "properties": { + "type": { + "type": "string", + "const": "rows", + "title": "Type", + "default": "rows" + }, + "rows": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Rows" + } + }, + "type": "object", + "required": [ + "rows" + ], + "title": "RowsDataSource", + "description": "A dataset stored in rows." + }, + "RunShieldResponse": { + "properties": { + "violation": { + "$ref": "#/components/schemas/SafetyViolation" + } + }, + "type": "object", + "title": "RunShieldResponse", + "description": "Response from running a safety shield." + }, + "SafetyViolation": { + "properties": { + "violation_level": { + "$ref": "#/components/schemas/ViolationLevel" + }, + "user_message": { + "title": "User Message", + "type": "string" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "violation_level" + ], + "title": "SafetyViolation", + "description": "Details of a safety violation detected by content moderation." + }, + "SamplingParams": { + "properties": { + "strategy": { + "oneOf": [ + { + "$ref": "#/components/schemas/GreedySamplingStrategy" + }, + { + "$ref": "#/components/schemas/TopPSamplingStrategy" + }, + { + "$ref": "#/components/schemas/TopKSamplingStrategy" + } + ], + "title": "Strategy", + "discriminator": { + "propertyName": "type", + "mapping": { + "greedy": "#/components/schemas/GreedySamplingStrategy", + "top_k": "#/components/schemas/TopKSamplingStrategy", + "top_p": "#/components/schemas/TopPSamplingStrategy" + } + } + }, + "max_tokens": { + "title": "Max Tokens", + "type": "integer" + }, + "repetition_penalty": { + "title": "Repetition Penalty", + "default": 1.0, + "type": "number" + }, + "stop": { + "title": "Stop", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "title": "SamplingParams", + "description": "Sampling parameters." + }, + "ScoreBatchResponse": { + "properties": { + "dataset_id": { + "title": "Dataset Id", + "type": "string" + }, + "results": { + "additionalProperties": { + "$ref": "#/components/schemas/ScoringResult" + }, + "type": "object", + "title": "Results" + } + }, + "type": "object", + "required": [ + "results" + ], + "title": "ScoreBatchResponse", + "description": "Response from batch scoring operations on datasets." + }, + "ScoreResponse": { + "properties": { + "results": { + "additionalProperties": { + "$ref": "#/components/schemas/ScoringResult" + }, + "type": "object", + "title": "Results" + } + }, + "type": "object", + "required": [ + "results" + ], + "title": "ScoreResponse", + "description": "The response from scoring." + }, + "ScoringFn-Output": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "scoring_function", + "title": "Type", + "default": "scoring_function" + }, + "description": { + "title": "Description", + "type": "string" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata", + "description": "Any additional metadata for this definition" + }, + "return_type": { + "oneOf": [ + { + "$ref": "#/components/schemas/StringType" + }, + { + "$ref": "#/components/schemas/NumberType" + }, + { + "$ref": "#/components/schemas/BooleanType" + }, + { + "$ref": "#/components/schemas/ArrayType" + }, + { + "$ref": "#/components/schemas/ObjectType" + }, + { + "$ref": "#/components/schemas/JsonType" + }, + { + "$ref": "#/components/schemas/UnionType" + }, + { + "$ref": "#/components/schemas/ChatCompletionInputType" + }, + { + "$ref": "#/components/schemas/CompletionInputType" + }, + { + "$ref": "#/components/schemas/AgentTurnInputType" + } + ], + "title": "Return Type", + "description": "The return type of the deterministic function", + "discriminator": { + "propertyName": "type", + "mapping": { + "agent_turn_input": "#/components/schemas/AgentTurnInputType", + "array": "#/components/schemas/ArrayType", + "boolean": "#/components/schemas/BooleanType", + "chat_completion_input": "#/components/schemas/ChatCompletionInputType", + "completion_input": "#/components/schemas/CompletionInputType", + "json": "#/components/schemas/JsonType", + "number": "#/components/schemas/NumberType", + "object": "#/components/schemas/ObjectType", + "string": "#/components/schemas/StringType", + "union": "#/components/schemas/UnionType" + } + } + }, + "params": { + "title": "Params", + "description": "The parameters for the scoring function for benchmark eval, these can be overridden for app eval", + "oneOf": [ + { + "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" + }, + { + "$ref": "#/components/schemas/RegexParserScoringFnParams" + }, + { + "$ref": "#/components/schemas/BasicScoringFnParams" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "basic": "#/components/schemas/BasicScoringFnParams", + "llm_as_judge": "#/components/schemas/LLMAsJudgeScoringFnParams", + "regex_parser": "#/components/schemas/RegexParserScoringFnParams" + } + } + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id", + "return_type" + ], + "title": "ScoringFn", + "description": "A scoring function resource for evaluating model outputs." + }, + "ScoringResult": { + "properties": { + "score_rows": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Score Rows" + }, + "aggregated_results": { + "additionalProperties": true, + "type": "object", + "title": "Aggregated Results" + } + }, + "type": "object", + "required": [ + "score_rows", + "aggregated_results" + ], + "title": "ScoringResult", + "description": "A scoring result for a single row." + }, + "SearchRankingOptions": { + "properties": { + "ranker": { + "title": "Ranker", + "type": "string" + }, + "score_threshold": { + "title": "Score Threshold", + "default": 0.0, + "type": "number" + } + }, + "type": "object", + "title": "SearchRankingOptions", + "description": "Options for ranking and filtering search results." + }, + "Shield": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "shield", + "title": "Type", + "default": "shield" + }, + "params": { + "title": "Params", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id" + ], + "title": "Shield", + "description": "A safety shield resource that can be used to check content." + }, + "ShieldCallStep-Output": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "step_id": { + "type": "string", + "title": "Step Id" + }, + "started_at": { + "title": "Started At", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + }, + "step_type": { + "type": "string", + "const": "shield_call", + "title": "Step Type", + "default": "shield_call" + }, + "violation": { + "$ref": "#/components/schemas/SafetyViolation" + } + }, + "type": "object", + "required": [ + "turn_id", + "step_id", + "violation" + ], + "title": "ShieldCallStep", + "description": "A shield call step in an agent turn." + }, + "StopReason": { + "type": "string", + "enum": [ + "end_of_turn", + "end_of_message", + "out_of_tokens" + ], + "title": "StopReason" + }, + "StringType": { + "properties": { + "type": { + "type": "string", + "const": "string", + "title": "Type", + "default": "string" + } + }, + "type": "object", + "title": "StringType", + "description": "Parameter type for string values." + }, + "SystemMessage": { + "properties": { + "role": { + "type": "string", + "const": "system", + "title": "Role", + "default": "system" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "SystemMessage", + "description": "A system message providing instructions or context to the model." + }, + "SystemMessageBehavior": { + "type": "string", + "enum": [ + "append", + "replace" + ], + "title": "SystemMessageBehavior", + "description": "Config for how to override the default system prompt." + }, + "TextContentItem": { + "properties": { + "type": { + "type": "string", + "const": "text", + "title": "Type", + "default": "text" + }, + "text": { + "type": "string", + "title": "Text" + } + }, + "type": "object", + "required": [ + "text" + ], + "title": "TextContentItem", + "description": "A text content item" + }, + "ToolCall": { + "properties": { + "call_id": { + "type": "string", + "title": "Call Id" + }, + "tool_name": { + "anyOf": [ + { + "$ref": "#/components/schemas/BuiltinTool" + }, + { + "type": "string" + } + ], + "title": "Tool Name" + }, + "arguments": { + "type": "string", + "title": "Arguments" + } + }, + "type": "object", + "required": [ + "call_id", + "tool_name", + "arguments" + ], + "title": "ToolCall" + }, + "ToolChoice": { + "type": "string", + "enum": [ + "auto", + "required", + "none" + ], + "title": "ToolChoice", + "description": "Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model." + }, + "ToolConfig": { + "properties": { + "tool_choice": { + "anyOf": [ + { + "$ref": "#/components/schemas/ToolChoice" + }, + { + "type": "string" + } + ], + "title": "Tool Choice", + "default": "auto" + }, + "tool_prompt_format": { + "$ref": "#/components/schemas/ToolPromptFormat" + }, + "system_message_behavior": { + "default": "append", + "$ref": "#/components/schemas/SystemMessageBehavior" + } + }, + "type": "object", + "title": "ToolConfig", + "description": "Configuration for tool use." + }, + "ToolDef": { + "properties": { + "toolgroup_id": { + "title": "Toolgroup Id", + "type": "string" + }, + "name": { + "type": "string", + "title": "Name" + }, + "description": { + "title": "Description", + "type": "string" + }, + "input_schema": { + "title": "Input Schema", + "additionalProperties": true, + "type": "object" + }, + "output_schema": { + "title": "Output Schema", + "additionalProperties": true, + "type": "object" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "required": [ + "name" + ], + "title": "ToolDef", + "description": "Tool definition used in runtime contexts." + }, + "ToolExecutionStep-Output": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "step_id": { + "type": "string", + "title": "Step Id" + }, + "started_at": { + "title": "Started At", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + }, + "step_type": { + "type": "string", + "const": "tool_execution", + "title": "Step Type", + "default": "tool_execution" + }, + "tool_calls": { + "items": { + "$ref": "#/components/schemas/ToolCall" + }, + "type": "array", + "title": "Tool Calls" + }, + "tool_responses": { + "items": { + "$ref": "#/components/schemas/ToolResponse-Output" + }, + "type": "array", + "title": "Tool Responses" + } + }, + "type": "object", + "required": [ + "turn_id", + "step_id", + "tool_calls", + "tool_responses" + ], + "title": "ToolExecutionStep", + "description": "A tool execution step in an agent turn." + }, + "ToolGroup": { + "properties": { + "identifier": { + "type": "string", + "title": "Identifier", + "description": "Unique identifier for this resource in llama stack" + }, + "provider_resource_id": { + "title": "Provider Resource Id", + "description": "Unique identifier for this resource in the provider", + "type": "string" + }, + "provider_id": { + "type": "string", + "title": "Provider Id", + "description": "ID of the provider that owns this resource" + }, + "type": { + "type": "string", + "const": "tool_group", + "title": "Type", + "default": "tool_group" + }, + "mcp_endpoint": { + "$ref": "#/components/schemas/URL" + }, + "args": { + "title": "Args", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "required": [ + "identifier", + "provider_id" + ], + "title": "ToolGroup", + "description": "A group of related tools managed together." + }, + "ToolInvocationResult": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "error_message": { + "title": "Error Message", + "type": "string" + }, + "error_code": { + "title": "Error Code", + "type": "integer" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "title": "ToolInvocationResult", + "description": "Result of a tool invocation." + }, + "ToolPromptFormat": { + "type": "string", + "enum": [ + "json", + "function_tag", + "python_list" + ], + "title": "ToolPromptFormat", + "description": "Prompt format for calling custom / zero shot tools." + }, + "ToolResponse-Input": { + "properties": { + "call_id": { + "type": "string", + "title": "Call Id" + }, + "tool_name": { + "anyOf": [ + { + "$ref": "#/components/schemas/BuiltinTool" + }, + { + "type": "string" + } + ], + "title": "Tool Name" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "required": [ + "call_id", + "tool_name", + "content" + ], + "title": "ToolResponse", + "description": "Response from a tool invocation." + }, + "ToolResponse-Output": { + "properties": { + "call_id": { + "type": "string", + "title": "Call Id" + }, + "tool_name": { + "anyOf": [ + { + "$ref": "#/components/schemas/BuiltinTool" + }, + { + "type": "string" + } + ], + "title": "Tool Name" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object" + } + }, + "type": "object", + "required": [ + "call_id", + "tool_name", + "content" + ], + "title": "ToolResponse", + "description": "Response from a tool invocation." + }, + "ToolResponseMessage-Output": { + "properties": { + "role": { + "type": "string", + "const": "tool", + "title": "Role", + "default": "tool" + }, + "call_id": { + "type": "string", + "title": "Call Id" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + } + }, + "type": "object", + "required": [ + "call_id", + "content" + ], + "title": "ToolResponseMessage", + "description": "A message representing the result of a tool invocation." + }, + "TopKSamplingStrategy": { + "properties": { + "type": { + "type": "string", + "const": "top_k", + "title": "Type", + "default": "top_k" + }, + "top_k": { + "type": "integer", + "minimum": 1.0, + "title": "Top K" + } + }, + "type": "object", + "required": [ + "top_k" + ], + "title": "TopKSamplingStrategy", + "description": "Top-k sampling strategy that restricts sampling to the k most likely tokens." + }, + "TopPSamplingStrategy": { + "properties": { + "type": { + "type": "string", + "const": "top_p", + "title": "Type", + "default": "top_p" + }, + "temperature": { + "title": "Temperature", + "type": "number", + "minimum": 0.0 + }, + "top_p": { + "title": "Top P", + "default": 0.95, + "type": "number" + } + }, + "type": "object", + "required": [ + "temperature" + ], + "title": "TopPSamplingStrategy", + "description": "Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p." + }, + "TrainingConfig": { + "properties": { + "n_epochs": { + "type": "integer", + "title": "N Epochs" + }, + "max_steps_per_epoch": { + "type": "integer", + "title": "Max Steps Per Epoch", + "default": 1 + }, + "gradient_accumulation_steps": { + "type": "integer", + "title": "Gradient Accumulation Steps", + "default": 1 + }, + "max_validation_steps": { + "title": "Max Validation Steps", + "default": 1, + "type": "integer" + }, + "data_config": { + "$ref": "#/components/schemas/DataConfig" + }, + "optimizer_config": { + "$ref": "#/components/schemas/OptimizerConfig" + }, + "efficiency_config": { + "$ref": "#/components/schemas/EfficiencyConfig" + }, + "dtype": { + "title": "Dtype", + "default": "bf16", + "type": "string" + } + }, + "type": "object", + "required": [ + "n_epochs" + ], + "title": "TrainingConfig", + "description": "Comprehensive configuration for the training process." + }, + "Turn": { + "properties": { + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "session_id": { + "type": "string", + "title": "Session Id" + }, + "input_messages": { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/UserMessage-Output" + }, + { + "$ref": "#/components/schemas/ToolResponseMessage-Output" + } + ] + }, + "type": "array", + "title": "Input Messages" + }, + "steps": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InferenceStep-Output" + }, + { + "$ref": "#/components/schemas/ToolExecutionStep-Output" + }, + { + "$ref": "#/components/schemas/ShieldCallStep-Output" + }, + { + "$ref": "#/components/schemas/MemoryRetrievalStep-Output" + } + ], + "discriminator": { + "propertyName": "step_type", + "mapping": { + "inference": "#/components/schemas/InferenceStep-Output", + "memory_retrieval": "#/components/schemas/MemoryRetrievalStep-Output", + "shield_call": "#/components/schemas/ShieldCallStep-Output", + "tool_execution": "#/components/schemas/ToolExecutionStep-Output" + } + } + }, + "type": "array", + "title": "Steps" + }, + "output_message": { + "$ref": "#/components/schemas/CompletionMessage-Output" + }, + "output_attachments": { + "title": "Output Attachments", + "items": { + "$ref": "#/components/schemas/Attachment-Output" + }, + "type": "array" + }, + "started_at": { + "type": "string", + "format": "date-time", + "title": "Started At" + }, + "completed_at": { + "title": "Completed At", + "type": "string", + "format": "date-time" + } + }, + "type": "object", + "required": [ + "turn_id", + "session_id", + "input_messages", + "steps", + "output_message", + "started_at" + ], + "title": "Turn", + "description": "A single turn in an interaction with an Agentic System." + }, + "URIDataSource": { + "properties": { + "type": { + "type": "string", + "const": "uri", + "title": "Type", + "default": "uri" + }, + "uri": { + "type": "string", + "title": "Uri" + } + }, + "type": "object", + "required": [ + "uri" + ], + "title": "URIDataSource", + "description": "A dataset that can be obtained from a URI." + }, + "URL": { + "properties": { + "uri": { + "type": "string", + "title": "Uri" + } + }, + "type": "object", + "required": [ + "uri" + ], + "title": "URL", + "description": "A URL reference to external content." + }, + "UnionType": { + "properties": { + "type": { + "type": "string", + "const": "union", + "title": "Type", + "default": "union" + } + }, + "type": "object", + "title": "UnionType", + "description": "Parameter type for union values." + }, + "UserMessage-Input": { + "properties": { + "role": { + "type": "string", + "const": "user", + "title": "Role", + "default": "user" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "context": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Input" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Input", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Context" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "UserMessage", + "description": "A message from the user in a chat conversation." + }, + "UserMessage-Output": { + "properties": { + "role": { + "type": "string", + "const": "user", + "title": "Role", + "default": "user" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Content" + }, + "context": { + "anyOf": [ + { + "type": "string" + }, + { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem-Output" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem-Output", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "type": "array" + } + ], + "title": "Context" + } + }, + "type": "object", + "required": [ + "content" + ], + "title": "UserMessage", + "description": "A message from the user in a chat conversation." + }, + "VectorStoreChunkingStrategyAuto": { + "properties": { + "type": { + "type": "string", + "const": "auto", + "title": "Type", + "default": "auto" + } + }, + "type": "object", + "title": "VectorStoreChunkingStrategyAuto", + "description": "Automatic chunking strategy for vector store files." + }, + "VectorStoreChunkingStrategyStatic": { + "properties": { + "type": { + "type": "string", + "const": "static", + "title": "Type", + "default": "static" + }, + "static": { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyStaticConfig" + } + }, + "type": "object", + "required": [ + "static" + ], + "title": "VectorStoreChunkingStrategyStatic", + "description": "Static chunking strategy with configurable parameters." + }, + "VectorStoreChunkingStrategyStaticConfig": { + "properties": { + "chunk_overlap_tokens": { + "type": "integer", + "title": "Chunk Overlap Tokens", + "default": 400 + }, + "max_chunk_size_tokens": { + "type": "integer", + "maximum": 4096.0, + "minimum": 100.0, + "title": "Max Chunk Size Tokens", + "default": 800 + } + }, + "type": "object", + "title": "VectorStoreChunkingStrategyStaticConfig", + "description": "Configuration for static chunking strategy." + }, + "VectorStoreContent": { + "properties": { + "type": { + "type": "string", + "const": "text", + "title": "Type" + }, + "text": { + "type": "string", + "title": "Text" + } + }, + "type": "object", + "required": [ + "type", + "text" + ], + "title": "VectorStoreContent", + "description": "Content item from a vector store file or search result." + }, + "VectorStoreFileBatchObject": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "object": { + "type": "string", + "title": "Object", + "default": "vector_store.file_batch" + }, + "created_at": { + "type": "integer", + "title": "Created At" + }, + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "status": { + "anyOf": [ + { + "type": "string", + "const": "completed" + }, + { + "type": "string", + "const": "in_progress" + }, + { + "type": "string", + "const": "cancelled" + }, + { + "type": "string", + "const": "failed" + } + ], + "title": "Status" + }, + "file_counts": { + "$ref": "#/components/schemas/VectorStoreFileCounts" + } + }, + "type": "object", + "required": [ + "id", + "created_at", + "vector_store_id", + "status", + "file_counts" + ], + "title": "VectorStoreFileBatchObject", + "description": "OpenAI Vector Store File Batch object." + }, + "VectorStoreFileCounts": { + "properties": { + "completed": { + "type": "integer", + "title": "Completed" + }, + "cancelled": { + "type": "integer", + "title": "Cancelled" + }, + "failed": { + "type": "integer", + "title": "Failed" + }, + "in_progress": { + "type": "integer", + "title": "In Progress" + }, + "total": { + "type": "integer", + "title": "Total" + } + }, + "type": "object", + "required": [ + "completed", + "cancelled", + "failed", + "in_progress", + "total" + ], + "title": "VectorStoreFileCounts", + "description": "File processing status counts for a vector store." + }, + "VectorStoreFileLastError": { + "properties": { + "code": { + "anyOf": [ + { + "type": "string", + "const": "server_error" + }, + { + "type": "string", + "const": "rate_limit_exceeded" + } + ], + "title": "Code" + }, + "message": { + "type": "string", + "title": "Message" + } + }, + "type": "object", + "required": [ + "code", + "message" + ], + "title": "VectorStoreFileLastError", + "description": "Error information for failed vector store file processing." + }, + "VectorStoreFileObject": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "object": { + "type": "string", + "title": "Object", + "default": "vector_store.file" + }, + "attributes": { + "additionalProperties": true, + "type": "object", + "title": "Attributes" + }, + "chunking_strategy": { + "oneOf": [ + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" + }, + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + ], + "title": "Chunking Strategy", + "discriminator": { + "propertyName": "type", + "mapping": { + "auto": "#/components/schemas/VectorStoreChunkingStrategyAuto", + "static": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + } + }, + "created_at": { + "type": "integer", + "title": "Created At" + }, + "last_error": { + "$ref": "#/components/schemas/VectorStoreFileLastError" + }, + "status": { + "anyOf": [ + { + "type": "string", + "const": "completed" + }, + { + "type": "string", + "const": "in_progress" + }, + { + "type": "string", + "const": "cancelled" + }, + { + "type": "string", + "const": "failed" + } + ], + "title": "Status" + }, + "usage_bytes": { + "type": "integer", + "title": "Usage Bytes", + "default": 0 + }, + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + } + }, + "type": "object", + "required": [ + "id", + "chunking_strategy", + "created_at", + "status", + "vector_store_id" + ], + "title": "VectorStoreFileObject", + "description": "OpenAI Vector Store File object." + }, + "VectorStoreObject": { + "properties": { + "id": { + "type": "string", + "title": "Id" + }, + "object": { + "type": "string", + "title": "Object", + "default": "vector_store" + }, + "created_at": { + "type": "integer", + "title": "Created At" + }, + "name": { + "title": "Name", + "type": "string" + }, + "usage_bytes": { + "type": "integer", + "title": "Usage Bytes", + "default": 0 + }, + "file_counts": { + "$ref": "#/components/schemas/VectorStoreFileCounts" + }, + "status": { + "type": "string", + "title": "Status", + "default": "completed" + }, + "expires_after": { + "title": "Expires After", + "additionalProperties": true, + "type": "object" + }, + "expires_at": { + "title": "Expires At", + "type": "integer" + }, + "last_active_at": { + "title": "Last Active At", + "type": "integer" + }, + "metadata": { + "additionalProperties": true, + "type": "object", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "id", + "created_at", + "file_counts" + ], + "title": "VectorStoreObject", + "description": "OpenAI Vector Store object." + }, + "VectorStoreSearchResponse": { + "properties": { + "file_id": { + "type": "string", + "title": "File Id" + }, + "filename": { + "type": "string", + "title": "Filename" + }, + "score": { + "type": "number", + "title": "Score" + }, + "attributes": { + "title": "Attributes", + "additionalProperties": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "type": "object" + }, + "content": { + "items": { + "$ref": "#/components/schemas/VectorStoreContent" + }, + "type": "array", + "title": "Content" + } + }, + "type": "object", + "required": [ + "file_id", + "filename", + "score", + "content" + ], + "title": "VectorStoreSearchResponse", + "description": "Response from searching a vector store." + }, + "VectorStoreSearchResponsePage": { + "properties": { + "object": { + "type": "string", + "title": "Object", + "default": "vector_store.search_results.page" + }, + "search_query": { + "type": "string", + "title": "Search Query" + }, + "data": { + "items": { + "$ref": "#/components/schemas/VectorStoreSearchResponse" + }, + "type": "array", + "title": "Data" + }, + "has_more": { + "type": "boolean", + "title": "Has More", + "default": false + }, + "next_page": { + "title": "Next Page", + "type": "string" + } + }, + "type": "object", + "required": [ + "search_query", + "data" + ], + "title": "VectorStoreSearchResponsePage", + "description": "Paginated response from searching a vector store." + }, + "VersionInfo": { + "properties": { + "version": { + "type": "string", + "title": "Version" + } + }, + "type": "object", + "required": [ + "version" + ], + "title": "VersionInfo", + "description": "Version information for the service." + }, + "ViolationLevel": { + "type": "string", + "enum": [ + "info", + "warn", + "error" + ], + "title": "ViolationLevel", + "description": "Severity level of a safety violation." + }, + "WeightedRanker": { + "properties": { + "type": { + "type": "string", + "const": "weighted", + "title": "Type", + "default": "weighted" + }, + "alpha": { + "type": "number", + "maximum": 1.0, + "minimum": 0.0, + "title": "Alpha", + "description": "Weight factor between 0 and 1. 0 means only keyword scores, 1 means only vector scores.", + "default": 0.5 + } + }, + "type": "object", + "title": "WeightedRanker", + "description": "Weighted ranker configuration that combines vector and keyword scores." + }, + "_URLOrData": { + "properties": { + "url": { + "$ref": "#/components/schemas/URL" + }, + "data": { + "contentEncoding": "base64", + "title": "Data", + "type": "string" + } + }, + "type": "object", + "title": "_URLOrData", + "description": "A URL or a base64 encoded string" + }, + "__main_____agents_agent_id_session_Request": { + "properties": { + "agent_id": { + "type": "string", + "title": "Agent Id" + }, + "session_name": { + "type": "string", + "title": "Session Name" + } + }, + "type": "object", + "required": [ + "agent_id", + "session_name" + ], + "title": "_agents_agent_id_session_Request" + }, + "__main_____agents_agent_id_session_session_id_turn_Request": { + "properties": { + "agent_id": { + "type": "string", + "title": "Agent Id" + }, + "session_id": { + "type": "string", + "title": "Session Id" + }, + "messages": { + "$ref": "#/components/schemas/UserMessage-Input" + }, + "stream": { + "type": "boolean", + "title": "Stream", + "default": false + }, + "documents": { + "$ref": "#/components/schemas/Document" + }, + "toolgroups": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/AgentToolGroupWithArgs" + } + ], + "title": "Toolgroups" + }, + "tool_config": { + "$ref": "#/components/schemas/ToolConfig" + } + }, + "type": "object", + "required": [ + "agent_id", + "session_id", + "messages", + "documents", + "toolgroups", + "tool_config" + ], + "title": "_agents_agent_id_session_session_id_turn_Request" + }, + "__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request": { + "properties": { + "agent_id": { + "type": "string", + "title": "Agent Id" + }, + "session_id": { + "type": "string", + "title": "Session Id" + }, + "turn_id": { + "type": "string", + "title": "Turn Id" + }, + "tool_responses": { + "$ref": "#/components/schemas/ToolResponse-Input" + }, + "stream": { + "type": "boolean", + "title": "Stream", + "default": false + } + }, + "type": "object", + "required": [ + "agent_id", + "session_id", + "turn_id", + "tool_responses" + ], + "title": "_agents_agent_id_session_session_id_turn_turn_id_resume_Request" + }, + "__main_____datasets_Request": { + "properties": { + "purpose": { + "$ref": "#/components/schemas/DatasetPurpose" + }, + "metadata": { + "type": "string", + "title": "Metadata" + }, + "dataset_id": { + "type": "string", + "title": "Dataset Id" + } + }, + "type": "object", + "required": [ + "purpose", + "metadata", + "dataset_id" + ], + "title": "_datasets_Request" + }, + "_batches_Request": { + "properties": { + "input_file_id": { + "type": "string", + "title": "Input File Id" + }, + "endpoint": { + "type": "string", + "title": "Endpoint" + }, + "completion_window": { + "type": "string", + "title": "Completion Window" + }, + "metadata": { + "type": "string", + "title": "Metadata" + }, + "idempotency_key": { + "type": "string", + "title": "Idempotency Key" + } + }, + "type": "object", + "required": [ + "input_file_id", + "endpoint", + "completion_window", + "metadata", + "idempotency_key" + ], + "title": "_batches_Request" + }, + "_batches_batch_id_cancel_Request": { + "properties": { + "batch_id": { + "type": "string", + "title": "Batch Id" + } + }, + "type": "object", + "required": [ + "batch_id" + ], + "title": "_batches_batch_id_cancel_Request" + }, + "_conversations_Request": { + "properties": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage-Input" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + } + ], + "title": "Items", + "discriminator": { + "propertyName": "type", + "mapping": { + "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", + "function_call_output": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput", + "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", + "mcp_approval_response": "#/components/schemas/OpenAIResponseMCPApprovalResponse", + "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", + "message": "#/components/schemas/OpenAIResponseMessage-Input", + "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + } + } + }, + "metadata": { + "type": "string", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "items", + "metadata" + ], + "title": "_conversations_Request" + }, + "_conversations_conversation_id_Request": { + "properties": { + "conversation_id": { + "type": "string", + "title": "Conversation Id" + }, + "metadata": { + "type": "string", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "conversation_id", + "metadata" + ], + "title": "_conversations_conversation_id_Request" + }, + "_conversations_conversation_id_items_Request": { + "properties": { + "conversation_id": { + "type": "string", + "title": "Conversation Id" + }, + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage-Input" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + } + ], + "title": "Items" + } + }, + "type": "object", + "required": [ + "conversation_id", + "items" + ], + "title": "_conversations_conversation_id_items_Request" + }, + "_inference_rerank_Request": { + "properties": { + "model": { + "type": "string", + "title": "Model" + }, + "query": { + "type": "string", + "title": "Query" + }, + "items": { + "type": "string", + "title": "Items" + }, + "max_num_results": { + "type": "integer", + "title": "Max Num Results" + } + }, + "type": "object", + "required": [ + "model", + "query", + "items", + "max_num_results" + ], + "title": "_inference_rerank_Request" + }, + "_models_Request": { + "properties": { + "model_id": { + "type": "string", + "title": "Model Id" + }, + "provider_model_id": { + "type": "string", + "title": "Provider Model Id" + }, + "provider_id": { + "type": "string", + "title": "Provider Id" + }, + "metadata": { + "type": "string", + "title": "Metadata" + }, + "model_type": { + "$ref": "#/components/schemas/ModelType" + } + }, + "type": "object", + "required": [ + "model_id", + "provider_model_id", + "provider_id", + "metadata", + "model_type" + ], + "title": "_models_Request" + }, + "_moderations_Request": { + "properties": { + "input": { + "type": "string", + "title": "Input" + }, + "model": { + "type": "string", + "title": "Model" + } + }, + "type": "object", + "required": [ + "input", + "model" + ], + "title": "_moderations_Request" + }, + "_prompts_Request": { + "properties": { + "prompt": { + "type": "string", + "title": "Prompt" + }, + "variables": { + "type": "string", + "title": "Variables" + } + }, + "type": "object", + "required": [ + "prompt", + "variables" + ], + "title": "_prompts_Request" + }, + "_prompts_prompt_id_Request": { + "properties": { + "prompt_id": { + "type": "string", + "title": "Prompt Id" + }, + "prompt": { + "type": "string", + "title": "Prompt" + }, + "version": { + "type": "integer", + "title": "Version" + }, + "variables": { + "type": "string", + "title": "Variables" + }, + "set_as_default": { + "type": "boolean", + "title": "Set As Default", + "default": true + } + }, + "type": "object", + "required": [ + "prompt_id", + "prompt", + "version", + "variables" + ], + "title": "_prompts_prompt_id_Request" + }, + "_prompts_prompt_id_set_default_version_Request": { + "properties": { + "prompt_id": { + "type": "string", + "title": "Prompt Id" + }, + "version": { + "type": "integer", + "title": "Version" + } + }, + "type": "object", + "required": [ + "prompt_id", + "version" + ], + "title": "_prompts_prompt_id_set_default_version_Request" + }, + "_responses_Request": { + "properties": { + "input": { + "type": "string", + "title": "Input" + }, + "model": { + "type": "string", + "title": "Model" + }, + "prompt": { + "$ref": "#/components/schemas/OpenAIResponsePrompt" + }, + "instructions": { + "type": "string", + "title": "Instructions" + }, + "previous_response_id": { + "type": "string", + "title": "Previous Response Id" + }, + "conversation": { + "type": "string", + "title": "Conversation" + }, + "store": { + "type": "boolean", + "title": "Store", + "default": true + }, + "stream": { + "type": "boolean", + "title": "Stream", + "default": false + }, + "temperature": { + "type": "number", + "title": "Temperature" + }, + "text": { + "$ref": "#/components/schemas/OpenAIResponseText" + }, + "tools": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolMCP" + } + ], + "title": "Tools", + "discriminator": { + "propertyName": "type", + "mapping": { + "file_search": "#/components/schemas/OpenAIResponseInputToolFileSearch", + "function": "#/components/schemas/OpenAIResponseInputToolFunction", + "mcp": "#/components/schemas/OpenAIResponseInputToolMCP", + "web_search": "#/components/schemas/OpenAIResponseInputToolWebSearch", + "web_search_preview": "#/components/schemas/OpenAIResponseInputToolWebSearch", + "web_search_preview_2025_03_11": "#/components/schemas/OpenAIResponseInputToolWebSearch" + } + } + }, + "include": { + "type": "string", + "title": "Include" + }, + "max_infer_iters": { + "type": "integer", + "title": "Max Infer Iters", + "default": 10 + } + }, + "type": "object", + "required": [ + "input", + "model", + "prompt", + "instructions", + "previous_response_id", + "conversation", + "temperature", + "text", + "tools", + "include" + ], + "title": "_responses_Request" + }, + "_scoring_score_Request": { + "properties": { + "input_rows": { + "type": "string", + "title": "Input Rows" + }, + "scoring_functions": { + "type": "string", + "title": "Scoring Functions" + } + }, + "type": "object", + "required": [ + "input_rows", + "scoring_functions" + ], + "title": "_scoring_score_Request" + }, + "_scoring_score_batch_Request": { + "properties": { + "dataset_id": { + "type": "string", + "title": "Dataset Id" + }, + "scoring_functions": { + "type": "string", + "title": "Scoring Functions" + }, + "save_results_dataset": { + "type": "boolean", + "title": "Save Results Dataset", + "default": false + } + }, + "type": "object", + "required": [ + "dataset_id", + "scoring_functions" + ], + "title": "_scoring_score_batch_Request" + }, + "_shields_Request": { + "properties": { + "shield_id": { + "type": "string", + "title": "Shield Id" + }, + "provider_shield_id": { + "type": "string", + "title": "Provider Shield Id" + }, + "provider_id": { + "type": "string", + "title": "Provider Id" + }, + "params": { + "type": "string", + "title": "Params" + } + }, + "type": "object", + "required": [ + "shield_id", + "provider_shield_id", + "provider_id", + "params" + ], + "title": "_shields_Request" + }, + "_tool_runtime_invoke_Request": { + "properties": { + "tool_name": { + "type": "string", + "title": "Tool Name" + }, + "kwargs": { + "type": "string", + "title": "Kwargs" + } + }, + "type": "object", + "required": [ + "tool_name", + "kwargs" + ], + "title": "_tool_runtime_invoke_Request" + }, + "_tool_runtime_rag_tool_query_Request": { + "properties": { + "content": { + "type": "string", + "title": "Content" + }, + "vector_store_ids": { + "type": "string", + "title": "Vector Store Ids" + }, + "query_config": { + "$ref": "#/components/schemas/RAGQueryConfig" + } + }, + "type": "object", + "required": [ + "content", + "vector_store_ids", + "query_config" + ], + "title": "_tool_runtime_rag_tool_query_Request" + }, + "_vector_io_query_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "query": { + "type": "string", + "title": "Query" + }, + "params": { + "type": "string", + "title": "Params" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "query", + "params" + ], + "title": "_vector_io_query_Request" + }, + "_vector_stores_vector_store_id_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "expires_after": { + "type": "string", + "title": "Expires After" + }, + "metadata": { + "type": "string", + "title": "Metadata" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "name", + "expires_after", + "metadata" + ], + "title": "_vector_stores_vector_store_id_Request" + }, + "_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request": { + "properties": { + "batch_id": { + "type": "string", + "title": "Batch Id" + }, + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + } + }, + "type": "object", + "required": [ + "batch_id", + "vector_store_id" + ], + "title": "_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request" + }, + "_vector_stores_vector_store_id_files_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "attributes": { + "type": "string", + "title": "Attributes" + }, + "chunking_strategy": { + "anyOf": [ + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" + }, + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + ], + "title": "Chunking Strategy" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "file_id", + "attributes", + "chunking_strategy" + ], + "title": "_vector_stores_vector_store_id_files_Request" + }, + "_vector_stores_vector_store_id_files_file_id_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "file_id": { + "type": "string", + "title": "File Id" + }, + "attributes": { + "type": "string", + "title": "Attributes" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "file_id", + "attributes" + ], + "title": "_vector_stores_vector_store_id_files_file_id_Request" + }, + "_vector_stores_vector_store_id_search_Request": { + "properties": { + "vector_store_id": { + "type": "string", + "title": "Vector Store Id" + }, + "query": { + "type": "string", + "title": "Query" + }, + "filters": { + "type": "string", + "title": "Filters" + }, + "max_num_results": { + "type": "integer", + "title": "Max Num Results", + "default": 10 + }, + "ranking_options": { + "$ref": "#/components/schemas/SearchRankingOptions" + }, + "rewrite_query": { + "type": "boolean", + "title": "Rewrite Query", + "default": false + }, + "search_mode": { + "type": "string", + "title": "Search Mode", + "default": "vector" + } + }, + "type": "object", + "required": [ + "vector_store_id", + "query", + "filters", + "ranking_options" + ], + "title": "_vector_stores_vector_store_id_search_Request" + }, + "Error": { + "description": "Error response from the API. Roughly follows RFC 7807.", + "properties": { + "status": { + "title": "Status", + "type": "integer" + }, + "title": { + "title": "Title", + "type": "string" + }, + "detail": { + "title": "Detail", + "type": "string" + }, + "instance": { + "title": "Instance", + "type": "string", + "nullable": true + } + }, + "required": [ + "status", + "title", + "detail" + ], + "title": "Error", + "type": "object" + }, + "Agent": { + "description": "An agent instance with configuration and metadata.", + "properties": { + "agent_id": { + "title": "Agent Id", + "type": "string" + }, + "agent_config": { + "$ref": "#/components/schemas/AgentConfig" + }, + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + } + }, + "required": [ + "agent_id", + "agent_config", + "created_at" + ], + "title": "Agent", + "type": "object" + }, + "AgentStepResponse": { + "description": "Response containing details of a specific agent step.", + "properties": { + "step": { + "discriminator": { + "mapping": { + "inference": "#/$defs/InferenceStep", + "memory_retrieval": "#/$defs/MemoryRetrievalStep", + "shield_call": "#/$defs/ShieldCallStep", + "tool_execution": "#/$defs/ToolExecutionStep" + }, + "propertyName": "step_type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/InferenceStep" + }, + { + "$ref": "#/components/schemas/ToolExecutionStep" + }, + { + "$ref": "#/components/schemas/ShieldCallStep" + }, + { + "$ref": "#/components/schemas/MemoryRetrievalStep" + } + ], + "title": "Step" + } + }, + "required": [ + "step" + ], + "title": "AgentStepResponse", + "type": "object" + }, + "CompletionMessage": { + "description": "A message containing the model's (assistant) response in a chat conversation.", + "properties": { + "role": { + "const": "assistant", + "default": "assistant", + "title": "Role", + "type": "string" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + { + "items": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + "type": "array" + } + ], + "title": "Content" + }, + "stop_reason": { + "$ref": "#/components/schemas/StopReason" + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/ToolCall" + }, + "type": "array" + } + }, + "required": [ + "content", + "stop_reason" + ], + "title": "CompletionMessage", + "type": "object" + }, + "InferenceStep": { + "description": "An inference step in an agent turn.", + "properties": { + "turn_id": { + "title": "Turn Id", + "type": "string" + }, + "step_id": { + "title": "Step Id", + "type": "string" + }, + "started_at": { + "title": "Started At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "completed_at": { + "title": "Completed At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "step_type": { + "const": "inference", + "default": "inference", + "title": "Step Type", + "type": "string" + }, + "model_response": { + "$ref": "#/components/schemas/CompletionMessage" + } + }, + "required": [ + "turn_id", + "step_id", + "model_response" + ], + "title": "InferenceStep", + "type": "object" + }, + "ListOpenAIResponseInputItem": { + "description": "List container for OpenAI response input items.", + "properties": { + "data": { + "items": { + "anyOf": [ + { + "discriminator": { + "mapping": { + "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", + "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", + "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", + "message": "#/$defs/OpenAIResponseMessage", + "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + } + ] + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + } + ] + }, + "title": "Data", + "type": "array" + }, + "object": { + "const": "list", + "default": "list", + "title": "Object", + "type": "string" + } + }, + "required": [ + "data" + ], + "title": "ListOpenAIResponseInputItem", + "type": "object" + }, + "ListOpenAIResponseObject": { + "description": "Paginated list of OpenAI response objects with navigation metadata.", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/OpenAIResponseObjectWithInput" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "first_id": { + "title": "First Id", + "type": "string" + }, + "last_id": { + "title": "Last Id", + "type": "string" + }, + "object": { + "const": "list", + "default": "list", + "title": "Object", + "type": "string" + } + }, + "required": [ + "data", + "has_more", + "first_id", + "last_id" + ], + "title": "ListOpenAIResponseObject", + "type": "object" + }, + "MemoryRetrievalStep": { + "description": "A memory retrieval step in an agent turn.", + "properties": { + "turn_id": { + "title": "Turn Id", + "type": "string" + }, + "step_id": { + "title": "Step Id", + "type": "string" + }, + "started_at": { + "title": "Started At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "completed_at": { + "title": "Completed At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "step_type": { + "const": "memory_retrieval", + "default": "memory_retrieval", + "title": "Step Type", + "type": "string" + }, + "vector_store_ids": { + "title": "Vector Store Ids", + "type": "string" + }, + "inserted_context": { + "anyOf": [ + { + "type": "string" + }, + { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + { + "items": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + "type": "array" + } + ], + "title": "Inserted Context" + } + }, + "required": [ + "turn_id", + "step_id", + "vector_store_ids", + "inserted_context" + ], + "title": "MemoryRetrievalStep", + "type": "object" + }, + "OpenAIDeleteResponseObject": { + "description": "Response object confirming deletion of an OpenAI response.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "object": { + "const": "response", + "default": "response", + "title": "Object", + "type": "string" + }, + "deleted": { + "default": true, + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id" + ], + "title": "OpenAIDeleteResponseObject", + "type": "object" + }, + "PaginatedResponse": { + "description": "A generic paginated response that follows a simple format.", + "properties": { + "data": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "url": { + "title": "Url", + "type": "string", + "nullable": true + } + }, + "required": [ + "data", + "has_more" + ], + "title": "PaginatedResponse", + "type": "object" + }, + "Session": { + "description": "A single session of an interaction with an Agentic System.", + "properties": { + "session_id": { + "title": "Session Id", + "type": "string" + }, + "session_name": { + "title": "Session Name", + "type": "string" + }, + "turns": { + "items": { + "$ref": "#/components/schemas/Turn" + }, + "title": "Turns", + "type": "array" + }, + "started_at": { + "format": "date-time", + "title": "Started At", + "type": "string" + } + }, + "required": [ + "session_id", + "session_name", + "turns", + "started_at" + ], + "title": "Session", + "type": "object" + }, + "ShieldCallStep": { + "description": "A shield call step in an agent turn.", + "properties": { + "turn_id": { + "title": "Turn Id", + "type": "string" + }, + "step_id": { + "title": "Step Id", + "type": "string" + }, + "started_at": { + "title": "Started At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "completed_at": { + "title": "Completed At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "step_type": { + "const": "shield_call", + "default": "shield_call", + "title": "Step Type", + "type": "string" + }, + "violation": { + "$ref": "#/components/schemas/SafetyViolation" + } + }, + "required": [ + "turn_id", + "step_id", + "violation" + ], + "title": "ShieldCallStep", + "type": "object" + }, + "ToolExecutionStep": { + "description": "A tool execution step in an agent turn.", + "properties": { + "turn_id": { + "title": "Turn Id", + "type": "string" + }, + "step_id": { + "title": "Step Id", + "type": "string" + }, + "started_at": { + "title": "Started At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "completed_at": { + "title": "Completed At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "step_type": { + "const": "tool_execution", + "default": "tool_execution", + "title": "Step Type", + "type": "string" + }, + "tool_calls": { + "items": { + "$ref": "#/components/schemas/ToolCall" + }, + "title": "Tool Calls", + "type": "array" + }, + "tool_responses": { + "items": { + "$ref": "#/components/schemas/ToolResponse" + }, + "title": "Tool Responses", + "type": "array" + } + }, + "required": [ + "turn_id", + "step_id", + "tool_calls", + "tool_responses" + ], + "title": "ToolExecutionStep", + "type": "object" + }, + "ToolResponse": { + "description": "Response from a tool invocation.", + "properties": { + "call_id": { + "title": "Call Id", + "type": "string" + }, + "tool_name": { + "anyOf": [ + { + "$ref": "#/components/schemas/BuiltinTool" + }, + { + "type": "string" + } + ], + "title": "Tool Name" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + { + "items": { + "discriminator": { + "mapping": { + "image": "#/$defs/ImageContentItem", + "text": "#/$defs/TextContentItem" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ] + }, + "type": "array" + } + ], + "title": "Content" + }, + "metadata": { + "title": "Metadata", + "additionalProperties": true, + "type": "object", + "nullable": true + } + }, + "required": [ + "call_id", + "tool_name", + "content" + ], + "title": "ToolResponse", + "type": "object" + }, + "ListBatchesResponse": { + "description": "Response containing a list of batch objects.", + "properties": { + "object": { + "const": "list", + "default": "list", + "title": "Object", + "type": "string" + }, + "data": { + "description": "List of batch objects", + "items": { + "$ref": "#/components/schemas/Batch" + }, + "title": "Data", + "type": "array" + }, + "first_id": { + "description": "ID of the first batch in the list", + "title": "First Id", + "type": "string", + "nullable": true + }, + "last_id": { + "description": "ID of the last batch in the list", + "title": "Last Id", + "type": "string", + "nullable": true + }, + "has_more": { + "default": false, + "description": "Whether there are more batches available", + "title": "Has More", + "type": "boolean" + } + }, + "required": [ + "data" + ], + "title": "ListBatchesResponse", + "type": "object" + }, + "ConversationDeletedResource": { + "description": "Response for deleted conversation.", + "properties": { + "id": { + "description": "The deleted conversation identifier", + "title": "Id", + "type": "string" + }, + "object": { + "default": "conversation.deleted", + "description": "Object type", + "title": "Object", + "type": "string" + }, + "deleted": { + "default": true, + "description": "Whether the object was deleted", + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id" + ], + "title": "ConversationDeletedResource", + "type": "object" + }, + "ConversationItemDeletedResource": { + "description": "Response for deleted conversation item.", + "properties": { + "id": { + "description": "The deleted item identifier", + "title": "Id", + "type": "string" + }, + "object": { + "default": "conversation.item.deleted", + "description": "Object type", + "title": "Object", + "type": "string" + }, + "deleted": { + "default": true, + "description": "Whether the object was deleted", + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id" + ], + "title": "ConversationItemDeletedResource", + "type": "object" + }, + "ListOpenAIFileResponse": { + "description": "Response for listing files in OpenAI Files API.", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/OpenAIFileObject" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "first_id": { + "title": "First Id", + "type": "string" + }, + "last_id": { + "title": "Last Id", + "type": "string" + }, + "object": { + "const": "list", + "default": "list", + "title": "Object", + "type": "string" + } + }, + "required": [ + "data", + "has_more", + "first_id", + "last_id" + ], + "title": "ListOpenAIFileResponse", + "type": "object" + }, + "OpenAIFileDeleteResponse": { + "description": "Response for deleting a file in OpenAI Files API.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "object": { + "const": "file", + "default": "file", + "title": "Object", + "type": "string" + }, + "deleted": { + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id", + "deleted" + ], + "title": "OpenAIFileDeleteResponse", + "type": "object" + }, + "ListOpenAIChatCompletionResponse": { + "description": "Response from listing OpenAI-compatible chat completions.", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/OpenAICompletionWithInputMessages" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "title": "Has More", + "type": "boolean" + }, + "first_id": { + "title": "First Id", + "type": "string" + }, + "last_id": { + "title": "Last Id", + "type": "string" + }, + "object": { + "const": "list", + "default": "list", + "title": "Object", + "type": "string" + } + }, + "required": [ + "data", + "has_more", + "first_id", + "last_id" + ], + "title": "ListOpenAIChatCompletionResponse", + "type": "object" + }, + "OpenAIAssistantMessageParam": { + "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.", + "properties": { + "role": { + "const": "assistant", + "default": "assistant", + "title": "Role", + "type": "string" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + "type": "array" + } + ], + "title": "Content", + "nullable": true + }, + "name": { + "title": "Name", + "type": "string", + "nullable": true + }, + "tool_calls": { + "title": "Tool Calls", + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" + }, + "type": "array", + "nullable": true + } + }, + "title": "OpenAIAssistantMessageParam", + "type": "object" + }, + "OpenAIChoice": { + "description": "A choice from an OpenAI-compatible chat completion response.", + "properties": { + "message": { + "discriminator": { + "mapping": { + "assistant": "#/$defs/OpenAIAssistantMessageParam", + "developer": "#/$defs/OpenAIDeveloperMessageParam", + "system": "#/$defs/OpenAISystemMessageParam", + "tool": "#/$defs/OpenAIToolMessageParam", + "user": "#/$defs/OpenAIUserMessageParam" + }, + "propertyName": "role" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIUserMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAISystemMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIAssistantMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIToolMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" + } + ], + "title": "Message" + }, + "finish_reason": { + "title": "Finish Reason", + "type": "string" + }, + "index": { + "title": "Index", + "type": "integer" + }, + "logprobs": { + "$ref": "#/components/schemas/OpenAIChoiceLogprobs", + "nullable": true + } + }, + "required": [ + "message", + "finish_reason", + "index" + ], + "title": "OpenAIChoice", + "type": "object" + }, + "OpenAIChoiceLogprobs": { + "description": "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response.", + "properties": { + "content": { + "title": "Content", + "items": { + "$ref": "#/components/schemas/OpenAITokenLogProb" + }, + "type": "array", + "nullable": true + }, + "refusal": { + "title": "Refusal", + "items": { + "$ref": "#/components/schemas/OpenAITokenLogProb" + }, + "type": "array", + "nullable": true + } + }, + "title": "OpenAIChoiceLogprobs", + "type": "object" + }, + "OpenAICompletionWithInputMessages": { + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "choices": { + "items": { + "$ref": "#/components/schemas/OpenAIChoice" + }, + "title": "Choices", + "type": "array" + }, + "object": { + "const": "chat.completion", + "default": "chat.completion", + "title": "Object", + "type": "string" + }, + "created": { + "title": "Created", + "type": "integer" + }, + "model": { + "title": "Model", + "type": "string" + }, + "usage": { + "$ref": "#/components/schemas/OpenAIChatCompletionUsage", + "nullable": true + }, + "input_messages": { + "items": { + "discriminator": { + "mapping": { + "assistant": "#/$defs/OpenAIAssistantMessageParam", + "developer": "#/$defs/OpenAIDeveloperMessageParam", + "system": "#/$defs/OpenAISystemMessageParam", + "tool": "#/$defs/OpenAIToolMessageParam", + "user": "#/$defs/OpenAIUserMessageParam" + }, + "propertyName": "role" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIUserMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAISystemMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIAssistantMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIToolMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" + } + ] + }, + "title": "Input Messages", + "type": "array" + } + }, + "required": [ + "id", + "choices", + "created", + "model", + "input_messages" + ], + "title": "OpenAICompletionWithInputMessages", + "type": "object" + }, + "OpenAIUserMessageParam": { + "description": "A message from the user in an OpenAI-compatible chat completion request.", + "properties": { + "role": { + "const": "user", + "default": "user", + "title": "Role", + "type": "string" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "discriminator": { + "mapping": { + "file": "#/$defs/OpenAIFile", + "image_url": "#/$defs/OpenAIChatCompletionContentPartImageParam", + "text": "#/$defs/OpenAIChatCompletionContentPartTextParam" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + }, + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" + }, + { + "$ref": "#/components/schemas/OpenAIFile" + } + ] + }, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string", + "nullable": true + } + }, + "required": [ + "content" + ], + "title": "OpenAIUserMessageParam", + "type": "object" + }, + "Checkpoint": { + "description": "Checkpoint created during training runs.", + "properties": { + "identifier": { + "title": "Identifier", + "type": "string" + }, + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "epoch": { + "title": "Epoch", + "type": "integer" + }, + "post_training_job_id": { + "title": "Post Training Job Id", + "type": "string" + }, + "path": { + "title": "Path", + "type": "string" + }, + "training_metrics": { + "$ref": "#/components/schemas/PostTrainingMetric", + "nullable": true + } + }, + "required": [ + "identifier", + "created_at", + "epoch", + "post_training_job_id", + "path" + ], + "title": "Checkpoint", + "type": "object" + }, + "PostTrainingJobArtifactsResponse": { + "description": "Artifacts of a finetuning job.", + "properties": { + "job_uuid": { + "title": "Job Uuid", + "type": "string" + }, + "checkpoints": { + "items": { + "$ref": "#/components/schemas/Checkpoint" + }, + "title": "Checkpoints", + "type": "array" + } + }, + "required": [ + "job_uuid" + ], + "title": "PostTrainingJobArtifactsResponse", + "type": "object" + }, + "PostTrainingJobStatusResponse": { + "description": "Status of a finetuning job.", + "properties": { + "job_uuid": { + "title": "Job Uuid", + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/JobStatus" + }, + "scheduled_at": { + "title": "Scheduled At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "started_at": { + "title": "Started At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "completed_at": { + "title": "Completed At", + "format": "date-time", + "type": "string", + "nullable": true + }, + "resources_allocated": { + "title": "Resources Allocated", + "additionalProperties": true, + "type": "object", + "nullable": true + }, + "checkpoints": { + "items": { + "$ref": "#/components/schemas/Checkpoint" + }, + "title": "Checkpoints", + "type": "array" + } + }, + "required": [ + "job_uuid", + "status" + ], + "title": "PostTrainingJobStatusResponse", + "type": "object" + }, + "ScoringFn": { + "description": "A scoring function resource for evaluating model outputs.", + "properties": { + "identifier": { + "description": "Unique identifier for this resource in llama stack", + "title": "Identifier", + "type": "string" + }, + "provider_resource_id": { + "description": "Unique identifier for this resource in the provider", + "title": "Provider Resource Id", + "type": "string", + "nullable": true + }, + "provider_id": { + "description": "ID of the provider that owns this resource", + "title": "Provider Id", + "type": "string" + }, + "type": { + "const": "scoring_function", + "default": "scoring_function", + "title": "Type", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string", + "nullable": true + }, + "metadata": { + "additionalProperties": true, + "description": "Any additional metadata for this definition", + "title": "Metadata", + "type": "object" + }, + "return_type": { + "description": "The return type of the deterministic function", + "discriminator": { + "mapping": { + "agent_turn_input": "#/$defs/AgentTurnInputType", + "array": "#/$defs/ArrayType", + "boolean": "#/$defs/BooleanType", + "chat_completion_input": "#/$defs/ChatCompletionInputType", + "completion_input": "#/$defs/CompletionInputType", + "json": "#/$defs/JsonType", + "number": "#/$defs/NumberType", + "object": "#/$defs/ObjectType", + "string": "#/$defs/StringType", + "union": "#/$defs/UnionType" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/StringType" + }, + { + "$ref": "#/components/schemas/NumberType" + }, + { + "$ref": "#/components/schemas/BooleanType" + }, + { + "$ref": "#/components/schemas/ArrayType" + }, + { + "$ref": "#/components/schemas/ObjectType" + }, + { + "$ref": "#/components/schemas/JsonType" + }, + { + "$ref": "#/components/schemas/UnionType" + }, + { + "$ref": "#/components/schemas/ChatCompletionInputType" + }, + { + "$ref": "#/components/schemas/CompletionInputType" + }, + { + "$ref": "#/components/schemas/AgentTurnInputType" + } + ], + "title": "Return Type" + }, + "params": { + "description": "The parameters for the scoring function for benchmark eval, these can be overridden for app eval", + "title": "Params", + "discriminator": { + "mapping": { + "basic": "#/$defs/BasicScoringFnParams", + "llm_as_judge": "#/$defs/LLMAsJudgeScoringFnParams", + "regex_parser": "#/$defs/RegexParserScoringFnParams" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" + }, + { + "$ref": "#/components/schemas/RegexParserScoringFnParams" + }, + { + "$ref": "#/components/schemas/BasicScoringFnParams" + } + ], + "nullable": true + } + }, + "required": [ + "identifier", + "provider_id", + "return_type" + ], + "title": "ScoringFn", + "type": "object" + }, + "ListToolDefsResponse": { + "description": "Response containing a list of tool definitions.", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/ToolDef" + }, + "title": "Data", + "type": "array" + } + }, + "required": [ + "data" + ], + "title": "ListToolDefsResponse", + "type": "object" + }, + "VectorStoreDeleteResponse": { + "description": "Response from deleting a vector store.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "object": { + "default": "vector_store.deleted", + "title": "Object", + "type": "string" + }, + "deleted": { + "default": true, + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id" + ], + "title": "VectorStoreDeleteResponse", + "type": "object" + }, + "VectorStoreFileContentsResponse": { + "description": "Response from retrieving the contents of a vector store file.", + "properties": { + "file_id": { + "title": "File Id", + "type": "string" + }, + "filename": { + "title": "Filename", + "type": "string" + }, + "attributes": { + "additionalProperties": true, + "title": "Attributes", + "type": "object" + }, + "content": { + "items": { + "$ref": "#/components/schemas/VectorStoreContent" + }, + "title": "Content", + "type": "array" + } + }, + "required": [ + "file_id", + "filename", + "attributes", + "content" + ], + "title": "VectorStoreFileContentsResponse", + "type": "object" + }, + "VectorStoreFileDeleteResponse": { + "description": "Response from deleting a vector store file.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "object": { + "default": "vector_store.file.deleted", + "title": "Object", + "type": "string" + }, + "deleted": { + "default": true, + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id" + ], + "title": "VectorStoreFileDeleteResponse", + "type": "object" + }, + "VectorStoreFilesListInBatchResponse": { + "description": "Response from listing files in a vector store file batch.", + "properties": { + "object": { + "default": "list", + "title": "Object", + "type": "string" + }, + "data": { + "items": { + "$ref": "#/components/schemas/VectorStoreFileObject" + }, + "title": "Data", + "type": "array" + }, + "first_id": { + "title": "First Id", + "type": "string", + "nullable": true + }, + "last_id": { + "title": "Last Id", + "type": "string", + "nullable": true + }, + "has_more": { + "default": false, + "title": "Has More", + "type": "boolean" + } + }, + "required": [ + "data" + ], + "title": "VectorStoreFilesListInBatchResponse", + "type": "object" + }, + "VectorStoreListFilesResponse": { + "description": "Response from listing files in a vector store.", + "properties": { + "object": { + "default": "list", + "title": "Object", + "type": "string" + }, + "data": { + "items": { + "$ref": "#/components/schemas/VectorStoreFileObject" + }, + "title": "Data", + "type": "array" + }, + "first_id": { + "title": "First Id", + "type": "string", + "nullable": true + }, + "last_id": { + "title": "Last Id", + "type": "string", + "nullable": true + }, + "has_more": { + "default": false, + "title": "Has More", + "type": "boolean" + } + }, + "required": [ + "data" + ], + "title": "VectorStoreListFilesResponse", + "type": "object" + }, + "VectorStoreListResponse": { + "description": "Response from listing vector stores.", + "properties": { + "object": { + "default": "list", + "title": "Object", + "type": "string" + }, + "data": { + "items": { + "$ref": "#/components/schemas/VectorStoreObject" + }, + "title": "Data", + "type": "array" + }, + "first_id": { + "title": "First Id", + "type": "string", + "nullable": true + }, + "last_id": { + "title": "Last Id", + "type": "string", + "nullable": true + }, + "has_more": { + "default": false, + "title": "Has More", + "type": "boolean" + } + }, + "required": [ + "data" + ], + "title": "VectorStoreListResponse", + "type": "object" + }, + "OpenAIResponseMessage": { + "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios.", + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "discriminator": { + "mapping": { + "input_file": "#/$defs/OpenAIResponseInputMessageContentFile", + "input_image": "#/$defs/OpenAIResponseInputMessageContentImage", + "input_text": "#/$defs/OpenAIResponseInputMessageContentText" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" + } + ] + }, + "type": "array" + }, + { + "items": { + "discriminator": { + "mapping": { + "output_text": "#/$defs/OpenAIResponseOutputMessageContentOutputText", + "refusal": "#/$defs/OpenAIResponseContentPartRefusal" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" + }, + { + "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" + } + ] + }, + "type": "array" + } + ], + "title": "Content" + }, + "role": { + "anyOf": [ + { + "const": "system", + "type": "string" + }, + { + "const": "developer", + "type": "string" + }, + { + "const": "user", + "type": "string" + }, + { + "const": "assistant", + "type": "string" + } + ], + "title": "Role" + }, + "type": { + "const": "message", + "default": "message", + "title": "Type", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string", + "nullable": true + }, + "status": { + "title": "Status", + "type": "string", + "nullable": true + } + }, + "required": [ + "content", + "role" + ], + "title": "OpenAIResponseMessage", + "type": "object" + }, + "OpenAIResponseObjectWithInput": { + "description": "OpenAI response object extended with input context information.", + "properties": { + "created_at": { + "title": "Created At", + "type": "integer" + }, + "error": { + "$ref": "#/components/schemas/OpenAIResponseError", + "nullable": true + }, + "id": { + "title": "Id", + "type": "string" + }, + "model": { + "title": "Model", + "type": "string" + }, + "object": { + "const": "response", + "default": "response", + "title": "Object", + "type": "string" + }, + "output": { + "items": { + "discriminator": { + "mapping": { + "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", + "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", + "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", + "message": "#/$defs/OpenAIResponseMessage", + "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + } + ] + }, + "title": "Output", + "type": "array" + }, + "parallel_tool_calls": { + "default": false, + "title": "Parallel Tool Calls", + "type": "boolean" + }, + "previous_response_id": { + "title": "Previous Response Id", + "type": "string", + "nullable": true + }, + "prompt": { + "$ref": "#/components/schemas/OpenAIResponsePrompt", + "nullable": true + }, + "status": { + "title": "Status", + "type": "string" + }, + "temperature": { + "title": "Temperature", + "type": "number", + "nullable": true + }, + "text": { + "$ref": "#/components/schemas/OpenAIResponseText", + "default": { + "format": { + "type": "text" + } + } + }, + "top_p": { + "title": "Top P", + "type": "number", + "nullable": true + }, + "tools": { + "title": "Tools", + "items": { + "discriminator": { + "mapping": { + "file_search": "#/$defs/OpenAIResponseInputToolFileSearch", + "function": "#/$defs/OpenAIResponseInputToolFunction", + "mcp": "#/$defs/OpenAIResponseToolMCP", + "web_search": "#/$defs/OpenAIResponseInputToolWebSearch", + "web_search_preview": "#/$defs/OpenAIResponseInputToolWebSearch", + "web_search_preview_2025_03_11": "#/$defs/OpenAIResponseInputToolWebSearch" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" + }, + { + "$ref": "#/components/schemas/OpenAIResponseToolMCP" + } + ] + }, + "type": "array", + "nullable": true + }, + "truncation": { + "title": "Truncation", + "type": "string", + "nullable": true + }, + "usage": { + "$ref": "#/components/schemas/OpenAIResponseUsage", + "nullable": true + }, + "instructions": { + "title": "Instructions", + "type": "string", + "nullable": true + }, + "input": { + "items": { + "anyOf": [ + { + "discriminator": { + "mapping": { + "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", + "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", + "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", + "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", + "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", + "message": "#/$defs/OpenAIResponseMessage", + "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" + }, + { + "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" + } + ] + }, + { + "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" + }, + { + "$ref": "#/components/schemas/OpenAIResponseMessage" + } + ] + }, + "title": "Input", + "type": "array" + } + }, + "required": [ + "created_at", + "id", + "model", + "output", + "status", + "input" + ], + "title": "OpenAIResponseObjectWithInput", + "type": "object" + }, + "ImageContentItem": { + "description": "A image content item", + "properties": { + "type": { + "const": "image", + "default": "image", + "title": "Type", + "type": "string" + }, + "image": { + "$ref": "#/components/schemas/_URLOrData" + } + }, + "required": [ + "image" + ], + "title": "ImageContentItem", + "type": "object" + }, + "PostTrainingMetric": { + "description": "Training metrics captured during post-training jobs.", + "properties": { + "epoch": { + "title": "Epoch", + "type": "integer" + }, + "train_loss": { + "title": "Train Loss", + "type": "number" + }, + "validation_loss": { + "title": "Validation Loss", + "type": "number" + }, + "perplexity": { + "title": "Perplexity", + "type": "number" + } + }, + "required": [ + "epoch", + "train_loss", + "validation_loss", + "perplexity" + ], + "title": "PostTrainingMetric", + "type": "object" + }, + "_safety_run_shield_Request": { + "properties": { + "shield_id": { + "title": "Shield Id", + "type": "string" + }, + "messages": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAIUserMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAISystemMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIAssistantMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIToolMessageParam" + }, + { + "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" + } + ], + "title": "Messages" + }, + "params": { + "title": "Params", + "type": "string" + } + }, + "required": [ + "shield_id", + "messages", + "params" + ], + "title": "_safety_run_shield_Request", + "type": "object" + } + }, + "responses": { + "BadRequest400": { + "description": "The request was invalid or malformed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "status": 400, + "title": "Bad Request", + "detail": "The request was invalid or malformed" + } + } + } + }, + "TooManyRequests429": { + "description": "The client has sent too many requests in a given amount of time", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "status": 429, + "title": "Too Many Requests", + "detail": "You have exceeded the rate limit. Please try again later." + } + } + } + }, + "InternalServerError500": { + "description": "The server encountered an unexpected error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "status": 500, + "title": "Internal Server Error", + "detail": "An unexpected error occurred. Our team has been notified." + } + } + } + }, + "DefaultError": { + "description": "An unexpected error occurred", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/docs/static/stainless-llama-stack-spec.yaml b/docs/static/stainless-llama-stack-spec.yaml index 118a887d6f..22f8d3d5d9 100644 --- a/docs/static/stainless-llama-stack-spec.yaml +++ b/docs/static/stainless-llama-stack-spec.yaml @@ -3476,7 +3476,7 @@ paths: post: tags: - V1Beta - summary: Append Rows + summary: Append rows to a dataset. description: Generic endpoint - this would be replaced with actual implementation. operationId: append_rows_v1beta_datasetio_append_rows__dataset_id__post parameters: @@ -3518,16 +3518,10 @@ paths: get: tags: - V1Beta - summary: Iterrows + summary: Get a paginated list of rows from a dataset. description: Query endpoint for proper schema generation. operationId: iterrows_v1beta_datasetio_iterrows__dataset_id__get parameters: - - name: dataset_id - in: path - required: true - schema: - type: string - title: Dataset Id - name: limit in: query required: true @@ -3540,6 +3534,12 @@ paths: schema: type: integer title: Start Index + - name: dataset_id + in: path + required: true + schema: + type: string + title: Dataset Id responses: '200': description: A PaginatedResponse. @@ -3563,7 +3563,7 @@ paths: get: tags: - V1Beta - summary: List Datasets + summary: List all datasets. description: Response-only endpoint for proper schema generation. operationId: list_datasets_v1beta_datasets_get responses: @@ -3588,7 +3588,7 @@ paths: post: tags: - V1Beta - summary: Register Dataset + summary: Register a new dataset. description: Typed endpoint for proper schema generation. operationId: register_dataset_v1beta_datasets_post requestBody: @@ -3620,7 +3620,7 @@ paths: delete: tags: - V1Beta - summary: Unregister Dataset + summary: Unregister a dataset by its ID. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_dataset_v1beta_datasets__dataset_id__delete parameters: @@ -3661,7 +3661,7 @@ paths: get: tags: - V1Beta - summary: Get Dataset + summary: Get a dataset by its ID. description: Query endpoint for proper schema generation. operationId: get_dataset_v1beta_datasets__dataset_id__get parameters: @@ -3694,7 +3694,7 @@ paths: get: tags: - V1Alpha - summary: List Agents + summary: List all agents. description: Query endpoint for proper schema generation. operationId: list_agents_v1alpha_agents_get parameters: @@ -3732,7 +3732,7 @@ paths: post: tags: - V1Alpha - summary: Create Agent + summary: Create an agent with the given configuration. description: Typed endpoint for proper schema generation. operationId: create_agent_v1alpha_agents_post requestBody: @@ -3764,7 +3764,7 @@ paths: delete: tags: - V1Alpha - summary: Delete Agent + summary: Delete an agent by its ID and its associated sessions and turns. description: Generic endpoint - this would be replaced with actual implementation. operationId: delete_agent_v1alpha_agents__agent_id__delete parameters: @@ -3783,7 +3783,7 @@ paths: required: true schema: type: string - description: 'Path parameter: agent_id' + description: The ID of the agent to delete. responses: '200': description: Successful Response @@ -3805,7 +3805,7 @@ paths: get: tags: - V1Alpha - summary: Get Agent + summary: Describe an agent by its ID. description: Query endpoint for proper schema generation. operationId: get_agent_v1alpha_agents__agent_id__get parameters: @@ -3815,6 +3815,7 @@ paths: schema: type: string title: Agent Id + description: ID of the agent. responses: '200': description: An Agent of the agent. @@ -3838,7 +3839,7 @@ paths: post: tags: - V1Alpha - summary: Create Agent Session + summary: Create a new session for an agent. description: Typed endpoint for proper schema generation. operationId: create_agent_session_v1alpha_agents__agent_id__session_post requestBody: @@ -3872,12 +3873,12 @@ paths: required: true schema: type: string - description: 'Path parameter: agent_id' + description: The ID of the agent to create the session for. /v1alpha/agents/{agent_id}/session/{session_id}: delete: tags: - V1Alpha - summary: Delete Agents Session + summary: Delete an agent session by its ID and its associated turns. description: Generic endpoint - this would be replaced with actual implementation. operationId: delete_agents_session_v1alpha_agents__agent_id__session__session_id__delete parameters: @@ -3891,18 +3892,18 @@ paths: required: true schema: title: Kwargs - - name: agent_id + - name: session_id in: path required: true schema: type: string - description: 'Path parameter: agent_id' - - name: session_id + description: The ID of the session to delete. + - name: agent_id in: path required: true schema: type: string - description: 'Path parameter: session_id' + description: The ID of the agent to delete the session for. responses: '200': description: Successful Response @@ -3924,28 +3925,30 @@ paths: get: tags: - V1Alpha - summary: Get Agents Session + summary: Retrieve an agent session by its ID. description: Query endpoint for proper schema generation. operationId: get_agents_session_v1alpha_agents__agent_id__session__session_id__get parameters: - - name: agent_id - in: path + - name: turn_ids + in: query required: true schema: type: string - title: Agent Id + title: Turn Ids - name: session_id in: path required: true schema: type: string title: Session Id - - name: turn_ids - in: query + description: The ID of the session to get. + - name: agent_id + in: path required: true schema: type: string - title: Turn Ids + title: Agent Id + description: The ID of the agent to get the session for. responses: '200': description: A Session. @@ -3969,7 +3972,7 @@ paths: post: tags: - V1Alpha - summary: Create Agent Turn + summary: Create a new turn for an agent. description: Typed endpoint for proper schema generation. operationId: create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post requestBody: @@ -4003,18 +4006,18 @@ paths: required: true schema: type: string - description: 'Path parameter: agent_id' + description: The ID of the agent to create the turn for. - name: session_id in: path required: true schema: type: string - description: 'Path parameter: session_id' + description: The ID of the session to create the turn for. /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}: get: tags: - V1Alpha - summary: Get Agents Turn + summary: Retrieve an agent turn by its ID. description: Query endpoint for proper schema generation. operationId: get_agents_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__get parameters: @@ -4024,18 +4027,21 @@ paths: schema: type: string title: Agent Id + description: The ID of the agent to get the turn for. - name: session_id in: path required: true schema: type: string title: Session Id + description: The ID of the session to get the turn for. - name: turn_id in: path required: true schema: type: string title: Turn Id + description: The ID of the turn to get. responses: '200': description: A Turn. @@ -4059,7 +4065,7 @@ paths: post: tags: - V1Alpha - summary: Resume Agent Turn + summary: Resume an agent turn with executed tool call responses. description: Typed endpoint for proper schema generation. operationId: resume_agent_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__resume_post requestBody: @@ -4093,24 +4099,24 @@ paths: required: true schema: type: string - description: 'Path parameter: agent_id' + description: The ID of the agent to resume. - name: session_id in: path required: true schema: type: string - description: 'Path parameter: session_id' + description: The ID of the session to resume. - name: turn_id in: path required: true schema: type: string - description: 'Path parameter: turn_id' + description: The ID of the turn to resume. /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}: get: tags: - V1Alpha - summary: Get Agents Step + summary: Retrieve an agent step by its ID. description: Query endpoint for proper schema generation. operationId: get_agents_step_v1alpha_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get parameters: @@ -4120,24 +4126,28 @@ paths: schema: type: string title: Agent Id + description: The ID of the agent to get the step for. - name: session_id in: path required: true schema: type: string title: Session Id - - name: step_id + description: The ID of the session to get the step for. + - name: turn_id in: path required: true schema: type: string - title: Step Id - - name: turn_id + title: Turn Id + description: The ID of the turn to get the step for. + - name: step_id in: path required: true schema: type: string - title: Turn Id + title: Step Id + description: The ID of the step to get. responses: '200': description: An AgentStepResponse. @@ -4161,16 +4171,10 @@ paths: get: tags: - V1Alpha - summary: List Agent Sessions + summary: List all session(s) of a given agent. description: Query endpoint for proper schema generation. operationId: list_agent_sessions_v1alpha_agents__agent_id__sessions_get parameters: - - name: agent_id - in: path - required: true - schema: - type: string - title: Agent Id - name: limit in: query required: true @@ -4183,6 +4187,13 @@ paths: schema: type: integer title: Start Index + - name: agent_id + in: path + required: true + schema: + type: string + title: Agent Id + description: The ID of the agent to list sessions for. responses: '200': description: A PaginatedResponse. @@ -4206,7 +4217,7 @@ paths: get: tags: - V1Alpha - summary: List Benchmarks + summary: List all benchmarks. description: Response-only endpoint for proper schema generation. operationId: list_benchmarks_v1alpha_eval_benchmarks_get responses: @@ -4231,7 +4242,7 @@ paths: post: tags: - V1Alpha - summary: Register Benchmark + summary: Register a benchmark. description: Generic endpoint - this would be replaced with actual implementation. operationId: register_benchmark_v1alpha_eval_benchmarks_post parameters: @@ -4267,7 +4278,7 @@ paths: delete: tags: - V1Alpha - summary: Unregister Benchmark + summary: Unregister a benchmark. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_benchmark_v1alpha_eval_benchmarks__benchmark_id__delete parameters: @@ -4286,7 +4297,7 @@ paths: required: true schema: type: string - description: 'Path parameter: benchmark_id' + description: The ID of the benchmark to unregister. responses: '200': description: Successful Response @@ -4308,7 +4319,7 @@ paths: get: tags: - V1Alpha - summary: Get Benchmark + summary: Get a benchmark by its ID. description: Query endpoint for proper schema generation. operationId: get_benchmark_v1alpha_eval_benchmarks__benchmark_id__get parameters: @@ -4318,6 +4329,7 @@ paths: schema: type: string title: Benchmark Id + description: The ID of the benchmark to get. responses: '200': description: A Benchmark. @@ -4341,7 +4353,7 @@ paths: post: tags: - V1Alpha - summary: Evaluate Rows + summary: Evaluate a list of rows on a benchmark. description: Typed endpoint for proper schema generation. operationId: evaluate_rows_v1alpha_eval_benchmarks__benchmark_id__evaluations_post requestBody: @@ -4375,12 +4387,12 @@ paths: required: true schema: type: string - description: 'Path parameter: benchmark_id' + description: The ID of the benchmark to run the evaluation on. /v1alpha/eval/benchmarks/{benchmark_id}/jobs: post: tags: - V1Alpha - summary: Run Eval + summary: Run an evaluation on a benchmark. description: Typed endpoint for proper schema generation. operationId: run_eval_v1alpha_eval_benchmarks__benchmark_id__jobs_post requestBody: @@ -4414,12 +4426,12 @@ paths: required: true schema: type: string - description: 'Path parameter: benchmark_id' + description: The ID of the benchmark to run the evaluation on. /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}: delete: tags: - V1Alpha - summary: Job Cancel + summary: Cancel a job. description: Generic endpoint - this would be replaced with actual implementation. operationId: job_cancel_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__delete parameters: @@ -4438,13 +4450,13 @@ paths: required: true schema: type: string - description: 'Path parameter: benchmark_id' + description: The ID of the benchmark to run the evaluation on. - name: job_id in: path required: true schema: type: string - description: 'Path parameter: job_id' + description: The ID of the job to cancel. responses: '200': description: Successful Response @@ -4466,7 +4478,7 @@ paths: get: tags: - V1Alpha - summary: Job Status + summary: Get the status of a job. description: Query endpoint for proper schema generation. operationId: job_status_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__get parameters: @@ -4476,12 +4488,14 @@ paths: schema: type: string title: Benchmark Id + description: The ID of the benchmark to run the evaluation on. - name: job_id in: path required: true schema: type: string title: Job Id + description: The ID of the job to get the status of. responses: '200': description: The status of the evaluation job. @@ -4505,7 +4519,7 @@ paths: get: tags: - V1Alpha - summary: Job Result + summary: Get the result of a job. description: Query endpoint for proper schema generation. operationId: job_result_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__result_get parameters: @@ -4515,12 +4529,14 @@ paths: schema: type: string title: Benchmark Id + description: The ID of the benchmark to run the evaluation on. - name: job_id in: path required: true schema: type: string title: Job Id + description: The ID of the job to get the result of. responses: '200': description: The result of the job. @@ -4544,7 +4560,7 @@ paths: post: tags: - V1Alpha - summary: Rerank + summary: Rerank a list of documents based on their relevance to a query. description: Typed endpoint for proper schema generation. operationId: rerank_v1alpha_inference_rerank_post requestBody: @@ -4576,7 +4592,7 @@ paths: get: tags: - V1Alpha - summary: Get Training Job Artifacts + summary: Get the artifacts of a training job. description: Query endpoint for proper schema generation. operationId: get_training_job_artifacts_v1alpha_post_training_job_artifacts_get parameters: @@ -4609,7 +4625,7 @@ paths: post: tags: - V1Alpha - summary: Cancel Training Job + summary: Cancel a training job. description: Generic endpoint - this would be replaced with actual implementation. operationId: cancel_training_job_v1alpha_post_training_job_cancel_post parameters: @@ -4645,7 +4661,7 @@ paths: get: tags: - V1Alpha - summary: Get Training Job Status + summary: Get the status of a training job. description: Query endpoint for proper schema generation. operationId: get_training_job_status_v1alpha_post_training_job_status_get parameters: @@ -4678,7 +4694,7 @@ paths: get: tags: - V1Alpha - summary: Get Training Jobs + summary: Get all training jobs. description: Response-only endpoint for proper schema generation. operationId: get_training_jobs_v1alpha_post_training_jobs_get responses: @@ -4704,7 +4720,7 @@ paths: post: tags: - V1Alpha - summary: Preference Optimize + summary: Run preference optimization of a model. description: Typed endpoint for proper schema generation. operationId: preference_optimize_v1alpha_post_training_preference_optimize_post requestBody: @@ -4736,7 +4752,7 @@ paths: post: tags: - V1Alpha - summary: Supervised Fine Tune + summary: Run supervised fine-tuning of a model. description: Typed endpoint for proper schema generation. operationId: supervised_fine_tune_v1alpha_post_training_supervised_fine_tune_post requestBody: @@ -4768,7 +4784,7 @@ paths: get: tags: - V1 - summary: List Batches + summary: List all batches for the current user. description: Query endpoint for proper schema generation. operationId: list_batches_v1_batches_get parameters: @@ -4807,7 +4823,7 @@ paths: post: tags: - V1 - summary: Create Batch + summary: Create a new batch for processing multiple API requests. description: Typed endpoint for proper schema generation. operationId: create_batch_v1_batches_post requestBody: @@ -4839,7 +4855,7 @@ paths: get: tags: - V1 - summary: Retrieve Batch + summary: Retrieve information about a specific batch. description: Query endpoint for proper schema generation. operationId: retrieve_batch_v1_batches__batch_id__get parameters: @@ -4849,6 +4865,7 @@ paths: schema: type: string title: Batch Id + description: The ID of the batch to retrieve. responses: '200': description: The batch object. @@ -4872,7 +4889,7 @@ paths: post: tags: - V1 - summary: Cancel Batch + summary: Cancel a batch that is in progress. description: Typed endpoint for proper schema generation. operationId: cancel_batch_v1_batches__batch_id__cancel_post requestBody: @@ -4906,12 +4923,12 @@ paths: required: true schema: type: string - description: 'Path parameter: batch_id' + description: The ID of the batch to cancel. /v1/chat/completions: get: tags: - V1 - summary: List Chat Completions + summary: List chat completions. description: Query endpoint for proper schema generation. operationId: list_chat_completions_v1_chat_completions_get parameters: @@ -4962,7 +4979,7 @@ paths: post: tags: - V1 - summary: Openai Chat Completion + summary: Create chat completions. description: Typed endpoint for proper schema generation. operationId: openai_chat_completion_v1_chat_completions_post requestBody: @@ -4994,7 +5011,7 @@ paths: get: tags: - V1 - summary: Get Chat Completion + summary: Get chat completion. description: Query endpoint for proper schema generation. operationId: get_chat_completion_v1_chat_completions__completion_id__get parameters: @@ -5004,6 +5021,7 @@ paths: schema: type: string title: Completion Id + description: ID of the chat completion. responses: '200': description: A OpenAICompletionWithInputMessages. @@ -5027,7 +5045,7 @@ paths: post: tags: - V1 - summary: Openai Completion + summary: Create completion. description: Typed endpoint for proper schema generation. operationId: openai_completion_v1_completions_post requestBody: @@ -5059,7 +5077,7 @@ paths: post: tags: - V1 - summary: Create Conversation + summary: Create a conversation. description: Typed endpoint for proper schema generation. operationId: create_conversation_v1_conversations_post requestBody: @@ -5091,7 +5109,7 @@ paths: delete: tags: - V1 - summary: Openai Delete Conversation + summary: Delete a conversation. description: Query endpoint for proper schema generation. operationId: openai_delete_conversation_v1_conversations__conversation_id__delete parameters: @@ -5101,6 +5119,7 @@ paths: schema: type: string title: Conversation Id + description: The conversation identifier. responses: '200': description: The deleted conversation resource. @@ -5123,7 +5142,7 @@ paths: get: tags: - V1 - summary: Get Conversation + summary: Retrieve a conversation. description: Query endpoint for proper schema generation. operationId: get_conversation_v1_conversations__conversation_id__get parameters: @@ -5133,6 +5152,7 @@ paths: schema: type: string title: Conversation Id + description: The conversation identifier. responses: '200': description: The conversation object. @@ -5155,7 +5175,7 @@ paths: post: tags: - V1 - summary: Update Conversation + summary: Update a conversation. description: Typed endpoint for proper schema generation. operationId: update_conversation_v1_conversations__conversation_id__post requestBody: @@ -5189,21 +5209,15 @@ paths: required: true schema: type: string - description: 'Path parameter: conversation_id' + description: The conversation identifier. /v1/conversations/{conversation_id}/items: get: tags: - V1 - summary: List Items + summary: List items. description: Query endpoint for proper schema generation. operationId: list_items_v1_conversations__conversation_id__items_get parameters: - - name: conversation_id - in: path - required: true - schema: - type: string - title: Conversation Id - name: after in: query required: true @@ -5227,6 +5241,13 @@ paths: schema: type: string title: Order + - name: conversation_id + in: path + required: true + schema: + type: string + title: Conversation Id + description: The conversation identifier. responses: '200': description: List of conversation items. @@ -5249,7 +5270,7 @@ paths: post: tags: - V1 - summary: Add Items + summary: Create items. description: Typed endpoint for proper schema generation. operationId: add_items_v1_conversations__conversation_id__items_post requestBody: @@ -5283,12 +5304,12 @@ paths: required: true schema: type: string - description: 'Path parameter: conversation_id' + description: The conversation identifier. /v1/conversations/{conversation_id}/items/{item_id}: delete: tags: - V1 - summary: Openai Delete Conversation Item + summary: Delete an item. description: Query endpoint for proper schema generation. operationId: openai_delete_conversation_item_v1_conversations__conversation_id__items__item_id__delete parameters: @@ -5298,12 +5319,14 @@ paths: schema: type: string title: Conversation Id + description: The conversation identifier. - name: item_id in: path required: true schema: type: string title: Item Id + description: The item identifier. responses: '200': description: The deleted item resource. @@ -5326,7 +5349,7 @@ paths: get: tags: - V1 - summary: Retrieve + summary: Retrieve an item. description: Query endpoint for proper schema generation. operationId: retrieve_v1_conversations__conversation_id__items__item_id__get parameters: @@ -5336,12 +5359,14 @@ paths: schema: type: string title: Conversation Id + description: The conversation identifier. - name: item_id in: path required: true schema: type: string title: Item Id + description: The item identifier. responses: '200': description: The conversation item. @@ -5365,7 +5390,7 @@ paths: post: tags: - V1 - summary: Openai Embeddings + summary: Create embeddings. description: Typed endpoint for proper schema generation. operationId: openai_embeddings_v1_embeddings_post requestBody: @@ -5397,7 +5422,7 @@ paths: get: tags: - V1 - summary: Openai List Files + summary: List files. description: Query endpoint for proper schema generation. operationId: openai_list_files_v1_files_get parameters: @@ -5447,7 +5472,7 @@ paths: post: tags: - V1 - summary: Openai Upload File + summary: Upload file. description: Response-only endpoint for proper schema generation. operationId: openai_upload_file_v1_files_post responses: @@ -5473,7 +5498,7 @@ paths: delete: tags: - V1 - summary: Openai Delete File + summary: Delete file. description: Query endpoint for proper schema generation. operationId: openai_delete_file_v1_files__file_id__delete parameters: @@ -5483,6 +5508,7 @@ paths: schema: type: string title: File Id + description: The ID of the file to use for this request. responses: '200': description: An OpenAIFileDeleteResponse indicating successful deletion. @@ -5505,7 +5531,7 @@ paths: get: tags: - V1 - summary: Openai Retrieve File + summary: Retrieve file. description: Query endpoint for proper schema generation. operationId: openai_retrieve_file_v1_files__file_id__get parameters: @@ -5515,6 +5541,7 @@ paths: schema: type: string title: File Id + description: The ID of the file to use for this request. responses: '200': description: An OpenAIFileObject containing file information. @@ -5538,7 +5565,7 @@ paths: get: tags: - V1 - summary: Openai Retrieve File Content + summary: Retrieve file content. description: Generic endpoint - this would be replaced with actual implementation. operationId: openai_retrieve_file_content_v1_files__file_id__content_get parameters: @@ -5557,7 +5584,7 @@ paths: required: true schema: type: string - description: 'Path parameter: file_id' + description: The ID of the file to use for this request. responses: '200': description: The raw file content as a binary response. @@ -5580,7 +5607,7 @@ paths: get: tags: - V1 - summary: Health + summary: Get health status. description: Response-only endpoint for proper schema generation. operationId: health_v1_health_get responses: @@ -5606,7 +5633,7 @@ paths: get: tags: - V1 - summary: List Routes + summary: List routes. description: Response-only endpoint for proper schema generation. operationId: list_routes_v1_inspect_routes_get responses: @@ -5632,7 +5659,7 @@ paths: get: tags: - V1 - summary: List Models + summary: List all models. description: Response-only endpoint for proper schema generation. operationId: list_models_v1_models_get responses: @@ -5657,7 +5684,7 @@ paths: post: tags: - V1 - summary: Register Model + summary: Register model. description: Typed endpoint for proper schema generation. operationId: register_model_v1_models_post requestBody: @@ -5689,7 +5716,7 @@ paths: delete: tags: - V1 - summary: Unregister Model + summary: Unregister model. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_model_v1_models__model_id__delete parameters: @@ -5730,7 +5757,7 @@ paths: get: tags: - V1 - summary: Get Model + summary: Get model. description: Query endpoint for proper schema generation. operationId: get_model_v1_models__model_id__get parameters: @@ -5763,7 +5790,7 @@ paths: post: tags: - V1 - summary: Run Moderation + summary: Create moderation. description: Typed endpoint for proper schema generation. operationId: run_moderation_v1_moderations_post requestBody: @@ -5795,7 +5822,7 @@ paths: get: tags: - V1 - summary: List Prompts + summary: List all prompts. description: Response-only endpoint for proper schema generation. operationId: list_prompts_v1_prompts_get responses: @@ -5820,7 +5847,7 @@ paths: post: tags: - V1 - summary: Create Prompt + summary: Create prompt. description: Typed endpoint for proper schema generation. operationId: create_prompt_v1_prompts_post requestBody: @@ -5852,7 +5879,7 @@ paths: delete: tags: - V1 - summary: Delete Prompt + summary: Delete prompt. description: Generic endpoint - this would be replaced with actual implementation. operationId: delete_prompt_v1_prompts__prompt_id__delete parameters: @@ -5866,13 +5893,12 @@ paths: required: true schema: title: Kwargs - - &id001 - name: prompt_id + - name: prompt_id in: path required: true schema: type: string - description: 'Path parameter: prompt_id' + description: The identifier of the prompt to delete. responses: '200': description: Successful Response @@ -5894,22 +5920,23 @@ paths: get: tags: - V1 - summary: Get Prompt + summary: Get prompt. description: Query endpoint for proper schema generation. operationId: get_prompt_v1_prompts__prompt_id__get parameters: - - name: prompt_id - in: path - required: true - schema: - type: string - title: Prompt Id - name: version in: query required: true schema: type: integer title: Version + - name: prompt_id + in: path + required: true + schema: + type: string + title: Prompt Id + description: The identifier of the prompt to get. responses: '200': description: A Prompt resource. @@ -5932,7 +5959,7 @@ paths: post: tags: - V1 - summary: Update Prompt + summary: Update prompt. description: Typed endpoint for proper schema generation. operationId: update_prompt_v1_prompts__prompt_id__post requestBody: @@ -5961,12 +5988,17 @@ paths: $ref: '#/components/responses/DefaultError' description: Default Response parameters: - - *id001 + - name: prompt_id + in: path + required: true + schema: + type: string + description: The identifier of the prompt to update. /v1/prompts/{prompt_id}/set-default-version: post: tags: - V1 - summary: Set Default Version + summary: Set prompt version. description: Typed endpoint for proper schema generation. operationId: set_default_version_v1_prompts__prompt_id__set_default_version_post requestBody: @@ -6000,12 +6032,12 @@ paths: required: true schema: type: string - description: 'Path parameter: prompt_id' + description: The identifier of the prompt. /v1/prompts/{prompt_id}/versions: get: tags: - V1 - summary: List Prompt Versions + summary: List prompt versions. description: Query endpoint for proper schema generation. operationId: list_prompt_versions_v1_prompts__prompt_id__versions_get parameters: @@ -6015,6 +6047,7 @@ paths: schema: type: string title: Prompt Id + description: The identifier of the prompt to list versions for. responses: '200': description: A ListPromptsResponse containing all versions of the prompt. @@ -6038,7 +6071,7 @@ paths: get: tags: - V1 - summary: List Providers + summary: List providers. description: Response-only endpoint for proper schema generation. operationId: list_providers_v1_providers_get responses: @@ -6064,7 +6097,7 @@ paths: get: tags: - V1 - summary: Inspect Provider + summary: Get provider. description: Query endpoint for proper schema generation. operationId: inspect_provider_v1_providers__provider_id__get parameters: @@ -6074,6 +6107,7 @@ paths: schema: type: string title: Provider Id + description: The ID of the provider to inspect. responses: '200': description: A ProviderInfo object containing the provider's details. @@ -6097,7 +6131,7 @@ paths: get: tags: - V1 - summary: List Openai Responses + summary: List all responses. description: Query endpoint for proper schema generation. operationId: list_openai_responses_v1_responses_get parameters: @@ -6148,7 +6182,7 @@ paths: post: tags: - V1 - summary: Create Openai Response + summary: Create a model response. description: Typed endpoint for proper schema generation. operationId: create_openai_response_v1_responses_post requestBody: @@ -6180,7 +6214,7 @@ paths: delete: tags: - V1 - summary: Delete Openai Response + summary: Delete a response. description: Query endpoint for proper schema generation. operationId: delete_openai_response_v1_responses__response_id__delete parameters: @@ -6190,6 +6224,7 @@ paths: schema: type: string title: Response Id + description: The ID of the OpenAI response to delete. responses: '200': description: An OpenAIDeleteResponseObject @@ -6212,7 +6247,7 @@ paths: get: tags: - V1 - summary: Get Openai Response + summary: Get a model response. description: Query endpoint for proper schema generation. operationId: get_openai_response_v1_responses__response_id__get parameters: @@ -6222,6 +6257,7 @@ paths: schema: type: string title: Response Id + description: The ID of the OpenAI response to retrieve. responses: '200': description: An OpenAIResponseObject. @@ -6245,16 +6281,10 @@ paths: get: tags: - V1 - summary: List Openai Response Input Items + summary: List input items. description: Query endpoint for proper schema generation. operationId: list_openai_response_input_items_v1_responses__response_id__input_items_get parameters: - - name: response_id - in: path - required: true - schema: - type: string - title: Response Id - name: after in: query required: true @@ -6286,6 +6316,13 @@ paths: schema: $ref: '#/components/schemas/Order' default: desc + - name: response_id + in: path + required: true + schema: + type: string + title: Response Id + description: The ID of the response to retrieve input items for. responses: '200': description: An ListOpenAIResponseInputItem. @@ -6309,7 +6346,7 @@ paths: post: tags: - V1 - summary: Run Shield + summary: Run shield. description: Typed endpoint for proper schema generation. operationId: run_shield_v1_safety_run_shield_post requestBody: @@ -6341,7 +6378,7 @@ paths: get: tags: - V1 - summary: List Scoring Functions + summary: List all scoring functions. description: Response-only endpoint for proper schema generation. operationId: list_scoring_functions_v1_scoring_functions_get responses: @@ -6366,7 +6403,7 @@ paths: post: tags: - V1 - summary: Register Scoring Function + summary: Register a scoring function. description: Generic endpoint - this would be replaced with actual implementation. operationId: register_scoring_function_v1_scoring_functions_post parameters: @@ -6402,7 +6439,7 @@ paths: delete: tags: - V1 - summary: Unregister Scoring Function + summary: Unregister a scoring function. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_scoring_function_v1_scoring_functions__scoring_fn_id__delete parameters: @@ -6443,7 +6480,7 @@ paths: get: tags: - V1 - summary: Get Scoring Function + summary: Get a scoring function by its ID. description: Query endpoint for proper schema generation. operationId: get_scoring_function_v1_scoring_functions__scoring_fn_id__get parameters: @@ -6476,7 +6513,7 @@ paths: post: tags: - V1 - summary: Score + summary: Score a list of rows. description: Typed endpoint for proper schema generation. operationId: score_v1_scoring_score_post requestBody: @@ -6508,7 +6545,7 @@ paths: post: tags: - V1 - summary: Score Batch + summary: Score a batch of rows. description: Typed endpoint for proper schema generation. operationId: score_batch_v1_scoring_score_batch_post requestBody: @@ -6540,7 +6577,7 @@ paths: get: tags: - V1 - summary: List Shields + summary: List all shields. description: Response-only endpoint for proper schema generation. operationId: list_shields_v1_shields_get responses: @@ -6565,7 +6602,7 @@ paths: post: tags: - V1 - summary: Register Shield + summary: Register a shield. description: Typed endpoint for proper schema generation. operationId: register_shield_v1_shields_post requestBody: @@ -6597,7 +6634,7 @@ paths: delete: tags: - V1 - summary: Unregister Shield + summary: Unregister a shield. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_shield_v1_shields__identifier__delete parameters: @@ -6638,7 +6675,7 @@ paths: get: tags: - V1 - summary: Get Shield + summary: Get a shield by its identifier. description: Query endpoint for proper schema generation. operationId: get_shield_v1_shields__identifier__get parameters: @@ -6671,7 +6708,7 @@ paths: post: tags: - V1 - summary: Invoke Tool + summary: Run a tool with the given arguments. description: Typed endpoint for proper schema generation. operationId: invoke_tool_v1_tool_runtime_invoke_post requestBody: @@ -6703,7 +6740,7 @@ paths: get: tags: - V1 - summary: List Runtime Tools + summary: List all tools in the runtime. description: Query endpoint for proper schema generation. operationId: list_runtime_tools_v1_tool_runtime_list_tools_get parameters: @@ -6742,7 +6779,7 @@ paths: post: tags: - V1 - summary: Rag Tool.Insert + summary: Index documents so they can be used by the RAG system. description: Generic endpoint - this would be replaced with actual implementation. operationId: rag_tool_insert_v1_tool_runtime_rag_tool_insert_post parameters: @@ -6778,7 +6815,7 @@ paths: post: tags: - V1 - summary: Rag Tool.Query + summary: Query the RAG system for context; typically invoked by the agent. description: Typed endpoint for proper schema generation. operationId: rag_tool_query_v1_tool_runtime_rag_tool_query_post requestBody: @@ -6810,7 +6847,7 @@ paths: get: tags: - V1 - summary: List Tool Groups + summary: List tool groups with optional provider. description: Response-only endpoint for proper schema generation. operationId: list_tool_groups_v1_toolgroups_get responses: @@ -6835,7 +6872,7 @@ paths: post: tags: - V1 - summary: Register Tool Group + summary: Register a tool group. description: Generic endpoint - this would be replaced with actual implementation. operationId: register_tool_group_v1_toolgroups_post parameters: @@ -6871,7 +6908,7 @@ paths: delete: tags: - V1 - summary: Unregister Toolgroup + summary: Unregister a tool group. description: Generic endpoint - this would be replaced with actual implementation. operationId: unregister_toolgroup_v1_toolgroups__toolgroup_id__delete parameters: @@ -6912,7 +6949,7 @@ paths: get: tags: - V1 - summary: Get Tool Group + summary: Get a tool group by its ID. description: Query endpoint for proper schema generation. operationId: get_tool_group_v1_toolgroups__toolgroup_id__get parameters: @@ -6945,7 +6982,7 @@ paths: get: tags: - V1 - summary: List Tools + summary: List tools with optional tool group. description: Query endpoint for proper schema generation. operationId: list_tools_v1_tools_get parameters: @@ -6978,7 +7015,7 @@ paths: get: tags: - V1 - summary: Get Tool + summary: Get a tool by its name. description: Query endpoint for proper schema generation. operationId: get_tool_v1_tools__tool_name__get parameters: @@ -7011,7 +7048,7 @@ paths: post: tags: - V1 - summary: Insert Chunks + summary: Insert chunks into a vector database. description: Generic endpoint - this would be replaced with actual implementation. operationId: insert_chunks_v1_vector_io_insert_post parameters: @@ -7047,7 +7084,7 @@ paths: post: tags: - V1 - summary: Query Chunks + summary: Query chunks from a vector database. description: Typed endpoint for proper schema generation. operationId: query_chunks_v1_vector_io_query_post requestBody: @@ -7079,7 +7116,7 @@ paths: get: tags: - V1 - summary: Openai List Vector Stores + summary: Returns a list of vector stores. description: Query endpoint for proper schema generation. operationId: openai_list_vector_stores_v1_vector_stores_get parameters: @@ -7131,7 +7168,7 @@ paths: post: tags: - V1 - summary: Openai Create Vector Store + summary: Creates a vector store. description: Typed endpoint for proper schema generation. operationId: openai_create_vector_store_v1_vector_stores_post requestBody: @@ -7163,7 +7200,7 @@ paths: delete: tags: - V1 - summary: Openai Delete Vector Store + summary: Delete a vector store. description: Query endpoint for proper schema generation. operationId: openai_delete_vector_store_v1_vector_stores__vector_store_id__delete parameters: @@ -7173,6 +7210,7 @@ paths: schema: type: string title: Vector Store Id + description: The ID of the vector store to delete. responses: '200': description: A VectorStoreDeleteResponse indicating the deletion status. @@ -7195,7 +7233,7 @@ paths: get: tags: - V1 - summary: Openai Retrieve Vector Store + summary: Retrieves a vector store. description: Query endpoint for proper schema generation. operationId: openai_retrieve_vector_store_v1_vector_stores__vector_store_id__get parameters: @@ -7205,6 +7243,7 @@ paths: schema: type: string title: Vector Store Id + description: The ID of the vector store to retrieve. responses: '200': description: A VectorStoreObject representing the vector store. @@ -7227,7 +7266,7 @@ paths: post: tags: - V1 - summary: Openai Update Vector Store + summary: Updates a vector store. description: Typed endpoint for proper schema generation. operationId: openai_update_vector_store_v1_vector_stores__vector_store_id__post requestBody: @@ -7261,12 +7300,12 @@ paths: required: true schema: type: string - description: 'Path parameter: vector_store_id' + description: The ID of the vector store to update. /v1/vector_stores/{vector_store_id}/file_batches: post: tags: - V1 - summary: Openai Create Vector Store File Batch + summary: Create a vector store file batch. description: Typed endpoint for proper schema generation. operationId: openai_create_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches_post requestBody: @@ -7300,12 +7339,12 @@ paths: required: true schema: type: string - description: 'Path parameter: vector_store_id' + description: The ID of the vector store to create the file batch for. /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: get: tags: - V1 - summary: Openai Retrieve Vector Store File Batch + summary: Retrieve a vector store file batch. description: Query endpoint for proper schema generation. operationId: openai_retrieve_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__get parameters: @@ -7315,12 +7354,14 @@ paths: schema: type: string title: Batch Id + description: The ID of the file batch to retrieve. - name: vector_store_id in: path required: true schema: type: string title: Vector Store Id + description: The ID of the vector store containing the file batch. responses: '200': description: A VectorStoreFileBatchObject representing the file batch. @@ -7344,7 +7385,7 @@ paths: post: tags: - V1 - summary: Openai Cancel Vector Store File Batch + summary: Cancels a vector store file batch. description: Typed endpoint for proper schema generation. operationId: openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post requestBody: @@ -7373,38 +7414,26 @@ paths: description: Default Response $ref: '#/components/responses/DefaultError' parameters: - - name: vector_store_id + - name: batch_id in: path required: true schema: type: string - description: 'Path parameter: vector_store_id' - - name: batch_id + description: The ID of the file batch to cancel. + - name: vector_store_id in: path required: true schema: type: string - description: 'Path parameter: batch_id' + description: The ID of the vector store containing the file batch. /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: get: tags: - V1 - summary: Openai List Files In Vector Store File Batch + summary: Returns a list of vector store files in a batch. description: Query endpoint for proper schema generation. operationId: openai_list_files_in_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get parameters: - - name: batch_id - in: path - required: true - schema: - type: string - title: Batch Id - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - name: after in: query required: true @@ -7437,6 +7466,20 @@ paths: type: string default: desc title: Order + - name: batch_id + in: path + required: true + schema: + type: string + title: Batch Id + description: The ID of the file batch to list files from. + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + description: The ID of the vector store containing the file batch. responses: '200': description: A VectorStoreFilesListInBatchResponse containing the list of files in the batch. @@ -7460,16 +7503,10 @@ paths: get: tags: - V1 - summary: Openai List Files In Vector Store + summary: List files in a vector store. description: Query endpoint for proper schema generation. operationId: openai_list_files_in_vector_store_v1_vector_stores__vector_store_id__files_get parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - name: after in: query required: true @@ -7502,6 +7539,13 @@ paths: type: string default: desc title: Order + - name: vector_store_id + in: path + required: true + schema: + type: string + title: Vector Store Id + description: The ID of the vector store to list files from. responses: '200': description: A VectorStoreListFilesResponse containing the list of files. @@ -7524,7 +7568,7 @@ paths: post: tags: - V1 - summary: Openai Attach File To Vector Store + summary: Attach a file to a vector store. description: Typed endpoint for proper schema generation. operationId: openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post requestBody: @@ -7558,27 +7602,29 @@ paths: required: true schema: type: string - description: 'Path parameter: vector_store_id' + description: The ID of the vector store to attach the file to. /v1/vector_stores/{vector_store_id}/files/{file_id}: delete: tags: - V1 - summary: Openai Delete Vector Store File + summary: Delete a vector store file. description: Query endpoint for proper schema generation. operationId: openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete parameters: - - name: file_id + - name: vector_store_id in: path required: true schema: type: string - title: File Id - - name: vector_store_id + title: Vector Store Id + description: The ID of the vector store containing the file to delete. + - name: file_id in: path required: true schema: type: string - title: Vector Store Id + title: File Id + description: The ID of the file to delete. responses: '200': description: A VectorStoreFileDeleteResponse indicating the deletion status. @@ -7601,22 +7647,24 @@ paths: get: tags: - V1 - summary: Openai Retrieve Vector Store File + summary: Retrieves a vector store file. description: Query endpoint for proper schema generation. operationId: openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get parameters: - - name: file_id + - name: vector_store_id in: path required: true schema: type: string - title: File Id - - name: vector_store_id + title: Vector Store Id + description: The ID of the vector store containing the file to retrieve. + - name: file_id in: path required: true schema: type: string - title: Vector Store Id + title: File Id + description: The ID of the file to retrieve. responses: '200': description: A VectorStoreFileObject representing the file. @@ -7639,7 +7687,7 @@ paths: post: tags: - V1 - summary: Openai Update Vector Store File + summary: Updates a vector store file. description: Typed endpoint for proper schema generation. operationId: openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post requestBody: @@ -7673,33 +7721,35 @@ paths: required: true schema: type: string - description: 'Path parameter: vector_store_id' + description: The ID of the vector store containing the file to update. - name: file_id in: path required: true schema: type: string - description: 'Path parameter: file_id' + description: The ID of the file to update. /v1/vector_stores/{vector_store_id}/files/{file_id}/content: get: tags: - V1 - summary: Openai Retrieve Vector Store File Contents + summary: Retrieves the contents of a vector store file. description: Query endpoint for proper schema generation. operationId: openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get parameters: - - name: file_id + - name: vector_store_id in: path required: true schema: type: string - title: File Id - - name: vector_store_id + title: Vector Store Id + description: The ID of the vector store containing the file to retrieve. + - name: file_id in: path required: true schema: type: string - title: Vector Store Id + title: File Id + description: The ID of the file to retrieve. responses: '200': description: A list of InterleavedContent representing the file contents. @@ -7723,7 +7773,7 @@ paths: post: tags: - V1 - summary: Openai Search Vector Store + summary: Search for chunks in a vector store. description: Typed endpoint for proper schema generation. operationId: openai_search_vector_store_v1_vector_stores__vector_store_id__search_post requestBody: @@ -7757,12 +7807,12 @@ paths: required: true schema: type: string - description: 'Path parameter: vector_store_id' + description: The ID of the vector store to search. /v1/version: get: tags: - V1 - summary: Version + summary: Get version. description: Response-only endpoint for proper schema generation. operationId: version_v1_version_get responses: @@ -7799,7 +7849,7 @@ components: required: - config title: AgentCandidate - description: "An agent candidate for evaluation.\n\n:param config: The configuration for the agent candidate." + description: An agent candidate for evaluation. AgentConfig: properties: sampling_params: @@ -7866,7 +7916,7 @@ components: - model - instructions title: AgentConfig - description: "Configuration for an agent.\n\n:param model: The model identifier to use for the agent\n:param instructions: The system instructions for the agent\n:param name: Optional name for the agent, used in telemetry and identification\n:param enable_session_persistence: Optional flag indicating whether session data has to be persisted\n:param response_format: Optional response format configuration" + description: Configuration for an agent. AgentCreateResponse: properties: agent_id: @@ -7876,7 +7926,7 @@ components: required: - agent_id title: AgentCreateResponse - description: "Response returned when creating a new agent.\n\n:param agent_id: Unique identifier for the created agent" + description: Response returned when creating a new agent. AgentSessionCreateResponse: properties: session_id: @@ -7886,7 +7936,7 @@ components: required: - session_id title: AgentSessionCreateResponse - description: "Response returned when creating a new agent session.\n\n:param session_id: Unique identifier for the created session" + description: Response returned when creating a new agent session. AgentToolGroupWithArgs: properties: name: @@ -7910,7 +7960,7 @@ components: default: agent_turn_input type: object title: AgentTurnInputType - description: "Parameter type for agent turn input.\n\n:param type: Discriminator type. Always \"agent_turn_input\"" + description: Parameter type for agent turn input. AggregationFunctionType: type: string enum: @@ -7920,7 +7970,7 @@ components: - categorical_count - accuracy title: AggregationFunctionType - description: "Types of aggregation functions for scoring results.\n:cvar average: Calculate the arithmetic mean of scores\n:cvar weighted_average: Calculate a weighted average of scores\n:cvar median: Calculate the median value of scores\n:cvar categorical_count: Count occurrences of categorical values\n:cvar accuracy: Calculate accuracy as the proportion of correct answers" + description: Types of aggregation functions for scoring results. AllowedToolsFilter: properties: tool_names: @@ -7930,7 +7980,7 @@ components: type: array type: object title: AllowedToolsFilter - description: "Filter configuration for restricting which MCP tools can be used.\n\n:param tool_names: (Optional) List of specific tool names that are allowed" + description: Filter configuration for restricting which MCP tools can be used. ApprovalFilter: properties: always: @@ -7945,7 +7995,7 @@ components: type: array type: object title: ApprovalFilter - description: "Filter configuration for MCP tool approval requirements.\n\n:param always: (Optional) List of tool names that always require approval\n:param never: (Optional) List of tool names that never require approval" + description: Filter configuration for MCP tool approval requirements. ArrayType: properties: type: @@ -7955,7 +8005,7 @@ components: default: array type: object title: ArrayType - description: "Parameter type for array values.\n\n:param type: Discriminator type. Always \"array\"" + description: Parameter type for array values. Attachment-Output: properties: content: @@ -7989,7 +8039,7 @@ components: - content - mime_type title: Attachment - description: "An attachment to an agent turn.\n\n:param content: The content of the attachment.\n:param mime_type: The MIME type of the attachment." + description: An attachment to an agent turn. BasicScoringFnParams: properties: type: @@ -8005,7 +8055,7 @@ components: description: Aggregation functions to apply to the scores of each row type: object title: BasicScoringFnParams - description: "Parameters for basic scoring function configuration.\n:param type: The type of scoring function parameters, always basic\n:param aggregation_functions: Aggregation functions to apply to the scores of each row" + description: Parameters for basic scoring function configuration. Batch: properties: id: @@ -8192,7 +8242,7 @@ components: - dataset_id - scoring_functions title: Benchmark - description: "A benchmark resource for evaluating model performance.\n\n:param dataset_id: Identifier of the dataset to use for the benchmark evaluation\n:param scoring_functions: List of scoring function identifiers to apply during evaluation\n:param metadata: Metadata for this evaluation task\n:param type: The resource type, always benchmark" + description: A benchmark resource for evaluating model performance. BenchmarkConfig: properties: eval_candidate: @@ -8228,7 +8278,7 @@ components: required: - eval_candidate title: BenchmarkConfig - description: "A benchmark configuration for evaluation.\n\n:param eval_candidate: The candidate to evaluate.\n:param scoring_params: Map between scoring function id and parameters for each scoring function you want to run\n:param num_examples: (Optional) The number of examples to evaluate. If not provided, all examples in the dataset will be evaluated" + description: A benchmark configuration for evaluation. BooleanType: properties: type: @@ -8238,7 +8288,7 @@ components: default: boolean type: object title: BooleanType - description: "Parameter type for boolean values.\n\n:param type: Discriminator type. Always \"boolean\"" + description: Parameter type for boolean values. BuiltinTool: type: string enum: @@ -8256,7 +8306,7 @@ components: default: chat_completion_input type: object title: ChatCompletionInputType - description: "Parameter type for chat completion input.\n\n:param type: Discriminator type. Always \"chat_completion_input\"" + description: Parameter type for chat completion input. Chunk-Output: properties: content: @@ -8300,7 +8350,7 @@ components: - content - chunk_id title: Chunk - description: "A chunk of content that can be inserted into a vector database.\n:param content: The content of the chunk, which can be interleaved text, images, or other types.\n:param chunk_id: Unique identifier for the chunk. Must be provided explicitly.\n:param metadata: Metadata associated with the chunk that will be used in the model context during inference.\n:param embedding: Optional embedding for the chunk. If not provided, it will be computed later.\n:param chunk_metadata: Metadata for the chunk that will NOT be used in the context during inference.\n The `chunk_metadata` is required backend functionality." + description: A chunk of content that can be inserted into a vector database. ChunkMetadata: properties: chunk_id: @@ -8338,7 +8388,7 @@ components: type: integer type: object title: ChunkMetadata - description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference.\n:param chunk_id: The ID of the chunk. If not set, it will be generated based on the document ID and content.\n:param document_id: The ID of the document this chunk belongs to.\n:param source: The source of the content, such as a URL, file path, or other identifier.\n:param created_timestamp: An optional timestamp indicating when the chunk was created.\n:param updated_timestamp: An optional timestamp indicating when the chunk was last updated.\n:param chunk_window: The window of the chunk, which can be used to group related chunks together.\n:param chunk_tokenizer: The tokenizer used to create the chunk. Default is Tiktoken.\n:param chunk_embedding_model: The embedding model used to create the chunk's embedding.\n:param chunk_embedding_dimension: The dimension of the embedding vector for the chunk.\n:param content_token_count: The number of tokens in the content of the chunk.\n:param metadata_token_count: The number of tokens in the metadata of the chunk." + description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." CompletionInputType: properties: type: @@ -8348,7 +8398,7 @@ components: default: completion_input type: object title: CompletionInputType - description: "Parameter type for completion input.\n\n:param type: Discriminator type. Always \"completion_input\"" + description: Parameter type for completion input. CompletionMessage-Output: properties: role: @@ -8390,7 +8440,7 @@ components: - content - stop_reason title: CompletionMessage - description: "A message containing the model's (assistant) response in a chat conversation.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param stop_reason: Reason why the model stopped generating. Options are:\n - `StopReason.end_of_turn`: The model finished generating the entire response.\n - `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n - `StopReason.out_of_tokens`: The model ran out of token budget.\n:param tool_calls: List of tool calls. Each tool call is a ToolCall object." + description: A message containing the model's (assistant) response in a chat conversation. Conversation: properties: id: @@ -8502,7 +8552,7 @@ components: required: - beta title: DPOAlignmentConfig - description: "Configuration for Direct Preference Optimization (DPO) alignment.\n\n:param beta: Temperature parameter for the DPO loss\n:param loss_type: The type of loss function to use for DPO" + description: Configuration for Direct Preference Optimization (DPO) alignment. DPOLossType: type: string enum: @@ -8542,7 +8592,7 @@ components: - shuffle - data_format title: DataConfig - description: "Configuration for training data and data loading.\n\n:param dataset_id: Unique identifier for the training dataset\n:param batch_size: Number of samples per training batch\n:param shuffle: Whether to shuffle the dataset during training\n:param data_format: Format of the dataset (instruct or dialog)\n:param validation_dataset_id: (Optional) Unique identifier for the validation dataset\n:param packed: (Optional) Whether to pack multiple samples into a single sequence for efficiency\n:param train_on_input: (Optional) Whether to compute loss on input tokens as well as output tokens" + description: Configuration for training data and data loading. Dataset: properties: identifier: @@ -8586,14 +8636,14 @@ components: - purpose - source title: Dataset - description: "Dataset resource for storing and accessing training or evaluation data.\n\n:param type: Type of resource, always 'dataset' for datasets" + description: Dataset resource for storing and accessing training or evaluation data. DatasetFormat: type: string enum: - instruct - dialog title: DatasetFormat - description: "Format of the training dataset.\n:cvar instruct: Instruction-following format with prompt and completion\n:cvar dialog: Multi-turn conversation format with messages" + description: Format of the training dataset. DatasetPurpose: type: string enum: @@ -8601,7 +8651,7 @@ components: - eval/question-answer - eval/messages-answer title: DatasetPurpose - description: "Purpose of the dataset. Each purpose has a required input data schema.\n\n:cvar post-training/messages: The dataset contains messages used for post-training.\n {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello, world!\"},\n {\"role\": \"assistant\", \"content\": \"Hello, world!\"},\n ]\n }\n:cvar eval/question-answer: The dataset contains a question column and an answer column.\n {\n \"question\": \"What is the capital of France?\",\n \"answer\": \"Paris\"\n }\n:cvar eval/messages-answer: The dataset contains a messages column with list of messages and an answer column.\n {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello, my name is John Doe.\"},\n {\"role\": \"assistant\", \"content\": \"Hello, John Doe. How can I help you today?\"},\n {\"role\": \"user\", \"content\": \"What's my name?\"},\n ],\n \"answer\": \"John Doe\"\n }" + description: Purpose of the dataset. Each purpose has a required input data schema. DefaultRAGQueryGeneratorConfig: properties: type: @@ -8615,7 +8665,7 @@ components: default: ' ' type: object title: DefaultRAGQueryGeneratorConfig - description: "Configuration for the default RAG query generator.\n\n:param type: Type of query generator, always 'default'\n:param separator: String separator used to join query terms" + description: Configuration for the default RAG query generator. Document: properties: content: @@ -8649,7 +8699,7 @@ components: - content - mime_type title: Document - description: "A document to be used by an agent.\n\n:param content: The content of the document.\n:param mime_type: The MIME type of the document." + description: A document to be used by an agent. EfficiencyConfig: properties: enable_activation_checkpointing: @@ -8670,7 +8720,7 @@ components: type: boolean type: object title: EfficiencyConfig - description: "Configuration for memory and compute efficiency optimizations.\n\n:param enable_activation_checkpointing: (Optional) Whether to use activation checkpointing to reduce memory usage\n:param enable_activation_offloading: (Optional) Whether to offload activations to CPU to save GPU memory\n:param memory_efficient_fsdp_wrap: (Optional) Whether to use memory-efficient FSDP wrapping\n:param fsdp_cpu_offload: (Optional) Whether to offload FSDP parameters to CPU" + description: Configuration for memory and compute efficiency optimizations. Errors: properties: data: @@ -8702,7 +8752,7 @@ components: - generations - scores title: EvaluateResponse - description: "The response from an evaluation.\n\n:param generations: The generations from the evaluation.\n:param scores: The scores from the evaluation." + description: The response from an evaluation. GrammarResponseFormat: properties: type: @@ -8718,7 +8768,7 @@ components: required: - bnf title: GrammarResponseFormat - description: "Configuration for grammar-guided response generation.\n\n:param type: Must be \"grammar\" to identify this format type\n:param bnf: The BNF grammar specification the response should conform to" + description: Configuration for grammar-guided response generation. GreedySamplingStrategy: properties: type: @@ -8728,7 +8778,7 @@ components: default: greedy type: object title: GreedySamplingStrategy - description: "Greedy sampling strategy that selects the highest probability token at each step.\n\n:param type: Must be \"greedy\" to identify this sampling strategy" + description: Greedy sampling strategy that selects the highest probability token at each step. HealthInfo: properties: status: @@ -8737,7 +8787,7 @@ components: required: - status title: HealthInfo - description: "Health status information for the service.\n\n:param status: Current health status of the service" + description: Health status information for the service. HealthStatus: type: string enum: @@ -8758,7 +8808,7 @@ components: required: - image title: ImageContentItem - description: "A image content item\n\n:param type: Discriminator type of the content item. Always \"image\"\n:param image: Image as a base64 encoded string or an URL" + description: A image content item ImageContentItem-Output: properties: type: @@ -8772,7 +8822,7 @@ components: required: - image title: ImageContentItem - description: "A image content item\n\n:param type: Discriminator type of the content item. Always \"image\"\n:param image: Image as a base64 encoded string or an URL" + description: A image content item InferenceStep-Output: properties: turn_id: @@ -8802,7 +8852,7 @@ components: - step_id - model_response title: InferenceStep - description: "An inference step in an agent turn.\n\n:param model_response: The response from the LLM." + description: An inference step in an agent turn. InputTokensDetails: properties: cached_tokens: @@ -8825,7 +8875,7 @@ components: - job_id - status title: Job - description: "A job execution instance with status tracking.\n\n:param job_id: Unique identifier for the job\n:param status: Current execution status of the job" + description: A job execution instance with status tracking. JobStatus: type: string enum: @@ -8835,7 +8885,7 @@ components: - scheduled - cancelled title: JobStatus - description: "Status of a job execution.\n:cvar completed: Job has finished successfully\n:cvar in_progress: Job is currently running\n:cvar failed: Job has failed during execution\n:cvar scheduled: Job is scheduled but not yet started\n:cvar cancelled: Job was cancelled before completion" + description: Status of a job execution. JsonSchemaResponseFormat: properties: type: @@ -8851,7 +8901,7 @@ components: required: - json_schema title: JsonSchemaResponseFormat - description: "Configuration for JSON schema-guided response generation.\n\n:param type: Must be \"json_schema\" to identify this format type\n:param json_schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model." + description: Configuration for JSON schema-guided response generation. JsonType: properties: type: @@ -8861,7 +8911,7 @@ components: default: json type: object title: JsonType - description: "Parameter type for JSON values.\n\n:param type: Discriminator type. Always \"json\"" + description: Parameter type for JSON values. LLMAsJudgeScoringFnParams: properties: type: @@ -8891,7 +8941,7 @@ components: required: - judge_model title: LLMAsJudgeScoringFnParams - description: "Parameters for LLM-as-judge scoring function configuration.\n:param type: The type of scoring function parameters, always llm_as_judge\n:param judge_model: Identifier of the LLM model to use as a judge for scoring\n:param prompt_template: (Optional) Custom prompt template for the judge model\n:param judge_score_regexes: Regexes to extract the answer from generated response\n:param aggregation_functions: Aggregation functions to apply to the scores of each row" + description: Parameters for LLM-as-judge scoring function configuration. LLMRAGQueryGeneratorConfig: properties: type: @@ -8910,7 +8960,7 @@ components: - model - template title: LLMRAGQueryGeneratorConfig - description: "Configuration for the LLM-based RAG query generator.\n\n:param type: Type of query generator, always 'llm'\n:param model: Name of the language model to use for query generation\n:param template: Template string for formatting the query generation prompt" + description: Configuration for the LLM-based RAG query generator. ListBenchmarksResponse: properties: data: @@ -8933,7 +8983,7 @@ components: required: - data title: ListDatasetsResponse - description: "Response from listing datasets.\n\n:param data: List of datasets" + description: Response from listing datasets. ListModelsResponse: properties: data: @@ -8979,7 +9029,7 @@ components: required: - data title: ListProvidersResponse - description: "Response containing a list of all available providers.\n\n:param data: List of provider information objects" + description: Response containing a list of all available providers. ListRoutesResponse: properties: data: @@ -8991,7 +9041,7 @@ components: required: - data title: ListRoutesResponse - description: "Response containing a list of all available API routes.\n\n:param data: List of available route information objects" + description: Response containing a list of all available API routes. ListScoringFunctionsResponse: properties: data: @@ -9025,7 +9075,7 @@ components: required: - data title: ListToolGroupsResponse - description: "Response containing a list of tool groups.\n\n:param data: List of tool groups" + description: Response containing a list of tool groups. MCPListToolsTool: properties: input_schema: @@ -9043,7 +9093,7 @@ components: - input_schema - name title: MCPListToolsTool - description: "Tool definition returned by MCP list tools operation.\n\n:param input_schema: JSON schema defining the tool's input parameters\n:param name: Name of the tool\n:param description: (Optional) Description of what the tool does" + description: Tool definition returned by MCP list tools operation. MemoryRetrievalStep-Output: properties: turn_id: @@ -9097,7 +9147,7 @@ components: - vector_store_ids - inserted_context title: MemoryRetrievalStep - description: "A memory retrieval step in an agent turn.\n\n:param vector_store_ids: The IDs of the vector databases to retrieve context from.\n:param inserted_context: The context retrieved from the vector databases." + description: A memory retrieval step in an agent turn. Model: properties: identifier: @@ -9130,7 +9180,7 @@ components: - identifier - provider_id title: Model - description: "A model resource representing an AI model registered in Llama Stack.\n\n:param type: The resource type, always 'model' for model resources\n:param model_type: The type of model (LLM or embedding model)\n:param metadata: Any additional metadata for this model\n:param identifier: Unique identifier for this resource in llama stack\n:param provider_resource_id: Unique identifier for this resource in the provider\n:param provider_id: ID of the provider that owns this resource" + description: A model resource representing an AI model registered in Llama Stack. ModelCandidate: properties: type: @@ -9150,7 +9200,7 @@ components: - model - sampling_params title: ModelCandidate - description: "A model candidate for evaluation.\n\n:param model: The model ID to evaluate.\n:param sampling_params: The sampling parameters for the model.\n:param system_message: (Optional) The system message providing instructions or context to the model." + description: A model candidate for evaluation. ModelType: type: string enum: @@ -9158,7 +9208,7 @@ components: - embedding - rerank title: ModelType - description: "Enumeration of supported model types in Llama Stack.\n:cvar llm: Large language model for text generation and completion\n:cvar embedding: Embedding model for converting text to vector representations\n:cvar rerank: Reranking model for reordering documents based on their relevance to a query" + description: Enumeration of supported model types in Llama Stack. ModerationObject: properties: id: @@ -9178,7 +9228,7 @@ components: - model - results title: ModerationObject - description: "A moderation object.\n:param id: The unique identifier for the moderation request.\n:param model: The model used to generate the moderation results.\n:param results: A list of moderation objects" + description: A moderation object. ModerationObjectResults: properties: flagged: @@ -9212,7 +9262,7 @@ components: required: - flagged title: ModerationObjectResults - description: "A moderation object.\n:param flagged: Whether any of the below categories are flagged.\n:param categories: A list of the categories, and whether they are flagged or not.\n:param category_applied_input_types: A list of the categories along with the input type(s) that the score applies to.\n:param category_scores: A list of the categories along with their scores as predicted by model." + description: A moderation object. NumberType: properties: type: @@ -9222,7 +9272,7 @@ components: default: number type: object title: NumberType - description: "Parameter type for numeric values.\n\n:param type: Discriminator type. Always \"number\"" + description: Parameter type for numeric values. ObjectType: properties: type: @@ -9232,7 +9282,7 @@ components: default: object type: object title: ObjectType - description: "Parameter type for object values.\n\n:param type: Discriminator type. Always \"object\"" + description: Parameter type for object values. OpenAIAssistantMessageParam-Input: properties: role: @@ -9257,7 +9307,7 @@ components: type: array type: object title: OpenAIAssistantMessageParam - description: "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param name: (Optional) The name of the assistant message participant.\n:param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object." + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. OpenAIAssistantMessageParam-Output: properties: role: @@ -9282,7 +9332,7 @@ components: type: array type: object title: OpenAIAssistantMessageParam - description: "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param name: (Optional) The name of the assistant message participant.\n:param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object." + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. OpenAIChatCompletion: properties: id: @@ -9313,7 +9363,7 @@ components: - created - model title: OpenAIChatCompletion - description: "Response from an OpenAI-compatible chat completion request.\n\n:param id: The ID of the chat completion\n:param choices: List of choices\n:param object: The object type, which will be \"chat.completion\"\n:param created: The Unix timestamp in seconds when the chat completion was created\n:param model: The model that was used to generate the chat completion\n:param usage: Token usage information for the completion" + description: Response from an OpenAI-compatible chat completion request. OpenAIChatCompletionContentPartImageParam: properties: type: @@ -9327,7 +9377,7 @@ components: required: - image_url title: OpenAIChatCompletionContentPartImageParam - description: "Image content part for OpenAI-compatible chat completion messages.\n\n:param type: Must be \"image_url\" to identify this as image content\n:param image_url: Image URL specification and processing details" + description: Image content part for OpenAI-compatible chat completion messages. OpenAIChatCompletionContentPartTextParam: properties: type: @@ -9342,7 +9392,7 @@ components: required: - text title: OpenAIChatCompletionContentPartTextParam - description: "Text content part for OpenAI-compatible chat completion messages.\n\n:param type: Must be \"text\" to identify this as text content\n:param text: The text content of the message" + description: Text content part for OpenAI-compatible chat completion messages. OpenAIChatCompletionRequestWithExtraBody: properties: model: @@ -9464,7 +9514,7 @@ components: - model - messages title: OpenAIChatCompletionRequestWithExtraBody - description: "Request parameters for OpenAI-compatible chat completion endpoint.\n\n:param model: The identifier of the model to use. The model must be registered with Llama Stack and available via the /models endpoint.\n:param messages: List of messages in the conversation.\n:param frequency_penalty: (Optional) The penalty for repeated tokens.\n:param function_call: (Optional) The function call to use.\n:param functions: (Optional) List of functions to use.\n:param logit_bias: (Optional) The logit bias to use.\n:param logprobs: (Optional) The log probabilities to use.\n:param max_completion_tokens: (Optional) The maximum number of tokens to generate.\n:param max_tokens: (Optional) The maximum number of tokens to generate.\n:param n: (Optional) The number of completions to generate.\n:param parallel_tool_calls: (Optional) Whether to parallelize tool calls.\n:param presence_penalty: (Optional) The penalty for repeated tokens.\n:param response_format: (Optional) The response format to use.\n:param seed: (Optional) The seed to use.\n:param stop: (Optional) The stop tokens to use.\n:param stream: (Optional) Whether to stream the response.\n:param stream_options: (Optional) The stream options to use.\n:param temperature: (Optional) The temperature to use.\n:param tool_choice: (Optional) The tool choice to use.\n:param tools: (Optional) The tools to use.\n:param top_logprobs: (Optional) The top log probabilities to use.\n:param top_p: (Optional) The top p to use.\n:param user: (Optional) The user to use." + description: Request parameters for OpenAI-compatible chat completion endpoint. OpenAIChatCompletionToolCall: properties: index: @@ -9482,7 +9532,7 @@ components: $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' type: object title: OpenAIChatCompletionToolCall - description: "Tool call specification for OpenAI-compatible chat completion responses.\n\n:param index: (Optional) Index of the tool call in the list\n:param id: (Optional) Unique identifier for the tool call\n:param type: Must be \"function\" to identify this as a function call\n:param function: (Optional) Function call details" + description: Tool call specification for OpenAI-compatible chat completion responses. OpenAIChatCompletionToolCallFunction: properties: name: @@ -9493,7 +9543,7 @@ components: type: string type: object title: OpenAIChatCompletionToolCallFunction - description: "Function call details for OpenAI-compatible tool calls.\n\n:param name: (Optional) Name of the function to call\n:param arguments: (Optional) Arguments to pass to the function as a JSON string" + description: Function call details for OpenAI-compatible tool calls. OpenAIChatCompletionUsage: properties: prompt_tokens: @@ -9515,7 +9565,7 @@ components: - completion_tokens - total_tokens title: OpenAIChatCompletionUsage - description: "Usage information for OpenAI chat completion.\n\n:param prompt_tokens: Number of tokens in the prompt\n:param completion_tokens: Number of tokens in the completion\n:param total_tokens: Total tokens used (prompt + completion)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + description: Usage information for OpenAI chat completion. OpenAIChatCompletionUsageCompletionTokensDetails: properties: reasoning_tokens: @@ -9523,7 +9573,7 @@ components: type: integer type: object title: OpenAIChatCompletionUsageCompletionTokensDetails - description: "Token details for output tokens in OpenAI chat completion usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + description: Token details for output tokens in OpenAI chat completion usage. OpenAIChatCompletionUsagePromptTokensDetails: properties: cached_tokens: @@ -9531,7 +9581,7 @@ components: type: integer type: object title: OpenAIChatCompletionUsagePromptTokensDetails - description: "Token details for prompt tokens in OpenAI chat completion usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + description: Token details for prompt tokens in OpenAI chat completion usage. OpenAIChoice-Output: properties: message: @@ -9564,7 +9614,7 @@ components: - finish_reason - index title: OpenAIChoice - description: "A choice from an OpenAI-compatible chat completion response.\n\n:param message: The message from the model\n:param finish_reason: The reason the model stopped generating\n:param index: The index of the choice\n:param logprobs: (Optional) The log probabilities for the tokens in the message" + description: A choice from an OpenAI-compatible chat completion response. OpenAIChoiceLogprobs-Output: properties: content: @@ -9579,7 +9629,7 @@ components: type: array type: object title: OpenAIChoiceLogprobs - description: "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response.\n\n:param content: (Optional) The log probabilities for the tokens in the message\n:param refusal: (Optional) The log probabilities for the tokens in the message" + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. OpenAICompletion: properties: id: @@ -9608,7 +9658,7 @@ components: - created - model title: OpenAICompletion - description: "Response from an OpenAI-compatible completion request.\n\n:id: The ID of the completion\n:choices: List of choices\n:created: The Unix timestamp in seconds when the completion was created\n:model: The model that was used to generate the completion\n:object: The object type, which will be \"text_completion\"" + description: Response from an OpenAI-compatible completion request. OpenAICompletionChoice-Output: properties: finish_reason: @@ -9628,7 +9678,7 @@ components: - text - index title: OpenAICompletionChoice - description: "A choice from an OpenAI-compatible completion response.\n\n:finish_reason: The reason the model stopped generating\n:text: The text of the choice\n:index: The index of the choice\n:logprobs: (Optional) The log probabilities for the tokens in the choice" + description: A choice from an OpenAI-compatible completion response. OpenAICompletionRequestWithExtraBody: properties: model: @@ -9710,7 +9760,7 @@ components: - model - prompt title: OpenAICompletionRequestWithExtraBody - description: "Request parameters for OpenAI-compatible completion endpoint.\n\n:param model: The identifier of the model to use. The model must be registered with Llama Stack and available via the /models endpoint.\n:param prompt: The prompt to generate a completion for.\n:param best_of: (Optional) The number of completions to generate.\n:param echo: (Optional) Whether to echo the prompt.\n:param frequency_penalty: (Optional) The penalty for repeated tokens.\n:param logit_bias: (Optional) The logit bias to use.\n:param logprobs: (Optional) The log probabilities to use.\n:param max_tokens: (Optional) The maximum number of tokens to generate.\n:param n: (Optional) The number of completions to generate.\n:param presence_penalty: (Optional) The penalty for repeated tokens.\n:param seed: (Optional) The seed to use.\n:param stop: (Optional) The stop tokens to use.\n:param stream: (Optional) Whether to stream the response.\n:param stream_options: (Optional) The stream options to use.\n:param temperature: (Optional) The temperature to use.\n:param top_p: (Optional) The top p to use.\n:param user: (Optional) The user to use.\n:param suffix: (Optional) The suffix that should be appended to the completion." + description: Request parameters for OpenAI-compatible completion endpoint. OpenAICreateVectorStoreFileBatchRequestWithExtraBody: properties: file_ids: @@ -9737,7 +9787,7 @@ components: required: - file_ids title: OpenAICreateVectorStoreFileBatchRequestWithExtraBody - description: "Request to create a vector store file batch with extra_body support.\n\n:param file_ids: A list of File IDs that the vector store should use\n:param attributes: (Optional) Key-value attributes to store with the files\n:param chunking_strategy: (Optional) The chunking strategy used to chunk the file(s). Defaults to auto" + description: Request to create a vector store file batch with extra_body support. OpenAICreateVectorStoreRequestWithExtraBody: properties: name: @@ -9763,7 +9813,7 @@ components: additionalProperties: true type: object title: OpenAICreateVectorStoreRequestWithExtraBody - description: "Request to create a vector store with extra_body support.\n\n:param name: (Optional) A name for the vector store\n:param file_ids: List of file IDs to include in the vector store\n:param expires_after: (Optional) Expiration policy for the vector store\n:param chunking_strategy: (Optional) Strategy for splitting files into chunks\n:param metadata: Set of key-value pairs that can be attached to the vector store" + description: Request to create a vector store with extra_body support. OpenAIDeveloperMessageParam: properties: role: @@ -9785,7 +9835,7 @@ components: required: - content title: OpenAIDeveloperMessageParam - description: "A message from the developer in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"developer\" to identify this as a developer message\n:param content: The content of the developer message\n:param name: (Optional) The name of the developer message participant." + description: A message from the developer in an OpenAI-compatible chat completion request. OpenAIEmbeddingData: properties: object: @@ -9808,7 +9858,7 @@ components: - embedding - index title: OpenAIEmbeddingData - description: "A single embedding data object from an OpenAI-compatible embeddings response.\n\n:param object: The object type, which will be \"embedding\"\n:param embedding: The embedding vector as a list of floats (when encoding_format=\"float\") or as a base64-encoded string (when encoding_format=\"base64\")\n:param index: The index of the embedding in the input list" + description: A single embedding data object from an OpenAI-compatible embeddings response. OpenAIEmbeddingUsage: properties: prompt_tokens: @@ -9822,7 +9872,7 @@ components: - prompt_tokens - total_tokens title: OpenAIEmbeddingUsage - description: "Usage information for an OpenAI-compatible embeddings response.\n\n:param prompt_tokens: The number of tokens in the input\n:param total_tokens: The total number of tokens used" + description: Usage information for an OpenAI-compatible embeddings response. OpenAIEmbeddingsRequestWithExtraBody: properties: model: @@ -9851,7 +9901,7 @@ components: - model - input title: OpenAIEmbeddingsRequestWithExtraBody - description: "Request parameters for OpenAI-compatible embeddings endpoint.\n\n:param model: The identifier of the model to use. The model must be an embedding model registered with Llama Stack and available via the /models endpoint.\n:param input: Input text to embed, encoded as a string or array of strings. To embed multiple inputs in a single request, pass an array of strings.\n:param encoding_format: (Optional) The format to return the embeddings in. Can be either \"float\" or \"base64\". Defaults to \"float\".\n:param dimensions: (Optional) The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.\n:param user: (Optional) A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse." + description: Request parameters for OpenAI-compatible embeddings endpoint. OpenAIEmbeddingsResponse: properties: object: @@ -9875,7 +9925,7 @@ components: - model - usage title: OpenAIEmbeddingsResponse - description: "Response from an OpenAI-compatible embeddings request.\n\n:param object: The object type, which will be \"list\"\n:param data: List of embedding data objects\n:param model: The model that was used to generate the embeddings\n:param usage: Usage information" + description: Response from an OpenAI-compatible embeddings request. OpenAIFile: properties: type: @@ -9935,7 +9985,7 @@ components: - filename - purpose title: OpenAIFileObject - description: "OpenAI File object as defined in the OpenAI Files API.\n\n:param object: The object type, which is always \"file\"\n:param id: The file identifier, which can be referenced in the API endpoints\n:param bytes: The size of the file, in bytes\n:param created_at: The Unix timestamp (in seconds) for when the file was created\n:param expires_at: The Unix timestamp (in seconds) for when the file expires\n:param filename: The name of the file\n:param purpose: The intended purpose of the file" + description: OpenAI File object as defined in the OpenAI Files API. OpenAIFilePurpose: type: string enum: @@ -9955,7 +10005,7 @@ components: required: - url title: OpenAIImageURL - description: "Image URL specification for OpenAI-compatible chat completion messages.\n\n:param url: URL of the image to include in the message\n:param detail: (Optional) Level of detail for image processing. Can be \"low\", \"high\", or \"auto\"" + description: Image URL specification for OpenAI-compatible chat completion messages. OpenAIJSONSchema: properties: name: @@ -9973,7 +10023,7 @@ components: type: object type: object title: OpenAIJSONSchema - description: "JSON schema specification for OpenAI-compatible structured response format.\n\n:param name: Name of the schema\n:param description: (Optional) Description of the schema\n:param strict: (Optional) Whether to enforce strict adherence to the schema\n:param schema: (Optional) The JSON schema definition" + description: JSON schema specification for OpenAI-compatible structured response format. OpenAIResponseAnnotationCitation: properties: type: @@ -10000,7 +10050,7 @@ components: - title - url title: OpenAIResponseAnnotationCitation - description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + description: URL citation annotation for referencing external web resources. OpenAIResponseAnnotationContainerFileCitation: properties: type: @@ -10053,7 +10103,7 @@ components: - filename - index title: OpenAIResponseAnnotationFileCitation - description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + description: File citation annotation for referencing specific files in response content. OpenAIResponseAnnotationFilePath: properties: type: @@ -10086,7 +10136,7 @@ components: required: - refusal title: OpenAIResponseContentPartRefusal - description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + description: Refusal content within a streamed response part. OpenAIResponseError: properties: code: @@ -10100,7 +10150,7 @@ components: - code - message title: OpenAIResponseError - description: "Error details for failed OpenAI response requests.\n\n:param code: Error code identifying the type of failure\n:param message: Human-readable error message describing the failure" + description: Error details for failed OpenAI response requests. OpenAIResponseFormatJSONObject: properties: type: @@ -10110,7 +10160,7 @@ components: default: json_object type: object title: OpenAIResponseFormatJSONObject - description: "JSON object response format for OpenAI-compatible chat completion requests.\n\n:param type: Must be \"json_object\" to indicate generic JSON object response format" + description: JSON object response format for OpenAI-compatible chat completion requests. OpenAIResponseFormatJSONSchema: properties: type: @@ -10124,7 +10174,7 @@ components: required: - json_schema title: OpenAIResponseFormatJSONSchema - description: "JSON schema response format for OpenAI-compatible chat completion requests.\n\n:param type: Must be \"json_schema\" to indicate structured JSON response format\n:param json_schema: The JSON schema specification for the response" + description: JSON schema response format for OpenAI-compatible chat completion requests. OpenAIResponseFormatText: properties: type: @@ -10134,7 +10184,7 @@ components: default: text type: object title: OpenAIResponseFormatText - description: "Text response format for OpenAI-compatible chat completion requests.\n\n:param type: Must be \"text\" to indicate plain text response format" + description: Text response format for OpenAI-compatible chat completion requests. OpenAIResponseInputFunctionToolCallOutput: properties: call_id: @@ -10181,7 +10231,7 @@ components: type: string type: object title: OpenAIResponseInputMessageContentFile - description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + description: File content for input messages in OpenAI response format. OpenAIResponseInputMessageContentImage: properties: detail: @@ -10207,7 +10257,7 @@ components: type: string type: object title: OpenAIResponseInputMessageContentImage - description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + description: Image content for input messages in OpenAI response format. OpenAIResponseInputMessageContentText: properties: text: @@ -10222,7 +10272,7 @@ components: required: - text title: OpenAIResponseInputMessageContentText - description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + description: Text content for input messages in OpenAI response format. OpenAIResponseInputToolFileSearch: properties: type: @@ -10251,7 +10301,7 @@ components: required: - vector_store_ids title: OpenAIResponseInputToolFileSearch - description: "File search tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"file_search\"\n:param vector_store_ids: List of vector store identifiers to search within\n:param filters: (Optional) Additional filters to apply to the search\n:param max_num_results: (Optional) Maximum number of search results to return (1-50)\n:param ranking_options: (Optional) Options for ranking and scoring search results" + description: File search tool configuration for OpenAI response inputs. OpenAIResponseInputToolFunction: properties: type: @@ -10277,7 +10327,7 @@ components: - name - parameters title: OpenAIResponseInputToolFunction - description: "Function tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"function\"\n:param name: Name of the function that can be called\n:param description: (Optional) Description of what the function does\n:param parameters: (Optional) JSON schema defining the function's parameters\n:param strict: (Optional) Whether to enforce strict parameter validation" + description: Function tool configuration for OpenAI response inputs. OpenAIResponseInputToolMCP: properties: type: @@ -10316,7 +10366,7 @@ components: - server_label - server_url title: OpenAIResponseInputToolMCP - description: "Model Context Protocol (MCP) tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param server_url: URL endpoint of the MCP server\n:param headers: (Optional) HTTP headers to include when connecting to the server\n:param require_approval: Approval requirement for tool calls (\"always\", \"never\", or filter)\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + description: Model Context Protocol (MCP) tool configuration for OpenAI response inputs. OpenAIResponseInputToolWebSearch: properties: type: @@ -10336,7 +10386,7 @@ components: pattern: ^low|medium|high$ type: object title: OpenAIResponseInputToolWebSearch - description: "Web search tool configuration for OpenAI response inputs.\n\n:param type: Web search tool type variant to use\n:param search_context_size: (Optional) Size of search context, must be \"low\", \"medium\", or \"high\"" + description: Web search tool configuration for OpenAI response inputs. OpenAIResponseMCPApprovalRequest: properties: arguments: @@ -10598,7 +10648,7 @@ components: - output - status title: OpenAIResponseObject - description: "Complete OpenAI response object containing generation results and metadata.\n\n:param created_at: Unix timestamp when the response was created\n:param error: (Optional) Error details if the response generation failed\n:param id: Unique identifier for this response\n:param model: Model identifier used for generation\n:param object: Object type identifier, always \"response\"\n:param output: List of generated output items (messages, tool calls, etc.)\n:param parallel_tool_calls: Whether tool calls can be executed in parallel\n:param previous_response_id: (Optional) ID of the previous response in a conversation\n:param prompt: (Optional) Reference to a prompt template and its variables.\n:param status: Current status of the response generation\n:param temperature: (Optional) Sampling temperature used for generation\n:param text: Text formatting configuration for the response\n:param top_p: (Optional) Nucleus sampling parameter used for generation\n:param tools: (Optional) An array of tools the model may call while generating a response.\n:param truncation: (Optional) Truncation strategy applied to the response\n:param usage: (Optional) Token usage information for the response\n:param instructions: (Optional) System message inserted into the model's context" + description: Complete OpenAI response object containing generation results and metadata. OpenAIResponseOutputMessageContentOutputText: properties: text: @@ -10658,7 +10708,7 @@ components: - queries - status title: OpenAIResponseOutputMessageFileSearchToolCall - description: "File search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param queries: List of search queries executed\n:param status: Current status of the file search operation\n:param type: Tool call type identifier, always \"file_search_call\"\n:param results: (Optional) Search results returned by the file search operation" + description: File search tool call output message for OpenAI responses. OpenAIResponseOutputMessageFileSearchToolCallResults: properties: attributes: @@ -10685,7 +10735,7 @@ components: - score - text title: OpenAIResponseOutputMessageFileSearchToolCallResults - description: "Search results returned by the file search operation.\n\n:param attributes: (Optional) Key-value attributes associated with the file\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result (between 0 and 1)\n:param text: Text content of the search result" + description: Search results returned by the file search operation. OpenAIResponseOutputMessageFunctionToolCall: properties: call_id: @@ -10714,7 +10764,7 @@ components: - name - arguments title: OpenAIResponseOutputMessageFunctionToolCall - description: "Function tool call output message for OpenAI responses.\n\n:param call_id: Unique identifier for the function call\n:param name: Name of the function being called\n:param arguments: JSON string containing the function arguments\n:param type: Tool call type identifier, always \"function_call\"\n:param id: (Optional) Additional identifier for the tool call\n:param status: (Optional) Current status of the function call execution" + description: Function tool call output message for OpenAI responses. OpenAIResponseOutputMessageMCPCall: properties: id: @@ -10747,7 +10797,7 @@ components: - name - server_label title: OpenAIResponseOutputMessageMCPCall - description: "Model Context Protocol (MCP) call output message for OpenAI responses.\n\n:param id: Unique identifier for this MCP call\n:param type: Tool call type identifier, always \"mcp_call\"\n:param arguments: JSON string containing the MCP call arguments\n:param name: Name of the MCP method being called\n:param server_label: Label identifying the MCP server handling the call\n:param error: (Optional) Error message if the MCP call failed\n:param output: (Optional) Output result from the successful MCP call" + description: Model Context Protocol (MCP) call output message for OpenAI responses. OpenAIResponseOutputMessageMCPListTools: properties: id: @@ -10772,7 +10822,7 @@ components: - server_label - tools title: OpenAIResponseOutputMessageMCPListTools - description: "MCP list tools output message containing available tools from an MCP server.\n\n:param id: Unique identifier for this MCP list tools operation\n:param type: Tool call type identifier, always \"mcp_list_tools\"\n:param server_label: Label identifying the MCP server providing the tools\n:param tools: List of available tools provided by the MCP server" + description: MCP list tools output message containing available tools from an MCP server. OpenAIResponseOutputMessageWebSearchToolCall: properties: id: @@ -10791,7 +10841,7 @@ components: - id - status title: OpenAIResponseOutputMessageWebSearchToolCall - description: "Web search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param status: Current status of the web search operation\n:param type: Tool call type identifier, always \"web_search_call\"" + description: Web search tool call output message for OpenAI responses. OpenAIResponsePrompt: properties: id: @@ -10818,14 +10868,14 @@ components: required: - id title: OpenAIResponsePrompt - description: "OpenAI compatible Prompt object that is used in OpenAI responses.\n\n:param id: Unique identifier of the prompt template\n:param variables: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types\nlike images or files.\n:param version: Version number of the prompt to use (defaults to latest if not specified)" + description: OpenAI compatible Prompt object that is used in OpenAI responses. OpenAIResponseText: properties: format: $ref: '#/components/schemas/OpenAIResponseTextFormat' type: object title: OpenAIResponseText - description: "Text response configuration for OpenAI responses.\n\n:param format: (Optional) Text format configuration specifying output format requirements" + description: Text response configuration for OpenAI responses. OpenAIResponseTextFormat: properties: type: @@ -10852,7 +10902,7 @@ components: type: boolean type: object title: OpenAIResponseTextFormat - description: "Configuration for Responses API text format.\n\n:param type: Must be \"text\", \"json_schema\", or \"json_object\" to identify the format type\n:param name: The name of the response format. Only used for json_schema.\n:param schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model. Only used for json_schema.\n:param description: (Optional) A description of the response format. Only used for json_schema.\n:param strict: (Optional) Whether to strictly enforce the JSON schema. If true, the response must match the schema exactly. Only used for json_schema." + description: Configuration for Responses API text format. OpenAIResponseToolMCP: properties: type: @@ -10874,7 +10924,7 @@ components: required: - server_label title: OpenAIResponseToolMCP - description: "Model Context Protocol (MCP) tool configuration for OpenAI response object.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + description: Model Context Protocol (MCP) tool configuration for OpenAI response object. OpenAIResponseUsage: properties: input_tokens: @@ -10896,7 +10946,7 @@ components: - output_tokens - total_tokens title: OpenAIResponseUsage - description: "Usage information for OpenAI response.\n\n:param input_tokens: Number of tokens in the input\n:param output_tokens: Number of tokens in the output\n:param total_tokens: Total tokens used (input + output)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + description: Usage information for OpenAI response. OpenAIResponseUsageInputTokensDetails: properties: cached_tokens: @@ -10904,7 +10954,7 @@ components: type: integer type: object title: OpenAIResponseUsageInputTokensDetails - description: "Token details for input tokens in OpenAI response usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + description: Token details for input tokens in OpenAI response usage. OpenAIResponseUsageOutputTokensDetails: properties: reasoning_tokens: @@ -10912,7 +10962,7 @@ components: type: integer type: object title: OpenAIResponseUsageOutputTokensDetails - description: "Token details for output tokens in OpenAI response usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + description: Token details for output tokens in OpenAI response usage. OpenAISystemMessageParam: properties: role: @@ -10934,7 +10984,7 @@ components: required: - content title: OpenAISystemMessageParam - description: "A system message providing instructions or context to the model.\n\n:param role: Must be \"system\" to identify this as a system message\n:param content: The content of the \"system prompt\". If multiple system messages are provided, they are concatenated. The underlying Llama Stack code may also add other system messages (for example, for formatting tool definitions).\n:param name: (Optional) The name of the system message participant." + description: A system message providing instructions or context to the model. OpenAITokenLogProb: properties: token: @@ -10959,7 +11009,7 @@ components: - logprob - top_logprobs title: OpenAITokenLogProb - description: "The log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token\n:top_logprobs: The top log probabilities for the token" + description: The log probability for a token from an OpenAI-compatible chat completion response. OpenAIToolMessageParam: properties: role: @@ -10982,7 +11032,7 @@ components: - tool_call_id - content title: OpenAIToolMessageParam - description: "A message representing the result of a tool invocation in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"tool\" to identify this as a tool response\n:param tool_call_id: Unique identifier for the tool call this response is for\n:param content: The response content from the tool" + description: A message representing the result of a tool invocation in an OpenAI-compatible chat completion request. OpenAITopLogProb: properties: token: @@ -11001,7 +11051,7 @@ components: - token - logprob title: OpenAITopLogProb - description: "The top log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token" + description: The top log probability for a token from an OpenAI-compatible chat completion response. OpenAIUserMessageParam-Input: properties: role: @@ -11032,7 +11082,7 @@ components: required: - content title: OpenAIUserMessageParam - description: "A message from the user in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param name: (Optional) The name of the user message participant." + description: A message from the user in an OpenAI-compatible chat completion request. OpenAIUserMessageParam-Output: properties: role: @@ -11063,7 +11113,7 @@ components: required: - content title: OpenAIUserMessageParam - description: "A message from the user in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param name: (Optional) The name of the user message participant." + description: A message from the user in an OpenAI-compatible chat completion request. OptimizerConfig: properties: optimizer_type: @@ -11084,7 +11134,7 @@ components: - weight_decay - num_warmup_steps title: OptimizerConfig - description: "Configuration parameters for the optimization algorithm.\n\n:param optimizer_type: Type of optimizer to use (adam, adamw, or sgd)\n:param lr: Learning rate for the optimizer\n:param weight_decay: Weight decay coefficient for regularization\n:param num_warmup_steps: Number of steps for learning rate warmup" + description: Configuration parameters for the optimization algorithm. OptimizerType: type: string enum: @@ -11092,14 +11142,14 @@ components: - adamw - sgd title: OptimizerType - description: "Available optimizer algorithms for training.\n:cvar adam: Adaptive Moment Estimation optimizer\n:cvar adamw: AdamW optimizer with weight decay\n:cvar sgd: Stochastic Gradient Descent optimizer" + description: Available optimizer algorithms for training. Order: type: string enum: - asc - desc title: Order - description: "Sort order for paginated responses.\n:cvar asc: Ascending order\n:cvar desc: Descending order" + description: Sort order for paginated responses. OutputTokensDetails: properties: reasoning_tokens: @@ -11150,7 +11200,7 @@ components: - version - prompt_id title: Prompt - description: "A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack.\n\n:param prompt: The system prompt text with variable placeholders. Variables are only supported when using the Responses API.\n:param version: Version (integer starting at 1, incremented on save)\n:param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>'\n:param variables: List of prompt variable names that can be used in the prompt template\n:param is_default: Boolean indicating whether this version is the default version for this prompt" + description: A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack. ProviderInfo: properties: api: @@ -11178,7 +11228,7 @@ components: - config - health title: ProviderInfo - description: "Information about a registered provider including its configuration and health status.\n\n:param api: The API name this provider implements\n:param provider_id: Unique identifier for the provider\n:param provider_type: The type of provider implementation\n:param config: Configuration parameters for the provider\n:param health: Current health status of the provider" + description: Information about a registered provider including its configuration and health status. QueryChunksResponse: properties: chunks: @@ -11196,7 +11246,7 @@ components: - chunks - scores title: QueryChunksResponse - description: "Response from querying chunks in a vector database.\n\n:param chunks: List of content chunks returned from the query\n:param scores: Relevance scores corresponding to each returned chunk" + description: Response from querying chunks in a vector database. RAGQueryConfig: properties: query_generator_config: @@ -11239,7 +11289,7 @@ components: weighted: '#/components/schemas/WeightedRanker' type: object title: RAGQueryConfig - description: "Configuration for the RAG query generation.\n\n:param query_generator_config: Configuration for the query generator.\n:param max_tokens_in_context: Maximum number of tokens in the context.\n:param max_chunks: Maximum number of chunks to retrieve.\n:param chunk_template: Template for formatting each retrieved chunk in the context.\n Available placeholders: {index} (1-based chunk ordinal), {chunk.content} (chunk content string), {metadata} (chunk metadata dict).\n Default: \"Result {index}\\nContent: {chunk.content}\\nMetadata: {metadata}\\n\"\n:param mode: Search mode for retrieval—either \"vector\", \"keyword\", or \"hybrid\". Default \"vector\".\n:param ranker: Configuration for the ranker to use in hybrid search. Defaults to RRF ranker." + description: Configuration for the RAG query generation. RAGQueryResult: properties: content: @@ -11270,7 +11320,7 @@ components: title: Metadata type: object title: RAGQueryResult - description: "Result of a RAG query containing retrieved content and metadata.\n\n:param content: (Optional) The retrieved content from the query\n:param metadata: Additional metadata about the query result" + description: Result of a RAG query containing retrieved content and metadata. RAGSearchMode: type: string enum: @@ -11293,7 +11343,7 @@ components: minimum: 0.0 type: object title: RRFRanker - description: "Reciprocal Rank Fusion (RRF) ranker configuration.\n\n:param type: The type of ranker, always \"rrf\"\n:param impact_factor: The impact factor for RRF scoring. Higher values give more weight to higher-ranked results.\n Must be greater than 0" + description: Reciprocal Rank Fusion (RRF) ranker configuration. RegexParserScoringFnParams: properties: type: @@ -11315,7 +11365,7 @@ components: description: Aggregation functions to apply to the scores of each row type: object title: RegexParserScoringFnParams - description: "Parameters for regex parser scoring function configuration.\n:param type: The type of scoring function parameters, always regex_parser\n:param parsing_regexes: Regex to extract the answer from generated response\n:param aggregation_functions: Aggregation functions to apply to the scores of each row" + description: Parameters for regex parser scoring function configuration. RerankData: properties: index: @@ -11329,7 +11379,7 @@ components: - index - relevance_score title: RerankData - description: "A single rerank result from a reranking response.\n\n:param index: The original index of the document in the input list\n:param relevance_score: The relevance score from the model output. Values are inverted when applicable so that higher scores indicate greater relevance." + description: A single rerank result from a reranking response. RerankResponse: properties: data: @@ -11341,7 +11391,7 @@ components: required: - data title: RerankResponse - description: "Response from a reranking request.\n\n:param data: List of rerank result objects, sorted by relevance score (descending)" + description: Response from a reranking request. RouteInfo: properties: route: @@ -11361,7 +11411,7 @@ components: - method - provider_types title: RouteInfo - description: "Information about an API route including its path, method, and implementing providers.\n\n:param route: The API endpoint path\n:param method: HTTP method for the route\n:param provider_types: List of provider types that implement this route" + description: Information about an API route including its path, method, and implementing providers. RowsDataSource: properties: type: @@ -11379,14 +11429,14 @@ components: required: - rows title: RowsDataSource - description: "A dataset stored in rows.\n:param rows: The dataset is stored in rows. E.g.\n - [\n {\"messages\": [{\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}]}\n ]" + description: A dataset stored in rows. RunShieldResponse: properties: violation: $ref: '#/components/schemas/SafetyViolation' type: object title: RunShieldResponse - description: "Response from running a safety shield.\n\n:param violation: (Optional) Safety violation detected by the shield, if any" + description: Response from running a safety shield. SafetyViolation: properties: violation_level: @@ -11402,7 +11452,7 @@ components: required: - violation_level title: SafetyViolation - description: "Details of a safety violation detected by content moderation.\n\n:param violation_level: Severity level of the violation\n:param user_message: (Optional) Message to convey to the user about the violation\n:param metadata: Additional metadata including specific violation codes for debugging and telemetry" + description: Details of a safety violation detected by content moderation. SamplingParams: properties: strategy: @@ -11431,7 +11481,7 @@ components: type: array type: object title: SamplingParams - description: "Sampling parameters.\n\n:param strategy: The sampling strategy.\n:param max_tokens: The maximum number of tokens that can be generated in the completion. The token count of\n your prompt plus max_tokens cannot exceed the model's context length.\n:param repetition_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens\n based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.\n:param stop: Up to 4 sequences where the API will stop generating further tokens.\n The returned text will not contain the stop sequence." + description: Sampling parameters. ScoreBatchResponse: properties: dataset_id: @@ -11446,7 +11496,7 @@ components: required: - results title: ScoreBatchResponse - description: "Response from batch scoring operations on datasets.\n\n:param dataset_id: (Optional) The identifier of the dataset that was scored\n:param results: A map of scoring function name to ScoringResult" + description: Response from batch scoring operations on datasets. ScoreResponse: properties: results: @@ -11458,7 +11508,7 @@ components: required: - results title: ScoreResponse - description: "The response from scoring.\n\n:param results: A map of scoring function name to ScoringResult." + description: The response from scoring. ScoringFn-Output: properties: identifier: @@ -11532,7 +11582,7 @@ components: - provider_id - return_type title: ScoringFn - description: "A scoring function resource for evaluating model outputs.\n:param type: The resource type, always scoring_function" + description: A scoring function resource for evaluating model outputs. ScoringResult: properties: score_rows: @@ -11550,7 +11600,7 @@ components: - score_rows - aggregated_results title: ScoringResult - description: "A scoring result for a single row.\n\n:param score_rows: The scoring result for each row. Each row is a map of column name to value.\n:param aggregated_results: Map of metric name to aggregated value" + description: A scoring result for a single row. SearchRankingOptions: properties: ranker: @@ -11562,7 +11612,7 @@ components: type: number type: object title: SearchRankingOptions - description: "Options for ranking and filtering search results.\n\n:param ranker: (Optional) Name of the ranking algorithm to use\n:param score_threshold: (Optional) Minimum relevance score threshold for results" + description: Options for ranking and filtering search results. Shield: properties: identifier: @@ -11591,7 +11641,7 @@ components: - identifier - provider_id title: Shield - description: "A safety shield resource that can be used to check content.\n\n:param params: (Optional) Configuration parameters for the shield\n:param type: The resource type, always shield" + description: A safety shield resource that can be used to check content. ShieldCallStep-Output: properties: turn_id: @@ -11621,7 +11671,7 @@ components: - step_id - violation title: ShieldCallStep - description: "A shield call step in an agent turn.\n\n:param violation: The violation from the shield call." + description: A shield call step in an agent turn. StopReason: type: string enum: @@ -11638,7 +11688,7 @@ components: default: string type: object title: StringType - description: "Parameter type for string values.\n\n:param type: Discriminator type. Always \"string\"" + description: Parameter type for string values. SystemMessage: properties: role: @@ -11672,14 +11722,14 @@ components: required: - content title: SystemMessage - description: "A system message providing instructions or context to the model.\n\n:param role: Must be \"system\" to identify this as a system message\n:param content: The content of the \"system prompt\". If multiple system messages are provided, they are concatenated. The underlying Llama Stack code may also add other system messages (for example, for formatting tool definitions)." + description: A system message providing instructions or context to the model. SystemMessageBehavior: type: string enum: - append - replace title: SystemMessageBehavior - description: "Config for how to override the default system prompt.\n\n:cvar append: Appends the provided system message to the default system prompt:\n https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt-\n:cvar replace: Replaces the default system prompt with the provided system message. The system message can include the string\n '{{function_definitions}}' to indicate where the function definitions should be inserted." + description: Config for how to override the default system prompt. TextContentItem: properties: type: @@ -11694,7 +11744,7 @@ components: required: - text title: TextContentItem - description: "A text content item\n\n:param type: Discriminator type of the content item. Always \"text\"\n:param text: Text content" + description: A text content item ToolCall: properties: call_id: @@ -11721,7 +11771,7 @@ components: - required - none title: ToolChoice - description: "Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model.\n\n:cvar auto: The model may use tools if it determines that is appropriate.\n:cvar required: The model must use tools.\n:cvar none: The model must not use tools." + description: Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model. ToolConfig: properties: tool_choice: @@ -11737,7 +11787,7 @@ components: $ref: '#/components/schemas/SystemMessageBehavior' type: object title: ToolConfig - description: "Configuration for tool use.\n\n:param tool_choice: (Optional) Whether tool use is automatic, required, or none. Can also specify a tool name to use a specific tool. Defaults to ToolChoice.auto.\n:param tool_prompt_format: (Optional) Instructs the model how to format tool calls. By default, Llama Stack will attempt to use a format that is best adapted to the model.\n - `ToolPromptFormat.json`: The tool calls are formatted as a JSON object.\n - `ToolPromptFormat.function_tag`: The tool calls are enclosed in a tag.\n - `ToolPromptFormat.python_list`: The tool calls are output as Python syntax -- a list of function calls.\n:param system_message_behavior: (Optional) Config for how to override the default system prompt.\n - `SystemMessageBehavior.append`: Appends the provided system message to the default system prompt.\n - `SystemMessageBehavior.replace`: Replaces the default system prompt with the provided system message. The system message can include the string\n '{{function_definitions}}' to indicate where the function definitions should be inserted." + description: Configuration for tool use. ToolDef: properties: toolgroup_id: @@ -11765,7 +11815,7 @@ components: required: - name title: ToolDef - description: "Tool definition used in runtime contexts.\n\n:param name: Name of the tool\n:param description: (Optional) Human-readable description of what the tool does\n:param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema)\n:param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema)\n:param metadata: (Optional) Additional metadata about the tool\n:param toolgroup_id: (Optional) ID of the tool group this tool belongs to" + description: Tool definition used in runtime contexts. ToolExecutionStep-Output: properties: turn_id: @@ -11804,7 +11854,7 @@ components: - tool_calls - tool_responses title: ToolExecutionStep - description: "A tool execution step in an agent turn.\n\n:param tool_calls: The tool calls to execute.\n:param tool_responses: The tool responses from the tool calls." + description: A tool execution step in an agent turn. ToolGroup: properties: identifier: @@ -11835,7 +11885,7 @@ components: - identifier - provider_id title: ToolGroup - description: "A group of related tools managed together.\n\n:param type: Type of resource, always 'tool_group'\n:param mcp_endpoint: (Optional) Model Context Protocol endpoint for remote tools\n:param args: (Optional) Additional arguments for the tool group" + description: A group of related tools managed together. ToolInvocationResult: properties: content: @@ -11872,7 +11922,7 @@ components: type: object type: object title: ToolInvocationResult - description: "Result of a tool invocation.\n\n:param content: (Optional) The output content from the tool execution\n:param error_message: (Optional) Error message if the tool execution failed\n:param error_code: (Optional) Numeric error code if the tool execution failed\n:param metadata: (Optional) Additional metadata about the tool execution" + description: Result of a tool invocation. ToolPromptFormat: type: string enum: @@ -11880,7 +11930,7 @@ components: - function_tag - python_list title: ToolPromptFormat - description: "Prompt format for calling custom / zero shot tools.\n\n:cvar json: JSON format for calling tools. It takes the form:\n {\n \"type\": \"function\",\n \"function\" : {\n \"name\": \"function_name\",\n \"description\": \"function_description\",\n \"parameters\": {...}\n }\n }\n:cvar function_tag: Function tag format, pseudo-XML. This looks like:\n (parameters)\n\n:cvar python_list: Python list. The output is a valid Python expression that can be\n evaluated to a list. Each element in the list is a function call. Example:\n [\"function_name(param1, param2)\", \"function_name(param1, param2)\"]" + description: Prompt format for calling custom / zero shot tools. ToolResponse-Input: properties: call_id: @@ -11923,7 +11973,7 @@ components: - tool_name - content title: ToolResponse - description: "Response from a tool invocation.\n\n:param call_id: Unique identifier for the tool call this response is for\n:param tool_name: Name of the tool that was invoked\n:param content: The response content from the tool\n:param metadata: (Optional) Additional metadata about the tool response" + description: Response from a tool invocation. ToolResponse-Output: properties: call_id: @@ -11966,7 +12016,7 @@ components: - tool_name - content title: ToolResponse - description: "Response from a tool invocation.\n\n:param call_id: Unique identifier for the tool call this response is for\n:param tool_name: Name of the tool that was invoked\n:param content: The response content from the tool\n:param metadata: (Optional) Additional metadata about the tool response" + description: Response from a tool invocation. ToolResponseMessage-Output: properties: role: @@ -12004,7 +12054,7 @@ components: - call_id - content title: ToolResponseMessage - description: "A message representing the result of a tool invocation.\n\n:param role: Must be \"tool\" to identify this as a tool response\n:param call_id: Unique identifier for the tool call this response is for\n:param content: The response content from the tool" + description: A message representing the result of a tool invocation. TopKSamplingStrategy: properties: type: @@ -12020,7 +12070,7 @@ components: required: - top_k title: TopKSamplingStrategy - description: "Top-k sampling strategy that restricts sampling to the k most likely tokens.\n\n:param type: Must be \"top_k\" to identify this sampling strategy\n:param top_k: Number of top tokens to consider for sampling. Must be at least 1" + description: Top-k sampling strategy that restricts sampling to the k most likely tokens. TopPSamplingStrategy: properties: type: @@ -12040,7 +12090,7 @@ components: required: - temperature title: TopPSamplingStrategy - description: "Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p.\n\n:param type: Must be \"top_p\" to identify this sampling strategy\n:param temperature: Controls randomness in sampling. Higher values increase randomness\n:param top_p: Cumulative probability threshold for nucleus sampling. Defaults to 0.95" + description: Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p. TrainingConfig: properties: n_epochs: @@ -12072,7 +12122,7 @@ components: required: - n_epochs title: TrainingConfig - description: "Comprehensive configuration for the training process.\n\n:param n_epochs: Number of training epochs to run\n:param max_steps_per_epoch: Maximum number of steps to run per epoch\n:param gradient_accumulation_steps: Number of steps to accumulate gradients before updating\n:param max_validation_steps: (Optional) Maximum number of validation steps per epoch\n:param data_config: (Optional) Configuration for data loading and formatting\n:param optimizer_config: (Optional) Configuration for the optimization algorithm\n:param efficiency_config: (Optional) Configuration for memory and compute optimizations\n:param dtype: (Optional) Data type for model parameters (bf16, fp16, fp32)" + description: Comprehensive configuration for the training process. Turn: properties: turn_id: @@ -12128,7 +12178,7 @@ components: - output_message - started_at title: Turn - description: "A single turn in an interaction with an Agentic System.\n\n:param turn_id: Unique identifier for the turn within a session\n:param session_id: Unique identifier for the conversation session\n:param input_messages: List of messages that initiated this turn\n:param steps: Ordered list of processing steps executed during this turn\n:param output_message: The model's generated response containing content and metadata\n:param output_attachments: (Optional) Files or media attached to the agent's response\n:param started_at: Timestamp when the turn began\n:param completed_at: (Optional) Timestamp when the turn finished, if completed" + description: A single turn in an interaction with an Agentic System. URIDataSource: properties: type: @@ -12143,7 +12193,7 @@ components: required: - uri title: URIDataSource - description: "A dataset that can be obtained from a URI.\n:param uri: The dataset can be obtained from a URI. E.g.\n - \"https://mywebsite.com/mydata.jsonl\"\n - \"lsfs://mydata.jsonl\"\n - \"data:csv;base64,{base64_content}\"" + description: A dataset that can be obtained from a URI. URL: properties: uri: @@ -12153,7 +12203,7 @@ components: required: - uri title: URL - description: "A URL reference to external content.\n\n:param uri: The URL string pointing to the resource" + description: A URL reference to external content. UnionType: properties: type: @@ -12163,7 +12213,7 @@ components: default: union type: object title: UnionType - description: "Parameter type for union values.\n\n:param type: Discriminator type. Always \"union\"" + description: Parameter type for union values. UserMessage-Input: properties: role: @@ -12219,7 +12269,7 @@ components: required: - content title: UserMessage - description: "A message from the user in a chat conversation.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param context: (Optional) This field is used internally by Llama Stack to pass RAG context. This field may be removed in the API in the future." + description: A message from the user in a chat conversation. UserMessage-Output: properties: role: @@ -12275,7 +12325,7 @@ components: required: - content title: UserMessage - description: "A message from the user in a chat conversation.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param context: (Optional) This field is used internally by Llama Stack to pass RAG context. This field may be removed in the API in the future." + description: A message from the user in a chat conversation. VectorStoreChunkingStrategyAuto: properties: type: @@ -12285,7 +12335,7 @@ components: default: auto type: object title: VectorStoreChunkingStrategyAuto - description: "Automatic chunking strategy for vector store files.\n\n:param type: Strategy type, always \"auto\" for automatic chunking" + description: Automatic chunking strategy for vector store files. VectorStoreChunkingStrategyStatic: properties: type: @@ -12299,7 +12349,7 @@ components: required: - static title: VectorStoreChunkingStrategyStatic - description: "Static chunking strategy with configurable parameters.\n\n:param type: Strategy type, always \"static\" for static chunking\n:param static: Configuration parameters for the static chunking strategy" + description: Static chunking strategy with configurable parameters. VectorStoreChunkingStrategyStaticConfig: properties: chunk_overlap_tokens: @@ -12314,7 +12364,7 @@ components: default: 800 type: object title: VectorStoreChunkingStrategyStaticConfig - description: "Configuration for static chunking strategy.\n\n:param chunk_overlap_tokens: Number of tokens to overlap between adjacent chunks\n:param max_chunk_size_tokens: Maximum number of tokens per chunk, must be between 100 and 4096" + description: Configuration for static chunking strategy. VectorStoreContent: properties: type: @@ -12329,7 +12379,7 @@ components: - type - text title: VectorStoreContent - description: "Content item from a vector store file or search result.\n\n:param type: Content type, currently only \"text\" is supported\n:param text: The actual text content" + description: Content item from a vector store file or search result. VectorStoreFileBatchObject: properties: id: @@ -12366,7 +12416,7 @@ components: - status - file_counts title: VectorStoreFileBatchObject - description: "OpenAI Vector Store File Batch object.\n\n:param id: Unique identifier for the file batch\n:param object: Object type identifier, always \"vector_store.file_batch\"\n:param created_at: Timestamp when the file batch was created\n:param vector_store_id: ID of the vector store containing the file batch\n:param status: Current processing status of the file batch\n:param file_counts: File processing status counts for the batch" + description: OpenAI Vector Store File Batch object. VectorStoreFileCounts: properties: completed: @@ -12392,7 +12442,7 @@ components: - in_progress - total title: VectorStoreFileCounts - description: "File processing status counts for a vector store.\n\n:param completed: Number of files that have been successfully processed\n:param cancelled: Number of files that had their processing cancelled\n:param failed: Number of files that failed to process\n:param in_progress: Number of files currently being processed\n:param total: Total number of files in the vector store" + description: File processing status counts for a vector store. VectorStoreFileLastError: properties: code: @@ -12410,7 +12460,7 @@ components: - code - message title: VectorStoreFileLastError - description: "Error information for failed vector store file processing.\n\n:param code: Error code indicating the type of failure\n:param message: Human-readable error message describing the failure" + description: Error information for failed vector store file processing. VectorStoreFileObject: properties: id: @@ -12465,7 +12515,7 @@ components: - status - vector_store_id title: VectorStoreFileObject - description: "OpenAI Vector Store File object.\n\n:param id: Unique identifier for the file\n:param object: Object type identifier, always \"vector_store.file\"\n:param attributes: Key-value attributes associated with the file\n:param chunking_strategy: Strategy used for splitting the file into chunks\n:param created_at: Timestamp when the file was added to the vector store\n:param last_error: (Optional) Error information if file processing failed\n:param status: Current processing status of the file\n:param usage_bytes: Storage space used by this file in bytes\n:param vector_store_id: ID of the vector store containing this file" + description: OpenAI Vector Store File object. VectorStoreObject: properties: id: @@ -12511,7 +12561,7 @@ components: - created_at - file_counts title: VectorStoreObject - description: "OpenAI Vector Store object.\n\n:param id: Unique identifier for the vector store\n:param object: Object type identifier, always \"vector_store\"\n:param created_at: Timestamp when the vector store was created\n:param name: (Optional) Name of the vector store\n:param usage_bytes: Storage space used by the vector store in bytes\n:param file_counts: File processing status counts for the vector store\n:param status: Current status of the vector store\n:param expires_after: (Optional) Expiration policy for the vector store\n:param expires_at: (Optional) Timestamp when the vector store will expire\n:param last_active_at: (Optional) Timestamp of last activity on the vector store\n:param metadata: Set of key-value pairs that can be attached to the vector store" + description: OpenAI Vector Store object. VectorStoreSearchResponse: properties: file_id: @@ -12543,7 +12593,7 @@ components: - score - content title: VectorStoreSearchResponse - description: "Response from searching a vector store.\n\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result\n:param attributes: (Optional) Key-value attributes associated with the file\n:param content: List of content items matching the search query" + description: Response from searching a vector store. VectorStoreSearchResponsePage: properties: object: @@ -12570,7 +12620,7 @@ components: - search_query - data title: VectorStoreSearchResponsePage - description: "Paginated response from searching a vector store.\n\n:param object: Object type identifier for the search results page\n:param search_query: The original search query that was executed\n:param data: List of search result objects\n:param has_more: Whether there are more results available beyond this page\n:param next_page: (Optional) Token for retrieving the next page of results" + description: Paginated response from searching a vector store. VersionInfo: properties: version: @@ -12580,7 +12630,7 @@ components: required: - version title: VersionInfo - description: "Version information for the service.\n\n:param version: Version number of the service" + description: Version information for the service. ViolationLevel: type: string enum: @@ -12588,7 +12638,7 @@ components: - warn - error title: ViolationLevel - description: "Severity level of a safety violation.\n\n:cvar INFO: Informational level violation that does not require action\n:cvar WARN: Warning level violation that suggests caution but allows continuation\n:cvar ERROR: Error level violation that requires blocking or intervention" + description: Severity level of a safety violation. WeightedRanker: properties: type: @@ -12605,7 +12655,7 @@ components: default: 0.5 type: object title: WeightedRanker - description: "Weighted ranker configuration that combines vector and keyword scores.\n\n:param type: The type of ranker, always \"weighted\"\n:param alpha: Weight factor between 0 and 1.\n 0 means only use keyword scores,\n 1 means only use vector scores,\n values in between blend both scores." + description: Weighted ranker configuration that combines vector and keyword scores. _URLOrData: properties: url: @@ -12616,7 +12666,7 @@ components: type: string type: object title: _URLOrData - description: "A URL or a base64 encoded string\n\n:param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. Note that URL could have length limits.\n:param data: base64 encoded image data as string" + description: A URL or a base64 encoded string __main_____agents_agent_id_session_Request: properties: agent_id: @@ -13186,7 +13236,7 @@ components: - ranking_options title: _vector_stores_vector_store_id_search_Request Error: - description: "Error response from the API. Roughly follows RFC 7807.\n\n:param status: HTTP status code\n:param title: Error title, a short summary of the error which is invariant for an error type\n:param detail: Error detail, a longer human-readable description of the error\n:param instance: (Optional) A URL which can be used to retrieve more information about the specific occurrence of the error" + description: Error response from the API. Roughly follows RFC 7807. properties: status: title: Status @@ -13208,7 +13258,7 @@ components: title: Error type: object Agent: - description: "An agent instance with configuration and metadata.\n\n:param agent_id: Unique identifier for the agent\n:param agent_config: Configuration settings for the agent\n:param created_at: Timestamp when the agent was created" + description: An agent instance with configuration and metadata. properties: agent_id: title: Agent Id @@ -13226,7 +13276,7 @@ components: title: Agent type: object AgentStepResponse: - description: "Response containing details of a specific agent step.\n\n:param step: The complete step data and execution details" + description: Response containing details of a specific agent step. properties: step: discriminator: @@ -13247,7 +13297,7 @@ components: title: AgentStepResponse type: object CompletionMessage: - description: "A message containing the model's (assistant) response in a chat conversation.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param stop_reason: Reason why the model stopped generating. Options are:\n - `StopReason.end_of_turn`: The model finished generating the entire response.\n - `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n - `StopReason.out_of_tokens`: The model ran out of token budget.\n:param tool_calls: List of tool calls. Each tool call is a ToolCall object." + description: A message containing the model's (assistant) response in a chat conversation. properties: role: const: assistant @@ -13289,7 +13339,7 @@ components: title: CompletionMessage type: object InferenceStep: - description: "An inference step in an agent turn.\n\n:param model_response: The response from the LLM." + description: An inference step in an agent turn. properties: turn_id: title: Turn Id @@ -13321,7 +13371,7 @@ components: title: InferenceStep type: object ListOpenAIResponseInputItem: - description: "List container for OpenAI response input items.\n\n:param data: List of input items\n:param object: Object type identifier, always \"list\"" + description: List container for OpenAI response input items. properties: data: items: @@ -13359,7 +13409,7 @@ components: title: ListOpenAIResponseInputItem type: object ListOpenAIResponseObject: - description: "Paginated list of OpenAI response objects with navigation metadata.\n\n:param data: List of response objects with their input context\n:param has_more: Whether there are more results available beyond this page\n:param first_id: Identifier of the first item in this page\n:param last_id: Identifier of the last item in this page\n:param object: Object type identifier, always \"list\"" + description: Paginated list of OpenAI response objects with navigation metadata. properties: data: items: @@ -13388,7 +13438,7 @@ components: title: ListOpenAIResponseObject type: object MemoryRetrievalStep: - description: "A memory retrieval step in an agent turn.\n\n:param vector_store_ids: The IDs of the vector databases to retrieve context from.\n:param inserted_context: The context retrieved from the vector databases." + description: A memory retrieval step in an agent turn. properties: turn_id: title: Turn Id @@ -13444,7 +13494,7 @@ components: title: MemoryRetrievalStep type: object OpenAIDeleteResponseObject: - description: "Response object confirming deletion of an OpenAI response.\n\n:param id: Unique identifier of the deleted response\n:param object: Object type identifier, always \"response\"\n:param deleted: Deletion confirmation flag, always True" + description: Response object confirming deletion of an OpenAI response. properties: id: title: Id @@ -13463,7 +13513,7 @@ components: title: OpenAIDeleteResponseObject type: object PaginatedResponse: - description: "A generic paginated response that follows a simple format.\n\n:param data: The list of items for the current page\n:param has_more: Whether there are more items available after this set\n:param url: The URL for accessing this list" + description: A generic paginated response that follows a simple format. properties: data: items: @@ -13484,7 +13534,7 @@ components: title: PaginatedResponse type: object Session: - description: "A single session of an interaction with an Agentic System.\n\n:param session_id: Unique identifier for the conversation session\n:param session_name: Human-readable name for the session\n:param turns: List of all turns that have occurred in this session\n:param started_at: Timestamp when the session was created" + description: A single session of an interaction with an Agentic System. properties: session_id: title: Session Id @@ -13509,7 +13559,7 @@ components: title: Session type: object ShieldCallStep: - description: "A shield call step in an agent turn.\n\n:param violation: The violation from the shield call." + description: A shield call step in an agent turn. properties: turn_id: title: Turn Id @@ -13541,7 +13591,7 @@ components: title: ShieldCallStep type: object ToolExecutionStep: - description: "A tool execution step in an agent turn.\n\n:param tool_calls: The tool calls to execute.\n:param tool_responses: The tool responses from the tool calls." + description: A tool execution step in an agent turn. properties: turn_id: title: Turn Id @@ -13582,7 +13632,7 @@ components: title: ToolExecutionStep type: object ToolResponse: - description: "Response from a tool invocation.\n\n:param call_id: Unique identifier for the tool call this response is for\n:param tool_name: Name of the tool that was invoked\n:param content: The response content from the tool\n:param metadata: (Optional) Additional metadata about the tool response" + description: Response from a tool invocation. properties: call_id: title: Call Id @@ -13701,7 +13751,7 @@ components: title: ConversationItemDeletedResource type: object ListOpenAIFileResponse: - description: "Response for listing files in OpenAI Files API.\n\n:param data: List of file objects\n:param has_more: Whether there are more files available beyond this page\n:param first_id: ID of the first file in the list for pagination\n:param last_id: ID of the last file in the list for pagination\n:param object: The object type, which is always \"list\"" + description: Response for listing files in OpenAI Files API. properties: data: items: @@ -13730,7 +13780,7 @@ components: title: ListOpenAIFileResponse type: object OpenAIFileDeleteResponse: - description: "Response for deleting a file in OpenAI Files API.\n\n:param id: The file identifier that was deleted\n:param object: The object type, which is always \"file\"\n:param deleted: Whether the file was successfully deleted" + description: Response for deleting a file in OpenAI Files API. properties: id: title: Id @@ -13749,7 +13799,7 @@ components: title: OpenAIFileDeleteResponse type: object ListOpenAIChatCompletionResponse: - description: "Response from listing OpenAI-compatible chat completions.\n\n:param data: List of chat completion objects with their input messages\n:param has_more: Whether there are more completions available beyond this list\n:param first_id: ID of the first completion in this list\n:param last_id: ID of the last completion in this list\n:param object: Must be \"list\" to identify this as a list response" + description: Response from listing OpenAI-compatible chat completions. properties: data: items: @@ -15440,7 +15490,7 @@ components: title: ListOpenAIChatCompletionResponse type: object OpenAIAssistantMessageParam: - description: "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"assistant\" to identify this as the model's response\n:param content: The content of the model's response\n:param name: (Optional) The name of the assistant message participant.\n:param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object." + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. properties: role: const: assistant @@ -15468,7 +15518,7 @@ components: title: OpenAIAssistantMessageParam type: object OpenAIChoice: - description: "A choice from an OpenAI-compatible chat completion response.\n\n:param message: The message from the model\n:param finish_reason: The reason the model stopped generating\n:param index: The index of the choice\n:param logprobs: (Optional) The log probabilities for the tokens in the message" + description: A choice from an OpenAI-compatible chat completion response. properties: message: discriminator: @@ -15502,7 +15552,7 @@ components: title: OpenAIChoice type: object OpenAIChoiceLogprobs: - description: "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response.\n\n:param content: (Optional) The log probabilities for the tokens in the message\n:param refusal: (Optional) The log probabilities for the tokens in the message" + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. properties: content: title: Content @@ -15569,7 +15619,7 @@ components: title: OpenAICompletionWithInputMessages type: object OpenAIUserMessageParam: - description: "A message from the user in an OpenAI-compatible chat completion request.\n\n:param role: Must be \"user\" to identify this as a user message\n:param content: The content of the message, which can include text and other media\n:param name: (Optional) The name of the user message participant." + description: A message from the user in an OpenAI-compatible chat completion request. properties: role: const: user @@ -15601,7 +15651,7 @@ components: title: OpenAIUserMessageParam type: object Checkpoint: - description: "Checkpoint created during training runs.\n\n:param identifier: Unique identifier for the checkpoint\n:param created_at: Timestamp when the checkpoint was created\n:param epoch: Training epoch when the checkpoint was saved\n:param post_training_job_id: Identifier of the training job that created this checkpoint\n:param path: File system path where the checkpoint is stored\n:param training_metrics: (Optional) Training metrics associated with this checkpoint" + description: Checkpoint created during training runs. properties: identifier: title: Identifier @@ -15631,7 +15681,7 @@ components: title: Checkpoint type: object PostTrainingJobArtifactsResponse: - description: "Artifacts of a finetuning job.\n\n:param job_uuid: Unique identifier for the training job\n:param checkpoints: List of model checkpoints created during training" + description: Artifacts of a finetuning job. properties: job_uuid: title: Job Uuid @@ -15646,7 +15696,7 @@ components: title: PostTrainingJobArtifactsResponse type: object PostTrainingJobStatusResponse: - description: "Status of a finetuning job.\n\n:param job_uuid: Unique identifier for the training job\n:param status: Current status of the training job\n:param scheduled_at: (Optional) Timestamp when the job was scheduled\n:param started_at: (Optional) Timestamp when the job execution began\n:param completed_at: (Optional) Timestamp when the job finished, if completed\n:param resources_allocated: (Optional) Information about computational resources allocated to the job\n:param checkpoints: List of model checkpoints created during training" + description: Status of a finetuning job. properties: job_uuid: title: Job Uuid @@ -15684,7 +15734,7 @@ components: title: PostTrainingJobStatusResponse type: object ScoringFn: - description: "A scoring function resource for evaluating model outputs.\n:param type: The resource type, always scoring_function" + description: A scoring function resource for evaluating model outputs. properties: identifier: description: Unique identifier for this resource in llama stack @@ -16484,7 +16534,7 @@ components: title: URL type: object ListToolDefsResponse: - description: "Response containing a list of tool definitions.\n\n:param data: List of tool definitions" + description: Response containing a list of tool definitions. properties: data: items: @@ -16496,7 +16546,7 @@ components: title: ListToolDefsResponse type: object VectorStoreDeleteResponse: - description: "Response from deleting a vector store.\n\n:param id: Unique identifier of the deleted vector store\n:param object: Object type identifier for the deletion response\n:param deleted: Whether the deletion operation was successful" + description: Response from deleting a vector store. properties: id: title: Id @@ -16514,7 +16564,7 @@ components: title: VectorStoreDeleteResponse type: object VectorStoreFileContentsResponse: - description: "Response from retrieving the contents of a vector store file.\n\n:param file_id: Unique identifier for the file\n:param filename: Name of the file\n:param attributes: Key-value attributes associated with the file\n:param content: List of content items from the file" + description: Response from retrieving the contents of a vector store file. properties: file_id: title: File Id @@ -16539,7 +16589,7 @@ components: title: VectorStoreFileContentsResponse type: object VectorStoreFileDeleteResponse: - description: "Response from deleting a vector store file.\n\n:param id: Unique identifier of the deleted file\n:param object: Object type identifier for the deletion response\n:param deleted: Whether the deletion operation was successful" + description: Response from deleting a vector store file. properties: id: title: Id @@ -16557,7 +16607,7 @@ components: title: VectorStoreFileDeleteResponse type: object VectorStoreFilesListInBatchResponse: - description: "Response from listing files in a vector store file batch.\n\n:param object: Object type identifier, always \"list\"\n:param data: List of vector store file objects in the batch\n:param first_id: (Optional) ID of the first file in the list for pagination\n:param last_id: (Optional) ID of the last file in the list for pagination\n:param has_more: Whether there are more files available beyond this page" + description: Response from listing files in a vector store file batch. properties: object: default: list @@ -16585,7 +16635,7 @@ components: title: VectorStoreFilesListInBatchResponse type: object VectorStoreListFilesResponse: - description: "Response from listing files in a vector store.\n\n:param object: Object type identifier, always \"list\"\n:param data: List of vector store file objects\n:param first_id: (Optional) ID of the first file in the list for pagination\n:param last_id: (Optional) ID of the last file in the list for pagination\n:param has_more: Whether there are more files available beyond this page" + description: Response from listing files in a vector store. properties: object: default: list @@ -16613,7 +16663,7 @@ components: title: VectorStoreListFilesResponse type: object VectorStoreListResponse: - description: "Response from listing vector stores.\n\n:param object: Object type identifier, always \"list\"\n:param data: List of vector store objects\n:param first_id: (Optional) ID of the first vector store in the list for pagination\n:param last_id: (Optional) ID of the last vector store in the list for pagination\n:param has_more: Whether there are more vector stores available beyond this page" + description: Response from listing vector stores. properties: object: default: list @@ -16699,7 +16749,7 @@ components: title: OpenAIResponseMessage type: object OpenAIResponseObjectWithInput: - description: "OpenAI response object extended with input context information.\n\n:param input: List of input items that led to this response" + description: OpenAI response object extended with input context information. properties: created_at: title: Created At @@ -18473,7 +18523,7 @@ components: title: OpenAIResponseObjectWithInput type: object ImageContentItem: - description: "A image content item\n\n:param type: Discriminator type of the content item. Always \"image\"\n:param image: Image as a base64 encoded string or an URL" + description: A image content item properties: type: const: image @@ -18688,9 +18738,9 @@ components: example: status: 500 title: Internal Server Error - detail: An unexpected error occurred + detail: An unexpected error occurred. Our team has been notified. DefaultError: - description: An error occurred + description: An unexpected error occurred content: application/json: schema: diff --git a/scripts/fastapi_generator.py b/scripts/fastapi_generator.py index 08b80a0fbb..7a8b87afe1 100755 --- a/scripts/fastapi_generator.py +++ b/scripts/fastapi_generator.py @@ -29,6 +29,9 @@ # Global list to store dynamic models created during endpoint generation _dynamic_models = [] +# Global mapping from (path, method) to webmethod for parameter description extraction +_path_webmethod_map: dict[tuple[str, str], Any] = {} + def _get_all_api_routes_with_functions(): """ @@ -107,18 +110,24 @@ def create_llama_stack_app() -> FastAPI: # Create FastAPI routes from the discovered routes for _, routes in api_routes.items(): for route, webmethod in routes: + # Store mapping for later use in parameter description extraction + for method in route.methods: + _path_webmethod_map[(route.path, method.lower())] = webmethod # Convert the route to a FastAPI endpoint _create_fastapi_endpoint(app, route, webmethod) return app -def _extract_path_parameters(path: str) -> list[dict[str, Any]]: +def _extract_path_parameters(path: str, webmethod=None) -> list[dict[str, Any]]: """ Extract path parameters from a URL path and return them as OpenAPI parameter definitions. + Parameters are returned in the order they appear in the docstring if available, + otherwise in the order they appear in the path. Args: path: URL path with parameters like /v1/batches/{batch_id}/cancel + webmethod: Optional webmethod to extract parameter descriptions from docstring Returns: List of parameter definitions for OpenAPI @@ -127,19 +136,62 @@ def _extract_path_parameters(path: str) -> list[dict[str, Any]]: # Find all path parameters in the format {param} or {param:type} param_pattern = r"\{([^}:]+)(?::[^}]+)?\}" - matches = re.findall(param_pattern, path) + path_params = set(re.findall(param_pattern, path)) + # Extract parameter descriptions and order from docstring if available + param_descriptions = {} + docstring_param_order = [] + if webmethod: + func = getattr(webmethod, "func", None) + if func and func.__doc__: + docstring = func.__doc__ + lines = docstring.split("\n") + for line in lines: + line = line.strip() + if line.startswith(":param "): + # Extract parameter name and description + # Format: :param param_name: description + parts = line[7:].split(":", 1) + if len(parts) == 2: + param_name = parts[0].strip() + description = parts[1].strip() + # Only track path parameters that exist in the path + if param_name in path_params: + if description: + param_descriptions[param_name] = description + if param_name not in docstring_param_order: + docstring_param_order.append(param_name) + + # Build parameters list preserving docstring order for path parameters found in docstring, + # then add any remaining path parameters in path order parameters = [] - for param_name in matches: - parameters.append( - { - "name": param_name, - "in": "path", - "required": True, - "schema": {"type": "string"}, - "description": f"Path parameter: {param_name}", - } - ) + # First add parameters in docstring order + for param_name in docstring_param_order: + if param_name in path_params: + description = param_descriptions.get(param_name, f"Path parameter: {param_name}") + parameters.append( + { + "name": param_name, + "in": "path", + "required": True, + "schema": {"type": "string"}, + "description": description, + } + ) + # Then add any path parameters not in docstring, in path order + path_param_list = re.findall(param_pattern, path) + for param_name in path_param_list: + if param_name not in docstring_param_order: + description = param_descriptions.get(param_name, f"Path parameter: {param_name}") + parameters.append( + { + "name": param_name, + "in": "path", + "required": True, + "schema": {"type": "string"}, + "description": description, + } + ) return parameters @@ -166,7 +218,8 @@ def _create_fastapi_endpoint(app: FastAPI, route, webmethod): f"Debug: {webmethod.route} - request_model: {request_model}, response_model: {response_model}, query_parameters: {query_parameters}" ) - # Extract response description from webmethod docstring (always try this first) + # Extract summary and response description from webmethod docstring + summary = _extract_summary_from_docstring(webmethod) response_description = _extract_response_description_from_docstring(webmethod, response_model) # Create endpoint function with proper typing @@ -316,6 +369,9 @@ async def generic_endpoint(*args, **kwargs): }, } + if summary: + route_kwargs["summary"] = summary + for method in methods: if method.upper() == "GET": app.get(fastapi_path, **route_kwargs)(endpoint_func) @@ -329,32 +385,51 @@ async def generic_endpoint(*args, **kwargs): app.patch(fastapi_path, **route_kwargs)(endpoint_func) +def _extract_summary_from_docstring(webmethod) -> str | None: + """ + Extract summary from the actual function docstring. + The summary is typically the first non-empty line of the docstring, + before any :param:, :returns:, or other docstring field markers. + """ + func = getattr(webmethod, "func", None) + if not func: + return None + + docstring = func.__doc__ or "" + if not docstring: + return None + + lines = docstring.split("\n") + for line in lines: + line = line.strip() + if not line: + continue + if line.startswith(":param:") or line.startswith(":returns:") or line.startswith(":raises:"): + break + return line + + return None + + def _extract_response_description_from_docstring(webmethod, response_model) -> str: """ Extract response description from the actual function docstring. Looks for :returns: in the docstring and uses that as the description. """ - # Try to get the actual function from the webmethod - # The webmethod should have a reference to the original function func = getattr(webmethod, "func", None) if not func: - # If we can't get the function, return a generic description return "Successful Response" - # Get the function's docstring docstring = func.__doc__ or "" - # Look for :returns: line in the docstring lines = docstring.split("\n") for line in lines: line = line.strip() if line.startswith(":returns:"): - # Extract the description after :returns: - description = line[9:].strip() # Remove ':returns:' prefix + description = line[9:].strip() if description: return description - # If no :returns: found, return a generic description return "Successful Response" @@ -842,7 +917,11 @@ def _add_error_responses(openapi_schema: dict[str, Any]) -> dict[str, Any]: 500: { "name": "InternalServerError500", "description": "The server encountered an unexpected error", - "example": {"status": 500, "title": "Internal Server Error", "detail": "An unexpected error occurred"}, + "example": { + "status": 500, + "title": "Internal Server Error", + "detail": "An unexpected error occurred. Our team has been notified.", + }, }, } @@ -858,7 +937,7 @@ def _add_error_responses(openapi_schema: dict[str, Any]) -> dict[str, Any]: # Add a default error response openapi_schema["components"]["responses"]["DefaultError"] = { - "description": "An error occurred", + "description": "An unexpected error occurred", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}, } @@ -868,29 +947,112 @@ def _add_error_responses(openapi_schema: dict[str, Any]) -> dict[str, Any]: def _fix_path_parameters(openapi_schema: dict[str, Any]) -> dict[str, Any]: """ Fix path parameter resolution issues by adding explicit parameter definitions. + Uses docstring descriptions if available. """ + global _path_webmethod_map + if "paths" not in openapi_schema: return openapi_schema for path, path_item in openapi_schema["paths"].items(): - # Extract path parameters from the URL - path_params = _extract_path_parameters(path) - - if not path_params: - continue - # Add parameters to each operation in this path for method in ["get", "post", "put", "delete", "patch", "head", "options"]: if method in path_item and isinstance(path_item[method], dict): operation = path_item[method] + + # Get webmethod for this path/method to extract parameter descriptions + webmethod = _path_webmethod_map.get((path, method)) + + # Extract path parameters from the URL with descriptions from docstring + path_params = _extract_path_parameters(path, webmethod) + + if not path_params: + continue + if "parameters" not in operation: operation["parameters"] = [] - # Add path parameters that aren't already defined - existing_param_names = {p.get("name") for p in operation["parameters"] if p.get("in") == "path"} + # Separate path and non-path parameters + existing_params = operation["parameters"] + non_path_params = [p for p in existing_params if p.get("in") != "path"] + existing_path_params = {p.get("name"): p for p in existing_params if p.get("in") == "path"} + + # Build new parameters list: non-path params first, then path params in docstring order + new_params = non_path_params.copy() + + # Add path parameters in docstring order for param in path_params: - if param["name"] not in existing_param_names: - operation["parameters"].append(param) + param_name = param["name"] + if param_name in existing_path_params: + # Update existing parameter description if we have a better one + existing_param = existing_path_params[param_name] + if param["description"] != f"Path parameter: {param_name}": + existing_param["description"] = param["description"] + new_params.append(existing_param) + else: + # Add new path parameter + new_params.append(param) + + operation["parameters"] = new_params + + return openapi_schema + + +def _extract_first_line_from_description(description: str) -> str: + """ + Extract all lines from a description string that don't start with docstring keywords. + Stops at the first line that starts with :param:, :returns:, :raises:, etc. + Preserves multiple lines and formatting. + """ + if not description: + return description + + lines = description.split("\n") + description_lines = [] + + for line in lines: + stripped = line.strip() + if not stripped: + # Keep empty lines in the description to preserve formatting + description_lines.append(line) + continue + if ( + stripped.startswith(":param") + or stripped.startswith(":returns") + or stripped.startswith(":raises") + or (stripped.startswith(":") and len(stripped) > 1 and stripped[1].isalpha()) + ): + break + description_lines.append(line) + + # Join lines and strip trailing whitespace/newlines + result = "\n".join(description_lines).rstrip() + return result if result else description + + +def _fix_component_descriptions(openapi_schema: dict[str, Any]) -> dict[str, Any]: + """ + Fix component descriptions to only include the first line (summary), + removing :param:, :returns:, and other docstring directives. + """ + if "components" not in openapi_schema or "schemas" not in openapi_schema["components"]: + return openapi_schema + + schemas = openapi_schema["components"]["schemas"] + + def fix_description_in_schema(schema_def: dict[str, Any]) -> None: + if isinstance(schema_def, dict): + if "description" in schema_def and isinstance(schema_def["description"], str): + schema_def["description"] = _extract_first_line_from_description(schema_def["description"]) + + for value in schema_def.values(): + fix_description_in_schema(value) + elif isinstance(schema_def, list): + for item in schema_def: + fix_description_in_schema(item) + + for _, schema_def in schemas.items(): + fix_description_in_schema(schema_def) return openapi_schema @@ -1409,6 +1571,9 @@ def find_defs_refs(obj: Any, path: str = "") -> None: # Eliminate $defs section entirely for oasdiff compatibility openapi_schema = _eliminate_defs_section(openapi_schema) + # Fix component descriptions to only include first line (summary) + openapi_schema = _fix_component_descriptions(openapi_schema) + # Debug: Check if there's a root-level $defs after flattening if "$defs" in openapi_schema: print(f"After flattening: root-level $defs with {len(openapi_schema['$defs'])} items") @@ -1485,7 +1650,7 @@ def find_defs_refs(obj: Any, path: str = "") -> None: if format in ["yaml", "both"]: yaml_path = output_path / "llama-stack-spec.yaml" - # Use ruamel.yaml for better control over YAML serialization + # Use ruamel.yaml for better YAML formatting try: from ruamel.yaml import YAML @@ -1497,46 +1662,52 @@ def find_defs_refs(obj: Any, path: str = "") -> None: with open(yaml_path, "w") as f: yaml_writer.dump(stable_schema, f) + + # Post-process the YAML file to remove $defs section and fix references + # Re-read and re-write with ruamel.yaml + with open(yaml_path) as f: + yaml_content = f.read() + + if " $defs:" in yaml_content or "#/$defs/" in yaml_content: + print("Post-processing YAML to remove $defs section") + + # Use string replacement to fix references directly + if "#/$defs/" in yaml_content: + refs_fixed = yaml_content.count("#/$defs/") + yaml_content = yaml_content.replace("#/$defs/", "#/components/schemas/") + print(f"Fixed {refs_fixed} $ref references using string replacement") + + # Parse using PyYAML safe_load first to avoid issues with custom types + # This handles block scalars better during post-processing + import yaml as pyyaml + + with open(yaml_path) as f: + yaml_data = pyyaml.safe_load(f) + + # Move $defs to components/schemas if it exists + if "$defs" in yaml_data: + print(f"Found $defs section with {len(yaml_data['$defs'])} items") + if "components" not in yaml_data: + yaml_data["components"] = {} + if "schemas" not in yaml_data["components"]: + yaml_data["components"]["schemas"] = {} + + # Move all $defs to components/schemas + for def_name, def_schema in yaml_data["$defs"].items(): + yaml_data["components"]["schemas"][def_name] = def_schema + + # Remove the $defs section + del yaml_data["$defs"] + print("Moved $defs to components/schemas") + + # Write the modified YAML back with ruamel.yaml + with open(yaml_path, "w") as f: + yaml_writer.dump(yaml_data, f) + print("Updated YAML file") except ImportError: # Fallback to standard yaml if ruamel.yaml is not available with open(yaml_path, "w") as f: yaml.dump(stable_schema, f, default_flow_style=False, sort_keys=False) - # Post-process the YAML file to remove $defs section and fix references - with open(yaml_path) as f: - yaml_content = f.read() - - if " $defs:" in yaml_content or "#/$defs/" in yaml_content: - print("Post-processing YAML to remove $defs section") - - # Use string replacement to fix references directly - if "#/$defs/" in yaml_content: - refs_fixed = yaml_content.count("#/$defs/") - yaml_content = yaml_content.replace("#/$defs/", "#/components/schemas/") - print(f"Fixed {refs_fixed} $ref references using string replacement") - - # Parse the YAML content - yaml_data = yaml.safe_load(yaml_content) - - # Move $defs to components/schemas if it exists - if "$defs" in yaml_data: - print(f"Found $defs section with {len(yaml_data['$defs'])} items") - if "components" not in yaml_data: - yaml_data["components"] = {} - if "schemas" not in yaml_data["components"]: - yaml_data["components"]["schemas"] = {} - - # Move all $defs to components/schemas - for def_name, def_schema in yaml_data["$defs"].items(): - yaml_data["components"]["schemas"][def_name] = def_schema - - # Remove the $defs section - del yaml_data["$defs"] - print("Moved $defs to components/schemas") - - # Write the modified YAML back - with open(yaml_path, "w") as f: - yaml.dump(yaml_data, f, default_flow_style=False, sort_keys=False) - print("Updated YAML file") print(f"✅ Generated YAML (stable): {yaml_path}") @@ -1643,7 +1814,7 @@ def main(): parser = argparse.ArgumentParser(description="Generate OpenAPI specification using FastAPI") parser.add_argument("output_dir", help="Output directory for generated files") - parser.add_argument("--format", choices=["yaml", "json", "both"], default="yaml", help="Output format") + parser.add_argument("--format", choices=["yaml", "json", "both"], default="both", help="Output format") parser.add_argument("--no-examples", action="store_true", help="Exclude examples from the specification") parser.add_argument( "--validate-only", action="store_true", help="Only validate existing schema files, don't generate new ones" From 8df9340dd39e572d50627c2af640fbda4e7d42f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Mon, 3 Nov 2025 17:06:43 +0100 Subject: [PATCH 5/6] wiprouters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sébastien Han --- client-sdks/stainless/openapi.yml | 27053 ++++++--------- docs/static/deprecated-llama-stack-spec.json | 18640 ---------- docs/static/deprecated-llama-stack-spec.yaml | 28368 +++++++++++++++- .../static/experimental-llama-stack-spec.json | 5135 --- .../static/experimental-llama-stack-spec.yaml | 3661 +- docs/static/llama-stack-spec.json | 11541 ------- docs/static/llama-stack-spec.yaml | 18539 ++++------ docs/static/stainless-llama-stack-spec.json | 16303 --------- docs/static/stainless-llama-stack-spec.yaml | 27053 ++++++--------- scripts/fastapi_generator.py | 1599 +- scripts/validate_openapi.py | 3 + src/llama_stack/apis/agents/__init__.py | 106 +- src/llama_stack/apis/agents/agents.py | 814 - src/llama_stack/apis/agents/agents_service.py | 308 + src/llama_stack/apis/agents/models.py | 409 + .../apis/agents/openai_responses.py | 795 +- src/llama_stack/apis/agents/routes.py | 452 + src/llama_stack/apis/batches/__init__.py | 15 +- src/llama_stack/apis/batches/batches.py | 96 - .../apis/batches/batches_service.py | 56 + src/llama_stack/apis/batches/models.py | 42 + src/llama_stack/apis/batches/routes.py | 111 + src/llama_stack/apis/benchmarks/__init__.py | 24 +- src/llama_stack/apis/benchmarks/benchmarks.py | 104 - .../apis/benchmarks/benchmarks_service.py | 42 + src/llama_stack/apis/benchmarks/models.py | 58 + src/llama_stack/apis/benchmarks/routes.py | 144 + src/llama_stack/apis/common/content_types.py | 50 +- src/llama_stack/apis/common/job_types.py | 6 +- src/llama_stack/apis/common/responses.py | 20 +- src/llama_stack/apis/common/training_types.py | 42 +- .../apis/conversations/__init__.py | 22 +- .../conversations/conversations_service.py | 70 + .../{conversations.py => models.py} | 147 +- src/llama_stack/apis/conversations/routes.py | 177 + src/llama_stack/apis/datasetio/__init__.py | 9 +- .../{datasetio.py => datasetio_service.py} | 24 +- src/llama_stack/apis/datasetio/models.py | 5 + src/llama_stack/apis/datasetio/routes.py | 77 + src/llama_stack/apis/datasets/__init__.py | 34 +- src/llama_stack/apis/datasets/datasets.py | 247 - .../apis/datasets/datasets_service.py | 65 + src/llama_stack/apis/datasets/models.py | 134 + src/llama_stack/apis/datasets/routes.py | 140 + src/llama_stack/apis/datatypes.py | 25 +- src/llama_stack/apis/eval/__init__.py | 26 +- src/llama_stack/apis/eval/eval.py | 150 - src/llama_stack/apis/eval/eval_service.py | 50 + src/llama_stack/apis/eval/models.py | 73 + src/llama_stack/apis/eval/routes.py | 170 + src/llama_stack/apis/files/__init__.py | 24 +- src/llama_stack/apis/files/files.py | 194 - src/llama_stack/apis/files/files_service.py | 70 + src/llama_stack/apis/files/models.py | 66 + src/llama_stack/apis/files/routes.py | 135 + src/llama_stack/apis/inference/__init__.py | 204 +- src/llama_stack/apis/inference/inference.py | 1267 - .../apis/inference/inference_service.py | 93 + src/llama_stack/apis/inference/models.py | 818 + src/llama_stack/apis/inference/routes.py | 183 + src/llama_stack/apis/inspect/__init__.py | 10 +- src/llama_stack/apis/inspect/inspect.py | 102 - .../apis/inspect/inspect_service.py | 29 + src/llama_stack/apis/inspect/models.py | 39 + src/llama_stack/apis/inspect/routes.py | 73 + src/llama_stack/apis/models/__init__.py | 28 +- src/llama_stack/apis/models/model_schemas.py | 98 + src/llama_stack/apis/models/models.py | 172 - src/llama_stack/apis/models/models_models.py | 98 + src/llama_stack/apis/models/models_service.py | 53 + src/llama_stack/apis/models/routes.py | 107 + .../apis/post_training/__init__.py | 59 +- src/llama_stack/apis/post_training/models.py | 222 + .../apis/post_training/post_training.py | 368 - .../post_training/post_training_service.py | 64 + src/llama_stack/apis/post_training/routes.py | 199 + src/llama_stack/apis/prompts/__init__.py | 24 +- src/llama_stack/apis/prompts/models.py | 113 + src/llama_stack/apis/prompts/prompts.py | 204 - .../apis/prompts/prompts_service.py | 72 + src/llama_stack/apis/prompts/routes.py | 154 + src/llama_stack/apis/providers/__init__.py | 10 +- src/llama_stack/apis/providers/models.py | 29 + src/llama_stack/apis/providers/providers.py | 69 - .../apis/providers/providers_service.py | 25 + src/llama_stack/apis/providers/routes.py | 68 + src/llama_stack/apis/safety/__init__.py | 29 +- src/llama_stack/apis/safety/models.py | 96 + src/llama_stack/apis/safety/routes.py | 68 + src/llama_stack/apis/safety/safety.py | 134 - src/llama_stack/apis/safety/safety_service.py | 41 + src/llama_stack/apis/scoring/__init__.py | 27 +- src/llama_stack/apis/scoring/models.py | 61 + src/llama_stack/apis/scoring/routes.py | 75 + src/llama_stack/apis/scoring/scoring.py | 93 - .../apis/scoring/scoring_service.py | 37 + .../apis/scoring_functions/__init__.py | 36 +- .../apis/scoring_functions/models.py | 143 + .../apis/scoring_functions/routes.py | 111 + .../scoring_functions/scoring_functions.py | 208 - .../scoring_functions_service.py | 40 + src/llama_stack/apis/shields/__init__.py | 18 +- src/llama_stack/apis/shields/models.py | 55 + src/llama_stack/apis/shields/routes.py | 102 + src/llama_stack/apis/shields/shields.py | 94 - .../apis/shields/shields_service.py | 37 + .../apis/synthetic_data_generation/models.py | 60 + .../apis/synthetic_data_generation/routes.py | 61 + .../synthetic_data_generation_service.py | 31 + src/llama_stack/apis/tools/__init__.py | 43 +- src/llama_stack/apis/tools/models.py | 101 + src/llama_stack/apis/tools/rag_tool.py | 5 +- src/llama_stack/apis/tools/routes.py | 240 + .../apis/tools/tool_groups_service.py | 61 + .../apis/tools/tool_runtime_service.py | 38 + src/llama_stack/apis/tools/tools.py | 222 - src/llama_stack/apis/vector_io/__init__.py | 75 +- src/llama_stack/apis/vector_io/models.py | 339 + src/llama_stack/apis/vector_io/routes.py | 452 + src/llama_stack/apis/vector_io/vector_io.py | 861 - .../apis/vector_io/vector_io_service.py | 326 + .../apis/vector_stores/__init__.py | 4 +- src/llama_stack/apis/vector_stores/models.py | 42 + .../apis/vector_stores/vector_stores.py | 51 - .../core/conversations/conversations.py | 2 +- src/llama_stack/core/inspect.py | 96 +- src/llama_stack/core/resolver.py | 128 +- src/llama_stack/core/routers/eval_scoring.py | 5 +- src/llama_stack/core/routers/inference.py | 6 +- src/llama_stack/core/routers/safety.py | 3 +- .../core/routing_tables/vector_stores.py | 2 +- src/llama_stack/core/server/auth.py | 62 +- src/llama_stack/core/server/router_utils.py | 28 + src/llama_stack/core/server/routers.py | 64 + src/llama_stack/core/server/server.py | 214 +- src/llama_stack/core/server/tracing.py | 30 +- .../inline/agents/meta_reference/agents.py | 8 +- .../responses/openai_responses.py | 7 +- .../agents/meta_reference/responses/utils.py | 2 +- .../inline/eval/meta_reference/eval.py | 2 +- .../inference/meta_reference/inference.py | 6 +- .../sentence_transformers.py | 6 +- .../safety/code_scanner/code_scanner.py | 6 +- .../inline/safety/llama_guard/llama_guard.py | 3 +- .../safety/prompt_guard/prompt_guard.py | 2 +- .../registry/synthetic_data_generation.py | 13 + .../remote/inference/bedrock/bedrock.py | 8 +- .../inference/llama_openai_compat/llama.py | 2 +- .../remote/inference/nvidia/nvidia.py | 6 +- .../remote/inference/together/together.py | 2 +- .../remote/inference/watsonx/watsonx.py | 2 +- .../providers/utils/inference/openai_mixin.py | 3 +- .../utils/responses/responses_store.py | 4 +- .../utils/scoring/base_scoring_fn.py | 4 +- .../inference/test_provider_data_routing.py | 2 +- 155 files changed, 69988 insertions(+), 104034 deletions(-) delete mode 100644 docs/static/deprecated-llama-stack-spec.json delete mode 100644 docs/static/experimental-llama-stack-spec.json delete mode 100644 docs/static/llama-stack-spec.json delete mode 100644 docs/static/stainless-llama-stack-spec.json delete mode 100644 src/llama_stack/apis/agents/agents.py create mode 100644 src/llama_stack/apis/agents/agents_service.py create mode 100644 src/llama_stack/apis/agents/models.py create mode 100644 src/llama_stack/apis/agents/routes.py delete mode 100644 src/llama_stack/apis/batches/batches.py create mode 100644 src/llama_stack/apis/batches/batches_service.py create mode 100644 src/llama_stack/apis/batches/models.py create mode 100644 src/llama_stack/apis/batches/routes.py delete mode 100644 src/llama_stack/apis/benchmarks/benchmarks.py create mode 100644 src/llama_stack/apis/benchmarks/benchmarks_service.py create mode 100644 src/llama_stack/apis/benchmarks/models.py create mode 100644 src/llama_stack/apis/benchmarks/routes.py create mode 100644 src/llama_stack/apis/conversations/conversations_service.py rename src/llama_stack/apis/conversations/{conversations.py => models.py} (53%) create mode 100644 src/llama_stack/apis/conversations/routes.py rename src/llama_stack/apis/datasetio/{datasetio.py => datasetio_service.py} (56%) create mode 100644 src/llama_stack/apis/datasetio/models.py create mode 100644 src/llama_stack/apis/datasetio/routes.py delete mode 100644 src/llama_stack/apis/datasets/datasets.py create mode 100644 src/llama_stack/apis/datasets/datasets_service.py create mode 100644 src/llama_stack/apis/datasets/models.py create mode 100644 src/llama_stack/apis/datasets/routes.py delete mode 100644 src/llama_stack/apis/eval/eval.py create mode 100644 src/llama_stack/apis/eval/eval_service.py create mode 100644 src/llama_stack/apis/eval/models.py create mode 100644 src/llama_stack/apis/eval/routes.py delete mode 100644 src/llama_stack/apis/files/files.py create mode 100644 src/llama_stack/apis/files/files_service.py create mode 100644 src/llama_stack/apis/files/models.py create mode 100644 src/llama_stack/apis/files/routes.py delete mode 100644 src/llama_stack/apis/inference/inference.py create mode 100644 src/llama_stack/apis/inference/inference_service.py create mode 100644 src/llama_stack/apis/inference/models.py create mode 100644 src/llama_stack/apis/inference/routes.py delete mode 100644 src/llama_stack/apis/inspect/inspect.py create mode 100644 src/llama_stack/apis/inspect/inspect_service.py create mode 100644 src/llama_stack/apis/inspect/models.py create mode 100644 src/llama_stack/apis/inspect/routes.py create mode 100644 src/llama_stack/apis/models/model_schemas.py delete mode 100644 src/llama_stack/apis/models/models.py create mode 100644 src/llama_stack/apis/models/models_models.py create mode 100644 src/llama_stack/apis/models/models_service.py create mode 100644 src/llama_stack/apis/models/routes.py create mode 100644 src/llama_stack/apis/post_training/models.py delete mode 100644 src/llama_stack/apis/post_training/post_training.py create mode 100644 src/llama_stack/apis/post_training/post_training_service.py create mode 100644 src/llama_stack/apis/post_training/routes.py create mode 100644 src/llama_stack/apis/prompts/models.py delete mode 100644 src/llama_stack/apis/prompts/prompts.py create mode 100644 src/llama_stack/apis/prompts/prompts_service.py create mode 100644 src/llama_stack/apis/prompts/routes.py create mode 100644 src/llama_stack/apis/providers/models.py delete mode 100644 src/llama_stack/apis/providers/providers.py create mode 100644 src/llama_stack/apis/providers/providers_service.py create mode 100644 src/llama_stack/apis/providers/routes.py create mode 100644 src/llama_stack/apis/safety/models.py create mode 100644 src/llama_stack/apis/safety/routes.py delete mode 100644 src/llama_stack/apis/safety/safety.py create mode 100644 src/llama_stack/apis/safety/safety_service.py create mode 100644 src/llama_stack/apis/scoring/models.py create mode 100644 src/llama_stack/apis/scoring/routes.py delete mode 100644 src/llama_stack/apis/scoring/scoring.py create mode 100644 src/llama_stack/apis/scoring/scoring_service.py create mode 100644 src/llama_stack/apis/scoring_functions/models.py create mode 100644 src/llama_stack/apis/scoring_functions/routes.py delete mode 100644 src/llama_stack/apis/scoring_functions/scoring_functions.py create mode 100644 src/llama_stack/apis/scoring_functions/scoring_functions_service.py create mode 100644 src/llama_stack/apis/shields/models.py create mode 100644 src/llama_stack/apis/shields/routes.py delete mode 100644 src/llama_stack/apis/shields/shields.py create mode 100644 src/llama_stack/apis/shields/shields_service.py create mode 100644 src/llama_stack/apis/synthetic_data_generation/models.py create mode 100644 src/llama_stack/apis/synthetic_data_generation/routes.py create mode 100644 src/llama_stack/apis/synthetic_data_generation/synthetic_data_generation_service.py create mode 100644 src/llama_stack/apis/tools/models.py create mode 100644 src/llama_stack/apis/tools/routes.py create mode 100644 src/llama_stack/apis/tools/tool_groups_service.py create mode 100644 src/llama_stack/apis/tools/tool_runtime_service.py delete mode 100644 src/llama_stack/apis/tools/tools.py create mode 100644 src/llama_stack/apis/vector_io/models.py create mode 100644 src/llama_stack/apis/vector_io/routes.py delete mode 100644 src/llama_stack/apis/vector_io/vector_io.py create mode 100644 src/llama_stack/apis/vector_io/vector_io_service.py create mode 100644 src/llama_stack/apis/vector_stores/models.py delete mode 100644 src/llama_stack/apis/vector_stores/vector_stores.py create mode 100644 src/llama_stack/core/server/router_utils.py create mode 100644 src/llama_stack/core/server/routers.py create mode 100644 src/llama_stack/providers/registry/synthetic_data_generation.py diff --git a/client-sdks/stainless/openapi.yml b/client-sdks/stainless/openapi.yml index 22f8d3d5d9..31f653afea 100644 --- a/client-sdks/stainless/openapi.yml +++ b/client-sdks/stainless/openapi.yml @@ -9,18851 +9,13934 @@ servers: - url: https://staging-api.llamastack.com description: Staging server paths: - /v1/batches: - get: - responses: - '200': - description: A list of batch objects. - content: - application/json: - schema: - $ref: '#/components/schemas/ListBatchesResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Batches - summary: List all batches for the current user. - description: List all batches for the current user. - parameters: - - name: after - in: query - description: >- - A cursor for pagination; returns batches after this batch ID. - required: false - schema: - type: string - - name: limit - in: query - description: >- - Number of batches to return (default 20, max 100). - required: true - schema: - type: integer - deprecated: false + /v1beta/datasetio/append-rows/{dataset_id}: post: - responses: - '200': - description: The created batch object. - content: - application/json: - schema: - $ref: '#/components/schemas/Batch' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' tags: - - Batches - summary: >- - Create a new batch for processing multiple API requests. - description: >- - Create a new batch for processing multiple API requests. - parameters: [] + - DatasetIO + summary: Append rows to a dataset. + description: Append rows to a dataset. + operationId: append_rows_v1beta_datasetio_append_rows__dataset_id__post + parameters: + - name: dataset_id + in: path + required: true + schema: + type: string + description: The ID of the dataset to append the rows to + title: Dataset Id + description: The ID of the dataset to append the rows to requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/CreateBatchRequest' - required: true - deprecated: false - /v1/batches/{batch_id}: - get: + type: array + items: + type: object + additionalProperties: true + description: The rows to append to the dataset. + title: Body responses: - '200': - description: The batch object. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Batch' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Batches - summary: >- - Retrieve information about a specific batch. - description: >- - Retrieve information about a specific batch. - parameters: - - name: batch_id - in: path - description: The ID of the batch to retrieve. - required: true - schema: - type: string - deprecated: false - /v1/batches/{batch_id}/cancel: - post: - responses: - '200': - description: The updated batch object. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/Batch' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Batches - summary: Cancel a batch that is in progress. - description: Cancel a batch that is in progress. - parameters: - - name: batch_id - in: path - description: The ID of the batch to cancel. - required: true - schema: - type: string - deprecated: false - /v1/chat/completions: - get: - responses: - '200': - description: A ListOpenAIChatCompletionResponse. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIChatCompletionResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - Inference - summary: List chat completions. - description: >- - List chat completions. - - :param after: The ID of the last chat completion to return. - :param limit: The maximum number of chat completions to return. - :param model: The model to filter by. - :param order: The order to sort the chat completions by: "asc" or - "desc". Defaults to "desc". - :returns: A ListOpenAIChatCompletionResponse. - parameters: - - name: after - description: >- - The ID of the last chat completion to return. - required: false - schema: - type: string - in: query - - name: limit - description: >- - The maximum number of chat completions to return. - required: false - schema: - type: integer - in: query - - name: model - description: The model to filter by. - required: false - schema: - type: string - in: query - - name: order - description: >- - The order to sort the chat completions by: "asc" or "desc". Defaults to - "desc". - required: false - schema: - $ref: '#/components/schemas/Order' - in: query - deprecated: false - post: - responses: - '200': - description: An OpenAIChatCompletion. + description: An unexpected error occurred. content: application/json: schema: - $ref: '#/components/schemas/llama_stack.apis.inference.inference.OpenAIChatCompletion - | collections.abc.AsyncIterator[llama_stack.apis.inference.inference.OpenAIChatCompletionChunk]' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' + $ref: '#/components/schemas/Error' + /v1beta/datasetio/iterrows/{dataset_id}: + get: tags: - - Inference - summary: Create chat completions. - description: >- - Create chat completions. - - Generate an OpenAI-compatible chat completion for the given messages using - the specified model. - :returns: An OpenAIChatCompletion. - parameters: [] - requestBody: - content: - application/json: - schema: - id: Annotated + - DatasetIO + summary: Get a paginated list of rows from a dataset. + description: Get a paginated list of rows from a dataset using offset-based pagination. + operationId: iterrows_v1beta_datasetio_iterrows__dataset_id__get + parameters: + - name: dataset_id + in: path required: true - deprecated: false - /v1/chat/completions/{completion_id}: - get: + schema: + type: string + description: The ID of the dataset to get the rows from + title: Dataset Id + description: The ID of the dataset to get the rows from + - name: start_index + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: Index into dataset for the first row to get. Get all rows if None. + title: Start Index + description: Index into dataset for the first row to get. Get all rows if None. + - name: limit + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The number of rows to get. + title: Limit + description: The number of rows to get. responses: '200': - description: A OpenAICompletionWithInputMessages. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAICompletionWithInputMessages' + $ref: '#/components/schemas/PaginatedResponse' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Inference - summary: Get chat completion. - description: >- - Get chat completion. - - Describe a chat completion by its ID. - - :param completion_id: ID of the chat completion. - :returns: A OpenAICompletionWithInputMessages. - parameters: - - name: completion_id - description: ID of the chat completion. - required: true - schema: - type: string - in: path - deprecated: false - /v1/completions: - post: - responses: - '200': - description: An OpenAICompletion. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/OpenAICompletion' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1beta/datasets: + get: tags: - - Inference - summary: Create completion. - description: >- - Create completion. - - Generate an OpenAI-compatible completion for the given prompt using the specified - model. - :returns: An OpenAICompletion. - parameters: [] - requestBody: - content: - application/json: - schema: - id: Annotated - required: true - deprecated: false - /v1/conversations: - post: + - Datasets + summary: List all datasets + description: List all datasets + operationId: list_datasets_v1beta_datasets_get responses: '200': - description: The created conversation object. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Conversation' + $ref: '#/components/schemas/ListDatasetsResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - Conversations - summary: Create a conversation. - description: >- - Create a conversation. - - Create a conversation. - - :param items: Initial items to include in the conversation context. - :param metadata: Set of key-value pairs that can be attached to an - object. - :returns: The created conversation object. - parameters: [] + - Datasets + summary: Register a new dataset + description: Register a new dataset + operationId: register_dataset_v1beta_datasets_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/CreateConversationRequest' + $ref: '#/components/schemas/RegisterDatasetRequest' required: true - deprecated: false - /v1/conversations/{conversation_id}: - get: responses: '200': - description: The conversation object. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Conversation' + $ref: '#/components/schemas/Dataset' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Conversations - summary: Retrieve a conversation. - description: >- - Retrieve a conversation. - - Get a conversation with the given ID. - - :param conversation_id: The conversation identifier. - :returns: The conversation object. - parameters: - - name: conversation_id - description: The conversation identifier. - required: true - schema: - type: string - in: path - deprecated: false - post: - responses: - '200': - description: The updated conversation object. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Conversation' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1beta/datasets/{{dataset_id}}: + delete: tags: - - Conversations - summary: Update a conversation. - description: >- - Update a conversation. - - Update a conversation's metadata with the given ID. - - :param conversation_id: The conversation identifier. - :param metadata: Set of key-value pairs that can be attached to an - object. - :returns: The updated conversation object. + - Datasets + summary: Unregister a dataset by its ID + description: Unregister a dataset by its ID + operationId: unregister_dataset_v1beta_datasets___dataset_id___delete parameters: - - name: conversation_id - description: The conversation identifier. - required: true - schema: - type: string - in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateConversationRequest' + - name: dataset_id + in: path required: true - deprecated: false - delete: + schema: + type: string + description: The ID of the dataset to unregister + title: Dataset Id + description: The ID of the dataset to unregister responses: - '200': - description: The deleted conversation resource. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ConversationDeletedResource' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Conversations - summary: Delete a conversation. - description: >- - Delete a conversation. - - Delete a conversation with the given ID. - - :param conversation_id: The conversation identifier. - :returns: The deleted conversation resource. - parameters: - - name: conversation_id - description: The conversation identifier. - required: true - schema: - type: string - in: path - deprecated: false - /v1/conversations/{conversation_id}/items: - get: - responses: - '200': - description: List of conversation items. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/ConversationItemList' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: tags: - - Conversations - summary: List items. - description: >- - List items. - - List items in the conversation. - - :param conversation_id: The conversation identifier. - :param after: An item ID to list items after, used in pagination. - :param include: Specify additional output data to include in the response. - :param limit: A limit on the number of objects to be returned (1-100, - default 20). - :param order: The order to return items in (asc or desc, default desc). - :returns: List of conversation items. + - Datasets + summary: Get a dataset by its ID + description: Get a dataset by its ID + operationId: get_dataset_v1beta_datasets___dataset_id___get parameters: - - name: conversation_id - description: The conversation identifier. - required: true - schema: - type: string - in: path - - name: after - description: >- - An item ID to list items after, used in pagination. - required: false - schema: - type: string - in: query - - name: include - description: >- - Specify additional output data to include in the response. - required: false - schema: - $ref: '#/components/schemas/list' - in: query - - name: limit - description: >- - A limit on the number of objects to be returned (1-100, default 20). - required: false - schema: - type: integer - in: query - - name: order - description: >- - The order to return items in (asc or desc, default desc). - required: false - schema: - $ref: '#/components/schemas/Literal' - in: query - deprecated: false - post: + - name: dataset_id + in: path + required: true + schema: + type: string + description: The ID of the dataset to get + title: Dataset Id + description: The ID of the dataset to get responses: '200': - description: List of created items. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ConversationItemList' + $ref: '#/components/schemas/Dataset' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Conversations - summary: Create items. - description: >- - Create items. - - Create items in the conversation. - - :param conversation_id: The conversation identifier. - :param items: Items to include in the conversation context. - :returns: List of created items. - parameters: - - name: conversation_id - description: The conversation identifier. - required: true - schema: - type: string - in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AddItemsRequest' - required: true - deprecated: false - /v1/conversations/{conversation_id}/items/{item_id}: - get: - responses: - '200': - description: The conversation item. + description: The request was invalid or malformed. content: application/json: schema: - id: Annotated - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Conversations - summary: Retrieve an item. - description: >- - Retrieve an item. - - Retrieve a conversation item. - - :param conversation_id: The conversation identifier. - :param item_id: The item identifier. - :returns: The conversation item. - parameters: - - name: conversation_id - description: The conversation identifier. - required: true - schema: - type: string - in: path - - name: item_id - description: The item identifier. - required: true - schema: - type: string - in: path - deprecated: false - delete: - responses: - '200': - description: The deleted item resource. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/ConversationItemDeletedResource' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents: + get: tags: - - Conversations - summary: Delete an item. - description: >- - Delete an item. - - Delete a conversation item. - - :param conversation_id: The conversation identifier. - :param item_id: The item identifier. - :returns: The deleted item resource. + - Agents + summary: List all agents. + description: List all agents. + operationId: list_agents_v1alpha_agents_get parameters: - - name: conversation_id - description: The conversation identifier. - required: true - schema: - type: string - in: path - - name: item_id - description: The item identifier. - required: true - schema: - type: string - in: path - deprecated: false - /v1/embeddings: - post: + - name: start_index + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The index to start the pagination from. + title: Start Index + description: The index to start the pagination from. + - name: limit + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The number of agents to return. + title: Limit + description: The number of agents to return. responses: '200': - description: >- - An OpenAIEmbeddingsResponse containing the embeddings. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/OpenAIEmbeddingsResponse' + schema: {} '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - Inference - summary: Create embeddings. - description: >- - Create embeddings. - - Generate OpenAI-compatible embeddings for the given input using the specified - model. - :returns: An OpenAIEmbeddingsResponse containing the embeddings. - parameters: [] + - Agents + summary: Create an agent. + description: Create an agent with the given configuration. + operationId: create_agent_v1alpha_agents_post requestBody: + required: true content: application/json: schema: - id: Annotated - required: true - deprecated: false - /v1/files: - get: + $ref: '#/components/schemas/AgentConfig-Input' responses: '200': - description: >- - An ListOpenAIFileResponse containing the list of files. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIFileResponse' + $ref: '#/components/schemas/AgentCreateResponse' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Files - summary: List files. - description: >- - List files. - - Returns a list of files that belong to the user's organization. - - :param after: A cursor for use in pagination. `after` is an object - ID that defines your place in the list. For instance, if you make a list request - and receive 100 objects, ending with obj_foo, your subsequent call can include - after=obj_foo in order to fetch the next page of the list. - :param limit: A limit on the number of objects to be returned. Limit - can range between 1 and 10,000, and the default is 10,000. - :param order: Sort order by the `created_at` timestamp of the objects. - `asc` for ascending order and `desc` for descending order. - :param purpose: Only return files with the given purpose. - :returns: An ListOpenAIFileResponse containing the list of files. - parameters: - - name: after - description: >- - A cursor for use in pagination. `after` is an object ID that defines your - place in the list. For instance, if you make a list request and receive - 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo - in order to fetch the next page of the list. - required: false - schema: - type: string - in: query - - name: limit - description: >- - A limit on the number of objects to be returned. Limit can range between - 1 and 10,000, and the default is 10,000. - required: false - schema: - type: integer - in: query - - name: order - description: >- - Sort order by the `created_at` timestamp of the objects. `asc` for ascending - order and `desc` for descending order. - required: false - schema: - $ref: '#/components/schemas/Order' - in: query - - name: purpose - description: >- - Only return files with the given purpose. - required: false - schema: - $ref: '#/components/schemas/OpenAIFilePurpose' - in: query - deprecated: false - post: - responses: - '200': - description: >- - An OpenAIFileObject representing the uploaded file. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileObject' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Files - summary: Upload file. - description: >- - Upload file. - - Upload a file that can be used across various endpoints. - - The file upload should be a multipart form request with: - - file: The File object (not file name) to be uploaded. - - purpose: The intended purpose of the uploaded file. - - expires_after: Optional form values describing expiration for the - file. - - :param file: The uploaded file object containing content and metadata - (filename, content_type, etc.). - :param purpose: The intended purpose of the uploaded file (e.g., "assistants", - "fine-tune"). - :param expires_after: Optional form values describing expiration for - the file. - :returns: An OpenAIFileObject representing the uploaded file. - parameters: [] - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - file: - type: string - format: binary - purpose: - $ref: '#/components/schemas/OpenAIFilePurpose' - expires_after: - $ref: '#/components/schemas/ExpiresAfter' - required: - - file - - purpose - required: true - deprecated: false - /v1/files/{file_id}: - get: - responses: - '200': - description: >- - An OpenAIFileObject containing file information. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileObject' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Files - summary: Retrieve file. - description: >- - Retrieve file. - - Returns information about a specific file. - - :param file_id: The ID of the file to use for this request. - :returns: An OpenAIFileObject containing file information. - parameters: - - name: file_id - description: >- - The ID of the file to use for this request. - required: true - schema: - type: string - in: path - deprecated: false - delete: - responses: - '200': - description: >- - An OpenAIFileDeleteResponse indicating successful deletion. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileDeleteResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - Files - summary: Delete file. - description: >- - Delete file. - - :param file_id: The ID of the file to use for this request. - :returns: An OpenAIFileDeleteResponse indicating successful deletion. - parameters: - - name: file_id - description: >- - The ID of the file to use for this request. - required: true - schema: - type: string - in: path - deprecated: false - /v1/files/{file_id}/content: - get: - responses: - '200': - description: >- - The raw file content as a binary response. + description: An unexpected error occurred. content: application/json: schema: - $ref: '#/components/schemas/Response' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}: + delete: tags: - - Files - summary: Retrieve file content. - description: >- - Retrieve file content. - - Returns the contents of the specified file. - - :param file_id: The ID of the file to use for this request. - :returns: The raw file content as a binary response. + - Agents + summary: Delete an agent. + description: Delete an agent by its ID. + operationId: delete_agent_v1alpha_agents___agent_id___delete parameters: - - name: file_id - description: >- - The ID of the file to use for this request. - required: true - schema: - type: string - in: path - deprecated: false - /v1/health: - get: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to delete. + title: Agent Id + description: The ID of the agent to delete. responses: - '200': - description: >- - Health information indicating if the service is operational. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/HealthInfo' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Inspect - summary: Get health status. - description: >- - Get health status. - - Get the current health status of the service. - - :returns: Health information indicating if the service is operational. - parameters: [] - deprecated: false - /v1/inspect/routes: - get: - responses: - '200': - description: >- - Response containing information about all available routes. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/ListRoutesResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: tags: - - Inspect - summary: List routes. - description: >- - List routes. - - List all available API routes with their methods and implementing providers. + - Agents + summary: Describe an agent. + description: Describe an agent by its ID. + operationId: get_agent_v1alpha_agents___agent_id___get parameters: - - name: api_filter - in: query - description: >- - Optional filter to control which routes are returned. Can be an API level - ('v1', 'v1alpha', 'v1beta') to show non-deprecated routes at that level, - or 'deprecated' to show deprecated routes across all levels. If not specified, - returns only non-deprecated v1 routes. - required: false - schema: - type: string - enum: - - v1 - - v1alpha - - v1beta - - deprecated - deprecated: false - /v1/models: - get: + - name: agent_id + in: path + required: true + schema: + type: string + description: ID of the agent. + title: Agent Id + description: ID of the agent. responses: '200': - description: A OpenAIListModelsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAIListModelsResponse' + $ref: '#/components/schemas/Agent' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Models - summary: List models using the OpenAI API. - description: List models using the OpenAI API. - parameters: [] - deprecated: false - post: - responses: - '200': - description: A Model. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Model' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session: + post: tags: - - Models - summary: Register model. - description: >- - Register model. - - Register a model. - - :param model_id: The identifier of the model to register. - :param provider_model_id: The identifier of the model in the provider. - :param provider_id: The identifier of the provider. - :param metadata: Any additional metadata for this model. - :param model_type: The type of model to register. - :returns: A Model. - parameters: [] + - Agents + summary: Create a new session for an agent. + description: Create a new session for an agent. + operationId: create_agent_session_v1alpha_agents___agent_id___session_post + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to create the session for. + title: Agent Id + description: The ID of the agent to create the session for. requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/RegisterModelRequest' - required: true - deprecated: false - /v1/models/{model_id}: - get: + $ref: '#/components/schemas/CreateAgentSessionRequest' responses: '200': - description: A Model. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Model' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Models - summary: Get model. - description: >- - Get model. - - Get a model by its identifier. - - :param model_id: The identifier of the model to get. - :returns: A Model. - parameters: - - name: model_id - description: The identifier of the model to get. - required: true - schema: - type: string - in: path - deprecated: false - delete: - responses: - '200': - description: OK + $ref: '#/components/schemas/AgentSessionCreateResponse' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Models - summary: Unregister model. - description: >- - Unregister model. - - Unregister a model. - - :param model_id: The identifier of the model to unregister. - parameters: - - name: model_id - description: >- - The identifier of the model to unregister. - required: true - schema: - type: string - in: path - deprecated: false - /v1/moderations: - post: - responses: - '200': - description: A moderation object. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ModerationObject' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session/{{session_id}}: + delete: tags: - - Safety - summary: Create moderation. - description: >- - Create moderation. - - Classifies if text and/or image inputs are potentially harmful. - :param input: Input (or inputs) to classify. - Can be a single string, an array of strings, or an array of multi-modal - input objects similar to other models. - :param model: (Optional) The content moderation model you would like - to use. - :returns: A moderation object. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RunModerationRequest' + - Agents + summary: Delete an agent session. + description: Delete an agent session by its ID. + operationId: delete_agents_session_v1alpha_agents___agent_id___session___session_id___delete + parameters: + - name: agent_id + in: path required: true - deprecated: false - /v1/prompts: - get: + schema: + type: string + description: The ID of the agent to delete the session for. + title: Agent Id + description: The ID of the agent to delete the session for. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to delete. + title: Session Id + description: The ID of the session to delete. responses: - '200': - description: >- - A ListPromptsResponse containing all prompts. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ListPromptsResponse' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Prompts - summary: List all prompts. - description: >- - List all prompts. - - :returns: A ListPromptsResponse containing all prompts. - parameters: [] - deprecated: false - post: - responses: - '200': - description: The created Prompt resource. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/Prompt' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Prompts - summary: Create prompt. - description: >- - Create prompt. - - Create a new prompt. - - :param prompt: The prompt text content with variable placeholders. - :param variables: List of variable names that can be used in the prompt - template. - :returns: The created Prompt resource. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreatePromptRequest' - required: true - deprecated: false - /v1/prompts/{prompt_id}: - get: - responses: - '200': - description: A Prompt resource. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/Prompt' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: tags: - - Prompts - summary: Get prompt. - description: >- - Get prompt. - - Get a prompt by its identifier and optional version. - - :param prompt_id: The identifier of the prompt to get. - :param version: The version of the prompt to get (defaults to latest). - :returns: A Prompt resource. + - Agents + summary: Retrieve an agent session. + description: Retrieve an agent session by its ID. + operationId: get_agents_session_v1alpha_agents___agent_id___session___session_id___get parameters: - - name: prompt_id - description: The identifier of the prompt to get. - required: true - schema: - type: string - in: path - - name: version - description: >- - The version of the prompt to get (defaults to latest). - required: false - schema: - type: integer - in: query - deprecated: false - post: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to get the session for. + title: Agent Id + description: The ID of the agent to get the session for. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to get. + title: Session Id + description: The ID of the session to get. + - name: turn_ids + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + - type: 'null' + description: List of turn IDs to filter the session by. + title: Turn Ids + description: List of turn IDs to filter the session by. responses: '200': - description: >- - The updated Prompt resource with incremented version. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Prompt' + $ref: '#/components/schemas/Session' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session/{{session_id}}/turn: + post: tags: - - Prompts - summary: Update prompt. - description: >- - Update prompt. - - Update an existing prompt (increments version). - - :param prompt_id: The identifier of the prompt to update. - :param prompt: The updated prompt text content. - :param version: The current version of the prompt being updated. - :param variables: Updated list of variable names that can be used - in the prompt template. - :param set_as_default: Set the new version as the default (default=True). - :returns: The updated Prompt resource with incremented version. + - Agents + summary: Create a new turn for an agent. + description: Create a new turn for an agent. + operationId: create_agent_turn_v1alpha_agents___agent_id___session___session_id___turn_post parameters: - - name: prompt_id - description: The identifier of the prompt to update. - required: true - schema: - type: string - in: path + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to create the turn for. + title: Agent Id + description: The ID of the agent to create the turn for. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to create the turn for. + title: Session Id + description: The ID of the session to create the turn for. requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/UpdatePromptRequest' - required: true - deprecated: false - delete: + $ref: '#/components/schemas/AgentTurnCreateRequest' responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session/{{session_id}}/turn/{{turn_id}}: + get: tags: - - Prompts - summary: Delete prompt. - description: >- - Delete prompt. - - Delete a prompt. - - :param prompt_id: The identifier of the prompt to delete. + - Agents + summary: Retrieve an agent turn. + description: Retrieve an agent turn by its ID. + operationId: get_agents_turn_v1alpha_agents___agent_id___session___session_id___turn___turn_id___get parameters: - - name: prompt_id - description: The identifier of the prompt to delete. - required: true - schema: - type: string - in: path - deprecated: false - /v1/prompts/{prompt_id}/set-default-version: - post: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to get the turn for. + title: Agent Id + description: The ID of the agent to get the turn for. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to get the turn for. + title: Session Id + description: The ID of the session to get the turn for. + - name: turn_id + in: path + required: true + schema: + type: string + description: The ID of the turn to get. + title: Turn Id + description: The ID of the turn to get. responses: '200': - description: >- - The prompt with the specified version now set as default. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Prompt' + $ref: '#/components/schemas/Turn' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session/{{session_id}}/turn/{{turn_id}}/resume: + post: tags: - - Prompts - summary: Set prompt version. - description: >- - Set prompt version. - - Set which version of a prompt should be the default in get_prompt (latest). - - :param prompt_id: The identifier of the prompt. - :param version: The version to set as default. - :returns: The prompt with the specified version now set as default. + - Agents + summary: Resume an agent turn. + description: Resume an agent turn with executed tool call responses. + operationId: resume_agent_turn_v1alpha_agents___agent_id___session___session_id___turn___turn_id___resume_post parameters: - - name: prompt_id - description: The identifier of the prompt. - required: true - schema: - type: string - in: path + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to resume. + title: Agent Id + description: The ID of the agent to resume. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to resume. + title: Session Id + description: The ID of the session to resume. + - name: turn_id + in: path + required: true + schema: + type: string + description: The ID of the turn to resume. + title: Turn Id + description: The ID of the turn to resume. requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/SetDefaultVersionRequest' - required: true - deprecated: false - /v1/prompts/{prompt_id}/versions: - get: + $ref: '#/components/schemas/AgentTurnResumeRequest' responses: '200': - description: >- - A ListPromptsResponse containing all versions of the prompt. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/ListPromptsResponse' + schema: {} '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Prompts - summary: List prompt versions. - description: >- - List prompt versions. - - List all versions of a specific prompt. - - :param prompt_id: The identifier of the prompt to list versions for. - :returns: A ListPromptsResponse containing all versions of the prompt. - parameters: - - name: prompt_id - description: >- - The identifier of the prompt to list versions for. - required: true - schema: - type: string - in: path - deprecated: false - /v1/providers: - get: - responses: - '200': - description: >- - A ListProvidersResponse containing information about all providers. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ListProvidersResponse' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: List providers. - description: >- - List providers. - - List all available providers. - - :returns: A ListProvidersResponse containing information about all - providers. - parameters: [] - deprecated: false - /v1/providers/{provider_id}: - get: - responses: - '200': - description: >- - A ProviderInfo object containing the provider's details. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/ProviderInfo' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: Get provider. - description: >- - Get provider. - - Get detailed information about a specific provider. - - :param provider_id: The ID of the provider to inspect. - :returns: A ProviderInfo object containing the provider's details. - parameters: - - name: provider_id - description: The ID of the provider to inspect. - required: true - schema: - type: string - in: path - deprecated: false - /v1/responses: - get: - responses: - '200': - description: A ListOpenAIResponseObject. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIResponseObject' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: List all responses. - description: >- - List all responses. - - :param after: The ID of the last response to return. - :param limit: The number of responses to return. - :param model: The model to filter responses by. - :param order: The order to sort responses by when sorted by created_at - ('asc' or 'desc'). - :returns: A ListOpenAIResponseObject. - parameters: - - name: after - description: The ID of the last response to return. - required: false - schema: - type: string - in: query - - name: limit - description: The number of responses to return. - required: false - schema: - type: integer - in: query - - name: model - description: The model to filter responses by. - required: false - schema: - type: string - in: query - - name: order - description: >- - The order to sort responses by when sorted by created_at ('asc' or 'desc'). - required: false - schema: - $ref: '#/components/schemas/Order' - in: query - deprecated: false - post: - responses: - '200': - description: An OpenAIResponseObject. + description: An unexpected error occurred. content: application/json: schema: - $ref: '#/components/schemas/OpenAIResponseObject' - text/event-stream: - schema: - $ref: '#/components/schemas/AsyncIterator' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session/{{session_id}}/turn/{{turn_id}}/step/{{step_id}}: + get: tags: - - Agents - summary: Create a model response. - description: >- - Create a model response. - - :param input: Input message(s) to create the response. - :param model: The underlying LLM used for completions. - :param previous_response_id: (Optional) if specified, the new response - will be a continuation of the previous response. This can be used to easily - fork-off new responses from existing responses. - :param conversation: (Optional) The ID of a conversation to add the - response to. Must begin with 'conv_'. Input and output messages will be automatically - added to the conversation. - :param include: (Optional) Additional fields to include in the response. - :param guardrails: (Optional) List of guardrails to apply during response - generation. Can be guardrail IDs (strings) or guardrail specifications. - :returns: An OpenAIResponseObject. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateOpenaiResponseRequest' + - Agents + summary: Retrieve an agent step. + description: Retrieve an agent step by its ID. + operationId: get_agents_step_v1alpha_agents___agent_id___session___session_id___turn___turn_id___step___step_id___get + parameters: + - name: agent_id + in: path required: true - deprecated: false - x-llama-stack-extra-body-params: - - name: guardrails - schema: - id: Annotated - description: >- - List of guardrails to apply during response generation. Guardrails provide - safety and content moderation. - required: true - /v1/responses/{response_id}: - get: + schema: + type: string + description: The ID of the agent to get the step for. + title: Agent Id + description: The ID of the agent to get the step for. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to get the step for. + title: Session Id + description: The ID of the session to get the step for. + - name: turn_id + in: path + required: true + schema: + type: string + description: The ID of the turn to get the step for. + title: Turn Id + description: The ID of the turn to get the step for. + - name: step_id + in: path + required: true + schema: + type: string + description: The ID of the step to get. + title: Step Id + description: The ID of the step to get. responses: '200': - description: An OpenAIResponseObject. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAIResponseObject' + $ref: '#/components/schemas/AgentStepResponse' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: Get a model response. - description: >- - Get a model response. - - :param response_id: The ID of the OpenAI response to retrieve. - :returns: An OpenAIResponseObject. - parameters: - - name: response_id - description: >- - The ID of the OpenAI response to retrieve. - required: true - schema: - type: string - in: path - deprecated: false - delete: - responses: - '200': - description: An OpenAIDeleteResponseObject + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/OpenAIDeleteResponseObject' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: Delete a response. - description: >- - Delete a response. - - :param response_id: The ID of the OpenAI response to delete. - :returns: An OpenAIDeleteResponseObject - parameters: - - name: response_id - description: The ID of the OpenAI response to delete. - required: true - schema: - type: string - in: path - deprecated: false - /v1/responses/{response_id}/input_items: - get: - responses: - '200': - description: An ListOpenAIResponseInputItem. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIResponseInputItem' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/sessions: + get: tags: - - Agents - summary: List input items. - description: >- - List input items. - - :param response_id: The ID of the response to retrieve input items for. - :param after: An item ID to list items after, used for pagination. - :param before: An item ID to list items before, used for pagination. - :param include: Additional fields to include in the response. - :param limit: A limit on the number of objects to be returned. Limit - can range between 1 and 100, and the default is 20. - :param order: The order to return the input items in. Default is desc. - :returns: An ListOpenAIResponseInputItem. + - Agents + summary: List all sessions of an agent. + description: List all session(s) of a given agent. + operationId: list_agent_sessions_v1alpha_agents___agent_id___sessions_get parameters: - - name: response_id - description: >- - The ID of the response to retrieve input items for. - required: true - schema: - type: string - in: path - - name: after - description: >- - An item ID to list items after, used for pagination. - required: false - schema: - type: string - in: query - - name: before - description: >- - An item ID to list items before, used for pagination. - required: false - schema: - type: string - in: query - - name: include - description: >- - Additional fields to include in the response. - required: false - schema: - $ref: '#/components/schemas/list' - in: query - - name: limit - description: >- - A limit on the number of objects to be returned. Limit can range between - 1 and 100, and the default is 20. - required: false - schema: - type: integer - in: query - - name: order - description: >- - The order to return the input items in. Default is desc. - required: false - schema: - $ref: '#/components/schemas/Order' - in: query - deprecated: false - /v1/safety/run-shield: - post: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to list sessions for. + title: Agent Id + description: The ID of the agent to list sessions for. + - name: start_index + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The index to start the pagination from. + title: Start Index + description: The index to start the pagination from. + - name: limit + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The number of sessions to return. + title: Limit + description: The number of sessions to return. responses: '200': - description: A RunShieldResponse. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/RunShieldResponse' + schema: {} '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - Safety - summary: Run shield. - description: >- - Run shield. - - Run a shield. - - :param shield_id: The identifier of the shield to run. - :param messages: The messages to run the shield on. - :param params: The parameters of the shield. - :returns: A RunShieldResponse. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RunShieldRequest' - required: true - deprecated: false - /v1/scoring-functions: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks: get: + tags: + - Benchmarks + summary: List all benchmarks + description: List all benchmarks + operationId: list_benchmarks_v1alpha_eval_benchmarks_get responses: '200': - description: A ListScoringFunctionsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListScoringFunctionsResponse' + $ref: '#/components/schemas/ListBenchmarksResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - ScoringFunctions - summary: List all scoring functions. - description: >- - List all scoring functions. - - :returns: A ListScoringFunctionsResponse. - parameters: [] - deprecated: false + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: - responses: - '200': - description: OK - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' tags: - - ScoringFunctions - summary: Register a scoring function. - description: >- - Register a scoring function. - - :param scoring_fn_id: The ID of the scoring function to register. - :param description: The description of the scoring function. - :param return_type: The return type of the scoring function. - :param provider_scoring_fn_id: The ID of the provider scoring function - to use for the scoring function. - :param provider_id: The ID of the provider to use for the scoring - function. - :param params: The parameters for the scoring function for benchmark - eval, these can be overridden for app eval. - parameters: [] + - Benchmarks + summary: Register a benchmark + description: Register a benchmark + operationId: register_benchmark_v1alpha_eval_benchmarks_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/RegisterScoringFunctionRequest' + $ref: '#/components/schemas/RegisterBenchmarkRequest' required: true - deprecated: false - /v1/scoring-functions/{scoring_fn_id}: - get: responses: - '200': - description: A ScoringFn. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ScoringFn' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - ScoringFunctions - summary: Get a scoring function by its ID. - description: >- - Get a scoring function by its ID. - - :param scoring_fn_id: The ID of the scoring function to get. - :returns: A ScoringFn. - parameters: - - name: scoring_fn_id - description: The ID of the scoring function to get. - required: true - schema: - type: string - in: path - deprecated: false + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks/{{benchmark_id}}: delete: - responses: - '200': - description: OK - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' tags: - - ScoringFunctions - summary: Unregister a scoring function. - description: >- - Unregister a scoring function. - - :param scoring_fn_id: The ID of the scoring function to unregister. + - Benchmarks + summary: Unregister a benchmark + description: Unregister a benchmark + operationId: unregister_benchmark_v1alpha_eval_benchmarks___benchmark_id___delete parameters: - - name: scoring_fn_id - description: >- - The ID of the scoring function to unregister. - required: true - schema: - type: string - in: path - deprecated: false - /v1/scoring/score: - post: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to unregister + title: Benchmark Id + description: The ID of the benchmark to unregister responses: - '200': - description: >- - A ScoreResponse object containing rows and aggregated results. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ScoreResponse' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: tags: - - Scoring - summary: Score a list of rows. - description: >- - Score a list of rows. - - :param input_rows: The rows to score. - :param scoring_functions: The scoring functions to use for the scoring. - :returns: A ScoreResponse object containing rows and aggregated results. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ScoreRequest' + - Benchmarks + summary: Get a benchmark by its ID + description: Get a benchmark by its ID + operationId: get_benchmark_v1alpha_eval_benchmarks___benchmark_id___get + parameters: + - name: benchmark_id + in: path required: true - deprecated: false - /v1/scoring/score-batch: - post: + schema: + type: string + description: The ID of the benchmark to get + title: Benchmark Id + description: The ID of the benchmark to get responses: '200': - description: A ScoreBatchResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ScoreBatchResponse' + $ref: '#/components/schemas/Benchmark' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks/{{benchmark_id}}/evaluations: + post: tags: - - Scoring - summary: Score a batch of rows. - description: >- - Score a batch of rows. - - :param dataset_id: The ID of the dataset to score. - :param scoring_functions: The scoring functions to use for the scoring. - :param save_results_dataset: Whether to save the results to a dataset. - :returns: A ScoreBatchResponse. - parameters: [] + - Eval + summary: Evaluate a list of rows on a benchmark + description: Evaluate a list of rows on a benchmark + operationId: evaluate_rows_v1alpha_eval_benchmarks___benchmark_id___evaluations_post + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/ScoreBatchRequest' - required: true - deprecated: false - /v1/shields: - get: + $ref: '#/components/schemas/EvaluateRowsRequest' responses: '200': - description: A ListShieldsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListShieldsResponse' + $ref: '#/components/schemas/EvaluateResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Shields - summary: List all shields. - description: >- - List all shields. - - :returns: A ListShieldsResponse. - parameters: [] - deprecated: false - post: - responses: - '200': - description: A Shield. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/Shield' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks/{{benchmark_id}}/jobs: + post: tags: - - Shields - summary: Register a shield. - description: >- - Register a shield. - - :param shield_id: The identifier of the shield to register. - :param provider_shield_id: The identifier of the shield in the provider. - :param provider_id: The identifier of the provider. - :param params: The parameters of the shield. - :returns: A Shield. - parameters: [] + - Eval + summary: Run an evaluation on a benchmark + description: Run an evaluation on a benchmark + operationId: run_eval_v1alpha_eval_benchmarks___benchmark_id___jobs_post + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/RegisterShieldRequest' - required: true - deprecated: false - /v1/shields/{identifier}: - get: + $ref: '#/components/schemas/BenchmarkConfig' responses: '200': - description: A Shield. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Shield' + $ref: '#/components/schemas/Job' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks/{{benchmark_id}}/jobs/{{job_id}}: + delete: tags: - - Shields - summary: Get a shield by its identifier. - description: >- - Get a shield by its identifier. - - :param identifier: The identifier of the shield to get. - :returns: A Shield. + - Eval + summary: Cancel a job + description: Cancel a job + operationId: job_cancel_v1alpha_eval_benchmarks___benchmark_id___jobs___job_id___delete parameters: - - name: identifier - description: The identifier of the shield to get. - required: true - schema: - type: string - in: path - deprecated: false - delete: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on + - name: job_id + in: path + required: true + schema: + type: string + description: The ID of the job to cancel + title: Job Id + description: The ID of the job to cancel responses: - '200': - description: OK + '204': + description: Successful Response '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: tags: - - Shields - summary: Unregister a shield. - description: >- - Unregister a shield. - - :param identifier: The identifier of the shield to unregister. + - Eval + summary: Get the status of a job + description: Get the status of a job + operationId: job_status_v1alpha_eval_benchmarks___benchmark_id___jobs___job_id___get parameters: - - name: identifier - description: >- - The identifier of the shield to unregister. - required: true - schema: - type: string - in: path - deprecated: false - /v1/tool-runtime/invoke: - post: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on + - name: job_id + in: path + required: true + schema: + type: string + description: The ID of the job to get the status of + title: Job Id + description: The ID of the job to get the status of responses: '200': - description: A ToolInvocationResult. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ToolInvocationResult' + $ref: '#/components/schemas/Job' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks/{{benchmark_id}}/jobs/{{job_id}}/result: + get: tags: - - ToolRuntime - summary: Run a tool with the given arguments. - description: >- - Run a tool with the given arguments. - - :param tool_name: The name of the tool to invoke. - :param kwargs: A dictionary of arguments to pass to the tool. - :returns: A ToolInvocationResult. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/InvokeToolRequest' + - Eval + summary: Get the result of a job + description: Get the result of a job + operationId: job_result_v1alpha_eval_benchmarks___benchmark_id___jobs___job_id___result_get + parameters: + - name: benchmark_id + in: path required: true - deprecated: false - /v1/tool-runtime/list-tools: - get: + schema: + type: string + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on + - name: job_id + in: path + required: true + schema: + type: string + description: The ID of the job to get the result of + title: Job Id + description: The ID of the job to get the result of responses: '200': - description: A ListToolDefsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListToolDefsResponse' + $ref: '#/components/schemas/EvaluateResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - ToolRuntime - summary: List all tools in the runtime. - description: >- - List all tools in the runtime. - - :param tool_group_id: The ID of the tool group to list tools for. - :param mcp_endpoint: The MCP endpoint to use for the tool group. - :returns: A ListToolDefsResponse. - parameters: - - name: tool_group_id - description: >- - The ID of the tool group to list tools for. - required: false - schema: - type: string - in: query - - name: mcp_endpoint - description: >- - The MCP endpoint to use for the tool group. - required: false - schema: - $ref: '#/components/schemas/URL' - in: query - deprecated: false - /v1/tool-runtime/rag-tool/insert: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/inference/rerank: post: - responses: - '200': - description: OK - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' tags: - - ToolRuntime - summary: >- - Index documents so they can be used by the RAG system. - description: >- - Index documents so they can be used by the RAG system. - - :param documents: List of documents to index in the RAG system - :param vector_store_id: ID of the vector database to store the document - embeddings - :param chunk_size_in_tokens: (Optional) Size in tokens for document - chunking during indexing - parameters: [] + - Inference + summary: Rerank a list of documents. + description: Rerank a list of documents based on their relevance to a query. + operationId: rerank_v1alpha_inference_rerank_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/InsertRequest' + $ref: '#/components/schemas/Body_rerank_v1alpha_inference_rerank_post' required: true - deprecated: false - /v1/tool-runtime/rag-tool/query: - post: responses: '200': - description: >- - RAGQueryResult containing the retrieved content and metadata + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/RAGQueryResult' + $ref: '#/components/schemas/RerankResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/post-training/job/artifacts: + get: tags: - - ToolRuntime - summary: >- - Query the RAG system for context; typically invoked by the agent. - description: >- - Query the RAG system for context; typically invoked by the agent. - - :param content: The query content to search for in the indexed documents - :param vector_store_ids: List of vector database IDs to search within - :param query_config: (Optional) Configuration parameters for the query - operation - :returns: RAGQueryResult containing the retrieved content and metadata - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QueryRequest' + - Post Training + summary: Get the artifacts of a training job + description: Get the artifacts of a training job + operationId: get_training_job_artifacts_v1alpha_post_training_job_artifacts_get + parameters: + - name: job_uuid + in: query required: true - deprecated: false - /v1/toolgroups: - get: + schema: + type: string + description: The UUID of the job to get the artifacts of + title: Job Uuid + description: The UUID of the job to get the artifacts of responses: '200': - description: A ListToolGroupsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListToolGroupsResponse' + $ref: '#/components/schemas/PostTrainingJobArtifactsResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - ToolGroups - summary: List tool groups with optional provider. - description: >- - List tool groups with optional provider. - - :returns: A ListToolGroupsResponse. - parameters: [] - deprecated: false + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/post-training/job/cancel: post: + tags: + - Post Training + summary: Cancel a training job + description: Cancel a training job + operationId: cancel_training_job_v1alpha_post_training_job_cancel_post + parameters: + - name: job_uuid + in: query + required: true + schema: + type: string + description: The UUID of the job to cancel + title: Job Uuid + description: The UUID of the job to cancel responses: - '200': - description: OK + '204': + description: Successful Response '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/post-training/job/status: + get: tags: - - ToolGroups - summary: Register a tool group. - description: >- - Register a tool group. - - :param toolgroup_id: The ID of the tool group to register. - :param provider_id: The ID of the provider to use for the tool group. - :param mcp_endpoint: The MCP endpoint to use for the tool group. - :param args: A dictionary of arguments to pass to the tool group. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterToolGroupRequest' + - Post Training + summary: Get the status of a training job + description: Get the status of a training job + operationId: get_training_job_status_v1alpha_post_training_job_status_get + parameters: + - name: job_uuid + in: query required: true - deprecated: false - /v1/toolgroups/{toolgroup_id}: - get: + schema: + type: string + description: The UUID of the job to get the status of + title: Job Uuid + description: The UUID of the job to get the status of responses: '200': - description: A ToolGroup. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ToolGroup' + $ref: '#/components/schemas/PostTrainingJobStatusResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - ToolGroups - summary: Get a tool group by its ID. - description: >- - Get a tool group by its ID. - - :param toolgroup_id: The ID of the tool group to get. - :returns: A ToolGroup. - parameters: - - name: toolgroup_id - description: The ID of the tool group to get. - required: true - schema: - type: string - in: path - deprecated: false - delete: - responses: - '200': - description: OK - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - ToolGroups - summary: Unregister a tool group. - description: >- - Unregister a tool group. - - :param toolgroup_id: The ID of the tool group to unregister. - parameters: - - name: toolgroup_id - description: The ID of the tool group to unregister. - required: true - schema: - type: string - in: path - deprecated: false - /v1/tools: - get: - responses: - '200': - description: A ListToolDefsResponse. + description: An unexpected error occurred. content: application/json: schema: - $ref: '#/components/schemas/ListToolDefsResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - ToolGroups - summary: List tools with optional tool group. - description: >- - List tools with optional tool group. - - :param toolgroup_id: The ID of the tool group to list tools for. - :returns: A ListToolDefsResponse. - parameters: - - name: toolgroup_id - description: >- - The ID of the tool group to list tools for. - required: false - schema: - type: string - in: query - deprecated: false - /v1/tools/{tool_name}: + $ref: '#/components/schemas/Error' + /v1alpha/post-training/jobs: get: + tags: + - Post Training + summary: Get all training jobs + description: Get all training jobs + operationId: get_training_jobs_v1alpha_post_training_jobs_get responses: '200': - description: A ToolDef. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ToolDef' + $ref: '#/components/schemas/ListPostTrainingJobsResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - ToolGroups - summary: Get a tool by its name. - description: >- - Get a tool by its name. - - :param tool_name: The name of the tool to get. - :returns: A ToolDef. - parameters: - - name: tool_name - description: The name of the tool to get. - required: true - schema: - type: string - in: path - deprecated: false - /v1/vector-io/insert: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/post-training/preference-optimize: post: - responses: - '200': - description: OK - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' tags: - - VectorIO - summary: Insert chunks into a vector database. - description: >- - Insert chunks into a vector database. - - :param vector_store_id: The identifier of the vector database to insert the - chunks into. - :param chunks: The chunks to insert. Each `Chunk` should contain content - which can be interleaved text, images, or other types. - `metadata`: `dict[str, Any]` and `embedding`: `List[float]` are - optional. - If `metadata` is provided, you configure how Llama Stack formats - the chunk during generation. - If `embedding` is not provided, it will be computed later. - :param ttl_seconds: The time to live of the chunks. - parameters: [] + - Post Training + summary: Run preference optimization of a model + description: Run preference optimization of a model + operationId: preference_optimize_v1alpha_post_training_preference_optimize_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/InsertChunksRequest' + $ref: '#/components/schemas/PreferenceOptimizeRequest' required: true - deprecated: false - /v1/vector-io/query: - post: responses: '200': - description: A QueryChunksResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/QueryChunksResponse' + $ref: '#/components/schemas/PostTrainingJob' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/post-training/supervised-fine-tune: + post: tags: - - VectorIO - summary: Query chunks from a vector database. - description: >- - Query chunks from a vector database. - - :param vector_store_id: The identifier of the vector database to query. - :param query: The query to search for. - :param params: The parameters of the query. - :returns: A QueryChunksResponse. - parameters: [] + - Post Training + summary: Run supervised fine-tuning of a model + description: Run supervised fine-tuning of a model + operationId: supervised_fine_tune_v1alpha_post_training_supervised_fine_tune_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/QueryChunksRequest' + $ref: '#/components/schemas/SupervisedFineTuneRequest' required: true - deprecated: false - /v1/vector_stores: - get: responses: '200': - description: >- - A VectorStoreListResponse containing the list of vector stores. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VectorStoreListResponse' + $ref: '#/components/schemas/PostTrainingJob' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/batches: + get: tags: - - VectorIO - summary: Returns a list of vector stores. - description: >- - Returns a list of vector stores. - - :param limit: A limit on the number of objects to be returned. Limit can range - between 1 and 100, and the default is 20. - :param order: Sort order by the `created_at` timestamp of the objects. - `asc` for ascending order and `desc` for descending order. - :param after: A cursor for use in pagination. `after` is an object - ID that defines your place in the list. - :param before: A cursor for use in pagination. `before` is an object - ID that defines your place in the list. - :returns: A VectorStoreListResponse containing the list of vector - stores. + - Batches + summary: List all batches for the current user. + description: List all batches for the current user. + operationId: list_batches_v1_batches_get parameters: - - name: limit - description: >- - A limit on the number of objects to be returned. Limit can range between - 1 and 100, and the default is 20. - required: false - schema: - type: integer - in: query - - name: order - description: >- - Sort order by the `created_at` timestamp of the objects. `asc` for ascending - order and `desc` for descending order. - required: false - schema: - type: string - in: query - - name: after - description: >- - A cursor for use in pagination. `after` is an object ID that defines your - place in the list. - required: false - schema: - type: string - in: query - - name: before - description: >- - A cursor for use in pagination. `before` is an object ID that defines - your place in the list. - required: false - schema: - type: string - in: query - deprecated: false - post: + - name: after + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: A cursor for pagination; returns batches after this batch ID. + title: After + description: A cursor for pagination; returns batches after this batch ID. + - name: limit + in: query + required: false + schema: + type: integer + maximum: 100 + minimum: 1 + description: Number of batches to return (default 20, max 100). + default: 20 + title: Limit + description: Number of batches to return (default 20, max 100). responses: '200': - description: >- - A VectorStoreObject representing the created vector store. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VectorStoreObject' + $ref: '#/components/schemas/ListBatchesResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - VectorIO - summary: Creates a vector store. - description: >- - Creates a vector store. - - Generate an OpenAI-compatible vector store with the given parameters. - :returns: A VectorStoreObject representing the created vector store. - parameters: [] + - Batches + summary: Create a new batch for processing multiple API requests. + description: Create a new batch for processing multiple API requests. + operationId: create_batch_v1_batches_post requestBody: + required: true content: application/json: schema: - id: Annotated - required: true - deprecated: false - /v1/vector_stores/{vector_store_id}: - get: + $ref: '#/components/schemas/CreateBatchRequest' responses: '200': - description: >- - A VectorStoreObject representing the vector store. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VectorStoreObject' + $ref: '#/components/schemas/Batch' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: Retrieves a vector store. - description: >- - Retrieves a vector store. - - :param vector_store_id: The ID of the vector store to retrieve. - :returns: A VectorStoreObject representing the vector store. - parameters: - - name: vector_store_id - description: The ID of the vector store to retrieve. - required: true - schema: - type: string - in: path - deprecated: false - post: - responses: - '200': - description: >- - A VectorStoreObject representing the updated vector store. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreObject' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/batches/{batch_id}: + get: tags: - - VectorIO - summary: Updates a vector store. - description: >- - Updates a vector store. - - :param vector_store_id: The ID of the vector store to update. - :param name: The name of the vector store. - :param expires_after: The expiration policy for a vector store. - :param metadata: Set of 16 key-value pairs that can be attached to - an object. - :returns: A VectorStoreObject representing the updated vector store. + - Batches + summary: Retrieve information about a specific batch. + description: Retrieve information about a specific batch. + operationId: retrieve_batch_v1_batches__batch_id__get parameters: - - name: vector_store_id - description: The ID of the vector store to update. - required: true - schema: - type: string - in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenaiUpdateVectorStoreRequest' + - name: batch_id + in: path required: true - deprecated: false - delete: + schema: + type: string + description: The ID of the batch to retrieve. + title: Batch Id + description: The ID of the batch to retrieve. responses: '200': - description: >- - A VectorStoreDeleteResponse indicating the deletion status. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VectorStoreDeleteResponse' + $ref: '#/components/schemas/Batch' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: Delete a vector store. - description: >- - Delete a vector store. - - :param vector_store_id: The ID of the vector store to delete. - :returns: A VectorStoreDeleteResponse indicating the deletion status. - parameters: - - name: vector_store_id - description: The ID of the vector store to delete. - required: true - schema: - type: string - in: path - deprecated: false - /v1/vector_stores/{vector_store_id}/file_batches: - post: - responses: - '200': - description: >- - A VectorStoreFileBatchObject representing the created file batch. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileBatchObject' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/batches/{batch_id}/cancel: + post: tags: - - VectorIO - summary: Create a vector store file batch. - description: >- - Create a vector store file batch. - - Generate an OpenAI-compatible vector store file batch for the given vector - store. - :param vector_store_id: The ID of the vector store to create the file - batch for. - :returns: A VectorStoreFileBatchObject representing the created file - batch. + - Batches + summary: Cancel a batch that is in progress. + description: Cancel a batch that is in progress. + operationId: cancel_batch_v1_batches__batch_id__cancel_post parameters: - - name: vector_store_id - description: >- - The ID of the vector store to create the file batch for. - required: true - schema: - type: string - in: path - requestBody: - content: - application/json: - schema: - id: Annotated + - name: batch_id + in: path required: true - deprecated: false - /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: - get: + schema: + type: string + description: The ID of the batch to cancel. + title: Batch Id + description: The ID of the batch to cancel. responses: '200': - description: >- - A VectorStoreFileBatchObject representing the file batch. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileBatchObject' + $ref: '#/components/schemas/Batch' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: Retrieve a vector store file batch. - description: >- - Retrieve a vector store file batch. - - :param batch_id: The ID of the file batch to retrieve. - :param vector_store_id: The ID of the vector store containing the - file batch. - :returns: A VectorStoreFileBatchObject representing the file batch. - parameters: - - name: batch_id - description: The ID of the file batch to retrieve. - required: true - schema: - type: string - in: path - - name: vector_store_id - description: >- - The ID of the vector store containing the file batch. - required: true - schema: - type: string - in: path - deprecated: false - /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: - post: - responses: - '200': - description: >- - A VectorStoreFileBatchObject representing the cancelled file batch. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileBatchObject' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: Cancels a vector store file batch. - description: >- - Cancels a vector store file batch. - - :param batch_id: The ID of the file batch to cancel. - :param vector_store_id: The ID of the vector store containing the - file batch. - :returns: A VectorStoreFileBatchObject representing the cancelled - file batch. - parameters: - - name: batch_id - description: The ID of the file batch to cancel. - required: true - schema: - type: string - in: path - - name: vector_store_id - description: >- - The ID of the vector store containing the file batch. - required: true - schema: - type: string - in: path - deprecated: false - /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: - get: - responses: - '200': - description: >- - A VectorStoreFilesListInBatchResponse containing the list of files in - the batch. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFilesListInBatchResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: >- - Returns a list of vector store files in a batch. - description: >- - Returns a list of vector store files in a batch. - - :param batch_id: The ID of the file batch to list files from. - :param vector_store_id: The ID of the vector store containing the - file batch. - :param after: A cursor for use in pagination. `after` is an object - ID that defines your place in the list. - :param before: A cursor for use in pagination. `before` is an object - ID that defines your place in the list. - :param filter: Filter by file status. One of in_progress, completed, - failed, cancelled. - :param limit: A limit on the number of objects to be returned. Limit - can range between 1 and 100, and the default is 20. - :param order: Sort order by the `created_at` timestamp of the objects. - `asc` for ascending order and `desc` for descending order. - :returns: A VectorStoreFilesListInBatchResponse containing the list - of files in the batch. - parameters: - - name: batch_id - description: >- - The ID of the file batch to list files from. - required: true - schema: - type: string - in: path - - name: vector_store_id - description: >- - The ID of the vector store containing the file batch. - required: true - schema: - type: string - in: path - - name: after - description: >- - A cursor for use in pagination. `after` is an object ID that defines your - place in the list. - required: false - schema: - type: string - in: query - - name: before - description: >- - A cursor for use in pagination. `before` is an object ID that defines - your place in the list. - required: false - schema: - type: string - in: query - - name: filter - description: >- - Filter by file status. One of in_progress, completed, failed, cancelled. - required: false - schema: - type: string - in: query - - name: limit - description: >- - A limit on the number of objects to be returned. Limit can range between - 1 and 100, and the default is 20. - required: false - schema: - type: integer - in: query - - name: order - description: >- - Sort order by the `created_at` timestamp of the objects. `asc` for ascending - order and `desc` for descending order. - required: false - schema: - type: string - in: query - deprecated: false - /v1/vector_stores/{vector_store_id}/files: - get: - responses: - '200': - description: >- - A VectorStoreListFilesResponse containing the list of files. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreListFilesResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/chat/completions: + get: tags: - - VectorIO - summary: List files in a vector store. - description: >- - List files in a vector store. - - :param vector_store_id: The ID of the vector store to list files from. - :param limit: (Optional) A limit on the number of objects to be returned. - Limit can range between 1 and 100, and the default is 20. - :param order: (Optional) Sort order by the `created_at` timestamp - of the objects. `asc` for ascending order and `desc` for descending order. - :param after: (Optional) A cursor for use in pagination. `after` is - an object ID that defines your place in the list. - :param before: (Optional) A cursor for use in pagination. `before` - is an object ID that defines your place in the list. - :param filter: (Optional) Filter by file status to only return files - with the specified status. - :returns: A VectorStoreListFilesResponse containing the list of files. + - Inference + summary: List chat completions. + description: List chat completions. + operationId: list_chat_completions_v1_chat_completions_get parameters: - - name: vector_store_id - description: >- - The ID of the vector store to list files from. - required: true - schema: - type: string - in: path - - name: limit - description: >- - (Optional) A limit on the number of objects to be returned. Limit can - range between 1 and 100, and the default is 20. - required: false - schema: - type: integer - in: query - - name: order - description: >- - (Optional) Sort order by the `created_at` timestamp of the objects. `asc` - for ascending order and `desc` for descending order. - required: false - schema: - type: string - in: query - - name: after - description: >- - (Optional) A cursor for use in pagination. `after` is an object ID that - defines your place in the list. - required: false - schema: - type: string - in: query - - name: before - description: >- - (Optional) A cursor for use in pagination. `before` is an object ID that - defines your place in the list. - required: false - schema: - type: string - in: query - - name: filter - description: >- - (Optional) Filter by file status to only return files with the specified - status. - required: false - schema: - id: Union - in: query - deprecated: false - post: + - name: after + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: The ID of the last chat completion to return. + title: After + description: The ID of the last chat completion to return. + - name: limit + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The maximum number of chat completions to return. + default: 20 + title: Limit + description: The maximum number of chat completions to return. + - name: model + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: The model to filter by. + title: Model + description: The model to filter by. + - name: order + in: query + required: false + schema: + anyOf: + - $ref: '#/components/schemas/Order' + - type: 'null' + description: "The order to sort the chat completions by: 'asc' or 'desc'. Defaults to 'desc'." + default: desc + title: Order + description: "The order to sort the chat completions by: 'asc' or 'desc'. Defaults to 'desc'." responses: '200': - description: >- - A VectorStoreFileObject representing the attached file. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileObject' + $ref: '#/components/schemas/ListOpenAIChatCompletionResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - VectorIO - summary: Attach a file to a vector store. - description: >- - Attach a file to a vector store. - - :param vector_store_id: The ID of the vector store to attach the file to. - :param file_id: The ID of the file to attach to the vector store. - :param attributes: The key-value attributes stored with the file, - which can be used for filtering. - :param chunking_strategy: The chunking strategy to use for the file. - :returns: A VectorStoreFileObject representing the attached file. - parameters: - - name: vector_store_id - description: >- - The ID of the vector store to attach the file to. - required: true - schema: - type: string - in: path + - Inference + summary: Create chat completions. + description: Create chat completions. + operationId: openai_chat_completion_v1_chat_completions_post requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/OpenaiAttachFileToVectorStoreRequest' - required: true - deprecated: false - /v1/vector_stores/{vector_store_id}/files/{file_id}: - get: + $ref: '#/components/schemas/OpenAIChatCompletionRequestWithExtraBody' responses: '200': - description: >- - A VectorStoreFileObject representing the file. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileObject' + schema: {} '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/chat/completions/{completion_id}: + get: tags: - - VectorIO - summary: Retrieves a vector store file. - description: >- - Retrieves a vector store file. - - :param vector_store_id: The ID of the vector store containing the file to - retrieve. - :param file_id: The ID of the file to retrieve. - :returns: A VectorStoreFileObject representing the file. + - Inference + summary: Get chat completion. + description: Get chat completion. + operationId: get_chat_completion_v1_chat_completions__completion_id__get parameters: - - name: vector_store_id - description: >- - The ID of the vector store containing the file to retrieve. - required: true - schema: - type: string - in: path - - name: file_id - description: The ID of the file to retrieve. - required: true - schema: - type: string - in: path - deprecated: false - post: + - name: completion_id + in: path + required: true + schema: + type: string + description: ID of the chat completion. + title: Completion Id + description: ID of the chat completion. responses: '200': - description: >- - A VectorStoreFileObject representing the updated file. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileObject' + $ref: '#/components/schemas/OpenAICompletionWithInputMessages' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/completions: + post: tags: - - VectorIO - summary: Updates a vector store file. - description: >- - Updates a vector store file. - - :param vector_store_id: The ID of the vector store containing the file to - update. - :param file_id: The ID of the file to update. - :param attributes: The updated key-value attributes to store with - the file. - :returns: A VectorStoreFileObject representing the updated file. - parameters: - - name: vector_store_id - description: >- - The ID of the vector store containing the file to update. - required: true - schema: - type: string - in: path - - name: file_id - description: The ID of the file to update. - required: true - schema: - type: string - in: path + - Inference + summary: Create completion. + description: Create completion. + operationId: openai_completion_v1_completions_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenaiUpdateVectorStoreFileRequest' + $ref: '#/components/schemas/OpenAICompletionRequestWithExtraBody' required: true - deprecated: false - delete: responses: '200': - description: >- - A VectorStoreFileDeleteResponse indicating the deletion status. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileDeleteResponse' + $ref: '#/components/schemas/OpenAICompletion' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: Delete a vector store file. - description: >- - Delete a vector store file. - - :param vector_store_id: The ID of the vector store containing the file to - delete. - :param file_id: The ID of the file to delete. - :returns: A VectorStoreFileDeleteResponse indicating the deletion - status. - parameters: - - name: vector_store_id - description: >- - The ID of the vector store containing the file to delete. - required: true - schema: - type: string - in: path - - name: file_id - description: The ID of the file to delete. - required: true - schema: - type: string - in: path - deprecated: false - /v1/vector_stores/{vector_store_id}/files/{file_id}/content: - get: - responses: - '200': - description: >- - A list of InterleavedContent representing the file contents. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileContentsResponse' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: >- - Retrieves the contents of a vector store file. - description: >- - Retrieves the contents of a vector store file. - - :param vector_store_id: The ID of the vector store containing the file to - retrieve. - :param file_id: The ID of the file to retrieve. - :returns: A list of InterleavedContent representing the file contents. - parameters: - - name: vector_store_id - description: >- - The ID of the vector store containing the file to retrieve. - required: true - schema: - type: string - in: path - - name: file_id - description: The ID of the file to retrieve. - required: true - schema: - type: string - in: path - deprecated: false - /v1/vector_stores/{vector_store_id}/search: - post: - responses: - '200': - description: >- - A VectorStoreSearchResponse containing the search results. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreSearchResponsePage' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/conversations: + post: tags: - - VectorIO - summary: Search for chunks in a vector store. - description: >- - Search for chunks in a vector store. - - Searches a vector store for relevant chunks based on a query and optional - file attribute filters. - - :param vector_store_id: The ID of the vector store to search. - :param query: The query string or array for performing the search. - :param filters: Filters based on file attributes to narrow the search - results. - :param max_num_results: Maximum number of results to return (1 to - 50 inclusive, default 10). - :param ranking_options: Ranking options for fine-tuning the search - results. - :param rewrite_query: Whether to rewrite the natural language query - for vector search (default false) - :param search_mode: The search mode to use - "keyword", "vector", - or "hybrid" (default "vector") - :returns: A VectorStoreSearchResponse containing the search results. - parameters: - - name: vector_store_id - description: The ID of the vector store to search. - required: true - schema: - type: string - in: path + - Conversations + summary: Create a conversation + description: Create a conversation + operationId: create_conversation_v1_conversations_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenaiSearchVectorStoreRequest' + $ref: '#/components/schemas/ConversationCreateRequest' required: true - deprecated: false - /v1/version: - get: responses: '200': - description: >- - Version information containing the service version number. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VersionInfo' + $ref: '#/components/schemas/Conversation' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - Inspect - summary: Get version. - description: >- - Get version. - - Get the version of the service. - - :returns: Version information containing the service version number. - parameters: [] - deprecated: false - /v1beta/datasetio/append-rows/{dataset_id}: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/conversations/{conversation_id}: + delete: tags: - - V1Beta - summary: Append rows to a dataset. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: append_rows_v1beta_datasetio_append_rows__dataset_id__post + - Conversations + summary: Delete a conversation + description: Delete a conversation with the given ID + operationId: openai_delete_conversation_v1_conversations__conversation_id__delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - - name: dataset_id + - name: conversation_id in: path required: true schema: type: string - description: 'Path parameter: dataset_id' + description: The conversation identifier + title: Conversation Id + description: The conversation identifier responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/ConversationDeletedResource' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1beta/datasetio/iterrows/{dataset_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1Beta - summary: Get a paginated list of rows from a dataset. - description: Query endpoint for proper schema generation. - operationId: iterrows_v1beta_datasetio_iterrows__dataset_id__get + - Conversations + summary: Retrieve a conversation + description: Get a conversation with the given ID + operationId: get_conversation_v1_conversations__conversation_id__get parameters: - - name: limit - in: query - required: true - schema: - type: integer - title: Limit - - name: start_index - in: query - required: true - schema: - type: integer - title: Start Index - - name: dataset_id + - name: conversation_id in: path required: true schema: type: string - title: Dataset Id + description: The conversation identifier + title: Conversation Id + description: The conversation identifier responses: '200': - description: A PaginatedResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/PaginatedResponse' + $ref: '#/components/schemas/Conversation' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1beta/datasets: - get: - tags: - - V1Beta - summary: List all datasets. - description: Response-only endpoint for proper schema generation. - operationId: list_datasets_v1beta_datasets_get - responses: - '200': - description: A ListDatasetsResponse. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ListDatasetsResponse' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - post: - tags: - - V1Beta - summary: Register a new dataset. - description: Typed endpoint for proper schema generation. - operationId: register_dataset_v1beta_datasets_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/__main_____datasets_Request' - required: true - responses: - '200': - description: A Dataset. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/Dataset' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1beta/datasets/{dataset_id}: - delete: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - V1Beta - summary: Unregister a dataset by its ID. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: unregister_dataset_v1beta_datasets__dataset_id__delete + - Conversations + summary: Update a conversation + description: Update a conversation's metadata with the given ID + operationId: update_conversation_v1_conversations__conversation_id__post parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - - name: dataset_id + - name: conversation_id in: path required: true schema: type: string - description: 'Path parameter: dataset_id' + description: The conversation identifier + title: Conversation Id + description: The conversation identifier + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationUpdateRequest' responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/Conversation' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/conversations/{conversation_id}/items: get: tags: - - V1Beta - summary: Get a dataset by its ID. - description: Query endpoint for proper schema generation. - operationId: get_dataset_v1beta_datasets__dataset_id__get + - Conversations + summary: List items + description: List items in the conversation + operationId: list_items_v1_conversations__conversation_id__items_get parameters: - - name: dataset_id + - name: conversation_id in: path required: true schema: type: string - title: Dataset Id - responses: - '200': - description: A Dataset. - content: - application/json: - schema: - $ref: '#/components/schemas/Dataset' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents: - get: - tags: - - V1Alpha - summary: List all agents. - description: Query endpoint for proper schema generation. - operationId: list_agents_v1alpha_agents_get - parameters: + description: The conversation identifier + title: Conversation Id + description: The conversation identifier + - name: after + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: An item ID to list items after, used in pagination + title: After + description: An item ID to list items after, used in pagination + - name: include + in: query + required: false + schema: + anyOf: + - type: array + items: + $ref: '#/components/schemas/ConversationItemInclude' + - type: 'null' + description: Specify additional output data to include in the response + title: Include + description: Specify additional output data to include in the response - name: limit in: query - required: true + required: false schema: - type: integer + anyOf: + - type: integer + - type: 'null' + description: A limit on the number of objects to be returned (1-100, default 20) title: Limit - - name: start_index + description: A limit on the number of objects to be returned (1-100, default 20) + - name: order in: query - required: true + required: false schema: - type: integer - title: Start Index + anyOf: + - enum: + - asc + - desc + type: string + - type: 'null' + description: The order to return items in (asc or desc, default desc) + title: Order + description: The order to return items in (asc or desc, default desc) responses: '200': - description: A PaginatedResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/PaginatedResponse' + $ref: '#/components/schemas/ConversationItemList' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1Alpha - summary: Create an agent with the given configuration. - description: Typed endpoint for proper schema generation. - operationId: create_agent_v1alpha_agents_post + - Conversations + summary: Create items + description: Create items in the conversation + operationId: add_items_v1_conversations__conversation_id__items_post + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + description: The conversation identifier + title: Conversation Id + description: The conversation identifier requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/AgentConfig' + $ref: '#/components/schemas/ConversationItemCreateRequest' responses: '200': - description: An AgentCreateResponse with the agent ID. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/AgentCreateResponse' + $ref: '#/components/schemas/ConversationItemList' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents/{agent_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/conversations/{conversation_id}/items/{item_id}: delete: tags: - - V1Alpha - summary: Delete an agent by its ID and its associated sessions and turns. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: delete_agent_v1alpha_agents__agent_id__delete + - Conversations + summary: Delete an item + description: Delete a conversation item + operationId: openai_delete_conversation_item_v1_conversations__conversation_id__items__item_id__delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query + - name: conversation_id + in: path required: true schema: - title: Kwargs - - name: agent_id + type: string + description: The conversation identifier + title: Conversation Id + description: The conversation identifier + - name: item_id in: path required: true schema: type: string - description: The ID of the agent to delete. + description: The item identifier + title: Item Id + description: The item identifier responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/ConversationItemDeletedResource' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1Alpha - summary: Describe an agent by its ID. - description: Query endpoint for proper schema generation. - operationId: get_agent_v1alpha_agents__agent_id__get + - Conversations + summary: Retrieve an item + description: Retrieve a conversation item + operationId: retrieve_v1_conversations__conversation_id__items__item_id__get parameters: - - name: agent_id + - name: conversation_id in: path required: true schema: type: string - title: Agent Id - description: ID of the agent. + description: The conversation identifier + title: Conversation Id + description: The conversation identifier + - name: item_id + in: path + required: true + schema: + type: string + description: The item identifier + title: Item Id + description: The item identifier responses: '200': - description: An Agent of the agent. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Agent' + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + discriminator: + propertyName: type + mapping: + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + title: Response Retrieve V1 Conversations Conversation Id Items Item Id Get '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents/{agent_id}/session: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/embeddings: post: tags: - - V1Alpha - summary: Create a new session for an agent. - description: Typed endpoint for proper schema generation. - operationId: create_agent_session_v1alpha_agents__agent_id__session_post + - Inference + summary: Create embeddings. + description: Create embeddings. + operationId: openai_embeddings_v1_embeddings_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/__main_____agents_agent_id_session_Request' + $ref: '#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody' required: true responses: '200': - description: An AgentSessionCreateResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/AgentSessionCreateResponse' + $ref: '#/components/schemas/OpenAIEmbeddingsResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: agent_id - in: path - required: true - schema: - type: string - description: The ID of the agent to create the session for. - /v1alpha/agents/{agent_id}/session/{session_id}: - delete: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/files: + get: tags: - - V1Alpha - summary: Delete an agent session by its ID and its associated turns. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: delete_agents_session_v1alpha_agents__agent_id__session__session_id__delete + - Files + summary: List files. + description: Returns a list of files that belong to the user's organization. + operationId: openai_list_files_v1_files_get parameters: - - name: args + - name: after in: query - required: true + required: false schema: - title: Args - - name: kwargs + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + title: After + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + - name: limit in: query - required: true + required: false schema: - title: Kwargs - - name: session_id - in: path - required: true + anyOf: + - type: integer + - type: 'null' + description: A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000. + default: 10000 + title: Limit + description: A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000. + - name: order + in: query + required: false schema: - type: string - description: The ID of the session to delete. - - name: agent_id - in: path - required: true + anyOf: + - $ref: '#/components/schemas/Order' + - type: 'null' + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + default: desc + title: Order + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + - name: purpose + in: query + required: false schema: - type: string - description: The ID of the agent to delete the session for. + anyOf: + - $ref: '#/components/schemas/OpenAIFilePurpose' + - type: 'null' + description: Only return files with the given purpose. + title: Purpose + description: Only return files with the given purpose. responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/ListOpenAIFileResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - get: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - V1Alpha - summary: Retrieve an agent session by its ID. - description: Query endpoint for proper schema generation. - operationId: get_agents_session_v1alpha_agents__agent_id__session__session_id__get - parameters: - - name: turn_ids - in: query - required: true - schema: - type: string - title: Turn Ids - - name: session_id - in: path - required: true - schema: - type: string - title: Session Id - description: The ID of the session to get. - - name: agent_id - in: path + - Files + summary: Upload file. + description: Upload a file that can be used across various endpoints. + operationId: openai_upload_file_v1_files_post + requestBody: required: true - schema: - type: string - title: Agent Id - description: The ID of the agent to get the session for. + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/Body_openai_upload_file_v1_files_post' responses: '200': - description: A Session. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Session' + $ref: '#/components/schemas/OpenAIFileObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents/{agent_id}/session/{session_id}/turn: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/files/{file_id}: + delete: tags: - - V1Alpha - summary: Create a new turn for an agent. - description: Typed endpoint for proper schema generation. - operationId: create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/__main_____agents_agent_id_session_session_id_turn_Request' + - Files + summary: Delete file. + description: Delete a file. + operationId: openai_delete_file_v1_files__file_id__delete + parameters: + - name: file_id + in: path required: true + schema: + type: string + description: The ID of the file to use for this request. + title: File Id + description: The ID of the file to use for this request. responses: '200': - description: If stream=False, returns a Turn object. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Turn' + $ref: '#/components/schemas/OpenAIFileDeleteResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - Files + summary: Retrieve file. + description: Returns information about a specific file. + operationId: openai_retrieve_file_v1_files__file_id__get parameters: - - name: agent_id - in: path - required: true - schema: - type: string - description: The ID of the agent to create the turn for. - - name: session_id + - name: file_id in: path required: true schema: type: string - description: The ID of the session to create the turn for. - /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}: + description: The ID of the file to use for this request. + title: File Id + description: The ID of the file to use for this request. + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIFileObject' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/files/{file_id}/content: get: tags: - - V1Alpha - summary: Retrieve an agent turn by its ID. - description: Query endpoint for proper schema generation. - operationId: get_agents_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__get + - Files + summary: Retrieve file content. + description: Returns the contents of the specified file. + operationId: openai_retrieve_file_content_v1_files__file_id__content_get parameters: - - name: agent_id - in: path - required: true - schema: - type: string - title: Agent Id - description: The ID of the agent to get the turn for. - - name: session_id - in: path - required: true - schema: - type: string - title: Session Id - description: The ID of the session to get the turn for. - - name: turn_id + - name: file_id in: path required: true schema: type: string - title: Turn Id - description: The ID of the turn to get. + description: The ID of the file to use for this request. + title: File Id + description: The ID of the file to use for this request. responses: '200': - description: A Turn. + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Turn' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/health: + get: tags: - - V1Alpha - summary: Resume an agent turn with executed tool call responses. - description: Typed endpoint for proper schema generation. - operationId: resume_agent_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__resume_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request' - required: true + - Inspect + summary: Get health status. + description: Get the current health status of the service. + operationId: health_v1_health_get responses: '200': - description: A Turn object if stream is False, otherwise an AsyncIterator of AgentTurnResponseStreamChunk objects. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Turn' + $ref: '#/components/schemas/HealthInfo' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: agent_id - in: path - required: true - schema: - type: string - description: The ID of the agent to resume. - - name: session_id - in: path - required: true - schema: - type: string - description: The ID of the session to resume. - - name: turn_id - in: path - required: true - schema: - type: string - description: The ID of the turn to resume. - /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}: - get: - tags: - - V1Alpha - summary: Retrieve an agent step by its ID. - description: Query endpoint for proper schema generation. - operationId: get_agents_step_v1alpha_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get - parameters: - - name: agent_id - in: path - required: true - schema: - type: string - title: Agent Id - description: The ID of the agent to get the step for. - - name: session_id - in: path - required: true - schema: - type: string - title: Session Id - description: The ID of the session to get the step for. - - name: turn_id - in: path - required: true - schema: - type: string - title: Turn Id - description: The ID of the turn to get the step for. - - name: step_id - in: path - required: true - schema: - type: string - title: Step Id - description: The ID of the step to get. - responses: - '200': - description: An AgentStepResponse. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/AgentStepResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents/{agent_id}/sessions: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/inspect/routes: get: tags: - - V1Alpha - summary: List all session(s) of a given agent. - description: Query endpoint for proper schema generation. - operationId: list_agent_sessions_v1alpha_agents__agent_id__sessions_get - parameters: - - name: limit - in: query - required: true - schema: - type: integer - title: Limit - - name: start_index - in: query - required: true - schema: - type: integer - title: Start Index - - name: agent_id - in: path - required: true - schema: - type: string - title: Agent Id - description: The ID of the agent to list sessions for. + - Inspect + summary: List routes. + description: List all available API routes with their methods and implementing providers. + operationId: list_routes_v1_inspect_routes_get responses: '200': - description: A PaginatedResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/PaginatedResponse' + $ref: '#/components/schemas/ListRoutesResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/eval/benchmarks: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/models: get: tags: - - V1Alpha - summary: List all benchmarks. - description: Response-only endpoint for proper schema generation. - operationId: list_benchmarks_v1alpha_eval_benchmarks_get + - Models + summary: List all models. + description: List all models registered in Llama Stack. + operationId: list_models_v1_models_get responses: '200': - description: A ListBenchmarksResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListBenchmarksResponse' + $ref: '#/components/schemas/ListModelsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1Alpha - summary: Register a benchmark. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: register_benchmark_v1alpha_eval_benchmarks_post - parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query + - Models + summary: Register model. + description: Register a new model in Llama Stack. + operationId: register_model_v1_models_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterModelRequest' required: true - schema: - title: Kwargs responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/Model' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/eval/benchmarks/{benchmark_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/models/{model_id}: delete: tags: - - V1Alpha - summary: Unregister a benchmark. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: unregister_benchmark_v1alpha_eval_benchmarks__benchmark_id__delete + - Models + summary: Unregister model. + description: Unregister a model from Llama Stack. + operationId: unregister_model_v1_models__model_id__delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - - name: benchmark_id + - name: model_id in: path required: true schema: type: string - description: The ID of the benchmark to unregister. + description: The identifier of the model to unregister. + title: Model Id + description: The identifier of the model to unregister. responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1Alpha - summary: Get a benchmark by its ID. - description: Query endpoint for proper schema generation. - operationId: get_benchmark_v1alpha_eval_benchmarks__benchmark_id__get + - Models + summary: Get model. + description: Get a model by its identifier. + operationId: get_model_v1_models__model_id__get parameters: - - name: benchmark_id + - name: model_id in: path required: true schema: type: string - title: Benchmark Id - description: The ID of the benchmark to get. + description: The identifier of the model to get. + title: Model Id + description: The identifier of the model to get. responses: '200': - description: A Benchmark. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Benchmark' + $ref: '#/components/schemas/Model' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/eval/benchmarks/{benchmark_id}/evaluations: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/moderations: post: tags: - - V1Alpha - summary: Evaluate a list of rows on a benchmark. - description: Typed endpoint for proper schema generation. - operationId: evaluate_rows_v1alpha_eval_benchmarks__benchmark_id__evaluations_post + - Safety + summary: Create moderation. + description: Classifies if text and/or image inputs are potentially harmful. + operationId: run_moderation_v1_moderations_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/BenchmarkConfig' + $ref: '#/components/schemas/RunModerationRequest' required: true responses: '200': - description: EvaluateResponse object containing generations and scores. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/EvaluateResponse' + $ref: '#/components/schemas/ModerationObject' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: benchmark_id - in: path - required: true - schema: - type: string - description: The ID of the benchmark to run the evaluation on. - /v1alpha/eval/benchmarks/{benchmark_id}/jobs: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/prompts: + get: tags: - - V1Alpha - summary: Run an evaluation on a benchmark. - description: Typed endpoint for proper schema generation. - operationId: run_eval_v1alpha_eval_benchmarks__benchmark_id__jobs_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/BenchmarkConfig' - required: true + - Prompts + summary: List all prompts + description: List all prompts registered in Llama Stack + operationId: list_prompts_v1_prompts_get responses: '200': - description: The job that was created to run the evaluation. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Job' + $ref: '#/components/schemas/ListPromptsResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: benchmark_id - in: path - required: true - schema: - type: string - description: The ID of the benchmark to run the evaluation on. - /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}: - delete: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - V1Alpha - summary: Cancel a job. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: job_cancel_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__delete - parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - - name: benchmark_id - in: path - required: true - schema: - type: string - description: The ID of the benchmark to run the evaluation on. - - name: job_id - in: path + - Prompts + summary: Create prompt + description: Create a new prompt + operationId: create_prompt_v1_prompts_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePromptRequest' required: true - schema: - type: string - description: The ID of the job to cancel. responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/Prompt' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - get: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/prompts/{prompt_id}: + delete: tags: - - V1Alpha - summary: Get the status of a job. - description: Query endpoint for proper schema generation. - operationId: job_status_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__get + - Prompts + summary: Delete prompt + description: Delete a prompt + operationId: delete_prompt_v1_prompts__prompt_id__delete parameters: - - name: benchmark_id - in: path - required: true - schema: - type: string - title: Benchmark Id - description: The ID of the benchmark to run the evaluation on. - - name: job_id + - name: prompt_id in: path required: true schema: type: string - title: Job Id - description: The ID of the job to get the status of. + description: The identifier of the prompt to delete + title: Prompt Id + description: The identifier of the prompt to delete responses: - '200': - description: The status of the evaluation job. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Job' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1Alpha - summary: Get the result of a job. - description: Query endpoint for proper schema generation. - operationId: job_result_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__result_get + - Prompts + summary: Get prompt + description: Get a prompt by its identifier and optional version + operationId: get_prompt_v1_prompts__prompt_id__get parameters: - - name: benchmark_id + - name: prompt_id in: path required: true schema: type: string - title: Benchmark Id - description: The ID of the benchmark to run the evaluation on. - - name: job_id - in: path - required: true + description: The identifier of the prompt to get + title: Prompt Id + description: The identifier of the prompt to get + - name: version + in: query + required: false schema: - type: string - title: Job Id - description: The ID of the job to get the result of. + anyOf: + - type: integer + - type: 'null' + description: The version of the prompt to get (defaults to latest) + title: Version + description: The version of the prompt to get (defaults to latest) responses: '200': - description: The result of the job. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/EvaluateResponse' + $ref: '#/components/schemas/Prompt' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/inference/rerank: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1Alpha - summary: Rerank a list of documents based on their relevance to a query. - description: Typed endpoint for proper schema generation. - operationId: rerank_v1alpha_inference_rerank_post + - Prompts + summary: Update prompt + description: Update an existing prompt (increments version) + operationId: update_prompt_v1_prompts__prompt_id__post + parameters: + - name: prompt_id + in: path + required: true + schema: + type: string + description: The identifier of the prompt to update + title: Prompt Id + description: The identifier of the prompt to update requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/_inference_rerank_Request' - required: true + $ref: '#/components/schemas/UpdatePromptRequest' responses: '200': - description: RerankResponse with indices sorted by relevance score (descending). + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/RerankResponse' + $ref: '#/components/schemas/Prompt' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1alpha/post-training/job/artifacts: - get: - tags: - - V1Alpha - summary: Get the artifacts of a training job. - description: Query endpoint for proper schema generation. - operationId: get_training_job_artifacts_v1alpha_post_training_job_artifacts_get - parameters: - - name: job_uuid - in: query - required: true - schema: - type: string - title: Job Uuid - responses: - '200': - description: A PostTrainingJobArtifactsResponse. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/PostTrainingJobArtifactsResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/post-training/job/cancel: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/prompts/{prompt_id}/set-default-version: post: tags: - - V1Alpha - summary: Cancel a training job. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: cancel_training_job_v1alpha_post_training_job_cancel_post + - Prompts + summary: Set prompt version + description: Set which version of a prompt should be the default in get_prompt (latest) + operationId: set_default_version_v1_prompts__prompt_id__set_default_version_post parameters: - - name: args - in: query + - name: prompt_id + in: path required: true schema: - title: Args - - name: kwargs - in: query + type: string + description: The identifier of the prompt + title: Prompt Id + description: The identifier of the prompt + requestBody: required: true - schema: - title: Kwargs + content: + application/json: + schema: + $ref: '#/components/schemas/SetDefaultVersionRequest' responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/Prompt' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/post-training/job/status: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/prompts/{prompt_id}/versions: get: tags: - - V1Alpha - summary: Get the status of a training job. - description: Query endpoint for proper schema generation. - operationId: get_training_job_status_v1alpha_post_training_job_status_get + - Prompts + summary: List prompt versions + description: List all versions of a specific prompt + operationId: list_prompt_versions_v1_prompts__prompt_id__versions_get parameters: - - name: job_uuid - in: query + - name: prompt_id + in: path required: true schema: type: string - title: Job Uuid + description: The identifier of the prompt to list versions for + title: Prompt Id + description: The identifier of the prompt to list versions for responses: '200': - description: A PostTrainingJobStatusResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/PostTrainingJobStatusResponse' + $ref: '#/components/schemas/ListPromptsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/post-training/jobs: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/providers: get: tags: - - V1Alpha - summary: Get all training jobs. - description: Response-only endpoint for proper schema generation. - operationId: get_training_jobs_v1alpha_post_training_jobs_get + - Providers + summary: List providers + description: List all available providers + operationId: list_providers_v1_providers_get responses: '200': - description: A ListPostTrainingJobsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListPostTrainingJobsResponse' + $ref: '#/components/schemas/ListProvidersResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1alpha/post-training/preference-optimize: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/providers/{provider_id}: + get: tags: - - V1Alpha - summary: Run preference optimization of a model. - description: Typed endpoint for proper schema generation. - operationId: preference_optimize_v1alpha_post_training_preference_optimize_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DPOAlignmentConfig' + - Providers + summary: Get provider + description: Get detailed information about a specific provider + operationId: inspect_provider_v1_providers__provider_id__get + parameters: + - name: provider_id + in: path required: true + schema: + type: string + description: The ID of the provider to inspect + title: Provider Id + description: The ID of the provider to inspect responses: '200': - description: A PostTrainingJob. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/PostTrainingJob' + $ref: '#/components/schemas/ProviderInfo' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1alpha/post-training/supervised-fine-tune: - post: - tags: - - V1Alpha - summary: Run supervised fine-tuning of a model. - description: Typed endpoint for proper schema generation. - operationId: supervised_fine_tune_v1alpha_post_training_supervised_fine_tune_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TrainingConfig' - required: true - responses: - '200': - description: A PostTrainingJob. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/PostTrainingJob' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/batches: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/responses: get: tags: - - V1 - summary: List all batches for the current user. - description: Query endpoint for proper schema generation. - operationId: list_batches_v1_batches_get + - Agents + summary: List all responses. + description: List all responses. + operationId: list_openai_responses_v1_responses_get parameters: - name: after in: query - required: true + required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: The ID of the last response to return. title: After + description: The ID of the last response to return. - name: limit in: query required: false schema: - type: integer - default: 20 + anyOf: + - type: integer + - type: 'null' + description: The number of responses to return. + default: 50 title: Limit + description: The number of responses to return. + - name: model + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: The model to filter responses by. + title: Model + description: The model to filter responses by. + - name: order + in: query + required: false + schema: + anyOf: + - $ref: '#/components/schemas/Order' + - type: 'null' + description: The order to sort responses by when sorted by created_at ('asc' or 'desc'). + default: desc + title: Order + description: The order to sort responses by when sorted by created_at ('asc' or 'desc'). responses: '200': - description: A list of batch objects. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListBatchesResponse' + $ref: '#/components/schemas/ListOpenAIResponseObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Create a new batch for processing multiple API requests. - description: Typed endpoint for proper schema generation. - operationId: create_batch_v1_batches_post + - Agents + summary: Create a model response. + description: Create a model response. + operationId: create_openai_response_v1_responses_post requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/_batches_Request' + $ref: '#/components/schemas/CreateOpenAIResponseRequest' responses: '200': - description: The created batch object. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/Batch' + schema: {} '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/batches/{batch_id}: - get: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/responses/{response_id}: + delete: tags: - - V1 - summary: Retrieve information about a specific batch. - description: Query endpoint for proper schema generation. - operationId: retrieve_batch_v1_batches__batch_id__get + - Agents + summary: Delete a response. + description: Delete a response. + operationId: delete_openai_response_v1_responses__response_id__delete parameters: - - name: batch_id + - name: response_id in: path required: true schema: type: string - title: Batch Id - description: The ID of the batch to retrieve. + description: The ID of the OpenAI response to delete. + title: Response Id + description: The ID of the OpenAI response to delete. responses: '200': - description: The batch object. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Batch' + $ref: '#/components/schemas/OpenAIDeleteResponseObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/batches/{batch_id}/cancel: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: tags: - - V1 - summary: Cancel a batch that is in progress. - description: Typed endpoint for proper schema generation. - operationId: cancel_batch_v1_batches__batch_id__cancel_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_batches_batch_id_cancel_Request' + - Agents + summary: Get a model response. + description: Get a model response. + operationId: get_openai_response_v1_responses__response_id__get + parameters: + - name: response_id + in: path required: true + schema: + type: string + description: The ID of the OpenAI response to retrieve. + title: Response Id + description: The ID of the OpenAI response to retrieve. responses: '200': - description: The updated batch object. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Batch' + $ref: '#/components/schemas/OpenAIResponseObject' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/responses/{response_id}/input_items: + get: + tags: + - Agents + summary: List input items. + description: List input items. + operationId: list_openai_response_input_items_v1_responses__response_id__input_items_get parameters: - - name: batch_id + - name: response_id in: path required: true schema: type: string - description: The ID of the batch to cancel. - /v1/chat/completions: - get: - tags: - - V1 - summary: List chat completions. - description: Query endpoint for proper schema generation. - operationId: list_chat_completions_v1_chat_completions_get - parameters: + description: The ID of the response to retrieve input items for. + title: Response Id + description: The ID of the response to retrieve input items for. - name: after in: query - required: true + required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: An item ID to list items after, used for pagination. title: After - - name: model + description: An item ID to list items after, used for pagination. + - name: before in: query - required: true + required: false schema: - type: string - title: Model + anyOf: + - type: string + - type: 'null' + description: An item ID to list items before, used for pagination. + title: Before + description: An item ID to list items before, used for pagination. + - name: include + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + - type: 'null' + description: Additional fields to include in the response. + title: Include + description: Additional fields to include in the response. - name: limit in: query required: false schema: - type: integer + anyOf: + - type: integer + maximum: 100 + minimum: 1 + - type: 'null' + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. default: 20 title: Limit + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - name: order in: query required: false schema: - $ref: '#/components/schemas/Order' + anyOf: + - $ref: '#/components/schemas/Order' + - type: 'null' + description: The order to return the input items in. Default is desc. default: desc + title: Order + description: The order to return the input items in. Default is desc. responses: '200': - description: A ListOpenAIChatCompletionResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIChatCompletionResponse' + $ref: '#/components/schemas/ListOpenAIResponseInputItem' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/safety/run-shield: post: tags: - - V1 - summary: Create chat completions. - description: Typed endpoint for proper schema generation. - operationId: openai_chat_completion_v1_chat_completions_post + - Safety + summary: Run shield. + description: Run a shield. + operationId: run_shield_v1_safety_run_shield_post requestBody: - required: true content: application/json: schema: - $ref: '#/components/schemas/OpenAIChatCompletionRequestWithExtraBody' + $ref: '#/components/schemas/RunShieldRequest' + required: true responses: '200': - description: An OpenAIChatCompletion. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAIChatCompletion' + $ref: '#/components/schemas/RunShieldResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/chat/completions/{completion_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/scoring-functions: get: tags: - - V1 - summary: Get chat completion. - description: Query endpoint for proper schema generation. - operationId: get_chat_completion_v1_chat_completions__completion_id__get - parameters: - - name: completion_id - in: path - required: true - schema: - type: string - title: Completion Id - description: ID of the chat completion. + - Scoring Functions + summary: List all scoring functions + description: List all scoring functions + operationId: list_scoring_functions_v1_scoring_functions_get responses: '200': - description: A OpenAICompletionWithInputMessages. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAICompletionWithInputMessages' + $ref: '#/components/schemas/ListScoringFunctionsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/completions: - post: - tags: - - V1 - summary: Create completion. - description: Typed endpoint for proper schema generation. - operationId: openai_completion_v1_completions_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAICompletionRequestWithExtraBody' - required: true - responses: - '200': - description: An OpenAICompletion. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/OpenAICompletion' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/conversations: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Create a conversation. - description: Typed endpoint for proper schema generation. - operationId: create_conversation_v1_conversations_post + - Scoring Functions + summary: Register a scoring function + description: Register a scoring function + operationId: register_scoring_function_v1_scoring_functions_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_conversations_Request' + $ref: '#/components/schemas/RegisterScoringFunctionRequest' required: true responses: - '200': - description: The created conversation object. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Conversation' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/conversations/{conversation_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/scoring-functions/{scoring_fn_id}: delete: tags: - - V1 - summary: Delete a conversation. - description: Query endpoint for proper schema generation. - operationId: openai_delete_conversation_v1_conversations__conversation_id__delete + - Scoring Functions + summary: Unregister a scoring function + description: Unregister a scoring function + operationId: unregister_scoring_function_v1_scoring_functions__scoring_fn_id__delete parameters: - - name: conversation_id + - name: scoring_fn_id in: path required: true schema: type: string - title: Conversation Id - description: The conversation identifier. + description: The ID of the scoring function to unregister + title: Scoring Fn Id + description: The ID of the scoring function to unregister responses: - '200': - description: The deleted conversation resource. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ConversationDeletedResource' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 - summary: Retrieve a conversation. - description: Query endpoint for proper schema generation. - operationId: get_conversation_v1_conversations__conversation_id__get + - Scoring Functions + summary: Get a scoring function by its ID + description: Get a scoring function by its ID + operationId: get_scoring_function_v1_scoring_functions__scoring_fn_id__get parameters: - - name: conversation_id + - name: scoring_fn_id in: path required: true schema: type: string - title: Conversation Id - description: The conversation identifier. + description: The ID of the scoring function to get + title: Scoring Fn Id + description: The ID of the scoring function to get responses: '200': - description: The conversation object. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Conversation' + $ref: '#/components/schemas/ScoringFn' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/scoring/score: post: tags: - - V1 - summary: Update a conversation. - description: Typed endpoint for proper schema generation. - operationId: update_conversation_v1_conversations__conversation_id__post + - Scoring + summary: Score a list of rows + description: Score a list of rows + operationId: score_v1_scoring_score_post requestBody: - required: true content: application/json: schema: - $ref: '#/components/schemas/_conversations_conversation_id_Request' + $ref: '#/components/schemas/ScoreRequest' + required: true responses: '200': - description: The updated conversation object. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Conversation' + $ref: '#/components/schemas/ScoreResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - parameters: - - name: conversation_id - in: path - required: true - schema: - type: string - description: The conversation identifier. - /v1/conversations/{conversation_id}/items: - get: - tags: - - V1 - summary: List items. - description: Query endpoint for proper schema generation. - operationId: list_items_v1_conversations__conversation_id__items_get - parameters: - - name: after - in: query - required: true - schema: - type: string - title: After - - name: include - in: query - required: true - schema: - $ref: '#/components/schemas/ConversationItemInclude' - - name: limit - in: query - required: true - schema: - type: integer - title: Limit - - name: order - in: query - required: true - schema: - type: string - title: Order - - name: conversation_id - in: path - required: true - schema: - type: string - title: Conversation Id - description: The conversation identifier. - responses: - '200': - description: List of conversation items. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ConversationItemList' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/scoring/score-batch: post: tags: - - V1 - summary: Create items. - description: Typed endpoint for proper schema generation. - operationId: add_items_v1_conversations__conversation_id__items_post + - Scoring + summary: Score a batch of rows + description: Score a batch of rows from a dataset + operationId: score_batch_v1_scoring_score_batch_post requestBody: - required: true content: application/json: schema: - $ref: '#/components/schemas/_conversations_conversation_id_items_Request' + $ref: '#/components/schemas/ScoreBatchRequest' + required: true responses: '200': - description: List of created items. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ConversationItemList' + $ref: '#/components/schemas/ScoreBatchResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - parameters: - - name: conversation_id - in: path - required: true - schema: - type: string - description: The conversation identifier. - /v1/conversations/{conversation_id}/items/{item_id}: - delete: - tags: - - V1 - summary: Delete an item. - description: Query endpoint for proper schema generation. - operationId: openai_delete_conversation_item_v1_conversations__conversation_id__items__item_id__delete - parameters: - - name: conversation_id - in: path - required: true - schema: - type: string - title: Conversation Id - description: The conversation identifier. - - name: item_id - in: path - required: true - schema: - type: string - title: Item Id - description: The item identifier. - responses: - '200': - description: The deleted item resource. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ConversationItemDeletedResource' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/shields: get: tags: - - V1 - summary: Retrieve an item. - description: Query endpoint for proper schema generation. - operationId: retrieve_v1_conversations__conversation_id__items__item_id__get - parameters: - - name: conversation_id - in: path - required: true - schema: - type: string - title: Conversation Id - description: The conversation identifier. - - name: item_id - in: path - required: true - schema: - type: string - title: Item Id - description: The item identifier. + - Shields + summary: List all shields + description: List all shields + operationId: list_shields_v1_shields_get responses: '200': - description: The conversation item. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAIResponseMessage' + $ref: '#/components/schemas/ListShieldsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/embeddings: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Create embeddings. - description: Typed endpoint for proper schema generation. - operationId: openai_embeddings_v1_embeddings_post + - Shields + summary: Register a shield + description: Register a shield + operationId: register_shield_v1_shields_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody' + $ref: '#/components/schemas/RegisterShieldRequest' required: true responses: '200': - description: An OpenAIEmbeddingsResponse containing the embeddings. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAIEmbeddingsResponse' + $ref: '#/components/schemas/Shield' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/files: - get: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/shields/{identifier}: + delete: tags: - - V1 - summary: List files. - description: Query endpoint for proper schema generation. - operationId: openai_list_files_v1_files_get + - Shields + summary: Unregister a shield + description: Unregister a shield + operationId: unregister_shield_v1_shields__identifier__delete parameters: - - name: after - in: query + - name: identifier + in: path required: true schema: type: string - title: After - - name: purpose - in: query - required: true - schema: - $ref: '#/components/schemas/OpenAIFilePurpose' - - name: limit - in: query - required: false - schema: - type: integer - default: 10000 - title: Limit - - name: order - in: query - required: false - schema: - $ref: '#/components/schemas/Order' - default: desc + description: The identifier of the shield to unregister + title: Identifier + description: The identifier of the shield to unregister responses: - '200': - description: An ListOpenAIFileResponse containing the list of files. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIFileResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - post: - tags: - - V1 - summary: Upload file. - description: Response-only endpoint for proper schema generation. - operationId: openai_upload_file_v1_files_post - responses: - '200': - description: An OpenAIFileObject representing the uploaded file. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/files/{file_id}: - delete: - tags: - - V1 - summary: Delete file. - description: Query endpoint for proper schema generation. - operationId: openai_delete_file_v1_files__file_id__delete - parameters: - - name: file_id - in: path - required: true - schema: - type: string - title: File Id - description: The ID of the file to use for this request. - responses: - '200': - description: An OpenAIFileDeleteResponse indicating successful deletion. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileDeleteResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - get: - tags: - - V1 - summary: Retrieve file. - description: Query endpoint for proper schema generation. - operationId: openai_retrieve_file_v1_files__file_id__get - parameters: - - name: file_id - in: path - required: true - schema: - type: string - title: File Id - description: The ID of the file to use for this request. - responses: - '200': - description: An OpenAIFileObject containing file information. + description: An unexpected error occurred. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/files/{file_id}/content: + $ref: '#/components/schemas/Error' get: tags: - - V1 - summary: Retrieve file content. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: openai_retrieve_file_content_v1_files__file_id__content_get + - Shields + summary: Get a shield by its identifier + description: Get a shield by its identifier + operationId: get_shield_v1_shields__identifier__get parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - - name: file_id + - name: identifier in: path required: true schema: type: string - description: The ID of the file to use for this request. + description: The identifier of the shield to get + title: Identifier + description: The identifier of the shield to get responses: '200': - description: The raw file content as a binary response. + description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/Shield' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/health: - get: - tags: - - V1 - summary: Get health status. - description: Response-only endpoint for proper schema generation. - operationId: health_v1_health_get - responses: - '200': - description: Health information indicating if the service is operational. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/HealthInfo' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/inspect/routes: - get: - tags: - - V1 - summary: List routes. - description: Response-only endpoint for proper schema generation. - operationId: list_routes_v1_inspect_routes_get - responses: - '200': - description: Response containing information about all available routes. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/ListRoutesResponse' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/models: - get: - tags: - - V1 - summary: List all models. - description: Response-only endpoint for proper schema generation. - operationId: list_models_v1_models_get - responses: - '200': - description: A ListModelsResponse. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/ListModelsResponse' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/tool-runtime/invoke: post: tags: - - V1 - summary: Register model. - description: Typed endpoint for proper schema generation. - operationId: register_model_v1_models_post + - Tool Runtime + summary: Run a tool with the given arguments + description: Run a tool with the given arguments + operationId: invoke_tool_v1_tool_runtime_invoke_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_models_Request' + $ref: '#/components/schemas/InvokeToolRequest' required: true responses: '200': - description: A Model. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Model' + $ref: '#/components/schemas/ToolInvocationResult' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/models/{model_id}: - delete: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/tool-runtime/list-tools: + get: tags: - - V1 - summary: Unregister model. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: unregister_model_v1_models__model_id__delete + - Tool Runtime + summary: List all tools in the runtime + description: List all tools in the runtime + operationId: list_runtime_tools_v1_tool_runtime_list_tools_get parameters: - - name: args + - name: tool_group_id in: query - required: true + required: false schema: - title: Args - - name: kwargs + anyOf: + - type: string + - type: 'null' + description: The ID of the tool group to list tools for + title: Tool Group Id + description: The ID of the tool group to list tools for + - name: mcp_endpoint in: query - required: true - schema: - title: Kwargs - - name: model_id - in: path - required: true + required: false schema: - type: string - description: 'Path parameter: model_id' + anyOf: + - type: string + - type: 'null' + description: The MCP endpoint URL to use for the tool group + title: Mcp Endpoint + description: The MCP endpoint URL to use for the tool group responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/ListToolDefsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - get: - tags: - - V1 - summary: Get model. - description: Query endpoint for proper schema generation. - operationId: get_model_v1_models__model_id__get - parameters: - - name: model_id - in: path - required: true - schema: - type: string - title: Model Id - responses: - '200': - description: A Model. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Model' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/moderations: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/tool-runtime/rag-tool/insert: post: tags: - - V1 - summary: Create moderation. - description: Typed endpoint for proper schema generation. - operationId: run_moderation_v1_moderations_post + - Tool Runtime + summary: Insert documents into the RAG system. + description: Index documents so they can be used by the RAG system. + operationId: rag_tool_insert_v1_tool_runtime_rag_tool_insert_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_moderations_Request' + $ref: '#/components/schemas/Body_rag_tool_insert_v1_tool_runtime_rag_tool_insert_post' required: true responses: - '200': - description: A moderation object. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ModerationObject' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/prompts: - get: - tags: - - V1 - summary: List all prompts. - description: Response-only endpoint for proper schema generation. - operationId: list_prompts_v1_prompts_get - responses: - '200': - description: A ListPromptsResponse containing all prompts. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/ListPromptsResponse' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/tool-runtime/rag-tool/query: post: tags: - - V1 - summary: Create prompt. - description: Typed endpoint for proper schema generation. - operationId: create_prompt_v1_prompts_post + - Tool Runtime + summary: Query the RAG system for context. + description: Query the RAG system for context; typically invoked by the agent. + operationId: rag_tool_query_v1_tool_runtime_rag_tool_query_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_prompts_Request' + $ref: '#/components/schemas/Body_rag_tool_query_v1_tool_runtime_rag_tool_query_post' required: true responses: '200': - description: The created Prompt resource. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Prompt' + $ref: '#/components/schemas/RAGQueryResult' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/prompts/{prompt_id}: - delete: - tags: - - V1 - summary: Delete prompt. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: delete_prompt_v1_prompts__prompt_id__delete - parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - - name: prompt_id - in: path - required: true - schema: - type: string - description: The identifier of the prompt to delete. - responses: - '200': - description: Successful Response + description: The server encountered an unexpected error. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/toolgroups: get: tags: - - V1 - summary: Get prompt. - description: Query endpoint for proper schema generation. - operationId: get_prompt_v1_prompts__prompt_id__get - parameters: - - name: version - in: query - required: true - schema: - type: integer - title: Version - - name: prompt_id - in: path - required: true - schema: - type: string - title: Prompt Id - description: The identifier of the prompt to get. + - Tool Groups + summary: List tool groups + description: List tool groups with optional provider + operationId: list_tool_groups_v1_toolgroups_get responses: '200': - description: A Prompt resource. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Prompt' + $ref: '#/components/schemas/ListToolGroupsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Update prompt. - description: Typed endpoint for proper schema generation. - operationId: update_prompt_v1_prompts__prompt_id__post + - Tool Groups + summary: Register a tool group + description: Register a tool group + operationId: register_tool_group_v1_toolgroups_post requestBody: - required: true content: application/json: schema: - $ref: '#/components/schemas/_prompts_prompt_id_Request' + $ref: '#/components/schemas/RegisterToolGroupRequest' + required: true responses: - '200': - description: The updated Prompt resource with incremented version. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Prompt' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/toolgroups/{toolgroup_id}: + delete: + tags: + - Tool Groups + summary: Unregister a tool group + description: Unregister a tool group + operationId: unregister_toolgroup_v1_toolgroups__toolgroup_id__delete parameters: - - name: prompt_id + - name: toolgroup_id in: path required: true schema: type: string - description: The identifier of the prompt to update. - /v1/prompts/{prompt_id}/set-default-version: - post: - tags: - - V1 - summary: Set prompt version. - description: Typed endpoint for proper schema generation. - operationId: set_default_version_v1_prompts__prompt_id__set_default_version_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_prompts_prompt_id_set_default_version_Request' - required: true + description: The ID of the tool group to unregister + title: Toolgroup Id + description: The ID of the tool group to unregister responses: - '200': - description: The prompt with the specified version now set as default. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Prompt' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: prompt_id - in: path - required: true - schema: - type: string - description: The identifier of the prompt. - /v1/prompts/{prompt_id}/versions: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 - summary: List prompt versions. - description: Query endpoint for proper schema generation. - operationId: list_prompt_versions_v1_prompts__prompt_id__versions_get + - Tool Groups + summary: Get a tool group by its ID + description: Get a tool group by its ID + operationId: get_tool_group_v1_toolgroups__toolgroup_id__get parameters: - - name: prompt_id + - name: toolgroup_id in: path required: true schema: type: string - title: Prompt Id - description: The identifier of the prompt to list versions for. + description: The ID of the tool group to get + title: Toolgroup Id + description: The ID of the tool group to get responses: '200': - description: A ListPromptsResponse containing all versions of the prompt. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListPromptsResponse' + $ref: '#/components/schemas/ToolGroup' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/providers: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/tools: get: tags: - - V1 - summary: List providers. - description: Response-only endpoint for proper schema generation. - operationId: list_providers_v1_providers_get + - Tool Groups + summary: List tools + description: List tools with optional tool group + operationId: list_tools_v1_tools_get + parameters: + - name: toolgroup_id + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: The ID of the tool group to list tools for + title: Toolgroup Id + description: The ID of the tool group to list tools for responses: '200': - description: A ListProvidersResponse containing information about all providers. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListProvidersResponse' + $ref: '#/components/schemas/ListToolDefsResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/providers/{provider_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/tools/{tool_name}: get: tags: - - V1 - summary: Get provider. - description: Query endpoint for proper schema generation. - operationId: inspect_provider_v1_providers__provider_id__get + - Tool Groups + summary: Get a tool by its name + description: Get a tool by its name + operationId: get_tool_v1_tools__tool_name__get parameters: - - name: provider_id + - name: tool_name in: path required: true schema: type: string - title: Provider Id - description: The ID of the provider to inspect. + description: The name of the tool to get + title: Tool Name + description: The name of the tool to get responses: '200': - description: A ProviderInfo object containing the provider's details. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ProviderInfo' + $ref: '#/components/schemas/ToolDef' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/responses: - get: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector-io/insert: + post: tags: - - V1 - summary: List all responses. - description: Query endpoint for proper schema generation. - operationId: list_openai_responses_v1_responses_get - parameters: - - name: after - in: query - required: true - schema: - type: string - title: After - - name: model - in: query + - Vector IO + summary: Insert chunks into a vector database. + description: Insert chunks into a vector database. + operationId: insert_chunks_v1_vector_io_insert_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InsertChunksRequest' required: true - schema: - type: string - title: Model - - name: limit - in: query - required: false - schema: - type: integer - default: 50 - title: Limit - - name: order - in: query - required: false - schema: - $ref: '#/components/schemas/Order' - default: desc responses: - '200': - description: A ListOpenAIResponseObject. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIResponseObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector-io/query: post: tags: - - V1 - summary: Create a model response. - description: Typed endpoint for proper schema generation. - operationId: create_openai_response_v1_responses_post + - Vector IO + summary: Query chunks from a vector database. + description: Query chunks from a vector database. + operationId: query_chunks_v1_vector_io_query_post requestBody: - required: true content: application/json: schema: - $ref: '#/components/schemas/_responses_Request' + $ref: '#/components/schemas/QueryChunksRequest' + required: true responses: '200': - description: An OpenAIResponseObject. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAIResponseObject' + $ref: '#/components/schemas/QueryChunksResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/responses/{response_id}: - delete: - tags: - - V1 - summary: Delete a response. - description: Query endpoint for proper schema generation. - operationId: delete_openai_response_v1_responses__response_id__delete - parameters: - - name: response_id - in: path - required: true - schema: - type: string - title: Response Id - description: The ID of the OpenAI response to delete. - responses: - '200': - description: An OpenAIDeleteResponseObject + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/OpenAIDeleteResponseObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - get: - tags: - - V1 - summary: Get a model response. - description: Query endpoint for proper schema generation. - operationId: get_openai_response_v1_responses__response_id__get - parameters: - - name: response_id - in: path - required: true - schema: - type: string - title: Response Id - description: The ID of the OpenAI response to retrieve. - responses: - '200': - description: An OpenAIResponseObject. + description: An unexpected error occurred. content: application/json: schema: - $ref: '#/components/schemas/OpenAIResponseObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/responses/{response_id}/input_items: + $ref: '#/components/schemas/Error' + /v1/vector_stores: get: tags: - - V1 - summary: List input items. - description: Query endpoint for proper schema generation. - operationId: list_openai_response_input_items_v1_responses__response_id__input_items_get + - Vector IO + summary: Returns a list of vector stores. + description: Returns a list of vector stores. + operationId: openai_list_vector_stores_v1_vector_stores_get parameters: - - name: after - in: query - required: true - schema: - type: string - title: After - - name: before - in: query - required: true - schema: - type: string - title: Before - - name: include - in: query - required: true - schema: - type: string - title: Include - name: limit in: query required: false schema: - type: integer + anyOf: + - type: integer + maximum: 100 + minimum: 1 + - type: 'null' + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. default: 20 title: Limit + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - name: order in: query required: false schema: - $ref: '#/components/schemas/Order' + anyOf: + - type: string + - type: 'null' + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. default: desc - - name: response_id - in: path - required: true + title: Order + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + - name: after + in: query + required: false schema: - type: string - title: Response Id - description: The ID of the response to retrieve input items for. + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + title: After + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + - name: before + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. + title: Before + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. responses: '200': - description: An ListOpenAIResponseInputItem. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIResponseInputItem' + $ref: '#/components/schemas/VectorStoreListResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/safety/run-shield: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Run shield. - description: Typed endpoint for proper schema generation. - operationId: run_shield_v1_safety_run_shield_post + - Vector IO + summary: Creates a vector store. + description: Creates a vector store. + operationId: openai_create_vector_store_v1_vector_stores_post requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/_safety_run_shield_Request' - required: true + $ref: '#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody' responses: '200': - description: A RunShieldResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/RunShieldResponse' + $ref: '#/components/schemas/VectorStoreObject' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/scoring-functions: - get: - tags: - - V1 - summary: List all scoring functions. - description: Response-only endpoint for proper schema generation. - operationId: list_scoring_functions_v1_scoring_functions_get - responses: - '200': - description: A ListScoringFunctionsResponse. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ListScoringFunctionsResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - post: - tags: - - V1 - summary: Register a scoring function. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: register_scoring_function_v1_scoring_functions_post - parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - responses: - '200': - description: Successful Response + description: The client has sent too many requests in a given amount of time. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/scoring-functions/{scoring_fn_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}: delete: tags: - - V1 - summary: Unregister a scoring function. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: unregister_scoring_function_v1_scoring_functions__scoring_fn_id__delete + - Vector IO + summary: Delete a vector store. + description: Delete a vector store. + operationId: openai_delete_vector_store_v1_vector_stores__vector_store_id__delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - - name: scoring_fn_id + - name: vector_store_id in: path required: true schema: type: string - description: 'Path parameter: scoring_fn_id' + description: The ID of the vector store to delete. + title: Vector Store Id + description: The ID of the vector store to delete. responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/VectorStoreDeleteResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 - summary: Get a scoring function by its ID. - description: Query endpoint for proper schema generation. - operationId: get_scoring_function_v1_scoring_functions__scoring_fn_id__get + - Vector IO + summary: Retrieves a vector store. + description: Retrieves a vector store. + operationId: openai_retrieve_vector_store_v1_vector_stores__vector_store_id__get parameters: - - name: scoring_fn_id + - name: vector_store_id in: path required: true schema: type: string - title: Scoring Fn Id + description: The ID of the vector store to retrieve. + title: Vector Store Id + description: The ID of the vector store to retrieve. responses: '200': - description: A ScoringFn. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ScoringFn' + $ref: '#/components/schemas/VectorStoreObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/scoring/score: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Score a list of rows. - description: Typed endpoint for proper schema generation. - operationId: score_v1_scoring_score_post + - Vector IO + summary: Updates a vector store. + description: Updates a vector store. + operationId: openai_update_vector_store_v1_vector_stores__vector_store_id__post + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: The ID of the vector store to update. + title: Vector Store Id + description: The ID of the vector store to update. requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/_scoring_score_Request' - required: true + $ref: '#/components/schemas/VectorStoreModifyRequest' responses: '200': - description: A ScoreResponse object containing rows and aggregated results. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ScoreResponse' + $ref: '#/components/schemas/VectorStoreObject' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/scoring/score-batch: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/file_batches: post: tags: - - V1 - summary: Score a batch of rows. - description: Typed endpoint for proper schema generation. - operationId: score_batch_v1_scoring_score_batch_post + - Vector IO + summary: Create a vector store file batch. + description: Create a vector store file batch. + operationId: openai_create_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches_post + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: The ID of the vector store to create the file batch for. + title: Vector Store Id + description: The ID of the vector store to create the file batch for. requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/_scoring_score_batch_Request' - required: true + $ref: '#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody' responses: '200': - description: A ScoreBatchResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ScoreBatchResponse' + $ref: '#/components/schemas/VectorStoreFileBatchObject' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/shields: - get: - tags: - - V1 - summary: List all shields. - description: Response-only endpoint for proper schema generation. - operationId: list_shields_v1_shields_get - responses: - '200': - description: A ListShieldsResponse. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ListShieldsResponse' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: + get: tags: - - V1 - summary: Register a shield. - description: Typed endpoint for proper schema generation. - operationId: register_shield_v1_shields_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_shields_Request' + - Vector IO + summary: Retrieve a vector store file batch. + description: Retrieve a vector store file batch. + operationId: openai_retrieve_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__get + parameters: + - name: vector_store_id + in: path required: true + schema: + type: string + description: The ID of the vector store containing the file batch. + title: Vector Store Id + description: The ID of the vector store containing the file batch. + - name: batch_id + in: path + required: true + schema: + type: string + description: The ID of the file batch to retrieve. + title: Batch Id + description: The ID of the file batch to retrieve. responses: '200': - description: A Shield. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Shield' + $ref: '#/components/schemas/VectorStoreFileBatchObject' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/shields/{identifier}: - delete: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: + post: tags: - - V1 - summary: Unregister a shield. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: unregister_shield_v1_shields__identifier__delete + - Vector IO + summary: Cancels a vector store file batch. + description: Cancels a vector store file batch. + operationId: openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query + - name: vector_store_id + in: path required: true schema: - title: Kwargs - - name: identifier + type: string + description: The ID of the vector store containing the file batch. + title: Vector Store Id + description: The ID of the vector store containing the file batch. + - name: batch_id in: path required: true schema: type: string - description: 'Path parameter: identifier' + description: The ID of the file batch to cancel. + title: Batch Id + description: The ID of the file batch to cancel. responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/VectorStoreFileBatchObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: get: tags: - - V1 - summary: Get a shield by its identifier. - description: Query endpoint for proper schema generation. - operationId: get_shield_v1_shields__identifier__get + - Vector IO + summary: Returns a list of vector store files in a batch. + description: Returns a list of vector store files in a batch. + operationId: openai_list_files_in_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get parameters: - - name: identifier + - name: vector_store_id in: path required: true schema: type: string - title: Identifier + description: The ID of the vector store containing the file batch. + title: Vector Store Id + description: The ID of the vector store containing the file batch. + - name: batch_id + in: path + required: true + schema: + type: string + description: The ID of the file batch to list files from. + title: Batch Id + description: The ID of the file batch to list files from. + - name: after + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + title: After + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + - name: before + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. + title: Before + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. + - name: filter + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Filter by file status. One of in_progress, completed, failed, cancelled. + title: Filter + description: Filter by file status. One of in_progress, completed, failed, cancelled. + - name: limit + in: query + required: false + schema: + anyOf: + - type: integer + maximum: 100 + minimum: 1 + - type: 'null' + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + default: 20 + title: Limit + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + - name: order + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + default: desc + title: Order + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. responses: '200': - description: A Shield. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Shield' + $ref: '#/components/schemas/VectorStoreFilesListInBatchResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/tool-runtime/invoke: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/files: + get: tags: - - V1 - summary: Run a tool with the given arguments. - description: Typed endpoint for proper schema generation. - operationId: invoke_tool_v1_tool_runtime_invoke_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_tool_runtime_invoke_Request' + - Vector IO + summary: List files in a vector store. + description: List files in a vector store. + operationId: openai_list_files_in_vector_store_v1_vector_stores__vector_store_id__files_get + parameters: + - name: vector_store_id + in: path required: true + schema: + type: string + description: The ID of the vector store to list files from. + title: Vector Store Id + description: The ID of the vector store to list files from. + - name: limit + in: query + required: false + schema: + anyOf: + - type: integer + maximum: 100 + minimum: 1 + - type: 'null' + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + default: 20 + title: Limit + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + - name: order + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + default: desc + title: Order + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + - name: after + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + title: After + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + - name: before + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. + title: Before + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. + - name: filter + in: query + required: false + schema: + anyOf: + - const: completed + type: string + - const: in_progress + type: string + - const: cancelled + type: string + - const: failed + type: string + - type: 'null' + description: Filter by file status to only return files with the specified status. + title: Filter + description: Filter by file status to only return files with the specified status. responses: '200': - description: A ToolInvocationResult. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ToolInvocationResult' + $ref: '#/components/schemas/VectorStoreListFilesResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/tool-runtime/list-tools: - get: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - V1 - summary: List all tools in the runtime. - description: Query endpoint for proper schema generation. - operationId: list_runtime_tools_v1_tool_runtime_list_tools_get + - Vector IO + summary: Attach a file to a vector store. + description: Attach a file to a vector store. + operationId: openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post parameters: - - name: tool_group_id - in: query + - name: vector_store_id + in: path required: true schema: type: string - title: Tool Group Id + description: The ID of the vector store to attach the file to. + title: Vector Store Id + description: The ID of the vector store to attach the file to. requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/URL' + $ref: '#/components/schemas/Body_openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post' responses: '200': - description: A ListToolDefsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListToolDefsResponse' + $ref: '#/components/schemas/VectorStoreFileObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/tool-runtime/rag-tool/insert: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/files/{file_id}: + delete: tags: - - V1 - summary: Index documents so they can be used by the RAG system. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: rag_tool_insert_v1_tool_runtime_rag_tool_insert_post + - Vector IO + summary: Delete a vector store file. + description: Delete a vector store file. + operationId: openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete parameters: - - name: args - in: query + - name: vector_store_id + in: path required: true schema: - title: Args - - name: kwargs - in: query + type: string + description: The ID of the vector store containing the file to delete. + title: Vector Store Id + description: The ID of the vector store containing the file to delete. + - name: file_id + in: path required: true schema: - title: Kwargs + type: string + description: The ID of the file to delete. + title: File Id + description: The ID of the file to delete. responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/VectorStoreFileDeleteResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/tool-runtime/rag-tool/query: - post: - tags: - - V1 - summary: Query the RAG system for context; typically invoked by the agent. - description: Typed endpoint for proper schema generation. - operationId: rag_tool_query_v1_tool_runtime_rag_tool_query_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_tool_runtime_rag_tool_query_Request' - required: true - responses: - '200': - description: RAGQueryResult containing the retrieved content and metadata + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/RAGQueryResult' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/toolgroups: - get: - tags: - - V1 - summary: List tool groups with optional provider. - description: Response-only endpoint for proper schema generation. - operationId: list_tool_groups_v1_toolgroups_get - responses: - '200': - description: A ListToolGroupsResponse. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/ListToolGroupsResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: tags: - - V1 - summary: Register a tool group. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: register_tool_group_v1_toolgroups_post + - Vector IO + summary: Retrieves a vector store file. + description: Retrieves a vector store file. + operationId: openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get parameters: - - name: args - in: query + - name: vector_store_id + in: path required: true schema: - title: Args - - name: kwargs - in: query + type: string + description: The ID of the vector store containing the file to retrieve. + title: Vector Store Id + description: The ID of the vector store containing the file to retrieve. + - name: file_id + in: path required: true schema: - title: Kwargs + type: string + description: The ID of the file to retrieve. + title: File Id + description: The ID of the file to retrieve. responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/VectorStoreFileObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/toolgroups/{toolgroup_id}: - delete: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - V1 - summary: Unregister a tool group. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: unregister_toolgroup_v1_toolgroups__toolgroup_id__delete + - Vector IO + summary: Updates a vector store file. + description: Updates a vector store file. + operationId: openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query + - name: vector_store_id + in: path required: true schema: - title: Kwargs - - name: toolgroup_id + type: string + description: The ID of the vector store containing the file to update. + title: Vector Store Id + description: The ID of the vector store containing the file to update. + - name: file_id in: path required: true schema: type: string - description: 'Path parameter: toolgroup_id' + description: The ID of the file to update. + title: File Id + description: The ID of the file to update. + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: true + description: The updated key-value attributes to store with the file. + title: Attributes responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/VectorStoreFileObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/files/{file_id}/content: get: tags: - - V1 - summary: Get a tool group by its ID. - description: Query endpoint for proper schema generation. - operationId: get_tool_group_v1_toolgroups__toolgroup_id__get + - Vector IO + summary: Retrieves the contents of a vector store file. + description: Retrieves the contents of a vector store file. + operationId: openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get parameters: - - name: toolgroup_id + - name: vector_store_id in: path required: true schema: type: string - title: Toolgroup Id - responses: - '200': - description: A ToolGroup. - content: - application/json: - schema: - $ref: '#/components/schemas/ToolGroup' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/tools: - get: - tags: - - V1 - summary: List tools with optional tool group. - description: Query endpoint for proper schema generation. - operationId: list_tools_v1_tools_get - parameters: - - name: toolgroup_id - in: query + description: The ID of the vector store containing the file to retrieve. + title: Vector Store Id + description: The ID of the vector store containing the file to retrieve. + - name: file_id + in: path required: true schema: type: string - title: Toolgroup Id + description: The ID of the file to retrieve. + title: File Id + description: The ID of the file to retrieve. responses: '200': - description: A ListToolDefsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListToolDefsResponse' + $ref: '#/components/schemas/VectorStoreFileContentsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/tools/{tool_name}: - get: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/search: + post: tags: - - V1 - summary: Get a tool by its name. - description: Query endpoint for proper schema generation. - operationId: get_tool_v1_tools__tool_name__get + - Vector IO + summary: Search for chunks in a vector store. + description: Search for chunks in a vector store. + operationId: openai_search_vector_store_v1_vector_stores__vector_store_id__search_post parameters: - - name: tool_name + - name: vector_store_id in: path required: true schema: type: string - title: Tool Name + description: The ID of the vector store to search. + title: Vector Store Id + description: The ID of the vector store to search. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Body_openai_search_vector_store_v1_vector_stores__vector_store_id__search_post' responses: '200': - description: A ToolDef. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ToolDef' + $ref: '#/components/schemas/VectorStoreSearchResponsePage' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/vector-io/insert: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/version: + get: tags: - - V1 - summary: Insert chunks into a vector database. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: insert_chunks_v1_vector_io_insert_post - parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs + - Inspect + summary: Get version. + description: Get the version of the service. + operationId: version_v1_version_get responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/VersionInfo' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/vector-io/query: - post: - tags: - - V1 - summary: Query chunks from a vector database. - description: Typed endpoint for proper schema generation. - operationId: query_chunks_v1_vector_io_query_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_vector_io_query_Request' - required: true - responses: - '200': - description: A QueryChunksResponse. - content: - application/json: - schema: - $ref: '#/components/schemas/QueryChunksResponse' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/vector_stores: - get: - tags: - - V1 - summary: Returns a list of vector stores. - description: Query endpoint for proper schema generation. - operationId: openai_list_vector_stores_v1_vector_stores_get - parameters: - - name: after - in: query - required: true - schema: - type: string - title: After - - name: before - in: query - required: true - schema: - type: string - title: Before - - name: limit - in: query - required: false - schema: - type: integer - default: 20 - title: Limit - - name: order - in: query - required: false - schema: - type: string - default: desc - title: Order - responses: - '200': - description: A VectorStoreListResponse containing the list of vector stores. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreListResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - post: - tags: - - V1 - summary: Creates a vector store. - description: Typed endpoint for proper schema generation. - operationId: openai_create_vector_store_v1_vector_stores_post - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody' - responses: - '200': - description: A VectorStoreObject representing the created vector store. + description: An unexpected error occurred. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/vector_stores/{vector_store_id}: - delete: - tags: - - V1 - summary: Delete a vector store. - description: Query endpoint for proper schema generation. - operationId: openai_delete_vector_store_v1_vector_stores__vector_store_id__delete - parameters: - - name: vector_store_id - in: path - required: true - schema: + $ref: '#/components/schemas/Error' +components: + schemas: + Agent: + properties: + agent_id: type: string - title: Vector Store Id - description: The ID of the vector store to delete. - responses: - '200': - description: A VectorStoreDeleteResponse indicating the deletion status. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreDeleteResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - get: - tags: - - V1 - summary: Retrieves a vector store. - description: Query endpoint for proper schema generation. - operationId: openai_retrieve_vector_store_v1_vector_stores__vector_store_id__get - parameters: - - name: vector_store_id - in: path - required: true - schema: + title: Agent Id + description: Unique identifier for the agent + agent_config: + $ref: '#/components/schemas/AgentConfig-Output' + description: Configuration settings for the agent + created_at: type: string - title: Vector Store Id - description: The ID of the vector store to retrieve. - responses: - '200': - description: A VectorStoreObject representing the vector store. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - post: - tags: - - V1 - summary: Updates a vector store. - description: Typed endpoint for proper schema generation. - operationId: openai_update_vector_store_v1_vector_stores__vector_store_id__post - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/_vector_stores_vector_store_id_Request' - responses: - '200': - description: A VectorStoreObject representing the updated vector store. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - parameters: - - name: vector_store_id - in: path - required: true - schema: + format: date-time + title: Created At + description: Timestamp when the agent was created + type: object + required: + - agent_id + - agent_config + - created_at + title: Agent + description: An agent instance with configuration and metadata. + AgentCandidate: + properties: + type: type: string - description: The ID of the vector store to update. - /v1/vector_stores/{vector_store_id}/file_batches: - post: - tags: - - V1 - summary: Create a vector store file batch. - description: Typed endpoint for proper schema generation. - operationId: openai_create_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody' - required: true - responses: - '200': - description: A VectorStoreFileBatchObject representing the created file batch. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileBatchObject' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: vector_store_id - in: path - required: true - schema: + const: agent + title: Type + description: The type of candidate. + default: agent + config: + $ref: '#/components/schemas/AgentConfig-Input' + description: The configuration for the agent candidate. + type: object + required: + - config + title: AgentCandidate + description: An agent candidate for evaluation. + AgentConfig-Input: + properties: + sampling_params: + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' + input_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Input Shields + output_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields + toolgroups: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups + client_tools: + anyOf: + - items: + $ref: '#/components/schemas/ToolDef' + type: array + - type: 'null' + title: Client Tools + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: 'null' + deprecated: true + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + deprecated: true + tool_config: + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' + max_infer_iters: + anyOf: + - type: integer + - type: 'null' + title: Max Infer Iters + default: 10 + model: type: string - description: The ID of the vector store to create the file batch for. - /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: - get: - tags: - - V1 - summary: Retrieve a vector store file batch. - description: Query endpoint for proper schema generation. - operationId: openai_retrieve_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__get - parameters: - - name: batch_id - in: path - required: true - schema: + title: Model + description: The model identifier to use for the agent + instructions: type: string - title: Batch Id - description: The ID of the file batch to retrieve. - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - description: The ID of the vector store containing the file batch. - responses: - '200': - description: A VectorStoreFileBatchObject representing the file batch. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileBatchObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: - post: - tags: - - V1 - summary: Cancels a vector store file batch. - description: Typed endpoint for proper schema generation. - operationId: openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request' - required: true - responses: - '200': - description: A VectorStoreFileBatchObject representing the cancelled file batch. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileBatchObject' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: batch_id - in: path - required: true - schema: - type: string - description: The ID of the file batch to cancel. - - name: vector_store_id - in: path - required: true - schema: - type: string - description: The ID of the vector store containing the file batch. - /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: - get: - tags: - - V1 - summary: Returns a list of vector store files in a batch. - description: Query endpoint for proper schema generation. - operationId: openai_list_files_in_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get - parameters: - - name: after - in: query - required: true - schema: - type: string - title: After - - name: before - in: query - required: true - schema: - type: string - title: Before - - name: filter - in: query - required: true - schema: - type: string - title: Filter - - name: limit - in: query - required: false - schema: - type: integer - default: 20 - title: Limit - - name: order - in: query - required: false - schema: - type: string - default: desc - title: Order - - name: batch_id - in: path - required: true - schema: - type: string - title: Batch Id - description: The ID of the file batch to list files from. - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - description: The ID of the vector store containing the file batch. - responses: - '200': - description: A VectorStoreFilesListInBatchResponse containing the list of files in the batch. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFilesListInBatchResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/vector_stores/{vector_store_id}/files: - get: - tags: - - V1 - summary: List files in a vector store. - description: Query endpoint for proper schema generation. - operationId: openai_list_files_in_vector_store_v1_vector_stores__vector_store_id__files_get - parameters: - - name: after - in: query - required: true - schema: - type: string - title: After - - name: before - in: query - required: true - schema: - type: string - title: Before - - name: filter - in: query - required: true - schema: - type: string - title: Filter - - name: limit - in: query - required: false - schema: - type: integer - default: 20 - title: Limit - - name: order - in: query - required: false - schema: - type: string - default: desc - title: Order - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - description: The ID of the vector store to list files from. - responses: - '200': - description: A VectorStoreListFilesResponse containing the list of files. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreListFilesResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - post: - tags: - - V1 - summary: Attach a file to a vector store. - description: Typed endpoint for proper schema generation. - operationId: openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/_vector_stores_vector_store_id_files_Request' - responses: - '200': - description: A VectorStoreFileObject representing the attached file. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - description: The ID of the vector store to attach the file to. - /v1/vector_stores/{vector_store_id}/files/{file_id}: - delete: - tags: - - V1 - summary: Delete a vector store file. - description: Query endpoint for proper schema generation. - operationId: openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - description: The ID of the vector store containing the file to delete. - - name: file_id - in: path - required: true - schema: - type: string - title: File Id - description: The ID of the file to delete. - responses: - '200': - description: A VectorStoreFileDeleteResponse indicating the deletion status. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileDeleteResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - get: - tags: - - V1 - summary: Retrieves a vector store file. - description: Query endpoint for proper schema generation. - operationId: openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - description: The ID of the vector store containing the file to retrieve. - - name: file_id - in: path - required: true - schema: - type: string - title: File Id - description: The ID of the file to retrieve. - responses: - '200': - description: A VectorStoreFileObject representing the file. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - post: - tags: - - V1 - summary: Updates a vector store file. - description: Typed endpoint for proper schema generation. - operationId: openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/_vector_stores_vector_store_id_files_file_id_Request' - responses: - '200': - description: A VectorStoreFileObject representing the updated file. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - description: The ID of the vector store containing the file to update. - - name: file_id - in: path - required: true - schema: - type: string - description: The ID of the file to update. - /v1/vector_stores/{vector_store_id}/files/{file_id}/content: - get: - tags: - - V1 - summary: Retrieves the contents of a vector store file. - description: Query endpoint for proper schema generation. - operationId: openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - description: The ID of the vector store containing the file to retrieve. - - name: file_id - in: path - required: true - schema: - type: string - title: File Id - description: The ID of the file to retrieve. - responses: - '200': - description: A list of InterleavedContent representing the file contents. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileContentsResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/vector_stores/{vector_store_id}/search: - post: - tags: - - V1 - summary: Search for chunks in a vector store. - description: Typed endpoint for proper schema generation. - operationId: openai_search_vector_store_v1_vector_stores__vector_store_id__search_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_vector_stores_vector_store_id_search_Request' - required: true - responses: - '200': - description: A VectorStoreSearchResponse containing the search results. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreSearchResponsePage' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - description: The ID of the vector store to search. - /v1/version: - get: - tags: - - V1 - summary: Get version. - description: Response-only endpoint for proper schema generation. - operationId: version_v1_version_get - responses: - '200': - description: Version information containing the service version number. - content: - application/json: - schema: - $ref: '#/components/schemas/VersionInfo' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' -components: - schemas: - AgentCandidate: - properties: - type: - type: string - const: agent - title: Type - default: agent - config: - $ref: '#/components/schemas/AgentConfig' - type: object - required: - - config - title: AgentCandidate - description: An agent candidate for evaluation. - AgentConfig: - properties: - sampling_params: - $ref: '#/components/schemas/SamplingParams' - input_shields: - title: Input Shields - items: - type: string - type: array - output_shields: - title: Output Shields - items: - type: string - type: array - toolgroups: - title: Toolgroups - items: - anyOf: - - type: string - - $ref: '#/components/schemas/AgentToolGroupWithArgs' - type: array - client_tools: - title: Client Tools - items: - $ref: '#/components/schemas/ToolDef' - type: array - tool_choice: - deprecated: true - $ref: '#/components/schemas/ToolChoice' - tool_prompt_format: - deprecated: true - $ref: '#/components/schemas/ToolPromptFormat' - tool_config: - $ref: '#/components/schemas/ToolConfig' - max_infer_iters: - title: Max Infer Iters - default: 10 - type: integer - model: - type: string - title: Model - instructions: - type: string - title: Instructions - name: - title: Name - type: string - enable_session_persistence: - title: Enable Session Persistence - default: false - type: boolean - response_format: - title: Response Format - oneOf: - - $ref: '#/components/schemas/JsonSchemaResponseFormat' - - $ref: '#/components/schemas/GrammarResponseFormat' - discriminator: - propertyName: type - mapping: - grammar: '#/components/schemas/GrammarResponseFormat' - json_schema: '#/components/schemas/JsonSchemaResponseFormat' - type: object - required: - - model - - instructions - title: AgentConfig - description: Configuration for an agent. - AgentCreateResponse: - properties: - agent_id: - type: string - title: Agent Id - type: object - required: - - agent_id - title: AgentCreateResponse - description: Response returned when creating a new agent. - AgentSessionCreateResponse: - properties: - session_id: - type: string - title: Session Id - type: object - required: - - session_id - title: AgentSessionCreateResponse - description: Response returned when creating a new agent session. - AgentToolGroupWithArgs: - properties: - name: - type: string - title: Name - args: - additionalProperties: true - type: object - title: Args - type: object - required: - - name - - args - title: AgentToolGroupWithArgs - AgentTurnInputType: - properties: - type: - type: string - const: agent_turn_input - title: Type - default: agent_turn_input - type: object - title: AgentTurnInputType - description: Parameter type for agent turn input. - AggregationFunctionType: - type: string - enum: - - average - - weighted_average - - median - - categorical_count - - accuracy - title: AggregationFunctionType - description: Types of aggregation functions for scoring results. - AllowedToolsFilter: - properties: - tool_names: - title: Tool Names - items: - type: string - type: array - type: object - title: AllowedToolsFilter - description: Filter configuration for restricting which MCP tools can be used. - ApprovalFilter: - properties: - always: - title: Always - items: - type: string - type: array - never: - title: Never - items: - type: string - type: array - type: object - title: ApprovalFilter - description: Filter configuration for MCP tool approval requirements. - ArrayType: - properties: - type: - type: string - const: array - title: Type - default: array - type: object - title: ArrayType - description: Parameter type for array values. - Attachment-Output: - properties: - content: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - - $ref: '#/components/schemas/URL' - title: Content - mime_type: - type: string - title: Mime Type - type: object - required: - - content - - mime_type - title: Attachment - description: An attachment to an agent turn. - BasicScoringFnParams: - properties: - type: - type: string - const: basic - title: Type - default: basic - aggregation_functions: - items: - $ref: '#/components/schemas/AggregationFunctionType' - type: array - title: Aggregation Functions - description: Aggregation functions to apply to the scores of each row - type: object - title: BasicScoringFnParams - description: Parameters for basic scoring function configuration. - Batch: - properties: - id: - type: string - title: Id - completion_window: - type: string - title: Completion Window - created_at: - type: integer - title: Created At - endpoint: - type: string - title: Endpoint - input_file_id: - type: string - title: Input File Id - object: - type: string - const: batch - title: Object - status: - type: string - enum: - - validating - - failed - - in_progress - - finalizing - - completed - - expired - - cancelling - - cancelled - title: Status - cancelled_at: - title: Cancelled At - type: integer - cancelling_at: - title: Cancelling At - type: integer - completed_at: - title: Completed At - type: integer - error_file_id: - title: Error File Id - type: string - errors: - $ref: '#/components/schemas/Errors' - expired_at: - title: Expired At - type: integer - expires_at: - title: Expires At - type: integer - failed_at: - title: Failed At - type: integer - finalizing_at: - title: Finalizing At - type: integer - in_progress_at: - title: In Progress At - type: integer - metadata: - title: Metadata - additionalProperties: - type: string - type: object - model: - title: Model - type: string - output_file_id: - title: Output File Id - type: string - request_counts: - $ref: '#/components/schemas/BatchRequestCounts' - usage: - $ref: '#/components/schemas/BatchUsage' - additionalProperties: true - type: object - required: - - id - - completion_window - - created_at - - endpoint - - input_file_id - - object - - status - title: Batch - BatchError: - properties: - code: - title: Code - type: string - line: - title: Line - type: integer - message: - title: Message - type: string - param: - title: Param - type: string - additionalProperties: true - type: object - title: BatchError - BatchRequestCounts: - properties: - completed: - type: integer - title: Completed - failed: - type: integer - title: Failed - total: - type: integer - title: Total - additionalProperties: true - type: object - required: - - completed - - failed - - total - title: BatchRequestCounts - BatchUsage: - properties: - input_tokens: - type: integer - title: Input Tokens - input_tokens_details: - $ref: '#/components/schemas/InputTokensDetails' - output_tokens: - type: integer - title: Output Tokens - output_tokens_details: - $ref: '#/components/schemas/OutputTokensDetails' - total_tokens: - type: integer - title: Total Tokens - additionalProperties: true - type: object - required: - - input_tokens - - input_tokens_details - - output_tokens - - output_tokens_details - - total_tokens - title: BatchUsage - Benchmark: - properties: - identifier: - type: string - title: Identifier - description: Unique identifier for this resource in llama stack - provider_resource_id: - title: Provider Resource Id - description: Unique identifier for this resource in the provider - type: string - provider_id: - type: string - title: Provider Id - description: ID of the provider that owns this resource - type: - type: string - const: benchmark - title: Type - default: benchmark - dataset_id: - type: string - title: Dataset Id - scoring_functions: - items: - type: string - type: array - title: Scoring Functions - metadata: - additionalProperties: true - type: object - title: Metadata - description: Metadata for this evaluation task - type: object - required: - - identifier - - provider_id - - dataset_id - - scoring_functions - title: Benchmark - description: A benchmark resource for evaluating model performance. - BenchmarkConfig: - properties: - eval_candidate: - oneOf: - - $ref: '#/components/schemas/ModelCandidate' - - $ref: '#/components/schemas/AgentCandidate' - title: Eval Candidate - discriminator: - propertyName: type - mapping: - agent: '#/components/schemas/AgentCandidate' - model: '#/components/schemas/ModelCandidate' - scoring_params: - additionalProperties: - oneOf: - - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - - $ref: '#/components/schemas/RegexParserScoringFnParams' - - $ref: '#/components/schemas/BasicScoringFnParams' - discriminator: - propertyName: type - mapping: - basic: '#/components/schemas/BasicScoringFnParams' - llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' - regex_parser: '#/components/schemas/RegexParserScoringFnParams' - type: object - title: Scoring Params - description: Map between scoring function id and parameters for each scoring function you want to run - num_examples: - title: Num Examples - description: Number of examples to evaluate (useful for testing), if not provided, all examples in the dataset will be evaluated - type: integer - type: object - required: - - eval_candidate - title: BenchmarkConfig - description: A benchmark configuration for evaluation. - BooleanType: - properties: - type: - type: string - const: boolean - title: Type - default: boolean - type: object - title: BooleanType - description: Parameter type for boolean values. - BuiltinTool: - type: string - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - ChatCompletionInputType: - properties: - type: - type: string - const: chat_completion_input - title: Type - default: chat_completion_input - type: object - title: ChatCompletionInputType - description: Parameter type for chat completion input. - Chunk-Output: - properties: - content: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - title: Content - chunk_id: - type: string - title: Chunk Id - metadata: - additionalProperties: true - type: object - title: Metadata - embedding: - title: Embedding - items: - type: number - type: array - chunk_metadata: - $ref: '#/components/schemas/ChunkMetadata' - type: object - required: - - content - - chunk_id - title: Chunk - description: A chunk of content that can be inserted into a vector database. - ChunkMetadata: - properties: - chunk_id: - title: Chunk Id - type: string - document_id: - title: Document Id - type: string - source: - title: Source - type: string - created_timestamp: - title: Created Timestamp - type: integer - updated_timestamp: - title: Updated Timestamp - type: integer - chunk_window: - title: Chunk Window - type: string - chunk_tokenizer: - title: Chunk Tokenizer - type: string - chunk_embedding_model: - title: Chunk Embedding Model - type: string - chunk_embedding_dimension: - title: Chunk Embedding Dimension - type: integer - content_token_count: - title: Content Token Count - type: integer - metadata_token_count: - title: Metadata Token Count - type: integer - type: object - title: ChunkMetadata - description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." - CompletionInputType: - properties: - type: - type: string - const: completion_input - title: Type - default: completion_input - type: object - title: CompletionInputType - description: Parameter type for completion input. - CompletionMessage-Output: - properties: - role: - type: string - const: assistant - title: Role - default: assistant - content: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - title: Content - stop_reason: - $ref: '#/components/schemas/StopReason' - tool_calls: - title: Tool Calls - items: - $ref: '#/components/schemas/ToolCall' - type: array - type: object - required: - - content - - stop_reason - title: CompletionMessage - description: A message containing the model's (assistant) response in a chat conversation. - Conversation: - properties: - id: - type: string - title: Id - description: The unique ID of the conversation. - object: - type: string - const: conversation - title: Object - description: The object type, which is always conversation. - default: conversation - created_at: - type: integer - title: Created At - description: The time at which the conversation was created, measured in seconds since the Unix epoch. - metadata: - title: Metadata - description: Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. - additionalProperties: - type: string - type: object - items: - title: Items - description: Initial items to include in the conversation context. You may add up to 20 items at a time. - items: - additionalProperties: true - type: object - type: array - type: object - required: - - id - - created_at - title: Conversation - description: OpenAI-compatible conversation object. - ConversationItemInclude: - type: string - enum: - - web_search_call.action.sources - - code_interpreter_call.outputs - - computer_call_output.output.image_url - - file_search_call.results - - message.input_image.image_url - - message.output_text.logprobs - - reasoning.encrypted_content - title: ConversationItemInclude - description: Specify additional output data to include in the model response. - ConversationItemList: - properties: - object: - type: string - title: Object - description: Object type - default: list - data: - items: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage-Output' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - discriminator: - propertyName: type - mapping: - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - message: '#/components/schemas/OpenAIResponseMessage-Output' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - type: array - title: Data - description: List of conversation items - first_id: - title: First Id - description: The ID of the first item in the list - type: string - last_id: - title: Last Id - description: The ID of the last item in the list - type: string - has_more: - type: boolean - title: Has More - description: Whether there are more items available - default: false - type: object - required: - - data - title: ConversationItemList - description: List of conversation items with pagination. - DPOAlignmentConfig: - properties: - beta: - type: number - title: Beta - loss_type: - $ref: '#/components/schemas/DPOLossType' - default: sigmoid - type: object - required: - - beta - title: DPOAlignmentConfig - description: Configuration for Direct Preference Optimization (DPO) alignment. - DPOLossType: - type: string - enum: - - sigmoid - - hinge - - ipo - - kto_pair - title: DPOLossType - DataConfig: - properties: - dataset_id: - type: string - title: Dataset Id - batch_size: - type: integer - title: Batch Size - shuffle: - type: boolean - title: Shuffle - data_format: - $ref: '#/components/schemas/DatasetFormat' - validation_dataset_id: - title: Validation Dataset Id - type: string - packed: - title: Packed - default: false - type: boolean - train_on_input: - title: Train On Input - default: false - type: boolean - type: object - required: - - dataset_id - - batch_size - - shuffle - - data_format - title: DataConfig - description: Configuration for training data and data loading. - Dataset: - properties: - identifier: - type: string - title: Identifier - description: Unique identifier for this resource in llama stack - provider_resource_id: - title: Provider Resource Id - description: Unique identifier for this resource in the provider - type: string - provider_id: - type: string - title: Provider Id - description: ID of the provider that owns this resource - type: - type: string - const: dataset - title: Type - default: dataset - purpose: - $ref: '#/components/schemas/DatasetPurpose' - source: - oneOf: - - $ref: '#/components/schemas/URIDataSource' - - $ref: '#/components/schemas/RowsDataSource' - title: Source - discriminator: - propertyName: type - mapping: - rows: '#/components/schemas/RowsDataSource' - uri: '#/components/schemas/URIDataSource' - metadata: - additionalProperties: true - type: object - title: Metadata - description: Any additional metadata for this dataset - type: object - required: - - identifier - - provider_id - - purpose - - source - title: Dataset - description: Dataset resource for storing and accessing training or evaluation data. - DatasetFormat: - type: string - enum: - - instruct - - dialog - title: DatasetFormat - description: Format of the training dataset. - DatasetPurpose: - type: string - enum: - - post-training/messages - - eval/question-answer - - eval/messages-answer - title: DatasetPurpose - description: Purpose of the dataset. Each purpose has a required input data schema. - DefaultRAGQueryGeneratorConfig: - properties: - type: - type: string - const: default - title: Type - default: default - separator: - type: string - title: Separator - default: ' ' - type: object - title: DefaultRAGQueryGeneratorConfig - description: Configuration for the default RAG query generator. - Document: - properties: - content: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' - type: array - - $ref: '#/components/schemas/URL' - title: Content - mime_type: - type: string - title: Mime Type - type: object - required: - - content - - mime_type - title: Document - description: A document to be used by an agent. - EfficiencyConfig: - properties: - enable_activation_checkpointing: - title: Enable Activation Checkpointing - default: false - type: boolean - enable_activation_offloading: - title: Enable Activation Offloading - default: false - type: boolean - memory_efficient_fsdp_wrap: - title: Memory Efficient Fsdp Wrap - default: false - type: boolean - fsdp_cpu_offload: - title: Fsdp Cpu Offload - default: false - type: boolean - type: object - title: EfficiencyConfig - description: Configuration for memory and compute efficiency optimizations. - Errors: - properties: - data: - title: Data - items: - $ref: '#/components/schemas/BatchError' - type: array - object: - title: Object - type: string - additionalProperties: true - type: object - title: Errors - EvaluateResponse: - properties: - generations: - items: - additionalProperties: true - type: object - type: array - title: Generations - scores: - additionalProperties: - $ref: '#/components/schemas/ScoringResult' - type: object - title: Scores - type: object - required: - - generations - - scores - title: EvaluateResponse - description: The response from an evaluation. - GrammarResponseFormat: - properties: - type: - type: string - const: grammar - title: Type - default: grammar - bnf: - additionalProperties: true - type: object - title: Bnf - type: object - required: - - bnf - title: GrammarResponseFormat - description: Configuration for grammar-guided response generation. - GreedySamplingStrategy: - properties: - type: - type: string - const: greedy - title: Type - default: greedy - type: object - title: GreedySamplingStrategy - description: Greedy sampling strategy that selects the highest probability token at each step. - HealthInfo: - properties: - status: - $ref: '#/components/schemas/HealthStatus' - type: object - required: - - status - title: HealthInfo - description: Health status information for the service. - HealthStatus: - type: string - enum: - - OK - - Error - - Not Implemented - title: HealthStatus - ImageContentItem-Input: - properties: - type: - type: string - const: image - title: Type - default: image - image: - $ref: '#/components/schemas/_URLOrData' - type: object - required: - - image - title: ImageContentItem - description: A image content item - ImageContentItem-Output: - properties: - type: - type: string - const: image - title: Type - default: image - image: - $ref: '#/components/schemas/_URLOrData' - type: object - required: - - image - title: ImageContentItem - description: A image content item - InferenceStep-Output: - properties: - turn_id: - type: string - title: Turn Id - step_id: - type: string - title: Step Id - started_at: - title: Started At - type: string - format: date-time - completed_at: - title: Completed At - type: string - format: date-time - step_type: - type: string - const: inference - title: Step Type - default: inference - model_response: - $ref: '#/components/schemas/CompletionMessage-Output' - type: object - required: - - turn_id - - step_id - - model_response - title: InferenceStep - description: An inference step in an agent turn. - InputTokensDetails: - properties: - cached_tokens: - type: integer - title: Cached Tokens - additionalProperties: true - type: object - required: - - cached_tokens - title: InputTokensDetails - Job: - properties: - job_id: - type: string - title: Job Id - status: - $ref: '#/components/schemas/JobStatus' - type: object - required: - - job_id - - status - title: Job - description: A job execution instance with status tracking. - JobStatus: - type: string - enum: - - completed - - in_progress - - failed - - scheduled - - cancelled - title: JobStatus - description: Status of a job execution. - JsonSchemaResponseFormat: - properties: - type: - type: string - const: json_schema - title: Type - default: json_schema - json_schema: - additionalProperties: true - type: object - title: Json Schema - type: object - required: - - json_schema - title: JsonSchemaResponseFormat - description: Configuration for JSON schema-guided response generation. - JsonType: - properties: - type: - type: string - const: json - title: Type - default: json - type: object - title: JsonType - description: Parameter type for JSON values. - LLMAsJudgeScoringFnParams: - properties: - type: - type: string - const: llm_as_judge - title: Type - default: llm_as_judge - judge_model: - type: string - title: Judge Model - prompt_template: - title: Prompt Template - type: string - judge_score_regexes: - items: - type: string - type: array - title: Judge Score Regexes - description: Regexes to extract the answer from generated response - aggregation_functions: - items: - $ref: '#/components/schemas/AggregationFunctionType' - type: array - title: Aggregation Functions - description: Aggregation functions to apply to the scores of each row - type: object - required: - - judge_model - title: LLMAsJudgeScoringFnParams - description: Parameters for LLM-as-judge scoring function configuration. - LLMRAGQueryGeneratorConfig: - properties: - type: - type: string - const: llm - title: Type - default: llm - model: - type: string - title: Model - template: - type: string - title: Template - type: object - required: - - model - - template - title: LLMRAGQueryGeneratorConfig - description: Configuration for the LLM-based RAG query generator. - ListBenchmarksResponse: - properties: - data: - items: - $ref: '#/components/schemas/Benchmark' - type: array - title: Data - type: object - required: - - data - title: ListBenchmarksResponse - ListDatasetsResponse: - properties: - data: - items: - $ref: '#/components/schemas/Dataset' - type: array - title: Data - type: object - required: - - data - title: ListDatasetsResponse - description: Response from listing datasets. - ListModelsResponse: - properties: - data: - items: - $ref: '#/components/schemas/Model' - type: array - title: Data - type: object - required: - - data - title: ListModelsResponse - ListPostTrainingJobsResponse: - properties: - data: - items: - $ref: '#/components/schemas/PostTrainingJob' - type: array - title: Data - type: object - required: - - data - title: ListPostTrainingJobsResponse - ListPromptsResponse: - properties: - data: - items: - $ref: '#/components/schemas/Prompt' - type: array - title: Data - type: object - required: - - data - title: ListPromptsResponse - description: Response model to list prompts. - ListProvidersResponse: - properties: - data: - items: - $ref: '#/components/schemas/ProviderInfo' - type: array - title: Data - type: object - required: - - data - title: ListProvidersResponse - description: Response containing a list of all available providers. - ListRoutesResponse: - properties: - data: - items: - $ref: '#/components/schemas/RouteInfo' - type: array - title: Data - type: object - required: - - data - title: ListRoutesResponse - description: Response containing a list of all available API routes. - ListScoringFunctionsResponse: - properties: - data: - items: - $ref: '#/components/schemas/ScoringFn-Output' - type: array - title: Data - type: object - required: - - data - title: ListScoringFunctionsResponse - ListShieldsResponse: - properties: - data: - items: - $ref: '#/components/schemas/Shield' - type: array - title: Data - type: object - required: - - data - title: ListShieldsResponse - ListToolGroupsResponse: - properties: - data: - items: - $ref: '#/components/schemas/ToolGroup' - type: array - title: Data - type: object - required: - - data - title: ListToolGroupsResponse - description: Response containing a list of tool groups. - MCPListToolsTool: - properties: - input_schema: - additionalProperties: true - type: object - title: Input Schema - name: - type: string - title: Name - description: - title: Description - type: string - type: object - required: - - input_schema - - name - title: MCPListToolsTool - description: Tool definition returned by MCP list tools operation. - MemoryRetrievalStep-Output: - properties: - turn_id: - type: string - title: Turn Id - step_id: - type: string - title: Step Id - started_at: - title: Started At - type: string - format: date-time - completed_at: - title: Completed At - type: string - format: date-time - step_type: - type: string - const: memory_retrieval - title: Step Type - default: memory_retrieval - vector_store_ids: - type: string - title: Vector Store Ids - inserted_context: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - title: Inserted Context - type: object - required: - - turn_id - - step_id - - vector_store_ids - - inserted_context - title: MemoryRetrievalStep - description: A memory retrieval step in an agent turn. - Model: - properties: - identifier: - type: string - title: Identifier - description: Unique identifier for this resource in llama stack - provider_resource_id: - title: Provider Resource Id - description: Unique identifier for this resource in the provider - type: string - provider_id: - type: string - title: Provider Id - description: ID of the provider that owns this resource - type: - type: string - const: model - title: Type - default: model - metadata: - additionalProperties: true - type: object - title: Metadata - description: Any additional metadata for this model - model_type: - $ref: '#/components/schemas/ModelType' - default: llm - type: object - required: - - identifier - - provider_id - title: Model - description: A model resource representing an AI model registered in Llama Stack. - ModelCandidate: - properties: - type: - type: string - const: model - title: Type - default: model - model: - type: string - title: Model - sampling_params: - $ref: '#/components/schemas/SamplingParams' - system_message: - $ref: '#/components/schemas/SystemMessage' - type: object - required: - - model - - sampling_params - title: ModelCandidate - description: A model candidate for evaluation. - ModelType: - type: string - enum: - - llm - - embedding - - rerank - title: ModelType - description: Enumeration of supported model types in Llama Stack. - ModerationObject: - properties: - id: - type: string - title: Id - model: - type: string - title: Model - results: - items: - $ref: '#/components/schemas/ModerationObjectResults' - type: array - title: Results - type: object - required: - - id - - model - - results - title: ModerationObject - description: A moderation object. - ModerationObjectResults: - properties: - flagged: - type: boolean - title: Flagged - categories: - title: Categories - additionalProperties: - type: boolean - type: object - category_applied_input_types: - title: Category Applied Input Types - additionalProperties: - items: - type: string - type: array - type: object - category_scores: - title: Category Scores - additionalProperties: - type: number - type: object - user_message: - title: User Message - type: string - metadata: - additionalProperties: true - type: object - title: Metadata - type: object - required: - - flagged - title: ModerationObjectResults - description: A moderation object. - NumberType: - properties: - type: - type: string - const: number - title: Type - default: number - type: object - title: NumberType - description: Parameter type for numeric values. - ObjectType: - properties: - type: - type: string - const: object - title: Type - default: object - type: object - title: ObjectType - description: Parameter type for object values. - OpenAIAssistantMessageParam-Input: - properties: - role: - type: string - const: assistant - title: Role - default: assistant - content: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - name: - title: Name - type: string - tool_calls: - title: Tool Calls - items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' - type: array - type: object - title: OpenAIAssistantMessageParam - description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. - OpenAIAssistantMessageParam-Output: - properties: - role: - type: string - const: assistant - title: Role - default: assistant - content: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - name: - title: Name - type: string - tool_calls: - title: Tool Calls - items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' - type: array - type: object - title: OpenAIAssistantMessageParam - description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. - OpenAIChatCompletion: - properties: - id: - type: string - title: Id - choices: - items: - $ref: '#/components/schemas/OpenAIChoice-Output' - type: array - title: Choices - object: - type: string - const: chat.completion - title: Object - default: chat.completion - created: - type: integer - title: Created - model: - type: string - title: Model - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - type: object - required: - - id - - choices - - created - - model - title: OpenAIChatCompletion - description: Response from an OpenAI-compatible chat completion request. - OpenAIChatCompletionContentPartImageParam: - properties: - type: - type: string - const: image_url - title: Type - default: image_url - image_url: - $ref: '#/components/schemas/OpenAIImageURL' - type: object - required: - - image_url - title: OpenAIChatCompletionContentPartImageParam - description: Image content part for OpenAI-compatible chat completion messages. - OpenAIChatCompletionContentPartTextParam: - properties: - type: - type: string - const: text - title: Type - default: text - text: - type: string - title: Text - type: object - required: - - text - title: OpenAIChatCompletionContentPartTextParam - description: Text content part for OpenAI-compatible chat completion messages. - OpenAIChatCompletionRequestWithExtraBody: - properties: - model: - type: string - title: Model - messages: - items: - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - discriminator: - propertyName: role - mapping: - assistant: '#/components/schemas/OpenAIAssistantMessageParam-Input' - developer: '#/components/schemas/OpenAIDeveloperMessageParam' - system: '#/components/schemas/OpenAISystemMessageParam' - tool: '#/components/schemas/OpenAIToolMessageParam' - user: '#/components/schemas/OpenAIUserMessageParam-Input' - type: array - minItems: 1 - title: Messages - frequency_penalty: - title: Frequency Penalty - type: number - function_call: - anyOf: - - type: string - - additionalProperties: true - type: object - title: Function Call - functions: - title: Functions - items: - additionalProperties: true - type: object - type: array - logit_bias: - title: Logit Bias - additionalProperties: - type: number - type: object - logprobs: - title: Logprobs - type: boolean - max_completion_tokens: - title: Max Completion Tokens - type: integer - max_tokens: - title: Max Tokens - type: integer - n: - title: N - type: integer - parallel_tool_calls: - title: Parallel Tool Calls - type: boolean - presence_penalty: - title: Presence Penalty - type: number - response_format: - title: Response Format - oneOf: - - $ref: '#/components/schemas/OpenAIResponseFormatText' - - $ref: '#/components/schemas/OpenAIResponseFormatJSONSchema' - - $ref: '#/components/schemas/OpenAIResponseFormatJSONObject' - discriminator: - propertyName: type - mapping: - json_object: '#/components/schemas/OpenAIResponseFormatJSONObject' - json_schema: '#/components/schemas/OpenAIResponseFormatJSONSchema' - text: '#/components/schemas/OpenAIResponseFormatText' - seed: - title: Seed - type: integer - stop: - anyOf: - - type: string - - items: - type: string - type: array - title: Stop - stream: - title: Stream - type: boolean - stream_options: - title: Stream Options - additionalProperties: true - type: object - temperature: - title: Temperature - type: number - tool_choice: - anyOf: - - type: string - - additionalProperties: true - type: object - title: Tool Choice - tools: - title: Tools - items: - additionalProperties: true - type: object - type: array - top_logprobs: - title: Top Logprobs - type: integer - top_p: - title: Top P - type: number - user: - title: User - type: string - additionalProperties: true - type: object - required: - - model - - messages - title: OpenAIChatCompletionRequestWithExtraBody - description: Request parameters for OpenAI-compatible chat completion endpoint. - OpenAIChatCompletionToolCall: - properties: - index: - title: Index - type: integer - id: - title: Id - type: string - type: - type: string - const: function - title: Type - default: function - function: - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' - type: object - title: OpenAIChatCompletionToolCall - description: Tool call specification for OpenAI-compatible chat completion responses. - OpenAIChatCompletionToolCallFunction: - properties: - name: - title: Name - type: string - arguments: - title: Arguments - type: string - type: object - title: OpenAIChatCompletionToolCallFunction - description: Function call details for OpenAI-compatible tool calls. - OpenAIChatCompletionUsage: - properties: - prompt_tokens: - type: integer - title: Prompt Tokens - completion_tokens: - type: integer - title: Completion Tokens - total_tokens: - type: integer - title: Total Tokens - prompt_tokens_details: - $ref: '#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails' - completion_tokens_details: - $ref: '#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails' - type: object - required: - - prompt_tokens - - completion_tokens - - total_tokens - title: OpenAIChatCompletionUsage - description: Usage information for OpenAI chat completion. - OpenAIChatCompletionUsageCompletionTokensDetails: - properties: - reasoning_tokens: - title: Reasoning Tokens - type: integer - type: object - title: OpenAIChatCompletionUsageCompletionTokensDetails - description: Token details for output tokens in OpenAI chat completion usage. - OpenAIChatCompletionUsagePromptTokensDetails: - properties: - cached_tokens: - title: Cached Tokens - type: integer - type: object - title: OpenAIChatCompletionUsagePromptTokensDetails - description: Token details for prompt tokens in OpenAI chat completion usage. - OpenAIChoice-Output: - properties: - message: - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam-Output' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Output' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - title: Message - discriminator: - propertyName: role - mapping: - assistant: '#/components/schemas/OpenAIAssistantMessageParam-Output' - developer: '#/components/schemas/OpenAIDeveloperMessageParam' - system: '#/components/schemas/OpenAISystemMessageParam' - tool: '#/components/schemas/OpenAIToolMessageParam' - user: '#/components/schemas/OpenAIUserMessageParam-Output' - finish_reason: - type: string - title: Finish Reason - index: - type: integer - title: Index - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' - type: object - required: - - message - - finish_reason - - index - title: OpenAIChoice - description: A choice from an OpenAI-compatible chat completion response. - OpenAIChoiceLogprobs-Output: - properties: - content: - title: Content - items: - $ref: '#/components/schemas/OpenAITokenLogProb' - type: array - refusal: - title: Refusal - items: - $ref: '#/components/schemas/OpenAITokenLogProb' - type: array - type: object - title: OpenAIChoiceLogprobs - description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. - OpenAICompletion: - properties: - id: - type: string - title: Id - choices: - items: - $ref: '#/components/schemas/OpenAICompletionChoice-Output' - type: array - title: Choices - created: - type: integer - title: Created - model: - type: string - title: Model - object: - type: string - const: text_completion - title: Object - default: text_completion - type: object - required: - - id - - choices - - created - - model - title: OpenAICompletion - description: Response from an OpenAI-compatible completion request. - OpenAICompletionChoice-Output: - properties: - finish_reason: - type: string - title: Finish Reason - text: - type: string - title: Text - index: - type: integer - title: Index - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' - type: object - required: - - finish_reason - - text - - index - title: OpenAICompletionChoice - description: A choice from an OpenAI-compatible completion response. - OpenAICompletionRequestWithExtraBody: - properties: - model: - type: string - title: Model - prompt: - anyOf: - - type: string - - items: - type: string - type: array - - items: - type: integer - type: array - - items: - items: - type: integer - type: array - type: array - title: Prompt - best_of: - title: Best Of - type: integer - echo: - title: Echo - type: boolean - frequency_penalty: - title: Frequency Penalty - type: number - logit_bias: - title: Logit Bias - additionalProperties: - type: number - type: object - logprobs: - title: Logprobs - type: boolean - max_tokens: - title: Max Tokens - type: integer - n: - title: N - type: integer - presence_penalty: - title: Presence Penalty - type: number - seed: - title: Seed - type: integer - stop: - anyOf: - - type: string - - items: - type: string - type: array - title: Stop - stream: - title: Stream - type: boolean - stream_options: - title: Stream Options - additionalProperties: true - type: object - temperature: - title: Temperature - type: number - top_p: - title: Top P - type: number - user: - title: User - type: string - suffix: - title: Suffix - type: string - additionalProperties: true - type: object - required: - - model - - prompt - title: OpenAICompletionRequestWithExtraBody - description: Request parameters for OpenAI-compatible completion endpoint. - OpenAICreateVectorStoreFileBatchRequestWithExtraBody: - properties: - file_ids: - items: - type: string - type: array - title: File Ids - attributes: - title: Attributes - additionalProperties: true - type: object - chunking_strategy: - title: Chunking Strategy - oneOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' - discriminator: - propertyName: type - mapping: - auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' - static: '#/components/schemas/VectorStoreChunkingStrategyStatic' - additionalProperties: true - type: object - required: - - file_ids - title: OpenAICreateVectorStoreFileBatchRequestWithExtraBody - description: Request to create a vector store file batch with extra_body support. - OpenAICreateVectorStoreRequestWithExtraBody: - properties: - name: - title: Name - type: string - file_ids: - title: File Ids - items: - type: string - type: array - expires_after: - title: Expires After - additionalProperties: true - type: object - chunking_strategy: - title: Chunking Strategy - additionalProperties: true - type: object - metadata: - title: Metadata - additionalProperties: true - type: object - additionalProperties: true - type: object - title: OpenAICreateVectorStoreRequestWithExtraBody - description: Request to create a vector store with extra_body support. - OpenAIDeveloperMessageParam: - properties: - role: - type: string - const: developer - title: Role - default: developer - content: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content + title: Instructions + description: The system instructions for the agent name: - title: Name - type: string - type: object - required: - - content - title: OpenAIDeveloperMessageParam - description: A message from the developer in an OpenAI-compatible chat completion request. - OpenAIEmbeddingData: - properties: - object: - type: string - const: embedding - title: Object - default: embedding - embedding: anyOf: - - items: - type: number - type: array - type: string - title: Embedding - index: - type: integer - title: Index - type: object - required: - - embedding - - index - title: OpenAIEmbeddingData - description: A single embedding data object from an OpenAI-compatible embeddings response. - OpenAIEmbeddingUsage: - properties: - prompt_tokens: - type: integer - title: Prompt Tokens - total_tokens: - type: integer - title: Total Tokens + - type: 'null' + title: Name + description: Optional name for the agent, used in telemetry and identification + enable_session_persistence: + anyOf: + - type: boolean + - type: 'null' + title: Enable Session Persistence + description: Optional flag indicating whether session data has to be persisted + default: false + response_format: + anyOf: + - oneOf: + - $ref: '#/components/schemas/JsonSchemaResponseFormat' + - $ref: '#/components/schemas/GrammarResponseFormat' + discriminator: + propertyName: type + mapping: + grammar: '#/components/schemas/GrammarResponseFormat' + json_schema: '#/components/schemas/JsonSchemaResponseFormat' + - type: 'null' + title: Response Format + description: Optional response format configuration type: object required: - - prompt_tokens - - total_tokens - title: OpenAIEmbeddingUsage - description: Usage information for an OpenAI-compatible embeddings response. - OpenAIEmbeddingsRequestWithExtraBody: + - model + - instructions + title: AgentConfig + description: Configuration for an agent. + AgentConfig-Output: properties: - model: - type: string - title: Model - input: + sampling_params: + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' + input_shields: anyOf: - - type: string - items: type: string type: array - title: Input - encoding_format: - title: Encoding Format - default: float + - type: 'null' + title: Input Shields + output_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields + toolgroups: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups + client_tools: + anyOf: + - items: + $ref: '#/components/schemas/ToolDef' + type: array + - type: 'null' + title: Client Tools + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: 'null' + deprecated: true + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + deprecated: true + tool_config: + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' + max_infer_iters: + anyOf: + - type: integer + - type: 'null' + title: Max Infer Iters + default: 10 + model: type: string - dimensions: - title: Dimensions - type: integer - user: - title: User + title: Model + description: The model identifier to use for the agent + instructions: type: string - additionalProperties: true + title: Instructions + description: The system instructions for the agent + name: + anyOf: + - type: string + - type: 'null' + title: Name + description: Optional name for the agent, used in telemetry and identification + enable_session_persistence: + anyOf: + - type: boolean + - type: 'null' + title: Enable Session Persistence + description: Optional flag indicating whether session data has to be persisted + default: false + response_format: + anyOf: + - oneOf: + - $ref: '#/components/schemas/JsonSchemaResponseFormat' + - $ref: '#/components/schemas/GrammarResponseFormat' + discriminator: + propertyName: type + mapping: + grammar: '#/components/schemas/GrammarResponseFormat' + json_schema: '#/components/schemas/JsonSchemaResponseFormat' + - type: 'null' + title: Response Format + description: Optional response format configuration type: object required: - model - - input - title: OpenAIEmbeddingsRequestWithExtraBody - description: Request parameters for OpenAI-compatible embeddings endpoint. - OpenAIEmbeddingsResponse: + - instructions + title: AgentConfig + description: Configuration for an agent. + AgentCreateResponse: properties: - object: - type: string - const: list - title: Object - default: list - data: - items: - $ref: '#/components/schemas/OpenAIEmbeddingData' - type: array - title: Data - model: + agent_id: type: string - title: Model - usage: - $ref: '#/components/schemas/OpenAIEmbeddingUsage' + title: Agent Id + description: Unique identifier for the created agent type: object required: - - data - - model - - usage - title: OpenAIEmbeddingsResponse - description: Response from an OpenAI-compatible embeddings request. - OpenAIFile: + - agent_id + title: AgentCreateResponse + description: Response returned when creating a new agent. + AgentSessionCreateResponse: properties: - type: + session_id: type: string - const: file - title: Type - default: file - file: - $ref: '#/components/schemas/OpenAIFileFile' + title: Session Id + description: Unique identifier for the created session type: object required: - - file - title: OpenAIFile - OpenAIFileFile: + - session_id + title: AgentSessionCreateResponse + description: Response returned when creating a new agent session. + AgentStepResponse: properties: - file_data: - title: File Data - type: string - file_id: - title: File Id - type: string - filename: - title: Filename - type: string + step: + oneOf: + - $ref: '#/components/schemas/InferenceStep-Output' + - $ref: '#/components/schemas/ToolExecutionStep-Output' + - $ref: '#/components/schemas/ShieldCallStep-Output' + - $ref: '#/components/schemas/MemoryRetrievalStep-Output' + title: Step + description: The complete step data and execution details + discriminator: + propertyName: step_type + mapping: + inference: '#/components/schemas/InferenceStep-Output' + memory_retrieval: '#/components/schemas/MemoryRetrievalStep-Output' + shield_call: '#/components/schemas/ShieldCallStep-Output' + tool_execution: '#/components/schemas/ToolExecutionStep-Output' type: object - title: OpenAIFileFile - OpenAIFileObject: + required: + - step + title: AgentStepResponse + description: Response containing details of a specific agent step. + AgentToolGroupWithArgs: properties: - object: - type: string - const: file - title: Object - default: file - id: - type: string - title: Id - bytes: - type: integer - title: Bytes - created_at: - type: integer - title: Created At - expires_at: - type: integer - title: Expires At - filename: + name: type: string - title: Filename - purpose: - $ref: '#/components/schemas/OpenAIFilePurpose' + title: Name + args: + additionalProperties: true + type: object + title: Args type: object required: - - id - - bytes - - created_at - - expires_at - - filename - - purpose - title: OpenAIFileObject - description: OpenAI File object as defined in the OpenAI Files API. - OpenAIFilePurpose: - type: string - enum: - - assistants - - batch - title: OpenAIFilePurpose - description: Valid purpose values for OpenAI Files API. - OpenAIImageURL: + - name + - args + title: AgentToolGroupWithArgs + AgentTurnCreateRequest: properties: - url: - type: string - title: Url - detail: - title: Detail + sampling_params: + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' + input_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Input Shields + output_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields + toolgroups: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups + description: List of tool groups to make available for this turn + client_tools: + anyOf: + - items: + $ref: '#/components/schemas/ToolDef' + type: array + - type: 'null' + title: Client Tools + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: 'null' + deprecated: true + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + deprecated: true + tool_config: + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' + description: Tool configuration to override agent defaults + max_infer_iters: + anyOf: + - type: integer + - type: 'null' + title: Max Infer Iters + default: 10 + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + agent_id: type: string + title: Agent Id + description: Unique identifier for the agent + session_id: + type: string + title: Session Id + description: Unique identifier for the conversation session + messages: + items: + anyOf: + - $ref: '#/components/schemas/UserMessage-Input' + - $ref: '#/components/schemas/ToolResponseMessage-Input' + type: array + title: Messages + description: List of messages to start the turn with + documents: + anyOf: + - items: + $ref: '#/components/schemas/Document' + type: array + - type: 'null' + title: Documents + description: List of documents to provide to the agent + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + description: Whether to stream the response + default: false type: object required: - - url - title: OpenAIImageURL - description: Image URL specification for OpenAI-compatible chat completion messages. - OpenAIJSONSchema: + - agent_id + - session_id + - messages + title: AgentTurnCreateRequest + description: Request to create a new turn for an agent. + AgentTurnInputType: properties: - name: - type: string - title: Name - description: - title: Description + type: type: string - strict: - title: Strict - type: boolean - schema: - title: Schema - additionalProperties: true - type: object + const: agent_turn_input + title: Type + default: agent_turn_input type: object - title: OpenAIJSONSchema - description: JSON schema specification for OpenAI-compatible structured response format. - OpenAIResponseAnnotationCitation: + title: AgentTurnInputType + description: "Parameter type for agent turn input.\n\n:param type: Discriminator type. Always \"agent_turn_input\"" + AgentTurnResumeRequest: properties: - type: + agent_id: type: string - const: url_citation - title: Type - default: url_citation - end_index: - type: integer - title: End Index - start_index: - type: integer - title: Start Index - title: + title: Agent Id + description: Unique identifier for the agent + session_id: type: string - title: Title - url: + title: Session Id + description: Unique identifier for the conversation session + turn_id: type: string - title: Url + title: Turn Id + description: Unique identifier for the turn within a session + tool_responses: + items: + $ref: '#/components/schemas/ToolResponse-Input' + type: array + title: Tool Responses + description: List of tool responses to submit to continue the turn + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + description: Whether to stream the response + default: false type: object required: - - end_index - - start_index - - title - - url - title: OpenAIResponseAnnotationCitation - description: URL citation annotation for referencing external web resources. - OpenAIResponseAnnotationContainerFileCitation: + - agent_id + - session_id + - turn_id + - tool_responses + title: AgentTurnResumeRequest + description: Request to resume an agent turn with tool responses. + AggregationFunctionType: + type: string + enum: + - average + - weighted_average + - median + - categorical_count + - accuracy + title: AggregationFunctionType + description: Types of aggregation functions for scoring results. + AllowedToolsFilter: + properties: + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Tool Names + description: List of specific tool names that are allowed + type: object + title: AllowedToolsFilter + description: "Filter configuration for restricting which MCP tools can be used.\n\n:param tool_names: (Optional) List of specific tool names that are allowed" + ApprovalFilter: + properties: + always: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Always + description: List of tool names that always require approval + never: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Never + description: List of tool names that never require approval + type: object + title: ApprovalFilter + description: "Filter configuration for MCP tool approval requirements.\n\n:param always: (Optional) List of tool names that always require approval\n:param never: (Optional) List of tool names that never require approval" + ArrayType: properties: type: type: string - const: container_file_citation + const: array title: Type - default: container_file_citation - container_id: - type: string - title: Container Id - end_index: - type: integer - title: End Index - file_id: - type: string - title: File Id - filename: + default: array + type: object + title: ArrayType + description: "Parameter type for array values.\n\n:param type: Discriminator type. Always \"array\"" + Attachment-Output: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + title: Content + description: The content of the attachment. + mime_type: type: string - title: Filename - start_index: - type: integer - title: Start Index + title: Mime Type + description: The MIME type of the attachment. type: object required: - - container_id - - end_index - - file_id - - filename - - start_index - title: OpenAIResponseAnnotationContainerFileCitation - OpenAIResponseAnnotationFileCitation: + - content + - mime_type + title: Attachment + description: An attachment to an agent turn. + BasicScoringFnParams: properties: type: type: string - const: file_citation + const: basic title: Type - default: file_citation - file_id: - type: string - title: File Id - filename: - type: string - title: Filename - index: - type: integer - title: Index + default: basic + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row type: object - required: - - file_id - - filename - - index - title: OpenAIResponseAnnotationFileCitation - description: File citation annotation for referencing specific files in response content. - OpenAIResponseAnnotationFilePath: + title: BasicScoringFnParams + description: Parameters for basic scoring function configuration. + Batch: properties: - type: + id: type: string - const: file_path - title: Type - default: file_path - file_id: + title: Id + completion_window: type: string - title: File Id - index: + title: Completion Window + created_at: type: integer - title: Index - type: object - required: - - file_id - - index - title: OpenAIResponseAnnotationFilePath - OpenAIResponseContentPartRefusal: - properties: - type: + title: Created At + endpoint: type: string - const: refusal - title: Type - default: refusal - refusal: + title: Endpoint + input_file_id: type: string - title: Refusal + title: Input File Id + object: + type: string + const: batch + title: Object + status: + type: string + enum: + - validating + - failed + - in_progress + - finalizing + - completed + - expired + - cancelling + - cancelled + title: Status + cancelled_at: + anyOf: + - type: integer + - type: 'null' + title: Cancelled At + cancelling_at: + anyOf: + - type: integer + - type: 'null' + title: Cancelling At + completed_at: + anyOf: + - type: integer + - type: 'null' + title: Completed At + error_file_id: + anyOf: + - type: string + - type: 'null' + title: Error File Id + errors: + anyOf: + - $ref: '#/components/schemas/Errors' + - type: 'null' + expired_at: + anyOf: + - type: integer + - type: 'null' + title: Expired At + expires_at: + anyOf: + - type: integer + - type: 'null' + title: Expires At + failed_at: + anyOf: + - type: integer + - type: 'null' + title: Failed At + finalizing_at: + anyOf: + - type: integer + - type: 'null' + title: Finalizing At + in_progress_at: + anyOf: + - type: integer + - type: 'null' + title: In Progress At + metadata: + anyOf: + - additionalProperties: + type: string + type: object + - type: 'null' + title: Metadata + model: + anyOf: + - type: string + - type: 'null' + title: Model + output_file_id: + anyOf: + - type: string + - type: 'null' + title: Output File Id + request_counts: + anyOf: + - $ref: '#/components/schemas/BatchRequestCounts' + - type: 'null' + usage: + anyOf: + - $ref: '#/components/schemas/BatchUsage' + - type: 'null' + additionalProperties: true type: object required: - - refusal - title: OpenAIResponseContentPartRefusal - description: Refusal content within a streamed response part. - OpenAIResponseError: + - id + - completion_window + - created_at + - endpoint + - input_file_id + - object + - status + title: Batch + BatchError: properties: code: - type: string + anyOf: + - type: string + - type: 'null' title: Code + line: + anyOf: + - type: integer + - type: 'null' + title: Line message: - type: string + anyOf: + - type: string + - type: 'null' title: Message + param: + anyOf: + - type: string + - type: 'null' + title: Param + additionalProperties: true type: object - required: - - code - - message - title: OpenAIResponseError - description: Error details for failed OpenAI response requests. - OpenAIResponseFormatJSONObject: - properties: - type: - type: string - const: json_object - title: Type - default: json_object - type: object - title: OpenAIResponseFormatJSONObject - description: JSON object response format for OpenAI-compatible chat completion requests. - OpenAIResponseFormatJSONSchema: + title: BatchError + BatchRequestCounts: properties: - type: - type: string - const: json_schema - title: Type - default: json_schema - json_schema: - $ref: '#/components/schemas/OpenAIJSONSchema' + completed: + type: integer + title: Completed + failed: + type: integer + title: Failed + total: + type: integer + title: Total + additionalProperties: true type: object required: - - json_schema - title: OpenAIResponseFormatJSONSchema - description: JSON schema response format for OpenAI-compatible chat completion requests. - OpenAIResponseFormatText: + - completed + - failed + - total + title: BatchRequestCounts + BatchUsage: properties: - type: - type: string - const: text - title: Type - default: text + input_tokens: + type: integer + title: Input Tokens + input_tokens_details: + $ref: '#/components/schemas/InputTokensDetails' + output_tokens: + type: integer + title: Output Tokens + output_tokens_details: + $ref: '#/components/schemas/OutputTokensDetails' + total_tokens: + type: integer + title: Total Tokens + additionalProperties: true type: object - title: OpenAIResponseFormatText - description: Text response format for OpenAI-compatible chat completion requests. - OpenAIResponseInputFunctionToolCallOutput: + required: + - input_tokens + - input_tokens_details + - output_tokens + - output_tokens_details + - total_tokens + title: BatchUsage + Benchmark: properties: - call_id: + identifier: type: string - title: Call Id - output: + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: type: string - title: Output + title: Provider Id + description: ID of the provider that owns this resource type: type: string - const: function_call_output + const: benchmark title: Type - default: function_call_output - id: - title: Id - type: string - status: - title: Status + description: The resource type, always benchmark + default: benchmark + dataset_id: type: string + title: Dataset Id + description: The ID of the dataset to use for the benchmark + scoring_functions: + items: + type: string + type: array + title: Scoring Functions + description: The scoring functions to use for the benchmark + metadata: + additionalProperties: true + type: object + title: Metadata + description: Metadata for this evaluation task type: object required: - - call_id - - output - title: OpenAIResponseInputFunctionToolCallOutput - description: This represents the output of a function call that gets passed back to the model. - OpenAIResponseInputMessageContentFile: - properties: - type: - type: string - const: input_file - title: Type - default: input_file - file_data: - title: File Data - type: string - file_id: - title: File Id - type: string - file_url: - title: File Url - type: string - filename: - title: Filename - type: string - type: object - title: OpenAIResponseInputMessageContentFile - description: File content for input messages in OpenAI response format. - OpenAIResponseInputMessageContentImage: + - identifier + - provider_id + - dataset_id + - scoring_functions + title: Benchmark + description: A benchmark resource for evaluating model performance. + BenchmarkConfig: properties: - detail: - anyOf: - - type: string - const: low - - type: string - const: high - - type: string - const: auto - title: Detail - default: auto - type: - type: string - const: input_image - title: Type - default: input_image - file_id: - title: File Id - type: string - image_url: - title: Image Url - type: string + eval_candidate: + oneOf: + - $ref: '#/components/schemas/ModelCandidate' + - $ref: '#/components/schemas/AgentCandidate' + title: Eval Candidate + description: The candidate to evaluate. + discriminator: + propertyName: type + mapping: + agent: '#/components/schemas/AgentCandidate' + model: '#/components/schemas/ModelCandidate' + scoring_params: + additionalProperties: + oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + type: object + title: Scoring Params + description: Map between scoring function id and parameters for each scoring function you want to run. + num_examples: + anyOf: + - type: integer + - type: 'null' + title: Num Examples + description: The number of examples to evaluate. If not provided, all examples in the dataset will be evaluated. type: object - title: OpenAIResponseInputMessageContentImage - description: Image content for input messages in OpenAI response format. - OpenAIResponseInputMessageContentText: + required: + - eval_candidate + title: BenchmarkConfig + description: A benchmark configuration for evaluation. + Body_openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post: properties: - text: - type: string - title: Text - type: + file_id: type: string - const: input_text - title: Type - default: input_text + title: File Id + description: The ID of the file to attach to the vector store. + attributes: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Attributes + description: The key-value attributes stored with the file, which can be used for filtering. + chunking_strategy: + anyOf: + - oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + - type: 'null' + title: Chunking Strategy + description: The chunking strategy to use for the file. type: object required: - - text - title: OpenAIResponseInputMessageContentText - description: Text content for input messages in OpenAI response format. - OpenAIResponseInputToolFileSearch: + - file_id + title: Body_openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post + Body_openai_search_vector_store_v1_vector_stores__vector_store_id__search_post: properties: - type: - type: string - const: file_search - title: Type - default: file_search - vector_store_ids: - items: - type: string - type: array - title: Vector Store Ids + query: + anyOf: + - type: string + - items: + type: string + type: array + title: Query + description: The query string or array for performing the search. filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' title: Filters - additionalProperties: true - type: object + description: Filters based on file attributes to narrow the search results. max_num_results: + anyOf: + - type: integer + maximum: 50.0 + minimum: 1.0 + - type: 'null' title: Max Num Results + description: Maximum number of results to return (1 to 50 inclusive, default 10). default: 10 - type: integer - maximum: 50.0 - minimum: 1.0 ranking_options: - $ref: '#/components/schemas/SearchRankingOptions' + anyOf: + - $ref: '#/components/schemas/SearchRankingOptions' + - type: 'null' + description: Ranking options for fine-tuning the search results. + rewrite_query: + type: boolean + title: Rewrite Query + description: Whether to rewrite the natural language query for vector search (default false). + default: false + search_mode: + anyOf: + - type: string + - type: 'null' + title: Search Mode + description: The search mode to use - 'keyword', 'vector', or 'hybrid' (default 'vector'). + default: vector type: object required: - - vector_store_ids - title: OpenAIResponseInputToolFileSearch - description: File search tool configuration for OpenAI response inputs. - OpenAIResponseInputToolFunction: + - query + title: Body_openai_search_vector_store_v1_vector_stores__vector_store_id__search_post + Body_openai_upload_file_v1_files_post: properties: - type: - type: string - const: function - title: Type - default: function - name: - type: string - title: Name - description: - title: Description + file: type: string - parameters: - title: Parameters - additionalProperties: true - type: object - strict: - title: Strict - type: boolean + format: binary + title: File + description: The File object to be uploaded. + purpose: + $ref: '#/components/schemas/OpenAIFilePurpose' + description: The intended purpose of the uploaded file. + expires_after: + anyOf: + - $ref: '#/components/schemas/ExpiresAfter' + - type: 'null' + description: Optional form values describing expiration for the file. type: object required: - - name - - parameters - title: OpenAIResponseInputToolFunction - description: Function tool configuration for OpenAI response inputs. - OpenAIResponseInputToolMCP: + - file + - purpose + title: Body_openai_upload_file_v1_files_post + Body_rag_tool_insert_v1_tool_runtime_rag_tool_insert_post: properties: - type: - type: string - const: mcp - title: Type - default: mcp - server_label: - type: string - title: Server Label - server_url: + documents: + items: + $ref: '#/components/schemas/RAGDocument' + type: array + title: Documents + description: List of documents to index in the RAG system. + vector_store_id: type: string - title: Server Url - headers: - title: Headers - additionalProperties: true - type: object - require_approval: + title: Vector Store Id + description: ID of the vector database to store the document embeddings. + chunk_size_in_tokens: + type: integer + title: Chunk Size In Tokens + description: Size in tokens for document chunking during indexing. + default: 512 + type: object + required: + - documents + - vector_store_id + title: Body_rag_tool_insert_v1_tool_runtime_rag_tool_insert_post + Body_rag_tool_query_v1_tool_runtime_rag_tool_query_post: + properties: + content: anyOf: - type: string - const: always - - type: string - const: never - - $ref: '#/components/schemas/ApprovalFilter' - title: Require Approval - default: never - allowed_tools: - anyOf: + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' - items: - type: string + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' type: array - - $ref: '#/components/schemas/AllowedToolsFilter' - title: Allowed Tools + title: Content + description: The query content to search for in the indexed documents. + vector_store_ids: + items: + type: string + type: array + title: Vector Store Ids + description: List of vector database IDs to search within. + query_config: + anyOf: + - $ref: '#/components/schemas/RAGQueryConfig' + - type: 'null' + description: Configuration parameters for the query operation. type: object required: - - server_label - - server_url - title: OpenAIResponseInputToolMCP - description: Model Context Protocol (MCP) tool configuration for OpenAI response inputs. - OpenAIResponseInputToolWebSearch: + - content + - vector_store_ids + title: Body_rag_tool_query_v1_tool_runtime_rag_tool_query_post + Body_rerank_v1alpha_inference_rerank_post: properties: - type: + model: + type: string + title: Model + description: The identifier of the reranking model to use. + query: anyOf: - type: string - const: web_search - - type: string - const: web_search_preview - - type: string - const: web_search_preview_2025_03_11 - title: Type - default: web_search - search_context_size: - title: Search Context Size - default: medium - type: string - pattern: ^low|medium|high$ + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + title: Query + description: The search query to rank items against. + items: + items: + anyOf: + - type: string + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + type: array + title: Items + description: List of items to rerank. + max_num_results: + anyOf: + - type: integer + - type: 'null' + title: Max Num Results + description: 'Maximum number of results to return. Default: returns all.' type: object - title: OpenAIResponseInputToolWebSearch - description: Web search tool configuration for OpenAI response inputs. - OpenAIResponseMCPApprovalRequest: + required: + - model + - query + - items + title: Body_rerank_v1alpha_inference_rerank_post + BooleanType: properties: - arguments: - type: string - title: Arguments - id: - type: string - title: Id - name: - type: string - title: Name - server_label: + type: type: string - title: Server Label + const: boolean + title: Type + default: boolean + type: object + title: BooleanType + description: "Parameter type for boolean values.\n\n:param type: Discriminator type. Always \"boolean\"" + BuiltinTool: + type: string + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + ChatCompletionInputType: + properties: type: type: string - const: mcp_approval_request + const: chat_completion_input title: Type - default: mcp_approval_request + default: chat_completion_input type: object - required: - - arguments - - id - - name - - server_label - title: OpenAIResponseMCPApprovalRequest - description: A request for human approval of a tool invocation. - OpenAIResponseMCPApprovalResponse: + title: ChatCompletionInputType + description: "Parameter type for chat completion input.\n\n:param type: Discriminator type. Always \"chat_completion_input\"" + Checkpoint: properties: - approval_request_id: + identifier: type: string - title: Approval Request Id - approve: - type: boolean - title: Approve - type: + title: Identifier + description: Unique identifier for the checkpoint. + created_at: type: string - const: mcp_approval_response - title: Type - default: mcp_approval_response - id: - title: Id + format: date-time + title: Created At + description: Timestamp when the checkpoint was created. + epoch: + type: integer + title: Epoch + description: Training epoch when the checkpoint was saved. + post_training_job_id: type: string - reason: - title: Reason + title: Post Training Job Id + description: Identifier of the training job that created this checkpoint. + path: type: string + title: Path + description: File system path where the checkpoint is stored. + training_metrics: + anyOf: + - $ref: '#/components/schemas/PostTrainingMetric' + - type: 'null' + description: Training metrics associated with this checkpoint. type: object required: - - approval_request_id - - approve - title: OpenAIResponseMCPApprovalResponse - description: A response to an MCP approval request. - OpenAIResponseMessage-Input: + - identifier + - created_at + - epoch + - post_training_job_id + - path + - training_metrics + title: Checkpoint + description: Checkpoint created during training runs. + Chunk-Input: properties: content: anyOf: - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' - items: oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' - input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' - input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + chunk_id: + type: string + title: Chunk Id + metadata: + additionalProperties: true + type: object + title: Metadata + embedding: + anyOf: + - items: + type: number type: array + - type: 'null' + title: Embedding + chunk_metadata: + anyOf: + - $ref: '#/components/schemas/ChunkMetadata' + - type: 'null' + type: object + required: + - content + - chunk_id + title: Chunk + description: A chunk of content that can be inserted into a vector database. + Chunk-Output: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' - items: oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' type: array title: Content - role: + chunk_id: + type: string + title: Chunk Id + metadata: + additionalProperties: true + type: object + title: Metadata + embedding: + anyOf: + - items: + type: number + type: array + - type: 'null' + title: Embedding + chunk_metadata: + anyOf: + - $ref: '#/components/schemas/ChunkMetadata' + - type: 'null' + type: object + required: + - content + - chunk_id + title: Chunk + description: A chunk of content that can be inserted into a vector database. + ChunkMetadata: + properties: + chunk_id: anyOf: - type: string - const: system + - type: 'null' + title: Chunk Id + document_id: + anyOf: - type: string - const: developer + - type: 'null' + title: Document Id + source: + anyOf: - type: string - const: user + - type: 'null' + title: Source + created_timestamp: + anyOf: + - type: integer + - type: 'null' + title: Created Timestamp + updated_timestamp: + anyOf: + - type: integer + - type: 'null' + title: Updated Timestamp + chunk_window: + anyOf: - type: string - const: assistant - title: Role + - type: 'null' + title: Chunk Window + chunk_tokenizer: + anyOf: + - type: string + - type: 'null' + title: Chunk Tokenizer + chunk_embedding_model: + anyOf: + - type: string + - type: 'null' + title: Chunk Embedding Model + chunk_embedding_dimension: + anyOf: + - type: integer + - type: 'null' + title: Chunk Embedding Dimension + content_token_count: + anyOf: + - type: integer + - type: 'null' + title: Content Token Count + metadata_token_count: + anyOf: + - type: integer + - type: 'null' + title: Metadata Token Count + type: object + title: ChunkMetadata + description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." + CompletionInputType: + properties: type: type: string - const: message + const: completion_input title: Type - default: message - id: - title: Id - type: string - status: - title: Status - type: string + default: completion_input type: object - required: - - content - - role - title: OpenAIResponseMessage - description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." - OpenAIResponseMessage-Output: + title: CompletionInputType + description: "Parameter type for completion input.\n\n:param type: Discriminator type. Always \"completion_input\"" + CompletionMessage-Output: properties: + role: + type: string + const: assistant + title: Role + default: assistant content: anyOf: - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' - items: oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' - input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' - input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' + title: Tool Calls + type: object + required: + - content + - stop_reason + title: CompletionMessage + description: "A message containing the model's (assistant) response in a chat conversation.\n\n- `StopReason.end_of_turn`: The model finished generating the entire response.\n- `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n- `StopReason.out_of_tokens`: The model ran out of token budget." + Conversation: + properties: + id: + type: string + title: Id + description: The unique ID of the conversation. + object: + type: string + const: conversation + title: Object + description: The object type, which is always conversation. + default: conversation + created_at: + type: integer + title: Created At + description: The time at which the conversation was created, measured in seconds since the Unix epoch. + metadata: + anyOf: + - additionalProperties: + type: string + type: object + - type: 'null' + title: Metadata + description: Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. + items: + anyOf: + - items: + additionalProperties: true + type: object type: array + - type: 'null' + title: Items + description: Initial items to include in the conversation context. You may add up to 20 items at a time. + type: object + required: + - id + - created_at + title: Conversation + description: OpenAI-compatible conversation object. + ConversationCreateRequest: + properties: + items: + anyOf: - items: oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' discriminator: propertyName: type mapping: - output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Input' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' type: array - title: Content - role: + maxItems: 20 + - type: 'null' + title: Items + description: Initial items to include in the conversation context. You may add up to 20 items at a time. + default: [] + metadata: anyOf: - - type: string - const: system - - type: string - const: developer - - type: string - const: user - - type: string - const: assistant - title: Role - type: - type: string - const: message - title: Type - default: message - id: - title: Id - type: string - status: - title: Status - type: string + - additionalProperties: + type: string + type: object + maxProperties: 16 + - type: 'null' + title: Metadata + description: Set of 16 key-value pairs that can be attached to an object. Useful for storing additional information + default: {} type: object - required: - - content - - role - title: OpenAIResponseMessage - description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." - OpenAIResponseObject: + title: ConversationCreateRequest + description: Request body for creating a conversation. + ConversationDeletedResource: properties: - created_at: - type: integer - title: Created At - error: - $ref: '#/components/schemas/OpenAIResponseError' id: type: string title: Id - model: - type: string - title: Model + description: The deleted conversation identifier object: type: string - const: response title: Object - default: response - output: + description: Object type + default: conversation.deleted + deleted: + type: boolean + title: Deleted + description: Whether the object was deleted + default: true + type: object + required: + - id + title: ConversationDeletedResource + description: Response for deleted conversation. + ConversationItemCreateRequest: + properties: + items: items: oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' discriminator: propertyName: type mapping: file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - message: '#/components/schemas/OpenAIResponseMessage-Output' + message: '#/components/schemas/OpenAIResponseMessage-Input' web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' type: array - title: Output - parallel_tool_calls: - type: boolean - title: Parallel Tool Calls - default: false - previous_response_id: - title: Previous Response Id - type: string - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - status: - type: string - title: Status - temperature: - title: Temperature - type: number - text: - $ref: '#/components/schemas/OpenAIResponseText' - default: - format: - type: text - top_p: - title: Top P - type: number - tools: - title: Tools - items: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseToolMCP' - discriminator: - propertyName: type - mapping: - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseToolMCP' - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' - web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' - type: array - truncation: - title: Truncation + maxItems: 20 + title: Items + description: Items to include in the conversation context. You may add up to 20 items at a time. + type: object + required: + - items + title: ConversationItemCreateRequest + description: Request body for creating conversation items. + ConversationItemDeletedResource: + properties: + id: type: string - usage: - $ref: '#/components/schemas/OpenAIResponseUsage' - instructions: - title: Instructions + title: Id + description: The deleted item identifier + object: type: string + title: Object + description: Object type + default: conversation.item.deleted + deleted: + type: boolean + title: Deleted + description: Whether the object was deleted + default: true type: object required: - - created_at - id - - model - - output - - status - title: OpenAIResponseObject - description: Complete OpenAI response object containing generation results and metadata. - OpenAIResponseOutputMessageContentOutputText: + title: ConversationItemDeletedResource + description: Response for deleted conversation item. + ConversationItemInclude: + type: string + enum: + - web_search_call.action.sources + - code_interpreter_call.outputs + - computer_call_output.output.image_url + - file_search_call.results + - message.input_image.image_url + - message.output_text.logprobs + - reasoning.encrypted_content + title: ConversationItemInclude + description: Specify additional output data to include in the model response. + ConversationItemList: properties: - text: - type: string - title: Text - type: + object: type: string - const: output_text - title: Type - default: output_text - annotations: + title: Object + description: Object type + default: list + data: items: oneOf: - - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' discriminator: propertyName: type mapping: - container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' - url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' type: array - title: Annotations + title: Data + description: List of conversation items + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + description: The ID of the first item in the list + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + description: The ID of the last item in the list + has_more: + type: boolean + title: Has More + description: Whether there are more items available + default: false type: object required: - - text - title: OpenAIResponseOutputMessageContentOutputText - OpenAIResponseOutputMessageFileSearchToolCall: + - data + title: ConversationItemList + description: List of conversation items with pagination. + ConversationUpdateRequest: properties: - id: - type: string - title: Id - queries: - items: + metadata: + additionalProperties: type: string - type: array - title: Queries - status: - type: string - title: Status - type: - type: string - const: file_search_call - title: Type - default: file_search_call - results: - title: Results - items: - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' - type: array - type: object - required: - - id - - queries - - status - title: OpenAIResponseOutputMessageFileSearchToolCall - description: File search tool call output message for OpenAI responses. - OpenAIResponseOutputMessageFileSearchToolCallResults: - properties: - attributes: - additionalProperties: true - type: object - title: Attributes - file_id: - type: string - title: File Id - filename: - type: string - title: Filename - score: - type: number - title: Score - text: - type: string - title: Text + type: object + title: Metadata + description: Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. type: object required: - - attributes - - file_id - - filename - - score - - text - title: OpenAIResponseOutputMessageFileSearchToolCallResults - description: Search results returned by the file search operation. - OpenAIResponseOutputMessageFunctionToolCall: + - metadata + title: ConversationUpdateRequest + description: Request body for updating a conversation. + CreateAgentSessionRequest: properties: - call_id: - type: string - title: Call Id - name: - type: string - title: Name - arguments: - type: string - title: Arguments - type: - type: string - const: function_call - title: Type - default: function_call - id: - title: Id + agent_id: type: string - status: - title: Status + title: Agent Id + description: The ID of the agent to create the session for + session_name: type: string + title: Session Name + description: The name of the session to create type: object required: - - call_id - - name - - arguments - title: OpenAIResponseOutputMessageFunctionToolCall - description: Function tool call output message for OpenAI responses. - OpenAIResponseOutputMessageMCPCall: + - agent_id + - session_name + title: CreateAgentSessionRequest + description: Request to create a new session for an agent. + CreateBatchRequest: properties: - id: - type: string - title: Id - type: + input_file_id: type: string - const: mcp_call - title: Type - default: mcp_call - arguments: + title: Input File Id + description: The ID of an uploaded file containing requests for the batch. + endpoint: type: string - title: Arguments - name: + title: Endpoint + description: The endpoint to be used for all requests in the batch. + completion_window: type: string - title: Name - server_label: + const: 24h + title: Completion Window + description: The time window within which the batch should be processed. + metadata: + anyOf: + - additionalProperties: + type: string + type: object + - type: 'null' + title: Metadata + description: Optional metadata for the batch. + idempotency_key: + anyOf: + - type: string + - type: 'null' + title: Idempotency Key + description: Optional idempotency key. When provided, enables idempotent behavior. + type: object + required: + - input_file_id + - endpoint + - completion_window + title: CreateBatchRequest + description: Request model for creating a batch. + CreateOpenAIResponseRequest: + properties: + input: + anyOf: + - type: string + - items: + anyOf: + - oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Input' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + type: array + title: Input + description: Input message(s) to create the response + model: type: string - title: Server Label - error: - title: Error + title: Model + description: The underlying LLM used for completions + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + description: Prompt object with ID, version, and variables + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + description: System instructions + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + description: If specified, the new response will be a continuation of the previous response + conversation: + anyOf: + - type: string + - type: 'null' + title: Conversation + description: The ID of a conversation to add the response to. Must begin with 'conv_' + store: + type: boolean + title: Store + description: Whether to store the response + default: true + stream: + type: boolean + title: Stream + description: Whether to stream the response + default: false + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Sampling temperature + text: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseText' + - type: 'null' + description: Text generation parameters + tools: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseInputToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + type: array + - type: 'null' + title: Tools + description: Tools to make available + include: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Include + description: Additional fields to include in the response + max_infer_iters: + type: integer + title: Max Infer Iters + description: Maximum number of inference iterations (extension to the OpenAI API) + default: 10 + guardrails: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/ResponseGuardrailSpec' + type: array + - type: 'null' + title: Guardrails + description: List of guardrails to apply during response generation + type: object + required: + - input + - model + title: CreateOpenAIResponseRequest + description: Request to create a model response. + CreatePromptRequest: + properties: + prompt: type: string - output: - title: Output + title: Prompt + description: The prompt text content with variable placeholders. + variables: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Variables + description: List of variable names that can be used in the prompt template. + type: object + required: + - prompt + title: CreatePromptRequest + description: Request model for creating a new prompt. + DPOAlignmentConfig: + properties: + beta: + type: number + title: Beta + loss_type: + $ref: '#/components/schemas/DPOLossType' + default: sigmoid + type: object + required: + - beta + title: DPOAlignmentConfig + description: Configuration for Direct Preference Optimization (DPO) alignment. + DPOLossType: + type: string + enum: + - sigmoid + - hinge + - ipo + - kto_pair + title: DPOLossType + DataConfig: + properties: + dataset_id: type: string + title: Dataset Id + batch_size: + type: integer + title: Batch Size + shuffle: + type: boolean + title: Shuffle + data_format: + $ref: '#/components/schemas/DatasetFormat' + validation_dataset_id: + anyOf: + - type: string + - type: 'null' + title: Validation Dataset Id + packed: + anyOf: + - type: boolean + - type: 'null' + title: Packed + default: false + train_on_input: + anyOf: + - type: boolean + - type: 'null' + title: Train On Input + default: false type: object required: - - id - - arguments - - name - - server_label - title: OpenAIResponseOutputMessageMCPCall - description: Model Context Protocol (MCP) call output message for OpenAI responses. - OpenAIResponseOutputMessageMCPListTools: + - dataset_id + - batch_size + - shuffle + - data_format + title: DataConfig + description: Configuration for training data and data loading. + Dataset: properties: - id: + identifier: type: string - title: Id + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource type: type: string - const: mcp_list_tools + const: dataset title: Type - default: mcp_list_tools - server_label: - type: string - title: Server Label - tools: - items: - $ref: '#/components/schemas/MCPListToolsTool' - type: array - title: Tools + description: Type of resource, always 'dataset' for datasets + default: dataset + purpose: + $ref: '#/components/schemas/DatasetPurpose' + source: + oneOf: + - $ref: '#/components/schemas/URIDataSource' + - $ref: '#/components/schemas/RowsDataSource' + title: Source + discriminator: + propertyName: type + mapping: + rows: '#/components/schemas/RowsDataSource' + uri: '#/components/schemas/URIDataSource' + metadata: + additionalProperties: true + type: object + title: Metadata + description: Any additional metadata for this dataset type: object required: - - id - - server_label - - tools - title: OpenAIResponseOutputMessageMCPListTools - description: MCP list tools output message containing available tools from an MCP server. - OpenAIResponseOutputMessageWebSearchToolCall: + - identifier + - provider_id + - purpose + - source + title: Dataset + description: Dataset resource for storing and accessing training or evaluation data. + DatasetFormat: + type: string + enum: + - instruct + - dialog + title: DatasetFormat + description: Format of the training dataset. + DatasetPurpose: + type: string + enum: + - post-training/messages + - eval/question-answer + - eval/messages-answer + title: DatasetPurpose + description: "Purpose of the dataset. Each purpose has a required input data schema.\n\n {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello, world!\"},\n {\"role\": \"assistant\", \"content\": \"Hello, world!\"},\n ]\n }\n {\n \"question\": \"What is the capital of France?\",\n \"answer\": \"Paris\"\n }\n {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello, my name is John Doe.\"},\n {\"role\": \"assistant\", \"content\": \"Hello, John Doe. How can I help you today?\"},\n {\"role\": \"user\", \"content\": \"What's my name?\"},\n ],\n \"answer\": \"John Doe\"\n }" + DefaultRAGQueryGeneratorConfig: properties: - id: - type: string - title: Id - status: - type: string - title: Status type: type: string - const: web_search_call + const: default title: Type - default: web_search_call + default: default + separator: + type: string + title: Separator + default: ' ' type: object - required: - - id - - status - title: OpenAIResponseOutputMessageWebSearchToolCall - description: Web search tool call output message for OpenAI responses. - OpenAIResponsePrompt: + title: DefaultRAGQueryGeneratorConfig + description: "Configuration for the default RAG query generator.\n\n:param type: Type of query generator, always 'default'\n:param separator: String separator used to join query terms" + Document: properties: - id: - type: string - title: Id - variables: - title: Variables - additionalProperties: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' - input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' - input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' - type: object - version: - title: Version + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + title: Content + description: The content of the document. + mime_type: type: string + title: Mime Type + description: The MIME type of the document. type: object required: - - id - title: OpenAIResponsePrompt - description: OpenAI compatible Prompt object that is used in OpenAI responses. - OpenAIResponseText: + - content + - mime_type + title: Document + description: A document to be used by an agent. + EfficiencyConfig: properties: - format: - $ref: '#/components/schemas/OpenAIResponseTextFormat' + enable_activation_checkpointing: + anyOf: + - type: boolean + - type: 'null' + title: Enable Activation Checkpointing + default: false + enable_activation_offloading: + anyOf: + - type: boolean + - type: 'null' + title: Enable Activation Offloading + default: false + memory_efficient_fsdp_wrap: + anyOf: + - type: boolean + - type: 'null' + title: Memory Efficient Fsdp Wrap + default: false + fsdp_cpu_offload: + anyOf: + - type: boolean + - type: 'null' + title: Fsdp Cpu Offload + default: false type: object - title: OpenAIResponseText - description: Text response configuration for OpenAI responses. - OpenAIResponseTextFormat: + title: EfficiencyConfig + description: Configuration for memory and compute efficiency optimizations. + Error: properties: - type: - anyOf: - - type: string - const: text - - type: string - const: json_schema - - type: string - const: json_object - title: Type - name: - title: Name + status: + type: integer + title: Status + description: HTTP status code + title: type: string - schema: - title: Schema - additionalProperties: true - type: object - description: - title: Description + title: Title + description: Error title, a short summary of the error which is invariant for an error type + detail: type: string - strict: - title: Strict - type: boolean + title: Detail + description: Error detail, a longer human-readable description of the error + instance: + anyOf: + - type: string + - type: 'null' + title: Instance + description: (Optional) A URL which can be used to retrieve more information about the specific occurrence of the error type: object - title: OpenAIResponseTextFormat - description: Configuration for Responses API text format. - OpenAIResponseToolMCP: + required: + - status + - title + - detail + title: Error + description: Error response from the API. Roughly follows RFC 7807. + Errors: properties: - type: - type: string - const: mcp - title: Type - default: mcp - server_label: - type: string - title: Server Label - allowed_tools: + data: anyOf: - items: - type: string + $ref: '#/components/schemas/BatchError' type: array - - $ref: '#/components/schemas/AllowedToolsFilter' - title: Allowed Tools + - type: 'null' + title: Data + object: + anyOf: + - type: string + - type: 'null' + title: Object + additionalProperties: true + type: object + title: Errors + EvaluateResponse: + properties: + generations: + items: + additionalProperties: true + type: object + type: array + title: Generations + description: The generations from the evaluation. + scores: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' + type: object + title: Scores + description: The scores from the evaluation. Each key in the dict is a scoring function name. type: object required: - - server_label - title: OpenAIResponseToolMCP - description: Model Context Protocol (MCP) tool configuration for OpenAI response object. - OpenAIResponseUsage: + - generations + - scores + title: EvaluateResponse + description: The response from an evaluation. + EvaluateRowsRequest: properties: - input_tokens: - type: integer - title: Input Tokens - output_tokens: - type: integer - title: Output Tokens - total_tokens: - type: integer - title: Total Tokens - input_tokens_details: - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' - output_tokens_details: - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + input_rows: + items: + additionalProperties: true + type: object + type: array + title: Input Rows + description: The rows to evaluate. + scoring_functions: + items: + type: string + type: array + title: Scoring Functions + description: The scoring functions to use for the evaluation. + benchmark_config: + $ref: '#/components/schemas/BenchmarkConfig' + description: The configuration for the benchmark. type: object required: - - input_tokens - - output_tokens - - total_tokens - title: OpenAIResponseUsage - description: Usage information for OpenAI response. - OpenAIResponseUsageInputTokensDetails: + - input_rows + - scoring_functions + - benchmark_config + title: EvaluateRowsRequest + description: Request model for evaluating rows. + ExpiresAfter: properties: - cached_tokens: - title: Cached Tokens + anchor: + type: string + const: created_at + title: Anchor + description: Anchor must be 'created_at'. + seconds: type: integer + maximum: 2592000.0 + minimum: 3600.0 + title: Seconds + description: Seconds between 3600 and 2592000 (1 hour to 30 days). type: object - title: OpenAIResponseUsageInputTokensDetails - description: Token details for input tokens in OpenAI response usage. - OpenAIResponseUsageOutputTokensDetails: + required: + - anchor + - seconds + title: ExpiresAfter + description: Control expiration of uploaded files. + GrammarResponseFormat: + properties: + type: + type: string + const: grammar + title: Type + default: grammar + bnf: + additionalProperties: true + type: object + title: Bnf + type: object + required: + - bnf + title: GrammarResponseFormat + description: Configuration for grammar-guided response generation. + GreedySamplingStrategy: + properties: + type: + type: string + const: greedy + title: Type + default: greedy + type: object + title: GreedySamplingStrategy + description: Greedy sampling strategy that selects the highest probability token at each step. + HealthInfo: properties: - reasoning_tokens: - title: Reasoning Tokens - type: integer + status: + $ref: '#/components/schemas/HealthStatus' + description: Current health status of the service type: object - title: OpenAIResponseUsageOutputTokensDetails - description: Token details for output tokens in OpenAI response usage. - OpenAISystemMessageParam: + required: + - status + title: HealthInfo + description: Health status information for the service. + HealthStatus: + type: string + enum: + - OK + - Error + - Not Implemented + title: HealthStatus + ImageContentItem-Input: properties: - role: - type: string - const: system - title: Role - default: system - content: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - name: - title: Name + type: type: string + const: image + title: Type + default: image + image: + $ref: '#/components/schemas/_URLOrData' type: object required: - - content - title: OpenAISystemMessageParam - description: A system message providing instructions or context to the model. - OpenAITokenLogProb: + - image + title: ImageContentItem + description: A image content item. + ImageContentItem-Output: properties: - token: + type: type: string - title: Token - bytes: - title: Bytes - items: - type: integer - type: array - logprob: - type: number - title: Logprob - top_logprobs: - items: - $ref: '#/components/schemas/OpenAITopLogProb' - type: array - title: Top Logprobs + const: image + title: Type + default: image + image: + $ref: '#/components/schemas/_URLOrData' type: object required: - - token - - logprob - - top_logprobs - title: OpenAITokenLogProb - description: The log probability for a token from an OpenAI-compatible chat completion response. - OpenAIToolMessageParam: + - image + title: ImageContentItem + description: A image content item. + InferenceStep-Output: properties: - role: + turn_id: type: string - const: tool - title: Role - default: tool - tool_call_id: + title: Turn Id + description: The ID of the turn. + step_id: type: string - title: Tool Call Id - content: + title: Step Id + description: The ID of the step. + started_at: anyOf: - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content + format: date-time + - type: 'null' + title: Started At + description: The time the step started. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: The time the step completed. + step_type: + type: string + const: inference + title: Step Type + default: inference + model_response: + $ref: '#/components/schemas/CompletionMessage-Output' + description: The response from the LLM. type: object required: - - tool_call_id - - content - title: OpenAIToolMessageParam - description: A message representing the result of a tool invocation in an OpenAI-compatible chat completion request. - OpenAITopLogProb: + - turn_id + - step_id + - model_response + title: InferenceStep + description: An inference step in an agent turn. + InputTokensDetails: properties: - token: - type: string - title: Token - bytes: - title: Bytes - items: - type: integer - type: array - logprob: - type: number - title: Logprob + cached_tokens: + type: integer + title: Cached Tokens + additionalProperties: true type: object required: - - token - - logprob - title: OpenAITopLogProb - description: The top log probability for a token from an OpenAI-compatible chat completion response. - OpenAIUserMessageParam-Input: + - cached_tokens + title: InputTokensDetails + InsertChunksRequest: properties: - role: + vector_store_id: type: string - const: user - title: Role - default: user - content: + title: Vector Store Id + description: The identifier of the vector database to insert the chunks into. + chunks: + items: + $ref: '#/components/schemas/Chunk-Input' + type: array + title: Chunks + description: The chunks to insert. + ttl_seconds: anyOf: - - type: string - - items: - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - - $ref: '#/components/schemas/OpenAIFile' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/OpenAIFile' - image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - name: - title: Name - type: string + - type: integer + - type: 'null' + title: Ttl Seconds + description: The time to live of the chunks. type: object required: - - content - title: OpenAIUserMessageParam - description: A message from the user in an OpenAI-compatible chat completion request. - OpenAIUserMessageParam-Output: + - vector_store_id + - chunks + title: InsertChunksRequest + description: Request to insert chunks into a vector database. + InvokeToolRequest: properties: - role: - type: string - const: user - title: Role - default: user - content: - anyOf: - - type: string - - items: - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - - $ref: '#/components/schemas/OpenAIFile' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/OpenAIFile' - image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - name: - title: Name + tool_name: type: string + title: Tool Name + description: The name of the tool to invoke + kwargs: + additionalProperties: true + type: object + title: Kwargs + description: A dictionary of arguments to pass to the tool type: object required: - - content - title: OpenAIUserMessageParam - description: A message from the user in an OpenAI-compatible chat completion request. - OptimizerConfig: + - tool_name + - kwargs + title: InvokeToolRequest + description: Request model for invoking a tool. + Job: properties: - optimizer_type: - $ref: '#/components/schemas/OptimizerType' - lr: - type: number - title: Lr - weight_decay: - type: number - title: Weight Decay - num_warmup_steps: - type: integer - title: Num Warmup Steps + job_id: + type: string + title: Job Id + status: + $ref: '#/components/schemas/JobStatus' type: object required: - - optimizer_type - - lr - - weight_decay - - num_warmup_steps - title: OptimizerConfig - description: Configuration parameters for the optimization algorithm. - OptimizerType: - type: string - enum: - - adam - - adamw - - sgd - title: OptimizerType - description: Available optimizer algorithms for training. - Order: + - job_id + - status + title: Job + description: A job execution instance with status tracking. + JobStatus: type: string enum: - - asc - - desc - title: Order - description: Sort order for paginated responses. - OutputTokensDetails: + - completed + - in_progress + - failed + - scheduled + - cancelled + title: JobStatus + description: "Status of a job execution.\n:cvar completed: Job has finished successfully\n:cvar in_progress: Job is currently running\n:cvar failed: Job has failed during execution\n:cvar scheduled: Job is scheduled but not yet started\n:cvar cancelled: Job was cancelled before completion" + JsonSchemaResponseFormat: properties: - reasoning_tokens: - type: integer - title: Reasoning Tokens - additionalProperties: true + type: + type: string + const: json_schema + title: Type + default: json_schema + json_schema: + additionalProperties: true + type: object + title: Json Schema type: object required: - - reasoning_tokens - title: OutputTokensDetails - PostTrainingJob: + - json_schema + title: JsonSchemaResponseFormat + description: Configuration for JSON schema-guided response generation. + JsonType: properties: - job_uuid: + type: type: string - title: Job Uuid + const: json + title: Type + default: json type: object - required: - - job_uuid - title: PostTrainingJob - Prompt: + title: JsonType + description: "Parameter type for JSON values.\n\n:param type: Discriminator type. Always \"json\"" + LLMAsJudgeScoringFnParams: properties: - prompt: - title: Prompt - description: The system prompt with variable placeholders + type: type: string - version: - type: integer - minimum: 1.0 - title: Version - description: Version (integer starting at 1, incremented on save) - prompt_id: + const: llm_as_judge + title: Type + default: llm_as_judge + judge_model: type: string - title: Prompt Id - description: Unique identifier in format 'pmpt_<48-digit-hash>' - variables: + title: Judge Model + prompt_template: + anyOf: + - type: string + - type: 'null' + title: Prompt Template + judge_score_regexes: items: type: string type: array - title: Variables - description: List of variable names that can be used in the prompt template - is_default: - type: boolean - title: Is Default - description: Boolean indicating whether this version is the default version - default: false + title: Judge Score Regexes + description: Regexes to extract the answer from generated response + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row type: object required: - - version - - prompt_id - title: Prompt - description: A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack. - ProviderInfo: + - judge_model + title: LLMAsJudgeScoringFnParams + description: Parameters for LLM-as-judge scoring function configuration. + LLMRAGQueryGeneratorConfig: properties: - api: + type: type: string - title: Api - provider_id: + const: llm + title: Type + default: llm + model: type: string - title: Provider Id - provider_type: + title: Model + template: type: string - title: Provider Type - config: - additionalProperties: true - type: object - title: Config - health: - additionalProperties: true - type: object - title: Health + title: Template type: object required: - - api - - provider_id - - provider_type - - config - - health - title: ProviderInfo - description: Information about a registered provider including its configuration and health status. - QueryChunksResponse: + - model + - template + title: LLMRAGQueryGeneratorConfig + description: "Configuration for the LLM-based RAG query generator.\n\n:param type: Type of query generator, always 'llm'\n:param model: Name of the language model to use for query generation\n:param template: Template string for formatting the query generation prompt" + ListBatchesResponse: properties: - chunks: + object: + type: string + const: list + title: Object + description: The object type, which is always 'list'. + default: list + data: items: - $ref: '#/components/schemas/Chunk-Output' + $ref: '#/components/schemas/Batch' type: array - title: Chunks - scores: + title: Data + description: List of batch objects. + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + description: ID of the first batch in the list. + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + description: ID of the last batch in the list. + has_more: + type: boolean + title: Has More + description: Whether there are more batches available. + default: false + type: object + required: + - data + title: ListBatchesResponse + description: Response containing a list of batch objects. + ListBenchmarksResponse: + properties: + data: items: - type: number + $ref: '#/components/schemas/Benchmark' type: array - title: Scores + title: Data + description: List of benchmark resources type: object required: - - chunks - - scores - title: QueryChunksResponse - description: Response from querying chunks in a vector database. - RAGQueryConfig: + - data + title: ListBenchmarksResponse + description: Response model for listing benchmarks. + ListDatasetsResponse: properties: - query_generator_config: - oneOf: - - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' - - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' - title: Query Generator Config - default: - type: default - separator: ' ' - discriminator: - propertyName: type - mapping: - default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' - llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' - max_tokens_in_context: - type: integer - title: Max Tokens In Context - default: 4096 - max_chunks: - type: integer - title: Max Chunks - default: 5 - chunk_template: + data: + items: + $ref: '#/components/schemas/Dataset' + type: array + title: Data + description: List of datasets + type: object + required: + - data + title: ListDatasetsResponse + description: Response from listing datasets. + ListModelsResponse: + properties: + data: + items: + $ref: '#/components/schemas/Model' + type: array + title: Data + description: List of model resources. + type: object + required: + - data + title: ListModelsResponse + description: Response model for listing models. + ListOpenAIChatCompletionResponse: + properties: + data: + items: + $ref: '#/components/schemas/OpenAICompletionWithInputMessages' + type: array + title: Data + has_more: + type: boolean + title: Has More + first_id: type: string - title: Chunk Template - default: "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n" - mode: - default: vector - $ref: '#/components/schemas/RAGSearchMode' - ranker: - title: Ranker - oneOf: - - $ref: '#/components/schemas/RRFRanker' - - $ref: '#/components/schemas/WeightedRanker' - discriminator: - propertyName: type - mapping: - rrf: '#/components/schemas/RRFRanker' - weighted: '#/components/schemas/WeightedRanker' + title: First Id + last_id: + type: string + title: Last Id + object: + type: string + const: list + title: Object + default: list type: object - title: RAGQueryConfig - description: Configuration for the RAG query generation. - RAGQueryResult: + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIChatCompletionResponse + description: Response from listing OpenAI-compatible chat completions. + ListOpenAIFileResponse: + properties: + data: + items: + $ref: '#/components/schemas/OpenAIFileObject' + type: array + title: Data + description: List of file objects. + has_more: + type: boolean + title: Has More + description: Whether there are more files available beyond this page. + first_id: + type: string + title: First Id + description: ID of the first file in the list for pagination. + last_id: + type: string + title: Last Id + description: ID of the last file in the list for pagination. + object: + type: string + const: list + title: Object + description: The object type, which is always 'list'. + default: list + type: object + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIFileResponse + description: Response for listing files in OpenAI Files API. + ListOpenAIResponseInputItem: properties: - content: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' + data: + items: + anyOf: + - oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - title: Content - metadata: - additionalProperties: true - type: object - title: Metadata - type: object - title: RAGQueryResult - description: Result of a RAG query containing retrieved content and metadata. - RAGSearchMode: - type: string - enum: - - vector - - keyword - - hybrid - title: RAGSearchMode - description: "Search modes for RAG query retrieval:\n- VECTOR: Uses vector similarity search for semantic matching\n- KEYWORD: Uses keyword-based search for exact matching\n- HYBRID: Combines both vector and keyword search for better results" - RRFRanker: - properties: - type: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + type: array + title: Data + description: List of input items + object: type: string - const: rrf - title: Type - default: rrf - impact_factor: - type: number - title: Impact Factor - default: 60.0 - minimum: 0.0 + const: list + title: Object + description: Object type identifier, always "list" + default: list type: object - title: RRFRanker - description: Reciprocal Rank Fusion (RRF) ranker configuration. - RegexParserScoringFnParams: + required: + - data + title: ListOpenAIResponseInputItem + description: "List container for OpenAI response input items.\n\n:param data: List of input items\n:param object: Object type identifier, always \"list\"" + ListOpenAIResponseObject: properties: - type: - type: string - const: regex_parser - title: Type - default: regex_parser - parsing_regexes: + data: items: - type: string + $ref: '#/components/schemas/OpenAIResponseObjectWithInput-Output' type: array - title: Parsing Regexes - description: Regex to extract the answer from generated response - aggregation_functions: + title: Data + description: List of response objects with their input context + has_more: + type: boolean + title: Has More + description: Whether there are more results available beyond this page + first_id: + type: string + title: First Id + description: Identifier of the first item in this page + last_id: + type: string + title: Last Id + description: Identifier of the last item in this page + object: + type: string + const: list + title: Object + description: Object type identifier, always "list" + default: list + type: object + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIResponseObject + description: "Paginated list of OpenAI response objects with navigation metadata.\n\n:param data: List of response objects with their input context\n:param has_more: Whether there are more results available beyond this page\n:param first_id: Identifier of the first item in this page\n:param last_id: Identifier of the last item in this page\n:param object: Object type identifier, always \"list\"" + ListPostTrainingJobsResponse: + properties: + data: items: - $ref: '#/components/schemas/AggregationFunctionType' + $ref: '#/components/schemas/PostTrainingJob' type: array - title: Aggregation Functions - description: Aggregation functions to apply to the scores of each row + title: Data + description: The list of training jobs type: object - title: RegexParserScoringFnParams - description: Parameters for regex parser scoring function configuration. - RerankData: + required: + - data + title: ListPostTrainingJobsResponse + ListPromptsResponse: properties: - index: - type: integer - title: Index - relevance_score: - type: number - title: Relevance Score + data: + items: + $ref: '#/components/schemas/Prompt' + type: array + title: Data + description: List of prompt resources. type: object required: - - index - - relevance_score - title: RerankData - description: A single rerank result from a reranking response. - RerankResponse: + - data + title: ListPromptsResponse + description: Response model to list prompts. + ListProvidersResponse: properties: data: items: - $ref: '#/components/schemas/RerankData' + $ref: '#/components/schemas/ProviderInfo' type: array title: Data + description: List of provider information objects type: object required: - data - title: RerankResponse - description: Response from a reranking request. - RouteInfo: + title: ListProvidersResponse + description: Response containing a list of all available providers. + ListRoutesResponse: properties: - route: - type: string - title: Route - method: - type: string - title: Method - provider_types: + data: items: - type: string + $ref: '#/components/schemas/RouteInfo' type: array - title: Provider Types + title: Data + description: List of available route information objects type: object required: - - route - - method - - provider_types - title: RouteInfo - description: Information about an API route including its path, method, and implementing providers. - RowsDataSource: + - data + title: ListRoutesResponse + description: Response containing a list of all available API routes. + ListScoringFunctionsResponse: properties: - type: - type: string - const: rows - title: Type - default: rows - rows: + data: items: - additionalProperties: true - type: object + $ref: '#/components/schemas/ScoringFn' type: array - title: Rows + title: Data + description: List of scoring function resources type: object required: - - rows - title: RowsDataSource - description: A dataset stored in rows. - RunShieldResponse: + - data + title: ListScoringFunctionsResponse + description: Response model for listing scoring functions. + ListShieldsResponse: properties: - violation: - $ref: '#/components/schemas/SafetyViolation' + data: + items: + $ref: '#/components/schemas/Shield' + type: array + title: Data + description: List of shield resources type: object - title: RunShieldResponse - description: Response from running a safety shield. - SafetyViolation: + required: + - data + title: ListShieldsResponse + description: Response model for listing shields. + ListToolDefsResponse: properties: - violation_level: - $ref: '#/components/schemas/ViolationLevel' - user_message: - title: User Message - type: string - metadata: - additionalProperties: true - type: object - title: Metadata + data: + items: + $ref: '#/components/schemas/ToolDef' + type: array + title: Data + description: List of tool definitions type: object required: - - violation_level - title: SafetyViolation - description: Details of a safety violation detected by content moderation. - SamplingParams: + - data + title: ListToolDefsResponse + description: Response containing a list of tool definitions. + ListToolGroupsResponse: properties: - strategy: - oneOf: - - $ref: '#/components/schemas/GreedySamplingStrategy' - - $ref: '#/components/schemas/TopPSamplingStrategy' - - $ref: '#/components/schemas/TopKSamplingStrategy' - title: Strategy - discriminator: - propertyName: type - mapping: - greedy: '#/components/schemas/GreedySamplingStrategy' - top_k: '#/components/schemas/TopKSamplingStrategy' - top_p: '#/components/schemas/TopPSamplingStrategy' - max_tokens: - title: Max Tokens - type: integer - repetition_penalty: - title: Repetition Penalty - default: 1.0 - type: number - stop: - title: Stop + data: + items: + $ref: '#/components/schemas/ToolGroup' + type: array + title: Data + description: List of tool groups + type: object + required: + - data + title: ListToolGroupsResponse + description: Response containing a list of tool groups. + LoraFinetuningConfig: + properties: + type: + type: string + const: LoRA + title: Type + default: LoRA + lora_attn_modules: items: type: string type: array + title: Lora Attn Modules + apply_lora_to_mlp: + type: boolean + title: Apply Lora To Mlp + apply_lora_to_output: + type: boolean + title: Apply Lora To Output + rank: + type: integer + title: Rank + alpha: + type: integer + title: Alpha + use_dora: + anyOf: + - type: boolean + - type: 'null' + title: Use Dora + default: false + quantize_base: + anyOf: + - type: boolean + - type: 'null' + title: Quantize Base + default: false type: object - title: SamplingParams - description: Sampling parameters. - ScoreBatchResponse: + required: + - lora_attn_modules + - apply_lora_to_mlp + - apply_lora_to_output + - rank + - alpha + title: LoraFinetuningConfig + description: Configuration for Low-Rank Adaptation (LoRA) fine-tuning. + MCPListToolsTool: properties: - dataset_id: - title: Dataset Id - type: string - results: - additionalProperties: - $ref: '#/components/schemas/ScoringResult' + input_schema: + additionalProperties: true type: object - title: Results + title: Input Schema + description: JSON schema defining the tool's input parameters + name: + type: string + title: Name + description: Name of the tool + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Description of what the tool does type: object required: - - results - title: ScoreBatchResponse - description: Response from batch scoring operations on datasets. - ScoreResponse: + - input_schema + - name + title: MCPListToolsTool + description: "Tool definition returned by MCP list tools operation.\n\n:param input_schema: JSON schema defining the tool's input parameters\n:param name: Name of the tool\n:param description: (Optional) Description of what the tool does" + MemoryRetrievalStep-Output: properties: - results: - additionalProperties: - $ref: '#/components/schemas/ScoringResult' - type: object - title: Results + turn_id: + type: string + title: Turn Id + description: The ID of the turn. + step_id: + type: string + title: Step Id + description: The ID of the step. + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At + description: The time the step started. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: The time the step completed. + step_type: + type: string + const: memory_retrieval + title: Step Type + default: memory_retrieval + vector_store_ids: + type: string + title: Vector Store Ids + description: The IDs of the vector databases to retrieve context from. + inserted_context: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Inserted Context + description: The context retrieved from the vector databases. type: object required: - - results - title: ScoreResponse - description: The response from scoring. - ScoringFn-Output: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + description: A memory retrieval step in an agent turn. + Model: properties: identifier: type: string title: Identifier description: Unique identifier for this resource in llama stack provider_resource_id: + anyOf: + - type: string + - type: 'null' title: Provider Resource Id description: Unique identifier for this resource in the provider - type: string provider_id: type: string title: Provider Id description: ID of the provider that owns this resource type: type: string - const: scoring_function + const: model title: Type - default: scoring_function - description: - title: Description - type: string + description: The resource type, always 'model' for model resources. + default: model metadata: additionalProperties: true type: object title: Metadata - description: Any additional metadata for this definition - return_type: - oneOf: - - $ref: '#/components/schemas/StringType' - - $ref: '#/components/schemas/NumberType' - - $ref: '#/components/schemas/BooleanType' - - $ref: '#/components/schemas/ArrayType' - - $ref: '#/components/schemas/ObjectType' - - $ref: '#/components/schemas/JsonType' - - $ref: '#/components/schemas/UnionType' - - $ref: '#/components/schemas/ChatCompletionInputType' - - $ref: '#/components/schemas/CompletionInputType' - - $ref: '#/components/schemas/AgentTurnInputType' - title: Return Type - description: The return type of the deterministic function - discriminator: - propertyName: type - mapping: - agent_turn_input: '#/components/schemas/AgentTurnInputType' - array: '#/components/schemas/ArrayType' - boolean: '#/components/schemas/BooleanType' - chat_completion_input: '#/components/schemas/ChatCompletionInputType' - completion_input: '#/components/schemas/CompletionInputType' - json: '#/components/schemas/JsonType' - number: '#/components/schemas/NumberType' - object: '#/components/schemas/ObjectType' - string: '#/components/schemas/StringType' - union: '#/components/schemas/UnionType' - params: - title: Params - description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval - oneOf: - - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - - $ref: '#/components/schemas/RegexParserScoringFnParams' - - $ref: '#/components/schemas/BasicScoringFnParams' - discriminator: - propertyName: type - mapping: - basic: '#/components/schemas/BasicScoringFnParams' - llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' - regex_parser: '#/components/schemas/RegexParserScoringFnParams' + description: Any additional metadata for this model. + model_type: + $ref: '#/components/schemas/ModelType' + description: The type of model (LLM or embedding model). + default: llm type: object required: - identifier - provider_id - - return_type - title: ScoringFn - description: A scoring function resource for evaluating model outputs. - ScoringResult: + title: Model + description: A model resource representing an AI model registered in Llama Stack. + ModelCandidate: properties: - score_rows: + type: + type: string + const: model + title: Type + description: The type of candidate. + default: model + model: + type: string + title: Model + description: The model ID to evaluate. + sampling_params: + $ref: '#/components/schemas/SamplingParams' + description: The sampling parameters for the model. + system_message: + anyOf: + - $ref: '#/components/schemas/SystemMessage' + - type: 'null' + description: The system message providing instructions or context to the model. + type: object + required: + - model + - sampling_params + title: ModelCandidate + description: A model candidate for evaluation. + ModelType: + type: string + enum: + - llm + - embedding + - rerank + title: ModelType + description: Enumeration of supported model types in Llama Stack. + ModerationObject: + properties: + id: + type: string + title: Id + description: The unique identifier for the moderation request. + model: + type: string + title: Model + description: The model used to generate the moderation results. + results: items: - additionalProperties: true - type: object + $ref: '#/components/schemas/ModerationObjectResults' type: array - title: Score Rows - aggregated_results: + title: Results + description: A list of moderation objects. + type: object + required: + - id + - model + - results + title: ModerationObject + description: A moderation object. + ModerationObjectResults: + properties: + flagged: + type: boolean + title: Flagged + description: Whether any of the below categories are flagged. + categories: + anyOf: + - additionalProperties: + type: boolean + type: object + - type: 'null' + title: Categories + description: A list of the categories, and whether they are flagged or not. + category_applied_input_types: + anyOf: + - additionalProperties: + items: + type: string + type: array + type: object + - type: 'null' + title: Category Applied Input Types + description: A list of the categories along with the input type(s) that the score applies to. + category_scores: + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Category Scores + description: A list of the categories along with their scores as predicted by model. + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + description: User message. + metadata: additionalProperties: true type: object - title: Aggregated Results + title: Metadata + description: Additional metadata. type: object required: - - score_rows - - aggregated_results - title: ScoringResult - description: A scoring result for a single row. - SearchRankingOptions: + - flagged + title: ModerationObjectResults + description: A moderation object. + NumberType: properties: - ranker: - title: Ranker + type: type: string - score_threshold: - title: Score Threshold - default: 0.0 - type: number + const: number + title: Type + default: number type: object - title: SearchRankingOptions - description: Options for ranking and filtering search results. - Shield: + title: NumberType + description: "Parameter type for numeric values.\n\n:param type: Discriminator type. Always \"number\"" + ObjectType: properties: - identifier: - type: string - title: Identifier - description: Unique identifier for this resource in llama stack - provider_resource_id: - title: Provider Resource Id - description: Unique identifier for this resource in the provider - type: string - provider_id: - type: string - title: Provider Id - description: ID of the provider that owns this resource type: type: string - const: shield + const: object title: Type - default: shield - params: - title: Params - additionalProperties: true - type: object + default: object type: object - required: - - identifier - - provider_id - title: Shield - description: A safety shield resource that can be used to check content. - ShieldCallStep-Output: + title: ObjectType + description: "Parameter type for object values.\n\n:param type: Discriminator type. Always \"object\"" + OpenAIAssistantMessageParam-Input: properties: - turn_id: - type: string - title: Turn Id - step_id: - type: string - title: Step Id - started_at: - title: Started At + role: type: string - format: date-time - completed_at: - title: Completed At + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + - type: 'null' + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + title: Tool Calls + type: object + title: OpenAIAssistantMessageParam + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. + OpenAIAssistantMessageParam-Output: + properties: + role: type: string - format: date-time - step_type: + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + - type: 'null' + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + title: Tool Calls + type: object + title: OpenAIAssistantMessageParam + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. + OpenAIChatCompletionContentPartImageParam: + properties: + type: type: string - const: shield_call - title: Step Type - default: shield_call - violation: - $ref: '#/components/schemas/SafetyViolation' + const: image_url + title: Type + default: image_url + image_url: + $ref: '#/components/schemas/OpenAIImageURL' type: object required: - - turn_id - - step_id - - violation - title: ShieldCallStep - description: A shield call step in an agent turn. - StopReason: - type: string - enum: - - end_of_turn - - end_of_message - - out_of_tokens - title: StopReason - StringType: + - image_url + title: OpenAIChatCompletionContentPartImageParam + description: Image content part for OpenAI-compatible chat completion messages. + OpenAIChatCompletionContentPartTextParam: properties: type: type: string - const: string + const: text title: Type - default: string + default: text + text: + type: string + title: Text type: object - title: StringType - description: Parameter type for string values. - SystemMessage: + required: + - text + title: OpenAIChatCompletionContentPartTextParam + description: Text content part for OpenAI-compatible chat completion messages. + OpenAIChatCompletionRequestWithExtraBody: properties: - role: + model: type: string - const: system - title: Role - default: system - content: + title: Model + messages: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Input' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Input' + type: array + minItems: 1 + title: Messages + frequency_penalty: + anyOf: + - type: number + - type: 'null' + title: Frequency Penalty + function_call: anyOf: - type: string + - additionalProperties: true + type: object + - type: 'null' + title: Function Call + functions: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Functions + logit_bias: + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Logit Bias + logprobs: + anyOf: + - type: boolean + - type: 'null' + title: Logprobs + max_completion_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Completion Tokens + max_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Tokens + n: + anyOf: + - type: integer + - type: 'null' + title: N + parallel_tool_calls: + anyOf: + - type: boolean + - type: 'null' + title: Parallel Tool Calls + presence_penalty: + anyOf: + - type: number + - type: 'null' + title: Presence Penalty + response_format: + anyOf: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' + - $ref: '#/components/schemas/OpenAIResponseFormatText' + - $ref: '#/components/schemas/OpenAIResponseFormatJSONSchema' + - $ref: '#/components/schemas/OpenAIResponseFormatJSONObject' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' + json_object: '#/components/schemas/OpenAIResponseFormatJSONObject' + json_schema: '#/components/schemas/OpenAIResponseFormatJSONSchema' + text: '#/components/schemas/OpenAIResponseFormatText' + - type: 'null' + title: Response Format + seed: + anyOf: + - type: integer + - type: 'null' + title: Seed + stop: + anyOf: + - type: string - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' + type: string + type: array + - type: 'null' + title: Stop + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + stream_options: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Stream Options + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + tool_choice: + anyOf: + - type: string + - additionalProperties: true + type: object + - type: 'null' + title: Tool Choice + tools: + anyOf: + - items: + additionalProperties: true + type: object type: array - title: Content + - type: 'null' + title: Tools + top_logprobs: + anyOf: + - type: integer + - type: 'null' + title: Top Logprobs + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + user: + anyOf: + - type: string + - type: 'null' + title: User + additionalProperties: true type: object required: - - content - title: SystemMessage - description: A system message providing instructions or context to the model. - SystemMessageBehavior: - type: string - enum: - - append - - replace - title: SystemMessageBehavior - description: Config for how to override the default system prompt. - TextContentItem: + - model + - messages + title: OpenAIChatCompletionRequestWithExtraBody + description: Request parameters for OpenAI-compatible chat completion endpoint. + OpenAIChatCompletionToolCall: properties: + index: + anyOf: + - type: integer + - type: 'null' + title: Index + id: + anyOf: + - type: string + - type: 'null' + title: Id type: type: string - const: text + const: function title: Type - default: text - text: - type: string - title: Text + default: function + function: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' + - type: 'null' type: object - required: - - text - title: TextContentItem - description: A text content item - ToolCall: + title: OpenAIChatCompletionToolCall + description: Tool call specification for OpenAI-compatible chat completion responses. + OpenAIChatCompletionToolCallFunction: properties: - call_id: - type: string - title: Call Id - tool_name: + name: anyOf: - - $ref: '#/components/schemas/BuiltinTool' - type: string - title: Tool Name + - type: 'null' + title: Name arguments: - type: string + anyOf: + - type: string + - type: 'null' title: Arguments type: object + title: OpenAIChatCompletionToolCallFunction + description: Function call details for OpenAI-compatible tool calls. + OpenAIChatCompletionUsage: + properties: + prompt_tokens: + type: integer + title: Prompt Tokens + completion_tokens: + type: integer + title: Completion Tokens + total_tokens: + type: integer + title: Total Tokens + prompt_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails' + - type: 'null' + completion_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails' + - type: 'null' + type: object required: - - call_id - - tool_name - - arguments - title: ToolCall - ToolChoice: - type: string - enum: - - auto - - required - - none - title: ToolChoice - description: Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model. - ToolConfig: + - prompt_tokens + - completion_tokens + - total_tokens + title: OpenAIChatCompletionUsage + description: Usage information for OpenAI chat completion. + OpenAIChatCompletionUsageCompletionTokensDetails: properties: - tool_choice: + reasoning_tokens: anyOf: - - $ref: '#/components/schemas/ToolChoice' - - type: string - title: Tool Choice - default: auto - tool_prompt_format: - $ref: '#/components/schemas/ToolPromptFormat' - system_message_behavior: - default: append - $ref: '#/components/schemas/SystemMessageBehavior' + - type: integer + - type: 'null' + title: Reasoning Tokens type: object - title: ToolConfig - description: Configuration for tool use. - ToolDef: + title: OpenAIChatCompletionUsageCompletionTokensDetails + description: Token details for output tokens in OpenAI chat completion usage. + OpenAIChatCompletionUsagePromptTokensDetails: properties: - toolgroup_id: - title: Toolgroup Id - type: string - name: - type: string - title: Name - description: - title: Description - type: string - input_schema: - title: Input Schema - additionalProperties: true - type: object - output_schema: - title: Output Schema - additionalProperties: true - type: object - metadata: - title: Metadata - additionalProperties: true - type: object + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens type: object - required: - - name - title: ToolDef - description: Tool definition used in runtime contexts. - ToolExecutionStep-Output: + title: OpenAIChatCompletionUsagePromptTokensDetails + description: Token details for prompt tokens in OpenAI chat completion usage. + OpenAIChoice-Output: properties: - turn_id: - type: string - title: Turn Id - step_id: - type: string - title: Step Id - started_at: - title: Started At - type: string - format: date-time - completed_at: - title: Completed At - type: string - format: date-time - step_type: + message: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Output' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Output' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Message + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Output' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Output' + finish_reason: type: string - const: tool_execution - title: Step Type - default: tool_execution - tool_calls: - items: - $ref: '#/components/schemas/ToolCall' - type: array - title: Tool Calls - tool_responses: - items: - $ref: '#/components/schemas/ToolResponse-Output' - type: array - title: Tool Responses + title: Finish Reason + index: + type: integer + title: Index + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + - type: 'null' type: object required: - - turn_id - - step_id - - tool_calls - - tool_responses - title: ToolExecutionStep - description: A tool execution step in an agent turn. - ToolGroup: + - message + - finish_reason + - index + title: OpenAIChoice + description: A choice from an OpenAI-compatible chat completion response. + OpenAIChoiceLogprobs-Output: properties: - identifier: - type: string - title: Identifier - description: Unique identifier for this resource in llama stack - provider_resource_id: - title: Provider Resource Id - description: Unique identifier for this resource in the provider - type: string - provider_id: - type: string - title: Provider Id - description: ID of the provider that owns this resource - type: + content: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + title: Content + refusal: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + title: Refusal + type: object + title: OpenAIChoiceLogprobs + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. + OpenAICompletion: + properties: + id: type: string - const: tool_group - title: Type - default: tool_group - mcp_endpoint: - $ref: '#/components/schemas/URL' - args: - title: Args - additionalProperties: true - type: object + title: Id + choices: + items: + $ref: '#/components/schemas/OpenAICompletionChoice-Output' + type: array + title: Choices + created: + type: integer + title: Created + model: + type: string + title: Model + object: + type: string + const: text_completion + title: Object + default: text_completion type: object required: - - identifier - - provider_id - title: ToolGroup - description: A group of related tools managed together. - ToolInvocationResult: + - id + - choices + - created + - model + title: OpenAICompletion + description: "Response from an OpenAI-compatible completion request.\n\n:id: The ID of the completion\n:choices: List of choices\n:created: The Unix timestamp in seconds when the completion was created\n:model: The model that was used to generate the completion\n:object: The object type, which will be \"text_completion\"" + OpenAICompletionChoice-Output: properties: - content: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - title: Content - error_message: - title: Error Message + finish_reason: type: string - error_code: - title: Error Code + title: Finish Reason + text: + type: string + title: Text + index: type: integer - metadata: - title: Metadata - additionalProperties: true - type: object + title: Index + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + - type: 'null' type: object - title: ToolInvocationResult - description: Result of a tool invocation. - ToolPromptFormat: - type: string - enum: - - json - - function_tag - - python_list - title: ToolPromptFormat - description: Prompt format for calling custom / zero shot tools. - ToolResponse-Input: + required: + - finish_reason + - text + - index + title: OpenAICompletionChoice + description: "A choice from an OpenAI-compatible completion response.\n\n:finish_reason: The reason the model stopped generating\n:text: The text of the choice\n:index: The index of the choice\n:logprobs: (Optional) The log probabilities for the tokens in the choice" + OpenAICompletionRequestWithExtraBody: properties: - call_id: + model: type: string - title: Call Id - tool_name: + title: Model + prompt: anyOf: - - $ref: '#/components/schemas/BuiltinTool' - type: string - title: Tool Name - content: + - items: + type: string + type: array + - items: + type: integer + type: array + - items: + items: + type: integer + type: array + type: array + title: Prompt + best_of: + anyOf: + - type: integer + - type: 'null' + title: Best Of + echo: + anyOf: + - type: boolean + - type: 'null' + title: Echo + frequency_penalty: + anyOf: + - type: number + - type: 'null' + title: Frequency Penalty + logit_bias: + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Logit Bias + logprobs: + anyOf: + - type: integer + maximum: 5.0 + minimum: 0.0 + - type: 'null' + title: Logprobs + max_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Tokens + n: + anyOf: + - type: integer + - type: 'null' + title: N + presence_penalty: + anyOf: + - type: number + - type: 'null' + title: Presence Penalty + seed: + anyOf: + - type: integer + - type: 'null' + title: Seed + stop: anyOf: - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' + type: string type: array - title: Content - metadata: - title: Metadata - additionalProperties: true - type: object + - type: 'null' + title: Stop + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + stream_options: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Stream Options + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + user: + anyOf: + - type: string + - type: 'null' + title: User + suffix: + anyOf: + - type: string + - type: 'null' + title: Suffix + additionalProperties: true type: object required: - - call_id - - tool_name - - content - title: ToolResponse - description: Response from a tool invocation. - ToolResponse-Output: + - model + - prompt + title: OpenAICompletionRequestWithExtraBody + description: Request parameters for OpenAI-compatible completion endpoint. + OpenAICompletionWithInputMessages: properties: - call_id: + id: type: string - title: Call Id - tool_name: + title: Id + choices: + items: + $ref: '#/components/schemas/OpenAIChoice-Output' + type: array + title: Choices + object: + type: string + const: chat.completion + title: Object + default: chat.completion + created: + type: integer + title: Created + model: + type: string + title: Model + usage: anyOf: - - $ref: '#/components/schemas/BuiltinTool' - - type: string - title: Tool Name - content: + - $ref: '#/components/schemas/OpenAIChatCompletionUsage' + - type: 'null' + input_messages: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Output' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Output' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Output' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Output' + type: array + title: Input Messages + type: object + required: + - id + - choices + - created + - model + - input_messages + title: OpenAICompletionWithInputMessages + OpenAICreateVectorStoreFileBatchRequestWithExtraBody: + properties: + file_ids: + items: + type: string + type: array + title: File Ids + attributes: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Attributes + chunking_strategy: anyOf: - - type: string - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + - type: 'null' + title: Chunking Strategy + additionalProperties: true + type: object + required: + - file_ids + title: OpenAICreateVectorStoreFileBatchRequestWithExtraBody + description: Request to create a vector store file batch with extra_body support. + OpenAICreateVectorStoreRequestWithExtraBody: + properties: + name: + anyOf: + - type: string + - type: 'null' + title: Name + file_ids: + anyOf: - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' + type: string type: array - title: Content + - type: 'null' + title: File Ids + expires_after: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After + chunking_strategy: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Chunking Strategy metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' title: Metadata - additionalProperties: true - type: object + additionalProperties: true + type: object + title: OpenAICreateVectorStoreRequestWithExtraBody + description: Request to create a vector store with extra_body support. + OpenAIDeleteResponseObject: + properties: + id: + type: string + title: Id + description: Unique identifier of the deleted response + object: + type: string + const: response + title: Object + description: Object type identifier, always "response" + default: response + deleted: + type: boolean + title: Deleted + description: Deletion confirmation flag, always True + default: true type: object required: - - call_id - - tool_name - - content - title: ToolResponse - description: Response from a tool invocation. - ToolResponseMessage-Output: + - id + title: OpenAIDeleteResponseObject + description: "Response object confirming deletion of an OpenAI response.\n\n:param id: Unique identifier of the deleted response\n:param object: Object type identifier, always \"response\"\n:param deleted: Deletion confirmation flag, always True" + OpenAIDeveloperMessageParam: properties: role: type: string - const: tool + const: developer title: Role - default: tool - call_id: - type: string - title: Call Id + default: developer content: anyOf: - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' type: array title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name type: object required: - - call_id - content - title: ToolResponseMessage - description: A message representing the result of a tool invocation. - TopKSamplingStrategy: + title: OpenAIDeveloperMessageParam + description: A message from the developer in an OpenAI-compatible chat completion request. + OpenAIEmbeddingData: properties: - type: + object: type: string - const: top_k - title: Type - default: top_k - top_k: + const: embedding + title: Object + default: embedding + embedding: + anyOf: + - items: + type: number + type: array + - type: string + title: Embedding + index: type: integer - minimum: 1.0 - title: Top K - type: object - required: - - top_k - title: TopKSamplingStrategy - description: Top-k sampling strategy that restricts sampling to the k most likely tokens. - TopPSamplingStrategy: - properties: - type: - type: string - const: top_p - title: Type - default: top_p - temperature: - title: Temperature - type: number - minimum: 0.0 - top_p: - title: Top P - default: 0.95 - type: number + title: Index type: object required: - - temperature - title: TopPSamplingStrategy - description: Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p. - TrainingConfig: + - embedding + - index + title: OpenAIEmbeddingData + description: A single embedding data object from an OpenAI-compatible embeddings response. + OpenAIEmbeddingUsage: properties: - n_epochs: - type: integer - title: N Epochs - max_steps_per_epoch: - type: integer - title: Max Steps Per Epoch - default: 1 - gradient_accumulation_steps: + prompt_tokens: type: integer - title: Gradient Accumulation Steps - default: 1 - max_validation_steps: - title: Max Validation Steps - default: 1 + title: Prompt Tokens + total_tokens: type: integer - data_config: - $ref: '#/components/schemas/DataConfig' - optimizer_config: - $ref: '#/components/schemas/OptimizerConfig' - efficiency_config: - $ref: '#/components/schemas/EfficiencyConfig' - dtype: - title: Dtype - default: bf16 - type: string - type: object - required: - - n_epochs - title: TrainingConfig - description: Comprehensive configuration for the training process. - Turn: - properties: - turn_id: - type: string - title: Turn Id - session_id: - type: string - title: Session Id - input_messages: - items: - anyOf: - - $ref: '#/components/schemas/UserMessage-Output' - - $ref: '#/components/schemas/ToolResponseMessage-Output' - type: array - title: Input Messages - steps: - items: - oneOf: - - $ref: '#/components/schemas/InferenceStep-Output' - - $ref: '#/components/schemas/ToolExecutionStep-Output' - - $ref: '#/components/schemas/ShieldCallStep-Output' - - $ref: '#/components/schemas/MemoryRetrievalStep-Output' - discriminator: - propertyName: step_type - mapping: - inference: '#/components/schemas/InferenceStep-Output' - memory_retrieval: '#/components/schemas/MemoryRetrievalStep-Output' - shield_call: '#/components/schemas/ShieldCallStep-Output' - tool_execution: '#/components/schemas/ToolExecutionStep-Output' - type: array - title: Steps - output_message: - $ref: '#/components/schemas/CompletionMessage-Output' - output_attachments: - title: Output Attachments - items: - $ref: '#/components/schemas/Attachment-Output' - type: array - started_at: - type: string - format: date-time - title: Started At - completed_at: - title: Completed At - type: string - format: date-time + title: Total Tokens type: object required: - - turn_id - - session_id - - input_messages - - steps - - output_message - - started_at - title: Turn - description: A single turn in an interaction with an Agentic System. - URIDataSource: + - prompt_tokens + - total_tokens + title: OpenAIEmbeddingUsage + description: Usage information for an OpenAI-compatible embeddings response. + OpenAIEmbeddingsRequestWithExtraBody: properties: - type: - type: string - const: uri - title: Type - default: uri - uri: + model: type: string - title: Uri + title: Model + input: + anyOf: + - type: string + - items: + type: string + type: array + title: Input + encoding_format: + anyOf: + - type: string + - type: 'null' + title: Encoding Format + default: float + dimensions: + anyOf: + - type: integer + - type: 'null' + title: Dimensions + user: + anyOf: + - type: string + - type: 'null' + title: User + additionalProperties: true type: object required: - - uri - title: URIDataSource - description: A dataset that can be obtained from a URI. - URL: + - model + - input + title: OpenAIEmbeddingsRequestWithExtraBody + description: Request parameters for OpenAI-compatible embeddings endpoint. + OpenAIEmbeddingsResponse: properties: - uri: + object: type: string - title: Uri + const: list + title: Object + default: list + data: + items: + $ref: '#/components/schemas/OpenAIEmbeddingData' + type: array + title: Data + model: + type: string + title: Model + usage: + $ref: '#/components/schemas/OpenAIEmbeddingUsage' type: object required: - - uri - title: URL - description: A URL reference to external content. - UnionType: + - data + - model + - usage + title: OpenAIEmbeddingsResponse + description: Response from an OpenAI-compatible embeddings request. + OpenAIFile: properties: type: type: string - const: union + const: file title: Type - default: union + default: file + file: + $ref: '#/components/schemas/OpenAIFileFile' type: object - title: UnionType - description: Parameter type for union values. - UserMessage-Input: + required: + - file + title: OpenAIFile + OpenAIFileDeleteResponse: properties: - role: + id: type: string - const: user - title: Role - default: user - content: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' - type: array - title: Content - context: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' - type: array - title: Context + title: Id + description: The file identifier that was deleted. + object: + type: string + const: file + title: Object + description: The object type, which is always 'file'. + default: file + deleted: + type: boolean + title: Deleted + description: Whether the file was successfully deleted. type: object required: - - content - title: UserMessage - description: A message from the user in a chat conversation. - UserMessage-Output: + - id + - deleted + title: OpenAIFileDeleteResponse + description: Response for deleting a file in OpenAI Files API. + OpenAIFileFile: properties: - role: - type: string - const: user - title: Role - default: user - content: + file_id: anyOf: - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - title: Content - context: + - type: 'null' + title: File Id + filename: anyOf: - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - title: Context + - type: 'null' + title: Filename type: object - required: - - content - title: UserMessage - description: A message from the user in a chat conversation. - VectorStoreChunkingStrategyAuto: + title: OpenAIFileFile + OpenAIFileObject: properties: - type: + object: type: string - const: auto - title: Type - default: auto + const: file + title: Object + description: The object type, which is always 'file'. + default: file + id: + type: string + title: Id + description: The file identifier, which can be referenced in the API endpoints. + bytes: + type: integer + title: Bytes + description: The size of the file, in bytes. + created_at: + type: integer + title: Created At + description: The Unix timestamp (in seconds) for when the file was created. + expires_at: + type: integer + title: Expires At + description: The Unix timestamp (in seconds) for when the file expires. + filename: + type: string + title: Filename + description: The name of the file. + purpose: + $ref: '#/components/schemas/OpenAIFilePurpose' + description: The intended purpose of the file. type: object - title: VectorStoreChunkingStrategyAuto - description: Automatic chunking strategy for vector store files. - VectorStoreChunkingStrategyStatic: + required: + - id + - bytes + - created_at + - expires_at + - filename + - purpose + title: OpenAIFileObject + description: OpenAI File object as defined in the OpenAI Files API. + OpenAIFilePurpose: + type: string + enum: + - assistants + - batch + title: OpenAIFilePurpose + description: Valid purpose values for OpenAI Files API. + OpenAIImageURL: properties: - type: + url: type: string - const: static - title: Type - default: static - static: - $ref: '#/components/schemas/VectorStoreChunkingStrategyStaticConfig' + title: Url + detail: + anyOf: + - type: string + - type: 'null' + title: Detail type: object required: - - static - title: VectorStoreChunkingStrategyStatic - description: Static chunking strategy with configurable parameters. - VectorStoreChunkingStrategyStaticConfig: + - url + title: OpenAIImageURL + description: Image URL specification for OpenAI-compatible chat completion messages. + OpenAIJSONSchema: properties: - chunk_overlap_tokens: - type: integer - title: Chunk Overlap Tokens - default: 400 - max_chunk_size_tokens: - type: integer - maximum: 4096.0 - minimum: 100.0 - title: Max Chunk Size Tokens - default: 800 + name: + type: string + title: Name + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema type: object - title: VectorStoreChunkingStrategyStaticConfig - description: Configuration for static chunking strategy. - VectorStoreContent: + title: OpenAIJSONSchema + description: JSON schema specification for OpenAI-compatible structured response format. + OpenAIResponseAnnotationCitation: properties: type: type: string - const: text + const: url_citation title: Type - text: + description: Annotation type identifier, always "url_citation" + default: url_citation + end_index: + type: integer + title: End Index + description: End position of the citation span in the content + start_index: + type: integer + title: Start Index + description: Start position of the citation span in the content + title: type: string - title: Text + title: Title + description: Title of the referenced web resource + url: + type: string + title: Url + description: URL of the referenced web resource type: object required: - - type - - text - title: VectorStoreContent - description: Content item from a vector store file or search result. - VectorStoreFileBatchObject: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + OpenAIResponseAnnotationContainerFileCitation: properties: - id: + type: type: string - title: Id - object: + const: container_file_citation + title: Type + default: container_file_citation + container_id: type: string - title: Object - default: vector_store.file_batch - created_at: + title: Container Id + end_index: type: integer - title: Created At - vector_store_id: + title: End Index + file_id: type: string - title: Vector Store Id - status: - anyOf: - - type: string - const: completed - - type: string - const: in_progress - - type: string - const: cancelled - - type: string - const: failed - title: Status - file_counts: - $ref: '#/components/schemas/VectorStoreFileCounts' - type: object - required: - - id - - created_at - - vector_store_id - - status - - file_counts - title: VectorStoreFileBatchObject - description: OpenAI Vector Store File Batch object. - VectorStoreFileCounts: - properties: - completed: - type: integer - title: Completed - cancelled: - type: integer - title: Cancelled - failed: - type: integer - title: Failed - in_progress: - type: integer - title: In Progress - total: + title: File Id + filename: + type: string + title: Filename + start_index: type: integer - title: Total + title: Start Index type: object required: - - completed - - cancelled - - failed - - in_progress - - total - title: VectorStoreFileCounts - description: File processing status counts for a vector store. - VectorStoreFileLastError: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + OpenAIResponseAnnotationFileCitation: properties: - code: - anyOf: - - type: string - const: server_error - - type: string - const: rate_limit_exceeded - title: Code - message: + type: type: string - title: Message - type: object - required: - - code - - message - title: VectorStoreFileLastError - description: Error information for failed vector store file processing. - VectorStoreFileObject: - properties: - id: + const: file_citation + title: Type + description: Annotation type identifier, always "file_citation" + default: file_citation + file_id: type: string - title: Id - object: + title: File Id + description: Unique identifier of the referenced file + filename: type: string - title: Object - default: vector_store.file - attributes: - additionalProperties: true - type: object - title: Attributes - chunking_strategy: - oneOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' - title: Chunking Strategy - discriminator: - propertyName: type - mapping: - auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' - static: '#/components/schemas/VectorStoreChunkingStrategyStatic' - created_at: - type: integer - title: Created At - last_error: - $ref: '#/components/schemas/VectorStoreFileLastError' - status: - anyOf: - - type: string - const: completed - - type: string - const: in_progress - - type: string - const: cancelled - - type: string - const: failed - title: Status - usage_bytes: + title: Filename + description: Name of the referenced file + index: type: integer - title: Usage Bytes - default: 0 - vector_store_id: - type: string - title: Vector Store Id + title: Index + description: Position index of the citation within the content type: object required: - - id - - chunking_strategy - - created_at - - status - - vector_store_id - title: VectorStoreFileObject - description: OpenAI Vector Store File object. - VectorStoreObject: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + OpenAIResponseAnnotationFilePath: properties: - id: + type: type: string - title: Id - object: + const: file_path + title: Type + default: file_path + file_id: type: string - title: Object - default: vector_store - created_at: + title: File Id + index: type: integer - title: Created At - name: - title: Name + title: Index + type: object + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + OpenAIResponseContentPartRefusal: + properties: + type: type: string - usage_bytes: - type: integer - title: Usage Bytes - default: 0 - file_counts: - $ref: '#/components/schemas/VectorStoreFileCounts' - status: + const: refusal + title: Type + description: Content part type identifier, always "refusal" + default: refusal + refusal: type: string - title: Status - default: completed - expires_after: - title: Expires After - additionalProperties: true - type: object - expires_at: - title: Expires At - type: integer - last_active_at: - title: Last Active At - type: integer - metadata: - additionalProperties: true - type: object - title: Metadata + title: Refusal + description: Refusal text supplied by the model + type: object + required: + - refusal + title: OpenAIResponseContentPartRefusal + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + OpenAIResponseError: + properties: + code: + type: string + title: Code + description: Error code identifying the type of failure + message: + type: string + title: Message + description: Human-readable error message describing the failure type: object required: - - id - - created_at - - file_counts - title: VectorStoreObject - description: OpenAI Vector Store object. - VectorStoreSearchResponse: + - code + - message + title: OpenAIResponseError + description: "Error details for failed OpenAI response requests.\n\n:param code: Error code identifying the type of failure\n:param message: Human-readable error message describing the failure" + OpenAIResponseFormatJSONObject: properties: - file_id: + type: type: string - title: File Id - filename: + const: json_object + title: Type + default: json_object + type: object + title: OpenAIResponseFormatJSONObject + description: JSON object response format for OpenAI-compatible chat completion requests. + OpenAIResponseFormatJSONSchema: + properties: + type: type: string - title: Filename - score: - type: number - title: Score - attributes: - title: Attributes - additionalProperties: - anyOf: - - type: string - - type: number - - type: boolean - type: object - content: - items: - $ref: '#/components/schemas/VectorStoreContent' - type: array - title: Content + const: json_schema + title: Type + default: json_schema + json_schema: + $ref: '#/components/schemas/OpenAIJSONSchema' type: object required: - - file_id - - filename - - score - - content - title: VectorStoreSearchResponse - description: Response from searching a vector store. - VectorStoreSearchResponsePage: + - json_schema + title: OpenAIResponseFormatJSONSchema + description: JSON schema response format for OpenAI-compatible chat completion requests. + OpenAIResponseFormatText: properties: - object: + type: type: string - title: Object - default: vector_store.search_results.page - search_query: + const: text + title: Type + default: text + type: object + title: OpenAIResponseFormatText + description: Text response format for OpenAI-compatible chat completion requests. + OpenAIResponseInputFunctionToolCallOutput: + properties: + call_id: type: string - title: Search Query - data: - items: - $ref: '#/components/schemas/VectorStoreSearchResponse' - type: array - title: Data - has_more: - type: boolean - title: Has More - default: false - next_page: - title: Next Page + title: Call Id + output: + type: string + title: Output + type: type: string + const: function_call_output + title: Type + default: function_call_output + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status type: object required: - - search_query - - data - title: VectorStoreSearchResponsePage - description: Paginated response from searching a vector store. - VersionInfo: + - call_id + - output + title: OpenAIResponseInputFunctionToolCallOutput + description: This represents the output of a function call that gets passed back to the model. + OpenAIResponseInputMessageContentFile: properties: - version: + type: type: string - title: Version + const: input_file + title: Type + description: The type of the input item. Always `input_file`. + default: input_file + file_data: + anyOf: + - type: string + - type: 'null' + title: File Data + description: The data of the file to be sent to the model. + file_id: + anyOf: + - type: string + - type: 'null' + title: File Id + description: The ID of the file to be sent to the model. + file_url: + anyOf: + - type: string + - type: 'null' + title: File Url + description: The URL of the file to be sent to the model. + filename: + anyOf: + - type: string + - type: 'null' + title: Filename + description: The name of the file to be sent to the model. type: object - required: - - version - title: VersionInfo - description: Version information for the service. - ViolationLevel: - type: string - enum: - - info - - warn - - error - title: ViolationLevel - description: Severity level of a safety violation. - WeightedRanker: + title: OpenAIResponseInputMessageContentFile + description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + OpenAIResponseInputMessageContentImage: properties: + detail: + anyOf: + - type: string + const: low + - type: string + const: high + - type: string + const: auto + title: Detail + description: Level of detail for image processing, can be "low", "high", or "auto" + default: auto type: type: string - const: weighted + const: input_image title: Type - default: weighted - alpha: - type: number - maximum: 1.0 - minimum: 0.0 - title: Alpha - description: Weight factor between 0 and 1. 0 means only keyword scores, 1 means only vector scores. - default: 0.5 + description: Content type identifier, always "input_image" + default: input_image + file_id: + anyOf: + - type: string + - type: 'null' + title: File Id + description: The ID of the file to be sent to the model. + image_url: + anyOf: + - type: string + - type: 'null' + title: Image Url + description: URL of the image content type: object - title: WeightedRanker - description: Weighted ranker configuration that combines vector and keyword scores. - _URLOrData: + title: OpenAIResponseInputMessageContentImage + description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + OpenAIResponseInputMessageContentText: properties: - url: - $ref: '#/components/schemas/URL' - data: - contentEncoding: base64 - title: Data + text: type: string + title: Text + description: The text content of the input message + type: + type: string + const: input_text + title: Type + description: Content type identifier, always "input_text" + default: input_text type: object - title: _URLOrData - description: A URL or a base64 encoded string - __main_____agents_agent_id_session_Request: + required: + - text + title: OpenAIResponseInputMessageContentText + description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + OpenAIResponseInputToolFileSearch: properties: - agent_id: - type: string - title: Agent Id - session_name: + type: type: string - title: Session Name + const: file_search + title: Type + description: Tool type identifier, always "file_search" + default: file_search + vector_store_ids: + items: + type: string + type: array + title: Vector Store Ids + description: List of vector store identifiers to search within + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Filters + description: Additional filters to apply to the search + max_num_results: + anyOf: + - type: integer + maximum: 50.0 + minimum: 1.0 + - type: 'null' + title: Max Num Results + description: Maximum number of search results to return (1-50) + default: 10 + ranking_options: + anyOf: + - $ref: '#/components/schemas/SearchRankingOptions' + - type: 'null' + description: Options for ranking and scoring search results type: object required: - - agent_id - - session_name - title: _agents_agent_id_session_Request - __main_____agents_agent_id_session_session_id_turn_Request: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + description: "File search tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"file_search\"\n:param vector_store_ids: List of vector store identifiers to search within\n:param filters: (Optional) Additional filters to apply to the search\n:param max_num_results: (Optional) Maximum number of search results to return (1-50)\n:param ranking_options: (Optional) Options for ranking and scoring search results" + OpenAIResponseInputToolFunction: properties: - agent_id: + type: type: string - title: Agent Id - session_id: + const: function + title: Type + description: Tool type identifier, always "function" + default: function + name: type: string - title: Session Id - messages: - $ref: '#/components/schemas/UserMessage-Input' - stream: - type: boolean - title: Stream - default: false - documents: - $ref: '#/components/schemas/Document' - toolgroups: + title: Name + description: Name of the function that can be called + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Description of what the function does + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Parameters + description: JSON schema defining the function's parameters + strict: anyOf: - - type: string - - $ref: '#/components/schemas/AgentToolGroupWithArgs' - title: Toolgroups - tool_config: - $ref: '#/components/schemas/ToolConfig' + - type: boolean + - type: 'null' + title: Strict + description: Whether to enforce strict parameter validation type: object required: - - agent_id - - session_id - - messages - - documents - - toolgroups - - tool_config - title: _agents_agent_id_session_session_id_turn_Request - __main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request: + - name + title: OpenAIResponseInputToolFunction + description: "Function tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"function\"\n:param name: Name of the function that can be called\n:param description: (Optional) Description of what the function does\n:param parameters: (Optional) JSON schema defining the function's parameters\n:param strict: (Optional) Whether to enforce strict parameter validation" + OpenAIResponseInputToolMCP: properties: - agent_id: + type: type: string - title: Agent Id - session_id: + const: mcp + title: Type + description: Tool type identifier, always "mcp" + default: mcp + server_label: type: string - title: Session Id - turn_id: + title: Server Label + description: Label to identify this MCP server + server_url: type: string - title: Turn Id - tool_responses: - $ref: '#/components/schemas/ToolResponse-Input' - stream: - type: boolean - title: Stream - default: false + title: Server Url + description: URL endpoint of the MCP server + headers: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Headers + description: HTTP headers to include when connecting to the server + require_approval: + anyOf: + - type: string + const: always + - type: string + const: never + - $ref: '#/components/schemas/ApprovalFilter' + title: Require Approval + description: Approval requirement for tool calls ("always", "never", or filter) + default: never + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + title: Allowed Tools + description: Restriction on which tools can be used from this server type: object required: - - agent_id - - session_id - - turn_id - - tool_responses - title: _agents_agent_id_session_session_id_turn_turn_id_resume_Request - __main_____datasets_Request: + - server_label + - server_url + title: OpenAIResponseInputToolMCP + description: "Model Context Protocol (MCP) tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param server_url: URL endpoint of the MCP server\n:param headers: (Optional) HTTP headers to include when connecting to the server\n:param require_approval: Approval requirement for tool calls (\"always\", \"never\", or filter)\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + OpenAIResponseInputToolWebSearch: properties: - purpose: - $ref: '#/components/schemas/DatasetPurpose' - metadata: - type: string - title: Metadata - dataset_id: - type: string - title: Dataset Id + type: + anyOf: + - type: string + const: web_search + - type: string + const: web_search_preview + - type: string + const: web_search_preview_2025_03_11 + title: Type + description: Web search tool type variant to use + default: web_search + search_context_size: + anyOf: + - type: string + pattern: ^low|medium|high$ + - type: 'null' + title: Search Context Size + description: Size of search context, must be "low", "medium", or "high" + default: medium type: object - required: - - purpose - - metadata - - dataset_id - title: _datasets_Request - _batches_Request: + title: OpenAIResponseInputToolWebSearch + description: "Web search tool configuration for OpenAI response inputs.\n\n:param type: Web search tool type variant to use\n:param search_context_size: (Optional) Size of search context, must be \"low\", \"medium\", or \"high\"" + OpenAIResponseMCPApprovalRequest: properties: - input_file_id: + arguments: type: string - title: Input File Id - endpoint: + title: Arguments + id: type: string - title: Endpoint - completion_window: + title: Id + name: type: string - title: Completion Window - metadata: + title: Name + server_label: type: string - title: Metadata - idempotency_key: + title: Server Label + type: type: string - title: Idempotency Key + const: mcp_approval_request + title: Type + default: mcp_approval_request type: object required: - - input_file_id - - endpoint - - completion_window - - metadata - - idempotency_key - title: _batches_Request - _batches_batch_id_cancel_Request: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + description: A request for human approval of a tool invocation. + OpenAIResponseMCPApprovalResponse: properties: - batch_id: + approval_request_id: type: string - title: Batch Id - type: object - required: - - batch_id - title: _batches_batch_id_cancel_Request - _conversations_Request: - properties: - items: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage-Input' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - title: Items - discriminator: - propertyName: type - mapping: - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - message: '#/components/schemas/OpenAIResponseMessage-Input' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - metadata: + title: Approval Request Id + approve: + type: boolean + title: Approve + type: type: string - title: Metadata + const: mcp_approval_response + title: Type + default: mcp_approval_response + id: + anyOf: + - type: string + - type: 'null' + title: Id + reason: + anyOf: + - type: string + - type: 'null' + title: Reason type: object required: - - items - - metadata - title: _conversations_Request - _conversations_conversation_id_Request: + - approval_request_id + - approve + title: OpenAIResponseMCPApprovalResponse + description: A response to an MCP approval request. + OpenAIResponseMessage-Input: properties: - conversation_id: - type: string - title: Conversation Id - metadata: + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - type: string + const: system + - type: string + const: developer + - type: string + const: user + - type: string + const: assistant + title: Role + type: type: string - title: Metadata + const: message + title: Type + default: message + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status type: object required: - - conversation_id - - metadata - title: _conversations_conversation_id_Request - _conversations_conversation_id_items_Request: + - content + - role + title: OpenAIResponseMessage + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + OpenAIResponseMessage-Output: properties: - conversation_id: + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - type: string + const: system + - type: string + const: developer + - type: string + const: user + - type: string + const: assistant + title: Role + type: type: string - title: Conversation Id - items: + const: message + title: Type + default: message + id: anyOf: - - $ref: '#/components/schemas/OpenAIResponseMessage-Input' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - title: Items + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status type: object required: - - conversation_id - - items - title: _conversations_conversation_id_items_Request - _inference_rerank_Request: + - content + - role + title: OpenAIResponseMessage + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + OpenAIResponseObject: properties: + created_at: + type: integer + title: Created At + description: Unix timestamp when the response was created + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + description: Error details if the response generation failed + id: + type: string + title: Id + description: Unique identifier for this response model: type: string title: Model - query: + description: Model identifier used for generation + object: type: string - title: Query - items: + const: response + title: Object + description: Object type identifier, always "response" + default: response + output: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + title: Output + description: List of generated output items (messages, tool calls, etc.) + parallel_tool_calls: + type: boolean + title: Parallel Tool Calls + description: Whether tool calls can be executed in parallel + default: false + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + description: ID of the previous response in a conversation + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + description: Reference to a prompt template and its variables. + status: type: string - title: Items - max_num_results: - type: integer - title: Max Num Results + title: Status + description: Current status of the response generation + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Sampling temperature used for generation + text: + $ref: '#/components/schemas/OpenAIResponseText' + description: Text formatting configuration for the response + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + description: Nucleus sampling parameter used for generation + tools: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + type: array + - type: 'null' + title: Tools + description: An array of tools the model may call while generating a response. + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + description: Truncation strategy applied to the response + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + description: Token usage information for the response + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + description: System message inserted into the model's context type: object required: + - created_at + - id - model - - query - - items - - max_num_results - title: _inference_rerank_Request - _models_Request: + - output + - status + title: OpenAIResponseObject + description: "Complete OpenAI response object containing generation results and metadata.\n\n:param created_at: Unix timestamp when the response was created\n:param error: (Optional) Error details if the response generation failed\n:param id: Unique identifier for this response\n:param model: Model identifier used for generation\n:param object: Object type identifier, always \"response\"\n:param output: List of generated output items (messages, tool calls, etc.)\n:param parallel_tool_calls: Whether tool calls can be executed in parallel\n:param previous_response_id: (Optional) ID of the previous response in a conversation\n:param prompt: (Optional) Reference to a prompt template and its variables.\n:param status: Current status of the response generation\n:param temperature: (Optional) Sampling temperature used for generation\n:param text: Text formatting configuration for the response\n:param top_p: (Optional) Nucleus sampling parameter used for generation\n:param tools: (Optional) An array of tools the model may call while generating a response.\n:param truncation: (Optional) Truncation strategy applied to the response\n:param usage: (Optional) Token usage information for the response\n:param instructions: (Optional) System message inserted into the model's context" + OpenAIResponseObjectWithInput-Output: properties: - model_id: + created_at: + type: integer + title: Created At + description: Unix timestamp when the response was created + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + description: Error details if the response generation failed + id: type: string - title: Model Id - provider_model_id: + title: Id + description: Unique identifier for this response + model: type: string - title: Provider Model Id - provider_id: + title: Model + description: Model identifier used for generation + object: type: string - title: Provider Id - metadata: + const: response + title: Object + description: Object type identifier, always "response" + default: response + output: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + title: Output + description: List of generated output items (messages, tool calls, etc.) + parallel_tool_calls: + type: boolean + title: Parallel Tool Calls + description: Whether tool calls can be executed in parallel + default: false + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + description: ID of the previous response in a conversation + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + description: Reference to a prompt template and its variables. + status: type: string - title: Metadata - model_type: - $ref: '#/components/schemas/ModelType' - type: object - required: - - model_id - - provider_model_id - - provider_id - - metadata - - model_type - title: _models_Request - _moderations_Request: - properties: + title: Status + description: Current status of the response generation + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Sampling temperature used for generation + text: + $ref: '#/components/schemas/OpenAIResponseText' + description: Text formatting configuration for the response + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + description: Nucleus sampling parameter used for generation + tools: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + type: array + - type: 'null' + title: Tools + description: An array of tools the model may call while generating a response. + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + description: Truncation strategy applied to the response + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + description: Token usage information for the response + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + description: System message inserted into the model's context input: - type: string + items: + anyOf: + - oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + type: array title: Input - model: - type: string - title: Model + description: List of input items that led to this response type: object required: - - input + - created_at + - id - model - title: _moderations_Request - _prompts_Request: - properties: - prompt: - type: string - title: Prompt - variables: - type: string - title: Variables - type: object - required: - - prompt - - variables - title: _prompts_Request - _prompts_prompt_id_Request: + - output + - status + - input + title: OpenAIResponseObjectWithInput + description: "OpenAI response object extended with input context information.\n\n:param input: List of input items that led to this response" + OpenAIResponseOutputMessageContentOutputText: properties: - prompt_id: - type: string - title: Prompt Id - prompt: - type: string - title: Prompt - version: - type: integer - title: Version - variables: + text: type: string - title: Variables - set_as_default: - type: boolean - title: Set As Default - default: true - type: object - required: - - prompt_id - - prompt - - version - - variables - title: _prompts_prompt_id_Request - _prompts_prompt_id_set_default_version_Request: - properties: - prompt_id: + title: Text + type: type: string - title: Prompt Id - version: - type: integer - title: Version + const: output_text + title: Type + default: output_text + annotations: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + discriminator: + propertyName: type + mapping: + container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' + url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' + type: array + title: Annotations type: object required: - - prompt_id - - version - title: _prompts_prompt_id_set_default_version_Request - _responses_Request: + - text + title: OpenAIResponseOutputMessageContentOutputText + OpenAIResponseOutputMessageFileSearchToolCall: properties: - input: + id: type: string - title: Input - model: + title: Id + description: Unique identifier for this tool call + queries: + items: + type: string + type: array + title: Queries + description: List of search queries executed + status: type: string - title: Model - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - instructions: + title: Status + description: Current status of the file search operation + type: type: string - title: Instructions - previous_response_id: + const: file_search_call + title: Type + description: Tool call type identifier, always "file_search_call" + default: file_search_call + results: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' + type: array + - type: 'null' + title: Results + description: Search results returned by the file search operation + type: object + required: + - id + - queries + - status + title: OpenAIResponseOutputMessageFileSearchToolCall + description: "File search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param queries: List of search queries executed\n:param status: Current status of the file search operation\n:param type: Tool call type identifier, always \"file_search_call\"\n:param results: (Optional) Search results returned by the file search operation" + OpenAIResponseOutputMessageFileSearchToolCallResults: + properties: + attributes: + additionalProperties: true + type: object + title: Attributes + description: Key-value attributes associated with the file + file_id: type: string - title: Previous Response Id - conversation: + title: File Id + description: Unique identifier of the file containing the result + filename: type: string - title: Conversation - store: - type: boolean - title: Store - default: true - stream: - type: boolean - title: Stream - default: false - temperature: + title: Filename + description: Name of the file containing the result + score: type: number - title: Temperature + title: Score + description: Relevance score for this search result (between 0 and 1) text: - $ref: '#/components/schemas/OpenAIResponseText' - tools: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' - title: Tools - discriminator: - propertyName: type - mapping: - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseInputToolMCP' - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' - web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' - include: type: string - title: Include - max_infer_iters: - type: integer - title: Max Infer Iters - default: 10 + title: Text + description: Text content of the search result type: object required: - - input - - model - - prompt - - instructions - - previous_response_id - - conversation - - temperature + - attributes + - file_id + - filename + - score - text - - tools - - include - title: _responses_Request - _scoring_score_Request: + title: OpenAIResponseOutputMessageFileSearchToolCallResults + description: "Search results returned by the file search operation.\n\n:param attributes: (Optional) Key-value attributes associated with the file\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result (between 0 and 1)\n:param text: Text content of the search result" + OpenAIResponseOutputMessageFunctionToolCall: properties: - input_rows: + call_id: type: string - title: Input Rows - scoring_functions: + title: Call Id + description: Unique identifier for the function call + name: type: string - title: Scoring Functions - type: object - required: - - input_rows - - scoring_functions - title: _scoring_score_Request - _scoring_score_batch_Request: - properties: - dataset_id: + title: Name + description: Name of the function being called + arguments: type: string - title: Dataset Id - scoring_functions: + title: Arguments + description: JSON string containing the function arguments + type: type: string - title: Scoring Functions - save_results_dataset: - type: boolean - title: Save Results Dataset - default: false + const: function_call + title: Type + description: Tool call type identifier, always "function_call" + default: function_call + id: + anyOf: + - type: string + - type: 'null' + title: Id + description: Additional identifier for the tool call + status: + anyOf: + - type: string + - type: 'null' + title: Status + description: Current status of the function call execution type: object required: - - dataset_id - - scoring_functions - title: _scoring_score_batch_Request - _shields_Request: + - call_id + - name + - arguments + title: OpenAIResponseOutputMessageFunctionToolCall + description: "Function tool call output message for OpenAI responses.\n\n:param call_id: Unique identifier for the function call\n:param name: Name of the function being called\n:param arguments: JSON string containing the function arguments\n:param type: Tool call type identifier, always \"function_call\"\n:param id: (Optional) Additional identifier for the tool call\n:param status: (Optional) Current status of the function call execution" + OpenAIResponseOutputMessageMCPCall: properties: - shield_id: + id: type: string - title: Shield Id - provider_shield_id: + title: Id + description: Unique identifier for this MCP call + type: type: string - title: Provider Shield Id - provider_id: + const: mcp_call + title: Type + description: Tool call type identifier, always "mcp_call" + default: mcp_call + arguments: type: string - title: Provider Id - params: + title: Arguments + description: JSON string containing the MCP call arguments + name: type: string - title: Params + title: Name + description: Name of the MCP method being called + server_label: + type: string + title: Server Label + description: Label identifying the MCP server handling the call + error: + anyOf: + - type: string + - type: 'null' + title: Error + description: Error message if the MCP call failed + output: + anyOf: + - type: string + - type: 'null' + title: Output + description: Output result from the successful MCP call type: object required: - - shield_id - - provider_shield_id - - provider_id - - params - title: _shields_Request - _tool_runtime_invoke_Request: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + description: "Model Context Protocol (MCP) call output message for OpenAI responses.\n\n:param id: Unique identifier for this MCP call\n:param type: Tool call type identifier, always \"mcp_call\"\n:param arguments: JSON string containing the MCP call arguments\n:param name: Name of the MCP method being called\n:param server_label: Label identifying the MCP server handling the call\n:param error: (Optional) Error message if the MCP call failed\n:param output: (Optional) Output result from the successful MCP call" + OpenAIResponseOutputMessageMCPListTools: properties: - tool_name: + id: type: string - title: Tool Name - kwargs: + title: Id + description: Unique identifier for this MCP list tools operation + type: type: string - title: Kwargs + const: mcp_list_tools + title: Type + description: Tool call type identifier, always "mcp_list_tools" + default: mcp_list_tools + server_label: + type: string + title: Server Label + description: Label identifying the MCP server providing the tools + tools: + items: + $ref: '#/components/schemas/MCPListToolsTool' + type: array + title: Tools + description: List of available tools provided by the MCP server type: object required: - - tool_name - - kwargs - title: _tool_runtime_invoke_Request - _tool_runtime_rag_tool_query_Request: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + description: "MCP list tools output message containing available tools from an MCP server.\n\n:param id: Unique identifier for this MCP list tools operation\n:param type: Tool call type identifier, always \"mcp_list_tools\"\n:param server_label: Label identifying the MCP server providing the tools\n:param tools: List of available tools provided by the MCP server" + OpenAIResponseOutputMessageWebSearchToolCall: properties: - content: + id: type: string - title: Content - vector_store_ids: + title: Id + description: Unique identifier for this tool call + status: type: string - title: Vector Store Ids - query_config: - $ref: '#/components/schemas/RAGQueryConfig' + title: Status + description: Current status of the web search operation + type: + type: string + const: web_search_call + title: Type + description: Tool call type identifier, always "web_search_call" + default: web_search_call type: object required: - - content - - vector_store_ids - - query_config - title: _tool_runtime_rag_tool_query_Request - _vector_io_query_Request: + - id + - status + title: OpenAIResponseOutputMessageWebSearchToolCall + description: "Web search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param status: Current status of the web search operation\n:param type: Tool call type identifier, always \"web_search_call\"" + OpenAIResponsePrompt: properties: - vector_store_id: - type: string - title: Vector Store Id - query: - type: string - title: Query - params: + id: type: string - title: Params + title: Id + description: Unique identifier of the prompt template + variables: + anyOf: + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: object + - type: 'null' + title: Variables + description: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files. + version: + anyOf: + - type: string + - type: 'null' + title: Version + description: Version number of the prompt to use (defaults to latest if not specified) type: object required: - - vector_store_id - - query - - params - title: _vector_io_query_Request - _vector_stores_vector_store_id_Request: + - id + title: OpenAIResponsePrompt + description: "OpenAI compatible Prompt object that is used in OpenAI responses.\n\n:param id: Unique identifier of the prompt template\n:param variables: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types\nlike images or files.\n:param version: Version number of the prompt to use (defaults to latest if not specified)" + OpenAIResponseText: properties: - vector_store_id: - type: string - title: Vector Store Id + format: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseTextFormat' + - type: 'null' + description: Text format configuration specifying output format requirements + type: object + title: OpenAIResponseText + description: "Text response configuration for OpenAI responses.\n\n:param format: (Optional) Text format configuration specifying output format requirements" + OpenAIResponseTextFormat: + properties: + type: + anyOf: + - type: string + const: text + - type: string + const: json_schema + - type: string + const: json_object + title: Type name: - type: string + anyOf: + - type: string + - type: 'null' title: Name - expires_after: - type: string - title: Expires After - metadata: - type: string - title: Metadata + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict type: object - required: - - vector_store_id - - name - - expires_after - - metadata - title: _vector_stores_vector_store_id_Request - _vector_stores_vector_store_id_file_batches_batch_id_cancel_Request: + title: OpenAIResponseTextFormat + description: "Configuration for Responses API text format.\n\n:param type: Must be \"text\", \"json_schema\", or \"json_object\" to identify the format type\n:param name: The name of the response format. Only used for json_schema.\n:param schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model. Only used for json_schema.\n:param description: (Optional) A description of the response format. Only used for json_schema.\n:param strict: (Optional) Whether to strictly enforce the JSON schema. If true, the response must match the schema exactly. Only used for json_schema." + OpenAIResponseToolMCP: properties: - batch_id: + type: type: string - title: Batch Id - vector_store_id: + const: mcp + title: Type + description: Tool type identifier, always "mcp" + default: mcp + server_label: type: string - title: Vector Store Id + title: Server Label + description: Label to identify this MCP server + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + title: Allowed Tools + description: Restriction on which tools can be used from this server type: object required: - - batch_id - - vector_store_id - title: _vector_stores_vector_store_id_file_batches_batch_id_cancel_Request - _vector_stores_vector_store_id_files_Request: + - server_label + title: OpenAIResponseToolMCP + description: "Model Context Protocol (MCP) tool configuration for OpenAI response object.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + OpenAIResponseUsage: properties: - vector_store_id: - type: string - title: Vector Store Id - file_id: - type: string - title: File Id - attributes: - type: string - title: Attributes - chunking_strategy: + input_tokens: + type: integer + title: Input Tokens + description: Number of tokens in the input + output_tokens: + type: integer + title: Output Tokens + description: Number of tokens in the output + total_tokens: + type: integer + title: Total Tokens + description: Total tokens used (input + output) + input_tokens_details: anyOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' - title: Chunking Strategy + - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' + - type: 'null' + description: Detailed breakdown of input token usage + output_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + - type: 'null' + description: Detailed breakdown of output token usage type: object required: - - vector_store_id - - file_id - - attributes - - chunking_strategy - title: _vector_stores_vector_store_id_files_Request - _vector_stores_vector_store_id_files_file_id_Request: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + description: "Usage information for OpenAI response.\n\n:param input_tokens: Number of tokens in the input\n:param output_tokens: Number of tokens in the output\n:param total_tokens: Total tokens used (input + output)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + OpenAIResponseUsageInputTokensDetails: properties: - vector_store_id: - type: string - title: Vector Store Id - file_id: - type: string - title: File Id - attributes: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens + description: Number of tokens retrieved from cache + type: object + title: OpenAIResponseUsageInputTokensDetails + description: "Token details for input tokens in OpenAI response usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + OpenAIResponseUsageOutputTokensDetails: + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens + description: Number of tokens used for reasoning (o1/o3 models) + type: object + title: OpenAIResponseUsageOutputTokensDetails + description: "Token details for output tokens in OpenAI response usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + OpenAISystemMessageParam: + properties: + role: type: string - title: Attributes + const: system + title: Role + default: system + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name type: object required: - - vector_store_id - - file_id - - attributes - title: _vector_stores_vector_store_id_files_file_id_Request - _vector_stores_vector_store_id_search_Request: + - content + title: OpenAISystemMessageParam + description: A system message providing instructions or context to the model. + OpenAITokenLogProb: properties: - vector_store_id: - type: string - title: Vector Store Id - query: - type: string - title: Query - filters: - type: string - title: Filters - max_num_results: - type: integer - title: Max Num Results - default: 10 - ranking_options: - $ref: '#/components/schemas/SearchRankingOptions' - rewrite_query: - type: boolean - title: Rewrite Query - default: false - search_mode: + token: type: string - title: Search Mode - default: vector + title: Token + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + type: number + title: Logprob + top_logprobs: + items: + $ref: '#/components/schemas/OpenAITopLogProb' + type: array + title: Top Logprobs type: object required: - - vector_store_id - - query - - filters - - ranking_options - title: _vector_stores_vector_store_id_search_Request - Error: - description: Error response from the API. Roughly follows RFC 7807. + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + description: "The log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token\n:top_logprobs: The top log probabilities for the token" + OpenAIToolMessageParam: properties: - status: - title: Status - type: integer - title: - title: Title - type: string - detail: - title: Detail + role: type: string - instance: - title: Instance + const: tool + title: Role + default: tool + tool_call_id: type: string - nullable: true - required: - - status - - title - - detail - title: Error + title: Tool Call Id + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content type: object - Agent: - description: An agent instance with configuration and metadata. + required: + - tool_call_id + - content + title: OpenAIToolMessageParam + description: A message representing the result of a tool invocation in an OpenAI-compatible chat completion request. + OpenAITopLogProb: properties: - agent_id: - title: Agent Id - type: string - agent_config: - $ref: '#/components/schemas/AgentConfig' - created_at: - format: date-time - title: Created At + token: type: string - required: - - agent_id - - agent_config - - created_at - title: Agent + title: Token + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + type: number + title: Logprob type: object - AgentStepResponse: - description: Response containing details of a specific agent step. - properties: - step: - discriminator: - mapping: - inference: '#/$defs/InferenceStep' - memory_retrieval: '#/$defs/MemoryRetrievalStep' - shield_call: '#/$defs/ShieldCallStep' - tool_execution: '#/$defs/ToolExecutionStep' - propertyName: step_type - oneOf: - - $ref: '#/components/schemas/InferenceStep' - - $ref: '#/components/schemas/ToolExecutionStep' - - $ref: '#/components/schemas/ShieldCallStep' - - $ref: '#/components/schemas/MemoryRetrievalStep' - title: Step required: - - step - title: AgentStepResponse - type: object - CompletionMessage: - description: A message containing the model's (assistant) response in a chat conversation. + - token + - logprob + title: OpenAITopLogProb + description: "The top log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token" + OpenAIUserMessageParam-Input: properties: role: - const: assistant - default: assistant - title: Role type: string + const: user + title: Role + default: user content: anyOf: - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' - items: + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' propertyName: type - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' + mapping: + file: '#/components/schemas/OpenAIFile' + image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' type: array title: Content - stop_reason: - $ref: '#/components/schemas/StopReason' - tool_calls: - title: Tool Calls - items: - $ref: '#/components/schemas/ToolCall' - type: array - required: - - content - - stop_reason - title: CompletionMessage - type: object - InferenceStep: - description: An inference step in an agent turn. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - title: Started At - format: date-time - type: string - nullable: true - completed_at: - title: Completed At - format: date-time - type: string - nullable: true - step_type: - const: inference - default: inference - title: Step Type - type: string - model_response: - $ref: '#/components/schemas/CompletionMessage' - required: - - turn_id - - step_id - - model_response - title: InferenceStep - type: object - ListOpenAIResponseInputItem: - description: List container for OpenAI response input items. - properties: - data: - items: - anyOf: - - discriminator: - mapping: - file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' - message: '#/$defs/OpenAIResponseMessage' - web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseMessage' - title: Data - type: array - object: - const: list - default: list - title: Object - type: string - required: - - data - title: ListOpenAIResponseInputItem + name: + anyOf: + - type: string + - type: 'null' + title: Name type: object - ListOpenAIResponseObject: - description: Paginated list of OpenAI response objects with navigation metadata. - properties: - data: - items: - $ref: '#/components/schemas/OpenAIResponseObjectWithInput' - title: Data - type: array - has_more: - title: Has More - type: boolean - first_id: - title: First Id - type: string - last_id: - title: Last Id - type: string - object: - const: list - default: list - title: Object - type: string required: - - data - - has_more - - first_id - - last_id - title: ListOpenAIResponseObject - type: object - MemoryRetrievalStep: - description: A memory retrieval step in an agent turn. + - content + title: OpenAIUserMessageParam + description: A message from the user in an OpenAI-compatible chat completion request. + OpenAIUserMessageParam-Output: properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - title: Started At - format: date-time - type: string - nullable: true - completed_at: - title: Completed At - format: date-time - type: string - nullable: true - step_type: - const: memory_retrieval - default: memory_retrieval - title: Step Type - type: string - vector_store_ids: - title: Vector Store Ids + role: type: string - inserted_context: + const: user + title: Role + default: user + content: anyOf: - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' - items: + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' propertyName: type - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' + mapping: + file: '#/components/schemas/OpenAIFile' + image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' type: array - title: Inserted Context - required: - - turn_id - - step_id - - vector_store_ids - - inserted_context - title: MemoryRetrievalStep + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name type: object - OpenAIDeleteResponseObject: - description: Response object confirming deletion of an OpenAI response. + required: + - content + title: OpenAIUserMessageParam + description: A message from the user in an OpenAI-compatible chat completion request. + OptimizerConfig: properties: - id: - title: Id - type: string - object: - const: response - default: response - title: Object - type: string - deleted: - default: true - title: Deleted - type: boolean + optimizer_type: + $ref: '#/components/schemas/OptimizerType' + lr: + type: number + title: Lr + weight_decay: + type: number + title: Weight Decay + num_warmup_steps: + type: integer + title: Num Warmup Steps + type: object required: - - id - title: OpenAIDeleteResponseObject + - optimizer_type + - lr + - weight_decay + - num_warmup_steps + title: OptimizerConfig + description: Configuration parameters for the optimization algorithm. + OptimizerType: + type: string + enum: + - adam + - adamw + - sgd + title: OptimizerType + description: Available optimizer algorithms for training. + Order: + type: string + enum: + - asc + - desc + title: Order + description: Sort order for paginated responses. + OutputTokensDetails: + properties: + reasoning_tokens: + type: integer + title: Reasoning Tokens + additionalProperties: true type: object + required: + - reasoning_tokens + title: OutputTokensDetails PaginatedResponse: - description: A generic paginated response that follows a simple format. properties: data: items: additionalProperties: true type: object - title: Data type: array + title: Data + description: The list of items for the current page. has_more: - title: Has More type: boolean + title: Has More + description: Whether there are more items available after this set. url: + anyOf: + - type: string + - type: 'null' title: Url - type: string - nullable: true + description: The URL for accessing this list. + type: object required: - data - has_more + - url title: PaginatedResponse - type: object - Session: - description: A single session of an interaction with an Agentic System. + description: A generic paginated response that follows a simple format. + PostTrainingJob: properties: - session_id: - title: Session Id + job_uuid: type: string - session_name: - title: Session Name + title: Job Uuid + description: The UUID of the job + type: object + required: + - job_uuid + title: PostTrainingJob + PostTrainingJobArtifactsResponse: + properties: + job_uuid: type: string - turns: + title: Job Uuid + description: The UUID of the job + checkpoints: items: - $ref: '#/components/schemas/Turn' - title: Turns + $ref: '#/components/schemas/Checkpoint' type: array - started_at: - format: date-time - title: Started At - type: string - required: - - session_id - - session_name - - turns - - started_at - title: Session + title: Checkpoints type: object - ShieldCallStep: - description: A shield call step in an agent turn. + required: + - job_uuid + title: PostTrainingJobArtifactsResponse + description: Artifacts of a finetuning job. + PostTrainingJobStatusResponse: properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id + job_uuid: type: string + title: Job Uuid + status: + $ref: '#/components/schemas/JobStatus' + scheduled_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Scheduled At started_at: + anyOf: + - type: string + format: date-time + - type: 'null' title: Started At - format: date-time - type: string - nullable: true completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' title: Completed At - format: date-time - type: string - nullable: true - step_type: - const: shield_call - default: shield_call - title: Step Type + resources_allocated: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Resources Allocated + checkpoints: + items: + $ref: '#/components/schemas/Checkpoint' + type: array + title: Checkpoints + type: object + required: + - job_uuid + - status + title: PostTrainingJobStatusResponse + description: Status of a finetuning job. + PostTrainingMetric: + properties: + epoch: + type: integer + title: Epoch + description: Training epoch number. + train_loss: + type: number + title: Train Loss + description: Loss value on the training dataset. + validation_loss: + type: number + title: Validation Loss + description: Loss value on the validation dataset. + perplexity: + type: number + title: Perplexity + description: Perplexity metric indicating model confidence. + type: object + required: + - epoch + - train_loss + - validation_loss + - perplexity + title: PostTrainingMetric + description: Training metrics captured during post-training jobs. + PreferenceOptimizeRequest: + properties: + job_uuid: type: string - violation: - $ref: '#/components/schemas/SafetyViolation' + title: Job Uuid + description: The UUID of the job to create + finetuned_model: + type: string + title: Finetuned Model + description: The model to fine-tune + algorithm_config: + $ref: '#/components/schemas/DPOAlignmentConfig' + description: The algorithm configuration + training_config: + $ref: '#/components/schemas/TrainingConfig' + description: The training configuration + hyperparam_search_config: + additionalProperties: true + type: object + title: Hyperparam Search Config + description: The hyperparam search configuration + logger_config: + additionalProperties: true + type: object + title: Logger Config + description: The logger configuration + type: object required: - - turn_id - - step_id - - violation - title: ShieldCallStep + - job_uuid + - finetuned_model + - algorithm_config + - training_config + - hyperparam_search_config + - logger_config + title: PreferenceOptimizeRequest + description: Request to run preference optimization of a model. + Prompt: + properties: + prompt: + anyOf: + - type: string + - type: 'null' + title: Prompt + description: The system prompt text with variable placeholders. Variables are only supported when using the Responses API. + version: + type: integer + minimum: 1.0 + title: Version + description: Version (integer starting at 1, incremented on save). + prompt_id: + type: string + title: Prompt Id + description: Unique identifier formatted as 'pmpt_<48-digit-hash>'. + variables: + items: + type: string + type: array + title: Variables + description: List of prompt variable names that can be used in the prompt template. + is_default: + type: boolean + title: Is Default + description: Boolean indicating whether this version is the default version for this prompt. + default: false type: object - ToolExecutionStep: - description: A tool execution step in an agent turn. + required: + - version + - prompt_id + title: Prompt + description: A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack. + ProviderInfo: properties: - turn_id: - title: Turn Id + api: type: string - step_id: - title: Step Id + title: Api + description: The API name this provider implements + provider_id: type: string - started_at: - title: Started At - format: date-time + title: Provider Id + description: Unique identifier for the provider + provider_type: type: string - nullable: true - completed_at: - title: Completed At - format: date-time + title: Provider Type + description: The type of provider implementation + config: + additionalProperties: true + type: object + title: Config + description: Configuration parameters for the provider + health: + additionalProperties: true + type: object + title: Health + description: Current health status of the provider + type: object + required: + - api + - provider_id + - provider_type + - config + - health + title: ProviderInfo + description: Information about a registered provider including its configuration and health status. + QATFinetuningConfig: + properties: + type: type: string - nullable: true - step_type: - const: tool_execution - default: tool_execution - title: Step Type + const: QAT + title: Type + default: QAT + quantizer_name: type: string - tool_calls: + title: Quantizer Name + group_size: + type: integer + title: Group Size + type: object + required: + - quantizer_name + - group_size + title: QATFinetuningConfig + description: Configuration for Quantization-Aware Training (QAT) fine-tuning. + QueryChunksRequest: + properties: + vector_store_id: + type: string + title: Vector Store Id + description: The identifier of the vector database to query. + query: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Query + description: The query to search for. + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + description: The parameters of the query. + type: object + required: + - vector_store_id + - query + title: QueryChunksRequest + description: Request to query chunks from a vector database. + QueryChunksResponse: + properties: + chunks: items: - $ref: '#/components/schemas/ToolCall' - title: Tool Calls + $ref: '#/components/schemas/Chunk-Output' type: array - tool_responses: + title: Chunks + scores: items: - $ref: '#/components/schemas/ToolResponse' - title: Tool Responses + type: number type: array - required: - - turn_id - - step_id - - tool_calls - - tool_responses - title: ToolExecutionStep + title: Scores type: object - ToolResponse: - description: Response from a tool invocation. + required: + - chunks + - scores + title: QueryChunksResponse + description: Response from querying chunks in a vector database. + RAGDocument: properties: - call_id: - title: Call Id + document_id: type: string - tool_name: - anyOf: - - $ref: '#/components/schemas/BuiltinTool' - - type: string - title: Tool Name + title: Document Id content: anyOf: - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/components/schemas/ImageContentItem' + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type oneOf: - - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/ImageContentItem-Input' - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' type: array + - $ref: '#/components/schemas/URL' title: Content + mime_type: + anyOf: + - type: string + - type: 'null' + title: Mime Type metadata: - title: Metadata additionalProperties: true type: object - nullable: true + title: Metadata + type: object required: - - call_id - - tool_name + - document_id - content - title: ToolResponse - type: object - ListBatchesResponse: - description: Response containing a list of batch objects. + title: RAGDocument + description: "A document to be used for document ingestion in the RAG Tool.\n\n:param document_id: The unique identifier for the document.\n:param content: The content of the document.\n:param mime_type: The MIME type of the document.\n:param metadata: Additional metadata for the document." + RAGQueryConfig: properties: - object: - const: list - default: list - title: Object - type: string - data: - description: List of batch objects - items: - $ref: '#/components/schemas/Batch' - title: Data - type: array - first_id: - description: ID of the first batch in the list - title: First Id - type: string - nullable: true - last_id: - description: ID of the last batch in the list - title: Last Id + query_generator_config: + oneOf: + - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' + title: Query Generator Config + default: + type: default + separator: ' ' + discriminator: + propertyName: type + mapping: + default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' + max_tokens_in_context: + type: integer + title: Max Tokens In Context + default: 4096 + max_chunks: + type: integer + title: Max Chunks + default: 5 + chunk_template: type: string - nullable: true - has_more: - default: false - description: Whether there are more batches available - title: Has More - type: boolean - required: - - data - title: ListBatchesResponse + title: Chunk Template + default: "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n" + mode: + anyOf: + - $ref: '#/components/schemas/RAGSearchMode' + - type: 'null' + default: vector + ranker: + anyOf: + - oneOf: + - $ref: '#/components/schemas/RRFRanker' + - $ref: '#/components/schemas/WeightedRanker' + discriminator: + propertyName: type + mapping: + rrf: '#/components/schemas/RRFRanker' + weighted: '#/components/schemas/WeightedRanker' + - type: 'null' + title: Ranker type: object - ConversationDeletedResource: - description: Response for deleted conversation. + title: RAGQueryConfig + description: "Configuration for the RAG query generation.\n\n:param query_generator_config: Configuration for the query generator.\n:param max_tokens_in_context: Maximum number of tokens in the context.\n:param max_chunks: Maximum number of chunks to retrieve.\n:param chunk_template: Template for formatting each retrieved chunk in the context.\n Available placeholders: {index} (1-based chunk ordinal), {chunk.content} (chunk content string), {metadata} (chunk metadata dict).\n Default: \"Result {index}\\nContent: {chunk.content}\\nMetadata: {metadata}\\n\"\n:param mode: Search mode for retrieval—either \"vector\", \"keyword\", or \"hybrid\". Default \"vector\".\n:param ranker: Configuration for the ranker to use in hybrid search. Defaults to RRF ranker." + RAGQueryResult: properties: - id: - description: The deleted conversation identifier - title: Id - type: string - object: - default: conversation.deleted - description: Object type - title: Object - type: string - deleted: - default: true - description: Whether the object was deleted - title: Deleted - type: boolean - required: - - id - title: ConversationDeletedResource + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + title: Content + metadata: + additionalProperties: true + type: object + title: Metadata type: object - ConversationItemDeletedResource: - description: Response for deleted conversation item. + title: RAGQueryResult + description: "Result of a RAG query containing retrieved content and metadata.\n\n:param content: (Optional) The retrieved content from the query\n:param metadata: Additional metadata about the query result" + RAGSearchMode: + type: string + enum: + - vector + - keyword + - hybrid + title: RAGSearchMode + description: "Search modes for RAG query retrieval:\n- VECTOR: Uses vector similarity search for semantic matching\n- KEYWORD: Uses keyword-based search for exact matching\n- HYBRID: Combines both vector and keyword search for better results" + RRFRanker: properties: - id: - description: The deleted item identifier - title: Id - type: string - object: - default: conversation.item.deleted - description: Object type - title: Object + type: type: string - deleted: - default: true - description: Whether the object was deleted - title: Deleted - type: boolean - required: - - id - title: ConversationItemDeletedResource + const: rrf + title: Type + default: rrf + impact_factor: + type: number + title: Impact Factor + default: 60.0 + minimum: 0.0 type: object - ListOpenAIFileResponse: - description: Response for listing files in OpenAI Files API. + title: RRFRanker + description: "Reciprocal Rank Fusion (RRF) ranker configuration.\n\n:param type: The type of ranker, always \"rrf\"\n:param impact_factor: The impact factor for RRF scoring. Higher values give more weight to higher-ranked results.\n Must be greater than 0" + RegexParserScoringFnParams: properties: - data: + type: + type: string + const: regex_parser + title: Type + default: regex_parser + parsing_regexes: items: - $ref: '#/components/schemas/OpenAIFileObject' - title: Data + type: string type: array - has_more: - title: Has More - type: boolean - first_id: - title: First Id - type: string - last_id: - title: Last Id - type: string - object: - const: list - default: list - title: Object - type: string - required: - - data - - has_more - - first_id - - last_id - title: ListOpenAIFileResponse - type: object - OpenAIFileDeleteResponse: - description: Response for deleting a file in OpenAI Files API. - properties: - id: - title: Id - type: string - object: - const: file - default: file - title: Object - type: string - deleted: - title: Deleted - type: boolean - required: - - id - - deleted - title: OpenAIFileDeleteResponse - type: object - ListOpenAIChatCompletionResponse: - description: Response from listing OpenAI-compatible chat completions. - properties: - data: + title: Parsing Regexes + description: Regex to extract the answer from generated response + aggregation_functions: items: - $ref: '#/$defs/RouteInfo' - title: Data + $ref: '#/components/schemas/AggregationFunctionType' type: array - required: - - data - title: ListRoutesResponse - description: >- - Response containing a list of all available API routes. - OpenAIModel: + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row type: object + title: RegexParserScoringFnParams + description: Parameters for regex parser scoring function configuration. + RegisterBenchmarkRequest: properties: - id: + benchmark_id: type: string - object: - type: string - const: model - default: model - created: - type: integer - owned_by: + title: Benchmark Id + description: The ID of the benchmark to register + dataset_id: type: string - custom_metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - additionalProperties: false - required: - - id - - object - - created - - owned_by - title: OpenAIModel - description: A model from OpenAI. - OpenAIListModelsResponse: + title: Dataset Id + description: The ID of the dataset to use for the benchmark + scoring_functions: + items: + type: string + type: array + title: Scoring Functions + description: The scoring functions to use for the benchmark + provider_benchmark_id: + anyOf: + - type: string + - type: 'null' + title: Provider Benchmark Id + description: The ID of the provider benchmark to use for the benchmark + provider_id: + anyOf: + - type: string + - type: 'null' + title: Provider Id + description: The ID of the provider to use for the benchmark + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: The metadata to use for the benchmark type: object + required: + - benchmark_id + - dataset_id + - scoring_functions + title: RegisterBenchmarkRequest + description: Request model for registering a benchmark. + RegisterDatasetRequest: properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAIModel' - additionalProperties: false + purpose: + $ref: '#/components/schemas/DatasetPurpose' + description: The purpose of the dataset + source: + oneOf: + - $ref: '#/components/schemas/URIDataSource' + - $ref: '#/components/schemas/RowsDataSource' + title: Source + description: The data source of the dataset + discriminator: + propertyName: type + mapping: + rows: '#/components/schemas/RowsDataSource' + uri: '#/components/schemas/URIDataSource' + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: The metadata for the dataset + dataset_id: + anyOf: + - type: string + - type: 'null' + title: Dataset Id + description: The ID of the dataset. If not provided, an ID will be generated + type: object required: - - data - title: OpenAIListModelsResponse - ModelType: - type: string - enum: - - llm - - embedding - - rerank - title: ModelType - description: >- - Enumeration of supported model types in Llama Stack. + - purpose + - source + title: RegisterDatasetRequest + description: Request model for registering a dataset. RegisterModelRequest: - type: object properties: model_id: type: string + title: Model Id description: The identifier of the model to register. provider_model_id: - type: string - description: >- - The identifier of the model in the provider. + anyOf: + - type: string + - type: 'null' + title: Provider Model Id + description: The identifier of the model in the provider. provider_id: - type: string + anyOf: + - type: string + - type: 'null' + title: Provider Id description: The identifier of the provider. metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata description: Any additional metadata for this model. model_type: - $ref: '#/components/schemas/ModelType' + anyOf: + - $ref: '#/components/schemas/ModelType' + - type: 'null' description: The type of model to register. - additionalProperties: false + type: object required: - - model_id + - model_id title: RegisterModelRequest - Model: - type: object + description: Request model for registering a new model. + RegisterScoringFunctionRequest: properties: - identifier: + scoring_fn_id: type: string - description: >- - Unique identifier for this resource in llama stack - provider_resource_id: + title: Scoring Fn Id + description: The ID of the scoring function to register + description: type: string - description: >- - Unique identifier for this resource in the provider + title: Description + description: The description of the scoring function + return_type: + oneOf: + - $ref: '#/components/schemas/StringType' + - $ref: '#/components/schemas/NumberType' + - $ref: '#/components/schemas/BooleanType' + - $ref: '#/components/schemas/ArrayType' + - $ref: '#/components/schemas/ObjectType' + - $ref: '#/components/schemas/JsonType' + - $ref: '#/components/schemas/UnionType' + - $ref: '#/components/schemas/ChatCompletionInputType' + - $ref: '#/components/schemas/CompletionInputType' + - $ref: '#/components/schemas/AgentTurnInputType' + title: Return Type + description: The return type of the scoring function + discriminator: + propertyName: type + mapping: + agent_turn_input: '#/components/schemas/AgentTurnInputType' + array: '#/components/schemas/ArrayType' + boolean: '#/components/schemas/BooleanType' + chat_completion_input: '#/components/schemas/ChatCompletionInputType' + completion_input: '#/components/schemas/CompletionInputType' + json: '#/components/schemas/JsonType' + number: '#/components/schemas/NumberType' + object: '#/components/schemas/ObjectType' + string: '#/components/schemas/StringType' + union: '#/components/schemas/UnionType' + provider_scoring_fn_id: + anyOf: + - type: string + - type: 'null' + title: Provider Scoring Fn Id + description: The ID of the provider scoring function to use for the scoring function provider_id: - type: string - description: >- - ID of the provider that owns this resource - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: model - default: model - description: >- - The resource type, always 'model' for model resources - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Any additional metadata for this model - model_type: - $ref: '#/components/schemas/ModelType' - default: llm - description: >- - The type of model (LLM or embedding model) - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: Provider Id + description: The ID of the provider to use for the scoring function + params: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' + title: Params + description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval + type: object required: - - identifier - - provider_id - - type - - metadata - - model_type - title: Model - description: >- - A model resource representing an AI model registered in Llama Stack. - RunModerationRequest: + - scoring_fn_id + - description + - return_type + title: RegisterScoringFunctionRequest + description: Request model for registering a scoring function. + RegisterShieldRequest: + properties: + shield_id: + type: string + title: Shield Id + description: The identifier of the shield to register + provider_shield_id: + anyOf: + - type: string + - type: 'null' + title: Provider Shield Id + description: The identifier of the shield in the provider + provider_id: + anyOf: + - type: string + - type: 'null' + title: Provider Id + description: The identifier of the provider + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + description: The parameters of the shield type: object - ModerationObject: - $defs: - ModerationObjectResults: - description: >- - A moderation object. - - :param flagged: Whether any of the below categories are flagged. - - :param categories: A list of the categories, and whether they are flagged - or not. - - :param category_applied_input_types: A list of the categories along with - the input type(s) that the score applies to. - - :param category_scores: A list of the categories along with their scores - as predicted by model. - properties: - flagged: - title: Flagged - type: boolean - categories: - anyOf: - - additionalProperties: - type: boolean - type: object - - type: 'null' - title: Categories - category_applied_input_types: - anyOf: - - additionalProperties: - items: - type: string - type: array - type: object - - type: 'null' - title: Category Applied Input Types - category_scores: - anyOf: - - additionalProperties: - type: number - type: object - - type: 'null' - title: Category Scores - user_message: - anyOf: - - type: string - - type: 'null' - title: User Message - metadata: - additionalProperties: true - title: Metadata - type: object - required: - - flagged - title: ModerationObjectResults - type: object - description: >- - A moderation object. - - :param id: The unique identifier for the moderation request. - - :param model: The model used to generate the moderation results. - - :param results: A list of moderation objects + required: + - shield_id + title: RegisterShieldRequest + description: Request model for registering a shield. + RegisterToolGroupRequest: properties: - id: - title: Id + toolgroup_id: type: string - model: - title: Model + title: Toolgroup Id + description: The ID of the tool group to register + provider_id: type: string - results: - items: - $ref: '#/$defs/ModerationObjectResults' - title: Results - type: array + title: Provider Id + description: The ID of the provider to use for the tool group + mcp_endpoint: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + description: The MCP endpoint to use for the tool group + args: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Args + description: A dictionary of arguments to pass to the tool group + type: object required: - - id - - model - - results - title: ModerationObject + - toolgroup_id + - provider_id + title: RegisterToolGroupRequest + description: Request model for registering a tool group. + RerankData: + properties: + index: + type: integer + title: Index + relevance_score: + type: number + title: Relevance Score type: object - ListPromptsResponse: - $defs: - Prompt: - description: >- - A prompt resource representing a stored OpenAI Compatible prompt template - in Llama Stack. - - - :param prompt: The system prompt text with variable placeholders. Variables - are only supported when using the Responses API. - - :param version: Version (integer starting at 1, incremented on save) - - :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' - - :param variables: List of prompt variable names that can be used in the - prompt template - - :param is_default: Boolean indicating whether this version is the default - version for this prompt - properties: - prompt: - anyOf: - - type: string - - type: 'null' - description: >- - The system prompt with variable placeholders - title: Prompt - version: - description: >- - Version (integer starting at 1, incremented on save) - minimum: 1 - title: Version - type: integer - prompt_id: - description: >- - Unique identifier in format 'pmpt_<48-digit-hash>' - title: Prompt Id - type: string - variables: - description: >- - List of variable names that can be used in the prompt template - items: - type: string - title: Variables - type: array - is_default: - default: false - description: >- - Boolean indicating whether this version is the default version - title: Is Default - type: boolean - required: - - version - - prompt_id - title: Prompt - type: object - description: Response model to list prompts. + required: + - index + - relevance_score + title: RerankData + description: A single rerank result from a reranking response. + RerankResponse: properties: data: items: - $ref: '#/$defs/Prompt' - title: Data + $ref: '#/components/schemas/RerankData' type: array - required: - - data - title: ListPromptsResponse + title: Data type: object - CreatePromptRequest: + required: + - data + title: RerankResponse + description: Response from a reranking request. + ResponseGuardrailSpec: + properties: + type: + type: string + title: Type + description: The type/identifier of the guardrail. type: object - Prompt: - description: >- - A prompt resource representing a stored OpenAI Compatible prompt template - in Llama Stack. - - - :param prompt: The system prompt text with variable placeholders. Variables - are only supported when using the Responses API. - - :param version: Version (integer starting at 1, incremented on save) - - :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' - - :param variables: List of prompt variable names that can be used in the prompt - template - - :param is_default: Boolean indicating whether this version is the default - version for this prompt + required: + - type + title: ResponseGuardrailSpec + description: Specification for a guardrail to apply during response generation. + RouteInfo: properties: - prompt: - anyOf: - - type: string - - type: 'null' - description: >- - The system prompt with variable placeholders - title: Prompt - version: - description: >- - Version (integer starting at 1, incremented on save) - minimum: 1 - title: Version - type: integer - prompt_id: - description: >- - Unique identifier in format 'pmpt_<48-digit-hash>' - title: Prompt Id + route: type: string - variables: - description: >- - List of variable names that can be used in the prompt template + title: Route + description: The API endpoint path + method: + type: string + title: Method + description: HTTP method for the route + provider_types: items: type: string - title: Variables type: array - is_default: - default: false - description: >- - Boolean indicating whether this version is the default version - title: Is Default - type: boolean - required: - - version - - prompt_id - title: Prompt - type: object - UpdatePromptRequest: - type: object - SetDefaultVersionRequest: + title: Provider Types + description: List of provider types that implement this route type: object - ListProvidersResponse: - $defs: - ProviderInfo: - description: >- - Information about a registered provider including its configuration and - health status. - - - :param api: The API name this provider implements - - :param provider_id: Unique identifier for the provider - - :param provider_type: The type of provider implementation - - :param config: Configuration parameters for the provider - - :param health: Current health status of the provider - properties: - api: - title: Api - type: string - provider_id: - title: Provider Id - type: string - provider_type: - title: Provider Type - type: string - config: - additionalProperties: true - title: Config - type: object - health: - additionalProperties: true - title: Health - type: object - required: - - api - - provider_id - - provider_type - - config - - health - title: ProviderInfo - type: object - description: >- - Response containing a list of all available providers. - - - :param data: List of provider information objects + required: + - route + - method + - provider_types + title: RouteInfo + description: Information about an API route including its path, method, and implementing providers. + RowsDataSource: properties: - data: + type: + type: string + const: rows + title: Type + description: The type of data source + default: rows + rows: items: - $ref: '#/$defs/ProviderInfo' - title: Data + additionalProperties: true + type: object type: array + title: Rows + description: "The dataset is stored in rows. E.g. [{'messages': [{'role': 'user', 'content': 'Hello, world!'}, {'role': 'assistant', 'content': 'Hello, world!'}]}]" + type: object required: - - data - title: ListProvidersResponse + - rows + title: RowsDataSource + description: A dataset stored in rows. + RunModerationRequest: + properties: + input: + anyOf: + - type: string + - items: + type: string + type: array + title: Input + description: Input (or inputs) to classify. Can be a single string, an array of strings, or an array of multi-modal input objects similar to other models. + model: + anyOf: + - type: string + - type: 'null' + title: Model + description: The content moderation model you would like to use. type: object - ProviderInfo: - description: >- - Information about a registered provider including its configuration and health - status. - - - :param api: The API name this provider implements - - :param provider_id: Unique identifier for the provider - - :param provider_type: The type of provider implementation - - :param config: Configuration parameters for the provider - - :param health: Current health status of the provider + required: + - input + title: RunModerationRequest + description: Request model for running moderation. + RunShieldRequest: properties: - api: - title: Api - type: string - provider_id: - title: Provider Id - type: string - provider_type: - title: Provider Type + shield_id: type: string - config: - additionalProperties: true - title: Config - type: object - health: - additionalProperties: true - title: Health - type: object - required: - - api - - provider_id - - provider_type - - config - - health - title: ProviderInfo - type: object - ListOpenAIResponseObject: - $defs: - AllowedToolsFilter: - description: >- - Filter configuration for restricting which MCP tools can be used. - - - :param tool_names: (Optional) List of specific tool names that are allowed - properties: - tool_names: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Tool Names - title: AllowedToolsFilter - type: object - MCPListToolsTool: - description: >- - Tool definition returned by MCP list tools operation. - - - :param input_schema: JSON schema defining the tool's input parameters - - :param name: Name of the tool - - :param description: (Optional) Description of what the tool does - properties: - input_schema: - additionalProperties: true - title: Input Schema - type: object - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - required: - - input_schema - - name - title: MCPListToolsTool - type: object - OpenAIResponseAnnotationCitation: - description: >- - URL citation annotation for referencing external web resources. - - - :param type: Annotation type identifier, always "url_citation" - - :param end_index: End position of the citation span in the content - - :param start_index: Start position of the citation span in the content - - :param title: Title of the referenced web resource - - :param url: URL of the referenced web resource - properties: - type: - const: url_citation - default: url_citation - title: Type - type: string - end_index: - title: End Index - type: integer - start_index: - title: Start Index - type: integer - title: - title: Title - type: string - url: - title: Url - type: string - required: - - end_index - - start_index - - title - - url - title: OpenAIResponseAnnotationCitation - type: object - "OpenAIResponseAnnotationContainerFileCitation": - properties: - type: - const: container_file_citation - default: container_file_citation - title: Type - type: string - container_id: - title: Container Id - type: string - end_index: - title: End Index - type: integer - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - start_index: - title: Start Index - type: integer - required: - - container_id - - end_index - - file_id - - filename - - start_index - title: >- - OpenAIResponseAnnotationContainerFileCitation - type: object - OpenAIResponseAnnotationFileCitation: - description: >- - File citation annotation for referencing specific files in response content. - - - :param type: Annotation type identifier, always "file_citation" - - :param file_id: Unique identifier of the referenced file - - :param filename: Name of the referenced file - - :param index: Position index of the citation within the content - properties: - type: - const: file_citation - default: file_citation - title: Type - type: string - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - index: - title: Index - type: integer - required: - - file_id - - filename - - index - title: OpenAIResponseAnnotationFileCitation - type: object - OpenAIResponseAnnotationFilePath: - properties: - type: - const: file_path - default: file_path - title: Type - type: string - file_id: - title: File Id - type: string - index: - title: Index - type: integer - required: - - file_id - - index - title: OpenAIResponseAnnotationFilePath - type: object - OpenAIResponseContentPartRefusal: - description: >- - Refusal content within a streamed response part. - - - :param type: Content part type identifier, always "refusal" - - :param refusal: Refusal text supplied by the model - properties: - type: - const: refusal - default: refusal - title: Type - type: string - refusal: - title: Refusal - type: string - required: - - refusal - title: OpenAIResponseContentPartRefusal - type: object - OpenAIResponseError: - description: >- - Error details for failed OpenAI response requests. - - - :param code: Error code identifying the type of failure - - :param message: Human-readable error message describing the failure - properties: - code: - title: Code - type: string - message: - title: Message - type: string - required: - - code - - message - title: OpenAIResponseError - type: object - "OpenAIResponseInputFunctionToolCallOutput": - description: >- - This represents the output of a function call that gets passed back to - the model. - properties: - call_id: - title: Call Id - type: string - output: - title: Output - type: string - type: - const: function_call_output - default: function_call_output - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - output - title: >- - OpenAIResponseInputFunctionToolCallOutput - type: object - OpenAIResponseInputMessageContentImage: - description: >- - Image content for input messages in OpenAI response format. - - - :param detail: Level of detail for image processing, can be "low", "high", - or "auto" - - :param type: Content type identifier, always "input_image" - - :param image_url: (Optional) URL of the image content - properties: - detail: - anyOf: - - const: low - type: string - - const: high - type: string - - const: auto - type: string - default: auto - title: Detail - type: - const: input_image - default: input_image - title: Type - type: string - image_url: - anyOf: - - type: string - - type: 'null' - title: Image Url - title: OpenAIResponseInputMessageContentImage - type: object - OpenAIResponseInputMessageContentText: - description: >- - Text content for input messages in OpenAI response format. - - - :param text: The text content of the input message - - :param type: Content type identifier, always "input_text" - properties: - text: - title: Text - type: string - type: - const: input_text - default: input_text - title: Type - type: string - required: - - text - title: OpenAIResponseInputMessageContentText - type: object - OpenAIResponseInputToolFileSearch: - description: >- - File search tool configuration for OpenAI response inputs. - - - :param type: Tool type identifier, always "file_search" - - :param vector_store_ids: List of vector store identifiers to search within - - :param filters: (Optional) Additional filters to apply to the search - - :param max_num_results: (Optional) Maximum number of search results to - return (1-50) - - :param ranking_options: (Optional) Options for ranking and scoring search - results - properties: - type: - const: file_search - default: file_search - title: Type - type: string - vector_store_ids: - items: - type: string - title: Vector Store Ids - type: array - filters: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Filters - max_num_results: - anyOf: - - maximum: 50 - minimum: 1 - type: integer - - type: 'null' - default: 10 - title: Max Num Results - ranking_options: - anyOf: - - $ref: '#/$defs/SearchRankingOptions' - - type: 'null' - required: - - vector_store_ids - title: OpenAIResponseInputToolFileSearch - type: object - OpenAIResponseInputToolFunction: - description: >- - Function tool configuration for OpenAI response inputs. - - - :param type: Tool type identifier, always "function" - - :param name: Name of the function that can be called - - :param description: (Optional) Description of what the function does - - :param parameters: (Optional) JSON schema defining the function's parameters - - :param strict: (Optional) Whether to enforce strict parameter validation - properties: - type: - const: function - default: function - title: Type - type: string - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - parameters: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Parameters - strict: - anyOf: - - type: boolean - - type: 'null' - title: Strict - required: - - name - - parameters - title: OpenAIResponseInputToolFunction - type: object - OpenAIResponseInputToolWebSearch: - description: >- - Web search tool configuration for OpenAI response inputs. - - - :param type: Web search tool type variant to use - - :param search_context_size: (Optional) Size of search context, must be - "low", "medium", or "high" - properties: - type: - anyOf: - - const: web_search - type: string - - const: web_search_preview - type: string - - const: web_search_preview_2025_03_11 - type: string - default: web_search - title: Type - search_context_size: - anyOf: - - pattern: ^low|medium|high$ - type: string - - type: 'null' - default: medium - title: Search Context Size - title: OpenAIResponseInputToolWebSearch - type: object - OpenAIResponseMCPApprovalRequest: - description: >- - A request for human approval of a tool invocation. - properties: - arguments: - title: Arguments - type: string - id: - title: Id - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - type: - const: mcp_approval_request - default: mcp_approval_request - title: Type - type: string - required: - - arguments - - id - - name - - server_label - title: OpenAIResponseMCPApprovalRequest - type: object - OpenAIResponseMCPApprovalResponse: - description: A response to an MCP approval request. - properties: - approval_request_id: - title: Approval Request Id - type: string - approve: - title: Approve - type: boolean - type: - const: mcp_approval_response - default: mcp_approval_response - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - reason: - anyOf: - - type: string - - type: 'null' - title: Reason - required: - - approval_request_id - - approve - title: OpenAIResponseMCPApprovalResponse - type: object - OpenAIResponseMessage: - description: >- - Corresponds to the various Message types in the Responses API. - - They are all under one type because the Responses API gives them all - - the same "type" value, and there is no way to tell them apart in certain - - scenarios. - properties: - content: - anyOf: - - type: string - - items: - discriminator: - mapping: - input_image: >- - #/$defs/OpenAIResponseInputMessageContentImage - input_text: >- - #/$defs/OpenAIResponseInputMessageContentText - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentText - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentImage - type: array - - items: - discriminator: - mapping: - output_text: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - refusal: '#/$defs/OpenAIResponseContentPartRefusal' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - - $ref: '#/$defs/OpenAIResponseContentPartRefusal' - type: array - title: Content - role: - anyOf: - - const: system - type: string - - const: developer - type: string - - const: user - type: string - - const: assistant - type: string - title: Role - type: - const: message - default: message - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - content - - role - title: OpenAIResponseMessage - type: object - OpenAIResponseObjectWithInput: - description: >- - OpenAI response object extended with input context information. - - - :param input: List of input items that led to this response - properties: - created_at: - title: Created At - type: integer - error: - anyOf: - - $ref: '#/$defs/OpenAIResponseError' - - type: 'null' - id: - title: Id - type: string - model: - title: Model - type: string - object: - const: response - default: response - title: Object - type: string - output: - items: - discriminator: - mapping: - file_search_call: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - function_call: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - mcp_list_tools: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - message: '#/$defs/OpenAIResponseMessage' - web_search_call: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseMessage' - - $ref: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' - title: Output - type: array - parallel_tool_calls: - default: false - title: Parallel Tool Calls - type: boolean - previous_response_id: - anyOf: - - type: string - - type: 'null' - title: Previous Response Id - status: - title: Status - type: string - temperature: - anyOf: - - type: number - - type: 'null' - title: Temperature - text: - $ref: '#/$defs/OpenAIResponseText' - default: - format: - type: text - top_p: - anyOf: - - type: number - - type: 'null' - title: Top P - tools: - anyOf: - - items: - discriminator: - mapping: - file_search: >- - #/$defs/OpenAIResponseInputToolFileSearch - function: '#/$defs/OpenAIResponseInputToolFunction' - mcp: '#/$defs/OpenAIResponseToolMCP' - web_search: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseInputToolWebSearch' - - $ref: >- - #/$defs/OpenAIResponseInputToolFileSearch - - $ref: '#/$defs/OpenAIResponseInputToolFunction' - - $ref: '#/$defs/OpenAIResponseToolMCP' - type: array - - type: 'null' - title: Tools - truncation: - anyOf: - - type: string - - type: 'null' - title: Truncation - usage: - anyOf: - - $ref: '#/$defs/OpenAIResponseUsage' - - type: 'null' - instructions: - anyOf: - - type: string - - type: 'null' - title: Instructions - input: - items: - anyOf: - - discriminator: - mapping: - file_search_call: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - function_call: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - mcp_list_tools: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - message: '#/$defs/OpenAIResponseMessage' - web_search_call: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseMessage' - - $ref: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' - - $ref: >- - #/$defs/OpenAIResponseInputFunctionToolCallOutput - - $ref: >- - #/$defs/OpenAIResponseMCPApprovalResponse - - $ref: '#/$defs/OpenAIResponseMessage' - title: Input - type: array - required: - - created_at - - id - - model - - output - - status - - input - title: OpenAIResponseObjectWithInput - type: object - "OpenAIResponseOutputMessageContentOutputText": - properties: - text: - title: Text - type: string - type: - const: output_text - default: output_text - title: Type - type: string - annotations: - items: - discriminator: - mapping: - container_file_citation: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - file_citation: >- - #/$defs/OpenAIResponseAnnotationFileCitation - file_path: '#/$defs/OpenAIResponseAnnotationFilePath' - url_citation: '#/$defs/OpenAIResponseAnnotationCitation' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseAnnotationFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationCitation' - - $ref: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' - title: Annotations - type: array - required: - - text - title: >- - OpenAIResponseOutputMessageContentOutputText - type: object - "OpenAIResponseOutputMessageFileSearchToolCall": - description: >- - File search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param queries: List of search queries executed - - :param status: Current status of the file search operation - - :param type: Tool call type identifier, always "file_search_call" - - :param results: (Optional) Search results returned by the file search - operation - properties: - id: - title: Id - type: string - queries: - items: - type: string - title: Queries - type: array - status: - title: Status - type: string - type: - const: file_search_call - default: file_search_call - title: Type - type: string - results: - anyOf: - - items: - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults - type: array - - type: 'null' - title: Results - required: - - id - - queries - - status - title: >- - OpenAIResponseOutputMessageFileSearchToolCall - type: object - "OpenAIResponseOutputMessageFileSearchToolCallResults": - description: >- - Search results returned by the file search operation. - - - :param attributes: (Optional) Key-value attributes associated with the - file - - :param file_id: Unique identifier of the file containing the result - - :param filename: Name of the file containing the result - - :param score: Relevance score for this search result (between 0 and 1) - - :param text: Text content of the search result - properties: - attributes: - additionalProperties: true - title: Attributes - type: object - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - score: - title: Score - type: number - text: - title: Text - type: string - required: - - attributes - - file_id - - filename - - score - - text - title: >- - OpenAIResponseOutputMessageFileSearchToolCallResults - type: object - "OpenAIResponseOutputMessageFunctionToolCall": - description: >- - Function tool call output message for OpenAI responses. - - - :param call_id: Unique identifier for the function call - - :param name: Name of the function being called - - :param arguments: JSON string containing the function arguments - - :param type: Tool call type identifier, always "function_call" - - :param id: (Optional) Additional identifier for the tool call - - :param status: (Optional) Current status of the function call execution - properties: - call_id: - title: Call Id - type: string - name: - title: Name - type: string - arguments: - title: Arguments - type: string - type: - const: function_call - default: function_call - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - name - - arguments - title: >- - OpenAIResponseOutputMessageFunctionToolCall - type: object - OpenAIResponseOutputMessageMCPCall: - description: >- - Model Context Protocol (MCP) call output message for OpenAI responses. - - - :param id: Unique identifier for this MCP call - - :param type: Tool call type identifier, always "mcp_call" - - :param arguments: JSON string containing the MCP call arguments - - :param name: Name of the MCP method being called - - :param server_label: Label identifying the MCP server handling the call - - :param error: (Optional) Error message if the MCP call failed - - :param output: (Optional) Output result from the successful MCP call - properties: - id: - title: Id - type: string - type: - const: mcp_call - default: mcp_call - title: Type - type: string - arguments: - title: Arguments - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - error: - anyOf: - - type: string - - type: 'null' - title: Error - output: - anyOf: - - type: string - - type: 'null' - title: Output - required: - - id - - arguments - - name - - server_label - title: OpenAIResponseOutputMessageMCPCall + title: Shield Id + description: The identifier of the shield to run. + messages: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Input' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Input' + type: array + title: Messages + description: The messages to run the shield on. + params: + additionalProperties: true type: object - OpenAIResponseOutputMessageMCPListTools: - description: >- - MCP list tools output message containing available tools from an MCP server. - - - :param id: Unique identifier for this MCP list tools operation - - :param type: Tool call type identifier, always "mcp_list_tools" - - :param server_label: Label identifying the MCP server providing the tools - - :param tools: List of available tools provided by the MCP server - properties: - id: - title: Id - type: string - type: - const: mcp_list_tools - default: mcp_list_tools - title: Type - type: string - server_label: - title: Server Label - type: string - tools: - items: - $ref: '#/$defs/MCPListToolsTool' - title: Tools - type: array - required: - - id - - server_label - - tools - title: OpenAIResponseOutputMessageMCPListTools + title: Params + description: The parameters of the shield. + type: object + required: + - shield_id + - messages + - params + title: RunShieldRequest + description: Request model for running a shield. + RunShieldResponse: + properties: + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + description: Safety violation detected by the shield, if any. + type: object + title: RunShieldResponse + description: Response from running a safety shield. + SafetyViolation: + properties: + violation_level: + $ref: '#/components/schemas/ViolationLevel' + description: Severity level of the violation. + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + description: Message to convey to the user about the violation. + metadata: + additionalProperties: true type: object - "OpenAIResponseOutputMessageWebSearchToolCall": - description: >- - Web search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param status: Current status of the web search operation - - :param type: Tool call type identifier, always "web_search_call" - properties: - id: - title: Id - type: string - status: - title: Status - type: string - type: - const: web_search_call - default: web_search_call - title: Type + title: Metadata + description: Additional metadata including specific violation codes for debugging and telemetry. + type: object + required: + - violation_level + title: SafetyViolation + description: Details of a safety violation detected by content moderation. + SamplingParams: + properties: + strategy: + oneOf: + - $ref: '#/components/schemas/GreedySamplingStrategy' + - $ref: '#/components/schemas/TopPSamplingStrategy' + - $ref: '#/components/schemas/TopKSamplingStrategy' + title: Strategy + discriminator: + propertyName: type + mapping: + greedy: '#/components/schemas/GreedySamplingStrategy' + top_k: '#/components/schemas/TopKSamplingStrategy' + top_p: '#/components/schemas/TopPSamplingStrategy' + max_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Tokens + repetition_penalty: + anyOf: + - type: number + - type: 'null' + title: Repetition Penalty + default: 1.0 + stop: + anyOf: + - items: type: string - required: - - id - - status - title: >- - OpenAIResponseOutputMessageWebSearchToolCall - type: object - OpenAIResponseText: - description: >- - Text response configuration for OpenAI responses. - - - :param format: (Optional) Text format configuration specifying output - format requirements - properties: - format: - anyOf: - - $ref: '#/$defs/OpenAIResponseTextFormat' - - type: 'null' - title: OpenAIResponseText - type: object - OpenAIResponseTextFormat: - description: >- - Configuration for Responses API text format. - - - :param type: Must be "text", "json_schema", or "json_object" to identify - the format type - - :param name: The name of the response format. Only used for json_schema. - - :param schema: The JSON schema the response should conform to. In a Python - SDK, this is often a `pydantic` model. Only used for json_schema. - - :param description: (Optional) A description of the response format. Only - used for json_schema. - - :param strict: (Optional) Whether to strictly enforce the JSON schema. - If true, the response must match the schema exactly. Only used for json_schema. - properties: - type: - anyOf: - - const: text - type: string - - const: json_schema - type: string - - const: json_object - type: string - title: Type - name: - anyOf: - - type: string - - type: 'null' - title: Name - schema: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Schema - description: - anyOf: - - type: string - - type: 'null' - title: Description - strict: - anyOf: - - type: boolean - - type: 'null' - title: Strict - title: OpenAIResponseTextFormat + type: array + - type: 'null' + title: Stop + type: object + title: SamplingParams + description: Sampling parameters. + ScoreBatchRequest: + properties: + dataset_id: + type: string + title: Dataset Id + description: The ID of the dataset to score + scoring_functions: + additionalProperties: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' type: object - OpenAIResponseToolMCP: - description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response object. - - - :param type: Tool type identifier, always "mcp" - - :param server_label: Label to identify this MCP server - - :param allowed_tools: (Optional) Restriction on which tools can be used - from this server - properties: - type: - const: mcp - default: mcp - title: Type - type: string - server_label: - title: Server Label - type: string - allowed_tools: - anyOf: - - items: - type: string - type: array - - $ref: '#/$defs/AllowedToolsFilter' - - type: 'null' - title: Allowed Tools - required: - - server_label - title: OpenAIResponseToolMCP + title: Scoring Functions + description: The scoring functions to use for the scoring + save_results_dataset: + type: boolean + title: Save Results Dataset + description: Whether to save the results to a dataset + default: false + type: object + required: + - dataset_id + - scoring_functions + title: ScoreBatchRequest + description: Request for batch scoring operations. + ScoreBatchResponse: + properties: + dataset_id: + anyOf: + - type: string + - type: 'null' + title: Dataset Id + description: The identifier of the dataset that was scored + results: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' type: object - OpenAIResponseUsage: - description: >- - Usage information for OpenAI response. - - - :param input_tokens: Number of tokens in the input - - :param output_tokens: Number of tokens in the output - - :param total_tokens: Total tokens used (input + output) - - :param input_tokens_details: Detailed breakdown of input token usage - - :param output_tokens_details: Detailed breakdown of output token usage - properties: - input_tokens: - title: Input Tokens - type: integer - output_tokens: - title: Output Tokens - type: integer - total_tokens: - title: Total Tokens - type: integer - input_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIResponseUsageInputTokensDetails - - type: 'null' - output_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIResponseUsageOutputTokensDetails - - type: 'null' - required: - - input_tokens - - output_tokens - - total_tokens - title: OpenAIResponseUsage + title: Results + description: A map of scoring function name to ScoringResult + type: object + required: + - results + title: ScoreBatchResponse + description: Response from batch scoring operations on datasets. + ScoreRequest: + properties: + input_rows: + items: + additionalProperties: true + type: object + type: array + title: Input Rows + description: The rows to score + scoring_functions: + additionalProperties: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' type: object - OpenAIResponseUsageInputTokensDetails: - description: >- - Token details for input tokens in OpenAI response usage. - - - :param cached_tokens: Number of tokens retrieved from cache - properties: - cached_tokens: - anyOf: - - type: integer - - type: 'null' - title: Cached Tokens - title: OpenAIResponseUsageInputTokensDetails + title: Scoring Functions + description: The scoring functions to use for the scoring + type: object + required: + - input_rows + - scoring_functions + title: ScoreRequest + description: Request for scoring a list of rows. + ScoreResponse: + properties: + results: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' type: object - OpenAIResponseUsageOutputTokensDetails: - description: >- - Token details for output tokens in OpenAI response usage. - - - :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) - properties: - reasoning_tokens: - anyOf: - - type: integer - - type: 'null' - title: Reasoning Tokens - title: OpenAIResponseUsageOutputTokensDetails + title: Results + description: A map of scoring function name to ScoringResult + type: object + required: + - results + title: ScoreResponse + description: The response from scoring. + ScoringFn: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: scoring_function + title: Type + default: scoring_function + description: + anyOf: + - type: string + - type: 'null' + title: Description + metadata: + additionalProperties: true type: object - SearchRankingOptions: - description: >- - Options for ranking and filtering search results. - - - :param ranker: (Optional) Name of the ranking algorithm to use - - :param score_threshold: (Optional) Minimum relevance score threshold for - results - properties: - ranker: - anyOf: - - type: string - - type: 'null' - title: Ranker - score_threshold: - anyOf: - - type: number - - type: 'null' - default: 0.0 - title: Score Threshold - title: SearchRankingOptions + title: Metadata + description: Any additional metadata for this definition + return_type: + oneOf: + - $ref: '#/components/schemas/StringType' + - $ref: '#/components/schemas/NumberType' + - $ref: '#/components/schemas/BooleanType' + - $ref: '#/components/schemas/ArrayType' + - $ref: '#/components/schemas/ObjectType' + - $ref: '#/components/schemas/JsonType' + - $ref: '#/components/schemas/UnionType' + - $ref: '#/components/schemas/ChatCompletionInputType' + - $ref: '#/components/schemas/CompletionInputType' + - $ref: '#/components/schemas/AgentTurnInputType' + title: Return Type + description: The return type of the deterministic function + discriminator: + propertyName: type + mapping: + agent_turn_input: '#/components/schemas/AgentTurnInputType' + array: '#/components/schemas/ArrayType' + boolean: '#/components/schemas/BooleanType' + chat_completion_input: '#/components/schemas/ChatCompletionInputType' + completion_input: '#/components/schemas/CompletionInputType' + json: '#/components/schemas/JsonType' + number: '#/components/schemas/NumberType' + object: '#/components/schemas/ObjectType' + string: '#/components/schemas/StringType' + union: '#/components/schemas/UnionType' + params: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' + title: Params + description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval + type: object + required: + - identifier + - provider_id + - return_type + title: ScoringFn + description: A scoring function resource for evaluating model outputs. + ScoringResult: + properties: + score_rows: + items: + additionalProperties: true + type: object + type: array + title: Score Rows + description: The scoring result for each row. Each row is a map of column name to value + aggregated_results: + additionalProperties: true type: object - description: >- - Paginated list of OpenAI response objects with navigation metadata. - - - :param data: List of response objects with their input context - - :param has_more: Whether there are more results available beyond this page - - :param first_id: Identifier of the first item in this page - - :param last_id: Identifier of the last item in this page - - :param object: Object type identifier, always "list" + title: Aggregated Results + description: Map of metric name to aggregated value + type: object + required: + - score_rows + - aggregated_results + title: ScoringResult + description: A scoring result for a single row. + SearchRankingOptions: properties: - data: + ranker: + anyOf: + - type: string + - type: 'null' + title: Ranker + score_threshold: + anyOf: + - type: number + - type: 'null' + title: Score Threshold + default: 0.0 + type: object + title: SearchRankingOptions + description: Options for ranking and filtering search results. + Session: + properties: + session_id: + type: string + title: Session Id + description: Unique identifier for the conversation session + session_name: + type: string + title: Session Name + description: Human-readable name for the session + turns: items: - $ref: '#/$defs/OpenAIResponseObjectWithInput' - title: Data + $ref: '#/components/schemas/Turn' type: array - has_more: - title: Has More - type: boolean - first_id: - title: First Id + title: Turns + description: List of all turns that have occurred in this session + started_at: type: string - last_id: - title: Last Id + format: date-time + title: Started At + description: Timestamp when the session was created + type: object + required: + - session_id + - session_name + - turns + - started_at + title: Session + description: A single session of an interaction with an Agentic System. + SetDefaultVersionRequest: + properties: + version: + type: integer + title: Version + description: The version to set as default. + type: object + required: + - version + title: SetDefaultVersionRequest + description: Request model for setting a prompt version as default. + Shield: + properties: + identifier: type: string - object: - const: list - default: list - title: Object + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: shield + title: Type + description: The resource type, always shield + default: shield + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + description: Configuration parameters for the shield + type: object required: - - data - - has_more - - first_id - - last_id - title: ListOpenAIChatCompletionResponse + - identifier + - provider_id + title: Shield + description: A safety shield resource that can be used to check content. + ShieldCallStep-Output: + properties: + turn_id: + type: string + title: Turn Id + description: The ID of the turn. + step_id: + type: string + title: Step Id + description: The ID of the step. + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At + description: The time the step started. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: The time the step completed. + step_type: + type: string + const: shield_call + title: Step Type + default: shield_call + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + description: The violation from the shield call. + type: object + required: + - turn_id + - step_id + title: ShieldCallStep + description: A shield call step in an agent turn. + StopReason: + type: string + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + StringType: + properties: + type: + type: string + const: string + title: Type + default: string + type: object + title: StringType + description: "Parameter type for string values.\n\n:param type: Discriminator type. Always \"string\"" + SupervisedFineTuneRequest: + properties: + job_uuid: + type: string + title: Job Uuid + description: The UUID of the job to create + training_config: + $ref: '#/components/schemas/TrainingConfig' + description: The training configuration + hyperparam_search_config: + additionalProperties: true + type: object + title: Hyperparam Search Config + description: The hyperparam search configuration + logger_config: + additionalProperties: true + type: object + title: Logger Config + description: The logger configuration + model: + anyOf: + - type: string + - type: 'null' + title: Model + description: Model descriptor for training if not in provider config` + checkpoint_dir: + anyOf: + - type: string + - type: 'null' + title: Checkpoint Dir + description: The directory to save checkpoint(s) to + algorithm_config: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LoraFinetuningConfig' + - $ref: '#/components/schemas/QATFinetuningConfig' + discriminator: + propertyName: type + mapping: + LoRA: '#/components/schemas/LoraFinetuningConfig' + QAT: '#/components/schemas/QATFinetuningConfig' + - type: 'null' + title: Algorithm Config + description: The algorithm configuration + type: object + required: + - job_uuid + - training_config + - hyperparam_search_config + - logger_config + title: SupervisedFineTuneRequest + description: Request to run supervised fine-tuning of a model. + SystemMessage: + properties: + role: + type: string + const: system + title: Role + default: system + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + type: object + required: + - content + title: SystemMessage + description: A system message providing instructions or context to the model. + SystemMessageBehavior: + type: string + enum: + - append + - replace + title: SystemMessageBehavior + description: "Config for how to override the default system prompt.\n\nhttps://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt-\n'{{function_definitions}}' to indicate where the function definitions should be inserted." + TextContentItem: + properties: + type: + type: string + const: text + title: Type + default: text + text: + type: string + title: Text + type: object + required: + - text + title: TextContentItem + description: A text content item. + ToolCall: + properties: + call_id: + type: string + title: Call Id + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + type: string + title: Arguments + type: object + required: + - call_id + - tool_name + - arguments + title: ToolCall + ToolChoice: + type: string + enum: + - auto + - required + - none + title: ToolChoice + description: Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model. + ToolConfig: + properties: + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: string + - type: 'null' + title: Tool Choice + default: auto + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + system_message_behavior: + anyOf: + - $ref: '#/components/schemas/SystemMessageBehavior' + - type: 'null' + default: append type: object - OpenAIAssistantMessageParam: - description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. + title: ToolConfig + description: "Configuration for tool use.\n\n- `ToolPromptFormat.json`: The tool calls are formatted as a JSON object.\n- `ToolPromptFormat.function_tag`: The tool calls are enclosed in a tag.\n- `ToolPromptFormat.python_list`: The tool calls are output as Python syntax -- a list of function calls.\n- `SystemMessageBehavior.append`: Appends the provided system message to the default system prompt.\n- `SystemMessageBehavior.replace`: Replaces the default system prompt with the provided system message. The system message can include the string\n '{{function_definitions}}' to indicate where the function definitions should be inserted." + ToolDef: properties: - role: - const: assistant - default: assistant - title: Role - type: string - content: + toolgroup_id: anyOf: - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - nullable: true + - type: 'null' + title: Toolgroup Id + description: ID of the tool group this tool belongs to name: + type: string title: Name + description: Name of the tool + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Human-readable description of what the tool does + input_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Input Schema + description: JSON Schema for tool inputs (MCP inputSchema) + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Output Schema + description: JSON Schema for tool outputs (MCP outputSchema) + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Additional metadata about the tool + type: object + required: + - name + title: ToolDef + description: Tool definition used in runtime contexts. + ToolExecutionStep-Output: + properties: + turn_id: + type: string + title: Turn Id + description: The ID of the turn. + step_id: + type: string + title: Step Id + description: The ID of the step. + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At + description: The time the step started. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: The time the step completed. + step_type: type: string - nullable: true + const: tool_execution + title: Step Type + default: tool_execution tool_calls: + items: + $ref: '#/components/schemas/ToolCall' + type: array title: Tool Calls + description: The tool calls to execute. + tool_responses: items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + $ref: '#/components/schemas/ToolResponse-Output' type: array - nullable: true - title: OpenAIAssistantMessageParam + title: Tool Responses + description: The tool responses from the tool calls. type: object - OpenAIChoice: - description: A choice from an OpenAI-compatible chat completion response. + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + description: A tool execution step in an agent turn. + ToolGroup: properties: - message: - discriminator: - mapping: - assistant: '#/$defs/OpenAIAssistantMessageParam' - developer: '#/$defs/OpenAIDeveloperMessageParam' - system: '#/$defs/OpenAISystemMessageParam' - tool: '#/$defs/OpenAIToolMessageParam' - user: '#/$defs/OpenAIUserMessageParam' - propertyName: role - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - title: Message - finish_reason: - title: Finish Reason + identifier: type: string - index: - title: Index - type: integer - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - nullable: true - required: - - message - - finish_reason - - index - title: OpenAIChoice + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: tool_group + title: Type + description: Type of resource, always 'tool_group' + default: tool_group + mcp_endpoint: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + description: Model Context Protocol endpoint for remote tools + args: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Args + description: Additional arguments for the tool group type: object - OpenAIChoiceLogprobs: - description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. + required: + - identifier + - provider_id + title: ToolGroup + description: A group of related tools managed together. + ToolInvocationResult: properties: content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - type: 'null' title: Content - items: - $ref: '#/components/schemas/OpenAITokenLogProb' - type: array - nullable: true - refusal: - title: Refusal - items: - $ref: '#/components/schemas/OpenAITokenLogProb' - type: array - nullable: true - title: OpenAIChoiceLogprobs + description: The output content from the tool execution + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + description: Error message if the tool execution failed + error_code: + anyOf: + - type: integer + - type: 'null' + title: Error Code + description: Numeric error code if the tool execution failed + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Additional metadata about the tool execution type: object - OpenAICompletionWithInputMessages: + title: ToolInvocationResult + description: Result of a tool invocation. + ToolPromptFormat: + type: string + enum: + - json + - function_tag + - python_list + title: ToolPromptFormat + description: "Prompt format for calling custom / zero shot tools.\n\n:cvar json: JSON format for calling tools. It takes the form:\n {\n \"type\": \"function\",\n \"function\" : {\n \"name\": \"function_name\",\n \"description\": \"function_description\",\n \"parameters\": {...}\n }\n }\n:cvar function_tag: Function tag format, pseudo-XML. This looks like:\n (parameters)\n\n:cvar python_list: Python list. The output is a valid Python expression that can be\n evaluated to a list. Each element in the list is a function call. Example:\n [\"function_name(param1, param2)\", \"function_name(param1, param2)\"]" + ToolResponse-Input: properties: - id: - title: Id - type: string - choices: - items: - $ref: '#/components/schemas/OpenAIChoice' - title: Choices - type: array - object: - const: chat.completion - default: chat.completion - title: Object - type: string - created: - title: Created - type: integer - model: - title: Model + call_id: type: string - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - nullable: true - input_messages: - items: + title: Call Id + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' discriminator: + propertyName: type mapping: - assistant: '#/$defs/OpenAIAssistantMessageParam' - developer: '#/$defs/OpenAIDeveloperMessageParam' - system: '#/$defs/OpenAISystemMessageParam' - tool: '#/$defs/OpenAIToolMessageParam' - user: '#/$defs/OpenAIUserMessageParam' - propertyName: role - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - title: Input Messages - type: array - required: - - id - - choices - - created - - model - - input_messages - title: OpenAICompletionWithInputMessages + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata type: object - OpenAIUserMessageParam: - description: A message from the user in an OpenAI-compatible chat completion request. + required: + - call_id + - tool_name + - content + title: ToolResponse + description: Response from a tool invocation. + ToolResponse-Output: properties: - role: - const: user - default: user - title: Role + call_id: type: string + title: Call Id + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name content: anyOf: - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' discriminator: - mapping: - file: '#/$defs/OpenAIFile' - image_url: '#/$defs/OpenAIChatCompletionContentPartImageParam' - text: '#/$defs/OpenAIChatCompletionContentPartTextParam' propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - - $ref: '#/components/schemas/OpenAIFile' + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' type: array title: Content - name: - title: Name - type: string - nullable: true - required: - - content - title: OpenAIUserMessageParam - type: object - Checkpoint: - description: Checkpoint created during training runs. - properties: - identifier: - title: Identifier - type: string - created_at: - format: date-time - title: Created At - type: string - epoch: - title: Epoch - type: integer - post_training_job_id: - title: Post Training Job Id - type: string - path: - title: Path - type: string - training_metrics: - $ref: '#/components/schemas/PostTrainingMetric' - nullable: true - required: - - identifier - - created_at - - epoch - - post_training_job_id - - path - title: Checkpoint - type: object - PostTrainingJobArtifactsResponse: - description: Artifacts of a finetuning job. - properties: - job_uuid: - title: Job Uuid - type: string - checkpoints: - items: - $ref: '#/components/schemas/Checkpoint' - title: Checkpoints - type: array - required: - - job_uuid - title: PostTrainingJobArtifactsResponse - type: object - PostTrainingJobStatusResponse: - description: Status of a finetuning job. - properties: - job_uuid: - title: Job Uuid - type: string - status: - $ref: '#/components/schemas/JobStatus' - scheduled_at: - title: Scheduled At - format: date-time - type: string - nullable: true - started_at: - title: Started At - format: date-time - type: string - nullable: true - completed_at: - title: Completed At - format: date-time - type: string - nullable: true - resources_allocated: - title: Resources Allocated - additionalProperties: true - type: object - nullable: true - checkpoints: - items: - $ref: '#/components/schemas/Checkpoint' - title: Checkpoints - type: array - required: - - job_uuid - - status - title: PostTrainingJobStatusResponse - type: object - ScoringFn: - description: A scoring function resource for evaluating model outputs. - properties: - identifier: - description: Unique identifier for this resource in llama stack - title: Identifier - type: string - provider_resource_id: - description: Unique identifier for this resource in the provider - title: Provider Resource Id - type: string - nullable: true - provider_id: - description: ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: scoring_function - default: scoring_function - title: Type - type: string - description: - title: Description - type: string - nullable: true metadata: - additionalProperties: true - description: Any additional metadata for this definition + anyOf: + - additionalProperties: true + type: object + - type: 'null' title: Metadata - type: object - return_type: - description: The return type of the deterministic function - discriminator: - mapping: - agent_turn_input: '#/$defs/AgentTurnInputType' - array: '#/$defs/ArrayType' - boolean: '#/$defs/BooleanType' - chat_completion_input: '#/$defs/ChatCompletionInputType' - completion_input: '#/$defs/CompletionInputType' - json: '#/$defs/JsonType' - number: '#/$defs/NumberType' - object: '#/$defs/ObjectType' - string: '#/$defs/StringType' - union: '#/$defs/UnionType' - propertyName: type - oneOf: - - $ref: '#/components/schemas/StringType' - - $ref: '#/components/schemas/NumberType' - - $ref: '#/components/schemas/BooleanType' - - $ref: '#/components/schemas/ArrayType' - - $ref: '#/components/schemas/ObjectType' - - $ref: '#/components/schemas/JsonType' - - $ref: '#/components/schemas/UnionType' - - $ref: '#/components/schemas/ChatCompletionInputType' - - $ref: '#/components/schemas/CompletionInputType' - - $ref: '#/components/schemas/AgentTurnInputType' - title: Return Type - params: - description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval - title: Params - discriminator: - mapping: - basic: '#/$defs/BasicScoringFnParams' - llm_as_judge: '#/$defs/LLMAsJudgeScoringFnParams' - regex_parser: '#/$defs/RegexParserScoringFnParams' - propertyName: type - oneOf: - - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - - $ref: '#/components/schemas/RegexParserScoringFnParams' - - $ref: '#/components/schemas/BasicScoringFnParams' - nullable: true - required: - - identifier - - provider_id - - return_type - title: ScoringFn - type: object - ScoreRequest: type: object - ScoreResponse: - $defs: - ScoringResult: - description: >- - A scoring result for a single row. - - - :param score_rows: The scoring result for each row. Each row is a map - of column name to value. - - :param aggregated_results: Map of metric name to aggregated value - properties: - score_rows: - items: - additionalProperties: true - type: object - title: Score Rows - type: array - aggregated_results: - additionalProperties: true - title: Aggregated Results - type: object - required: - - score_rows - - aggregated_results - title: ScoringResult - type: object - description: >- - The response from scoring. - - - :param results: A map of scoring function name to ScoringResult. - properties: - results: - additionalProperties: - $ref: '#/$defs/ScoringResult' - title: Results - type: object required: - - results - title: ScoreResponse - type: object - ScoreBatchRequest: - type: object - ScoreBatchResponse: - $defs: - ScoringResult: - description: >- - A scoring result for a single row. - - - :param score_rows: The scoring result for each row. Each row is a map - of column name to value. - - :param aggregated_results: Map of metric name to aggregated value - properties: - score_rows: - items: - additionalProperties: true - type: object - title: Score Rows - type: array - aggregated_results: - additionalProperties: true - title: Aggregated Results - type: object - required: - - score_rows - - aggregated_results - title: ScoringResult - type: object - description: >- - Response from batch scoring operations on datasets. - - - :param dataset_id: (Optional) The identifier of the dataset that was scored - - :param results: A map of scoring function name to ScoringResult + - call_id + - tool_name + - content + title: ToolResponse + description: Response from a tool invocation. + ToolResponseMessage-Input: properties: - dataset_id: + role: + type: string + const: tool + title: Role + default: tool + call_id: + type: string + title: Call Id + content: anyOf: - - type: string - - type: 'null' - title: Dataset Id - results: - additionalProperties: - $ref: '#/$defs/ScoringResult' - title: Results - type: object - required: - - results - title: ScoreBatchResponse - type: object - ListShieldsResponse: - $defs: - Shield: - description: >- - A safety shield resource that can be used to check content. - - - :param params: (Optional) Configuration parameters for the shield - - :param type: The resource type, always shield - properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier - type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: shield - default: shield - title: Type - type: string - params: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Params - required: - - identifier - - provider_id - title: Shield - type: object - properties: - data: - items: - $ref: '#/$defs/Shield' - title: Data - type: array - required: - - data - title: ListShieldsResponse - type: object - RegisterShieldRequest: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content type: object + required: + - call_id + - content + title: ToolResponseMessage + description: A message representing the result of a tool invocation. + ToolResponseMessage-Output: properties: - shield_id: - type: string - description: >- - The identifier of the shield to register. - provider_shield_id: + role: type: string - description: >- - The identifier of the shield in the provider. - provider_id: + const: tool + title: Role + default: tool + call_id: type: string - description: The identifier of the provider. - params: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The parameters of the shield. - additionalProperties: false - required: - - shield_id - title: RegisterShieldRequest - InvokeToolRequest: + title: Call Id + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content type: object - properties: - tool_name: - type: string - description: The name of the tool to invoke. - kwargs: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - A dictionary of arguments to pass to the tool. - additionalProperties: false required: - - tool_name - - kwargs - title: InvokeToolRequest - ImageContentItem: - type: object + - call_id + - content + title: ToolResponseMessage + description: A message representing the result of a tool invocation. + TopKSamplingStrategy: properties: type: type: string - const: image - default: image - description: >- - Discriminator type of the content item. Always "image" - image: - type: object - properties: - url: - $ref: '#/components/schemas/URL' - description: >- - A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - data: - type: string - contentEncoding: base64 - description: base64 encoded image data as string - additionalProperties: false - description: >- - Image as a base64 encoded string or an URL - additionalProperties: false - required: - - type - - image - title: ImageContentItem - description: A image content item - InterleavedContent: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - InterleavedContentItem: - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem' - text: '#/components/schemas/TextContentItem' - TextContentItem: + const: top_k + title: Type + default: top_k + top_k: + type: integer + minimum: 1.0 + title: Top K type: object + required: + - top_k + title: TopKSamplingStrategy + description: Top-k sampling strategy that restricts sampling to the k most likely tokens. + TopPSamplingStrategy: properties: type: type: string - const: text - default: text - description: >- - Discriminator type of the content item. Always "text" - text: - type: string - description: Text content - additionalProperties: false - required: - - type - - text - title: TextContentItem - description: A text content item - ToolInvocationResult: + const: top_p + title: Type + default: top_p + temperature: + anyOf: + - type: number + minimum: 0.0 + - type: 'null' + title: Temperature + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + default: 0.95 type: object + required: + - temperature + title: TopPSamplingStrategy + description: Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p. + TrainingConfig: properties: - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - (Optional) The output content from the tool execution - error_message: - type: string - description: >- - (Optional) Error message if the tool execution failed - error_code: + n_epochs: type: integer - description: >- - (Optional) Numeric error code if the tool execution failed - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool execution - additionalProperties: false - title: ToolInvocationResult - description: Result of a tool invocation. - URL: + title: N Epochs + max_steps_per_epoch: + type: integer + title: Max Steps Per Epoch + default: 1 + gradient_accumulation_steps: + type: integer + title: Gradient Accumulation Steps + default: 1 + max_validation_steps: + anyOf: + - type: integer + - type: 'null' + title: Max Validation Steps + default: 1 + data_config: + anyOf: + - $ref: '#/components/schemas/DataConfig' + - type: 'null' + optimizer_config: + anyOf: + - $ref: '#/components/schemas/OptimizerConfig' + - type: 'null' + efficiency_config: + anyOf: + - $ref: '#/components/schemas/EfficiencyConfig' + - type: 'null' + dtype: + anyOf: + - type: string + - type: 'null' + title: Dtype + default: bf16 type: object - properties: - uri: - type: string - description: The URL string pointing to the resource - additionalProperties: false required: - - uri - title: URL - description: A URL reference to external content. - ToolDef: - type: object + - n_epochs + title: TrainingConfig + description: Comprehensive configuration for the training process. + Turn: properties: - toolgroup_id: - type: string - description: >- - (Optional) ID of the tool group this tool belongs to - name: + turn_id: type: string - description: Name of the tool - description: + title: Turn Id + description: Unique identifier for the turn within a session + session_id: type: string - description: >- - (Optional) Human-readable description of what the tool does - input_schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON Schema for tool inputs (MCP inputSchema) - output_schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON Schema for tool outputs (MCP outputSchema) - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool - additionalProperties: false - required: - - name - title: ToolDef - description: >- - Tool definition used in runtime contexts. - ListToolDefsResponse: - type: object - properties: - data: - type: array + title: Session Id + description: Unique identifier for the conversation session + input_messages: items: - $ref: '#/components/schemas/ToolDef' - description: List of tool definitions - additionalProperties: false - required: - - data - title: ListToolDefsResponse - description: >- - Response containing a list of tool definitions. - RAGDocument: - type: object - properties: - document_id: - type: string - description: The unique identifier for the document. - content: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - - $ref: '#/components/schemas/URL' - description: The content of the document. - mime_type: - type: string - description: The MIME type of the document. - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Additional metadata for the document. - additionalProperties: false - required: - - document_id - - content - - metadata - title: RAGDocument - description: >- - A document to be used for document ingestion in the RAG Tool. - InsertRequest: - type: object - properties: - documents: + anyOf: + - $ref: '#/components/schemas/UserMessage-Output' + - $ref: '#/components/schemas/ToolResponseMessage-Output' type: array + title: Input Messages + description: List of messages that initiated this turn + steps: items: - $ref: '#/components/schemas/RAGDocument' - description: >- - List of documents to index in the RAG system - vector_store_id: + oneOf: + - $ref: '#/components/schemas/InferenceStep-Output' + - $ref: '#/components/schemas/ToolExecutionStep-Output' + - $ref: '#/components/schemas/ShieldCallStep-Output' + - $ref: '#/components/schemas/MemoryRetrievalStep-Output' + discriminator: + propertyName: step_type + mapping: + inference: '#/components/schemas/InferenceStep-Output' + memory_retrieval: '#/components/schemas/MemoryRetrievalStep-Output' + shield_call: '#/components/schemas/ShieldCallStep-Output' + tool_execution: '#/components/schemas/ToolExecutionStep-Output' + type: array + title: Steps + description: Ordered list of processing steps executed during this turn + output_message: + $ref: '#/components/schemas/CompletionMessage-Output' + description: The model's generated response containing content and metadata + output_attachments: + anyOf: + - items: + $ref: '#/components/schemas/Attachment-Output' + type: array + - type: 'null' + title: Output Attachments + description: Files or media attached to the agent's response + started_at: type: string - description: >- - ID of the vector database to store the document embeddings - chunk_size_in_tokens: - type: integer - description: >- - (Optional) Size in tokens for document chunking during indexing - additionalProperties: false - required: - - documents - - vector_store_id - - chunk_size_in_tokens - title: InsertRequest - DefaultRAGQueryGeneratorConfig: + format: date-time + title: Started At + description: Timestamp when the turn began + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: Timestamp when the turn finished, if completed type: object + required: + - turn_id + - session_id + - input_messages + - steps + - output_message + - started_at + title: Turn + description: A single turn in an interaction with an Agentic System. + URIDataSource: properties: type: type: string - const: default - default: default - description: >- - Type of query generator, always 'default' - separator: + const: uri + title: Type + description: The type of data source + default: uri + uri: type: string - default: ' ' - description: >- - String separator used to join query terms - additionalProperties: false + title: Uri + description: The dataset can be obtained from a URI. E.g. 'https://mywebsite.com/mydata.jsonl', 'lsfs://mydata.jsonl', 'data:csv;base64,{base64_content}' + type: object required: - - type - - separator - title: DefaultRAGQueryGeneratorConfig - description: >- - Configuration for the default RAG query generator. - LLMRAGQueryGeneratorConfig: + - uri + title: URIDataSource + description: A dataset that can be obtained from a URI. + URL: + properties: + uri: + type: string + title: Uri type: object + required: + - uri + title: URL + description: A URL reference to external content. + UnionType: properties: type: type: string - const: llm - default: llm - description: Type of query generator, always 'llm' - model: - type: string - description: >- - Name of the language model to use for query generation - template: - type: string - description: >- - Template string for formatting the query generation prompt - additionalProperties: false - required: - - type - - model - - template - title: LLMRAGQueryGeneratorConfig - description: >- - Configuration for the LLM-based RAG query generator. - RAGQueryConfig: + const: union + title: Type + default: union type: object + title: UnionType + description: "Parameter type for union values.\n\n:param type: Discriminator type. Always \"union\"" + UpdatePromptRequest: properties: - query_generator_config: - oneOf: - - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' - - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' - discriminator: - propertyName: type - mapping: - default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' - llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' - description: Configuration for the query generator. - max_tokens_in_context: - type: integer - default: 4096 - description: Maximum number of tokens in the context. - max_chunks: - type: integer - default: 5 - description: Maximum number of chunks to retrieve. - chunk_template: + prompt: type: string - default: > - Result {index} - - - :param params: (Optional) Configuration parameters for the shield - - :param type: The resource type, always shield + title: Prompt + description: The updated prompt text content. + version: + type: integer + title: Version + description: The current version of the prompt being updated. + variables: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Variables + description: Updated list of variable names that can be used in the prompt template. + set_as_default: + type: boolean + title: Set As Default + description: Set the new version as the default (default=True). + default: true + type: object + required: + - prompt + - version + title: UpdatePromptRequest + description: Request model for updating an existing prompt. + UserMessage-Input: properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier + role: type: string - provider_resource_id: + const: user + title: Role + default: user + content: anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: shield - default: shield - title: Type - type: string - params: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + context: anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Params - required: - - identifier - - provider_id - title: Shield + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + title: Context type: object - SyntheticDataGenerateRequest: - type: object - SyntheticDataGenerationResponse: - description: >- - Response from the synthetic data generation. Batch of (prompt, response, score) - tuples that pass the threshold. - - - :param synthetic_data: List of generated synthetic data samples that passed - the filtering criteria - - :param statistics: (Optional) Statistical information about the generation - process and filtering results - properties: - synthetic_data: - items: - additionalProperties: true - type: object - title: Synthetic Data - type: array - statistics: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Statistics required: - - synthetic_data - title: SyntheticDataGenerationResponse - type: object - InvokeToolRequest: - type: object - ToolInvocationResult: - $defs: - ImageContentItem: - description: >- - A image content item - - - :param type: Discriminator type of the content item. Always "image" - - :param image: Image as a base64 encoded string or an URL - properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/$defs/_URLOrData' - required: - - image - title: ImageContentItem - type: object - TextContentItem: - description: >- - A text content item - - - :param type: Discriminator type of the content item. Always "text" - - :param text: Text content - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: TextContentItem - type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL - type: object - _URLOrData: - description: >- - A URL or a base64 encoded string - - - :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - - :param data: base64 encoded image data as string - properties: - url: - anyOf: - - $ref: '#/$defs/URL' - - type: 'null' - data: - anyOf: - - type: string - - type: 'null' - contentEncoding: base64 - title: Data - title: _URLOrData - type: object - description: >- - Result of a tool invocation. - - - :param content: (Optional) The output content from the tool execution - - :param error_message: (Optional) Error message if the tool execution failed - - :param error_code: (Optional) Numeric error code if the tool execution failed - - :param metadata: (Optional) Additional metadata about the tool execution + - content + title: UserMessage + description: A message from the user in a chat conversation. + UserMessage-Output: properties: + role: + type: string + const: user + title: Role + default: user content: anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - type: 'null' + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array title: Content - error_message: - anyOf: - - type: string - - type: 'null' - title: Error Message - error_code: - anyOf: - - type: integer - - type: 'null' - title: Error Code - metadata: + context: anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Metadata - title: ToolInvocationResult + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + title: Context type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource + required: + - content + title: UserMessage + description: A message from the user in a chat conversation. + VectorStoreChunkingStrategyAuto: properties: - uri: - title: Uri + type: type: string - required: - - uri - title: URL + const: auto + title: Type + default: auto type: object - ListToolDefsResponse: - description: Response containing a list of tool definitions. + title: VectorStoreChunkingStrategyAuto + description: Automatic chunking strategy for vector store files. + VectorStoreChunkingStrategyStatic: properties: - data: - items: - $ref: '#/components/schemas/ToolDef' - title: Data - type: array + type: + type: string + const: static + title: Type + default: static + static: + $ref: '#/components/schemas/VectorStoreChunkingStrategyStaticConfig' + type: object required: - - data - title: ListToolDefsResponse + - static + title: VectorStoreChunkingStrategyStatic + description: Static chunking strategy with configurable parameters. + VectorStoreChunkingStrategyStaticConfig: + properties: + chunk_overlap_tokens: + type: integer + title: Chunk Overlap Tokens + default: 400 + max_chunk_size_tokens: + type: integer + maximum: 4096.0 + minimum: 100.0 + title: Max Chunk Size Tokens + default: 800 + type: object + title: VectorStoreChunkingStrategyStaticConfig + description: Configuration for static chunking strategy. + VectorStoreContent: + properties: + type: + type: string + const: text + title: Type + text: + type: string + title: Text type: object + required: + - type + - text + title: VectorStoreContent + description: Content item from a vector store file or search result. VectorStoreDeleteResponse: - description: Response from deleting a vector store. properties: id: - title: Id type: string + title: Id object: - default: vector_store.deleted - title: Object type: string + title: Object + default: vector_store.deleted deleted: - default: true - title: Deleted type: boolean + title: Deleted + default: true + type: object required: - id title: VectorStoreDeleteResponse + description: Response from deleting a vector store. + VectorStoreFileBatchObject: + properties: + id: + type: string + title: Id + object: + type: string + title: Object + default: vector_store.file_batch + created_at: + type: integer + title: Created At + vector_store_id: + type: string + title: Vector Store Id + status: + anyOf: + - type: string + const: completed + - type: string + const: in_progress + - type: string + const: cancelled + - type: string + const: failed + title: Status + file_counts: + $ref: '#/components/schemas/VectorStoreFileCounts' type: object + required: + - id + - created_at + - vector_store_id + - status + - file_counts + title: VectorStoreFileBatchObject + description: OpenAI Vector Store File Batch object. VectorStoreFileContentsResponse: - description: Response from retrieving the contents of a vector store file. properties: file_id: - title: File Id type: string + title: File Id filename: - title: Filename type: string + title: Filename attributes: additionalProperties: true - title: Attributes type: object + title: Attributes content: items: $ref: '#/components/schemas/VectorStoreContent' - title: Content type: array + title: Content + type: object required: - file_id - filename - attributes - content title: VectorStoreFileContentsResponse + description: Response from retrieving the contents of a vector store file. + VectorStoreFileCounts: + properties: + completed: + type: integer + title: Completed + cancelled: + type: integer + title: Cancelled + failed: + type: integer + title: Failed + in_progress: + type: integer + title: In Progress + total: + type: integer + title: Total type: object + required: + - completed + - cancelled + - failed + - in_progress + - total + title: VectorStoreFileCounts + description: File processing status counts for a vector store. VectorStoreFileDeleteResponse: - description: Response from deleting a vector store file. properties: id: - title: Id type: string + title: Id object: - default: vector_store.file.deleted - title: Object type: string + title: Object + default: vector_store.file.deleted deleted: - default: true - title: Deleted type: boolean + title: Deleted + default: true + type: object required: - id title: VectorStoreFileDeleteResponse + description: Response from deleting a vector store file. + VectorStoreFileLastError: + properties: + code: + anyOf: + - type: string + const: server_error + - type: string + const: rate_limit_exceeded + title: Code + message: + type: string + title: Message type: object - VectorStoreFilesListInBatchResponse: - description: Response from listing files in a vector store file batch. + required: + - code + - message + title: VectorStoreFileLastError + description: Error information for failed vector store file processing. + VectorStoreFileObject: properties: - object: - default: list - title: Object + id: type: string - data: - items: - $ref: '#/components/schemas/VectorStoreFileObject' - title: Data - type: array - first_id: - title: First Id + title: Id + object: type: string - nullable: true - last_id: - title: Last Id + title: Object + default: vector_store.file + attributes: + additionalProperties: true + type: object + title: Attributes + chunking_strategy: + oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + title: Chunking Strategy + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + created_at: + type: integer + title: Created At + last_error: + anyOf: + - $ref: '#/components/schemas/VectorStoreFileLastError' + - type: 'null' + status: + anyOf: + - type: string + const: completed + - type: string + const: in_progress + - type: string + const: cancelled + - type: string + const: failed + title: Status + usage_bytes: + type: integer + title: Usage Bytes + default: 0 + vector_store_id: type: string - nullable: true - has_more: - default: false - title: Has More - type: boolean - required: - - data - title: VectorStoreFilesListInBatchResponse + title: Vector Store Id type: object - VectorStoreListFilesResponse: - description: Response from listing files in a vector store. + required: + - id + - chunking_strategy + - created_at + - status + - vector_store_id + title: VectorStoreFileObject + description: OpenAI Vector Store File object. + VectorStoreFilesListInBatchResponse: properties: object: - default: list - title: Object type: string + title: Object + default: list data: items: $ref: '#/components/schemas/VectorStoreFileObject' - title: Data type: array + title: Data first_id: + anyOf: + - type: string + - type: 'null' title: First Id - type: string - nullable: true last_id: + anyOf: + - type: string + - type: 'null' title: Last Id - type: string - nullable: true has_more: - default: false - title: Has More type: boolean + title: Has More + default: false + type: object required: - data - title: VectorStoreListFilesResponse - type: object - VectorStoreListResponse: - description: Response from listing vector stores. + title: VectorStoreFilesListInBatchResponse + description: Response from listing files in a vector store file batch. + VectorStoreListFilesResponse: properties: object: - default: list - title: Object type: string + title: Object + default: list data: items: - $ref: '#/components/schemas/VectorStoreObject' - title: Data + $ref: '#/components/schemas/VectorStoreFileObject' type: array + title: Data first_id: - title: First Id - type: string - nullable: true - last_id: - title: Last Id - type: string - nullable: true - has_more: - default: false - title: Has More - type: boolean - required: - - data - title: VectorStoreListResponse - type: object - OpenAIResponseMessage: - description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." - properties: - content: anyOf: - type: string - - items: - discriminator: - mapping: - input_file: '#/$defs/OpenAIResponseInputMessageContentFile' - input_image: '#/$defs/OpenAIResponseInputMessageContentImage' - input_text: '#/$defs/OpenAIResponseInputMessageContentText' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' - type: array - - items: - discriminator: - mapping: - output_text: '#/$defs/OpenAIResponseOutputMessageContentOutputText' - refusal: '#/$defs/OpenAIResponseContentPartRefusal' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' - type: array - title: Content - role: - anyOf: - - const: system - type: string - - const: developer - type: string - - const: user - type: string - - const: assistant - type: string - title: Role - type: - const: message - default: message - title: Type - type: string - id: - title: Id - type: string - nullable: true - status: - title: Status - type: string - nullable: true - required: - - content - - role - title: OpenAIResponseMessage - type: object - OpenAIResponseObjectWithInput: - description: OpenAI response object extended with input context information. - properties: - created_at: - title: Created At - type: integer - error: - $ref: '#/components/schemas/OpenAIResponseError' - nullable: true - id: - title: Id - type: string - model: - title: Model - type: string - required: - - session_id - title: AgentSessionCreateResponse - description: >- - Response returned when creating a new agent session. - CompletionMessage: - type: object - properties: - role: - type: string - const: assistant - default: assistant - description: >- - Must be "assistant" to identify this as the model's response - content: - $ref: '#/components/schemas/InterleavedContent' - description: The content of the model's response - stop_reason: - type: string - enum: - - end_of_turn - - end_of_message - - out_of_tokens - description: >- - Reason why the model stopped generating. Options are: - `StopReason.end_of_turn`: - The model finished generating the entire response. - `StopReason.end_of_message`: - The model finished generating but generated a partial response -- usually, - a tool call. The user may call the tool and continue the conversation - with the tool's response. - `StopReason.out_of_tokens`: The model ran - out of token budget. - tool_calls: - type: array - items: - $ref: '#/components/schemas/ToolCall' - description: >- - List of tool calls. Each tool call is a ToolCall object. - additionalProperties: false - required: - - role - - content - - stop_reason - title: CompletionMessage - description: >- - A message containing the model's (assistant) response in a chat conversation. - InferenceStep: - type: object - Session: - $defs: - Attachment: - description: >- - An attachment to an agent turn. - - - :param content: The content of the attachment. - - :param mime_type: The MIME type of the attachment. - properties: - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - $ref: '#/$defs/URL' - title: Content - mime_type: - title: Mime Type - type: string - required: - - content - - mime_type - title: Attachment - type: object - BuiltinTool: - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - type: string - CompletionMessage: - description: >- - A message containing the model's (assistant) response in a chat conversation. - - - :param role: Must be "assistant" to identify this as the model's response - - :param content: The content of the model's response - - :param stop_reason: Reason why the model stopped generating. Options are: - - `StopReason.end_of_turn`: The model finished generating the entire - response. - - `StopReason.end_of_message`: The model finished generating but generated - a partial response -- usually, a tool call. The user may call the tool - and continue the conversation with the tool's response. - - `StopReason.out_of_tokens`: The model ran out of token budget. - :param tool_calls: List of tool calls. Each tool call is a ToolCall object. - properties: - role: - const: assistant - default: assistant - title: Role - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - stop_reason: - $ref: '#/$defs/StopReason' - tool_calls: - anyOf: - - items: - $ref: '#/$defs/ToolCall' - type: array - - type: 'null' - title: Tool Calls - required: - - content - - stop_reason - title: CompletionMessage - type: object - ImageContentItem: - description: >- - A image content item - - - :param type: Discriminator type of the content item. Always "image" - - :param image: Image as a base64 encoded string or an URL - properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/$defs/_URLOrData' - required: - - image - title: ImageContentItem - type: object - InferenceStep: - description: >- - An inference step in an agent turn. - - - :param model_response: The response from the LLM. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: inference - default: inference - title: Step Type - type: string - model_response: - $ref: '#/$defs/CompletionMessage' - required: - - turn_id - - step_id - - model_response - title: InferenceStep - type: object - MemoryRetrievalStep: - description: >- - A memory retrieval step in an agent turn. - - - :param vector_store_ids: The IDs of the vector databases to retrieve context - from. - - :param inserted_context: The context retrieved from the vector databases. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: memory_retrieval - default: memory_retrieval - title: Step Type - type: string - vector_store_ids: - title: Vector Store Ids - type: string - inserted_context: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Inserted Context - required: - - turn_id - - step_id - - vector_store_ids - - inserted_context - title: MemoryRetrievalStep - type: object - SafetyViolation: - description: >- - Details of a safety violation detected by content moderation. - - - :param violation_level: Severity level of the violation - - :param user_message: (Optional) Message to convey to the user about the - violation - - :param metadata: Additional metadata including specific violation codes - for debugging and telemetry - properties: - violation_level: - $ref: '#/$defs/ViolationLevel' - user_message: - anyOf: - - type: string - - type: 'null' - title: User Message - metadata: - additionalProperties: true - title: Metadata - type: object - required: - - violation_level - title: SafetyViolation - type: object - ShieldCallStep: - description: >- - A shield call step in an agent turn. - - - :param violation: The violation from the shield call. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: shield_call - default: shield_call - title: Step Type - type: string - violation: - anyOf: - - $ref: '#/$defs/SafetyViolation' - - type: 'null' - required: - - turn_id - - step_id - - violation - title: ShieldCallStep - type: object - StopReason: - enum: - - end_of_turn - - end_of_message - - out_of_tokens - title: StopReason - type: string - TextContentItem: - description: >- - A text content item - - - :param type: Discriminator type of the content item. Always "text" - - :param text: Text content - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: TextContentItem - type: object - ToolCall: - properties: - call_id: - title: Call Id - type: string - tool_name: - anyOf: - - $ref: '#/$defs/BuiltinTool' - - type: string - title: Tool Name - arguments: - title: Arguments - type: string - required: - - call_id - - tool_name - - arguments - title: ToolCall - type: object - ToolExecutionStep: - description: >- - A tool execution step in an agent turn. - - - :param tool_calls: The tool calls to execute. - - :param tool_responses: The tool responses from the tool calls. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: tool_execution - default: tool_execution - title: Step Type - type: string - tool_calls: - items: - $ref: '#/$defs/ToolCall' - title: Tool Calls - type: array - tool_responses: - items: - $ref: '#/$defs/ToolResponse' - title: Tool Responses - type: array - required: - - turn_id - - step_id - - tool_calls - - tool_responses - title: ToolExecutionStep - type: object - ToolResponse: - description: >- - Response from a tool invocation. - - - :param call_id: Unique identifier for the tool call this response is for - - :param tool_name: Name of the tool that was invoked - - :param content: The response content from the tool - - :param metadata: (Optional) Additional metadata about the tool response - properties: - call_id: - title: Call Id - type: string - tool_name: - anyOf: - - $ref: '#/$defs/BuiltinTool' - - type: string - title: Tool Name - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - metadata: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Metadata - required: - - call_id - - tool_name - - content - title: ToolResponse - type: object - ToolResponseMessage: - description: >- - A message representing the result of a tool invocation. - - - :param role: Must be "tool" to identify this as a tool response - - :param call_id: Unique identifier for the tool call this response is for - - :param content: The response content from the tool - properties: - role: - const: tool - default: tool - title: Role - type: string - call_id: - title: Call Id - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - required: - - call_id - - content - title: ToolResponseMessage - type: object - Turn: - description: >- - A single turn in an interaction with an Agentic System. - - - :param turn_id: Unique identifier for the turn within a session - - :param session_id: Unique identifier for the conversation session - - :param input_messages: List of messages that initiated this turn - - :param steps: Ordered list of processing steps executed during this turn - - :param output_message: The model's generated response containing content - and metadata - - :param output_attachments: (Optional) Files or media attached to the agent's - response - - :param started_at: Timestamp when the turn began - - :param completed_at: (Optional) Timestamp when the turn finished, if completed - properties: - turn_id: - title: Turn Id - type: string - session_id: - title: Session Id - type: string - input_messages: - items: - anyOf: - - $ref: '#/$defs/UserMessage' - - $ref: '#/$defs/ToolResponseMessage' - title: Input Messages - type: array - steps: - items: - discriminator: - mapping: - inference: '#/$defs/InferenceStep' - memory_retrieval: '#/$defs/MemoryRetrievalStep' - shield_call: '#/$defs/ShieldCallStep' - tool_execution: '#/$defs/ToolExecutionStep' - propertyName: step_type - oneOf: - - $ref: '#/$defs/InferenceStep' - - $ref: '#/$defs/ToolExecutionStep' - - $ref: '#/$defs/ShieldCallStep' - - $ref: '#/$defs/MemoryRetrievalStep' - title: Steps - type: array - output_message: - $ref: '#/$defs/CompletionMessage' - output_attachments: - anyOf: - - items: - $ref: '#/$defs/Attachment' - type: array - - type: 'null' - title: Output Attachments - started_at: - format: date-time - title: Started At - type: string - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - required: - - turn_id - - session_id - - input_messages - - steps - - output_message - - started_at - title: Turn - type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL - type: object - UserMessage: - description: >- - A message from the user in a chat conversation. - - - :param role: Must be "user" to identify this as a user message - - :param content: The content of the message, which can include text and - other media - - :param context: (Optional) This field is used internally by Llama Stack - to pass RAG context. This field may be removed in the API in the future. - properties: - role: - const: user - default: user - title: Role - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - context: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - type: 'null' - title: Context - required: - - content - title: UserMessage - type: object - ViolationLevel: - description: >- - Severity level of a safety violation. - - - :cvar INFO: Informational level violation that does not require action - - :cvar WARN: Warning level violation that suggests caution but allows continuation - - :cvar ERROR: Error level violation that requires blocking or intervention - enum: - - info - - warn - - error - title: ViolationLevel - type: string - _URLOrData: - description: >- - A URL or a base64 encoded string - - - :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - - :param data: base64 encoded image data as string - properties: - url: - anyOf: - - $ref: '#/$defs/URL' - - type: 'null' - data: - anyOf: - - type: string - - type: 'null' - contentEncoding: base64 - title: Data - title: _URLOrData - type: object - description: >- - A single session of an interaction with an Agentic System. - - - :param session_id: Unique identifier for the conversation session - - :param session_name: Human-readable name for the session - - :param turns: List of all turns that have occurred in this session - - :param started_at: Timestamp when the session was created - properties: - session_id: - title: Session Id - type: string - session_name: - title: Session Name - type: string - turns: - items: - $ref: '#/$defs/Turn' - title: Turns - type: array - started_at: - format: date-time - title: Started At - type: string - required: - - session_id - - session_name - - turns - - started_at - title: Session - type: object - properties: - turn_id: - type: string - description: The ID of the turn. - step_id: - type: string - description: The ID of the step. - started_at: - type: string - format: date-time - description: The time the step started. - completed_at: - type: string - format: date-time - description: The time the step completed. - step_type: - type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - title: StepType - description: Type of the step in an agent turn. - const: shield_call - default: shield_call - violation: - $ref: '#/components/schemas/SafetyViolation' - description: The violation from the shield call. - additionalProperties: false - required: - - turn_id - - step_id - - step_type - title: ShieldCallStep - description: A shield call step in an agent turn. - ToolCall: + - type: 'null' + title: First Id + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + has_more: + type: boolean + title: Has More + default: false type: object - properties: - call_id: - type: string - tool_name: - oneOf: - - type: string - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - - type: string - arguments: - type: string - additionalProperties: false required: - - call_id - - tool_name - - arguments - title: ToolCall - ToolExecutionStep: - type: object + - data + title: VectorStoreListFilesResponse + description: Response from listing files in a vector store. + VectorStoreListResponse: properties: - turn_id: - type: string - description: The ID of the turn. - step_id: - type: string - description: The ID of the step. - started_at: - type: string - format: date-time - description: The time the step started. - completed_at: - type: string - format: date-time - description: The time the step completed. - step_type: + object: type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - title: StepType - description: Type of the step in an agent turn. - const: tool_execution - default: tool_execution - tool_calls: - type: array + title: Object + default: list + data: items: - $ref: '#/components/schemas/ToolCall' - description: The tool calls to execute. - tool_responses: + $ref: '#/components/schemas/VectorStoreObject' type: array - items: - $ref: '#/components/schemas/ToolResponse' - description: The tool responses from the tool calls. - additionalProperties: false - required: - - turn_id - - step_id - - step_type - - tool_calls - - tool_responses - title: ToolExecutionStep - description: A tool execution step in an agent turn. - ToolResponse: + title: Data + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + has_more: + type: boolean + title: Has More + default: false type: object + required: + - data + title: VectorStoreListResponse + description: Response from listing vector stores. + VectorStoreModifyRequest: properties: - call_id: - type: string - description: >- - Unique identifier for the tool call this response is for - tool_name: - oneOf: - - type: string - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - - type: string - description: Name of the tool that was invoked - content: - $ref: '#/components/schemas/InterleavedContent' - description: The response content from the tool + name: + anyOf: + - type: string + - type: 'null' + title: Name + expires_after: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool response - additionalProperties: false - required: - - call_id - - tool_name - - content - title: ToolResponse - description: Response from a tool invocation. - ToolResponseMessage: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata type: object + title: VectorStoreModifyRequest + description: Request to modify a vector store. + VectorStoreObject: properties: - role: - type: string - const: tool - default: tool - description: >- - Must be "tool" to identify this as a tool response - call_id: - type: string - description: >- - Unique identifier for the tool call this response is for - content: - $ref: '#/components/schemas/InterleavedContent' - description: The response content from the tool - additionalProperties: false - required: - - role - - call_id - - content - title: ToolResponseMessage - description: >- - A message representing the result of a tool invocation. - Turn: - $defs: - Attachment: - description: >- - An attachment to an agent turn. - - - :param content: The content of the attachment. - - :param mime_type: The MIME type of the attachment. - properties: - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - $ref: '#/$defs/URL' - title: Content - mime_type: - title: Mime Type - type: string - required: - - content - - mime_type - title: Attachment - type: object - BuiltinTool: - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - type: string - CompletionMessage: - description: >- - A message containing the model's (assistant) response in a chat conversation. - - - :param role: Must be "assistant" to identify this as the model's response - - :param content: The content of the model's response - - :param stop_reason: Reason why the model stopped generating. Options are: - - `StopReason.end_of_turn`: The model finished generating the entire - response. - - `StopReason.end_of_message`: The model finished generating but generated - a partial response -- usually, a tool call. The user may call the tool - and continue the conversation with the tool's response. - - `StopReason.out_of_tokens`: The model ran out of token budget. - :param tool_calls: List of tool calls. Each tool call is a ToolCall object. - properties: - role: - const: assistant - default: assistant - title: Role - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - stop_reason: - $ref: '#/$defs/StopReason' - tool_calls: - anyOf: - - items: - $ref: '#/$defs/ToolCall' - type: array - - type: 'null' - title: Tool Calls - required: - - content - - stop_reason - title: CompletionMessage - type: object - ImageContentItem: - description: >- - A image content item - - - :param type: Discriminator type of the content item. Always "image" - - :param image: Image as a base64 encoded string or an URL - properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/$defs/_URLOrData' - required: - - image - title: ImageContentItem - type: object - InferenceStep: - description: >- - An inference step in an agent turn. - - - :param model_response: The response from the LLM. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: inference - default: inference - title: Step Type - type: string - model_response: - $ref: '#/$defs/CompletionMessage' - required: - - turn_id - - step_id - - model_response - title: InferenceStep - type: object - MemoryRetrievalStep: - description: >- - A memory retrieval step in an agent turn. - - - :param vector_store_ids: The IDs of the vector databases to retrieve context - from. - - :param inserted_context: The context retrieved from the vector databases. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: memory_retrieval - default: memory_retrieval - title: Step Type - type: string - vector_store_ids: - title: Vector Store Ids - type: string - inserted_context: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Inserted Context - required: - - turn_id - - step_id - - vector_store_ids - - inserted_context - title: MemoryRetrievalStep - type: object - SafetyViolation: - description: >- - Details of a safety violation detected by content moderation. - - - :param violation_level: Severity level of the violation - - :param user_message: (Optional) Message to convey to the user about the - violation - - :param metadata: Additional metadata including specific violation codes - for debugging and telemetry - properties: - violation_level: - $ref: '#/$defs/ViolationLevel' - user_message: - anyOf: - - type: string - - type: 'null' - title: User Message - metadata: - additionalProperties: true - title: Metadata - type: object - required: - - violation_level - title: SafetyViolation - type: object - ShieldCallStep: - description: >- - A shield call step in an agent turn. - - - :param violation: The violation from the shield call. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: shield_call - default: shield_call - title: Step Type - type: string - violation: - anyOf: - - $ref: '#/$defs/SafetyViolation' - - type: 'null' - required: - - turn_id - - step_id - - violation - title: ShieldCallStep - type: object - StopReason: - enum: - - end_of_turn - - end_of_message - - out_of_tokens - title: StopReason - type: string - TextContentItem: - description: >- - A text content item - - - :param type: Discriminator type of the content item. Always "text" - - :param text: Text content - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: TextContentItem - type: object - ToolCall: - properties: - call_id: - title: Call Id - type: string - tool_name: - anyOf: - - $ref: '#/$defs/BuiltinTool' - - type: string - title: Tool Name - arguments: - title: Arguments - type: string - required: - - call_id - - tool_name - - arguments - title: ToolCall - type: object - ToolExecutionStep: - description: >- - A tool execution step in an agent turn. - - - :param tool_calls: The tool calls to execute. - - :param tool_responses: The tool responses from the tool calls. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: tool_execution - default: tool_execution - title: Step Type - type: string - tool_calls: - items: - $ref: '#/$defs/ToolCall' - title: Tool Calls - type: array - tool_responses: - items: - $ref: '#/$defs/ToolResponse' - title: Tool Responses - type: array - required: - - turn_id - - step_id - - tool_calls - - tool_responses - title: ToolExecutionStep - type: object - ToolResponse: - description: >- - Response from a tool invocation. - - - :param call_id: Unique identifier for the tool call this response is for - - :param tool_name: Name of the tool that was invoked - - :param content: The response content from the tool - - :param metadata: (Optional) Additional metadata about the tool response - properties: - call_id: - title: Call Id - type: string - tool_name: - anyOf: - - $ref: '#/$defs/BuiltinTool' - - type: string - title: Tool Name - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - metadata: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Metadata - required: - - call_id - - tool_name - - content - title: ToolResponse - type: object - ToolResponseMessage: - description: >- - A message representing the result of a tool invocation. - - - :param role: Must be "tool" to identify this as a tool response - - :param call_id: Unique identifier for the tool call this response is for - - :param content: The response content from the tool - properties: - role: - const: tool - default: tool - title: Role - type: string - call_id: - title: Call Id - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - required: - - call_id - - content - title: ToolResponseMessage - type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL - type: object - UserMessage: - description: >- - A message from the user in a chat conversation. - - - :param role: Must be "user" to identify this as a user message - - :param content: The content of the message, which can include text and - other media - - :param context: (Optional) This field is used internally by Llama Stack - to pass RAG context. This field may be removed in the API in the future. - properties: - role: - const: user - default: user - title: Role - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - context: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - type: 'null' - title: Context - required: - - content - title: UserMessage - type: object - ViolationLevel: - description: >- - Severity level of a safety violation. - - - :cvar INFO: Informational level violation that does not require action - - :cvar WARN: Warning level violation that suggests caution but allows continuation - - :cvar ERROR: Error level violation that requires blocking or intervention - enum: - - info - - warn - - error - title: ViolationLevel - type: string - _URLOrData: - description: >- - A URL or a base64 encoded string - - - :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - - :param data: base64 encoded image data as string - properties: - url: - anyOf: - - $ref: '#/$defs/URL' - - type: 'null' - data: - anyOf: - - type: string - - type: 'null' - contentEncoding: base64 - title: Data - title: _URLOrData - type: object - description: >- - A single turn in an interaction with an Agentic System. - - - :param turn_id: Unique identifier for the turn within a session - - :param session_id: Unique identifier for the conversation session - - :param input_messages: List of messages that initiated this turn - - :param steps: Ordered list of processing steps executed during this turn - - :param output_message: The model's generated response containing content and - metadata - - :param output_attachments: (Optional) Files or media attached to the agent's - response - - :param started_at: Timestamp when the turn began - - :param completed_at: (Optional) Timestamp when the turn finished, if completed - properties: - turn_id: - title: Turn Id + id: type: string - session_id: - title: Session Id + title: Id + object: type: string - input_messages: - items: - anyOf: - - $ref: '#/$defs/UserMessage' - - $ref: '#/$defs/ToolResponseMessage' - title: Input Messages - type: array - steps: - items: - discriminator: - mapping: - file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' - message: '#/$defs/OpenAIResponseMessage' - web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - title: Output - type: array - parallel_tool_calls: - default: false - title: Parallel Tool Calls - type: boolean - previous_response_id: - title: Previous Response Id + title: Object + default: vector_store + created_at: + type: integer + title: Created At + name: + anyOf: + - type: string + - type: 'null' + title: Name + usage_bytes: + type: integer + title: Usage Bytes + default: 0 + file_counts: + $ref: '#/components/schemas/VectorStoreFileCounts' + status: type: string - completed_at: + title: Status + default: completed + expires_after: anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - required: - - turn_id - - session_id - - input_messages - - steps - - output_message - - started_at - title: Turn - description: >- - A single turn in an interaction with an Agentic System. - UserMessage: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After + expires_at: + anyOf: + - type: integer + - type: 'null' + title: Expires At + last_active_at: + anyOf: + - type: integer + - type: 'null' + title: Last Active At + metadata: + additionalProperties: true + type: object + title: Metadata type: object + required: + - id + - created_at + - file_counts + title: VectorStoreObject + description: OpenAI Vector Store object. + VectorStoreSearchResponse: properties: - role: + file_id: type: string - const: user - default: user - description: >- - Must be "user" to identify this as a user message - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - The content of the message, which can include text and other media - context: - $ref: '#/components/schemas/InterleavedContent' - description: >- - (Optional) This field is used internally by Llama Stack to pass RAG context. - This field may be removed in the API in the future. - additionalProperties: false - required: - - role - - content - title: UserMessage - description: >- - A message from the user in a chat conversation. - CreateAgentTurnRequest: - type: object - ResumeAgentTurnRequest: - type: object - AgentStepResponse: - $defs: - BuiltinTool: - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool + title: File Id + filename: type: string - temperature: - title: Temperature - type: number - nullable: true - text: - $ref: '#/components/schemas/OpenAIResponseText' - default: - format: - type: text - top_p: - title: Top P + title: Filename + score: type: number - nullable: true - tools: - title: Tools + title: Score + attributes: + anyOf: + - additionalProperties: + anyOf: + - type: string + - type: number + - type: boolean + type: object + - type: 'null' + title: Attributes + content: items: - discriminator: - mapping: - file_search: '#/$defs/OpenAIResponseInputToolFileSearch' - function: '#/$defs/OpenAIResponseInputToolFunction' - mcp: '#/$defs/OpenAIResponseToolMCP' - web_search: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseToolMCP' + $ref: '#/components/schemas/VectorStoreContent' type: array - nullable: true - truncation: - title: Truncation + title: Content + type: object + required: + - file_id + - filename + - score + - content + title: VectorStoreSearchResponse + description: Response from searching a vector store. + VectorStoreSearchResponsePage: + properties: + object: type: string - nullable: true - usage: - $ref: '#/components/schemas/OpenAIResponseUsage' - nullable: true - instructions: - title: Instructions + title: Object + default: vector_store.search_results.page + search_query: type: string - nullable: true - input: + title: Search Query + data: items: - anyOf: - - discriminator: - mapping: - file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' - message: '#/$defs/OpenAIResponseMessage' - web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseMessage' - title: Input + $ref: '#/components/schemas/VectorStoreSearchResponse' type: array - required: - - created_at - - id - - model - - output - - status - - input - title: OpenAIResponseObjectWithInput + title: Data + has_more: + type: boolean + title: Has More + default: false + next_page: + anyOf: + - type: string + - type: 'null' + title: Next Page type: object - ImageContentItem: - description: A image content item - properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/components/schemas/_URLOrData' required: - - image - title: ImageContentItem - type: object + - search_query + - data + title: VectorStoreSearchResponsePage + description: Paginated response from searching a vector store. + VersionInfo: properties: - type: + version: type: string - const: agent - default: agent - config: - $ref: '#/components/schemas/AgentConfig' - description: >- - The configuration for the agent candidate. - additionalProperties: false - required: - - type - - config - title: AgentCandidate - description: An agent candidate for evaluation. - BenchmarkConfig: + title: Version + description: Version number of the service type: object - properties: - eval_candidate: - oneOf: - - $ref: '#/components/schemas/ModelCandidate' - - $ref: '#/components/schemas/AgentCandidate' - discriminator: - propertyName: type - mapping: - model: '#/components/schemas/ModelCandidate' - agent: '#/components/schemas/AgentCandidate' - description: The candidate to evaluate. - scoring_params: - type: object - additionalProperties: - $ref: '#/components/schemas/ScoringFnParams' - description: >- - Map between scoring function id and parameters for each scoring function - you want to run - num_examples: - type: integer - description: >- - (Optional) The number of examples to evaluate. If not provided, all examples - in the dataset will be evaluated - additionalProperties: false required: - - eval_candidate - - scoring_params - title: BenchmarkConfig - description: >- - A benchmark configuration for evaluation. - ModelCandidate: - type: object + - version + title: VersionInfo + description: Version information for the service. + ViolationLevel: + type: string + enum: + - info + - warn + - error + title: ViolationLevel + description: "Severity level of a safety violation.\n\n:cvar INFO: Informational level violation that does not require action\n:cvar WARN: Warning level violation that suggests caution but allows continuation\n:cvar ERROR: Error level violation that requires blocking or intervention" + WeightedRanker: properties: type: type: string - const: model - default: model - model: - type: string - description: The model ID to evaluate. - sampling_params: - $ref: '#/components/schemas/SamplingParams' - description: The sampling parameters for the model. - system_message: - $ref: '#/components/schemas/SystemMessage' - description: >- - (Optional) The system message providing instructions or context to the - model. - additionalProperties: false - required: - - type - - model - - sampling_params - title: ModelCandidate - description: A model candidate for evaluation. - SystemMessage: - type: object - properties: - role: - type: string - const: system - default: system - description: >- - Must be "system" to identify this as a system message - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - The content of the "system prompt". If multiple system messages are provided, - they are concatenated. The underlying Llama Stack code may also add other - system messages (for example, for formatting tool definitions). - additionalProperties: false - required: - - role - - content - title: SystemMessage - description: >- - A system message providing instructions or context to the model. - EvaluateRowsRequest: - type: object - EvaluateResponse: - $defs: - ScoringResult: - description: >- - A scoring result for a single row. - - - :param score_rows: The scoring result for each row. Each row is a map - of column name to value. - - :param aggregated_results: Map of metric name to aggregated value - properties: - score_rows: - items: - additionalProperties: true - type: object - title: Score Rows - type: array - aggregated_results: - additionalProperties: true - title: Aggregated Results - type: object - required: - - score_rows - - aggregated_results - title: ScoringResult - type: object - description: >- - The response from an evaluation. - - - :param generations: The generations from the evaluation. - - :param scores: The scores from the evaluation. - properties: - epoch: - title: Epoch - type: integer - train_loss: - title: Train Loss - type: number - validation_loss: - title: Validation Loss - type: number - perplexity: - title: Perplexity + const: weighted + title: Type + default: weighted + alpha: type: number - required: - - epoch - - train_loss - - validation_loss - - perplexity - title: PostTrainingMetric + maximum: 1.0 + minimum: 0.0 + title: Alpha + description: Weight factor between 0 and 1. 0 means only keyword scores, 1 means only vector scores. + default: 0.5 type: object - _safety_run_shield_Request: + title: WeightedRanker + description: "Weighted ranker configuration that combines vector and keyword scores.\n\n:param type: The type of ranker, always \"weighted\"\n:param alpha: Weight factor between 0 and 1.\n 0 means only use keyword scores,\n 1 means only use vector scores,\n values in between blend both scores." + _URLOrData: properties: - shield_id: - title: Shield Id - type: string - messages: + url: anyOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - title: Messages - params: - title: Params - type: string - required: - - shield_id - - messages - - params - title: _safety_run_shield_Request - type: object - responses: - BadRequest400: - description: The request was invalid or malformed - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 400 - title: Bad Request - detail: The request was invalid or malformed - TooManyRequests429: - description: The client has sent too many requests in a given amount of time - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 429 - title: Too Many Requests - detail: You have exceeded the rate limit. Please try again later. - InternalServerError500: - description: The server encountered an unexpected error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 500 - title: Internal Server Error - detail: An unexpected error occurred. Our team has been notified. - DefaultError: - description: An unexpected error occurred - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 0 - title: Error - detail: An unexpected error occurred -security: - - Default: [] -tags: - - name: Agents - description: >- - APIs for creating and interacting with agentic systems. - x-displayName: Agents - - name: Batches - description: >- - The API is designed to allow use of openai client libraries for seamless integration. - - - This API provides the following extensions: - - idempotent batch creation - - Note: This API is currently under active development and may undergo changes. - x-displayName: >- - The Batches API enables efficient processing of multiple requests in a single - operation, particularly useful for processing large datasets, batch evaluation - workflows, and cost-effective inference at scale. - - name: Benchmarks - description: '' - - name: Conversations - description: >- - Protocol for conversation management operations. - x-displayName: Conversations - - name: DatasetIO - description: '' - - name: Datasets - description: '' - - name: Eval - description: >- - Llama Stack Evaluation API for running evaluations on model and agent candidates. - x-displayName: Evaluations - - name: Files - description: >- - This API is used to upload documents that can be used with other Llama Stack - APIs. - x-displayName: Files - - name: Inference - description: >- - Llama Stack Inference API for generating completions, chat completions, and - embeddings. - - This API provides the raw interface to the underlying models. Three kinds - of models are supported: - - LLM models: these models generate "raw" and "chat" (conversational) completions. - - Embedding models: these models generate embeddings to be used for semantic - search. - - Rerank models: these models reorder the documents based on their relevance - to a query. - x-displayName: Inference - - name: Inspect - description: >- - APIs for inspecting the Llama Stack service, including health status, available - API routes with methods and implementing providers. - x-displayName: Inspect - - name: Models - description: '' - - name: PostTraining (Coming Soon) - description: '' - - name: Prompts - description: >- - Protocol for prompt management operations. - x-displayName: Prompts - - name: Providers - description: >- - Providers API for inspecting, listing, and modifying providers and their configurations. - x-displayName: Providers - - name: Safety - description: OpenAI-compatible Moderations API. - x-displayName: Safety - - name: Scoring - description: '' - - name: ScoringFunctions - description: '' - - name: Shields - description: '' - - name: ToolGroups - description: '' - - name: ToolRuntime - description: '' - - name: VectorIO - description: '' -x-tagGroups: - - name: Operations - tags: - - Agents - - Batches - - Benchmarks - - Conversations - - DatasetIO - - Datasets - - Eval - - Files - - Inference - - Inspect - - Models - - PostTraining (Coming Soon) - - Prompts - - Providers - - Safety - - Scoring - - ScoringFunctions - - Shields - - ToolGroups - - ToolRuntime - - VectorIO + - $ref: '#/components/schemas/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data + type: object + title: _URLOrData + description: A URL or a base64 encoded string. diff --git a/docs/static/deprecated-llama-stack-spec.json b/docs/static/deprecated-llama-stack-spec.json deleted file mode 100644 index 8614bd0b72..0000000000 --- a/docs/static/deprecated-llama-stack-spec.json +++ /dev/null @@ -1,18640 +0,0 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "Llama Stack API", - "description": "A comprehensive API for building and deploying AI applications", - "version": "1.0.0" - }, - "servers": [ - { - "url": "https://api.llamastack.com", - "description": "Production server" - }, - { - "url": "https://staging-api.llamastack.com", - "description": "Staging server" - } - ], - "paths": { - "/v1/agents": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all agents.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_agents_v1_agents_get", - "deprecated": true, - "parameters": [ - { - "name": "limit", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Limit" - } - }, - { - "name": "start_index", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Start Index" - } - } - ], - "responses": { - "200": { - "description": "A PaginatedResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaginatedResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Create an agent with the given configuration.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_agent_v1_agents_post", - "deprecated": true, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentConfig" - } - } - } - }, - "responses": { - "200": { - "description": "An AgentCreateResponse with the agent ID.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentCreateResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/agents/{agent_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete an agent by its ID and its associated sessions and turns.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "delete_agent_v1_agents__agent_id__delete", - "deprecated": true, - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the agent to delete." - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Describe an agent by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_agent_v1_agents__agent_id__get", - "deprecated": true, - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Agent Id" - }, - "description": "ID of the agent." - } - ], - "responses": { - "200": { - "description": "An Agent of the agent.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Agent" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/agents/{agent_id}/session": { - "post": { - "tags": [ - "V1" - ], - "summary": "Create a new session for an agent.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_agent_session_v1_agents__agent_id__session_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/__main_____agents_agent_id_session_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "An AgentSessionCreateResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSessionCreateResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true, - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the agent to create the session for." - } - ] - } - }, - "/v1/agents/{agent_id}/session/{session_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete an agent session by its ID and its associated turns.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "delete_agents_session_v1_agents__agent_id__session__session_id__delete", - "deprecated": true, - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the session to delete." - }, - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the agent to delete the session for." - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve an agent session by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_agents_session_v1_agents__agent_id__session__session_id__get", - "deprecated": true, - "parameters": [ - { - "name": "turn_ids", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Turn Ids" - } - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Session Id" - }, - "description": "The ID of the session to get." - }, - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Agent Id" - }, - "description": "The ID of the agent to get the session for." - } - ], - "responses": { - "200": { - "description": "A Session.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Session" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/agents/{agent_id}/session/{session_id}/turn": { - "post": { - "tags": [ - "V1" - ], - "summary": "Create a new turn for an agent.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_agent_turn_v1_agents__agent_id__session__session_id__turn_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/__main_____agents_agent_id_session_session_id_turn_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "If stream=False, returns a Turn object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Turn" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true, - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the agent to create the turn for." - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the session to create the turn for." - } - ] - } - }, - "/v1/agents/{agent_id}/session/{session_id}/turn/{turn_id}": { - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve an agent turn by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_agents_turn_v1_agents__agent_id__session__session_id__turn__turn_id__get", - "deprecated": true, - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Agent Id" - }, - "description": "The ID of the agent to get the turn for." - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Session Id" - }, - "description": "The ID of the session to get the turn for." - }, - { - "name": "turn_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Turn Id" - }, - "description": "The ID of the turn to get." - } - ], - "responses": { - "200": { - "description": "A Turn.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Turn" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume": { - "post": { - "tags": [ - "V1" - ], - "summary": "Resume an agent turn with executed tool call responses.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "resume_agent_turn_v1_agents__agent_id__session__session_id__turn__turn_id__resume_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A Turn object if stream is False, otherwise an AsyncIterator of AgentTurnResponseStreamChunk objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Turn" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true, - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the agent to resume." - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the session to resume." - }, - { - "name": "turn_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the turn to resume." - } - ] - } - }, - "/v1/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}": { - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve an agent step by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_agents_step_v1_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get", - "deprecated": true, - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Agent Id" - }, - "description": "The ID of the agent to get the step for." - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Session Id" - }, - "description": "The ID of the session to get the step for." - }, - { - "name": "turn_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Turn Id" - }, - "description": "The ID of the turn to get the step for." - }, - { - "name": "step_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Step Id" - }, - "description": "The ID of the step to get." - } - ], - "responses": { - "200": { - "description": "An AgentStepResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentStepResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/agents/{agent_id}/sessions": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all session(s) of a given agent.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_agent_sessions_v1_agents__agent_id__sessions_get", - "deprecated": true, - "parameters": [ - { - "name": "limit", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Limit" - } - }, - { - "name": "start_index", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Start Index" - } - }, - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Agent Id" - }, - "description": "The ID of the agent to list sessions for." - } - ], - "responses": { - "200": { - "description": "A PaginatedResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaginatedResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/datasetio/append-rows/{dataset_id}": { - "post": { - "tags": [ - "V1" - ], - "summary": "Append rows to a dataset.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "append_rows_v1_datasetio_append_rows__dataset_id__post", - "deprecated": true, - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "dataset_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Path parameter: dataset_id" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/datasetio/iterrows/{dataset_id}": { - "get": { - "tags": [ - "V1" - ], - "summary": "Get a paginated list of rows from a dataset.", - "description": "Query endpoint for proper schema generation.", - "operationId": "iterrows_v1_datasetio_iterrows__dataset_id__get", - "deprecated": true, - "parameters": [ - { - "name": "limit", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Limit" - } - }, - { - "name": "start_index", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Start Index" - } - }, - { - "name": "dataset_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Dataset Id" - } - } - ], - "responses": { - "200": { - "description": "A PaginatedResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaginatedResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/datasets": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all datasets.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_datasets_v1_datasets_get", - "responses": { - "200": { - "description": "A ListDatasetsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListDatasetsResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Register a new dataset.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "register_dataset_v1_datasets_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/__main_____datasets_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A Dataset.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Dataset" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true - } - }, - "/v1/datasets/{dataset_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Unregister a dataset by its ID.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "unregister_dataset_v1_datasets__dataset_id__delete", - "deprecated": true, - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "dataset_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Path parameter: dataset_id" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Get a dataset by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_dataset_v1_datasets__dataset_id__get", - "deprecated": true, - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Dataset Id" - } - } - ], - "responses": { - "200": { - "description": "A Dataset.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Dataset" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/eval/benchmarks": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all benchmarks.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_benchmarks_v1_eval_benchmarks_get", - "deprecated": true, - "responses": { - "200": { - "description": "A ListBenchmarksResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListBenchmarksResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Register a benchmark.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "register_benchmark_v1_eval_benchmarks_post", - "deprecated": true, - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/eval/benchmarks/{benchmark_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Unregister a benchmark.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "unregister_benchmark_v1_eval_benchmarks__benchmark_id__delete", - "deprecated": true, - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the benchmark to unregister." - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Get a benchmark by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_benchmark_v1_eval_benchmarks__benchmark_id__get", - "deprecated": true, - "parameters": [ - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Benchmark Id" - }, - "description": "The ID of the benchmark to get." - } - ], - "responses": { - "200": { - "description": "A Benchmark.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Benchmark" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/eval/benchmarks/{benchmark_id}/evaluations": { - "post": { - "tags": [ - "V1" - ], - "summary": "Evaluate a list of rows on a benchmark.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "evaluate_rows_v1_eval_benchmarks__benchmark_id__evaluations_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BenchmarkConfig" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "EvaluateResponse object containing generations and scores.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluateResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true, - "parameters": [ - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the benchmark to run the evaluation on." - } - ] - } - }, - "/v1/eval/benchmarks/{benchmark_id}/jobs": { - "post": { - "tags": [ - "V1" - ], - "summary": "Run an evaluation on a benchmark.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "run_eval_v1_eval_benchmarks__benchmark_id__jobs_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BenchmarkConfig" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "The job that was created to run the evaluation.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Job" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true, - "parameters": [ - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the benchmark to run the evaluation on." - } - ] - } - }, - "/v1/eval/benchmarks/{benchmark_id}/jobs/{job_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Cancel a job.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "job_cancel_v1_eval_benchmarks__benchmark_id__jobs__job_id__delete", - "deprecated": true, - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the benchmark to run the evaluation on." - }, - { - "name": "job_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the job to cancel." - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Get the status of a job.", - "description": "Query endpoint for proper schema generation.", - "operationId": "job_status_v1_eval_benchmarks__benchmark_id__jobs__job_id__get", - "deprecated": true, - "parameters": [ - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Benchmark Id" - }, - "description": "The ID of the benchmark to run the evaluation on." - }, - { - "name": "job_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Job Id" - }, - "description": "The ID of the job to get the status of." - } - ], - "responses": { - "200": { - "description": "The status of the evaluation job.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Job" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result": { - "get": { - "tags": [ - "V1" - ], - "summary": "Get the result of a job.", - "description": "Query endpoint for proper schema generation.", - "operationId": "job_result_v1_eval_benchmarks__benchmark_id__jobs__job_id__result_get", - "deprecated": true, - "parameters": [ - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Benchmark Id" - }, - "description": "The ID of the benchmark to run the evaluation on." - }, - { - "name": "job_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Job Id" - }, - "description": "The ID of the job to get the result of." - } - ], - "responses": { - "200": { - "description": "The result of the job.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluateResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/openai/v1/batches": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all batches for the current user.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_batches_v1_openai_v1_batches_get", - "deprecated": true, - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - } - ], - "responses": { - "200": { - "description": "A list of batch objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListBatchesResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Create a new batch for processing multiple API requests.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_batch_v1_openai_v1_batches_post", - "deprecated": true, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_openai_v1_batches_Request" - } - } - } - }, - "responses": { - "200": { - "description": "The created batch object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Batch" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/openai/v1/batches/{batch_id}": { - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve information about a specific batch.", - "description": "Query endpoint for proper schema generation.", - "operationId": "retrieve_batch_v1_openai_v1_batches__batch_id__get", - "deprecated": true, - "parameters": [ - { - "name": "batch_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Batch Id" - }, - "description": "The ID of the batch to retrieve." - } - ], - "responses": { - "200": { - "description": "The batch object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Batch" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/openai/v1/batches/{batch_id}/cancel": { - "post": { - "tags": [ - "V1" - ], - "summary": "Cancel a batch that is in progress.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "cancel_batch_v1_openai_v1_batches__batch_id__cancel_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_openai_v1_batches_batch_id_cancel_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "The updated batch object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Batch" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true, - "parameters": [ - { - "name": "batch_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the batch to cancel." - } - ] - } - }, - "/v1/openai/v1/chat/completions": { - "get": { - "tags": [ - "V1" - ], - "summary": "List chat completions.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_chat_completions_v1_openai_v1_chat_completions_get", - "deprecated": true, - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "model", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Model" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "$ref": "#/components/schemas/Order", - "default": "desc" - } - } - ], - "responses": { - "200": { - "description": "A ListOpenAIChatCompletionResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListOpenAIChatCompletionResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Create chat completions.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_chat_completion_v1_openai_v1_chat_completions_post", - "deprecated": true, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIChatCompletionRequestWithExtraBody" - } - } - } - }, - "responses": { - "200": { - "description": "An OpenAIChatCompletion.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIChatCompletion" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/openai/v1/chat/completions/{completion_id}": { - "get": { - "tags": [ - "V1" - ], - "summary": "Get chat completion.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_chat_completion_v1_openai_v1_chat_completions__completion_id__get", - "deprecated": true, - "parameters": [ - { - "name": "completion_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Completion Id" - }, - "description": "ID of the chat completion." - } - ], - "responses": { - "200": { - "description": "A OpenAICompletionWithInputMessages.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAICompletionWithInputMessages" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/openai/v1/completions": { - "post": { - "tags": [ - "V1" - ], - "summary": "Create completion.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_completion_v1_openai_v1_completions_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAICompletionRequestWithExtraBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "An OpenAICompletion.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAICompletion" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true - } - }, - "/v1/openai/v1/embeddings": { - "post": { - "tags": [ - "V1" - ], - "summary": "Create embeddings.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_embeddings_v1_openai_v1_embeddings_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "An OpenAIEmbeddingsResponse containing the embeddings.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIEmbeddingsResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true - } - }, - "/v1/openai/v1/files": { - "get": { - "tags": [ - "V1" - ], - "summary": "List files.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_list_files_v1_openai_v1_files_get", - "deprecated": true, - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "purpose", - "in": "query", - "required": true, - "schema": { - "$ref": "#/components/schemas/OpenAIFilePurpose" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 10000, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "$ref": "#/components/schemas/Order", - "default": "desc" - } - } - ], - "responses": { - "200": { - "description": "An ListOpenAIFileResponse containing the list of files.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListOpenAIFileResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Upload file.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "openai_upload_file_v1_openai_v1_files_post", - "deprecated": true, - "responses": { - "200": { - "description": "An OpenAIFileObject representing the uploaded file.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIFileObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/openai/v1/files/{file_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete file.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_delete_file_v1_openai_v1_files__file_id__delete", - "deprecated": true, - "parameters": [ - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "File Id" - }, - "description": "The ID of the file to use for this request." - } - ], - "responses": { - "200": { - "description": "An OpenAIFileDeleteResponse indicating successful deletion.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIFileDeleteResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve file.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_retrieve_file_v1_openai_v1_files__file_id__get", - "deprecated": true, - "parameters": [ - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "File Id" - }, - "description": "The ID of the file to use for this request." - } - ], - "responses": { - "200": { - "description": "An OpenAIFileObject containing file information.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIFileObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/openai/v1/files/{file_id}/content": { - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve file content.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "openai_retrieve_file_content_v1_openai_v1_files__file_id__content_get", - "deprecated": true, - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the file to use for this request." - } - ], - "responses": { - "200": { - "description": "The raw file content as a binary response.", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/openai/v1/models": { - "get": { - "tags": [ - "V1" - ], - "summary": "List models using the OpenAI API.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "openai_list_models_v1_openai_v1_models_get", - "responses": { - "200": { - "description": "A OpenAIListModelsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIListModelsResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true - } - }, - "/v1/openai/v1/moderations": { - "post": { - "tags": [ - "V1" - ], - "summary": "Create moderation.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "run_moderation_v1_openai_v1_moderations_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_openai_v1_moderations_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A moderation object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModerationObject" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true - } - }, - "/v1/openai/v1/responses": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all responses.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_openai_responses_v1_openai_v1_responses_get", - "deprecated": true, - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "model", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Model" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 50, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "$ref": "#/components/schemas/Order", - "default": "desc" - } - } - ], - "responses": { - "200": { - "description": "A ListOpenAIResponseObject.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListOpenAIResponseObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Create a model response.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_openai_response_v1_openai_v1_responses_post", - "deprecated": true, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_openai_v1_responses_Request" - } - } - } - }, - "responses": { - "200": { - "description": "An OpenAIResponseObject.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIResponseObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/openai/v1/responses/{response_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete a response.", - "description": "Query endpoint for proper schema generation.", - "operationId": "delete_openai_response_v1_openai_v1_responses__response_id__delete", - "deprecated": true, - "parameters": [ - { - "name": "response_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Response Id" - }, - "description": "The ID of the OpenAI response to delete." - } - ], - "responses": { - "200": { - "description": "An OpenAIDeleteResponseObject", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIDeleteResponseObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Get a model response.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_openai_response_v1_openai_v1_responses__response_id__get", - "deprecated": true, - "parameters": [ - { - "name": "response_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Response Id" - }, - "description": "The ID of the OpenAI response to retrieve." - } - ], - "responses": { - "200": { - "description": "An OpenAIResponseObject.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIResponseObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/openai/v1/responses/{response_id}/input_items": { - "get": { - "tags": [ - "V1" - ], - "summary": "List input items.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_openai_response_input_items_v1_openai_v1_responses__response_id__input_items_get", - "deprecated": true, - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "before", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Before" - } - }, - { - "name": "include", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Include" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "$ref": "#/components/schemas/Order", - "default": "desc" - } - }, - { - "name": "response_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Response Id" - }, - "description": "The ID of the response to retrieve input items for." - } - ], - "responses": { - "200": { - "description": "An ListOpenAIResponseInputItem.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListOpenAIResponseInputItem" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/openai/v1/vector_stores": { - "get": { - "tags": [ - "V1" - ], - "summary": "Returns a list of vector stores.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_list_vector_stores_v1_openai_v1_vector_stores_get", - "deprecated": true, - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "before", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Before" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "desc", - "title": "Order" - } - } - ], - "responses": { - "200": { - "description": "A VectorStoreListResponse containing the list of vector stores.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreListResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Creates a vector store.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_create_vector_store_v1_openai_v1_vector_stores_post", - "deprecated": true, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody" - } - } - } - }, - "responses": { - "200": { - "description": "A VectorStoreObject representing the created vector store.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/openai/v1/vector_stores/{vector_store_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete a vector store.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_delete_vector_store_v1_openai_v1_vector_stores__vector_store_id__delete", - "deprecated": true, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store to delete." - } - ], - "responses": { - "200": { - "description": "A VectorStoreDeleteResponse indicating the deletion status.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreDeleteResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieves a vector store.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_retrieve_vector_store_v1_openai_v1_vector_stores__vector_store_id__get", - "deprecated": true, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store to retrieve." - } - ], - "responses": { - "200": { - "description": "A VectorStoreObject representing the vector store.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Updates a vector store.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_update_vector_store_v1_openai_v1_vector_stores__vector_store_id__post", - "deprecated": true, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_openai_v1_vector_stores_vector_store_id_Request" - } - } - } - }, - "responses": { - "200": { - "description": "A VectorStoreObject representing the updated vector store.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - }, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store to update." - } - ] - } - }, - "/v1/openai/v1/vector_stores/{vector_store_id}/file_batches": { - "post": { - "tags": [ - "V1" - ], - "summary": "Create a vector store file batch.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_create_vector_store_file_batch_v1_openai_v1_vector_stores__vector_store_id__file_batches_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A VectorStoreFileBatchObject representing the created file batch.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileBatchObject" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store to create the file batch for." - } - ] - } - }, - "/v1/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}": { - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve a vector store file batch.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_retrieve_vector_store_file_batch_v1_openai_v1_vector_stores__vector_store_id__file_batches__batch_id__get", - "deprecated": true, - "parameters": [ - { - "name": "batch_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Batch Id" - }, - "description": "The ID of the file batch to retrieve." - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store containing the file batch." - } - ], - "responses": { - "200": { - "description": "A VectorStoreFileBatchObject representing the file batch.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileBatchObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel": { - "post": { - "tags": [ - "V1" - ], - "summary": "Cancels a vector store file batch.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_cancel_vector_store_file_batch_v1_openai_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_openai_v1_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A VectorStoreFileBatchObject representing the cancelled file batch.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileBatchObject" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true, - "parameters": [ - { - "name": "batch_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the file batch to cancel." - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store containing the file batch." - } - ] - } - }, - "/v1/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files": { - "get": { - "tags": [ - "V1" - ], - "summary": "Returns a list of vector store files in a batch.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_list_files_in_vector_store_file_batch_v1_openai_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get", - "deprecated": true, - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "before", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Before" - } - }, - { - "name": "filter", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Filter" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "desc", - "title": "Order" - } - }, - { - "name": "batch_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Batch Id" - }, - "description": "The ID of the file batch to list files from." - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store containing the file batch." - } - ], - "responses": { - "200": { - "description": "A VectorStoreFilesListInBatchResponse containing the list of files in the batch.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFilesListInBatchResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/openai/v1/vector_stores/{vector_store_id}/files": { - "get": { - "tags": [ - "V1" - ], - "summary": "List files in a vector store.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_list_files_in_vector_store_v1_openai_v1_vector_stores__vector_store_id__files_get", - "deprecated": true, - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "before", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Before" - } - }, - { - "name": "filter", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Filter" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "desc", - "title": "Order" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store to list files from." - } - ], - "responses": { - "200": { - "description": "A VectorStoreListFilesResponse containing the list of files.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreListFilesResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Attach a file to a vector store.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_attach_file_to_vector_store_v1_openai_v1_vector_stores__vector_store_id__files_post", - "deprecated": true, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_openai_v1_vector_stores_vector_store_id_files_Request" - } - } - } - }, - "responses": { - "200": { - "description": "A VectorStoreFileObject representing the attached file.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - }, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store to attach the file to." - } - ] - } - }, - "/v1/openai/v1/vector_stores/{vector_store_id}/files/{file_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete a vector store file.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_delete_vector_store_file_v1_openai_v1_vector_stores__vector_store_id__files__file_id__delete", - "deprecated": true, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store containing the file to delete." - }, - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "File Id" - }, - "description": "The ID of the file to delete." - } - ], - "responses": { - "200": { - "description": "A VectorStoreFileDeleteResponse indicating the deletion status.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileDeleteResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieves a vector store file.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_retrieve_vector_store_file_v1_openai_v1_vector_stores__vector_store_id__files__file_id__get", - "deprecated": true, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store containing the file to retrieve." - }, - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "File Id" - }, - "description": "The ID of the file to retrieve." - } - ], - "responses": { - "200": { - "description": "A VectorStoreFileObject representing the file.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Updates a vector store file.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_update_vector_store_file_v1_openai_v1_vector_stores__vector_store_id__files__file_id__post", - "deprecated": true, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_openai_v1_vector_stores_vector_store_id_files_file_id_Request" - } - } - } - }, - "responses": { - "200": { - "description": "A VectorStoreFileObject representing the updated file.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - }, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store containing the file to update." - }, - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the file to update." - } - ] - } - }, - "/v1/openai/v1/vector_stores/{vector_store_id}/files/{file_id}/content": { - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieves the contents of a vector store file.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_retrieve_vector_store_file_contents_v1_openai_v1_vector_stores__vector_store_id__files__file_id__content_get", - "deprecated": true, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store containing the file to retrieve." - }, - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "File Id" - }, - "description": "The ID of the file to retrieve." - } - ], - "responses": { - "200": { - "description": "A list of InterleavedContent representing the file contents.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileContentsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/openai/v1/vector_stores/{vector_store_id}/search": { - "post": { - "tags": [ - "V1" - ], - "summary": "Search for chunks in a vector store.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_search_vector_store_v1_openai_v1_vector_stores__vector_store_id__search_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_openai_v1_vector_stores_vector_store_id_search_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A VectorStoreSearchResponse containing the search results.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreSearchResponsePage" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store to search." - } - ] - } - }, - "/v1/post-training/job/artifacts": { - "get": { - "tags": [ - "V1" - ], - "summary": "Get the artifacts of a training job.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_training_job_artifacts_v1_post_training_job_artifacts_get", - "deprecated": true, - "parameters": [ - { - "name": "job_uuid", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Job Uuid" - } - } - ], - "responses": { - "200": { - "description": "A PostTrainingJobArtifactsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostTrainingJobArtifactsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/post-training/job/cancel": { - "post": { - "tags": [ - "V1" - ], - "summary": "Cancel a training job.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "cancel_training_job_v1_post_training_job_cancel_post", - "deprecated": true, - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/post-training/job/status": { - "get": { - "tags": [ - "V1" - ], - "summary": "Get the status of a training job.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_training_job_status_v1_post_training_job_status_get", - "deprecated": true, - "parameters": [ - { - "name": "job_uuid", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Job Uuid" - } - } - ], - "responses": { - "200": { - "description": "A PostTrainingJobStatusResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostTrainingJobStatusResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/post-training/jobs": { - "get": { - "tags": [ - "V1" - ], - "summary": "Get all training jobs.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "get_training_jobs_v1_post_training_jobs_get", - "responses": { - "200": { - "description": "A ListPostTrainingJobsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListPostTrainingJobsResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true - } - }, - "/v1/post-training/preference-optimize": { - "post": { - "tags": [ - "V1" - ], - "summary": "Run preference optimization of a model.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "preference_optimize_v1_post_training_preference_optimize_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DPOAlignmentConfig" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A PostTrainingJob.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostTrainingJob" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true - } - }, - "/v1/post-training/supervised-fine-tune": { - "post": { - "tags": [ - "V1" - ], - "summary": "Run supervised fine-tuning of a model.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "supervised_fine_tune_v1_post_training_supervised_fine_tune_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TrainingConfig" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A PostTrainingJob.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostTrainingJob" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "deprecated": true - } - } - }, - "components": { - "schemas": { - "AgentCandidate": { - "properties": { - "type": { - "type": "string", - "const": "agent", - "title": "Type", - "default": "agent" - }, - "config": { - "$ref": "#/components/schemas/AgentConfig" - } - }, - "type": "object", - "required": [ - "config" - ], - "title": "AgentCandidate", - "description": "An agent candidate for evaluation." - }, - "AgentConfig": { - "properties": { - "sampling_params": { - "$ref": "#/components/schemas/SamplingParams" - }, - "input_shields": { - "title": "Input Shields", - "items": { - "type": "string" - }, - "type": "array" - }, - "output_shields": { - "title": "Output Shields", - "items": { - "type": "string" - }, - "type": "array" - }, - "toolgroups": { - "title": "Toolgroups", - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/AgentToolGroupWithArgs" - } - ] - }, - "type": "array" - }, - "client_tools": { - "title": "Client Tools", - "items": { - "$ref": "#/components/schemas/ToolDef" - }, - "type": "array" - }, - "tool_choice": { - "deprecated": true, - "$ref": "#/components/schemas/ToolChoice" - }, - "tool_prompt_format": { - "deprecated": true, - "$ref": "#/components/schemas/ToolPromptFormat" - }, - "tool_config": { - "$ref": "#/components/schemas/ToolConfig" - }, - "max_infer_iters": { - "title": "Max Infer Iters", - "default": 10, - "type": "integer" - }, - "model": { - "type": "string", - "title": "Model" - }, - "instructions": { - "type": "string", - "title": "Instructions" - }, - "name": { - "title": "Name", - "type": "string" - }, - "enable_session_persistence": { - "title": "Enable Session Persistence", - "default": false, - "type": "boolean" - }, - "response_format": { - "title": "Response Format", - "oneOf": [ - { - "$ref": "#/components/schemas/JsonSchemaResponseFormat" - }, - { - "$ref": "#/components/schemas/GrammarResponseFormat" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "grammar": "#/components/schemas/GrammarResponseFormat", - "json_schema": "#/components/schemas/JsonSchemaResponseFormat" - } - } - } - }, - "type": "object", - "required": [ - "model", - "instructions" - ], - "title": "AgentConfig", - "description": "Configuration for an agent." - }, - "AgentCreateResponse": { - "properties": { - "agent_id": { - "type": "string", - "title": "Agent Id" - } - }, - "type": "object", - "required": [ - "agent_id" - ], - "title": "AgentCreateResponse", - "description": "Response returned when creating a new agent." - }, - "AgentSessionCreateResponse": { - "properties": { - "session_id": { - "type": "string", - "title": "Session Id" - } - }, - "type": "object", - "required": [ - "session_id" - ], - "title": "AgentSessionCreateResponse", - "description": "Response returned when creating a new agent session." - }, - "AgentToolGroupWithArgs": { - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "args": { - "additionalProperties": true, - "type": "object", - "title": "Args" - } - }, - "type": "object", - "required": [ - "name", - "args" - ], - "title": "AgentToolGroupWithArgs" - }, - "AgentTurnInputType": { - "properties": { - "type": { - "type": "string", - "const": "agent_turn_input", - "title": "Type", - "default": "agent_turn_input" - } - }, - "type": "object", - "title": "AgentTurnInputType", - "description": "Parameter type for agent turn input." - }, - "AggregationFunctionType": { - "type": "string", - "enum": [ - "average", - "weighted_average", - "median", - "categorical_count", - "accuracy" - ], - "title": "AggregationFunctionType", - "description": "Types of aggregation functions for scoring results." - }, - "AllowedToolsFilter": { - "properties": { - "tool_names": { - "title": "Tool Names", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object", - "title": "AllowedToolsFilter", - "description": "Filter configuration for restricting which MCP tools can be used." - }, - "ApprovalFilter": { - "properties": { - "always": { - "title": "Always", - "items": { - "type": "string" - }, - "type": "array" - }, - "never": { - "title": "Never", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object", - "title": "ApprovalFilter", - "description": "Filter configuration for MCP tool approval requirements." - }, - "ArrayType": { - "properties": { - "type": { - "type": "string", - "const": "array", - "title": "Type", - "default": "array" - } - }, - "type": "object", - "title": "ArrayType", - "description": "Parameter type for array values." - }, - "Attachment-Input": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - }, - { - "$ref": "#/components/schemas/URL" - } - ], - "title": "Content" - }, - "mime_type": { - "type": "string", - "title": "Mime Type" - } - }, - "type": "object", - "required": [ - "content", - "mime_type" - ], - "title": "Attachment", - "description": "An attachment to an agent turn." - }, - "Attachment-Output": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - }, - { - "$ref": "#/components/schemas/URL" - } - ], - "title": "Content" - }, - "mime_type": { - "type": "string", - "title": "Mime Type" - } - }, - "type": "object", - "required": [ - "content", - "mime_type" - ], - "title": "Attachment", - "description": "An attachment to an agent turn." - }, - "BasicScoringFnParams": { - "properties": { - "type": { - "type": "string", - "const": "basic", - "title": "Type", - "default": "basic" - }, - "aggregation_functions": { - "items": { - "$ref": "#/components/schemas/AggregationFunctionType" - }, - "type": "array", - "title": "Aggregation Functions", - "description": "Aggregation functions to apply to the scores of each row" - } - }, - "type": "object", - "title": "BasicScoringFnParams", - "description": "Parameters for basic scoring function configuration." - }, - "Batch": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "completion_window": { - "type": "string", - "title": "Completion Window" - }, - "created_at": { - "type": "integer", - "title": "Created At" - }, - "endpoint": { - "type": "string", - "title": "Endpoint" - }, - "input_file_id": { - "type": "string", - "title": "Input File Id" - }, - "object": { - "type": "string", - "const": "batch", - "title": "Object" - }, - "status": { - "type": "string", - "enum": [ - "validating", - "failed", - "in_progress", - "finalizing", - "completed", - "expired", - "cancelling", - "cancelled" - ], - "title": "Status" - }, - "cancelled_at": { - "title": "Cancelled At", - "type": "integer" - }, - "cancelling_at": { - "title": "Cancelling At", - "type": "integer" - }, - "completed_at": { - "title": "Completed At", - "type": "integer" - }, - "error_file_id": { - "title": "Error File Id", - "type": "string" - }, - "errors": { - "$ref": "#/components/schemas/Errors" - }, - "expired_at": { - "title": "Expired At", - "type": "integer" - }, - "expires_at": { - "title": "Expires At", - "type": "integer" - }, - "failed_at": { - "title": "Failed At", - "type": "integer" - }, - "finalizing_at": { - "title": "Finalizing At", - "type": "integer" - }, - "in_progress_at": { - "title": "In Progress At", - "type": "integer" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "model": { - "title": "Model", - "type": "string" - }, - "output_file_id": { - "title": "Output File Id", - "type": "string" - }, - "request_counts": { - "$ref": "#/components/schemas/BatchRequestCounts" - }, - "usage": { - "$ref": "#/components/schemas/BatchUsage" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "completion_window", - "created_at", - "endpoint", - "input_file_id", - "object", - "status" - ], - "title": "Batch" - }, - "BatchError": { - "properties": { - "code": { - "title": "Code", - "type": "string" - }, - "line": { - "title": "Line", - "type": "integer" - }, - "message": { - "title": "Message", - "type": "string" - }, - "param": { - "title": "Param", - "type": "string" - } - }, - "additionalProperties": true, - "type": "object", - "title": "BatchError" - }, - "BatchRequestCounts": { - "properties": { - "completed": { - "type": "integer", - "title": "Completed" - }, - "failed": { - "type": "integer", - "title": "Failed" - }, - "total": { - "type": "integer", - "title": "Total" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "completed", - "failed", - "total" - ], - "title": "BatchRequestCounts" - }, - "BatchUsage": { - "properties": { - "input_tokens": { - "type": "integer", - "title": "Input Tokens" - }, - "input_tokens_details": { - "$ref": "#/components/schemas/InputTokensDetails" - }, - "output_tokens": { - "type": "integer", - "title": "Output Tokens" - }, - "output_tokens_details": { - "$ref": "#/components/schemas/OutputTokensDetails" - }, - "total_tokens": { - "type": "integer", - "title": "Total Tokens" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "input_tokens", - "input_tokens_details", - "output_tokens", - "output_tokens_details", - "total_tokens" - ], - "title": "BatchUsage" - }, - "Benchmark": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "benchmark", - "title": "Type", - "default": "benchmark" - }, - "dataset_id": { - "type": "string", - "title": "Dataset Id" - }, - "scoring_functions": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Scoring Functions" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata", - "description": "Metadata for this evaluation task" - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id", - "dataset_id", - "scoring_functions" - ], - "title": "Benchmark", - "description": "A benchmark resource for evaluating model performance." - }, - "BenchmarkConfig": { - "properties": { - "eval_candidate": { - "oneOf": [ - { - "$ref": "#/components/schemas/ModelCandidate" - }, - { - "$ref": "#/components/schemas/AgentCandidate" - } - ], - "title": "Eval Candidate", - "discriminator": { - "propertyName": "type", - "mapping": { - "agent": "#/components/schemas/AgentCandidate", - "model": "#/components/schemas/ModelCandidate" - } - } - }, - "scoring_params": { - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" - }, - { - "$ref": "#/components/schemas/RegexParserScoringFnParams" - }, - { - "$ref": "#/components/schemas/BasicScoringFnParams" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "basic": "#/components/schemas/BasicScoringFnParams", - "llm_as_judge": "#/components/schemas/LLMAsJudgeScoringFnParams", - "regex_parser": "#/components/schemas/RegexParserScoringFnParams" - } - } - }, - "type": "object", - "title": "Scoring Params", - "description": "Map between scoring function id and parameters for each scoring function you want to run" - }, - "num_examples": { - "title": "Num Examples", - "description": "Number of examples to evaluate (useful for testing), if not provided, all examples in the dataset will be evaluated", - "type": "integer" - } - }, - "type": "object", - "required": [ - "eval_candidate" - ], - "title": "BenchmarkConfig", - "description": "A benchmark configuration for evaluation." - }, - "BooleanType": { - "properties": { - "type": { - "type": "string", - "const": "boolean", - "title": "Type", - "default": "boolean" - } - }, - "type": "object", - "title": "BooleanType", - "description": "Parameter type for boolean values." - }, - "BuiltinTool": { - "type": "string", - "enum": [ - "brave_search", - "wolfram_alpha", - "photogen", - "code_interpreter" - ], - "title": "BuiltinTool" - }, - "ChatCompletionInputType": { - "properties": { - "type": { - "type": "string", - "const": "chat_completion_input", - "title": "Type", - "default": "chat_completion_input" - } - }, - "type": "object", - "title": "ChatCompletionInputType", - "description": "Parameter type for chat completion input." - }, - "Chunk-Input": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "chunk_id": { - "type": "string", - "title": "Chunk Id" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - }, - "embedding": { - "title": "Embedding", - "items": { - "type": "number" - }, - "type": "array" - }, - "chunk_metadata": { - "$ref": "#/components/schemas/ChunkMetadata" - } - }, - "type": "object", - "required": [ - "content", - "chunk_id" - ], - "title": "Chunk", - "description": "A chunk of content that can be inserted into a vector database." - }, - "Chunk-Output": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "chunk_id": { - "type": "string", - "title": "Chunk Id" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - }, - "embedding": { - "title": "Embedding", - "items": { - "type": "number" - }, - "type": "array" - }, - "chunk_metadata": { - "$ref": "#/components/schemas/ChunkMetadata" - } - }, - "type": "object", - "required": [ - "content", - "chunk_id" - ], - "title": "Chunk", - "description": "A chunk of content that can be inserted into a vector database." - }, - "ChunkMetadata": { - "properties": { - "chunk_id": { - "title": "Chunk Id", - "type": "string" - }, - "document_id": { - "title": "Document Id", - "type": "string" - }, - "source": { - "title": "Source", - "type": "string" - }, - "created_timestamp": { - "title": "Created Timestamp", - "type": "integer" - }, - "updated_timestamp": { - "title": "Updated Timestamp", - "type": "integer" - }, - "chunk_window": { - "title": "Chunk Window", - "type": "string" - }, - "chunk_tokenizer": { - "title": "Chunk Tokenizer", - "type": "string" - }, - "chunk_embedding_model": { - "title": "Chunk Embedding Model", - "type": "string" - }, - "chunk_embedding_dimension": { - "title": "Chunk Embedding Dimension", - "type": "integer" - }, - "content_token_count": { - "title": "Content Token Count", - "type": "integer" - }, - "metadata_token_count": { - "title": "Metadata Token Count", - "type": "integer" - } - }, - "type": "object", - "title": "ChunkMetadata", - "description": "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." - }, - "CompletionInputType": { - "properties": { - "type": { - "type": "string", - "const": "completion_input", - "title": "Type", - "default": "completion_input" - } - }, - "type": "object", - "title": "CompletionInputType", - "description": "Parameter type for completion input." - }, - "CompletionMessage-Input": { - "properties": { - "role": { - "type": "string", - "const": "assistant", - "title": "Role", - "default": "assistant" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "stop_reason": { - "$ref": "#/components/schemas/StopReason" - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/ToolCall" - }, - "type": "array" - } - }, - "type": "object", - "required": [ - "content", - "stop_reason" - ], - "title": "CompletionMessage", - "description": "A message containing the model's (assistant) response in a chat conversation." - }, - "CompletionMessage-Output": { - "properties": { - "role": { - "type": "string", - "const": "assistant", - "title": "Role", - "default": "assistant" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "stop_reason": { - "$ref": "#/components/schemas/StopReason" - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/ToolCall" - }, - "type": "array" - } - }, - "type": "object", - "required": [ - "content", - "stop_reason" - ], - "title": "CompletionMessage", - "description": "A message containing the model's (assistant) response in a chat conversation." - }, - "Conversation": { - "properties": { - "id": { - "type": "string", - "title": "Id", - "description": "The unique ID of the conversation." - }, - "object": { - "type": "string", - "const": "conversation", - "title": "Object", - "description": "The object type, which is always conversation.", - "default": "conversation" - }, - "created_at": { - "type": "integer", - "title": "Created At", - "description": "The time at which the conversation was created, measured in seconds since the Unix epoch." - }, - "metadata": { - "title": "Metadata", - "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.", - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "items": { - "title": "Items", - "description": "Initial items to include in the conversation context. You may add up to 20 items at a time.", - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - } - }, - "type": "object", - "required": [ - "id", - "created_at" - ], - "title": "Conversation", - "description": "OpenAI-compatible conversation object." - }, - "ConversationItemInclude": { - "type": "string", - "enum": [ - "web_search_call.action.sources", - "code_interpreter_call.outputs", - "computer_call_output.output.image_url", - "file_search_call.results", - "message.input_image.image_url", - "message.output_text.logprobs", - "reasoning.encrypted_content" - ], - "title": "ConversationItemInclude", - "description": "Specify additional output data to include in the model response." - }, - "ConversationItemList": { - "properties": { - "object": { - "type": "string", - "title": "Object", - "description": "Object type", - "default": "list" - }, - "data": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage-Output" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", - "function_call_output": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput", - "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", - "mcp_approval_response": "#/components/schemas/OpenAIResponseMCPApprovalResponse", - "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", - "message": "#/components/schemas/OpenAIResponseMessage-Output", - "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - } - } - }, - "type": "array", - "title": "Data", - "description": "List of conversation items" - }, - "first_id": { - "title": "First Id", - "description": "The ID of the first item in the list", - "type": "string" - }, - "last_id": { - "title": "Last Id", - "description": "The ID of the last item in the list", - "type": "string" - }, - "has_more": { - "type": "boolean", - "title": "Has More", - "description": "Whether there are more items available", - "default": false - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ConversationItemList", - "description": "List of conversation items with pagination." - }, - "DPOAlignmentConfig": { - "properties": { - "beta": { - "type": "number", - "title": "Beta" - }, - "loss_type": { - "$ref": "#/components/schemas/DPOLossType", - "default": "sigmoid" - } - }, - "type": "object", - "required": [ - "beta" - ], - "title": "DPOAlignmentConfig", - "description": "Configuration for Direct Preference Optimization (DPO) alignment." - }, - "DPOLossType": { - "type": "string", - "enum": [ - "sigmoid", - "hinge", - "ipo", - "kto_pair" - ], - "title": "DPOLossType" - }, - "DataConfig": { - "properties": { - "dataset_id": { - "type": "string", - "title": "Dataset Id" - }, - "batch_size": { - "type": "integer", - "title": "Batch Size" - }, - "shuffle": { - "type": "boolean", - "title": "Shuffle" - }, - "data_format": { - "$ref": "#/components/schemas/DatasetFormat" - }, - "validation_dataset_id": { - "title": "Validation Dataset Id", - "type": "string" - }, - "packed": { - "title": "Packed", - "default": false, - "type": "boolean" - }, - "train_on_input": { - "title": "Train On Input", - "default": false, - "type": "boolean" - } - }, - "type": "object", - "required": [ - "dataset_id", - "batch_size", - "shuffle", - "data_format" - ], - "title": "DataConfig", - "description": "Configuration for training data and data loading." - }, - "Dataset": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "dataset", - "title": "Type", - "default": "dataset" - }, - "purpose": { - "$ref": "#/components/schemas/DatasetPurpose" - }, - "source": { - "oneOf": [ - { - "$ref": "#/components/schemas/URIDataSource" - }, - { - "$ref": "#/components/schemas/RowsDataSource" - } - ], - "title": "Source", - "discriminator": { - "propertyName": "type", - "mapping": { - "rows": "#/components/schemas/RowsDataSource", - "uri": "#/components/schemas/URIDataSource" - } - } - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata", - "description": "Any additional metadata for this dataset" - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id", - "purpose", - "source" - ], - "title": "Dataset", - "description": "Dataset resource for storing and accessing training or evaluation data." - }, - "DatasetFormat": { - "type": "string", - "enum": [ - "instruct", - "dialog" - ], - "title": "DatasetFormat", - "description": "Format of the training dataset." - }, - "DatasetPurpose": { - "type": "string", - "enum": [ - "post-training/messages", - "eval/question-answer", - "eval/messages-answer" - ], - "title": "DatasetPurpose", - "description": "Purpose of the dataset. Each purpose has a required input data schema." - }, - "DefaultRAGQueryGeneratorConfig": { - "properties": { - "type": { - "type": "string", - "const": "default", - "title": "Type", - "default": "default" - }, - "separator": { - "type": "string", - "title": "Separator", - "default": " " - } - }, - "type": "object", - "title": "DefaultRAGQueryGeneratorConfig", - "description": "Configuration for the default RAG query generator." - }, - "Document": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - }, - { - "$ref": "#/components/schemas/URL" - } - ], - "title": "Content" - }, - "mime_type": { - "type": "string", - "title": "Mime Type" - } - }, - "type": "object", - "required": [ - "content", - "mime_type" - ], - "title": "Document", - "description": "A document to be used by an agent." - }, - "EfficiencyConfig": { - "properties": { - "enable_activation_checkpointing": { - "title": "Enable Activation Checkpointing", - "default": false, - "type": "boolean" - }, - "enable_activation_offloading": { - "title": "Enable Activation Offloading", - "default": false, - "type": "boolean" - }, - "memory_efficient_fsdp_wrap": { - "title": "Memory Efficient Fsdp Wrap", - "default": false, - "type": "boolean" - }, - "fsdp_cpu_offload": { - "title": "Fsdp Cpu Offload", - "default": false, - "type": "boolean" - } - }, - "type": "object", - "title": "EfficiencyConfig", - "description": "Configuration for memory and compute efficiency optimizations." - }, - "Errors": { - "properties": { - "data": { - "title": "Data", - "items": { - "$ref": "#/components/schemas/BatchError" - }, - "type": "array" - }, - "object": { - "title": "Object", - "type": "string" - } - }, - "additionalProperties": true, - "type": "object", - "title": "Errors" - }, - "EvaluateResponse": { - "properties": { - "generations": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Generations" - }, - "scores": { - "additionalProperties": { - "$ref": "#/components/schemas/ScoringResult" - }, - "type": "object", - "title": "Scores" - } - }, - "type": "object", - "required": [ - "generations", - "scores" - ], - "title": "EvaluateResponse", - "description": "The response from an evaluation." - }, - "GrammarResponseFormat": { - "properties": { - "type": { - "type": "string", - "const": "grammar", - "title": "Type", - "default": "grammar" - }, - "bnf": { - "additionalProperties": true, - "type": "object", - "title": "Bnf" - } - }, - "type": "object", - "required": [ - "bnf" - ], - "title": "GrammarResponseFormat", - "description": "Configuration for grammar-guided response generation." - }, - "GreedySamplingStrategy": { - "properties": { - "type": { - "type": "string", - "const": "greedy", - "title": "Type", - "default": "greedy" - } - }, - "type": "object", - "title": "GreedySamplingStrategy", - "description": "Greedy sampling strategy that selects the highest probability token at each step." - }, - "HealthInfo": { - "properties": { - "status": { - "$ref": "#/components/schemas/HealthStatus" - } - }, - "type": "object", - "required": [ - "status" - ], - "title": "HealthInfo", - "description": "Health status information for the service." - }, - "HealthStatus": { - "type": "string", - "enum": [ - "OK", - "Error", - "Not Implemented" - ], - "title": "HealthStatus" - }, - "ImageContentItem-Input": { - "properties": { - "type": { - "type": "string", - "const": "image", - "title": "Type", - "default": "image" - }, - "image": { - "$ref": "#/components/schemas/_URLOrData" - } - }, - "type": "object", - "required": [ - "image" - ], - "title": "ImageContentItem", - "description": "A image content item" - }, - "ImageContentItem-Output": { - "properties": { - "type": { - "type": "string", - "const": "image", - "title": "Type", - "default": "image" - }, - "image": { - "$ref": "#/components/schemas/_URLOrData" - } - }, - "type": "object", - "required": [ - "image" - ], - "title": "ImageContentItem", - "description": "A image content item" - }, - "InferenceStep-Input": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "step_id": { - "type": "string", - "title": "Step Id" - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - }, - "step_type": { - "type": "string", - "const": "inference", - "title": "Step Type", - "default": "inference" - }, - "model_response": { - "$ref": "#/components/schemas/CompletionMessage-Input" - } - }, - "type": "object", - "required": [ - "turn_id", - "step_id", - "model_response" - ], - "title": "InferenceStep", - "description": "An inference step in an agent turn." - }, - "InferenceStep-Output": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "step_id": { - "type": "string", - "title": "Step Id" - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - }, - "step_type": { - "type": "string", - "const": "inference", - "title": "Step Type", - "default": "inference" - }, - "model_response": { - "$ref": "#/components/schemas/CompletionMessage-Output" - } - }, - "type": "object", - "required": [ - "turn_id", - "step_id", - "model_response" - ], - "title": "InferenceStep", - "description": "An inference step in an agent turn." - }, - "InputTokensDetails": { - "properties": { - "cached_tokens": { - "type": "integer", - "title": "Cached Tokens" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "cached_tokens" - ], - "title": "InputTokensDetails" - }, - "Job": { - "properties": { - "job_id": { - "type": "string", - "title": "Job Id" - }, - "status": { - "$ref": "#/components/schemas/JobStatus" - } - }, - "type": "object", - "required": [ - "job_id", - "status" - ], - "title": "Job", - "description": "A job execution instance with status tracking." - }, - "JobStatus": { - "type": "string", - "enum": [ - "completed", - "in_progress", - "failed", - "scheduled", - "cancelled" - ], - "title": "JobStatus", - "description": "Status of a job execution." - }, - "JsonSchemaResponseFormat": { - "properties": { - "type": { - "type": "string", - "const": "json_schema", - "title": "Type", - "default": "json_schema" - }, - "json_schema": { - "additionalProperties": true, - "type": "object", - "title": "Json Schema" - } - }, - "type": "object", - "required": [ - "json_schema" - ], - "title": "JsonSchemaResponseFormat", - "description": "Configuration for JSON schema-guided response generation." - }, - "JsonType": { - "properties": { - "type": { - "type": "string", - "const": "json", - "title": "Type", - "default": "json" - } - }, - "type": "object", - "title": "JsonType", - "description": "Parameter type for JSON values." - }, - "LLMAsJudgeScoringFnParams": { - "properties": { - "type": { - "type": "string", - "const": "llm_as_judge", - "title": "Type", - "default": "llm_as_judge" - }, - "judge_model": { - "type": "string", - "title": "Judge Model" - }, - "prompt_template": { - "title": "Prompt Template", - "type": "string" - }, - "judge_score_regexes": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Judge Score Regexes", - "description": "Regexes to extract the answer from generated response" - }, - "aggregation_functions": { - "items": { - "$ref": "#/components/schemas/AggregationFunctionType" - }, - "type": "array", - "title": "Aggregation Functions", - "description": "Aggregation functions to apply to the scores of each row" - } - }, - "type": "object", - "required": [ - "judge_model" - ], - "title": "LLMAsJudgeScoringFnParams", - "description": "Parameters for LLM-as-judge scoring function configuration." - }, - "LLMRAGQueryGeneratorConfig": { - "properties": { - "type": { - "type": "string", - "const": "llm", - "title": "Type", - "default": "llm" - }, - "model": { - "type": "string", - "title": "Model" - }, - "template": { - "type": "string", - "title": "Template" - } - }, - "type": "object", - "required": [ - "model", - "template" - ], - "title": "LLMRAGQueryGeneratorConfig", - "description": "Configuration for the LLM-based RAG query generator." - }, - "ListBenchmarksResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Benchmark" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListBenchmarksResponse" - }, - "ListDatasetsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Dataset" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListDatasetsResponse", - "description": "Response from listing datasets." - }, - "ListModelsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Model" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListModelsResponse" - }, - "ListPostTrainingJobsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/PostTrainingJob" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListPostTrainingJobsResponse" - }, - "ListPromptsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Prompt" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListPromptsResponse", - "description": "Response model to list prompts." - }, - "ListProvidersResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ProviderInfo" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListProvidersResponse", - "description": "Response containing a list of all available providers." - }, - "ListRoutesResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/RouteInfo" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListRoutesResponse", - "description": "Response containing a list of all available API routes." - }, - "ListScoringFunctionsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ScoringFn-Output" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListScoringFunctionsResponse" - }, - "ListShieldsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Shield" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListShieldsResponse" - }, - "ListToolGroupsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ToolGroup" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListToolGroupsResponse", - "description": "Response containing a list of tool groups." - }, - "MCPListToolsTool": { - "properties": { - "input_schema": { - "additionalProperties": true, - "type": "object", - "title": "Input Schema" - }, - "name": { - "type": "string", - "title": "Name" - }, - "description": { - "title": "Description", - "type": "string" - } - }, - "type": "object", - "required": [ - "input_schema", - "name" - ], - "title": "MCPListToolsTool", - "description": "Tool definition returned by MCP list tools operation." - }, - "MemoryRetrievalStep-Input": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "step_id": { - "type": "string", - "title": "Step Id" - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - }, - "step_type": { - "type": "string", - "const": "memory_retrieval", - "title": "Step Type", - "default": "memory_retrieval" - }, - "vector_store_ids": { - "type": "string", - "title": "Vector Store Ids" - }, - "inserted_context": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Inserted Context" - } - }, - "type": "object", - "required": [ - "turn_id", - "step_id", - "vector_store_ids", - "inserted_context" - ], - "title": "MemoryRetrievalStep", - "description": "A memory retrieval step in an agent turn." - }, - "MemoryRetrievalStep-Output": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "step_id": { - "type": "string", - "title": "Step Id" - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - }, - "step_type": { - "type": "string", - "const": "memory_retrieval", - "title": "Step Type", - "default": "memory_retrieval" - }, - "vector_store_ids": { - "type": "string", - "title": "Vector Store Ids" - }, - "inserted_context": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Inserted Context" - } - }, - "type": "object", - "required": [ - "turn_id", - "step_id", - "vector_store_ids", - "inserted_context" - ], - "title": "MemoryRetrievalStep", - "description": "A memory retrieval step in an agent turn." - }, - "Model": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "model", - "title": "Type", - "default": "model" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata", - "description": "Any additional metadata for this model" - }, - "model_type": { - "$ref": "#/components/schemas/ModelType", - "default": "llm" - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id" - ], - "title": "Model", - "description": "A model resource representing an AI model registered in Llama Stack." - }, - "ModelCandidate": { - "properties": { - "type": { - "type": "string", - "const": "model", - "title": "Type", - "default": "model" - }, - "model": { - "type": "string", - "title": "Model" - }, - "sampling_params": { - "$ref": "#/components/schemas/SamplingParams" - }, - "system_message": { - "$ref": "#/components/schemas/SystemMessage" - } - }, - "type": "object", - "required": [ - "model", - "sampling_params" - ], - "title": "ModelCandidate", - "description": "A model candidate for evaluation." - }, - "ModelType": { - "type": "string", - "enum": [ - "llm", - "embedding", - "rerank" - ], - "title": "ModelType", - "description": "Enumeration of supported model types in Llama Stack." - }, - "ModerationObject": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "model": { - "type": "string", - "title": "Model" - }, - "results": { - "items": { - "$ref": "#/components/schemas/ModerationObjectResults" - }, - "type": "array", - "title": "Results" - } - }, - "type": "object", - "required": [ - "id", - "model", - "results" - ], - "title": "ModerationObject", - "description": "A moderation object." - }, - "ModerationObjectResults": { - "properties": { - "flagged": { - "type": "boolean", - "title": "Flagged" - }, - "categories": { - "title": "Categories", - "additionalProperties": { - "type": "boolean" - }, - "type": "object" - }, - "category_applied_input_types": { - "title": "Category Applied Input Types", - "additionalProperties": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": "object" - }, - "category_scores": { - "title": "Category Scores", - "additionalProperties": { - "type": "number" - }, - "type": "object" - }, - "user_message": { - "title": "User Message", - "type": "string" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "flagged" - ], - "title": "ModerationObjectResults", - "description": "A moderation object." - }, - "NumberType": { - "properties": { - "type": { - "type": "string", - "const": "number", - "title": "Type", - "default": "number" - } - }, - "type": "object", - "title": "NumberType", - "description": "Parameter type for numeric values." - }, - "ObjectType": { - "properties": { - "type": { - "type": "string", - "const": "object", - "title": "Type", - "default": "object" - } - }, - "type": "object", - "title": "ObjectType", - "description": "Parameter type for object values." - }, - "OpenAIAssistantMessageParam-Input": { - "properties": { - "role": { - "type": "string", - "const": "assistant", - "title": "Role", - "default": "assistant" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" - }, - "type": "array" - } - }, - "type": "object", - "title": "OpenAIAssistantMessageParam", - "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request." - }, - "OpenAIAssistantMessageParam-Output": { - "properties": { - "role": { - "type": "string", - "const": "assistant", - "title": "Role", - "default": "assistant" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" - }, - "type": "array" - } - }, - "type": "object", - "title": "OpenAIAssistantMessageParam", - "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request." - }, - "OpenAIChatCompletion": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "choices": { - "items": { - "$ref": "#/components/schemas/OpenAIChoice-Output" - }, - "type": "array", - "title": "Choices" - }, - "object": { - "type": "string", - "const": "chat.completion", - "title": "Object", - "default": "chat.completion" - }, - "created": { - "type": "integer", - "title": "Created" - }, - "model": { - "type": "string", - "title": "Model" - }, - "usage": { - "$ref": "#/components/schemas/OpenAIChatCompletionUsage" - } - }, - "type": "object", - "required": [ - "id", - "choices", - "created", - "model" - ], - "title": "OpenAIChatCompletion", - "description": "Response from an OpenAI-compatible chat completion request." - }, - "OpenAIChatCompletionContentPartImageParam": { - "properties": { - "type": { - "type": "string", - "const": "image_url", - "title": "Type", - "default": "image_url" - }, - "image_url": { - "$ref": "#/components/schemas/OpenAIImageURL" - } - }, - "type": "object", - "required": [ - "image_url" - ], - "title": "OpenAIChatCompletionContentPartImageParam", - "description": "Image content part for OpenAI-compatible chat completion messages." - }, - "OpenAIChatCompletionContentPartTextParam": { - "properties": { - "type": { - "type": "string", - "const": "text", - "title": "Type", - "default": "text" - }, - "text": { - "type": "string", - "title": "Text" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "OpenAIChatCompletionContentPartTextParam", - "description": "Text content part for OpenAI-compatible chat completion messages." - }, - "OpenAIChatCompletionRequestWithExtraBody": { - "properties": { - "model": { - "type": "string", - "title": "Model" - }, - "messages": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIUserMessageParam-Input" - }, - { - "$ref": "#/components/schemas/OpenAISystemMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIAssistantMessageParam-Input" - }, - { - "$ref": "#/components/schemas/OpenAIToolMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" - } - ], - "discriminator": { - "propertyName": "role", - "mapping": { - "assistant": "#/components/schemas/OpenAIAssistantMessageParam-Input", - "developer": "#/components/schemas/OpenAIDeveloperMessageParam", - "system": "#/components/schemas/OpenAISystemMessageParam", - "tool": "#/components/schemas/OpenAIToolMessageParam", - "user": "#/components/schemas/OpenAIUserMessageParam-Input" - } - } - }, - "type": "array", - "minItems": 1, - "title": "Messages" - }, - "frequency_penalty": { - "title": "Frequency Penalty", - "type": "number" - }, - "function_call": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": true, - "type": "object" - } - ], - "title": "Function Call" - }, - "functions": { - "title": "Functions", - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - "logit_bias": { - "title": "Logit Bias", - "additionalProperties": { - "type": "number" - }, - "type": "object" - }, - "logprobs": { - "title": "Logprobs", - "type": "boolean" - }, - "max_completion_tokens": { - "title": "Max Completion Tokens", - "type": "integer" - }, - "max_tokens": { - "title": "Max Tokens", - "type": "integer" - }, - "n": { - "title": "N", - "type": "integer" - }, - "parallel_tool_calls": { - "title": "Parallel Tool Calls", - "type": "boolean" - }, - "presence_penalty": { - "title": "Presence Penalty", - "type": "number" - }, - "response_format": { - "title": "Response Format", - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseFormatText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseFormatJSONSchema" - }, - { - "$ref": "#/components/schemas/OpenAIResponseFormatJSONObject" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "json_object": "#/components/schemas/OpenAIResponseFormatJSONObject", - "json_schema": "#/components/schemas/OpenAIResponseFormatJSONSchema", - "text": "#/components/schemas/OpenAIResponseFormatText" - } - } - }, - "seed": { - "title": "Seed", - "type": "integer" - }, - "stop": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ], - "title": "Stop" - }, - "stream": { - "title": "Stream", - "type": "boolean" - }, - "stream_options": { - "title": "Stream Options", - "additionalProperties": true, - "type": "object" - }, - "temperature": { - "title": "Temperature", - "type": "number" - }, - "tool_choice": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": true, - "type": "object" - } - ], - "title": "Tool Choice" - }, - "tools": { - "title": "Tools", - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - "top_logprobs": { - "title": "Top Logprobs", - "type": "integer" - }, - "top_p": { - "title": "Top P", - "type": "number" - }, - "user": { - "title": "User", - "type": "string" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "model", - "messages" - ], - "title": "OpenAIChatCompletionRequestWithExtraBody", - "description": "Request parameters for OpenAI-compatible chat completion endpoint." - }, - "OpenAIChatCompletionToolCall": { - "properties": { - "index": { - "title": "Index", - "type": "integer" - }, - "id": { - "title": "Id", - "type": "string" - }, - "type": { - "type": "string", - "const": "function", - "title": "Type", - "default": "function" - }, - "function": { - "$ref": "#/components/schemas/OpenAIChatCompletionToolCallFunction" - } - }, - "type": "object", - "title": "OpenAIChatCompletionToolCall", - "description": "Tool call specification for OpenAI-compatible chat completion responses." - }, - "OpenAIChatCompletionToolCallFunction": { - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "arguments": { - "title": "Arguments", - "type": "string" - } - }, - "type": "object", - "title": "OpenAIChatCompletionToolCallFunction", - "description": "Function call details for OpenAI-compatible tool calls." - }, - "OpenAIChatCompletionUsage": { - "properties": { - "prompt_tokens": { - "type": "integer", - "title": "Prompt Tokens" - }, - "completion_tokens": { - "type": "integer", - "title": "Completion Tokens" - }, - "total_tokens": { - "type": "integer", - "title": "Total Tokens" - }, - "prompt_tokens_details": { - "$ref": "#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails" - }, - "completion_tokens_details": { - "$ref": "#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails" - } - }, - "type": "object", - "required": [ - "prompt_tokens", - "completion_tokens", - "total_tokens" - ], - "title": "OpenAIChatCompletionUsage", - "description": "Usage information for OpenAI chat completion." - }, - "OpenAIChatCompletionUsageCompletionTokensDetails": { - "properties": { - "reasoning_tokens": { - "title": "Reasoning Tokens", - "type": "integer" - } - }, - "type": "object", - "title": "OpenAIChatCompletionUsageCompletionTokensDetails", - "description": "Token details for output tokens in OpenAI chat completion usage." - }, - "OpenAIChatCompletionUsagePromptTokensDetails": { - "properties": { - "cached_tokens": { - "title": "Cached Tokens", - "type": "integer" - } - }, - "type": "object", - "title": "OpenAIChatCompletionUsagePromptTokensDetails", - "description": "Token details for prompt tokens in OpenAI chat completion usage." - }, - "OpenAIChoice-Input": { - "properties": { - "message": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIUserMessageParam-Input" - }, - { - "$ref": "#/components/schemas/OpenAISystemMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIAssistantMessageParam-Input" - }, - { - "$ref": "#/components/schemas/OpenAIToolMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" - } - ], - "title": "Message", - "discriminator": { - "propertyName": "role", - "mapping": { - "assistant": "#/components/schemas/OpenAIAssistantMessageParam-Input", - "developer": "#/components/schemas/OpenAIDeveloperMessageParam", - "system": "#/components/schemas/OpenAISystemMessageParam", - "tool": "#/components/schemas/OpenAIToolMessageParam", - "user": "#/components/schemas/OpenAIUserMessageParam-Input" - } - } - }, - "finish_reason": { - "type": "string", - "title": "Finish Reason" - }, - "index": { - "type": "integer", - "title": "Index" - }, - "logprobs": { - "$ref": "#/components/schemas/OpenAIChoiceLogprobs-Input" - } - }, - "type": "object", - "required": [ - "message", - "finish_reason", - "index" - ], - "title": "OpenAIChoice", - "description": "A choice from an OpenAI-compatible chat completion response." - }, - "OpenAIChoice-Output": { - "properties": { - "message": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIUserMessageParam-Output" - }, - { - "$ref": "#/components/schemas/OpenAISystemMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIAssistantMessageParam-Output" - }, - { - "$ref": "#/components/schemas/OpenAIToolMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" - } - ], - "title": "Message", - "discriminator": { - "propertyName": "role", - "mapping": { - "assistant": "#/components/schemas/OpenAIAssistantMessageParam-Output", - "developer": "#/components/schemas/OpenAIDeveloperMessageParam", - "system": "#/components/schemas/OpenAISystemMessageParam", - "tool": "#/components/schemas/OpenAIToolMessageParam", - "user": "#/components/schemas/OpenAIUserMessageParam-Output" - } - } - }, - "finish_reason": { - "type": "string", - "title": "Finish Reason" - }, - "index": { - "type": "integer", - "title": "Index" - }, - "logprobs": { - "$ref": "#/components/schemas/OpenAIChoiceLogprobs-Output" - } - }, - "type": "object", - "required": [ - "message", - "finish_reason", - "index" - ], - "title": "OpenAIChoice", - "description": "A choice from an OpenAI-compatible chat completion response." - }, - "OpenAIChoiceLogprobs-Input": { - "properties": { - "content": { - "title": "Content", - "items": { - "$ref": "#/components/schemas/OpenAITokenLogProb" - }, - "type": "array" - }, - "refusal": { - "title": "Refusal", - "items": { - "$ref": "#/components/schemas/OpenAITokenLogProb" - }, - "type": "array" - } - }, - "type": "object", - "title": "OpenAIChoiceLogprobs", - "description": "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response." - }, - "OpenAIChoiceLogprobs-Output": { - "properties": { - "content": { - "title": "Content", - "items": { - "$ref": "#/components/schemas/OpenAITokenLogProb" - }, - "type": "array" - }, - "refusal": { - "title": "Refusal", - "items": { - "$ref": "#/components/schemas/OpenAITokenLogProb" - }, - "type": "array" - } - }, - "type": "object", - "title": "OpenAIChoiceLogprobs", - "description": "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response." - }, - "OpenAICompletion": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "choices": { - "items": { - "$ref": "#/components/schemas/OpenAICompletionChoice-Output" - }, - "type": "array", - "title": "Choices" - }, - "created": { - "type": "integer", - "title": "Created" - }, - "model": { - "type": "string", - "title": "Model" - }, - "object": { - "type": "string", - "const": "text_completion", - "title": "Object", - "default": "text_completion" - } - }, - "type": "object", - "required": [ - "id", - "choices", - "created", - "model" - ], - "title": "OpenAICompletion", - "description": "Response from an OpenAI-compatible completion request." - }, - "OpenAICompletionChoice-Input": { - "properties": { - "finish_reason": { - "type": "string", - "title": "Finish Reason" - }, - "text": { - "type": "string", - "title": "Text" - }, - "index": { - "type": "integer", - "title": "Index" - }, - "logprobs": { - "$ref": "#/components/schemas/OpenAIChoiceLogprobs-Input" - } - }, - "type": "object", - "required": [ - "finish_reason", - "text", - "index" - ], - "title": "OpenAICompletionChoice", - "description": "A choice from an OpenAI-compatible completion response." - }, - "OpenAICompletionChoice-Output": { - "properties": { - "finish_reason": { - "type": "string", - "title": "Finish Reason" - }, - "text": { - "type": "string", - "title": "Text" - }, - "index": { - "type": "integer", - "title": "Index" - }, - "logprobs": { - "$ref": "#/components/schemas/OpenAIChoiceLogprobs-Output" - } - }, - "type": "object", - "required": [ - "finish_reason", - "text", - "index" - ], - "title": "OpenAICompletionChoice", - "description": "A choice from an OpenAI-compatible completion response." - }, - "OpenAICompletionRequestWithExtraBody": { - "properties": { - "model": { - "type": "string", - "title": "Model" - }, - "prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "items": { - "type": "integer" - }, - "type": "array" - }, - { - "items": { - "items": { - "type": "integer" - }, - "type": "array" - }, - "type": "array" - } - ], - "title": "Prompt" - }, - "best_of": { - "title": "Best Of", - "type": "integer" - }, - "echo": { - "title": "Echo", - "type": "boolean" - }, - "frequency_penalty": { - "title": "Frequency Penalty", - "type": "number" - }, - "logit_bias": { - "title": "Logit Bias", - "additionalProperties": { - "type": "number" - }, - "type": "object" - }, - "logprobs": { - "title": "Logprobs", - "type": "boolean" - }, - "max_tokens": { - "title": "Max Tokens", - "type": "integer" - }, - "n": { - "title": "N", - "type": "integer" - }, - "presence_penalty": { - "title": "Presence Penalty", - "type": "number" - }, - "seed": { - "title": "Seed", - "type": "integer" - }, - "stop": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ], - "title": "Stop" - }, - "stream": { - "title": "Stream", - "type": "boolean" - }, - "stream_options": { - "title": "Stream Options", - "additionalProperties": true, - "type": "object" - }, - "temperature": { - "title": "Temperature", - "type": "number" - }, - "top_p": { - "title": "Top P", - "type": "number" - }, - "user": { - "title": "User", - "type": "string" - }, - "suffix": { - "title": "Suffix", - "type": "string" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "model", - "prompt" - ], - "title": "OpenAICompletionRequestWithExtraBody", - "description": "Request parameters for OpenAI-compatible completion endpoint." - }, - "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": { - "properties": { - "file_ids": { - "items": { - "type": "string" - }, - "type": "array", - "title": "File Ids" - }, - "attributes": { - "title": "Attributes", - "additionalProperties": true, - "type": "object" - }, - "chunking_strategy": { - "title": "Chunking Strategy", - "oneOf": [ - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" - }, - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "auto": "#/components/schemas/VectorStoreChunkingStrategyAuto", - "static": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - } - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "file_ids" - ], - "title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody", - "description": "Request to create a vector store file batch with extra_body support." - }, - "OpenAICreateVectorStoreRequestWithExtraBody": { - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "file_ids": { - "title": "File Ids", - "items": { - "type": "string" - }, - "type": "array" - }, - "expires_after": { - "title": "Expires After", - "additionalProperties": true, - "type": "object" - }, - "chunking_strategy": { - "title": "Chunking Strategy", - "additionalProperties": true, - "type": "object" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "additionalProperties": true, - "type": "object", - "title": "OpenAICreateVectorStoreRequestWithExtraBody", - "description": "Request to create a vector store with extra_body support." - }, - "OpenAIDeveloperMessageParam": { - "properties": { - "role": { - "type": "string", - "const": "developer", - "title": "Role", - "default": "developer" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "OpenAIDeveloperMessageParam", - "description": "A message from the developer in an OpenAI-compatible chat completion request." - }, - "OpenAIEmbeddingData": { - "properties": { - "object": { - "type": "string", - "const": "embedding", - "title": "Object", - "default": "embedding" - }, - "embedding": { - "anyOf": [ - { - "items": { - "type": "number" - }, - "type": "array" - }, - { - "type": "string" - } - ], - "title": "Embedding" - }, - "index": { - "type": "integer", - "title": "Index" - } - }, - "type": "object", - "required": [ - "embedding", - "index" - ], - "title": "OpenAIEmbeddingData", - "description": "A single embedding data object from an OpenAI-compatible embeddings response." - }, - "OpenAIEmbeddingUsage": { - "properties": { - "prompt_tokens": { - "type": "integer", - "title": "Prompt Tokens" - }, - "total_tokens": { - "type": "integer", - "title": "Total Tokens" - } - }, - "type": "object", - "required": [ - "prompt_tokens", - "total_tokens" - ], - "title": "OpenAIEmbeddingUsage", - "description": "Usage information for an OpenAI-compatible embeddings response." - }, - "OpenAIEmbeddingsRequestWithExtraBody": { - "properties": { - "model": { - "type": "string", - "title": "Model" - }, - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ], - "title": "Input" - }, - "encoding_format": { - "title": "Encoding Format", - "default": "float", - "type": "string" - }, - "dimensions": { - "title": "Dimensions", - "type": "integer" - }, - "user": { - "title": "User", - "type": "string" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "model", - "input" - ], - "title": "OpenAIEmbeddingsRequestWithExtraBody", - "description": "Request parameters for OpenAI-compatible embeddings endpoint." - }, - "OpenAIEmbeddingsResponse": { - "properties": { - "object": { - "type": "string", - "const": "list", - "title": "Object", - "default": "list" - }, - "data": { - "items": { - "$ref": "#/components/schemas/OpenAIEmbeddingData" - }, - "type": "array", - "title": "Data" - }, - "model": { - "type": "string", - "title": "Model" - }, - "usage": { - "$ref": "#/components/schemas/OpenAIEmbeddingUsage" - } - }, - "type": "object", - "required": [ - "data", - "model", - "usage" - ], - "title": "OpenAIEmbeddingsResponse", - "description": "Response from an OpenAI-compatible embeddings request." - }, - "OpenAIFile": { - "properties": { - "type": { - "type": "string", - "const": "file", - "title": "Type", - "default": "file" - }, - "file": { - "$ref": "#/components/schemas/OpenAIFileFile" - } - }, - "type": "object", - "required": [ - "file" - ], - "title": "OpenAIFile" - }, - "OpenAIFileFile": { - "properties": { - "file_data": { - "title": "File Data", - "type": "string" - }, - "file_id": { - "title": "File Id", - "type": "string" - }, - "filename": { - "title": "Filename", - "type": "string" - } - }, - "type": "object", - "title": "OpenAIFileFile" - }, - "OpenAIFileObject": { - "properties": { - "object": { - "type": "string", - "const": "file", - "title": "Object", - "default": "file" - }, - "id": { - "type": "string", - "title": "Id" - }, - "bytes": { - "type": "integer", - "title": "Bytes" - }, - "created_at": { - "type": "integer", - "title": "Created At" - }, - "expires_at": { - "type": "integer", - "title": "Expires At" - }, - "filename": { - "type": "string", - "title": "Filename" - }, - "purpose": { - "$ref": "#/components/schemas/OpenAIFilePurpose" - } - }, - "type": "object", - "required": [ - "id", - "bytes", - "created_at", - "expires_at", - "filename", - "purpose" - ], - "title": "OpenAIFileObject", - "description": "OpenAI File object as defined in the OpenAI Files API." - }, - "OpenAIFilePurpose": { - "type": "string", - "enum": [ - "assistants", - "batch" - ], - "title": "OpenAIFilePurpose", - "description": "Valid purpose values for OpenAI Files API." - }, - "OpenAIImageURL": { - "properties": { - "url": { - "type": "string", - "title": "Url" - }, - "detail": { - "title": "Detail", - "type": "string" - } - }, - "type": "object", - "required": [ - "url" - ], - "title": "OpenAIImageURL", - "description": "Image URL specification for OpenAI-compatible chat completion messages." - }, - "OpenAIJSONSchema": { - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "description": { - "title": "Description", - "type": "string" - }, - "strict": { - "title": "Strict", - "type": "boolean" - }, - "schema": { - "title": "Schema", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "title": "OpenAIJSONSchema", - "description": "JSON schema specification for OpenAI-compatible structured response format." - }, - "OpenAIListModelsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/OpenAIModel" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "OpenAIListModelsResponse" - }, - "OpenAIModel": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "object": { - "type": "string", - "const": "model", - "title": "Object", - "default": "model" - }, - "created": { - "type": "integer", - "title": "Created" - }, - "owned_by": { - "type": "string", - "title": "Owned By" - } - }, - "type": "object", - "required": [ - "id", - "created", - "owned_by" - ], - "title": "OpenAIModel", - "description": "A model from OpenAI." - }, - "OpenAIResponseAnnotationCitation": { - "properties": { - "type": { - "type": "string", - "const": "url_citation", - "title": "Type", - "default": "url_citation" - }, - "end_index": { - "type": "integer", - "title": "End Index" - }, - "start_index": { - "type": "integer", - "title": "Start Index" - }, - "title": { - "type": "string", - "title": "Title" - }, - "url": { - "type": "string", - "title": "Url" - } - }, - "type": "object", - "required": [ - "end_index", - "start_index", - "title", - "url" - ], - "title": "OpenAIResponseAnnotationCitation", - "description": "URL citation annotation for referencing external web resources." - }, - "OpenAIResponseAnnotationContainerFileCitation": { - "properties": { - "type": { - "type": "string", - "const": "container_file_citation", - "title": "Type", - "default": "container_file_citation" - }, - "container_id": { - "type": "string", - "title": "Container Id" - }, - "end_index": { - "type": "integer", - "title": "End Index" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "filename": { - "type": "string", - "title": "Filename" - }, - "start_index": { - "type": "integer", - "title": "Start Index" - } - }, - "type": "object", - "required": [ - "container_id", - "end_index", - "file_id", - "filename", - "start_index" - ], - "title": "OpenAIResponseAnnotationContainerFileCitation" - }, - "OpenAIResponseAnnotationFileCitation": { - "properties": { - "type": { - "type": "string", - "const": "file_citation", - "title": "Type", - "default": "file_citation" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "filename": { - "type": "string", - "title": "Filename" - }, - "index": { - "type": "integer", - "title": "Index" - } - }, - "type": "object", - "required": [ - "file_id", - "filename", - "index" - ], - "title": "OpenAIResponseAnnotationFileCitation", - "description": "File citation annotation for referencing specific files in response content." - }, - "OpenAIResponseAnnotationFilePath": { - "properties": { - "type": { - "type": "string", - "const": "file_path", - "title": "Type", - "default": "file_path" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "index": { - "type": "integer", - "title": "Index" - } - }, - "type": "object", - "required": [ - "file_id", - "index" - ], - "title": "OpenAIResponseAnnotationFilePath" - }, - "OpenAIResponseContentPartRefusal": { - "properties": { - "type": { - "type": "string", - "const": "refusal", - "title": "Type", - "default": "refusal" - }, - "refusal": { - "type": "string", - "title": "Refusal" - } - }, - "type": "object", - "required": [ - "refusal" - ], - "title": "OpenAIResponseContentPartRefusal", - "description": "Refusal content within a streamed response part." - }, - "OpenAIResponseError": { - "properties": { - "code": { - "type": "string", - "title": "Code" - }, - "message": { - "type": "string", - "title": "Message" - } - }, - "type": "object", - "required": [ - "code", - "message" - ], - "title": "OpenAIResponseError", - "description": "Error details for failed OpenAI response requests." - }, - "OpenAIResponseFormatJSONObject": { - "properties": { - "type": { - "type": "string", - "const": "json_object", - "title": "Type", - "default": "json_object" - } - }, - "type": "object", - "title": "OpenAIResponseFormatJSONObject", - "description": "JSON object response format for OpenAI-compatible chat completion requests." - }, - "OpenAIResponseFormatJSONSchema": { - "properties": { - "type": { - "type": "string", - "const": "json_schema", - "title": "Type", - "default": "json_schema" - }, - "json_schema": { - "$ref": "#/components/schemas/OpenAIJSONSchema" - } - }, - "type": "object", - "required": [ - "json_schema" - ], - "title": "OpenAIResponseFormatJSONSchema", - "description": "JSON schema response format for OpenAI-compatible chat completion requests." - }, - "OpenAIResponseFormatText": { - "properties": { - "type": { - "type": "string", - "const": "text", - "title": "Type", - "default": "text" - } - }, - "type": "object", - "title": "OpenAIResponseFormatText", - "description": "Text response format for OpenAI-compatible chat completion requests." - }, - "OpenAIResponseInputFunctionToolCallOutput": { - "properties": { - "call_id": { - "type": "string", - "title": "Call Id" - }, - "output": { - "type": "string", - "title": "Output" - }, - "type": { - "type": "string", - "const": "function_call_output", - "title": "Type", - "default": "function_call_output" - }, - "id": { - "title": "Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "type": "object", - "required": [ - "call_id", - "output" - ], - "title": "OpenAIResponseInputFunctionToolCallOutput", - "description": "This represents the output of a function call that gets passed back to the model." - }, - "OpenAIResponseInputMessageContentFile": { - "properties": { - "type": { - "type": "string", - "const": "input_file", - "title": "Type", - "default": "input_file" - }, - "file_data": { - "title": "File Data", - "type": "string" - }, - "file_id": { - "title": "File Id", - "type": "string" - }, - "file_url": { - "title": "File Url", - "type": "string" - }, - "filename": { - "title": "Filename", - "type": "string" - } - }, - "type": "object", - "title": "OpenAIResponseInputMessageContentFile", - "description": "File content for input messages in OpenAI response format." - }, - "OpenAIResponseInputMessageContentImage": { - "properties": { - "detail": { - "anyOf": [ - { - "type": "string", - "const": "low" - }, - { - "type": "string", - "const": "high" - }, - { - "type": "string", - "const": "auto" - } - ], - "title": "Detail", - "default": "auto" - }, - "type": { - "type": "string", - "const": "input_image", - "title": "Type", - "default": "input_image" - }, - "file_id": { - "title": "File Id", - "type": "string" - }, - "image_url": { - "title": "Image Url", - "type": "string" - } - }, - "type": "object", - "title": "OpenAIResponseInputMessageContentImage", - "description": "Image content for input messages in OpenAI response format." - }, - "OpenAIResponseInputMessageContentText": { - "properties": { - "text": { - "type": "string", - "title": "Text" - }, - "type": { - "type": "string", - "const": "input_text", - "title": "Type", - "default": "input_text" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "OpenAIResponseInputMessageContentText", - "description": "Text content for input messages in OpenAI response format." - }, - "OpenAIResponseInputToolFileSearch": { - "properties": { - "type": { - "type": "string", - "const": "file_search", - "title": "Type", - "default": "file_search" - }, - "vector_store_ids": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Vector Store Ids" - }, - "filters": { - "title": "Filters", - "additionalProperties": true, - "type": "object" - }, - "max_num_results": { - "title": "Max Num Results", - "default": 10, - "type": "integer", - "maximum": 50.0, - "minimum": 1.0 - }, - "ranking_options": { - "$ref": "#/components/schemas/SearchRankingOptions" - } - }, - "type": "object", - "required": [ - "vector_store_ids" - ], - "title": "OpenAIResponseInputToolFileSearch", - "description": "File search tool configuration for OpenAI response inputs." - }, - "OpenAIResponseInputToolFunction": { - "properties": { - "type": { - "type": "string", - "const": "function", - "title": "Type", - "default": "function" - }, - "name": { - "type": "string", - "title": "Name" - }, - "description": { - "title": "Description", - "type": "string" - }, - "parameters": { - "title": "Parameters", - "additionalProperties": true, - "type": "object" - }, - "strict": { - "title": "Strict", - "type": "boolean" - } - }, - "type": "object", - "required": [ - "name", - "parameters" - ], - "title": "OpenAIResponseInputToolFunction", - "description": "Function tool configuration for OpenAI response inputs." - }, - "OpenAIResponseInputToolMCP": { - "properties": { - "type": { - "type": "string", - "const": "mcp", - "title": "Type", - "default": "mcp" - }, - "server_label": { - "type": "string", - "title": "Server Label" - }, - "server_url": { - "type": "string", - "title": "Server Url" - }, - "headers": { - "title": "Headers", - "additionalProperties": true, - "type": "object" - }, - "require_approval": { - "anyOf": [ - { - "type": "string", - "const": "always" - }, - { - "type": "string", - "const": "never" - }, - { - "$ref": "#/components/schemas/ApprovalFilter" - } - ], - "title": "Require Approval", - "default": "never" - }, - "allowed_tools": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "$ref": "#/components/schemas/AllowedToolsFilter" - } - ], - "title": "Allowed Tools" - } - }, - "type": "object", - "required": [ - "server_label", - "server_url" - ], - "title": "OpenAIResponseInputToolMCP", - "description": "Model Context Protocol (MCP) tool configuration for OpenAI response inputs." - }, - "OpenAIResponseInputToolWebSearch": { - "properties": { - "type": { - "anyOf": [ - { - "type": "string", - "const": "web_search" - }, - { - "type": "string", - "const": "web_search_preview" - }, - { - "type": "string", - "const": "web_search_preview_2025_03_11" - } - ], - "title": "Type", - "default": "web_search" - }, - "search_context_size": { - "title": "Search Context Size", - "default": "medium", - "type": "string", - "pattern": "^low|medium|high$" - } - }, - "type": "object", - "title": "OpenAIResponseInputToolWebSearch", - "description": "Web search tool configuration for OpenAI response inputs." - }, - "OpenAIResponseMCPApprovalRequest": { - "properties": { - "arguments": { - "type": "string", - "title": "Arguments" - }, - "id": { - "type": "string", - "title": "Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "server_label": { - "type": "string", - "title": "Server Label" - }, - "type": { - "type": "string", - "const": "mcp_approval_request", - "title": "Type", - "default": "mcp_approval_request" - } - }, - "type": "object", - "required": [ - "arguments", - "id", - "name", - "server_label" - ], - "title": "OpenAIResponseMCPApprovalRequest", - "description": "A request for human approval of a tool invocation." - }, - "OpenAIResponseMCPApprovalResponse": { - "properties": { - "approval_request_id": { - "type": "string", - "title": "Approval Request Id" - }, - "approve": { - "type": "boolean", - "title": "Approve" - }, - "type": { - "type": "string", - "const": "mcp_approval_response", - "title": "Type", - "default": "mcp_approval_response" - }, - "id": { - "title": "Id", - "type": "string" - }, - "reason": { - "title": "Reason", - "type": "string" - } - }, - "type": "object", - "required": [ - "approval_request_id", - "approve" - ], - "title": "OpenAIResponseMCPApprovalResponse", - "description": "A response to an MCP approval request." - }, - "OpenAIResponseMessage-Input": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", - "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", - "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" - } - } - }, - "type": "array" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "output_text": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText", - "refusal": "#/components/schemas/OpenAIResponseContentPartRefusal" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "role": { - "anyOf": [ - { - "type": "string", - "const": "system" - }, - { - "type": "string", - "const": "developer" - }, - { - "type": "string", - "const": "user" - }, - { - "type": "string", - "const": "assistant" - } - ], - "title": "Role" - }, - "type": { - "type": "string", - "const": "message", - "title": "Type", - "default": "message" - }, - "id": { - "title": "Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "type": "object", - "required": [ - "content", - "role" - ], - "title": "OpenAIResponseMessage", - "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." - }, - "OpenAIResponseMessage-Output": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", - "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", - "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" - } - } - }, - "type": "array" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "output_text": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText", - "refusal": "#/components/schemas/OpenAIResponseContentPartRefusal" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "role": { - "anyOf": [ - { - "type": "string", - "const": "system" - }, - { - "type": "string", - "const": "developer" - }, - { - "type": "string", - "const": "user" - }, - { - "type": "string", - "const": "assistant" - } - ], - "title": "Role" - }, - "type": { - "type": "string", - "const": "message", - "title": "Type", - "default": "message" - }, - "id": { - "title": "Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "type": "object", - "required": [ - "content", - "role" - ], - "title": "OpenAIResponseMessage", - "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." - }, - "OpenAIResponseObject": { - "properties": { - "created_at": { - "type": "integer", - "title": "Created At" - }, - "error": { - "$ref": "#/components/schemas/OpenAIResponseError" - }, - "id": { - "type": "string", - "title": "Id" - }, - "model": { - "type": "string", - "title": "Model" - }, - "object": { - "type": "string", - "const": "response", - "title": "Object", - "default": "response" - }, - "output": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage-Output" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", - "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", - "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", - "message": "#/components/schemas/OpenAIResponseMessage-Output", - "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - } - } - }, - "type": "array", - "title": "Output" - }, - "parallel_tool_calls": { - "type": "boolean", - "title": "Parallel Tool Calls", - "default": false - }, - "previous_response_id": { - "title": "Previous Response Id", - "type": "string" - }, - "prompt": { - "$ref": "#/components/schemas/OpenAIResponsePrompt" - }, - "status": { - "type": "string", - "title": "Status" - }, - "temperature": { - "title": "Temperature", - "type": "number" - }, - "text": { - "$ref": "#/components/schemas/OpenAIResponseText", - "default": { - "format": { - "type": "text" - } - } - }, - "top_p": { - "title": "Top P", - "type": "number" - }, - "tools": { - "title": "Tools", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" - }, - { - "$ref": "#/components/schemas/OpenAIResponseToolMCP" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "file_search": "#/components/schemas/OpenAIResponseInputToolFileSearch", - "function": "#/components/schemas/OpenAIResponseInputToolFunction", - "mcp": "#/components/schemas/OpenAIResponseToolMCP", - "web_search": "#/components/schemas/OpenAIResponseInputToolWebSearch", - "web_search_preview": "#/components/schemas/OpenAIResponseInputToolWebSearch", - "web_search_preview_2025_03_11": "#/components/schemas/OpenAIResponseInputToolWebSearch" - } - } - }, - "type": "array" - }, - "truncation": { - "title": "Truncation", - "type": "string" - }, - "usage": { - "$ref": "#/components/schemas/OpenAIResponseUsage" - }, - "instructions": { - "title": "Instructions", - "type": "string" - } - }, - "type": "object", - "required": [ - "created_at", - "id", - "model", - "output", - "status" - ], - "title": "OpenAIResponseObject", - "description": "Complete OpenAI response object containing generation results and metadata." - }, - "OpenAIResponseOutputMessageContentOutputText": { - "properties": { - "text": { - "type": "string", - "title": "Text" - }, - "type": { - "type": "string", - "const": "output_text", - "title": "Type", - "default": "output_text" - }, - "annotations": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationFileCitation" - }, - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationCitation" - }, - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation" - }, - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationFilePath" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "container_file_citation": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation", - "file_citation": "#/components/schemas/OpenAIResponseAnnotationFileCitation", - "file_path": "#/components/schemas/OpenAIResponseAnnotationFilePath", - "url_citation": "#/components/schemas/OpenAIResponseAnnotationCitation" - } - } - }, - "type": "array", - "title": "Annotations" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "OpenAIResponseOutputMessageContentOutputText" - }, - "OpenAIResponseOutputMessageFileSearchToolCall": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "queries": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Queries" - }, - "status": { - "type": "string", - "title": "Status" - }, - "type": { - "type": "string", - "const": "file_search_call", - "title": "Type", - "default": "file_search_call" - }, - "results": { - "title": "Results", - "items": { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults" - }, - "type": "array" - } - }, - "type": "object", - "required": [ - "id", - "queries", - "status" - ], - "title": "OpenAIResponseOutputMessageFileSearchToolCall", - "description": "File search tool call output message for OpenAI responses." - }, - "OpenAIResponseOutputMessageFileSearchToolCallResults": { - "properties": { - "attributes": { - "additionalProperties": true, - "type": "object", - "title": "Attributes" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "filename": { - "type": "string", - "title": "Filename" - }, - "score": { - "type": "number", - "title": "Score" - }, - "text": { - "type": "string", - "title": "Text" - } - }, - "type": "object", - "required": [ - "attributes", - "file_id", - "filename", - "score", - "text" - ], - "title": "OpenAIResponseOutputMessageFileSearchToolCallResults", - "description": "Search results returned by the file search operation." - }, - "OpenAIResponseOutputMessageFunctionToolCall": { - "properties": { - "call_id": { - "type": "string", - "title": "Call Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "arguments": { - "type": "string", - "title": "Arguments" - }, - "type": { - "type": "string", - "const": "function_call", - "title": "Type", - "default": "function_call" - }, - "id": { - "title": "Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "type": "object", - "required": [ - "call_id", - "name", - "arguments" - ], - "title": "OpenAIResponseOutputMessageFunctionToolCall", - "description": "Function tool call output message for OpenAI responses." - }, - "OpenAIResponseOutputMessageMCPCall": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "type": { - "type": "string", - "const": "mcp_call", - "title": "Type", - "default": "mcp_call" - }, - "arguments": { - "type": "string", - "title": "Arguments" - }, - "name": { - "type": "string", - "title": "Name" - }, - "server_label": { - "type": "string", - "title": "Server Label" - }, - "error": { - "title": "Error", - "type": "string" - }, - "output": { - "title": "Output", - "type": "string" - } - }, - "type": "object", - "required": [ - "id", - "arguments", - "name", - "server_label" - ], - "title": "OpenAIResponseOutputMessageMCPCall", - "description": "Model Context Protocol (MCP) call output message for OpenAI responses." - }, - "OpenAIResponseOutputMessageMCPListTools": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "type": { - "type": "string", - "const": "mcp_list_tools", - "title": "Type", - "default": "mcp_list_tools" - }, - "server_label": { - "type": "string", - "title": "Server Label" - }, - "tools": { - "items": { - "$ref": "#/components/schemas/MCPListToolsTool" - }, - "type": "array", - "title": "Tools" - } - }, - "type": "object", - "required": [ - "id", - "server_label", - "tools" - ], - "title": "OpenAIResponseOutputMessageMCPListTools", - "description": "MCP list tools output message containing available tools from an MCP server." - }, - "OpenAIResponseOutputMessageWebSearchToolCall": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "status": { - "type": "string", - "title": "Status" - }, - "type": { - "type": "string", - "const": "web_search_call", - "title": "Type", - "default": "web_search_call" - } - }, - "type": "object", - "required": [ - "id", - "status" - ], - "title": "OpenAIResponseOutputMessageWebSearchToolCall", - "description": "Web search tool call output message for OpenAI responses." - }, - "OpenAIResponsePrompt": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "variables": { - "title": "Variables", - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", - "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", - "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" - } - } - }, - "type": "object" - }, - "version": { - "title": "Version", - "type": "string" - } - }, - "type": "object", - "required": [ - "id" - ], - "title": "OpenAIResponsePrompt", - "description": "OpenAI compatible Prompt object that is used in OpenAI responses." - }, - "OpenAIResponseText": { - "properties": { - "format": { - "$ref": "#/components/schemas/OpenAIResponseTextFormat" - } - }, - "type": "object", - "title": "OpenAIResponseText", - "description": "Text response configuration for OpenAI responses." - }, - "OpenAIResponseTextFormat": { - "properties": { - "type": { - "anyOf": [ - { - "type": "string", - "const": "text" - }, - { - "type": "string", - "const": "json_schema" - }, - { - "type": "string", - "const": "json_object" - } - ], - "title": "Type" - }, - "name": { - "title": "Name", - "type": "string" - }, - "schema": { - "title": "Schema", - "additionalProperties": true, - "type": "object" - }, - "description": { - "title": "Description", - "type": "string" - }, - "strict": { - "title": "Strict", - "type": "boolean" - } - }, - "type": "object", - "title": "OpenAIResponseTextFormat", - "description": "Configuration for Responses API text format." - }, - "OpenAIResponseToolMCP": { - "properties": { - "type": { - "type": "string", - "const": "mcp", - "title": "Type", - "default": "mcp" - }, - "server_label": { - "type": "string", - "title": "Server Label" - }, - "allowed_tools": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "$ref": "#/components/schemas/AllowedToolsFilter" - } - ], - "title": "Allowed Tools" - } - }, - "type": "object", - "required": [ - "server_label" - ], - "title": "OpenAIResponseToolMCP", - "description": "Model Context Protocol (MCP) tool configuration for OpenAI response object." - }, - "OpenAIResponseUsage": { - "properties": { - "input_tokens": { - "type": "integer", - "title": "Input Tokens" - }, - "output_tokens": { - "type": "integer", - "title": "Output Tokens" - }, - "total_tokens": { - "type": "integer", - "title": "Total Tokens" - }, - "input_tokens_details": { - "$ref": "#/components/schemas/OpenAIResponseUsageInputTokensDetails" - }, - "output_tokens_details": { - "$ref": "#/components/schemas/OpenAIResponseUsageOutputTokensDetails" - } - }, - "type": "object", - "required": [ - "input_tokens", - "output_tokens", - "total_tokens" - ], - "title": "OpenAIResponseUsage", - "description": "Usage information for OpenAI response." - }, - "OpenAIResponseUsageInputTokensDetails": { - "properties": { - "cached_tokens": { - "title": "Cached Tokens", - "type": "integer" - } - }, - "type": "object", - "title": "OpenAIResponseUsageInputTokensDetails", - "description": "Token details for input tokens in OpenAI response usage." - }, - "OpenAIResponseUsageOutputTokensDetails": { - "properties": { - "reasoning_tokens": { - "title": "Reasoning Tokens", - "type": "integer" - } - }, - "type": "object", - "title": "OpenAIResponseUsageOutputTokensDetails", - "description": "Token details for output tokens in OpenAI response usage." - }, - "OpenAISystemMessageParam": { - "properties": { - "role": { - "type": "string", - "const": "system", - "title": "Role", - "default": "system" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "OpenAISystemMessageParam", - "description": "A system message providing instructions or context to the model." - }, - "OpenAITokenLogProb": { - "properties": { - "token": { - "type": "string", - "title": "Token" - }, - "bytes": { - "title": "Bytes", - "items": { - "type": "integer" - }, - "type": "array" - }, - "logprob": { - "type": "number", - "title": "Logprob" - }, - "top_logprobs": { - "items": { - "$ref": "#/components/schemas/OpenAITopLogProb" - }, - "type": "array", - "title": "Top Logprobs" - } - }, - "type": "object", - "required": [ - "token", - "logprob", - "top_logprobs" - ], - "title": "OpenAITokenLogProb", - "description": "The log probability for a token from an OpenAI-compatible chat completion response." - }, - "OpenAIToolMessageParam": { - "properties": { - "role": { - "type": "string", - "const": "tool", - "title": "Role", - "default": "tool" - }, - "tool_call_id": { - "type": "string", - "title": "Tool Call Id" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content" - } - }, - "type": "object", - "required": [ - "tool_call_id", - "content" - ], - "title": "OpenAIToolMessageParam", - "description": "A message representing the result of a tool invocation in an OpenAI-compatible chat completion request." - }, - "OpenAITopLogProb": { - "properties": { - "token": { - "type": "string", - "title": "Token" - }, - "bytes": { - "title": "Bytes", - "items": { - "type": "integer" - }, - "type": "array" - }, - "logprob": { - "type": "number", - "title": "Logprob" - } - }, - "type": "object", - "required": [ - "token", - "logprob" - ], - "title": "OpenAITopLogProb", - "description": "The top log probability for a token from an OpenAI-compatible chat completion response." - }, - "OpenAIUserMessageParam-Input": { - "properties": { - "role": { - "type": "string", - "const": "user", - "title": "Role", - "default": "user" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" - }, - { - "$ref": "#/components/schemas/OpenAIFile" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "file": "#/components/schemas/OpenAIFile", - "image_url": "#/components/schemas/OpenAIChatCompletionContentPartImageParam", - "text": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "OpenAIUserMessageParam", - "description": "A message from the user in an OpenAI-compatible chat completion request." - }, - "OpenAIUserMessageParam-Output": { - "properties": { - "role": { - "type": "string", - "const": "user", - "title": "Role", - "default": "user" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" - }, - { - "$ref": "#/components/schemas/OpenAIFile" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "file": "#/components/schemas/OpenAIFile", - "image_url": "#/components/schemas/OpenAIChatCompletionContentPartImageParam", - "text": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "OpenAIUserMessageParam", - "description": "A message from the user in an OpenAI-compatible chat completion request." - }, - "OptimizerConfig": { - "properties": { - "optimizer_type": { - "$ref": "#/components/schemas/OptimizerType" - }, - "lr": { - "type": "number", - "title": "Lr" - }, - "weight_decay": { - "type": "number", - "title": "Weight Decay" - }, - "num_warmup_steps": { - "type": "integer", - "title": "Num Warmup Steps" - } - }, - "type": "object", - "required": [ - "optimizer_type", - "lr", - "weight_decay", - "num_warmup_steps" - ], - "title": "OptimizerConfig", - "description": "Configuration parameters for the optimization algorithm." - }, - "OptimizerType": { - "type": "string", - "enum": [ - "adam", - "adamw", - "sgd" - ], - "title": "OptimizerType", - "description": "Available optimizer algorithms for training." - }, - "Order": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "title": "Order", - "description": "Sort order for paginated responses." - }, - "OutputTokensDetails": { - "properties": { - "reasoning_tokens": { - "type": "integer", - "title": "Reasoning Tokens" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "reasoning_tokens" - ], - "title": "OutputTokensDetails" - }, - "PostTrainingJob": { - "properties": { - "job_uuid": { - "type": "string", - "title": "Job Uuid" - } - }, - "type": "object", - "required": [ - "job_uuid" - ], - "title": "PostTrainingJob" - }, - "Prompt": { - "properties": { - "prompt": { - "title": "Prompt", - "description": "The system prompt with variable placeholders", - "type": "string" - }, - "version": { - "type": "integer", - "minimum": 1.0, - "title": "Version", - "description": "Version (integer starting at 1, incremented on save)" - }, - "prompt_id": { - "type": "string", - "title": "Prompt Id", - "description": "Unique identifier in format 'pmpt_<48-digit-hash>'" - }, - "variables": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Variables", - "description": "List of variable names that can be used in the prompt template" - }, - "is_default": { - "type": "boolean", - "title": "Is Default", - "description": "Boolean indicating whether this version is the default version", - "default": false - } - }, - "type": "object", - "required": [ - "version", - "prompt_id" - ], - "title": "Prompt", - "description": "A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack." - }, - "ProviderInfo": { - "properties": { - "api": { - "type": "string", - "title": "Api" - }, - "provider_id": { - "type": "string", - "title": "Provider Id" - }, - "provider_type": { - "type": "string", - "title": "Provider Type" - }, - "config": { - "additionalProperties": true, - "type": "object", - "title": "Config" - }, - "health": { - "additionalProperties": true, - "type": "object", - "title": "Health" - } - }, - "type": "object", - "required": [ - "api", - "provider_id", - "provider_type", - "config", - "health" - ], - "title": "ProviderInfo", - "description": "Information about a registered provider including its configuration and health status." - }, - "QueryChunksResponse": { - "properties": { - "chunks": { - "items": { - "$ref": "#/components/schemas/Chunk-Output" - }, - "type": "array", - "title": "Chunks" - }, - "scores": { - "items": { - "type": "number" - }, - "type": "array", - "title": "Scores" - } - }, - "type": "object", - "required": [ - "chunks", - "scores" - ], - "title": "QueryChunksResponse", - "description": "Response from querying chunks in a vector database." - }, - "RAGQueryConfig": { - "properties": { - "query_generator_config": { - "oneOf": [ - { - "$ref": "#/components/schemas/DefaultRAGQueryGeneratorConfig" - }, - { - "$ref": "#/components/schemas/LLMRAGQueryGeneratorConfig" - } - ], - "title": "Query Generator Config", - "default": { - "type": "default", - "separator": " " - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "default": "#/components/schemas/DefaultRAGQueryGeneratorConfig", - "llm": "#/components/schemas/LLMRAGQueryGeneratorConfig" - } - } - }, - "max_tokens_in_context": { - "type": "integer", - "title": "Max Tokens In Context", - "default": 4096 - }, - "max_chunks": { - "type": "integer", - "title": "Max Chunks", - "default": 5 - }, - "chunk_template": { - "type": "string", - "title": "Chunk Template", - "default": "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n" - }, - "mode": { - "default": "vector", - "$ref": "#/components/schemas/RAGSearchMode" - }, - "ranker": { - "title": "Ranker", - "oneOf": [ - { - "$ref": "#/components/schemas/RRFRanker" - }, - { - "$ref": "#/components/schemas/WeightedRanker" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "rrf": "#/components/schemas/RRFRanker", - "weighted": "#/components/schemas/WeightedRanker" - } - } - } - }, - "type": "object", - "title": "RAGQueryConfig", - "description": "Configuration for the RAG query generation." - }, - "RAGQueryResult": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - } - }, - "type": "object", - "title": "RAGQueryResult", - "description": "Result of a RAG query containing retrieved content and metadata." - }, - "RAGSearchMode": { - "type": "string", - "enum": [ - "vector", - "keyword", - "hybrid" - ], - "title": "RAGSearchMode", - "description": "Search modes for RAG query retrieval:\n- VECTOR: Uses vector similarity search for semantic matching\n- KEYWORD: Uses keyword-based search for exact matching\n- HYBRID: Combines both vector and keyword search for better results" - }, - "RRFRanker": { - "properties": { - "type": { - "type": "string", - "const": "rrf", - "title": "Type", - "default": "rrf" - }, - "impact_factor": { - "type": "number", - "title": "Impact Factor", - "default": 60.0, - "minimum": 0.0 - } - }, - "type": "object", - "title": "RRFRanker", - "description": "Reciprocal Rank Fusion (RRF) ranker configuration." - }, - "RegexParserScoringFnParams": { - "properties": { - "type": { - "type": "string", - "const": "regex_parser", - "title": "Type", - "default": "regex_parser" - }, - "parsing_regexes": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Parsing Regexes", - "description": "Regex to extract the answer from generated response" - }, - "aggregation_functions": { - "items": { - "$ref": "#/components/schemas/AggregationFunctionType" - }, - "type": "array", - "title": "Aggregation Functions", - "description": "Aggregation functions to apply to the scores of each row" - } - }, - "type": "object", - "title": "RegexParserScoringFnParams", - "description": "Parameters for regex parser scoring function configuration." - }, - "RerankData": { - "properties": { - "index": { - "type": "integer", - "title": "Index" - }, - "relevance_score": { - "type": "number", - "title": "Relevance Score" - } - }, - "type": "object", - "required": [ - "index", - "relevance_score" - ], - "title": "RerankData", - "description": "A single rerank result from a reranking response." - }, - "RerankResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/RerankData" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "RerankResponse", - "description": "Response from a reranking request." - }, - "RouteInfo": { - "properties": { - "route": { - "type": "string", - "title": "Route" - }, - "method": { - "type": "string", - "title": "Method" - }, - "provider_types": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Provider Types" - } - }, - "type": "object", - "required": [ - "route", - "method", - "provider_types" - ], - "title": "RouteInfo", - "description": "Information about an API route including its path, method, and implementing providers." - }, - "RowsDataSource": { - "properties": { - "type": { - "type": "string", - "const": "rows", - "title": "Type", - "default": "rows" - }, - "rows": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Rows" - } - }, - "type": "object", - "required": [ - "rows" - ], - "title": "RowsDataSource", - "description": "A dataset stored in rows." - }, - "RunShieldResponse": { - "properties": { - "violation": { - "$ref": "#/components/schemas/SafetyViolation" - } - }, - "type": "object", - "title": "RunShieldResponse", - "description": "Response from running a safety shield." - }, - "SafetyViolation": { - "properties": { - "violation_level": { - "$ref": "#/components/schemas/ViolationLevel" - }, - "user_message": { - "title": "User Message", - "type": "string" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "violation_level" - ], - "title": "SafetyViolation", - "description": "Details of a safety violation detected by content moderation." - }, - "SamplingParams": { - "properties": { - "strategy": { - "oneOf": [ - { - "$ref": "#/components/schemas/GreedySamplingStrategy" - }, - { - "$ref": "#/components/schemas/TopPSamplingStrategy" - }, - { - "$ref": "#/components/schemas/TopKSamplingStrategy" - } - ], - "title": "Strategy", - "discriminator": { - "propertyName": "type", - "mapping": { - "greedy": "#/components/schemas/GreedySamplingStrategy", - "top_k": "#/components/schemas/TopKSamplingStrategy", - "top_p": "#/components/schemas/TopPSamplingStrategy" - } - } - }, - "max_tokens": { - "title": "Max Tokens", - "type": "integer" - }, - "repetition_penalty": { - "title": "Repetition Penalty", - "default": 1.0, - "type": "number" - }, - "stop": { - "title": "Stop", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object", - "title": "SamplingParams", - "description": "Sampling parameters." - }, - "ScoreBatchResponse": { - "properties": { - "dataset_id": { - "title": "Dataset Id", - "type": "string" - }, - "results": { - "additionalProperties": { - "$ref": "#/components/schemas/ScoringResult" - }, - "type": "object", - "title": "Results" - } - }, - "type": "object", - "required": [ - "results" - ], - "title": "ScoreBatchResponse", - "description": "Response from batch scoring operations on datasets." - }, - "ScoreResponse": { - "properties": { - "results": { - "additionalProperties": { - "$ref": "#/components/schemas/ScoringResult" - }, - "type": "object", - "title": "Results" - } - }, - "type": "object", - "required": [ - "results" - ], - "title": "ScoreResponse", - "description": "The response from scoring." - }, - "ScoringFn-Input": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "scoring_function", - "title": "Type", - "default": "scoring_function" - }, - "description": { - "title": "Description", - "type": "string" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata", - "description": "Any additional metadata for this definition" - }, - "return_type": { - "oneOf": [ - { - "$ref": "#/components/schemas/StringType" - }, - { - "$ref": "#/components/schemas/NumberType" - }, - { - "$ref": "#/components/schemas/BooleanType" - }, - { - "$ref": "#/components/schemas/ArrayType" - }, - { - "$ref": "#/components/schemas/ObjectType" - }, - { - "$ref": "#/components/schemas/JsonType" - }, - { - "$ref": "#/components/schemas/UnionType" - }, - { - "$ref": "#/components/schemas/ChatCompletionInputType" - }, - { - "$ref": "#/components/schemas/CompletionInputType" - }, - { - "$ref": "#/components/schemas/AgentTurnInputType" - } - ], - "title": "Return Type", - "description": "The return type of the deterministic function", - "discriminator": { - "propertyName": "type", - "mapping": { - "agent_turn_input": "#/components/schemas/AgentTurnInputType", - "array": "#/components/schemas/ArrayType", - "boolean": "#/components/schemas/BooleanType", - "chat_completion_input": "#/components/schemas/ChatCompletionInputType", - "completion_input": "#/components/schemas/CompletionInputType", - "json": "#/components/schemas/JsonType", - "number": "#/components/schemas/NumberType", - "object": "#/components/schemas/ObjectType", - "string": "#/components/schemas/StringType", - "union": "#/components/schemas/UnionType" - } - } - }, - "params": { - "title": "Params", - "description": "The parameters for the scoring function for benchmark eval, these can be overridden for app eval", - "oneOf": [ - { - "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" - }, - { - "$ref": "#/components/schemas/RegexParserScoringFnParams" - }, - { - "$ref": "#/components/schemas/BasicScoringFnParams" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "basic": "#/components/schemas/BasicScoringFnParams", - "llm_as_judge": "#/components/schemas/LLMAsJudgeScoringFnParams", - "regex_parser": "#/components/schemas/RegexParserScoringFnParams" - } - } - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id", - "return_type" - ], - "title": "ScoringFn", - "description": "A scoring function resource for evaluating model outputs." - }, - "ScoringFn-Output": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "scoring_function", - "title": "Type", - "default": "scoring_function" - }, - "description": { - "title": "Description", - "type": "string" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata", - "description": "Any additional metadata for this definition" - }, - "return_type": { - "oneOf": [ - { - "$ref": "#/components/schemas/StringType" - }, - { - "$ref": "#/components/schemas/NumberType" - }, - { - "$ref": "#/components/schemas/BooleanType" - }, - { - "$ref": "#/components/schemas/ArrayType" - }, - { - "$ref": "#/components/schemas/ObjectType" - }, - { - "$ref": "#/components/schemas/JsonType" - }, - { - "$ref": "#/components/schemas/UnionType" - }, - { - "$ref": "#/components/schemas/ChatCompletionInputType" - }, - { - "$ref": "#/components/schemas/CompletionInputType" - }, - { - "$ref": "#/components/schemas/AgentTurnInputType" - } - ], - "title": "Return Type", - "description": "The return type of the deterministic function", - "discriminator": { - "propertyName": "type", - "mapping": { - "agent_turn_input": "#/components/schemas/AgentTurnInputType", - "array": "#/components/schemas/ArrayType", - "boolean": "#/components/schemas/BooleanType", - "chat_completion_input": "#/components/schemas/ChatCompletionInputType", - "completion_input": "#/components/schemas/CompletionInputType", - "json": "#/components/schemas/JsonType", - "number": "#/components/schemas/NumberType", - "object": "#/components/schemas/ObjectType", - "string": "#/components/schemas/StringType", - "union": "#/components/schemas/UnionType" - } - } - }, - "params": { - "title": "Params", - "description": "The parameters for the scoring function for benchmark eval, these can be overridden for app eval", - "oneOf": [ - { - "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" - }, - { - "$ref": "#/components/schemas/RegexParserScoringFnParams" - }, - { - "$ref": "#/components/schemas/BasicScoringFnParams" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "basic": "#/components/schemas/BasicScoringFnParams", - "llm_as_judge": "#/components/schemas/LLMAsJudgeScoringFnParams", - "regex_parser": "#/components/schemas/RegexParserScoringFnParams" - } - } - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id", - "return_type" - ], - "title": "ScoringFn", - "description": "A scoring function resource for evaluating model outputs." - }, - "ScoringResult": { - "properties": { - "score_rows": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Score Rows" - }, - "aggregated_results": { - "additionalProperties": true, - "type": "object", - "title": "Aggregated Results" - } - }, - "type": "object", - "required": [ - "score_rows", - "aggregated_results" - ], - "title": "ScoringResult", - "description": "A scoring result for a single row." - }, - "SearchRankingOptions": { - "properties": { - "ranker": { - "title": "Ranker", - "type": "string" - }, - "score_threshold": { - "title": "Score Threshold", - "default": 0.0, - "type": "number" - } - }, - "type": "object", - "title": "SearchRankingOptions", - "description": "Options for ranking and filtering search results." - }, - "Shield": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "shield", - "title": "Type", - "default": "shield" - }, - "params": { - "title": "Params", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id" - ], - "title": "Shield", - "description": "A safety shield resource that can be used to check content." - }, - "ShieldCallStep-Input": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "step_id": { - "type": "string", - "title": "Step Id" - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - }, - "step_type": { - "type": "string", - "const": "shield_call", - "title": "Step Type", - "default": "shield_call" - }, - "violation": { - "$ref": "#/components/schemas/SafetyViolation" - } - }, - "type": "object", - "required": [ - "turn_id", - "step_id", - "violation" - ], - "title": "ShieldCallStep", - "description": "A shield call step in an agent turn." - }, - "ShieldCallStep-Output": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "step_id": { - "type": "string", - "title": "Step Id" - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - }, - "step_type": { - "type": "string", - "const": "shield_call", - "title": "Step Type", - "default": "shield_call" - }, - "violation": { - "$ref": "#/components/schemas/SafetyViolation" - } - }, - "type": "object", - "required": [ - "turn_id", - "step_id", - "violation" - ], - "title": "ShieldCallStep", - "description": "A shield call step in an agent turn." - }, - "StopReason": { - "type": "string", - "enum": [ - "end_of_turn", - "end_of_message", - "out_of_tokens" - ], - "title": "StopReason" - }, - "StringType": { - "properties": { - "type": { - "type": "string", - "const": "string", - "title": "Type", - "default": "string" - } - }, - "type": "object", - "title": "StringType", - "description": "Parameter type for string values." - }, - "SystemMessage": { - "properties": { - "role": { - "type": "string", - "const": "system", - "title": "Role", - "default": "system" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "SystemMessage", - "description": "A system message providing instructions or context to the model." - }, - "SystemMessageBehavior": { - "type": "string", - "enum": [ - "append", - "replace" - ], - "title": "SystemMessageBehavior", - "description": "Config for how to override the default system prompt." - }, - "TextContentItem": { - "properties": { - "type": { - "type": "string", - "const": "text", - "title": "Type", - "default": "text" - }, - "text": { - "type": "string", - "title": "Text" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "TextContentItem", - "description": "A text content item" - }, - "ToolCall": { - "properties": { - "call_id": { - "type": "string", - "title": "Call Id" - }, - "tool_name": { - "anyOf": [ - { - "$ref": "#/components/schemas/BuiltinTool" - }, - { - "type": "string" - } - ], - "title": "Tool Name" - }, - "arguments": { - "type": "string", - "title": "Arguments" - } - }, - "type": "object", - "required": [ - "call_id", - "tool_name", - "arguments" - ], - "title": "ToolCall" - }, - "ToolChoice": { - "type": "string", - "enum": [ - "auto", - "required", - "none" - ], - "title": "ToolChoice", - "description": "Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model." - }, - "ToolConfig": { - "properties": { - "tool_choice": { - "anyOf": [ - { - "$ref": "#/components/schemas/ToolChoice" - }, - { - "type": "string" - } - ], - "title": "Tool Choice", - "default": "auto" - }, - "tool_prompt_format": { - "$ref": "#/components/schemas/ToolPromptFormat" - }, - "system_message_behavior": { - "default": "append", - "$ref": "#/components/schemas/SystemMessageBehavior" - } - }, - "type": "object", - "title": "ToolConfig", - "description": "Configuration for tool use." - }, - "ToolDef": { - "properties": { - "toolgroup_id": { - "title": "Toolgroup Id", - "type": "string" - }, - "name": { - "type": "string", - "title": "Name" - }, - "description": { - "title": "Description", - "type": "string" - }, - "input_schema": { - "title": "Input Schema", - "additionalProperties": true, - "type": "object" - }, - "output_schema": { - "title": "Output Schema", - "additionalProperties": true, - "type": "object" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "required": [ - "name" - ], - "title": "ToolDef", - "description": "Tool definition used in runtime contexts." - }, - "ToolExecutionStep-Input": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "step_id": { - "type": "string", - "title": "Step Id" - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - }, - "step_type": { - "type": "string", - "const": "tool_execution", - "title": "Step Type", - "default": "tool_execution" - }, - "tool_calls": { - "items": { - "$ref": "#/components/schemas/ToolCall" - }, - "type": "array", - "title": "Tool Calls" - }, - "tool_responses": { - "items": { - "$ref": "#/components/schemas/ToolResponse-Input" - }, - "type": "array", - "title": "Tool Responses" - } - }, - "type": "object", - "required": [ - "turn_id", - "step_id", - "tool_calls", - "tool_responses" - ], - "title": "ToolExecutionStep", - "description": "A tool execution step in an agent turn." - }, - "ToolExecutionStep-Output": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "step_id": { - "type": "string", - "title": "Step Id" - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - }, - "step_type": { - "type": "string", - "const": "tool_execution", - "title": "Step Type", - "default": "tool_execution" - }, - "tool_calls": { - "items": { - "$ref": "#/components/schemas/ToolCall" - }, - "type": "array", - "title": "Tool Calls" - }, - "tool_responses": { - "items": { - "$ref": "#/components/schemas/ToolResponse-Output" - }, - "type": "array", - "title": "Tool Responses" - } - }, - "type": "object", - "required": [ - "turn_id", - "step_id", - "tool_calls", - "tool_responses" - ], - "title": "ToolExecutionStep", - "description": "A tool execution step in an agent turn." - }, - "ToolGroup": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "tool_group", - "title": "Type", - "default": "tool_group" - }, - "mcp_endpoint": { - "$ref": "#/components/schemas/URL" - }, - "args": { - "title": "Args", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id" - ], - "title": "ToolGroup", - "description": "A group of related tools managed together." - }, - "ToolInvocationResult": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "error_message": { - "title": "Error Message", - "type": "string" - }, - "error_code": { - "title": "Error Code", - "type": "integer" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "title": "ToolInvocationResult", - "description": "Result of a tool invocation." - }, - "ToolPromptFormat": { - "type": "string", - "enum": [ - "json", - "function_tag", - "python_list" - ], - "title": "ToolPromptFormat", - "description": "Prompt format for calling custom / zero shot tools." - }, - "ToolResponse-Input": { - "properties": { - "call_id": { - "type": "string", - "title": "Call Id" - }, - "tool_name": { - "anyOf": [ - { - "$ref": "#/components/schemas/BuiltinTool" - }, - { - "type": "string" - } - ], - "title": "Tool Name" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "required": [ - "call_id", - "tool_name", - "content" - ], - "title": "ToolResponse", - "description": "Response from a tool invocation." - }, - "ToolResponse-Output": { - "properties": { - "call_id": { - "type": "string", - "title": "Call Id" - }, - "tool_name": { - "anyOf": [ - { - "$ref": "#/components/schemas/BuiltinTool" - }, - { - "type": "string" - } - ], - "title": "Tool Name" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "required": [ - "call_id", - "tool_name", - "content" - ], - "title": "ToolResponse", - "description": "Response from a tool invocation." - }, - "ToolResponseMessage-Input": { - "properties": { - "role": { - "type": "string", - "const": "tool", - "title": "Role", - "default": "tool" - }, - "call_id": { - "type": "string", - "title": "Call Id" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - } - }, - "type": "object", - "required": [ - "call_id", - "content" - ], - "title": "ToolResponseMessage", - "description": "A message representing the result of a tool invocation." - }, - "ToolResponseMessage-Output": { - "properties": { - "role": { - "type": "string", - "const": "tool", - "title": "Role", - "default": "tool" - }, - "call_id": { - "type": "string", - "title": "Call Id" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - } - }, - "type": "object", - "required": [ - "call_id", - "content" - ], - "title": "ToolResponseMessage", - "description": "A message representing the result of a tool invocation." - }, - "TopKSamplingStrategy": { - "properties": { - "type": { - "type": "string", - "const": "top_k", - "title": "Type", - "default": "top_k" - }, - "top_k": { - "type": "integer", - "minimum": 1.0, - "title": "Top K" - } - }, - "type": "object", - "required": [ - "top_k" - ], - "title": "TopKSamplingStrategy", - "description": "Top-k sampling strategy that restricts sampling to the k most likely tokens." - }, - "TopPSamplingStrategy": { - "properties": { - "type": { - "type": "string", - "const": "top_p", - "title": "Type", - "default": "top_p" - }, - "temperature": { - "title": "Temperature", - "type": "number", - "minimum": 0.0 - }, - "top_p": { - "title": "Top P", - "default": 0.95, - "type": "number" - } - }, - "type": "object", - "required": [ - "temperature" - ], - "title": "TopPSamplingStrategy", - "description": "Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p." - }, - "TrainingConfig": { - "properties": { - "n_epochs": { - "type": "integer", - "title": "N Epochs" - }, - "max_steps_per_epoch": { - "type": "integer", - "title": "Max Steps Per Epoch", - "default": 1 - }, - "gradient_accumulation_steps": { - "type": "integer", - "title": "Gradient Accumulation Steps", - "default": 1 - }, - "max_validation_steps": { - "title": "Max Validation Steps", - "default": 1, - "type": "integer" - }, - "data_config": { - "$ref": "#/components/schemas/DataConfig" - }, - "optimizer_config": { - "$ref": "#/components/schemas/OptimizerConfig" - }, - "efficiency_config": { - "$ref": "#/components/schemas/EfficiencyConfig" - }, - "dtype": { - "title": "Dtype", - "default": "bf16", - "type": "string" - } - }, - "type": "object", - "required": [ - "n_epochs" - ], - "title": "TrainingConfig", - "description": "Comprehensive configuration for the training process." - }, - "Turn": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "session_id": { - "type": "string", - "title": "Session Id" - }, - "input_messages": { - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/UserMessage-Output" - }, - { - "$ref": "#/components/schemas/ToolResponseMessage-Output" - } - ] - }, - "type": "array", - "title": "Input Messages" - }, - "steps": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/InferenceStep-Output" - }, - { - "$ref": "#/components/schemas/ToolExecutionStep-Output" - }, - { - "$ref": "#/components/schemas/ShieldCallStep-Output" - }, - { - "$ref": "#/components/schemas/MemoryRetrievalStep-Output" - } - ], - "discriminator": { - "propertyName": "step_type", - "mapping": { - "inference": "#/components/schemas/InferenceStep-Output", - "memory_retrieval": "#/components/schemas/MemoryRetrievalStep-Output", - "shield_call": "#/components/schemas/ShieldCallStep-Output", - "tool_execution": "#/components/schemas/ToolExecutionStep-Output" - } - } - }, - "type": "array", - "title": "Steps" - }, - "output_message": { - "$ref": "#/components/schemas/CompletionMessage-Output" - }, - "output_attachments": { - "title": "Output Attachments", - "items": { - "$ref": "#/components/schemas/Attachment-Output" - }, - "type": "array" - }, - "started_at": { - "type": "string", - "format": "date-time", - "title": "Started At" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - } - }, - "type": "object", - "required": [ - "turn_id", - "session_id", - "input_messages", - "steps", - "output_message", - "started_at" - ], - "title": "Turn", - "description": "A single turn in an interaction with an Agentic System." - }, - "URIDataSource": { - "properties": { - "type": { - "type": "string", - "const": "uri", - "title": "Type", - "default": "uri" - }, - "uri": { - "type": "string", - "title": "Uri" - } - }, - "type": "object", - "required": [ - "uri" - ], - "title": "URIDataSource", - "description": "A dataset that can be obtained from a URI." - }, - "URL": { - "properties": { - "uri": { - "type": "string", - "title": "Uri" - } - }, - "type": "object", - "required": [ - "uri" - ], - "title": "URL", - "description": "A URL reference to external content." - }, - "UnionType": { - "properties": { - "type": { - "type": "string", - "const": "union", - "title": "Type", - "default": "union" - } - }, - "type": "object", - "title": "UnionType", - "description": "Parameter type for union values." - }, - "UserMessage-Input": { - "properties": { - "role": { - "type": "string", - "const": "user", - "title": "Role", - "default": "user" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "context": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Context" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "UserMessage", - "description": "A message from the user in a chat conversation." - }, - "UserMessage-Output": { - "properties": { - "role": { - "type": "string", - "const": "user", - "title": "Role", - "default": "user" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "context": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Context" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "UserMessage", - "description": "A message from the user in a chat conversation." - }, - "VectorStoreChunkingStrategyAuto": { - "properties": { - "type": { - "type": "string", - "const": "auto", - "title": "Type", - "default": "auto" - } - }, - "type": "object", - "title": "VectorStoreChunkingStrategyAuto", - "description": "Automatic chunking strategy for vector store files." - }, - "VectorStoreChunkingStrategyStatic": { - "properties": { - "type": { - "type": "string", - "const": "static", - "title": "Type", - "default": "static" - }, - "static": { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyStaticConfig" - } - }, - "type": "object", - "required": [ - "static" - ], - "title": "VectorStoreChunkingStrategyStatic", - "description": "Static chunking strategy with configurable parameters." - }, - "VectorStoreChunkingStrategyStaticConfig": { - "properties": { - "chunk_overlap_tokens": { - "type": "integer", - "title": "Chunk Overlap Tokens", - "default": 400 - }, - "max_chunk_size_tokens": { - "type": "integer", - "maximum": 4096.0, - "minimum": 100.0, - "title": "Max Chunk Size Tokens", - "default": 800 - } - }, - "type": "object", - "title": "VectorStoreChunkingStrategyStaticConfig", - "description": "Configuration for static chunking strategy." - }, - "VectorStoreContent": { - "properties": { - "type": { - "type": "string", - "const": "text", - "title": "Type" - }, - "text": { - "type": "string", - "title": "Text" - } - }, - "type": "object", - "required": [ - "type", - "text" - ], - "title": "VectorStoreContent", - "description": "Content item from a vector store file or search result." - }, - "VectorStoreFileBatchObject": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "object": { - "type": "string", - "title": "Object", - "default": "vector_store.file_batch" - }, - "created_at": { - "type": "integer", - "title": "Created At" - }, - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "status": { - "anyOf": [ - { - "type": "string", - "const": "completed" - }, - { - "type": "string", - "const": "in_progress" - }, - { - "type": "string", - "const": "cancelled" - }, - { - "type": "string", - "const": "failed" - } - ], - "title": "Status" - }, - "file_counts": { - "$ref": "#/components/schemas/VectorStoreFileCounts" - } - }, - "type": "object", - "required": [ - "id", - "created_at", - "vector_store_id", - "status", - "file_counts" - ], - "title": "VectorStoreFileBatchObject", - "description": "OpenAI Vector Store File Batch object." - }, - "VectorStoreFileCounts": { - "properties": { - "completed": { - "type": "integer", - "title": "Completed" - }, - "cancelled": { - "type": "integer", - "title": "Cancelled" - }, - "failed": { - "type": "integer", - "title": "Failed" - }, - "in_progress": { - "type": "integer", - "title": "In Progress" - }, - "total": { - "type": "integer", - "title": "Total" - } - }, - "type": "object", - "required": [ - "completed", - "cancelled", - "failed", - "in_progress", - "total" - ], - "title": "VectorStoreFileCounts", - "description": "File processing status counts for a vector store." - }, - "VectorStoreFileLastError": { - "properties": { - "code": { - "anyOf": [ - { - "type": "string", - "const": "server_error" - }, - { - "type": "string", - "const": "rate_limit_exceeded" - } - ], - "title": "Code" - }, - "message": { - "type": "string", - "title": "Message" - } - }, - "type": "object", - "required": [ - "code", - "message" - ], - "title": "VectorStoreFileLastError", - "description": "Error information for failed vector store file processing." - }, - "VectorStoreFileObject": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "object": { - "type": "string", - "title": "Object", - "default": "vector_store.file" - }, - "attributes": { - "additionalProperties": true, - "type": "object", - "title": "Attributes" - }, - "chunking_strategy": { - "oneOf": [ - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" - }, - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - ], - "title": "Chunking Strategy", - "discriminator": { - "propertyName": "type", - "mapping": { - "auto": "#/components/schemas/VectorStoreChunkingStrategyAuto", - "static": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - } - }, - "created_at": { - "type": "integer", - "title": "Created At" - }, - "last_error": { - "$ref": "#/components/schemas/VectorStoreFileLastError" - }, - "status": { - "anyOf": [ - { - "type": "string", - "const": "completed" - }, - { - "type": "string", - "const": "in_progress" - }, - { - "type": "string", - "const": "cancelled" - }, - { - "type": "string", - "const": "failed" - } - ], - "title": "Status" - }, - "usage_bytes": { - "type": "integer", - "title": "Usage Bytes", - "default": 0 - }, - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - } - }, - "type": "object", - "required": [ - "id", - "chunking_strategy", - "created_at", - "status", - "vector_store_id" - ], - "title": "VectorStoreFileObject", - "description": "OpenAI Vector Store File object." - }, - "VectorStoreObject": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "object": { - "type": "string", - "title": "Object", - "default": "vector_store" - }, - "created_at": { - "type": "integer", - "title": "Created At" - }, - "name": { - "title": "Name", - "type": "string" - }, - "usage_bytes": { - "type": "integer", - "title": "Usage Bytes", - "default": 0 - }, - "file_counts": { - "$ref": "#/components/schemas/VectorStoreFileCounts" - }, - "status": { - "type": "string", - "title": "Status", - "default": "completed" - }, - "expires_after": { - "title": "Expires After", - "additionalProperties": true, - "type": "object" - }, - "expires_at": { - "title": "Expires At", - "type": "integer" - }, - "last_active_at": { - "title": "Last Active At", - "type": "integer" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "id", - "created_at", - "file_counts" - ], - "title": "VectorStoreObject", - "description": "OpenAI Vector Store object." - }, - "VectorStoreSearchResponse": { - "properties": { - "file_id": { - "type": "string", - "title": "File Id" - }, - "filename": { - "type": "string", - "title": "Filename" - }, - "score": { - "type": "number", - "title": "Score" - }, - "attributes": { - "title": "Attributes", - "additionalProperties": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - } - ] - }, - "type": "object" - }, - "content": { - "items": { - "$ref": "#/components/schemas/VectorStoreContent" - }, - "type": "array", - "title": "Content" - } - }, - "type": "object", - "required": [ - "file_id", - "filename", - "score", - "content" - ], - "title": "VectorStoreSearchResponse", - "description": "Response from searching a vector store." - }, - "VectorStoreSearchResponsePage": { - "properties": { - "object": { - "type": "string", - "title": "Object", - "default": "vector_store.search_results.page" - }, - "search_query": { - "type": "string", - "title": "Search Query" - }, - "data": { - "items": { - "$ref": "#/components/schemas/VectorStoreSearchResponse" - }, - "type": "array", - "title": "Data" - }, - "has_more": { - "type": "boolean", - "title": "Has More", - "default": false - }, - "next_page": { - "title": "Next Page", - "type": "string" - } - }, - "type": "object", - "required": [ - "search_query", - "data" - ], - "title": "VectorStoreSearchResponsePage", - "description": "Paginated response from searching a vector store." - }, - "VersionInfo": { - "properties": { - "version": { - "type": "string", - "title": "Version" - } - }, - "type": "object", - "required": [ - "version" - ], - "title": "VersionInfo", - "description": "Version information for the service." - }, - "ViolationLevel": { - "type": "string", - "enum": [ - "info", - "warn", - "error" - ], - "title": "ViolationLevel", - "description": "Severity level of a safety violation." - }, - "WeightedRanker": { - "properties": { - "type": { - "type": "string", - "const": "weighted", - "title": "Type", - "default": "weighted" - }, - "alpha": { - "type": "number", - "maximum": 1.0, - "minimum": 0.0, - "title": "Alpha", - "description": "Weight factor between 0 and 1. 0 means only keyword scores, 1 means only vector scores.", - "default": 0.5 - } - }, - "type": "object", - "title": "WeightedRanker", - "description": "Weighted ranker configuration that combines vector and keyword scores." - }, - "_URLOrData": { - "properties": { - "url": { - "$ref": "#/components/schemas/URL" - }, - "data": { - "contentEncoding": "base64", - "title": "Data", - "type": "string" - } - }, - "type": "object", - "title": "_URLOrData", - "description": "A URL or a base64 encoded string" - }, - "__main_____agents_agent_id_session_Request": { - "properties": { - "agent_id": { - "type": "string", - "title": "Agent Id" - }, - "session_name": { - "type": "string", - "title": "Session Name" - } - }, - "type": "object", - "required": [ - "agent_id", - "session_name" - ], - "title": "_agents_agent_id_session_Request" - }, - "__main_____agents_agent_id_session_session_id_turn_Request": { - "properties": { - "agent_id": { - "type": "string", - "title": "Agent Id" - }, - "session_id": { - "type": "string", - "title": "Session Id" - }, - "messages": { - "$ref": "#/components/schemas/UserMessage-Input" - }, - "stream": { - "type": "boolean", - "title": "Stream", - "default": false - }, - "documents": { - "$ref": "#/components/schemas/Document" - }, - "toolgroups": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/AgentToolGroupWithArgs" - } - ], - "title": "Toolgroups" - }, - "tool_config": { - "$ref": "#/components/schemas/ToolConfig" - } - }, - "type": "object", - "required": [ - "agent_id", - "session_id", - "messages", - "documents", - "toolgroups", - "tool_config" - ], - "title": "_agents_agent_id_session_session_id_turn_Request" - }, - "__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request": { - "properties": { - "agent_id": { - "type": "string", - "title": "Agent Id" - }, - "session_id": { - "type": "string", - "title": "Session Id" - }, - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "tool_responses": { - "$ref": "#/components/schemas/ToolResponse-Input" - }, - "stream": { - "type": "boolean", - "title": "Stream", - "default": false - } - }, - "type": "object", - "required": [ - "agent_id", - "session_id", - "turn_id", - "tool_responses" - ], - "title": "_agents_agent_id_session_session_id_turn_turn_id_resume_Request" - }, - "__main_____datasets_Request": { - "properties": { - "purpose": { - "$ref": "#/components/schemas/DatasetPurpose" - }, - "metadata": { - "type": "string", - "title": "Metadata" - }, - "dataset_id": { - "type": "string", - "title": "Dataset Id" - } - }, - "type": "object", - "required": [ - "purpose", - "metadata", - "dataset_id" - ], - "title": "_datasets_Request" - }, - "_batches_Request": { - "properties": { - "input_file_id": { - "type": "string", - "title": "Input File Id" - }, - "endpoint": { - "type": "string", - "title": "Endpoint" - }, - "completion_window": { - "type": "string", - "title": "Completion Window" - }, - "metadata": { - "type": "string", - "title": "Metadata" - }, - "idempotency_key": { - "type": "string", - "title": "Idempotency Key" - } - }, - "type": "object", - "required": [ - "input_file_id", - "endpoint", - "completion_window", - "metadata", - "idempotency_key" - ], - "title": "_batches_Request" - }, - "_batches_batch_id_cancel_Request": { - "properties": { - "batch_id": { - "type": "string", - "title": "Batch Id" - } - }, - "type": "object", - "required": [ - "batch_id" - ], - "title": "_batches_batch_id_cancel_Request" - }, - "_conversations_Request": { - "properties": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage-Input" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - } - ], - "title": "Items", - "discriminator": { - "propertyName": "type", - "mapping": { - "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", - "function_call_output": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput", - "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", - "mcp_approval_response": "#/components/schemas/OpenAIResponseMCPApprovalResponse", - "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", - "message": "#/components/schemas/OpenAIResponseMessage-Input", - "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - } - } - }, - "metadata": { - "type": "string", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "items", - "metadata" - ], - "title": "_conversations_Request" - }, - "_conversations_conversation_id_Request": { - "properties": { - "conversation_id": { - "type": "string", - "title": "Conversation Id" - }, - "metadata": { - "type": "string", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "conversation_id", - "metadata" - ], - "title": "_conversations_conversation_id_Request" - }, - "_conversations_conversation_id_items_Request": { - "properties": { - "conversation_id": { - "type": "string", - "title": "Conversation Id" - }, - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage-Input" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - } - ], - "title": "Items" - } - }, - "type": "object", - "required": [ - "conversation_id", - "items" - ], - "title": "_conversations_conversation_id_items_Request" - }, - "_inference_rerank_Request": { - "properties": { - "model": { - "type": "string", - "title": "Model" - }, - "query": { - "type": "string", - "title": "Query" - }, - "items": { - "type": "string", - "title": "Items" - }, - "max_num_results": { - "type": "integer", - "title": "Max Num Results" - } - }, - "type": "object", - "required": [ - "model", - "query", - "items", - "max_num_results" - ], - "title": "_inference_rerank_Request" - }, - "_models_Request": { - "properties": { - "model_id": { - "type": "string", - "title": "Model Id" - }, - "provider_model_id": { - "type": "string", - "title": "Provider Model Id" - }, - "provider_id": { - "type": "string", - "title": "Provider Id" - }, - "metadata": { - "type": "string", - "title": "Metadata" - }, - "model_type": { - "$ref": "#/components/schemas/ModelType" - } - }, - "type": "object", - "required": [ - "model_id", - "provider_model_id", - "provider_id", - "metadata", - "model_type" - ], - "title": "_models_Request" - }, - "_moderations_Request": { - "properties": { - "input": { - "type": "string", - "title": "Input" - }, - "model": { - "type": "string", - "title": "Model" - } - }, - "type": "object", - "required": [ - "input", - "model" - ], - "title": "_moderations_Request" - }, - "_openai_v1_batches_Request": { - "properties": { - "input_file_id": { - "type": "string", - "title": "Input File Id" - }, - "endpoint": { - "type": "string", - "title": "Endpoint" - }, - "completion_window": { - "type": "string", - "title": "Completion Window" - }, - "metadata": { - "type": "string", - "title": "Metadata" - }, - "idempotency_key": { - "type": "string", - "title": "Idempotency Key" - } - }, - "type": "object", - "required": [ - "input_file_id", - "endpoint", - "completion_window", - "metadata", - "idempotency_key" - ], - "title": "_openai_v1_batches_Request" - }, - "_openai_v1_batches_batch_id_cancel_Request": { - "properties": { - "batch_id": { - "type": "string", - "title": "Batch Id" - } - }, - "type": "object", - "required": [ - "batch_id" - ], - "title": "_openai_v1_batches_batch_id_cancel_Request" - }, - "_openai_v1_moderations_Request": { - "properties": { - "input": { - "type": "string", - "title": "Input" - }, - "model": { - "type": "string", - "title": "Model" - } - }, - "type": "object", - "required": [ - "input", - "model" - ], - "title": "_openai_v1_moderations_Request" - }, - "_openai_v1_responses_Request": { - "properties": { - "input": { - "type": "string", - "title": "Input" - }, - "model": { - "type": "string", - "title": "Model" - }, - "prompt": { - "$ref": "#/components/schemas/OpenAIResponsePrompt" - }, - "instructions": { - "type": "string", - "title": "Instructions" - }, - "previous_response_id": { - "type": "string", - "title": "Previous Response Id" - }, - "conversation": { - "type": "string", - "title": "Conversation" - }, - "store": { - "type": "boolean", - "title": "Store", - "default": true - }, - "stream": { - "type": "boolean", - "title": "Stream", - "default": false - }, - "temperature": { - "type": "number", - "title": "Temperature" - }, - "text": { - "$ref": "#/components/schemas/OpenAIResponseText" - }, - "tools": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolMCP" - } - ], - "title": "Tools", - "discriminator": { - "propertyName": "type", - "mapping": { - "file_search": "#/components/schemas/OpenAIResponseInputToolFileSearch", - "function": "#/components/schemas/OpenAIResponseInputToolFunction", - "mcp": "#/components/schemas/OpenAIResponseInputToolMCP", - "web_search": "#/components/schemas/OpenAIResponseInputToolWebSearch", - "web_search_preview": "#/components/schemas/OpenAIResponseInputToolWebSearch", - "web_search_preview_2025_03_11": "#/components/schemas/OpenAIResponseInputToolWebSearch" - } - } - }, - "include": { - "type": "string", - "title": "Include" - }, - "max_infer_iters": { - "type": "integer", - "title": "Max Infer Iters", - "default": 10 - } - }, - "type": "object", - "required": [ - "input", - "model", - "prompt", - "instructions", - "previous_response_id", - "conversation", - "temperature", - "text", - "tools", - "include" - ], - "title": "_openai_v1_responses_Request" - }, - "_openai_v1_vector_stores_vector_store_id_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "expires_after": { - "type": "string", - "title": "Expires After" - }, - "metadata": { - "type": "string", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "name", - "expires_after", - "metadata" - ], - "title": "_openai_v1_vector_stores_vector_store_id_Request" - }, - "_openai_v1_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request": { - "properties": { - "batch_id": { - "type": "string", - "title": "Batch Id" - }, - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - } - }, - "type": "object", - "required": [ - "batch_id", - "vector_store_id" - ], - "title": "_openai_v1_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request" - }, - "_openai_v1_vector_stores_vector_store_id_files_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "attributes": { - "type": "string", - "title": "Attributes" - }, - "chunking_strategy": { - "anyOf": [ - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" - }, - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - ], - "title": "Chunking Strategy" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "file_id", - "attributes", - "chunking_strategy" - ], - "title": "_openai_v1_vector_stores_vector_store_id_files_Request" - }, - "_openai_v1_vector_stores_vector_store_id_files_file_id_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "attributes": { - "type": "string", - "title": "Attributes" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "file_id", - "attributes" - ], - "title": "_openai_v1_vector_stores_vector_store_id_files_file_id_Request" - }, - "_openai_v1_vector_stores_vector_store_id_search_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "query": { - "type": "string", - "title": "Query" - }, - "filters": { - "type": "string", - "title": "Filters" - }, - "max_num_results": { - "type": "integer", - "title": "Max Num Results", - "default": 10 - }, - "ranking_options": { - "$ref": "#/components/schemas/SearchRankingOptions" - }, - "rewrite_query": { - "type": "boolean", - "title": "Rewrite Query", - "default": false - }, - "search_mode": { - "type": "string", - "title": "Search Mode", - "default": "vector" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "query", - "filters", - "ranking_options" - ], - "title": "_openai_v1_vector_stores_vector_store_id_search_Request" - }, - "_prompts_Request": { - "properties": { - "prompt": { - "type": "string", - "title": "Prompt" - }, - "variables": { - "type": "string", - "title": "Variables" - } - }, - "type": "object", - "required": [ - "prompt", - "variables" - ], - "title": "_prompts_Request" - }, - "_prompts_prompt_id_Request": { - "properties": { - "prompt_id": { - "type": "string", - "title": "Prompt Id" - }, - "prompt": { - "type": "string", - "title": "Prompt" - }, - "version": { - "type": "integer", - "title": "Version" - }, - "variables": { - "type": "string", - "title": "Variables" - }, - "set_as_default": { - "type": "boolean", - "title": "Set As Default", - "default": true - } - }, - "type": "object", - "required": [ - "prompt_id", - "prompt", - "version", - "variables" - ], - "title": "_prompts_prompt_id_Request" - }, - "_prompts_prompt_id_set_default_version_Request": { - "properties": { - "prompt_id": { - "type": "string", - "title": "Prompt Id" - }, - "version": { - "type": "integer", - "title": "Version" - } - }, - "type": "object", - "required": [ - "prompt_id", - "version" - ], - "title": "_prompts_prompt_id_set_default_version_Request" - }, - "_responses_Request": { - "properties": { - "input": { - "type": "string", - "title": "Input" - }, - "model": { - "type": "string", - "title": "Model" - }, - "prompt": { - "$ref": "#/components/schemas/OpenAIResponsePrompt" - }, - "instructions": { - "type": "string", - "title": "Instructions" - }, - "previous_response_id": { - "type": "string", - "title": "Previous Response Id" - }, - "conversation": { - "type": "string", - "title": "Conversation" - }, - "store": { - "type": "boolean", - "title": "Store", - "default": true - }, - "stream": { - "type": "boolean", - "title": "Stream", - "default": false - }, - "temperature": { - "type": "number", - "title": "Temperature" - }, - "text": { - "$ref": "#/components/schemas/OpenAIResponseText" - }, - "tools": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolMCP" - } - ], - "title": "Tools", - "discriminator": { - "propertyName": "type", - "mapping": { - "file_search": "#/components/schemas/OpenAIResponseInputToolFileSearch", - "function": "#/components/schemas/OpenAIResponseInputToolFunction", - "mcp": "#/components/schemas/OpenAIResponseInputToolMCP", - "web_search": "#/components/schemas/OpenAIResponseInputToolWebSearch", - "web_search_preview": "#/components/schemas/OpenAIResponseInputToolWebSearch", - "web_search_preview_2025_03_11": "#/components/schemas/OpenAIResponseInputToolWebSearch" - } - } - }, - "include": { - "type": "string", - "title": "Include" - }, - "max_infer_iters": { - "type": "integer", - "title": "Max Infer Iters", - "default": 10 - } - }, - "type": "object", - "required": [ - "input", - "model", - "prompt", - "instructions", - "previous_response_id", - "conversation", - "temperature", - "text", - "tools", - "include" - ], - "title": "_responses_Request" - }, - "_scoring_score_Request": { - "properties": { - "input_rows": { - "type": "string", - "title": "Input Rows" - }, - "scoring_functions": { - "type": "string", - "title": "Scoring Functions" - } - }, - "type": "object", - "required": [ - "input_rows", - "scoring_functions" - ], - "title": "_scoring_score_Request" - }, - "_scoring_score_batch_Request": { - "properties": { - "dataset_id": { - "type": "string", - "title": "Dataset Id" - }, - "scoring_functions": { - "type": "string", - "title": "Scoring Functions" - }, - "save_results_dataset": { - "type": "boolean", - "title": "Save Results Dataset", - "default": false - } - }, - "type": "object", - "required": [ - "dataset_id", - "scoring_functions" - ], - "title": "_scoring_score_batch_Request" - }, - "_shields_Request": { - "properties": { - "shield_id": { - "type": "string", - "title": "Shield Id" - }, - "provider_shield_id": { - "type": "string", - "title": "Provider Shield Id" - }, - "provider_id": { - "type": "string", - "title": "Provider Id" - }, - "params": { - "type": "string", - "title": "Params" - } - }, - "type": "object", - "required": [ - "shield_id", - "provider_shield_id", - "provider_id", - "params" - ], - "title": "_shields_Request" - }, - "_tool_runtime_invoke_Request": { - "properties": { - "tool_name": { - "type": "string", - "title": "Tool Name" - }, - "kwargs": { - "type": "string", - "title": "Kwargs" - } - }, - "type": "object", - "required": [ - "tool_name", - "kwargs" - ], - "title": "_tool_runtime_invoke_Request" - }, - "_tool_runtime_rag_tool_query_Request": { - "properties": { - "content": { - "type": "string", - "title": "Content" - }, - "vector_store_ids": { - "type": "string", - "title": "Vector Store Ids" - }, - "query_config": { - "$ref": "#/components/schemas/RAGQueryConfig" - } - }, - "type": "object", - "required": [ - "content", - "vector_store_ids", - "query_config" - ], - "title": "_tool_runtime_rag_tool_query_Request" - }, - "_vector_io_query_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "query": { - "type": "string", - "title": "Query" - }, - "params": { - "type": "string", - "title": "Params" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "query", - "params" - ], - "title": "_vector_io_query_Request" - }, - "_vector_stores_vector_store_id_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "expires_after": { - "type": "string", - "title": "Expires After" - }, - "metadata": { - "type": "string", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "name", - "expires_after", - "metadata" - ], - "title": "_vector_stores_vector_store_id_Request" - }, - "_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request": { - "properties": { - "batch_id": { - "type": "string", - "title": "Batch Id" - }, - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - } - }, - "type": "object", - "required": [ - "batch_id", - "vector_store_id" - ], - "title": "_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request" - }, - "_vector_stores_vector_store_id_files_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "attributes": { - "type": "string", - "title": "Attributes" - }, - "chunking_strategy": { - "anyOf": [ - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" - }, - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - ], - "title": "Chunking Strategy" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "file_id", - "attributes", - "chunking_strategy" - ], - "title": "_vector_stores_vector_store_id_files_Request" - }, - "_vector_stores_vector_store_id_files_file_id_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "attributes": { - "type": "string", - "title": "Attributes" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "file_id", - "attributes" - ], - "title": "_vector_stores_vector_store_id_files_file_id_Request" - }, - "_vector_stores_vector_store_id_search_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "query": { - "type": "string", - "title": "Query" - }, - "filters": { - "type": "string", - "title": "Filters" - }, - "max_num_results": { - "type": "integer", - "title": "Max Num Results", - "default": 10 - }, - "ranking_options": { - "$ref": "#/components/schemas/SearchRankingOptions" - }, - "rewrite_query": { - "type": "boolean", - "title": "Rewrite Query", - "default": false - }, - "search_mode": { - "type": "string", - "title": "Search Mode", - "default": "vector" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "query", - "filters", - "ranking_options" - ], - "title": "_vector_stores_vector_store_id_search_Request" - }, - "Error": { - "description": "Error response from the API. Roughly follows RFC 7807.", - "properties": { - "status": { - "title": "Status", - "type": "integer" - }, - "title": { - "title": "Title", - "type": "string" - }, - "detail": { - "title": "Detail", - "type": "string" - }, - "instance": { - "title": "Instance", - "type": "string", - "nullable": true - } - }, - "required": [ - "status", - "title", - "detail" - ], - "title": "Error", - "type": "object" - }, - "Agent": { - "description": "An agent instance with configuration and metadata.", - "properties": { - "agent_id": { - "title": "Agent Id", - "type": "string" - }, - "agent_config": { - "$ref": "#/components/schemas/AgentConfig" - }, - "created_at": { - "format": "date-time", - "title": "Created At", - "type": "string" - } - }, - "required": [ - "agent_id", - "agent_config", - "created_at" - ], - "title": "Agent", - "type": "object" - }, - "AgentStepResponse": { - "description": "Response containing details of a specific agent step.", - "properties": { - "step": { - "discriminator": { - "mapping": { - "inference": "#/$defs/InferenceStep", - "memory_retrieval": "#/$defs/MemoryRetrievalStep", - "shield_call": "#/$defs/ShieldCallStep", - "tool_execution": "#/$defs/ToolExecutionStep" - }, - "propertyName": "step_type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/InferenceStep" - }, - { - "$ref": "#/components/schemas/ToolExecutionStep" - }, - { - "$ref": "#/components/schemas/ShieldCallStep" - }, - { - "$ref": "#/components/schemas/MemoryRetrievalStep" - } - ], - "title": "Step" - } - }, - "required": [ - "step" - ], - "title": "AgentStepResponse", - "type": "object" - }, - "AgentTurnCreateRequest": { - "description": "Request to create a new turn for an agent.", - "properties": { - "sampling_params": { - "$ref": "#/components/schemas/SamplingParams" - }, - "input_shields": { - "title": "Input Shields", - "items": { - "type": "string" - }, - "type": "array" - }, - "output_shields": { - "title": "Output Shields", - "items": { - "type": "string" - }, - "type": "array" - }, - "toolgroups": { - "title": "Toolgroups", - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/AgentToolGroupWithArgs" - } - ] - }, - "type": "array" - }, - "client_tools": { - "title": "Client Tools", - "items": { - "$ref": "#/components/schemas/ToolDef" - }, - "type": "array" - }, - "tool_choice": { - "deprecated": true, - "$ref": "#/components/schemas/ToolChoice", - "nullable": true - }, - "tool_prompt_format": { - "deprecated": true, - "$ref": "#/components/schemas/ToolPromptFormat", - "nullable": true - }, - "tool_config": { - "$ref": "#/components/schemas/ToolConfig", - "nullable": true - }, - "max_infer_iters": { - "default": 10, - "title": "Max Infer Iters", - "type": "integer" - }, - "instructions": { - "title": "Instructions", - "type": "string", - "nullable": true - }, - "agent_id": { - "title": "Agent Id", - "type": "string" - }, - "session_id": { - "title": "Session Id", - "type": "string" - }, - "messages": { - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/UserMessage" - }, - { - "$ref": "#/components/schemas/ToolResponseMessage" - } - ] - }, - "title": "Messages", - "type": "array" - }, - "documents": { - "title": "Documents", - "items": { - "$ref": "#/components/schemas/Document" - }, - "type": "array", - "nullable": true - }, - "stream": { - "default": false, - "title": "Stream", - "type": "boolean" - } - }, - "required": [ - "agent_id", - "session_id", - "messages" - ], - "title": "AgentTurnCreateRequest", - "type": "object" - }, - "AgentTurnResponseEvent": { - "description": "An event in an agent turn response stream.", - "properties": { - "payload": { - "discriminator": { - "mapping": { - "step_complete": "#/$defs/AgentTurnResponseStepCompletePayload", - "step_progress": "#/$defs/AgentTurnResponseStepProgressPayload", - "step_start": "#/$defs/AgentTurnResponseStepStartPayload", - "turn_awaiting_input": "#/$defs/AgentTurnResponseTurnAwaitingInputPayload", - "turn_complete": "#/$defs/AgentTurnResponseTurnCompletePayload", - "turn_start": "#/$defs/AgentTurnResponseTurnStartPayload" - }, - "propertyName": "event_type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/AgentTurnResponseStepStartPayload" - }, - { - "$ref": "#/components/schemas/AgentTurnResponseStepProgressPayload" - }, - { - "$ref": "#/components/schemas/AgentTurnResponseStepCompletePayload" - }, - { - "$ref": "#/components/schemas/AgentTurnResponseTurnStartPayload" - }, - { - "$ref": "#/components/schemas/AgentTurnResponseTurnCompletePayload" - }, - { - "$ref": "#/components/schemas/AgentTurnResponseTurnAwaitingInputPayload" - } - ], - "title": "Payload" - } - }, - "required": [ - "payload" - ], - "title": "AgentTurnResponseEvent", - "type": "object" - }, - "AgentTurnResponseStepCompletePayload": { - "description": "Payload for step completion events in agent turn responses.", - "properties": { - "event_type": { - "const": "step_complete", - "default": "step_complete", - "title": "Event Type", - "type": "string" - }, - "step_type": { - "$ref": "#/components/schemas/StepType" - }, - "step_id": { - "title": "Step Id", - "type": "string" - }, - "step_details": { - "discriminator": { - "mapping": { - "inference": "#/$defs/InferenceStep", - "memory_retrieval": "#/$defs/MemoryRetrievalStep", - "shield_call": "#/$defs/ShieldCallStep", - "tool_execution": "#/$defs/ToolExecutionStep" - }, - "propertyName": "step_type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/InferenceStep" - }, - { - "$ref": "#/components/schemas/ToolExecutionStep" - }, - { - "$ref": "#/components/schemas/ShieldCallStep" - }, - { - "$ref": "#/components/schemas/MemoryRetrievalStep" - } - ], - "title": "Step Details" - } - }, - "required": [ - "step_type", - "step_id", - "step_details" - ], - "title": "AgentTurnResponseStepCompletePayload", - "type": "object" - }, - "AgentTurnResponseStepProgressPayload": { - "description": "Payload for step progress events in agent turn responses.", - "properties": { - "event_type": { - "const": "step_progress", - "default": "step_progress", - "title": "Event Type", - "type": "string" - }, - "step_type": { - "$ref": "#/components/schemas/StepType" - }, - "step_id": { - "title": "Step Id", - "type": "string" - }, - "delta": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageDelta", - "text": "#/$defs/TextDelta", - "tool_call": "#/$defs/ToolCallDelta" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/TextDelta" - }, - { - "$ref": "#/components/schemas/ImageDelta" - }, - { - "$ref": "#/components/schemas/ToolCallDelta" - } - ], - "title": "Delta" - } - }, - "required": [ - "step_type", - "step_id", - "delta" - ], - "title": "AgentTurnResponseStepProgressPayload", - "type": "object" - }, - "AgentTurnResponseStepStartPayload": { - "description": "Payload for step start events in agent turn responses.", - "properties": { - "event_type": { - "const": "step_start", - "default": "step_start", - "title": "Event Type", - "type": "string" - }, - "step_type": { - "$ref": "#/components/schemas/StepType" - }, - "step_id": { - "title": "Step Id", - "type": "string" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "required": [ - "step_type", - "step_id" - ], - "title": "AgentTurnResponseStepStartPayload", - "type": "object" - }, - "AgentTurnResponseStreamChunk": { - "description": "Streamed agent turn completion response.", - "properties": { - "event": { - "$ref": "#/components/schemas/AgentTurnResponseEvent" - } - }, - "required": [ - "event" - ], - "title": "AgentTurnResponseStreamChunk", - "type": "object" - }, - "AgentTurnResponseTurnAwaitingInputPayload": { - "description": "Payload for turn awaiting input events in agent turn responses.", - "properties": { - "event_type": { - "const": "turn_awaiting_input", - "default": "turn_awaiting_input", - "title": "Event Type", - "type": "string" - }, - "turn": { - "$ref": "#/components/schemas/Turn" - } - }, - "required": [ - "turn" - ], - "title": "AgentTurnResponseTurnAwaitingInputPayload", - "type": "object" - }, - "AgentTurnResponseTurnCompletePayload": { - "description": "Payload for turn completion events in agent turn responses.", - "properties": { - "event_type": { - "const": "turn_complete", - "default": "turn_complete", - "title": "Event Type", - "type": "string" - }, - "turn": { - "$ref": "#/components/schemas/Turn" - } - }, - "required": [ - "turn" - ], - "title": "AgentTurnResponseTurnCompletePayload", - "type": "object" - }, - "AgentTurnResponseTurnStartPayload": { - "description": "Payload for turn start events in agent turn responses.", - "properties": { - "event_type": { - "const": "turn_start", - "default": "turn_start", - "title": "Event Type", - "type": "string" - }, - "turn_id": { - "title": "Turn Id", - "type": "string" - } - }, - "required": [ - "turn_id" - ], - "title": "AgentTurnResponseTurnStartPayload", - "type": "object" - }, - "AgentTurnResumeRequest": { - "description": "Request to resume an agent turn with tool responses.", - "properties": { - "agent_id": { - "title": "Agent Id", - "type": "string" - }, - "session_id": { - "title": "Session Id", - "type": "string" - }, - "turn_id": { - "title": "Turn Id", - "type": "string" - }, - "tool_responses": { - "items": { - "$ref": "#/components/schemas/ToolResponse" - }, - "title": "Tool Responses", - "type": "array" - }, - "stream": { - "default": false, - "title": "Stream", - "type": "boolean" - } - }, - "required": [ - "agent_id", - "session_id", - "turn_id", - "tool_responses" - ], - "title": "AgentTurnResumeRequest", - "type": "object" - }, - "CompletionMessage": { - "description": "A message containing the model's (assistant) response in a chat conversation.", - "properties": { - "role": { - "const": "assistant", - "default": "assistant", - "title": "Role", - "type": "string" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - { - "items": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - "type": "array" - } - ], - "title": "Content" - }, - "stop_reason": { - "$ref": "#/components/schemas/StopReason" - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/ToolCall" - }, - "type": "array" - } - }, - "required": [ - "content", - "stop_reason" - ], - "title": "CompletionMessage", - "type": "object" - }, - "InferenceStep": { - "description": "An inference step in an agent turn.", - "properties": { - "turn_id": { - "title": "Turn Id", - "type": "string" - }, - "step_id": { - "title": "Step Id", - "type": "string" - }, - "started_at": { - "title": "Started At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "completed_at": { - "title": "Completed At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "step_type": { - "const": "inference", - "default": "inference", - "title": "Step Type", - "type": "string" - }, - "model_response": { - "$ref": "#/components/schemas/CompletionMessage" - } - }, - "required": [ - "turn_id", - "step_id", - "model_response" - ], - "title": "InferenceStep", - "type": "object" - }, - "ListOpenAIResponseInputItem": { - "description": "List container for OpenAI response input items.", - "properties": { - "data": { - "items": { - "anyOf": [ - { - "discriminator": { - "mapping": { - "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", - "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", - "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", - "message": "#/$defs/OpenAIResponseMessage", - "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - } - ] - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - } - ] - }, - "title": "Data", - "type": "array" - }, - "object": { - "const": "list", - "default": "list", - "title": "Object", - "type": "string" - } - }, - "required": [ - "data" - ], - "title": "ListOpenAIResponseInputItem", - "type": "object" - }, - "ListOpenAIResponseObject": { - "description": "Paginated list of OpenAI response objects with navigation metadata.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/OpenAIResponseObjectWithInput" - }, - "title": "Data", - "type": "array" - }, - "has_more": { - "title": "Has More", - "type": "boolean" - }, - "first_id": { - "title": "First Id", - "type": "string" - }, - "last_id": { - "title": "Last Id", - "type": "string" - }, - "object": { - "const": "list", - "default": "list", - "title": "Object", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "first_id", - "last_id" - ], - "title": "ListOpenAIResponseObject", - "type": "object" - }, - "MemoryRetrievalStep": { - "description": "A memory retrieval step in an agent turn.", - "properties": { - "turn_id": { - "title": "Turn Id", - "type": "string" - }, - "step_id": { - "title": "Step Id", - "type": "string" - }, - "started_at": { - "title": "Started At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "completed_at": { - "title": "Completed At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "step_type": { - "const": "memory_retrieval", - "default": "memory_retrieval", - "title": "Step Type", - "type": "string" - }, - "vector_store_ids": { - "title": "Vector Store Ids", - "type": "string" - }, - "inserted_context": { - "anyOf": [ - { - "type": "string" - }, - { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - { - "items": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - "type": "array" - } - ], - "title": "Inserted Context" - } - }, - "required": [ - "turn_id", - "step_id", - "vector_store_ids", - "inserted_context" - ], - "title": "MemoryRetrievalStep", - "type": "object" - }, - "OpenAIDeleteResponseObject": { - "description": "Response object confirming deletion of an OpenAI response.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "object": { - "const": "response", - "default": "response", - "title": "Object", - "type": "string" - }, - "deleted": { - "default": true, - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id" - ], - "title": "OpenAIDeleteResponseObject", - "type": "object" - }, - "PaginatedResponse": { - "description": "A generic paginated response that follows a simple format.", - "properties": { - "data": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "title": "Data", - "type": "array" - }, - "has_more": { - "title": "Has More", - "type": "boolean" - }, - "url": { - "title": "Url", - "type": "string", - "nullable": true - } - }, - "required": [ - "data", - "has_more" - ], - "title": "PaginatedResponse", - "type": "object" - }, - "ResponseGuardrailSpec": { - "description": "Specification for a guardrail to apply during response generation.", - "properties": { - "type": { - "title": "Type", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "ResponseGuardrailSpec", - "type": "object" - }, - "Session": { - "description": "A single session of an interaction with an Agentic System.", - "properties": { - "session_id": { - "title": "Session Id", - "type": "string" - }, - "session_name": { - "title": "Session Name", - "type": "string" - }, - "turns": { - "items": { - "$ref": "#/components/schemas/Turn" - }, - "title": "Turns", - "type": "array" - }, - "started_at": { - "format": "date-time", - "title": "Started At", - "type": "string" - } - }, - "required": [ - "session_id", - "session_name", - "turns", - "started_at" - ], - "title": "Session", - "type": "object" - }, - "ShieldCallStep": { - "description": "A shield call step in an agent turn.", - "properties": { - "turn_id": { - "title": "Turn Id", - "type": "string" - }, - "step_id": { - "title": "Step Id", - "type": "string" - }, - "started_at": { - "title": "Started At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "completed_at": { - "title": "Completed At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "step_type": { - "const": "shield_call", - "default": "shield_call", - "title": "Step Type", - "type": "string" - }, - "violation": { - "$ref": "#/components/schemas/SafetyViolation" - } - }, - "required": [ - "turn_id", - "step_id", - "violation" - ], - "title": "ShieldCallStep", - "type": "object" - }, - "ToolExecutionStep": { - "description": "A tool execution step in an agent turn.", - "properties": { - "turn_id": { - "title": "Turn Id", - "type": "string" - }, - "step_id": { - "title": "Step Id", - "type": "string" - }, - "started_at": { - "title": "Started At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "completed_at": { - "title": "Completed At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "step_type": { - "const": "tool_execution", - "default": "tool_execution", - "title": "Step Type", - "type": "string" - }, - "tool_calls": { - "items": { - "$ref": "#/components/schemas/ToolCall" - }, - "title": "Tool Calls", - "type": "array" - }, - "tool_responses": { - "items": { - "$ref": "#/components/schemas/ToolResponse" - }, - "title": "Tool Responses", - "type": "array" - } - }, - "required": [ - "turn_id", - "step_id", - "tool_calls", - "tool_responses" - ], - "title": "ToolExecutionStep", - "type": "object" - }, - "ToolResponse": { - "description": "Response from a tool invocation.", - "properties": { - "call_id": { - "title": "Call Id", - "type": "string" - }, - "tool_name": { - "anyOf": [ - { - "$ref": "#/components/schemas/BuiltinTool" - }, - { - "type": "string" - } - ], - "title": "Tool Name" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - { - "items": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - "type": "array" - } - ], - "title": "Content" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object", - "nullable": true - } - }, - "required": [ - "call_id", - "tool_name", - "content" - ], - "title": "ToolResponse", - "type": "object" - }, - "ToolResponseMessage": { - "description": "A message representing the result of a tool invocation.", - "properties": { - "role": { - "const": "tool", - "default": "tool", - "title": "Role", - "type": "string" - }, - "call_id": { - "title": "Call Id", - "type": "string" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - { - "items": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - "type": "array" - } - ], - "title": "Content" - } - }, - "required": [ - "call_id", - "content" - ], - "title": "ToolResponseMessage", - "type": "object" - }, - "UserMessage": { - "description": "A message from the user in a chat conversation.", - "properties": { - "role": { - "const": "user", - "default": "user", - "title": "Role", - "type": "string" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - { - "items": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - "type": "array" - } - ], - "title": "Content" - }, - "context": { - "anyOf": [ - { - "type": "string" - }, - { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - { - "items": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - "type": "array" - } - ], - "title": "Context", - "nullable": true - } - }, - "required": [ - "content" - ], - "title": "UserMessage", - "type": "object" - }, - "ListBatchesResponse": { - "description": "Response containing a list of batch objects.", - "properties": { - "object": { - "const": "list", - "default": "list", - "title": "Object", - "type": "string" - }, - "data": { - "description": "List of batch objects", - "items": { - "$ref": "#/components/schemas/Batch" - }, - "title": "Data", - "type": "array" - }, - "first_id": { - "description": "ID of the first batch in the list", - "title": "First Id", - "type": "string", - "nullable": true - }, - "last_id": { - "description": "ID of the last batch in the list", - "title": "Last Id", - "type": "string", - "nullable": true - }, - "has_more": { - "default": false, - "description": "Whether there are more batches available", - "title": "Has More", - "type": "boolean" - } - }, - "required": [ - "data" - ], - "title": "ListBatchesResponse", - "type": "object" - }, - "ConversationCreateRequest": { - "description": "Request body for creating a conversation.", - "properties": { - "items": { - "default": [], - "description": "Initial items to include in the conversation context. You may add up to 20 items at a time.", - "title": "Items", - "items": { - "discriminator": { - "mapping": { - "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", - "function_call_output": "#/$defs/OpenAIResponseInputFunctionToolCallOutput", - "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", - "mcp_approval_response": "#/$defs/OpenAIResponseMCPApprovalResponse", - "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", - "message": "#/$defs/OpenAIResponseMessage", - "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - } - ] - }, - "maxItems": 20, - "type": "array" - }, - "metadata": { - "default": {}, - "description": "Set of 16 key-value pairs that can be attached to an object. Useful for storing additional information", - "title": "Metadata", - "additionalProperties": { - "type": "string" - }, - "maxProperties": 16, - "type": "object" - } - }, - "title": "ConversationCreateRequest", - "type": "object" - }, - "ConversationDeletedResource": { - "description": "Response for deleted conversation.", - "properties": { - "id": { - "description": "The deleted conversation identifier", - "title": "Id", - "type": "string" - }, - "object": { - "default": "conversation.deleted", - "description": "Object type", - "title": "Object", - "type": "string" - }, - "deleted": { - "default": true, - "description": "Whether the object was deleted", - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id" - ], - "title": "ConversationDeletedResource", - "type": "object" - }, - "ConversationItemCreateRequest": { - "description": "Request body for creating conversation items.", - "properties": { - "items": { - "description": "Items to include in the conversation context. You may add up to 20 items at a time.", - "items": { - "discriminator": { - "mapping": { - "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", - "function_call_output": "#/$defs/OpenAIResponseInputFunctionToolCallOutput", - "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", - "mcp_approval_response": "#/$defs/OpenAIResponseMCPApprovalResponse", - "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", - "message": "#/$defs/OpenAIResponseMessage", - "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - } - ] - }, - "maxItems": 20, - "title": "Items", - "type": "array" - } - }, - "required": [ - "items" - ], - "title": "ConversationItemCreateRequest", - "type": "object" - }, - "ConversationItemDeletedResource": { - "description": "Response for deleted conversation item.", - "properties": { - "id": { - "description": "The deleted item identifier", - "title": "Id", - "type": "string" - }, - "object": { - "default": "conversation.item.deleted", - "description": "Object type", - "title": "Object", - "type": "string" - }, - "deleted": { - "default": true, - "description": "Whether the object was deleted", - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id" - ], - "title": "ConversationItemDeletedResource", - "type": "object" - }, - "ConversationUpdateRequest": { - "description": "Request body for updating a conversation.", - "properties": { - "metadata": { - "additionalProperties": { - "type": "string" - }, - "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.", - "title": "Metadata", - "type": "object" - } - }, - "required": [ - "metadata" - ], - "title": "ConversationUpdateRequest", - "type": "object" - }, - "ExpiresAfter": { - "description": "Control expiration of uploaded files.\n\nParams:\n - anchor, must be \"created_at\"\n - seconds, must be int between 3600 and 2592000 (1 hour to 30 days)", - "properties": { - "anchor": { - "const": "created_at", - "title": "Anchor", - "type": "string" - }, - "seconds": { - "maximum": 2592000, - "minimum": 3600, - "title": "Seconds", - "type": "integer" - } - }, - "required": [ - "anchor", - "seconds" - ], - "title": "ExpiresAfter", - "type": "object" - }, - "ListOpenAIFileResponse": { - "description": "Response for listing files in OpenAI Files API.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/OpenAIFileObject" - }, - "title": "Data", - "type": "array" - }, - "has_more": { - "title": "Has More", - "type": "boolean" - }, - "first_id": { - "title": "First Id", - "type": "string" - }, - "last_id": { - "title": "Last Id", - "type": "string" - }, - "object": { - "const": "list", - "default": "list", - "title": "Object", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "first_id", - "last_id" - ], - "title": "ListOpenAIFileResponse", - "type": "object" - }, - "OpenAIFileDeleteResponse": { - "description": "Response for deleting a file in OpenAI Files API.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "object": { - "const": "file", - "default": "file", - "title": "Object", - "type": "string" - }, - "deleted": { - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id", - "deleted" - ], - "title": "OpenAIFileDeleteResponse", - "type": "object" - }, - "Bf16QuantizationConfig": { - "description": "Configuration for BFloat16 precision (typically no quantization).", - "properties": { - "type": { - "const": "bf16", - "default": "bf16", - "title": "Type", - "type": "string" - } - }, - "title": "Bf16QuantizationConfig", - "type": "object" - }, - "ChatCompletionRequest": { - "properties": { - "model": { - "title": "Model", - "type": "string" - }, - "messages": { - "items": { - "discriminator": { - "mapping": { - "assistant": "#/$defs/CompletionMessage", - "system": "#/$defs/SystemMessage", - "tool": "#/$defs/ToolResponseMessage", - "user": "#/$defs/UserMessage" - }, - "propertyName": "role" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/UserMessage" - }, - { - "$ref": "#/components/schemas/SystemMessage" - }, - { - "$ref": "#/components/schemas/ToolResponseMessage" - }, - { - "$ref": "#/components/schemas/CompletionMessage" - } - ] - }, - "title": "Messages", - "type": "array" - }, - "sampling_params": { - "$ref": "#/components/schemas/SamplingParams" - }, - "tools": { - "title": "Tools", - "items": { - "$ref": "#/components/schemas/ToolDefinition" - }, - "type": "array" - }, - "tool_config": { - "$ref": "#/components/schemas/ToolConfig" - }, - "response_format": { - "title": "Response Format", - "discriminator": { - "mapping": { - "grammar": "#/$defs/GrammarResponseFormat", - "json_schema": "#/$defs/JsonSchemaResponseFormat" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/JsonSchemaResponseFormat" - }, - { - "$ref": "#/components/schemas/GrammarResponseFormat" - } - ], - "nullable": true - }, - "stream": { - "default": false, - "title": "Stream", - "type": "boolean" - }, - "logprobs": { - "$ref": "#/components/schemas/LogProbConfig", - "nullable": true - } - }, - "required": [ - "model", - "messages" - ], - "title": "ChatCompletionRequest", - "type": "object" - }, - "ChatCompletionResponse": { - "description": "Response from a chat completion request.", - "properties": { - "metrics": { - "title": "Metrics", - "items": { - "$ref": "#/components/schemas/MetricInResponse" - }, - "type": "array", - "nullable": true - }, - "completion_message": { - "$ref": "#/components/schemas/CompletionMessage" - }, - "logprobs": { - "title": "Logprobs", - "items": { - "$ref": "#/components/schemas/TokenLogProbs" - }, - "type": "array", - "nullable": true - } - }, - "required": [ - "completion_message" - ], - "title": "ChatCompletionResponse", - "type": "object" - }, - "ChatCompletionResponseEvent": { - "description": "An event during chat completion generation.", - "properties": { - "event_type": { - "$ref": "#/components/schemas/ChatCompletionResponseEventType" - }, - "delta": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageDelta", - "text": "#/$defs/TextDelta", - "tool_call": "#/$defs/ToolCallDelta" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/TextDelta" - }, - { - "$ref": "#/components/schemas/ImageDelta" - }, - { - "$ref": "#/components/schemas/ToolCallDelta" - } - ], - "title": "Delta" - }, - "logprobs": { - "title": "Logprobs", - "items": { - "$ref": "#/components/schemas/TokenLogProbs" - }, - "type": "array", - "nullable": true - }, - "stop_reason": { - "$ref": "#/components/schemas/StopReason", - "nullable": true - } - }, - "required": [ - "event_type", - "delta" - ], - "title": "ChatCompletionResponseEvent", - "type": "object" - }, - "ChatCompletionResponseStreamChunk": { - "description": "A chunk of a streamed chat completion response.", - "properties": { - "metrics": { - "title": "Metrics", - "items": { - "$ref": "#/components/schemas/MetricInResponse" - }, - "type": "array", - "nullable": true - }, - "event": { - "$ref": "#/components/schemas/ChatCompletionResponseEvent" - } - }, - "required": [ - "event" - ], - "title": "ChatCompletionResponseStreamChunk", - "type": "object" - }, - "CompletionResponse": { - "description": "Response from a completion request.", - "properties": { - "metrics": { - "title": "Metrics", - "items": { - "$ref": "#/components/schemas/MetricInResponse" - }, - "type": "array", - "nullable": true - }, - "content": { - "title": "Content", - "type": "string" - }, - "stop_reason": { - "$ref": "#/components/schemas/StopReason" - }, - "logprobs": { - "title": "Logprobs", - "items": { - "$ref": "#/components/schemas/TokenLogProbs" - }, - "type": "array", - "nullable": true - } - }, - "required": [ - "content", - "stop_reason" - ], - "title": "CompletionResponse", - "type": "object" - }, - "CompletionResponseStreamChunk": { - "description": "A chunk of a streamed completion response.", - "properties": { - "metrics": { - "title": "Metrics", - "items": { - "$ref": "#/components/schemas/MetricInResponse" - }, - "type": "array", - "nullable": true - }, - "delta": { - "title": "Delta", - "type": "string" - }, - "stop_reason": { - "$ref": "#/components/schemas/StopReason", - "nullable": true - }, - "logprobs": { - "title": "Logprobs", - "items": { - "$ref": "#/components/schemas/TokenLogProbs" - }, - "type": "array", - "nullable": true - } - }, - "required": [ - "delta" - ], - "title": "CompletionResponseStreamChunk", - "type": "object" - }, - "EmbeddingsResponse": { - "description": "Response containing generated embeddings.", - "properties": { - "embeddings": { - "items": { - "items": { - "type": "number" - }, - "type": "array" - }, - "title": "Embeddings", - "type": "array" - } - }, - "required": [ - "embeddings" - ], - "title": "EmbeddingsResponse", - "type": "object" - }, - "Fp8QuantizationConfig": { - "description": "Configuration for 8-bit floating point quantization.", - "properties": { - "type": { - "const": "fp8_mixed", - "default": "fp8_mixed", - "title": "Type", - "type": "string" - } - }, - "title": "Fp8QuantizationConfig", - "type": "object" - }, - "Int4QuantizationConfig": { - "description": "Configuration for 4-bit integer quantization.", - "properties": { - "type": { - "const": "int4_mixed", - "default": "int4_mixed", - "title": "Type", - "type": "string" - }, - "scheme": { - "default": "int4_weight_int8_dynamic_activation", - "title": "Scheme", - "type": "string" - } - }, - "title": "Int4QuantizationConfig", - "type": "object" - }, - "ListOpenAIChatCompletionResponse": { - "description": "Response from listing OpenAI-compatible chat completions.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/OpenAICompletionWithInputMessages" - }, - "title": "Data", - "type": "array" - }, - "has_more": { - "title": "Has More", - "type": "boolean" - }, - "first_id": { - "title": "First Id", - "type": "string" - }, - "last_id": { - "title": "Last Id", - "type": "string" - }, - "object": { - "const": "list", - "default": "list", - "title": "Object", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "first_id", - "last_id" - ], - "title": "ListOpenAIChatCompletionResponse", - "type": "object" - }, - "OpenAIAssistantMessageParam": { - "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.", - "properties": { - "role": { - "const": "assistant", - "default": "assistant", - "title": "Role", - "type": "string" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content", - "nullable": true - }, - "name": { - "title": "Name", - "type": "string", - "nullable": true - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" - }, - "type": "array", - "nullable": true - } - }, - "title": "OpenAIAssistantMessageParam", - "type": "object" - }, - "OpenAIChatCompletionChunk": { - "description": "Chunk from a streaming response to an OpenAI-compatible chat completion request.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "choices": { - "items": { - "$ref": "#/components/schemas/OpenAIChunkChoice" - }, - "title": "Choices", - "type": "array" - }, - "object": { - "const": "chat.completion.chunk", - "default": "chat.completion.chunk", - "title": "Object", - "type": "string" - }, - "created": { - "title": "Created", - "type": "integer" - }, - "model": { - "title": "Model", - "type": "string" - }, - "usage": { - "$ref": "#/components/schemas/OpenAIChatCompletionUsage", - "nullable": true - } - }, - "required": [ - "id", - "choices", - "created", - "model" - ], - "title": "OpenAIChatCompletionChunk", - "type": "object" - }, - "OpenAIChoice": { - "description": "A choice from an OpenAI-compatible chat completion response.", - "properties": { - "message": { - "discriminator": { - "mapping": { - "assistant": "#/$defs/OpenAIAssistantMessageParam", - "developer": "#/$defs/OpenAIDeveloperMessageParam", - "system": "#/$defs/OpenAISystemMessageParam", - "tool": "#/$defs/OpenAIToolMessageParam", - "user": "#/$defs/OpenAIUserMessageParam" - }, - "propertyName": "role" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIUserMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAISystemMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIAssistantMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIToolMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" - } - ], - "title": "Message" - }, - "finish_reason": { - "title": "Finish Reason", - "type": "string" - }, - "index": { - "title": "Index", - "type": "integer" - }, - "logprobs": { - "$ref": "#/components/schemas/OpenAIChoiceLogprobs", - "nullable": true - } - }, - "required": [ - "message", - "finish_reason", - "index" - ], - "title": "OpenAIChoice", - "type": "object" - }, - "OpenAIChoiceDelta": { - "description": "A delta from an OpenAI-compatible chat completion streaming response.", - "properties": { - "content": { - "title": "Content", - "type": "string", - "nullable": true - }, - "refusal": { - "title": "Refusal", - "type": "string", - "nullable": true - }, - "role": { - "title": "Role", - "type": "string", - "nullable": true - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" - }, - "type": "array", - "nullable": true - }, - "reasoning_content": { - "title": "Reasoning Content", - "type": "string", - "nullable": true - } - }, - "title": "OpenAIChoiceDelta", - "type": "object" - }, - "OpenAIChoiceLogprobs": { - "description": "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response.", - "properties": { - "content": { - "title": "Content", - "items": { - "$ref": "#/components/schemas/OpenAITokenLogProb" - }, - "type": "array", - "nullable": true - }, - "refusal": { - "title": "Refusal", - "items": { - "$ref": "#/components/schemas/OpenAITokenLogProb" - }, - "type": "array", - "nullable": true - } - }, - "title": "OpenAIChoiceLogprobs", - "type": "object" - }, - "OpenAIChunkChoice": { - "description": "A chunk choice from an OpenAI-compatible chat completion streaming response.", - "properties": { - "delta": { - "$ref": "#/components/schemas/OpenAIChoiceDelta" - }, - "finish_reason": { - "title": "Finish Reason", - "type": "string" - }, - "index": { - "title": "Index", - "type": "integer" - }, - "logprobs": { - "$ref": "#/components/schemas/OpenAIChoiceLogprobs", - "nullable": true - } - }, - "required": [ - "delta", - "finish_reason", - "index" - ], - "title": "OpenAIChunkChoice", - "type": "object" - }, - "OpenAICompletionChoice": { - "description": "A choice from an OpenAI-compatible completion response.", - "properties": { - "finish_reason": { - "title": "Finish Reason", - "type": "string" - }, - "text": { - "title": "Text", - "type": "string" - }, - "index": { - "title": "Index", - "type": "integer" - }, - "logprobs": { - "$ref": "#/components/schemas/OpenAIChoiceLogprobs", - "nullable": true - } - }, - "required": [ - "finish_reason", - "text", - "index" - ], - "title": "OpenAICompletionChoice", - "type": "object" - }, - "OpenAICompletionLogprobs": { - "description": "The log probabilities for the tokens in the message from an OpenAI-compatible completion response.", - "properties": { - "text_offset": { - "title": "Text Offset", - "items": { - "type": "integer" - }, - "type": "array", - "nullable": true - }, - "token_logprobs": { - "title": "Token Logprobs", - "items": { - "type": "number" - }, - "type": "array", - "nullable": true - }, - "tokens": { - "title": "Tokens", - "items": { - "type": "string" - }, - "type": "array", - "nullable": true - }, - "top_logprobs": { - "title": "Top Logprobs", - "items": { - "additionalProperties": { - "type": "number" - }, - "type": "object" - }, - "type": "array", - "nullable": true - } - }, - "title": "OpenAICompletionLogprobs", - "type": "object" - }, - "OpenAICompletionWithInputMessages": { - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "choices": { - "items": { - "$ref": "#/components/schemas/OpenAIChoice" - }, - "title": "Choices", - "type": "array" - }, - "object": { - "const": "chat.completion", - "default": "chat.completion", - "title": "Object", - "type": "string" - }, - "created": { - "title": "Created", - "type": "integer" - }, - "model": { - "title": "Model", - "type": "string" - }, - "usage": { - "$ref": "#/components/schemas/OpenAIChatCompletionUsage", - "nullable": true - }, - "input_messages": { - "items": { - "discriminator": { - "mapping": { - "assistant": "#/$defs/OpenAIAssistantMessageParam", - "developer": "#/$defs/OpenAIDeveloperMessageParam", - "system": "#/$defs/OpenAISystemMessageParam", - "tool": "#/$defs/OpenAIToolMessageParam", - "user": "#/$defs/OpenAIUserMessageParam" - }, - "propertyName": "role" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIUserMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAISystemMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIAssistantMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIToolMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" - } - ] - }, - "title": "Input Messages", - "type": "array" - } - }, - "required": [ - "id", - "choices", - "created", - "model", - "input_messages" - ], - "title": "OpenAICompletionWithInputMessages", - "type": "object" - }, - "OpenAIUserMessageParam": { - "description": "A message from the user in an OpenAI-compatible chat completion request.", - "properties": { - "role": { - "const": "user", - "default": "user", - "title": "Role", - "type": "string" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "discriminator": { - "mapping": { - "file": "#/$defs/OpenAIFile", - "image_url": "#/$defs/OpenAIChatCompletionContentPartImageParam", - "text": "#/$defs/OpenAIChatCompletionContentPartTextParam" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" - }, - { - "$ref": "#/components/schemas/OpenAIFile" - } - ] - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string", - "nullable": true - } - }, - "required": [ - "content" - ], - "title": "OpenAIUserMessageParam", - "type": "object" - }, - "TokenLogProbs": { - "description": "Log probabilities for generated tokens.", - "properties": { - "logprobs_by_token": { - "additionalProperties": { - "type": "number" - }, - "title": "Logprobs By Token", - "type": "object" - } - }, - "required": [ - "logprobs_by_token" - ], - "title": "TokenLogProbs", - "type": "object" - }, - "Checkpoint": { - "description": "Checkpoint created during training runs.", - "properties": { - "identifier": { - "title": "Identifier", - "type": "string" - }, - "created_at": { - "format": "date-time", - "title": "Created At", - "type": "string" - }, - "epoch": { - "title": "Epoch", - "type": "integer" - }, - "post_training_job_id": { - "title": "Post Training Job Id", - "type": "string" - }, - "path": { - "title": "Path", - "type": "string" - }, - "training_metrics": { - "$ref": "#/components/schemas/PostTrainingMetric", - "nullable": true - } - }, - "required": [ - "identifier", - "created_at", - "epoch", - "post_training_job_id", - "path" - ], - "title": "Checkpoint", - "type": "object" - }, - "LoraFinetuningConfig": { - "description": "Configuration for Low-Rank Adaptation (LoRA) fine-tuning.", - "properties": { - "type": { - "const": "LoRA", - "default": "LoRA", - "title": "Type", - "type": "string" - }, - "lora_attn_modules": { - "items": { - "type": "string" - }, - "title": "Lora Attn Modules", - "type": "array" - }, - "apply_lora_to_mlp": { - "title": "Apply Lora To Mlp", - "type": "boolean" - }, - "apply_lora_to_output": { - "title": "Apply Lora To Output", - "type": "boolean" - }, - "rank": { - "title": "Rank", - "type": "integer" - }, - "alpha": { - "title": "Alpha", - "type": "integer" - }, - "use_dora": { - "default": false, - "title": "Use Dora", - "type": "boolean" - }, - "quantize_base": { - "default": false, - "title": "Quantize Base", - "type": "boolean" - } - }, - "required": [ - "lora_attn_modules", - "apply_lora_to_mlp", - "apply_lora_to_output", - "rank", - "alpha" - ], - "title": "LoraFinetuningConfig", - "type": "object" - }, - "PostTrainingJobArtifactsResponse": { - "description": "Artifacts of a finetuning job.", - "properties": { - "job_uuid": { - "title": "Job Uuid", - "type": "string" - }, - "checkpoints": { - "items": { - "$ref": "#/components/schemas/Checkpoint" - }, - "title": "Checkpoints", - "type": "array" - } - }, - "required": [ - "job_uuid" - ], - "title": "PostTrainingJobArtifactsResponse", - "type": "object" - }, - "PostTrainingJobLogStream": { - "description": "Stream of logs from a finetuning job.", - "properties": { - "job_uuid": { - "title": "Job Uuid", - "type": "string" - }, - "log_lines": { - "items": { - "type": "string" - }, - "title": "Log Lines", - "type": "array" - } - }, - "required": [ - "job_uuid", - "log_lines" - ], - "title": "PostTrainingJobLogStream", - "type": "object" - }, - "PostTrainingJobStatusResponse": { - "description": "Status of a finetuning job.", - "properties": { - "job_uuid": { - "title": "Job Uuid", - "type": "string" - }, - "status": { - "$ref": "#/components/schemas/JobStatus" - }, - "scheduled_at": { - "title": "Scheduled At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "started_at": { - "title": "Started At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "completed_at": { - "title": "Completed At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "resources_allocated": { - "title": "Resources Allocated", - "additionalProperties": true, - "type": "object", - "nullable": true - }, - "checkpoints": { - "items": { - "$ref": "#/components/schemas/Checkpoint" - }, - "title": "Checkpoints", - "type": "array" - } - }, - "required": [ - "job_uuid", - "status" - ], - "title": "PostTrainingJobStatusResponse", - "type": "object" - }, - "PostTrainingRLHFRequest": { - "description": "Request to finetune a model using reinforcement learning from human feedback.", - "properties": { - "job_uuid": { - "title": "Job Uuid", - "type": "string" - }, - "finetuned_model": { - "$ref": "#/components/schemas/URL" - }, - "dataset_id": { - "title": "Dataset Id", - "type": "string" - }, - "validation_dataset_id": { - "title": "Validation Dataset Id", - "type": "string" - }, - "algorithm": { - "$ref": "#/components/schemas/RLHFAlgorithm" - }, - "algorithm_config": { - "$ref": "#/components/schemas/DPOAlignmentConfig" - }, - "optimizer_config": { - "$ref": "#/components/schemas/OptimizerConfig" - }, - "training_config": { - "$ref": "#/components/schemas/TrainingConfig" - }, - "hyperparam_search_config": { - "additionalProperties": true, - "title": "Hyperparam Search Config", - "type": "object" - }, - "logger_config": { - "additionalProperties": true, - "title": "Logger Config", - "type": "object" - } - }, - "required": [ - "job_uuid", - "finetuned_model", - "dataset_id", - "validation_dataset_id", - "algorithm", - "algorithm_config", - "optimizer_config", - "training_config", - "hyperparam_search_config", - "logger_config" - ], - "title": "PostTrainingRLHFRequest", - "type": "object" - }, - "QATFinetuningConfig": { - "description": "Configuration for Quantization-Aware Training (QAT) fine-tuning.", - "properties": { - "type": { - "const": "QAT", - "default": "QAT", - "title": "Type", - "type": "string" - }, - "quantizer_name": { - "title": "Quantizer Name", - "type": "string" - }, - "group_size": { - "title": "Group Size", - "type": "integer" - } - }, - "required": [ - "quantizer_name", - "group_size" - ], - "title": "QATFinetuningConfig", - "type": "object" - }, - "ScoringFn": { - "description": "A scoring function resource for evaluating model outputs.", - "properties": { - "identifier": { - "description": "Unique identifier for this resource in llama stack", - "title": "Identifier", - "type": "string" - }, - "provider_resource_id": { - "description": "Unique identifier for this resource in the provider", - "title": "Provider Resource Id", - "type": "string", - "nullable": true - }, - "provider_id": { - "description": "ID of the provider that owns this resource", - "title": "Provider Id", - "type": "string" - }, - "type": { - "const": "scoring_function", - "default": "scoring_function", - "title": "Type", - "type": "string" - }, - "description": { - "title": "Description", - "type": "string", - "nullable": true - }, - "metadata": { - "additionalProperties": true, - "description": "Any additional metadata for this definition", - "title": "Metadata", - "type": "object" - }, - "return_type": { - "description": "The return type of the deterministic function", - "discriminator": { - "mapping": { - "agent_turn_input": "#/$defs/AgentTurnInputType", - "array": "#/$defs/ArrayType", - "boolean": "#/$defs/BooleanType", - "chat_completion_input": "#/$defs/ChatCompletionInputType", - "completion_input": "#/$defs/CompletionInputType", - "json": "#/$defs/JsonType", - "number": "#/$defs/NumberType", - "object": "#/$defs/ObjectType", - "string": "#/$defs/StringType", - "union": "#/$defs/UnionType" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/StringType" - }, - { - "$ref": "#/components/schemas/NumberType" - }, - { - "$ref": "#/components/schemas/BooleanType" - }, - { - "$ref": "#/components/schemas/ArrayType" - }, - { - "$ref": "#/components/schemas/ObjectType" - }, - { - "$ref": "#/components/schemas/JsonType" - }, - { - "$ref": "#/components/schemas/UnionType" - }, - { - "$ref": "#/components/schemas/ChatCompletionInputType" - }, - { - "$ref": "#/components/schemas/CompletionInputType" - }, - { - "$ref": "#/components/schemas/AgentTurnInputType" - } - ], - "title": "Return Type" - }, - "params": { - "description": "The parameters for the scoring function for benchmark eval, these can be overridden for app eval", - "title": "Params", - "discriminator": { - "mapping": { - "basic": "#/$defs/BasicScoringFnParams", - "llm_as_judge": "#/$defs/LLMAsJudgeScoringFnParams", - "regex_parser": "#/$defs/RegexParserScoringFnParams" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" - }, - { - "$ref": "#/components/schemas/RegexParserScoringFnParams" - }, - { - "$ref": "#/components/schemas/BasicScoringFnParams" - } - ], - "nullable": true - } - }, - "required": [ - "identifier", - "provider_id", - "return_type" - ], - "title": "ScoringFn", - "type": "object" - }, - "SyntheticDataGenerationRequest": { - "description": "Request to generate synthetic data. A small batch of prompts and a filtering function", - "properties": { - "dialogs": { - "items": { - "discriminator": { - "mapping": { - "assistant": "#/$defs/CompletionMessage", - "system": "#/$defs/SystemMessage", - "tool": "#/$defs/ToolResponseMessage", - "user": "#/$defs/UserMessage" - }, - "propertyName": "role" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/UserMessage" - }, - { - "$ref": "#/components/schemas/SystemMessage" - }, - { - "$ref": "#/components/schemas/ToolResponseMessage" - }, - { - "$ref": "#/components/schemas/CompletionMessage" - } - ] - }, - "title": "Dialogs", - "type": "array" - }, - "filtering_function": { - "$ref": "#/components/schemas/FilteringFunction", - "default": "none" - }, - "model": { - "title": "Model", - "type": "string", - "nullable": true - } - }, - "required": [ - "dialogs" - ], - "title": "SyntheticDataGenerationRequest", - "type": "object" - }, - "SyntheticDataGenerationResponse": { - "description": "Response from the synthetic data generation. Batch of (prompt, response, score) tuples that pass the threshold.", - "properties": { - "synthetic_data": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "title": "Synthetic Data", - "type": "array" - }, - "statistics": { - "title": "Statistics", - "additionalProperties": true, - "type": "object", - "nullable": true - } - }, - "required": [ - "synthetic_data" - ], - "title": "SyntheticDataGenerationResponse", - "type": "object" - }, - "ListToolDefsResponse": { - "description": "Response containing a list of tool definitions.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ToolDef" - }, - "title": "Data", - "type": "array" - } - }, - "required": [ - "data" - ], - "title": "ListToolDefsResponse", - "type": "object" - }, - "RAGDocument": { - "description": "A document to be used for document ingestion in the RAG Tool.", - "properties": { - "document_id": { - "title": "Document Id", - "type": "string" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - { - "items": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - "type": "array" - }, - { - "$ref": "#/components/schemas/URL" - } - ], - "title": "Content" - }, - "mime_type": { - "title": "Mime Type", - "type": "string", - "nullable": true - }, - "metadata": { - "additionalProperties": true, - "title": "Metadata", - "type": "object" - } - }, - "required": [ - "document_id", - "content" - ], - "title": "RAGDocument", - "type": "object" - }, - "ToolGroupInput": { - "description": "Input data for registering a tool group.", - "properties": { - "toolgroup_id": { - "title": "Toolgroup Id", - "type": "string" - }, - "provider_id": { - "title": "Provider Id", - "type": "string" - }, - "args": { - "title": "Args", - "additionalProperties": true, - "type": "object", - "nullable": true - }, - "mcp_endpoint": { - "$ref": "#/components/schemas/URL", - "nullable": true - } - }, - "required": [ - "toolgroup_id", - "provider_id" - ], - "title": "ToolGroupInput", - "type": "object" - }, - "Chunk": { - "description": "A chunk of content that can be inserted into a vector database.", - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - { - "items": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - "type": "array" - } - ], - "title": "Content" - }, - "chunk_id": { - "title": "Chunk Id", - "type": "string" - }, - "metadata": { - "additionalProperties": true, - "title": "Metadata", - "type": "object" - }, - "embedding": { - "title": "Embedding", - "items": { - "type": "number" - }, - "type": "array", - "nullable": true - }, - "chunk_metadata": { - "$ref": "#/components/schemas/ChunkMetadata", - "nullable": true - } - }, - "required": [ - "content", - "chunk_id" - ], - "title": "Chunk", - "type": "object" - }, - "VectorStoreCreateRequest": { - "description": "Request to create a vector store.", - "properties": { - "name": { - "title": "Name", - "type": "string", - "nullable": true - }, - "file_ids": { - "items": { - "type": "string" - }, - "title": "File Ids", - "type": "array" - }, - "expires_after": { - "title": "Expires After", - "additionalProperties": true, - "type": "object", - "nullable": true - }, - "chunking_strategy": { - "title": "Chunking Strategy", - "additionalProperties": true, - "type": "object", - "nullable": true - }, - "metadata": { - "additionalProperties": true, - "title": "Metadata", - "type": "object" - } - }, - "title": "VectorStoreCreateRequest", - "type": "object" - }, - "VectorStoreDeleteResponse": { - "description": "Response from deleting a vector store.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "object": { - "default": "vector_store.deleted", - "title": "Object", - "type": "string" - }, - "deleted": { - "default": true, - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id" - ], - "title": "VectorStoreDeleteResponse", - "type": "object" - }, - "VectorStoreFileContentsResponse": { - "description": "Response from retrieving the contents of a vector store file.", - "properties": { - "file_id": { - "title": "File Id", - "type": "string" - }, - "filename": { - "title": "Filename", - "type": "string" - }, - "attributes": { - "additionalProperties": true, - "title": "Attributes", - "type": "object" - }, - "content": { - "items": { - "$ref": "#/components/schemas/VectorStoreContent" - }, - "title": "Content", - "type": "array" - } - }, - "required": [ - "file_id", - "filename", - "attributes", - "content" - ], - "title": "VectorStoreFileContentsResponse", - "type": "object" - }, - "VectorStoreFileDeleteResponse": { - "description": "Response from deleting a vector store file.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "object": { - "default": "vector_store.file.deleted", - "title": "Object", - "type": "string" - }, - "deleted": { - "default": true, - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id" - ], - "title": "VectorStoreFileDeleteResponse", - "type": "object" - }, - "VectorStoreFilesListInBatchResponse": { - "description": "Response from listing files in a vector store file batch.", - "properties": { - "object": { - "default": "list", - "title": "Object", - "type": "string" - }, - "data": { - "items": { - "$ref": "#/components/schemas/VectorStoreFileObject" - }, - "title": "Data", - "type": "array" - }, - "first_id": { - "title": "First Id", - "type": "string", - "nullable": true - }, - "last_id": { - "title": "Last Id", - "type": "string", - "nullable": true - }, - "has_more": { - "default": false, - "title": "Has More", - "type": "boolean" - } - }, - "required": [ - "data" - ], - "title": "VectorStoreFilesListInBatchResponse", - "type": "object" - }, - "VectorStoreListFilesResponse": { - "description": "Response from listing files in a vector store.", - "properties": { - "object": { - "default": "list", - "title": "Object", - "type": "string" - }, - "data": { - "items": { - "$ref": "#/components/schemas/VectorStoreFileObject" - }, - "title": "Data", - "type": "array" - }, - "first_id": { - "title": "First Id", - "type": "string", - "nullable": true - }, - "last_id": { - "title": "Last Id", - "type": "string", - "nullable": true - }, - "has_more": { - "default": false, - "title": "Has More", - "type": "boolean" - } - }, - "required": [ - "data" - ], - "title": "VectorStoreListFilesResponse", - "type": "object" - }, - "VectorStoreListResponse": { - "description": "Response from listing vector stores.", - "properties": { - "object": { - "default": "list", - "title": "Object", - "type": "string" - }, - "data": { - "items": { - "$ref": "#/components/schemas/VectorStoreObject" - }, - "title": "Data", - "type": "array" - }, - "first_id": { - "title": "First Id", - "type": "string", - "nullable": true - }, - "last_id": { - "title": "Last Id", - "type": "string", - "nullable": true - }, - "has_more": { - "default": false, - "title": "Has More", - "type": "boolean" - } - }, - "required": [ - "data" - ], - "title": "VectorStoreListResponse", - "type": "object" - }, - "VectorStoreModifyRequest": { - "description": "Request to modify a vector store.", - "properties": { - "name": { - "title": "Name", - "type": "string", - "nullable": true - }, - "expires_after": { - "title": "Expires After", - "additionalProperties": true, - "type": "object", - "nullable": true - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object", - "nullable": true - } - }, - "title": "VectorStoreModifyRequest", - "type": "object" - }, - "VectorStoreSearchRequest": { - "description": "Request to search a vector store.", - "properties": { - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ], - "title": "Query" - }, - "filters": { - "title": "Filters", - "additionalProperties": true, - "type": "object", - "nullable": true - }, - "max_num_results": { - "default": 10, - "title": "Max Num Results", - "type": "integer" - }, - "ranking_options": { - "title": "Ranking Options", - "additionalProperties": true, - "type": "object", - "nullable": true - }, - "rewrite_query": { - "default": false, - "title": "Rewrite Query", - "type": "boolean" - } - }, - "required": [ - "query" - ], - "title": "VectorStoreSearchRequest", - "type": "object" - }, - "OpenAIResponseContentPartOutputText": { - "description": "Text content within a streamed response part.", - "properties": { - "type": { - "const": "output_text", - "default": "output_text", - "title": "Type", - "type": "string" - }, - "text": { - "title": "Text", - "type": "string" - }, - "annotations": { - "items": { - "discriminator": { - "mapping": { - "container_file_citation": "#/$defs/OpenAIResponseAnnotationContainerFileCitation", - "file_citation": "#/$defs/OpenAIResponseAnnotationFileCitation", - "file_path": "#/$defs/OpenAIResponseAnnotationFilePath", - "url_citation": "#/$defs/OpenAIResponseAnnotationCitation" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationFileCitation" - }, - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationCitation" - }, - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation" - }, - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationFilePath" - } - ] - }, - "title": "Annotations", - "type": "array" - }, - "logprobs": { - "title": "Logprobs", - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "nullable": true - } - }, - "required": [ - "text" - ], - "title": "OpenAIResponseContentPartOutputText", - "type": "object" - }, - "OpenAIResponseContentPartReasoningSummary": { - "description": "Reasoning summary part in a streamed response.", - "properties": { - "type": { - "const": "summary_text", - "default": "summary_text", - "title": "Type", - "type": "string" - }, - "text": { - "title": "Text", - "type": "string" - } - }, - "required": [ - "text" - ], - "title": "OpenAIResponseContentPartReasoningSummary", - "type": "object" - }, - "OpenAIResponseContentPartReasoningText": { - "description": "Reasoning text emitted as part of a streamed response.", - "properties": { - "type": { - "const": "reasoning_text", - "default": "reasoning_text", - "title": "Type", - "type": "string" - }, - "text": { - "title": "Text", - "type": "string" - } - }, - "required": [ - "text" - ], - "title": "OpenAIResponseContentPartReasoningText", - "type": "object" - }, - "OpenAIResponseMessage": { - "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios.", - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "discriminator": { - "mapping": { - "input_file": "#/$defs/OpenAIResponseInputMessageContentFile", - "input_image": "#/$defs/OpenAIResponseInputMessageContentImage", - "input_text": "#/$defs/OpenAIResponseInputMessageContentText" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" - } - ] - }, - "type": "array" - }, - { - "items": { - "discriminator": { - "mapping": { - "output_text": "#/$defs/OpenAIResponseOutputMessageContentOutputText", - "refusal": "#/$defs/OpenAIResponseContentPartRefusal" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" - } - ] - }, - "type": "array" - } - ], - "title": "Content" - }, - "role": { - "anyOf": [ - { - "const": "system", - "type": "string" - }, - { - "const": "developer", - "type": "string" - }, - { - "const": "user", - "type": "string" - }, - { - "const": "assistant", - "type": "string" - } - ], - "title": "Role" - }, - "type": { - "const": "message", - "default": "message", - "title": "Type", - "type": "string" - }, - "id": { - "title": "Id", - "type": "string", - "nullable": true - }, - "status": { - "title": "Status", - "type": "string", - "nullable": true - } - }, - "required": [ - "content", - "role" - ], - "title": "OpenAIResponseMessage", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseCompleted": { - "description": "Streaming event indicating a response has been completed.", - "properties": { - "response": { - "$ref": "#/components/schemas/OpenAIResponseObject" - }, - "type": { - "const": "response.completed", - "default": "response.completed", - "title": "Type", - "type": "string" - } - }, - "required": [ - "response" - ], - "title": "OpenAIResponseObjectStreamResponseCompleted", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseContentPartAdded": { - "description": "Streaming event for when a new content part is added to a response item.", - "properties": { - "content_index": { - "title": "Content Index", - "type": "integer" - }, - "response_id": { - "title": "Response Id", - "type": "string" - }, - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "part": { - "discriminator": { - "mapping": { - "output_text": "#/$defs/OpenAIResponseContentPartOutputText", - "reasoning_text": "#/$defs/OpenAIResponseContentPartReasoningText", - "refusal": "#/$defs/OpenAIResponseContentPartRefusal" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseContentPartOutputText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" - }, - { - "$ref": "#/components/schemas/OpenAIResponseContentPartReasoningText" - } - ], - "title": "Part" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.content_part.added", - "default": "response.content_part.added", - "title": "Type", - "type": "string" - } - }, - "required": [ - "content_index", - "response_id", - "item_id", - "output_index", - "part", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseContentPartAdded", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseContentPartDone": { - "description": "Streaming event for when a content part is completed.", - "properties": { - "content_index": { - "title": "Content Index", - "type": "integer" - }, - "response_id": { - "title": "Response Id", - "type": "string" - }, - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "part": { - "discriminator": { - "mapping": { - "output_text": "#/$defs/OpenAIResponseContentPartOutputText", - "reasoning_text": "#/$defs/OpenAIResponseContentPartReasoningText", - "refusal": "#/$defs/OpenAIResponseContentPartRefusal" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseContentPartOutputText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" - }, - { - "$ref": "#/components/schemas/OpenAIResponseContentPartReasoningText" - } - ], - "title": "Part" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.content_part.done", - "default": "response.content_part.done", - "title": "Type", - "type": "string" - } - }, - "required": [ - "content_index", - "response_id", - "item_id", - "output_index", - "part", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseContentPartDone", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseCreated": { - "description": "Streaming event indicating a new response has been created.", - "properties": { - "response": { - "$ref": "#/components/schemas/OpenAIResponseObject" - }, - "type": { - "const": "response.created", - "default": "response.created", - "title": "Type", - "type": "string" - } - }, - "required": [ - "response" - ], - "title": "OpenAIResponseObjectStreamResponseCreated", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseFailed": { - "description": "Streaming event emitted when a response fails.", - "properties": { - "response": { - "$ref": "#/components/schemas/OpenAIResponseObject" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.failed", - "default": "response.failed", - "title": "Type", - "type": "string" - } - }, - "required": [ - "response", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseFailed", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseFileSearchCallCompleted": { - "description": "Streaming event for completed file search calls.", - "properties": { - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.file_search_call.completed", - "default": "response.file_search_call.completed", - "title": "Type", - "type": "string" - } - }, - "required": [ - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseFileSearchCallCompleted", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseFileSearchCallInProgress": { - "description": "Streaming event for file search calls in progress.", - "properties": { - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.file_search_call.in_progress", - "default": "response.file_search_call.in_progress", - "title": "Type", - "type": "string" - } - }, - "required": [ - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseFileSearchCallInProgress", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseFileSearchCallSearching": { - "description": "Streaming event for file search currently searching.", - "properties": { - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.file_search_call.searching", - "default": "response.file_search_call.searching", - "title": "Type", - "type": "string" - } - }, - "required": [ - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseFileSearchCallSearching", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": { - "description": "Streaming event for incremental function call argument updates.", - "properties": { - "delta": { - "title": "Delta", - "type": "string" - }, - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.function_call_arguments.delta", - "default": "response.function_call_arguments.delta", - "title": "Type", - "type": "string" - } - }, - "required": [ - "delta", - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone": { - "description": "Streaming event for when function call arguments are completed.", - "properties": { - "arguments": { - "title": "Arguments", - "type": "string" - }, - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.function_call_arguments.done", - "default": "response.function_call_arguments.done", - "title": "Type", - "type": "string" - } - }, - "required": [ - "arguments", - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseInProgress": { - "description": "Streaming event indicating the response remains in progress.", - "properties": { - "response": { - "$ref": "#/components/schemas/OpenAIResponseObject" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.in_progress", - "default": "response.in_progress", - "title": "Type", - "type": "string" - } - }, - "required": [ - "response", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseInProgress", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseIncomplete": { - "description": "Streaming event emitted when a response ends in an incomplete state.", - "properties": { - "response": { - "$ref": "#/components/schemas/OpenAIResponseObject" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.incomplete", - "default": "response.incomplete", - "title": "Type", - "type": "string" - } - }, - "required": [ - "response", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseIncomplete", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta": { - "properties": { - "delta": { - "title": "Delta", - "type": "string" - }, - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.mcp_call.arguments.delta", - "default": "response.mcp_call.arguments.delta", - "title": "Type", - "type": "string" - } - }, - "required": [ - "delta", - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseMcpCallArgumentsDone": { - "properties": { - "arguments": { - "title": "Arguments", - "type": "string" - }, - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.mcp_call.arguments.done", - "default": "response.mcp_call.arguments.done", - "title": "Type", - "type": "string" - } - }, - "required": [ - "arguments", - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseMcpCallArgumentsDone", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseMcpCallCompleted": { - "description": "Streaming event for completed MCP calls.", - "properties": { - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.mcp_call.completed", - "default": "response.mcp_call.completed", - "title": "Type", - "type": "string" - } - }, - "required": [ - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseMcpCallCompleted", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseMcpCallFailed": { - "description": "Streaming event for failed MCP calls.", - "properties": { - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.mcp_call.failed", - "default": "response.mcp_call.failed", - "title": "Type", - "type": "string" - } - }, - "required": [ - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseMcpCallFailed", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseMcpCallInProgress": { - "description": "Streaming event for MCP calls in progress.", - "properties": { - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.mcp_call.in_progress", - "default": "response.mcp_call.in_progress", - "title": "Type", - "type": "string" - } - }, - "required": [ - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseMcpCallInProgress", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseMcpListToolsCompleted": { - "properties": { - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.mcp_list_tools.completed", - "default": "response.mcp_list_tools.completed", - "title": "Type", - "type": "string" - } - }, - "required": [ - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseMcpListToolsCompleted", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseMcpListToolsFailed": { - "properties": { - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.mcp_list_tools.failed", - "default": "response.mcp_list_tools.failed", - "title": "Type", - "type": "string" - } - }, - "required": [ - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseMcpListToolsFailed", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseMcpListToolsInProgress": { - "properties": { - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.mcp_list_tools.in_progress", - "default": "response.mcp_list_tools.in_progress", - "title": "Type", - "type": "string" - } - }, - "required": [ - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseMcpListToolsInProgress", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseOutputItemAdded": { - "description": "Streaming event for when a new output item is added to the response.", - "properties": { - "response_id": { - "title": "Response Id", - "type": "string" - }, - "item": { - "discriminator": { - "mapping": { - "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", - "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", - "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", - "message": "#/$defs/OpenAIResponseMessage", - "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - } - ], - "title": "Item" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.output_item.added", - "default": "response.output_item.added", - "title": "Type", - "type": "string" - } - }, - "required": [ - "response_id", - "item", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseOutputItemAdded", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseOutputItemDone": { - "description": "Streaming event for when an output item is completed.", - "properties": { - "response_id": { - "title": "Response Id", - "type": "string" - }, - "item": { - "discriminator": { - "mapping": { - "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", - "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", - "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", - "message": "#/$defs/OpenAIResponseMessage", - "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - } - ], - "title": "Item" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.output_item.done", - "default": "response.output_item.done", - "title": "Type", - "type": "string" - } - }, - "required": [ - "response_id", - "item", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseOutputItemDone", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded": { - "description": "Streaming event for when an annotation is added to output text.", - "properties": { - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "content_index": { - "title": "Content Index", - "type": "integer" - }, - "annotation_index": { - "title": "Annotation Index", - "type": "integer" - }, - "annotation": { - "discriminator": { - "mapping": { - "container_file_citation": "#/$defs/OpenAIResponseAnnotationContainerFileCitation", - "file_citation": "#/$defs/OpenAIResponseAnnotationFileCitation", - "file_path": "#/$defs/OpenAIResponseAnnotationFilePath", - "url_citation": "#/$defs/OpenAIResponseAnnotationCitation" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationFileCitation" - }, - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationCitation" - }, - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation" - }, - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationFilePath" - } - ], - "title": "Annotation" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.output_text.annotation.added", - "default": "response.output_text.annotation.added", - "title": "Type", - "type": "string" - } - }, - "required": [ - "item_id", - "output_index", - "content_index", - "annotation_index", - "annotation", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseOutputTextDelta": { - "description": "Streaming event for incremental text content updates.", - "properties": { - "content_index": { - "title": "Content Index", - "type": "integer" - }, - "delta": { - "title": "Delta", - "type": "string" - }, - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.output_text.delta", - "default": "response.output_text.delta", - "title": "Type", - "type": "string" - } - }, - "required": [ - "content_index", - "delta", - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseOutputTextDelta", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseOutputTextDone": { - "description": "Streaming event for when text output is completed.", - "properties": { - "content_index": { - "title": "Content Index", - "type": "integer" - }, - "text": { - "title": "Text", - "type": "string" - }, - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.output_text.done", - "default": "response.output_text.done", - "title": "Type", - "type": "string" - } - }, - "required": [ - "content_index", - "text", - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseOutputTextDone", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded": { - "description": "Streaming event for when a new reasoning summary part is added.", - "properties": { - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "part": { - "$ref": "#/components/schemas/OpenAIResponseContentPartReasoningSummary" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "summary_index": { - "title": "Summary Index", - "type": "integer" - }, - "type": { - "const": "response.reasoning_summary_part.added", - "default": "response.reasoning_summary_part.added", - "title": "Type", - "type": "string" - } - }, - "required": [ - "item_id", - "output_index", - "part", - "sequence_number", - "summary_index" - ], - "title": "OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseReasoningSummaryPartDone": { - "description": "Streaming event for when a reasoning summary part is completed.", - "properties": { - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "part": { - "$ref": "#/components/schemas/OpenAIResponseContentPartReasoningSummary" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "summary_index": { - "title": "Summary Index", - "type": "integer" - }, - "type": { - "const": "response.reasoning_summary_part.done", - "default": "response.reasoning_summary_part.done", - "title": "Type", - "type": "string" - } - }, - "required": [ - "item_id", - "output_index", - "part", - "sequence_number", - "summary_index" - ], - "title": "OpenAIResponseObjectStreamResponseReasoningSummaryPartDone", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta": { - "description": "Streaming event for incremental reasoning summary text updates.", - "properties": { - "delta": { - "title": "Delta", - "type": "string" - }, - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "summary_index": { - "title": "Summary Index", - "type": "integer" - }, - "type": { - "const": "response.reasoning_summary_text.delta", - "default": "response.reasoning_summary_text.delta", - "title": "Type", - "type": "string" - } - }, - "required": [ - "delta", - "item_id", - "output_index", - "sequence_number", - "summary_index" - ], - "title": "OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseReasoningSummaryTextDone": { - "description": "Streaming event for when reasoning summary text is completed.", - "properties": { - "text": { - "title": "Text", - "type": "string" - }, - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "summary_index": { - "title": "Summary Index", - "type": "integer" - }, - "type": { - "const": "response.reasoning_summary_text.done", - "default": "response.reasoning_summary_text.done", - "title": "Type", - "type": "string" - } - }, - "required": [ - "text", - "item_id", - "output_index", - "sequence_number", - "summary_index" - ], - "title": "OpenAIResponseObjectStreamResponseReasoningSummaryTextDone", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseReasoningTextDelta": { - "description": "Streaming event for incremental reasoning text updates.", - "properties": { - "content_index": { - "title": "Content Index", - "type": "integer" - }, - "delta": { - "title": "Delta", - "type": "string" - }, - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.reasoning_text.delta", - "default": "response.reasoning_text.delta", - "title": "Type", - "type": "string" - } - }, - "required": [ - "content_index", - "delta", - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseReasoningTextDelta", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseReasoningTextDone": { - "description": "Streaming event for when reasoning text is completed.", - "properties": { - "content_index": { - "title": "Content Index", - "type": "integer" - }, - "text": { - "title": "Text", - "type": "string" - }, - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.reasoning_text.done", - "default": "response.reasoning_text.done", - "title": "Type", - "type": "string" - } - }, - "required": [ - "content_index", - "text", - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseReasoningTextDone", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseRefusalDelta": { - "description": "Streaming event for incremental refusal text updates.", - "properties": { - "content_index": { - "title": "Content Index", - "type": "integer" - }, - "delta": { - "title": "Delta", - "type": "string" - }, - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.refusal.delta", - "default": "response.refusal.delta", - "title": "Type", - "type": "string" - } - }, - "required": [ - "content_index", - "delta", - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseRefusalDelta", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseRefusalDone": { - "description": "Streaming event for when refusal text is completed.", - "properties": { - "content_index": { - "title": "Content Index", - "type": "integer" - }, - "refusal": { - "title": "Refusal", - "type": "string" - }, - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.refusal.done", - "default": "response.refusal.done", - "title": "Type", - "type": "string" - } - }, - "required": [ - "content_index", - "refusal", - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseRefusalDone", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseWebSearchCallCompleted": { - "description": "Streaming event for completed web search calls.", - "properties": { - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.web_search_call.completed", - "default": "response.web_search_call.completed", - "title": "Type", - "type": "string" - } - }, - "required": [ - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseWebSearchCallCompleted", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseWebSearchCallInProgress": { - "description": "Streaming event for web search calls in progress.", - "properties": { - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.web_search_call.in_progress", - "default": "response.web_search_call.in_progress", - "title": "Type", - "type": "string" - } - }, - "required": [ - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseWebSearchCallInProgress", - "type": "object" - }, - "OpenAIResponseObjectStreamResponseWebSearchCallSearching": { - "properties": { - "item_id": { - "title": "Item Id", - "type": "string" - }, - "output_index": { - "title": "Output Index", - "type": "integer" - }, - "sequence_number": { - "title": "Sequence Number", - "type": "integer" - }, - "type": { - "const": "response.web_search_call.searching", - "default": "response.web_search_call.searching", - "title": "Type", - "type": "string" - } - }, - "required": [ - "item_id", - "output_index", - "sequence_number" - ], - "title": "OpenAIResponseObjectStreamResponseWebSearchCallSearching", - "type": "object" - }, - "OpenAIResponseObjectWithInput": { - "description": "OpenAI response object extended with input context information.", - "properties": { - "created_at": { - "title": "Created At", - "type": "integer" - }, - "error": { - "$ref": "#/components/schemas/OpenAIResponseError", - "nullable": true - }, - "id": { - "title": "Id", - "type": "string" - }, - "model": { - "title": "Model", - "type": "string" - }, - "object": { - "const": "response", - "default": "response", - "title": "Object", - "type": "string" - }, - "output": { - "items": { - "discriminator": { - "mapping": { - "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", - "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", - "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", - "message": "#/$defs/OpenAIResponseMessage", - "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - } - ] - }, - "title": "Output", - "type": "array" - }, - "parallel_tool_calls": { - "default": false, - "title": "Parallel Tool Calls", - "type": "boolean" - }, - "previous_response_id": { - "title": "Previous Response Id", - "type": "string", - "nullable": true - }, - "prompt": { - "$ref": "#/components/schemas/OpenAIResponsePrompt", - "nullable": true - }, - "status": { - "title": "Status", - "type": "string" - }, - "temperature": { - "title": "Temperature", - "type": "number", - "nullable": true - }, - "text": { - "$ref": "#/components/schemas/OpenAIResponseText", - "default": { - "format": { - "type": "text" - } - } - }, - "top_p": { - "title": "Top P", - "type": "number", - "nullable": true - }, - "tools": { - "title": "Tools", - "items": { - "discriminator": { - "mapping": { - "file_search": "#/$defs/OpenAIResponseInputToolFileSearch", - "function": "#/$defs/OpenAIResponseInputToolFunction", - "mcp": "#/$defs/OpenAIResponseToolMCP", - "web_search": "#/$defs/OpenAIResponseInputToolWebSearch", - "web_search_preview": "#/$defs/OpenAIResponseInputToolWebSearch", - "web_search_preview_2025_03_11": "#/$defs/OpenAIResponseInputToolWebSearch" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" - }, - { - "$ref": "#/components/schemas/OpenAIResponseToolMCP" - } - ] - }, - "type": "array", - "nullable": true - }, - "truncation": { - "title": "Truncation", - "type": "string", - "nullable": true - }, - "usage": { - "$ref": "#/components/schemas/OpenAIResponseUsage", - "nullable": true - }, - "instructions": { - "title": "Instructions", - "type": "string", - "nullable": true - }, - "input": { - "items": { - "anyOf": [ - { - "discriminator": { - "mapping": { - "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", - "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", - "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", - "message": "#/$defs/OpenAIResponseMessage", - "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - } - ] - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - } - ] - }, - "title": "Input", - "type": "array" - } - }, - "required": [ - "created_at", - "id", - "model", - "output", - "status", - "input" - ], - "title": "OpenAIResponseObjectWithInput", - "type": "object" - }, - "ImageContentItem": { - "description": "A image content item", - "properties": { - "type": { - "const": "image", - "default": "image", - "title": "Type", - "type": "string" - }, - "image": { - "$ref": "#/components/schemas/_URLOrData" - } - }, - "required": [ - "image" - ], - "title": "ImageContentItem", - "type": "object" - }, - "ImageDelta": { - "description": "An image content delta for streaming responses.", - "properties": { - "type": { - "const": "image", - "default": "image", - "title": "Type", - "type": "string" - }, - "image": { - "format": "binary", - "title": "Image", - "type": "string" - } - }, - "required": [ - "image" - ], - "title": "ImageDelta", - "type": "object" - }, - "TextDelta": { - "description": "A text content delta for streaming responses.", - "properties": { - "type": { - "const": "text", - "default": "text", - "title": "Type", - "type": "string" - }, - "text": { - "title": "Text", - "type": "string" - } - }, - "required": [ - "text" - ], - "title": "TextDelta", - "type": "object" - }, - "ToolCallDelta": { - "description": "A tool call content delta for streaming responses.", - "properties": { - "type": { - "const": "tool_call", - "default": "tool_call", - "title": "Type", - "type": "string" - }, - "tool_call": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/ToolCall" - } - ], - "title": "Tool Call" - }, - "parse_status": { - "$ref": "#/components/schemas/ToolCallParseStatus" - } - }, - "required": [ - "tool_call", - "parse_status" - ], - "title": "ToolCallDelta", - "type": "object" - }, - "PostTrainingMetric": { - "description": "Training metrics captured during post-training jobs.", - "properties": { - "epoch": { - "title": "Epoch", - "type": "integer" - }, - "train_loss": { - "title": "Train Loss", - "type": "number" - }, - "validation_loss": { - "title": "Validation Loss", - "type": "number" - }, - "perplexity": { - "title": "Perplexity", - "type": "number" - } - }, - "required": [ - "epoch", - "train_loss", - "validation_loss", - "perplexity" - ], - "title": "PostTrainingMetric", - "type": "object" - }, - "DialogType": { - "description": "Parameter type for dialog data with semantic output labels.", - "properties": { - "type": { - "const": "dialog", - "default": "dialog", - "title": "Type", - "type": "string" - } - }, - "title": "DialogType", - "type": "object" - }, - "ConversationMessage": { - "description": "OpenAI-compatible message item for conversations.", - "properties": { - "id": { - "description": "unique identifier for this message", - "title": "Id", - "type": "string" - }, - "content": { - "description": "message content", - "items": { - "additionalProperties": true, - "type": "object" - }, - "title": "Content", - "type": "array" - }, - "role": { - "description": "message role", - "title": "Role", - "type": "string" - }, - "status": { - "description": "message status", - "title": "Status", - "type": "string" - }, - "type": { - "const": "message", - "default": "message", - "title": "Type", - "type": "string" - }, - "object": { - "const": "message", - "default": "message", - "title": "Object", - "type": "string" - } - }, - "required": [ - "id", - "content", - "role", - "status" - ], - "title": "ConversationMessage", - "type": "object" - }, - "_agents_agent_id_session_Request": { - "properties": { - "agent_id": { - "title": "Agent Id", - "type": "string" - }, - "session_name": { - "title": "Session Name", - "type": "string" - } - }, - "required": [ - "agent_id", - "session_name" - ], - "title": "_agents_agent_id_session_Request", - "type": "object" - }, - "_agents_agent_id_session_session_id_turn_Request": { - "properties": { - "agent_id": { - "title": "Agent Id", - "type": "string" - }, - "session_id": { - "title": "Session Id", - "type": "string" - }, - "messages": { - "$ref": "#/components/schemas/UserMessage" - }, - "stream": { - "default": false, - "title": "Stream", - "type": "boolean" - }, - "documents": { - "$ref": "#/components/schemas/Document" - }, - "toolgroups": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/AgentToolGroupWithArgs" - } - ], - "title": "Toolgroups" - }, - "tool_config": { - "$ref": "#/components/schemas/ToolConfig" - } - }, - "required": [ - "agent_id", - "session_id", - "messages", - "documents", - "toolgroups", - "tool_config" - ], - "title": "_agents_agent_id_session_session_id_turn_Request", - "type": "object" - }, - "_agents_agent_id_session_session_id_turn_turn_id_resume_Request": { - "properties": { - "agent_id": { - "title": "Agent Id", - "type": "string" - }, - "session_id": { - "title": "Session Id", - "type": "string" - }, - "turn_id": { - "title": "Turn Id", - "type": "string" - }, - "tool_responses": { - "$ref": "#/components/schemas/ToolResponse" - }, - "stream": { - "default": false, - "title": "Stream", - "type": "boolean" - } - }, - "required": [ - "agent_id", - "session_id", - "turn_id", - "tool_responses" - ], - "title": "_agents_agent_id_session_session_id_turn_turn_id_resume_Request", - "type": "object" - }, - "_safety_run_shield_Request": { - "properties": { - "shield_id": { - "title": "Shield Id", - "type": "string" - }, - "messages": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAIUserMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAISystemMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIAssistantMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIToolMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" - } - ], - "title": "Messages" - }, - "params": { - "title": "Params", - "type": "string" - } - }, - "required": [ - "shield_id", - "messages", - "params" - ], - "title": "_safety_run_shield_Request", - "type": "object" - }, - "_datasets_Request": { - "properties": { - "purpose": { - "$ref": "#/components/schemas/DatasetPurpose" - }, - "metadata": { - "title": "Metadata", - "type": "string" - }, - "dataset_id": { - "title": "Dataset Id", - "type": "string" - } - }, - "required": [ - "purpose", - "metadata", - "dataset_id" - ], - "title": "_datasets_Request", - "type": "object" - }, - "Attachment": { - "description": "An attachment to an agent turn.", - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - { - "items": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - "type": "array" - }, - { - "$ref": "#/components/schemas/URL" - } - ], - "title": "Content" - }, - "mime_type": { - "title": "Mime Type", - "type": "string" - } - }, - "required": [ - "content", - "mime_type" - ], - "title": "Attachment", - "type": "object" - }, - "StepType": { - "description": "Type of the step in an agent turn.", - "enum": [ - "inference", - "tool_execution", - "shield_call", - "memory_retrieval" - ], - "title": "StepType", - "type": "string" - }, - "ToolCallParseStatus": { - "description": "Status of tool call parsing during streaming.", - "enum": [ - "started", - "in_progress", - "failed", - "succeeded" - ], - "title": "ToolCallParseStatus", - "type": "string" - }, - "LogProbConfig": { - "description": ":param top_k: How many tokens (for each position) to return log probabilities for.", - "properties": { - "top_k": { - "default": 0, - "title": "Top K", - "type": "integer" - } - }, - "title": "LogProbConfig", - "type": "object" - }, - "ToolDefinition": { - "properties": { - "tool_name": { - "anyOf": [ - { - "$ref": "#/components/schemas/BuiltinTool" - }, - { - "type": "string" - } - ], - "title": "Tool Name" - }, - "description": { - "title": "Description", - "type": "string", - "nullable": true - }, - "input_schema": { - "title": "Input Schema", - "additionalProperties": true, - "type": "object", - "nullable": true - }, - "output_schema": { - "title": "Output Schema", - "additionalProperties": true, - "type": "object", - "nullable": true - } - }, - "required": [ - "tool_name" - ], - "title": "ToolDefinition", - "type": "object" - }, - "MetricInResponse": { - "description": "A metric value included in API responses.", - "properties": { - "metric": { - "title": "Metric", - "type": "string" - }, - "value": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "number" - } - ], - "title": "Value" - }, - "unit": { - "title": "Unit", - "type": "string", - "nullable": true - } - }, - "required": [ - "metric", - "value" - ], - "title": "MetricInResponse", - "type": "object" - }, - "ChatCompletionResponseEventType": { - "description": "Types of events that can occur during chat completion.", - "enum": [ - "start", - "complete", - "progress" - ], - "title": "ChatCompletionResponseEventType", - "type": "string" - }, - "RLHFAlgorithm": { - "description": "Available reinforcement learning from human feedback algorithms.", - "enum": [ - "dpo" - ], - "title": "RLHFAlgorithm", - "type": "string" - }, - "FilteringFunction": { - "description": "The type of filtering function.", - "enum": [ - "none", - "random", - "top_k", - "top_p", - "top_k_top_p", - "sigmoid" - ], - "title": "FilteringFunction", - "type": "string" - } - }, - "responses": { - "BadRequest400": { - "description": "The request was invalid or malformed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - }, - "example": { - "status": 400, - "title": "Bad Request", - "detail": "The request was invalid or malformed" - } - } - } - }, - "TooManyRequests429": { - "description": "The client has sent too many requests in a given amount of time", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - }, - "example": { - "status": 429, - "title": "Too Many Requests", - "detail": "You have exceeded the rate limit. Please try again later." - } - } - } - }, - "InternalServerError500": { - "description": "The server encountered an unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - }, - "example": { - "status": 500, - "title": "Internal Server Error", - "detail": "An unexpected error occurred. Our team has been notified." - } - } - } - }, - "DefaultError": { - "description": "An unexpected error occurred", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - } - } -} \ No newline at end of file diff --git a/docs/static/deprecated-llama-stack-spec.yaml b/docs/static/deprecated-llama-stack-spec.yaml index 0526e24df9..964cfe0656 100644 --- a/docs/static/deprecated-llama-stack-spec.yaml +++ b/docs/static/deprecated-llama-stack-spec.yaml @@ -4,81 +4,28313 @@ info: description: A comprehensive API for building and deploying AI applications version: 1.0.0 servers: - - url: http://any-hosted-llama-stack.com -paths: {} -jsonSchemaDialect: >- - https://json-schema.org/draft/2020-12/schema +- url: https://api.llamastack.com + description: Production server +- url: https://staging-api.llamastack.com + description: Staging server +paths: + /v1/agents: + get: + tags: + - Agents + summary: List all agents. + description: List all agents. + operationId: list_agents_v1_agents_get + deprecated: true + parameters: + - name: start_index + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The index to start the pagination from. + title: Start Index + description: The index to start the pagination from. + - name: limit + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The number of agents to return. + title: Limit + description: The number of agents to return. + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - Agents + summary: Create an agent. + description: Create an agent with the given configuration. + operationId: create_agent_v1_agents_post + deprecated: true + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AgentConfig-Input' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentCreateResponse' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/agents/{agent_id}: + delete: + tags: + - Agents + summary: Delete an agent. + description: Delete an agent by its ID. + operationId: delete_agent_v1_agents__agent_id__delete + deprecated: true + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to delete. + title: Agent Id + description: The ID of the agent to delete. + responses: + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - Agents + summary: Describe an agent. + description: Describe an agent by its ID. + operationId: get_agent_v1_agents__agent_id__get + deprecated: true + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: ID of the agent. + title: Agent Id + description: ID of the agent. + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Agent' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/agents/{agent_id}/session: + post: + tags: + - Agents + summary: Create a new session for an agent. + description: Create a new session for an agent. + operationId: create_agent_session_v1_agents__agent_id__session_post + deprecated: true + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to create the session for. + title: Agent Id + description: The ID of the agent to create the session for. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAgentSessionRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentSessionCreateResponse' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/agents/{agent_id}/session/{session_id}: + delete: + tags: + - Agents + summary: Delete an agent session. + description: Delete an agent session by its ID. + operationId: delete_agents_session_v1_agents__agent_id__session__session_id__delete + deprecated: true + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to delete the session for. + title: Agent Id + description: The ID of the agent to delete the session for. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to delete. + title: Session Id + description: The ID of the session to delete. + responses: + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - Agents + summary: Retrieve an agent session. + description: Retrieve an agent session by its ID. + operationId: get_agents_session_v1_agents__agent_id__session__session_id__get + deprecated: true + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to get the session for. + title: Agent Id + description: The ID of the agent to get the session for. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to get. + title: Session Id + description: The ID of the session to get. + - name: turn_ids + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + - type: 'null' + description: List of turn IDs to filter the session by. + title: Turn Ids + description: List of turn IDs to filter the session by. + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Session' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/agents/{agent_id}/session/{session_id}/turn: + post: + tags: + - Agents + summary: Create a new turn for an agent. + description: Create a new turn for an agent. + operationId: create_agent_turn_v1_agents__agent_id__session__session_id__turn_post + deprecated: true + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to create the turn for. + title: Agent Id + description: The ID of the agent to create the turn for. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to create the turn for. + title: Session Id + description: The ID of the session to create the turn for. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTurnCreateRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/agents/{agent_id}/session/{session_id}/turn/{turn_id}: + get: + tags: + - Agents + summary: Retrieve an agent turn. + description: Retrieve an agent turn by its ID. + operationId: get_agents_turn_v1_agents__agent_id__session__session_id__turn__turn_id__get + deprecated: true + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to get the turn for. + title: Agent Id + description: The ID of the agent to get the turn for. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to get the turn for. + title: Session Id + description: The ID of the session to get the turn for. + - name: turn_id + in: path + required: true + schema: + type: string + description: The ID of the turn to get. + title: Turn Id + description: The ID of the turn to get. + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Turn' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume: + post: + tags: + - Agents + summary: Resume an agent turn. + description: Resume an agent turn with executed tool call responses. + operationId: resume_agent_turn_v1_agents__agent_id__session__session_id__turn__turn_id__resume_post + deprecated: true + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to resume. + title: Agent Id + description: The ID of the agent to resume. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to resume. + title: Session Id + description: The ID of the session to resume. + - name: turn_id + in: path + required: true + schema: + type: string + description: The ID of the turn to resume. + title: Turn Id + description: The ID of the turn to resume. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTurnResumeRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}: + get: + tags: + - Agents + summary: Retrieve an agent step. + description: Retrieve an agent step by its ID. + operationId: get_agents_step_v1_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get + deprecated: true + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to get the step for. + title: Agent Id + description: The ID of the agent to get the step for. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to get the step for. + title: Session Id + description: The ID of the session to get the step for. + - name: turn_id + in: path + required: true + schema: + type: string + description: The ID of the turn to get the step for. + title: Turn Id + description: The ID of the turn to get the step for. + - name: step_id + in: path + required: true + schema: + type: string + description: The ID of the step to get. + title: Step Id + description: The ID of the step to get. + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/AgentStepResponse' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/agents/{agent_id}/sessions: + get: + tags: + - Agents + summary: List all sessions of an agent. + description: List all session(s) of a given agent. + operationId: list_agent_sessions_v1_agents__agent_id__sessions_get + deprecated: true + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to list sessions for. + title: Agent Id + description: The ID of the agent to list sessions for. + - name: start_index + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The index to start the pagination from. + title: Start Index + description: The index to start the pagination from. + - name: limit + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The number of sessions to return. + title: Limit + description: The number of sessions to return. + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/datasets: + get: + tags: + - Datasets + summary: List all datasets + description: List all datasets + operationId: list_datasets_v1_datasets_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ListDatasetsResponse' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + deprecated: true + post: + tags: + - Datasets + summary: Register a new dataset + description: Register a new dataset + operationId: register_dataset_v1_datasets_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterDatasetRequest' + required: true + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Dataset' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + deprecated: true + /v1/datasets/{dataset_id}: + delete: + tags: + - Datasets + summary: Unregister a dataset by its ID + description: Unregister a dataset by its ID + operationId: unregister_dataset_v1_datasets__dataset_id__delete + deprecated: true + parameters: + - name: dataset_id + in: path + required: true + schema: + type: string + description: The ID of the dataset to unregister + title: Dataset Id + description: The ID of the dataset to unregister + responses: + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - Datasets + summary: Get a dataset by its ID + description: Get a dataset by its ID + operationId: get_dataset_v1_datasets__dataset_id__get + deprecated: true + parameters: + - name: dataset_id + in: path + required: true + schema: + type: string + description: The ID of the dataset to get + title: Dataset Id + description: The ID of the dataset to get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Dataset' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/eval/benchmarks: + get: + tags: + - Benchmarks + summary: List all benchmarks + description: List all benchmarks + operationId: list_benchmarks_v1_eval_benchmarks_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ListBenchmarksResponse' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + deprecated: true + post: + tags: + - Benchmarks + summary: Register a benchmark + description: Register a benchmark + operationId: register_benchmark_v1_eval_benchmarks_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterBenchmarkRequest' + required: true + responses: + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + deprecated: true + /v1/eval/benchmarks/{benchmark_id}: + delete: + tags: + - Benchmarks + summary: Unregister a benchmark + description: Unregister a benchmark + operationId: unregister_benchmark_v1_eval_benchmarks__benchmark_id__delete + deprecated: true + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to unregister + title: Benchmark Id + description: The ID of the benchmark to unregister + responses: + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - Benchmarks + summary: Get a benchmark by its ID + description: Get a benchmark by its ID + operationId: get_benchmark_v1_eval_benchmarks__benchmark_id__get + deprecated: true + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to get + title: Benchmark Id + description: The ID of the benchmark to get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Benchmark' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/eval/benchmarks/{benchmark_id}/evaluations: + post: + tags: + - Eval + summary: Evaluate a list of rows on a benchmark + description: Evaluate a list of rows on a benchmark + operationId: evaluate_rows_v1_eval_benchmarks__benchmark_id__evaluations_post + deprecated: true + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EvaluateRowsRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/EvaluateResponse' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/eval/benchmarks/{benchmark_id}/jobs: + post: + tags: + - Eval + summary: Run an evaluation on a benchmark + description: Run an evaluation on a benchmark + operationId: run_eval_v1_eval_benchmarks__benchmark_id__jobs_post + deprecated: true + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BenchmarkConfig' + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Job' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/eval/benchmarks/{benchmark_id}/jobs/{job_id}: + delete: + tags: + - Eval + summary: Cancel a job + description: Cancel a job + operationId: job_cancel_v1_eval_benchmarks__benchmark_id__jobs__job_id__delete + deprecated: true + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on + - name: job_id + in: path + required: true + schema: + type: string + description: The ID of the job to cancel + title: Job Id + description: The ID of the job to cancel + responses: + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - Eval + summary: Get the status of a job + description: Get the status of a job + operationId: job_status_v1_eval_benchmarks__benchmark_id__jobs__job_id__get + deprecated: true + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on + - name: job_id + in: path + required: true + schema: + type: string + description: The ID of the job to get the status of + title: Job Id + description: The ID of the job to get the status of + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Job' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result: + get: + tags: + - Eval + summary: Get the result of a job + description: Get the result of a job + operationId: job_result_v1_eval_benchmarks__benchmark_id__jobs__job_id__result_get + deprecated: true + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on + - name: job_id + in: path + required: true + schema: + type: string + description: The ID of the job to get the result of + title: Job Id + description: The ID of the job to get the result of + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/EvaluateResponse' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/post-training/job/artifacts: + get: + tags: + - Post Training + summary: Get the artifacts of a training job + description: Get the artifacts of a training job + operationId: get_training_job_artifacts_v1_post_training_job_artifacts_get + deprecated: true + parameters: + - name: job_uuid + in: query + required: true + schema: + type: string + description: The UUID of the job to get the artifacts of + title: Job Uuid + description: The UUID of the job to get the artifacts of + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/PostTrainingJobArtifactsResponse' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/post-training/job/cancel: + post: + tags: + - Post Training + summary: Cancel a training job + description: Cancel a training job + operationId: cancel_training_job_v1_post_training_job_cancel_post + deprecated: true + parameters: + - name: job_uuid + in: query + required: true + schema: + type: string + description: The UUID of the job to cancel + title: Job Uuid + description: The UUID of the job to cancel + responses: + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/post-training/job/status: + get: + tags: + - Post Training + summary: Get the status of a training job + description: Get the status of a training job + operationId: get_training_job_status_v1_post_training_job_status_get + deprecated: true + parameters: + - name: job_uuid + in: query + required: true + schema: + type: string + description: The UUID of the job to get the status of + title: Job Uuid + description: The UUID of the job to get the status of + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/PostTrainingJobStatusResponse' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/post-training/jobs: + get: + tags: + - Post Training + summary: Get all training jobs + description: Get all training jobs + operationId: get_training_jobs_v1_post_training_jobs_get + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/ListPostTrainingJobsResponse' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + deprecated: true + /v1/post-training/preference-optimize: + post: + tags: + - Post Training + summary: Run preference optimization of a model + description: Run preference optimization of a model + operationId: preference_optimize_v1_post_training_preference_optimize_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PreferenceOptimizeRequest' + required: true + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/PostTrainingJob' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + deprecated: true + /v1/post-training/supervised-fine-tune: + post: + tags: + - Post Training + summary: Run supervised fine-tuning of a model + description: Run supervised fine-tuning of a model + operationId: supervised_fine_tune_v1_post_training_supervised_fine_tune_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SupervisedFineTuneRequest' + required: true + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/PostTrainingJob' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + deprecated: true components: schemas: - Error: + Agent: + properties: + agent_id: + type: string + title: Agent Id + description: Unique identifier for the agent + agent_config: + $ref: '#/components/schemas/AgentConfig-Output' + description: Configuration settings for the agent + created_at: + type: string + format: date-time + title: Created At + description: Timestamp when the agent was created + type: object + required: + - agent_id + - agent_config + - created_at + title: Agent + description: An agent instance with configuration and metadata. + AgentCandidate: + properties: + type: + type: string + const: agent + title: Type + description: The type of candidate. + default: agent + config: + $ref: '#/components/schemas/AgentConfig-Input' + description: The configuration for the agent candidate. + type: object + required: + - config + title: AgentCandidate + description: An agent candidate for evaluation. + AgentConfig-Input: + properties: + sampling_params: + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' + input_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Input Shields + output_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields + toolgroups: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups + client_tools: + anyOf: + - items: + $ref: '#/components/schemas/ToolDef' + type: array + - type: 'null' + title: Client Tools + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: 'null' + deprecated: true + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + deprecated: true + tool_config: + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' + max_infer_iters: + anyOf: + - type: integer + - type: 'null' + title: Max Infer Iters + default: 10 + model: + type: string + title: Model + description: The model identifier to use for the agent + instructions: + type: string + title: Instructions + description: The system instructions for the agent + name: + anyOf: + - type: string + - type: 'null' + title: Name + description: Optional name for the agent, used in telemetry and identification + enable_session_persistence: + anyOf: + - type: boolean + - type: 'null' + title: Enable Session Persistence + description: Optional flag indicating whether session data has to be persisted + default: false + response_format: + anyOf: + - oneOf: + - $ref: '#/components/schemas/JsonSchemaResponseFormat' + - $ref: '#/components/schemas/GrammarResponseFormat' + discriminator: + propertyName: type + mapping: + grammar: '#/components/schemas/GrammarResponseFormat' + json_schema: '#/components/schemas/JsonSchemaResponseFormat' + - type: 'null' + title: Response Format + description: Optional response format configuration + type: object + required: + - model + - instructions + title: AgentConfig + description: Configuration for an agent. + AgentConfig-Output: + properties: + sampling_params: + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' + input_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Input Shields + output_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields + toolgroups: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups + client_tools: + anyOf: + - items: + $ref: '#/components/schemas/ToolDef' + type: array + - type: 'null' + title: Client Tools + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: 'null' + deprecated: true + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + deprecated: true + tool_config: + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' + max_infer_iters: + anyOf: + - type: integer + - type: 'null' + title: Max Infer Iters + default: 10 + model: + type: string + title: Model + description: The model identifier to use for the agent + instructions: + type: string + title: Instructions + description: The system instructions for the agent + name: + anyOf: + - type: string + - type: 'null' + title: Name + description: Optional name for the agent, used in telemetry and identification + enable_session_persistence: + anyOf: + - type: boolean + - type: 'null' + title: Enable Session Persistence + description: Optional flag indicating whether session data has to be persisted + default: false + response_format: + anyOf: + - oneOf: + - $ref: '#/components/schemas/JsonSchemaResponseFormat' + - $ref: '#/components/schemas/GrammarResponseFormat' + discriminator: + propertyName: type + mapping: + grammar: '#/components/schemas/GrammarResponseFormat' + json_schema: '#/components/schemas/JsonSchemaResponseFormat' + - type: 'null' + title: Response Format + description: Optional response format configuration + type: object + required: + - model + - instructions + title: AgentConfig + description: Configuration for an agent. + AgentCreateResponse: + properties: + agent_id: + type: string + title: Agent Id + description: Unique identifier for the created agent + type: object + required: + - agent_id + title: AgentCreateResponse + description: Response returned when creating a new agent. + AgentSessionCreateResponse: + properties: + session_id: + type: string + title: Session Id + description: Unique identifier for the created session + type: object + required: + - session_id + title: AgentSessionCreateResponse + description: Response returned when creating a new agent session. + AgentStepResponse: + properties: + step: + oneOf: + - $ref: '#/components/schemas/InferenceStep-Output' + - $ref: '#/components/schemas/ToolExecutionStep-Output' + - $ref: '#/components/schemas/ShieldCallStep-Output' + - $ref: '#/components/schemas/MemoryRetrievalStep-Output' + title: Step + description: The complete step data and execution details + discriminator: + propertyName: step_type + mapping: + inference: '#/components/schemas/InferenceStep-Output' + memory_retrieval: '#/components/schemas/MemoryRetrievalStep-Output' + shield_call: '#/components/schemas/ShieldCallStep-Output' + tool_execution: '#/components/schemas/ToolExecutionStep-Output' type: object + required: + - step + title: AgentStepResponse + description: Response containing details of a specific agent step. + AgentToolGroupWithArgs: + properties: + name: + type: string + title: Name + args: + additionalProperties: true + type: object + title: Args + type: object + required: + - name + - args + title: AgentToolGroupWithArgs + AgentTurnCreateRequest: + properties: + sampling_params: + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' + input_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Input Shields + output_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields + toolgroups: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups + description: List of tool groups to make available for this turn + client_tools: + anyOf: + - items: + $ref: '#/components/schemas/ToolDef' + type: array + - type: 'null' + title: Client Tools + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: 'null' + deprecated: true + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + deprecated: true + tool_config: + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' + description: Tool configuration to override agent defaults + max_infer_iters: + anyOf: + - type: integer + - type: 'null' + title: Max Infer Iters + default: 10 + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + agent_id: + type: string + title: Agent Id + description: Unique identifier for the agent + session_id: + type: string + title: Session Id + description: Unique identifier for the conversation session + messages: + items: + anyOf: + - $ref: '#/components/schemas/UserMessage-Input' + - $ref: '#/components/schemas/ToolResponseMessage-Input' + type: array + title: Messages + description: List of messages to start the turn with + documents: + anyOf: + - items: + $ref: '#/components/schemas/Document' + type: array + - type: 'null' + title: Documents + description: List of documents to provide to the agent + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + description: Whether to stream the response + default: false + type: object + required: + - agent_id + - session_id + - messages + title: AgentTurnCreateRequest + description: Request to create a new turn for an agent. + AgentTurnInputType: + properties: + type: + type: string + const: agent_turn_input + title: Type + default: agent_turn_input + type: object + title: AgentTurnInputType + description: "Parameter type for agent turn input.\n\n:param type: Discriminator type. Always \"agent_turn_input\"" + AgentTurnResumeRequest: + properties: + agent_id: + type: string + title: Agent Id + description: Unique identifier for the agent + session_id: + type: string + title: Session Id + description: Unique identifier for the conversation session + turn_id: + type: string + title: Turn Id + description: Unique identifier for the turn within a session + tool_responses: + items: + $ref: '#/components/schemas/ToolResponse-Input' + type: array + title: Tool Responses + description: List of tool responses to submit to continue the turn + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + description: Whether to stream the response + default: false + type: object + required: + - agent_id + - session_id + - turn_id + - tool_responses + title: AgentTurnResumeRequest + description: Request to resume an agent turn with tool responses. + AggregationFunctionType: + type: string + enum: + - average + - weighted_average + - median + - categorical_count + - accuracy + title: AggregationFunctionType + description: Types of aggregation functions for scoring results. + AllowedToolsFilter: + properties: + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Tool Names + description: List of specific tool names that are allowed + type: object + title: AllowedToolsFilter + description: "Filter configuration for restricting which MCP tools can be used.\n\n:param tool_names: (Optional) List of specific tool names that are allowed" + ApprovalFilter: + properties: + always: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Always + description: List of tool names that always require approval + never: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Never + description: List of tool names that never require approval + type: object + title: ApprovalFilter + description: "Filter configuration for MCP tool approval requirements.\n\n:param always: (Optional) List of tool names that always require approval\n:param never: (Optional) List of tool names that never require approval" + ArrayType: + properties: + type: + type: string + const: array + title: Type + default: array + type: object + title: ArrayType + description: "Parameter type for array values.\n\n:param type: Discriminator type. Always \"array\"" + Attachment-Input: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + title: Content + description: The content of the attachment. + mime_type: + type: string + title: Mime Type + description: The MIME type of the attachment. + type: object + required: + - content + - mime_type + title: Attachment + description: An attachment to an agent turn. + Attachment-Output: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + title: Content + description: The content of the attachment. + mime_type: + type: string + title: Mime Type + description: The MIME type of the attachment. + type: object + required: + - content + - mime_type + title: Attachment + description: An attachment to an agent turn. + BasicScoringFnParams: + properties: + type: + type: string + const: basic + title: Type + default: basic + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row + type: object + title: BasicScoringFnParams + description: Parameters for basic scoring function configuration. + Batch: properties: + id: + type: string + title: Id + completion_window: + type: string + title: Completion Window + created_at: + type: integer + title: Created At + endpoint: + type: string + title: Endpoint + input_file_id: + type: string + title: Input File Id + object: + type: string + const: batch + title: Object status: + type: string + enum: + - validating + - failed + - in_progress + - finalizing + - completed + - expired + - cancelling + - cancelled + title: Status + cancelled_at: + anyOf: + - type: integer + - type: 'null' + title: Cancelled At + cancelling_at: + anyOf: + - type: integer + - type: 'null' + title: Cancelling At + completed_at: + anyOf: + - type: integer + - type: 'null' + title: Completed At + error_file_id: + anyOf: + - type: string + - type: 'null' + title: Error File Id + errors: + anyOf: + - $ref: '#/components/schemas/Errors' + - type: 'null' + expired_at: + anyOf: + - type: integer + - type: 'null' + title: Expired At + expires_at: + anyOf: + - type: integer + - type: 'null' + title: Expires At + failed_at: + anyOf: + - type: integer + - type: 'null' + title: Failed At + finalizing_at: + anyOf: + - type: integer + - type: 'null' + title: Finalizing At + in_progress_at: + anyOf: + - type: integer + - type: 'null' + title: In Progress At + metadata: + anyOf: + - additionalProperties: + type: string + type: object + - type: 'null' + title: Metadata + model: + anyOf: + - type: string + - type: 'null' + title: Model + output_file_id: + anyOf: + - type: string + - type: 'null' + title: Output File Id + request_counts: + anyOf: + - $ref: '#/components/schemas/BatchRequestCounts' + - type: 'null' + usage: + anyOf: + - $ref: '#/components/schemas/BatchUsage' + - type: 'null' + additionalProperties: true + type: object + required: + - id + - completion_window + - created_at + - endpoint + - input_file_id + - object + - status + title: Batch + BatchError: + properties: + code: + anyOf: + - type: string + - type: 'null' + title: Code + line: + anyOf: + - type: integer + - type: 'null' + title: Line + message: + anyOf: + - type: string + - type: 'null' + title: Message + param: + anyOf: + - type: string + - type: 'null' + title: Param + additionalProperties: true + type: object + title: BatchError + BatchRequestCounts: + properties: + completed: type: integer - description: HTTP status code - title: + title: Completed + failed: + type: integer + title: Failed + total: + type: integer + title: Total + additionalProperties: true + type: object + required: + - completed + - failed + - total + title: BatchRequestCounts + BatchUsage: + properties: + input_tokens: + type: integer + title: Input Tokens + input_tokens_details: + $ref: '#/components/schemas/InputTokensDetails' + output_tokens: + type: integer + title: Output Tokens + output_tokens_details: + $ref: '#/components/schemas/OutputTokensDetails' + total_tokens: + type: integer + title: Total Tokens + additionalProperties: true + type: object + required: + - input_tokens + - input_tokens_details + - output_tokens + - output_tokens_details + - total_tokens + title: BatchUsage + Benchmark: + properties: + identifier: type: string - description: >- - Error title, a short summary of the error which is invariant for an error - type - detail: + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: type: string - description: >- - Error detail, a longer human-readable description of the error - instance: + title: Provider Id + description: ID of the provider that owns this resource + type: type: string - description: >- - (Optional) A URL which can be used to retrieve more information about - the specific occurrence of the error - additionalProperties: false + const: benchmark + title: Type + description: The resource type, always benchmark + default: benchmark + dataset_id: + type: string + title: Dataset Id + description: The ID of the dataset to use for the benchmark + scoring_functions: + items: + type: string + type: array + title: Scoring Functions + description: The scoring functions to use for the benchmark + metadata: + additionalProperties: true + type: object + title: Metadata + description: Metadata for this evaluation task + type: object required: - - status - - title - - detail - title: Error - description: >- - Error response from the API. Roughly follows RFC 7807. - responses: - BadRequest400: - description: The request was invalid or malformed - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 400 - title: Bad Request - detail: The request was invalid or malformed - TooManyRequests429: - description: The client has sent too many requests in a given amount of time - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 429 - title: Too Many Requests - detail: You have exceeded the rate limit. Please try again later. - InternalServerError500: - description: The server encountered an unexpected error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 500 - title: Internal Server Error - detail: An unexpected error occurred. Our team has been notified. - DefaultError: - description: An unexpected error occurred - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 0 - title: Error - detail: An unexpected error occurred -security: - - Default: [] -tags: [] + - identifier + - provider_id + - dataset_id + - scoring_functions + title: Benchmark + description: A benchmark resource for evaluating model performance. + BenchmarkConfig: + properties: + eval_candidate: + oneOf: + - $ref: '#/components/schemas/ModelCandidate' + - $ref: '#/components/schemas/AgentCandidate' + title: Eval Candidate + description: The candidate to evaluate. + discriminator: + propertyName: type + mapping: + agent: '#/components/schemas/AgentCandidate' + model: '#/components/schemas/ModelCandidate' + scoring_params: + additionalProperties: + oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + type: object + title: Scoring Params + description: Map between scoring function id and parameters for each scoring function you want to run. + num_examples: + anyOf: + - type: integer + - type: 'null' + title: Num Examples + description: The number of examples to evaluate. If not provided, all examples in the dataset will be evaluated. + type: object + required: + - eval_candidate + title: BenchmarkConfig + description: A benchmark configuration for evaluation. + Body_openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post: + properties: + file_id: + type: string + title: File Id + description: The ID of the file to attach to the vector store. + attributes: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Attributes + description: The key-value attributes stored with the file, which can be used for filtering. + chunking_strategy: + anyOf: + - oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + - type: 'null' + title: Chunking Strategy + description: The chunking strategy to use for the file. + type: object + required: + - file_id + title: Body_openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post + Body_openai_search_vector_store_v1_vector_stores__vector_store_id__search_post: + properties: + query: + anyOf: + - type: string + - items: + type: string + type: array + title: Query + description: The query string or array for performing the search. + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Filters + description: Filters based on file attributes to narrow the search results. + max_num_results: + anyOf: + - type: integer + maximum: 50.0 + minimum: 1.0 + - type: 'null' + title: Max Num Results + description: Maximum number of results to return (1 to 50 inclusive, default 10). + default: 10 + ranking_options: + anyOf: + - $ref: '#/components/schemas/SearchRankingOptions' + - type: 'null' + description: Ranking options for fine-tuning the search results. + rewrite_query: + type: boolean + title: Rewrite Query + description: Whether to rewrite the natural language query for vector search (default false). + default: false + search_mode: + anyOf: + - type: string + - type: 'null' + title: Search Mode + description: The search mode to use - 'keyword', 'vector', or 'hybrid' (default 'vector'). + default: vector + type: object + required: + - query + title: Body_openai_search_vector_store_v1_vector_stores__vector_store_id__search_post + Body_openai_upload_file_v1_files_post: + properties: + file: + type: string + format: binary + title: File + description: The File object to be uploaded. + purpose: + $ref: '#/components/schemas/OpenAIFilePurpose' + description: The intended purpose of the uploaded file. + expires_after: + anyOf: + - $ref: '#/components/schemas/ExpiresAfter' + - type: 'null' + description: Optional form values describing expiration for the file. + type: object + required: + - file + - purpose + title: Body_openai_upload_file_v1_files_post + Body_rag_tool_insert_v1_tool_runtime_rag_tool_insert_post: + properties: + documents: + items: + $ref: '#/components/schemas/RAGDocument' + type: array + title: Documents + description: List of documents to index in the RAG system. + vector_store_id: + type: string + title: Vector Store Id + description: ID of the vector database to store the document embeddings. + chunk_size_in_tokens: + type: integer + title: Chunk Size In Tokens + description: Size in tokens for document chunking during indexing. + default: 512 + type: object + required: + - documents + - vector_store_id + title: Body_rag_tool_insert_v1_tool_runtime_rag_tool_insert_post + Body_rag_tool_query_v1_tool_runtime_rag_tool_query_post: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + description: The query content to search for in the indexed documents. + vector_store_ids: + items: + type: string + type: array + title: Vector Store Ids + description: List of vector database IDs to search within. + query_config: + anyOf: + - $ref: '#/components/schemas/RAGQueryConfig' + - type: 'null' + description: Configuration parameters for the query operation. + type: object + required: + - content + - vector_store_ids + title: Body_rag_tool_query_v1_tool_runtime_rag_tool_query_post + Body_rerank_v1alpha_inference_rerank_post: + properties: + model: + type: string + title: Model + description: The identifier of the reranking model to use. + query: + anyOf: + - type: string + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + title: Query + description: The search query to rank items against. + items: + items: + anyOf: + - type: string + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + type: array + title: Items + description: List of items to rerank. + max_num_results: + anyOf: + - type: integer + - type: 'null' + title: Max Num Results + description: 'Maximum number of results to return. Default: returns all.' + type: object + required: + - model + - query + - items + title: Body_rerank_v1alpha_inference_rerank_post + BooleanType: + properties: + type: + type: string + const: boolean + title: Type + default: boolean + type: object + title: BooleanType + description: "Parameter type for boolean values.\n\n:param type: Discriminator type. Always \"boolean\"" + BuiltinTool: + type: string + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + ChatCompletionInputType: + properties: + type: + type: string + const: chat_completion_input + title: Type + default: chat_completion_input + type: object + title: ChatCompletionInputType + description: "Parameter type for chat completion input.\n\n:param type: Discriminator type. Always \"chat_completion_input\"" + Checkpoint: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for the checkpoint. + created_at: + type: string + format: date-time + title: Created At + description: Timestamp when the checkpoint was created. + epoch: + type: integer + title: Epoch + description: Training epoch when the checkpoint was saved. + post_training_job_id: + type: string + title: Post Training Job Id + description: Identifier of the training job that created this checkpoint. + path: + type: string + title: Path + description: File system path where the checkpoint is stored. + training_metrics: + anyOf: + - $ref: '#/components/schemas/PostTrainingMetric' + - type: 'null' + description: Training metrics associated with this checkpoint. + type: object + required: + - identifier + - created_at + - epoch + - post_training_job_id + - path + - training_metrics + title: Checkpoint + description: Checkpoint created during training runs. + Chunk-Input: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + chunk_id: + type: string + title: Chunk Id + metadata: + additionalProperties: true + type: object + title: Metadata + embedding: + anyOf: + - items: + type: number + type: array + - type: 'null' + title: Embedding + chunk_metadata: + anyOf: + - $ref: '#/components/schemas/ChunkMetadata' + - type: 'null' + type: object + required: + - content + - chunk_id + title: Chunk + description: A chunk of content that can be inserted into a vector database. + Chunk-Output: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + chunk_id: + type: string + title: Chunk Id + metadata: + additionalProperties: true + type: object + title: Metadata + embedding: + anyOf: + - items: + type: number + type: array + - type: 'null' + title: Embedding + chunk_metadata: + anyOf: + - $ref: '#/components/schemas/ChunkMetadata' + - type: 'null' + type: object + required: + - content + - chunk_id + title: Chunk + description: A chunk of content that can be inserted into a vector database. + ChunkMetadata: + properties: + chunk_id: + anyOf: + - type: string + - type: 'null' + title: Chunk Id + document_id: + anyOf: + - type: string + - type: 'null' + title: Document Id + source: + anyOf: + - type: string + - type: 'null' + title: Source + created_timestamp: + anyOf: + - type: integer + - type: 'null' + title: Created Timestamp + updated_timestamp: + anyOf: + - type: integer + - type: 'null' + title: Updated Timestamp + chunk_window: + anyOf: + - type: string + - type: 'null' + title: Chunk Window + chunk_tokenizer: + anyOf: + - type: string + - type: 'null' + title: Chunk Tokenizer + chunk_embedding_model: + anyOf: + - type: string + - type: 'null' + title: Chunk Embedding Model + chunk_embedding_dimension: + anyOf: + - type: integer + - type: 'null' + title: Chunk Embedding Dimension + content_token_count: + anyOf: + - type: integer + - type: 'null' + title: Content Token Count + metadata_token_count: + anyOf: + - type: integer + - type: 'null' + title: Metadata Token Count + type: object + title: ChunkMetadata + description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." + CompletionInputType: + properties: + type: + type: string + const: completion_input + title: Type + default: completion_input + type: object + title: CompletionInputType + description: "Parameter type for completion input.\n\n:param type: Discriminator type. Always \"completion_input\"" + CompletionMessage-Input: + properties: + role: + type: string + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' + title: Tool Calls + type: object + required: + - content + - stop_reason + title: CompletionMessage + description: "A message containing the model's (assistant) response in a chat conversation.\n\n- `StopReason.end_of_turn`: The model finished generating the entire response.\n- `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n- `StopReason.out_of_tokens`: The model ran out of token budget." + CompletionMessage-Output: + properties: + role: + type: string + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' + title: Tool Calls + type: object + required: + - content + - stop_reason + title: CompletionMessage + description: "A message containing the model's (assistant) response in a chat conversation.\n\n- `StopReason.end_of_turn`: The model finished generating the entire response.\n- `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n- `StopReason.out_of_tokens`: The model ran out of token budget." + Conversation: + properties: + id: + type: string + title: Id + description: The unique ID of the conversation. + object: + type: string + const: conversation + title: Object + description: The object type, which is always conversation. + default: conversation + created_at: + type: integer + title: Created At + description: The time at which the conversation was created, measured in seconds since the Unix epoch. + metadata: + anyOf: + - additionalProperties: + type: string + type: object + - type: 'null' + title: Metadata + description: Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. + items: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Items + description: Initial items to include in the conversation context. You may add up to 20 items at a time. + type: object + required: + - id + - created_at + title: Conversation + description: OpenAI-compatible conversation object. + ConversationCreateRequest: + properties: + items: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Input' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + maxItems: 20 + - type: 'null' + title: Items + description: Initial items to include in the conversation context. You may add up to 20 items at a time. + default: [] + metadata: + anyOf: + - additionalProperties: + type: string + type: object + maxProperties: 16 + - type: 'null' + title: Metadata + description: Set of 16 key-value pairs that can be attached to an object. Useful for storing additional information + default: {} + type: object + title: ConversationCreateRequest + description: Request body for creating a conversation. + ConversationDeletedResource: + properties: + id: + type: string + title: Id + description: The deleted conversation identifier + object: + type: string + title: Object + description: Object type + default: conversation.deleted + deleted: + type: boolean + title: Deleted + description: Whether the object was deleted + default: true + type: object + required: + - id + title: ConversationDeletedResource + description: Response for deleted conversation. + ConversationItemCreateRequest: + properties: + items: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Input' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + maxItems: 20 + title: Items + description: Items to include in the conversation context. You may add up to 20 items at a time. + type: object + required: + - items + title: ConversationItemCreateRequest + description: Request body for creating conversation items. + ConversationItemDeletedResource: + properties: + id: + type: string + title: Id + description: The deleted item identifier + object: + type: string + title: Object + description: Object type + default: conversation.item.deleted + deleted: + type: boolean + title: Deleted + description: Whether the object was deleted + default: true + type: object + required: + - id + title: ConversationItemDeletedResource + description: Response for deleted conversation item. + ConversationItemInclude: + type: string + enum: + - web_search_call.action.sources + - code_interpreter_call.outputs + - computer_call_output.output.image_url + - file_search_call.results + - message.input_image.image_url + - message.output_text.logprobs + - reasoning.encrypted_content + title: ConversationItemInclude + description: Specify additional output data to include in the model response. + ConversationItemList: + properties: + object: + type: string + title: Object + description: Object type + default: list + data: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + title: Data + description: List of conversation items + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + description: The ID of the first item in the list + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + description: The ID of the last item in the list + has_more: + type: boolean + title: Has More + description: Whether there are more items available + default: false + type: object + required: + - data + title: ConversationItemList + description: List of conversation items with pagination. + ConversationUpdateRequest: + properties: + metadata: + additionalProperties: + type: string + type: object + title: Metadata + description: Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. + type: object + required: + - metadata + title: ConversationUpdateRequest + description: Request body for updating a conversation. + CreateAgentSessionRequest: + properties: + agent_id: + type: string + title: Agent Id + description: The ID of the agent to create the session for + session_name: + type: string + title: Session Name + description: The name of the session to create + type: object + required: + - agent_id + - session_name + title: CreateAgentSessionRequest + description: Request to create a new session for an agent. + CreateBatchRequest: + properties: + input_file_id: + type: string + title: Input File Id + description: The ID of an uploaded file containing requests for the batch. + endpoint: + type: string + title: Endpoint + description: The endpoint to be used for all requests in the batch. + completion_window: + type: string + const: 24h + title: Completion Window + description: The time window within which the batch should be processed. + metadata: + anyOf: + - additionalProperties: + type: string + type: object + - type: 'null' + title: Metadata + description: Optional metadata for the batch. + idempotency_key: + anyOf: + - type: string + - type: 'null' + title: Idempotency Key + description: Optional idempotency key. When provided, enables idempotent behavior. + type: object + required: + - input_file_id + - endpoint + - completion_window + title: CreateBatchRequest + description: Request model for creating a batch. + CreateOpenAIResponseRequest: + properties: + input: + anyOf: + - type: string + - items: + anyOf: + - oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Input' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + type: array + title: Input + description: Input message(s) to create the response + model: + type: string + title: Model + description: The underlying LLM used for completions + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + description: Prompt object with ID, version, and variables + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + description: System instructions + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + description: If specified, the new response will be a continuation of the previous response + conversation: + anyOf: + - type: string + - type: 'null' + title: Conversation + description: The ID of a conversation to add the response to. Must begin with 'conv_' + store: + type: boolean + title: Store + description: Whether to store the response + default: true + stream: + type: boolean + title: Stream + description: Whether to stream the response + default: false + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Sampling temperature + text: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseText' + - type: 'null' + description: Text generation parameters + tools: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseInputToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + type: array + - type: 'null' + title: Tools + description: Tools to make available + include: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Include + description: Additional fields to include in the response + max_infer_iters: + type: integer + title: Max Infer Iters + description: Maximum number of inference iterations (extension to the OpenAI API) + default: 10 + guardrails: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/ResponseGuardrailSpec' + type: array + - type: 'null' + title: Guardrails + description: List of guardrails to apply during response generation + type: object + required: + - input + - model + title: CreateOpenAIResponseRequest + description: Request to create a model response. + CreatePromptRequest: + properties: + prompt: + type: string + title: Prompt + description: The prompt text content with variable placeholders. + variables: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Variables + description: List of variable names that can be used in the prompt template. + type: object + required: + - prompt + title: CreatePromptRequest + description: Request model for creating a new prompt. + DPOAlignmentConfig: + properties: + beta: + type: number + title: Beta + loss_type: + $ref: '#/components/schemas/DPOLossType' + default: sigmoid + type: object + required: + - beta + title: DPOAlignmentConfig + description: Configuration for Direct Preference Optimization (DPO) alignment. + DPOLossType: + type: string + enum: + - sigmoid + - hinge + - ipo + - kto_pair + title: DPOLossType + DataConfig: + properties: + dataset_id: + type: string + title: Dataset Id + batch_size: + type: integer + title: Batch Size + shuffle: + type: boolean + title: Shuffle + data_format: + $ref: '#/components/schemas/DatasetFormat' + validation_dataset_id: + anyOf: + - type: string + - type: 'null' + title: Validation Dataset Id + packed: + anyOf: + - type: boolean + - type: 'null' + title: Packed + default: false + train_on_input: + anyOf: + - type: boolean + - type: 'null' + title: Train On Input + default: false + type: object + required: + - dataset_id + - batch_size + - shuffle + - data_format + title: DataConfig + description: Configuration for training data and data loading. + Dataset: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: dataset + title: Type + description: Type of resource, always 'dataset' for datasets + default: dataset + purpose: + $ref: '#/components/schemas/DatasetPurpose' + source: + oneOf: + - $ref: '#/components/schemas/URIDataSource' + - $ref: '#/components/schemas/RowsDataSource' + title: Source + discriminator: + propertyName: type + mapping: + rows: '#/components/schemas/RowsDataSource' + uri: '#/components/schemas/URIDataSource' + metadata: + additionalProperties: true + type: object + title: Metadata + description: Any additional metadata for this dataset + type: object + required: + - identifier + - provider_id + - purpose + - source + title: Dataset + description: Dataset resource for storing and accessing training or evaluation data. + DatasetFormat: + type: string + enum: + - instruct + - dialog + title: DatasetFormat + description: Format of the training dataset. + DatasetPurpose: + type: string + enum: + - post-training/messages + - eval/question-answer + - eval/messages-answer + title: DatasetPurpose + description: "Purpose of the dataset. Each purpose has a required input data schema.\n\n {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello, world!\"},\n {\"role\": \"assistant\", \"content\": \"Hello, world!\"},\n ]\n }\n {\n \"question\": \"What is the capital of France?\",\n \"answer\": \"Paris\"\n }\n {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello, my name is John Doe.\"},\n {\"role\": \"assistant\", \"content\": \"Hello, John Doe. How can I help you today?\"},\n {\"role\": \"user\", \"content\": \"What's my name?\"},\n ],\n \"answer\": \"John Doe\"\n }" + DefaultRAGQueryGeneratorConfig: + properties: + type: + type: string + const: default + title: Type + default: default + separator: + type: string + title: Separator + default: ' ' + type: object + title: DefaultRAGQueryGeneratorConfig + description: "Configuration for the default RAG query generator.\n\n:param type: Type of query generator, always 'default'\n:param separator: String separator used to join query terms" + Document: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + title: Content + description: The content of the document. + mime_type: + type: string + title: Mime Type + description: The MIME type of the document. + type: object + required: + - content + - mime_type + title: Document + description: A document to be used by an agent. + EfficiencyConfig: + properties: + enable_activation_checkpointing: + anyOf: + - type: boolean + - type: 'null' + title: Enable Activation Checkpointing + default: false + enable_activation_offloading: + anyOf: + - type: boolean + - type: 'null' + title: Enable Activation Offloading + default: false + memory_efficient_fsdp_wrap: + anyOf: + - type: boolean + - type: 'null' + title: Memory Efficient Fsdp Wrap + default: false + fsdp_cpu_offload: + anyOf: + - type: boolean + - type: 'null' + title: Fsdp Cpu Offload + default: false + type: object + title: EfficiencyConfig + description: Configuration for memory and compute efficiency optimizations. + Error: + properties: + status: + type: integer + title: Status + description: HTTP status code + title: + type: string + title: Title + description: Error title, a short summary of the error which is invariant for an error type + detail: + type: string + title: Detail + description: Error detail, a longer human-readable description of the error + instance: + anyOf: + - type: string + - type: 'null' + title: Instance + description: (Optional) A URL which can be used to retrieve more information about the specific occurrence of the error + type: object + required: + - status + - title + - detail + title: Error + description: Error response from the API. Roughly follows RFC 7807. + Errors: + properties: + data: + anyOf: + - items: + $ref: '#/components/schemas/BatchError' + type: array + - type: 'null' + title: Data + object: + anyOf: + - type: string + - type: 'null' + title: Object + additionalProperties: true + type: object + title: Errors + EvaluateResponse: + properties: + generations: + items: + additionalProperties: true + type: object + type: array + title: Generations + description: The generations from the evaluation. + scores: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' + type: object + title: Scores + description: The scores from the evaluation. Each key in the dict is a scoring function name. + type: object + required: + - generations + - scores + title: EvaluateResponse + description: The response from an evaluation. + EvaluateRowsRequest: + properties: + input_rows: + items: + additionalProperties: true + type: object + type: array + title: Input Rows + description: The rows to evaluate. + scoring_functions: + items: + type: string + type: array + title: Scoring Functions + description: The scoring functions to use for the evaluation. + benchmark_config: + $ref: '#/components/schemas/BenchmarkConfig' + description: The configuration for the benchmark. + type: object + required: + - input_rows + - scoring_functions + - benchmark_config + title: EvaluateRowsRequest + description: Request model for evaluating rows. + ExpiresAfter: + properties: + anchor: + type: string + const: created_at + title: Anchor + description: Anchor must be 'created_at'. + seconds: + type: integer + maximum: 2592000.0 + minimum: 3600.0 + title: Seconds + description: Seconds between 3600 and 2592000 (1 hour to 30 days). + type: object + required: + - anchor + - seconds + title: ExpiresAfter + description: Control expiration of uploaded files. + GrammarResponseFormat: + properties: + type: + type: string + const: grammar + title: Type + default: grammar + bnf: + additionalProperties: true + type: object + minProperties: 1 + title: Bnf + type: object + required: + - bnf + title: GrammarResponseFormat + description: Configuration for grammar-guided response generation. + GreedySamplingStrategy: + properties: + type: + type: string + const: greedy + title: Type + default: greedy + type: object + title: GreedySamplingStrategy + description: Greedy sampling strategy that selects the highest probability token at each step. + HealthInfo: + properties: + status: + $ref: '#/components/schemas/HealthStatus' + description: Current health status of the service + type: object + required: + - status + title: HealthInfo + description: Health status information for the service. + HealthStatus: + type: string + enum: + - OK + - Error + - Not Implemented + title: HealthStatus + ImageContentItem-Input: + properties: + type: + type: string + const: image + title: Type + default: image + image: + $ref: '#/components/schemas/_URLOrData' + type: object + required: + - image + title: ImageContentItem + description: A image content item. + ImageContentItem-Output: + properties: + type: + type: string + const: image + title: Type + default: image + image: + $ref: '#/components/schemas/_URLOrData' + type: object + required: + - image + title: ImageContentItem + description: A image content item. + InferenceStep-Input: + properties: + turn_id: + type: string + title: Turn Id + description: The ID of the turn. + step_id: + type: string + title: Step Id + description: The ID of the step. + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At + description: The time the step started. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: The time the step completed. + step_type: + type: string + const: inference + title: Step Type + default: inference + model_response: + $ref: '#/components/schemas/CompletionMessage-Input' + description: The response from the LLM. + type: object + required: + - turn_id + - step_id + - model_response + title: InferenceStep + description: An inference step in an agent turn. + InferenceStep-Output: + properties: + turn_id: + type: string + title: Turn Id + description: The ID of the turn. + step_id: + type: string + title: Step Id + description: The ID of the step. + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At + description: The time the step started. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: The time the step completed. + step_type: + type: string + const: inference + title: Step Type + default: inference + model_response: + $ref: '#/components/schemas/CompletionMessage-Output' + description: The response from the LLM. + type: object + required: + - turn_id + - step_id + - model_response + title: InferenceStep + description: An inference step in an agent turn. + InputTokensDetails: + properties: + cached_tokens: + type: integer + title: Cached Tokens + additionalProperties: true + type: object + required: + - cached_tokens + title: InputTokensDetails + InsertChunksRequest: + properties: + vector_store_id: + type: string + title: Vector Store Id + description: The identifier of the vector database to insert the chunks into. + chunks: + items: + $ref: '#/components/schemas/Chunk-Input' + type: array + title: Chunks + description: The chunks to insert. + ttl_seconds: + anyOf: + - type: integer + - type: 'null' + title: Ttl Seconds + description: The time to live of the chunks. + type: object + required: + - vector_store_id + - chunks + title: InsertChunksRequest + description: Request to insert chunks into a vector database. + InvokeToolRequest: + properties: + tool_name: + type: string + title: Tool Name + description: The name of the tool to invoke + kwargs: + additionalProperties: true + type: object + title: Kwargs + description: A dictionary of arguments to pass to the tool + type: object + required: + - tool_name + - kwargs + title: InvokeToolRequest + description: Request model for invoking a tool. + Job: + properties: + job_id: + type: string + title: Job Id + status: + $ref: '#/components/schemas/JobStatus' + type: object + required: + - job_id + - status + title: Job + description: A job execution instance with status tracking. + JobStatus: + type: string + enum: + - completed + - in_progress + - failed + - scheduled + - cancelled + title: JobStatus + description: "Status of a job execution.\n:cvar completed: Job has finished successfully\n:cvar in_progress: Job is currently running\n:cvar failed: Job has failed during execution\n:cvar scheduled: Job is scheduled but not yet started\n:cvar cancelled: Job was cancelled before completion" + JsonSchemaResponseFormat: + properties: + type: + type: string + const: json_schema + title: Type + default: json_schema + json_schema: + additionalProperties: true + type: object + minProperties: 1 + title: Json Schema + type: object + required: + - json_schema + title: JsonSchemaResponseFormat + description: Configuration for JSON schema-guided response generation. + JsonType: + properties: + type: + type: string + const: json + title: Type + default: json + type: object + title: JsonType + description: "Parameter type for JSON values.\n\n:param type: Discriminator type. Always \"json\"" + LLMAsJudgeScoringFnParams: + properties: + type: + type: string + const: llm_as_judge + title: Type + default: llm_as_judge + judge_model: + type: string + title: Judge Model + prompt_template: + anyOf: + - type: string + - type: 'null' + title: Prompt Template + judge_score_regexes: + items: + type: string + type: array + title: Judge Score Regexes + description: Regexes to extract the answer from generated response + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row + type: object + required: + - judge_model + title: LLMAsJudgeScoringFnParams + description: Parameters for LLM-as-judge scoring function configuration. + LLMRAGQueryGeneratorConfig: + properties: + type: + type: string + const: llm + title: Type + default: llm + model: + type: string + title: Model + template: + type: string + title: Template + type: object + required: + - model + - template + title: LLMRAGQueryGeneratorConfig + description: "Configuration for the LLM-based RAG query generator.\n\n:param type: Type of query generator, always 'llm'\n:param model: Name of the language model to use for query generation\n:param template: Template string for formatting the query generation prompt" + ListBatchesResponse: + properties: + object: + type: string + const: list + title: Object + description: The object type, which is always 'list'. + default: list + data: + items: + $ref: '#/components/schemas/Batch' + type: array + title: Data + description: List of batch objects. + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + description: ID of the first batch in the list. + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + description: ID of the last batch in the list. + has_more: + type: boolean + title: Has More + description: Whether there are more batches available. + default: false + type: object + required: + - data + title: ListBatchesResponse + description: Response containing a list of batch objects. + ListBenchmarksResponse: + properties: + data: + items: + $ref: '#/components/schemas/Benchmark' + type: array + title: Data + description: List of benchmark resources + type: object + required: + - data + title: ListBenchmarksResponse + description: Response model for listing benchmarks. + ListDatasetsResponse: + properties: + data: + items: + $ref: '#/components/schemas/Dataset' + type: array + title: Data + description: List of datasets + type: object + required: + - data + title: ListDatasetsResponse + description: Response from listing datasets. + ListModelsResponse: + properties: + data: + items: + $ref: '#/components/schemas/Model' + type: array + title: Data + description: List of model resources. + type: object + required: + - data + title: ListModelsResponse + description: Response model for listing models. + ListOpenAIChatCompletionResponse: + properties: + data: + items: + $ref: '#/components/schemas/OpenAICompletionWithInputMessages' + type: array + title: Data + has_more: + type: boolean + title: Has More + first_id: + type: string + title: First Id + last_id: + type: string + title: Last Id + object: + type: string + const: list + title: Object + default: list + type: object + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIChatCompletionResponse + description: Response from listing OpenAI-compatible chat completions. + ListOpenAIFileResponse: + properties: + data: + items: + $ref: '#/components/schemas/OpenAIFileObject' + type: array + title: Data + description: List of file objects. + has_more: + type: boolean + title: Has More + description: Whether there are more files available beyond this page. + first_id: + type: string + title: First Id + description: ID of the first file in the list for pagination. + last_id: + type: string + title: Last Id + description: ID of the last file in the list for pagination. + object: + type: string + const: list + title: Object + description: The object type, which is always 'list'. + default: list + type: object + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIFileResponse + description: Response for listing files in OpenAI Files API. + ListOpenAIResponseInputItem: + properties: + data: + items: + anyOf: + - oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + type: array + title: Data + description: List of input items + object: + type: string + const: list + title: Object + description: Object type identifier, always "list" + default: list + type: object + required: + - data + title: ListOpenAIResponseInputItem + description: "List container for OpenAI response input items.\n\n:param data: List of input items\n:param object: Object type identifier, always \"list\"" + ListOpenAIResponseObject: + properties: + data: + items: + $ref: '#/components/schemas/OpenAIResponseObjectWithInput-Output' + type: array + title: Data + description: List of response objects with their input context + has_more: + type: boolean + title: Has More + description: Whether there are more results available beyond this page + first_id: + type: string + title: First Id + description: Identifier of the first item in this page + last_id: + type: string + title: Last Id + description: Identifier of the last item in this page + object: + type: string + const: list + title: Object + description: Object type identifier, always "list" + default: list + type: object + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIResponseObject + description: "Paginated list of OpenAI response objects with navigation metadata.\n\n:param data: List of response objects with their input context\n:param has_more: Whether there are more results available beyond this page\n:param first_id: Identifier of the first item in this page\n:param last_id: Identifier of the last item in this page\n:param object: Object type identifier, always \"list\"" + ListPostTrainingJobsResponse: + properties: + data: + items: + $ref: '#/components/schemas/PostTrainingJob' + type: array + title: Data + description: The list of training jobs + type: object + required: + - data + title: ListPostTrainingJobsResponse + ListPromptsResponse: + properties: + data: + items: + $ref: '#/components/schemas/Prompt' + type: array + title: Data + description: List of prompt resources. + type: object + required: + - data + title: ListPromptsResponse + description: Response model to list prompts. + ListProvidersResponse: + properties: + data: + items: + $ref: '#/components/schemas/ProviderInfo' + type: array + title: Data + description: List of provider information objects + type: object + required: + - data + title: ListProvidersResponse + description: Response containing a list of all available providers. + ListRoutesResponse: + properties: + data: + items: + $ref: '#/components/schemas/RouteInfo' + type: array + title: Data + description: List of available route information objects + type: object + required: + - data + title: ListRoutesResponse + description: Response containing a list of all available API routes. + ListScoringFunctionsResponse: + properties: + data: + items: + $ref: '#/components/schemas/ScoringFn' + type: array + title: Data + description: List of scoring function resources + type: object + required: + - data + title: ListScoringFunctionsResponse + description: Response model for listing scoring functions. + ListShieldsResponse: + properties: + data: + items: + $ref: '#/components/schemas/Shield' + type: array + title: Data + description: List of shield resources + type: object + required: + - data + title: ListShieldsResponse + description: Response model for listing shields. + ListToolDefsResponse: + properties: + data: + items: + $ref: '#/components/schemas/ToolDef' + type: array + title: Data + description: List of tool definitions + type: object + required: + - data + title: ListToolDefsResponse + description: Response containing a list of tool definitions. + ListToolGroupsResponse: + properties: + data: + items: + $ref: '#/components/schemas/ToolGroup' + type: array + title: Data + description: List of tool groups + type: object + required: + - data + title: ListToolGroupsResponse + description: Response containing a list of tool groups. + LoraFinetuningConfig: + properties: + type: + type: string + const: LoRA + title: Type + default: LoRA + lora_attn_modules: + items: + type: string + type: array + title: Lora Attn Modules + apply_lora_to_mlp: + type: boolean + title: Apply Lora To Mlp + apply_lora_to_output: + type: boolean + title: Apply Lora To Output + rank: + type: integer + title: Rank + alpha: + type: integer + title: Alpha + use_dora: + anyOf: + - type: boolean + - type: 'null' + title: Use Dora + default: false + quantize_base: + anyOf: + - type: boolean + - type: 'null' + title: Quantize Base + default: false + type: object + required: + - lora_attn_modules + - apply_lora_to_mlp + - apply_lora_to_output + - rank + - alpha + title: LoraFinetuningConfig + description: Configuration for Low-Rank Adaptation (LoRA) fine-tuning. + MCPListToolsTool: + properties: + input_schema: + additionalProperties: true + type: object + title: Input Schema + description: JSON schema defining the tool's input parameters + name: + type: string + title: Name + description: Name of the tool + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Description of what the tool does + type: object + required: + - input_schema + - name + title: MCPListToolsTool + description: "Tool definition returned by MCP list tools operation.\n\n:param input_schema: JSON schema defining the tool's input parameters\n:param name: Name of the tool\n:param description: (Optional) Description of what the tool does" + MemoryRetrievalStep-Input: + properties: + turn_id: + type: string + title: Turn Id + description: The ID of the turn. + step_id: + type: string + title: Step Id + description: The ID of the step. + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At + description: The time the step started. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: The time the step completed. + step_type: + type: string + const: memory_retrieval + title: Step Type + default: memory_retrieval + vector_store_ids: + type: string + title: Vector Store Ids + description: The IDs of the vector databases to retrieve context from. + inserted_context: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Inserted Context + description: The context retrieved from the vector databases. + type: object + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + description: A memory retrieval step in an agent turn. + MemoryRetrievalStep-Output: + properties: + turn_id: + type: string + title: Turn Id + description: The ID of the turn. + step_id: + type: string + title: Step Id + description: The ID of the step. + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At + description: The time the step started. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: The time the step completed. + step_type: + type: string + const: memory_retrieval + title: Step Type + default: memory_retrieval + vector_store_ids: + type: string + title: Vector Store Ids + description: The IDs of the vector databases to retrieve context from. + inserted_context: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Inserted Context + description: The context retrieved from the vector databases. + type: object + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + description: A memory retrieval step in an agent turn. + Model: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: model + title: Type + description: The resource type, always 'model' for model resources. + default: model + metadata: + additionalProperties: true + type: object + title: Metadata + description: Any additional metadata for this model. + model_type: + $ref: '#/components/schemas/ModelType' + description: The type of model (LLM or embedding model). + default: llm + type: object + required: + - identifier + - provider_id + title: Model + description: A model resource representing an AI model registered in Llama Stack. + ModelCandidate: + properties: + type: + type: string + const: model + title: Type + description: The type of candidate. + default: model + model: + type: string + title: Model + description: The model ID to evaluate. + sampling_params: + $ref: '#/components/schemas/SamplingParams' + description: The sampling parameters for the model. + system_message: + anyOf: + - $ref: '#/components/schemas/SystemMessage' + - type: 'null' + description: The system message providing instructions or context to the model. + type: object + required: + - model + - sampling_params + title: ModelCandidate + description: A model candidate for evaluation. + ModelType: + type: string + enum: + - llm + - embedding + - rerank + title: ModelType + description: Enumeration of supported model types in Llama Stack. + ModerationObject: + properties: + id: + type: string + title: Id + description: The unique identifier for the moderation request. + model: + type: string + title: Model + description: The model used to generate the moderation results. + results: + items: + $ref: '#/components/schemas/ModerationObjectResults' + type: array + title: Results + description: A list of moderation objects. + type: object + required: + - id + - model + - results + title: ModerationObject + description: A moderation object. + ModerationObjectResults: + properties: + flagged: + type: boolean + title: Flagged + description: Whether any of the below categories are flagged. + categories: + anyOf: + - additionalProperties: + type: boolean + type: object + - type: 'null' + title: Categories + description: A list of the categories, and whether they are flagged or not. + category_applied_input_types: + anyOf: + - additionalProperties: + items: + type: string + type: array + type: object + - type: 'null' + title: Category Applied Input Types + description: A list of the categories along with the input type(s) that the score applies to. + category_scores: + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Category Scores + description: A list of the categories along with their scores as predicted by model. + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + description: User message. + metadata: + additionalProperties: true + type: object + title: Metadata + description: Additional metadata. + type: object + required: + - flagged + title: ModerationObjectResults + description: A moderation object. + NumberType: + properties: + type: + type: string + const: number + title: Type + default: number + type: object + title: NumberType + description: "Parameter type for numeric values.\n\n:param type: Discriminator type. Always \"number\"" + ObjectType: + properties: + type: + type: string + const: object + title: Type + default: object + type: object + title: ObjectType + description: "Parameter type for object values.\n\n:param type: Discriminator type. Always \"object\"" + OpenAIAssistantMessageParam-Input: + properties: + role: + type: string + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + - type: 'null' + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + title: Tool Calls + type: object + title: OpenAIAssistantMessageParam + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. + OpenAIAssistantMessageParam-Output: + properties: + role: + type: string + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + - type: 'null' + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + title: Tool Calls + type: object + title: OpenAIAssistantMessageParam + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. + OpenAIChatCompletionContentPartImageParam: + properties: + type: + type: string + const: image_url + title: Type + default: image_url + image_url: + $ref: '#/components/schemas/OpenAIImageURL' + type: object + required: + - image_url + title: OpenAIChatCompletionContentPartImageParam + description: Image content part for OpenAI-compatible chat completion messages. + OpenAIChatCompletionContentPartTextParam: + properties: + type: + type: string + const: text + title: Type + default: text + text: + type: string + title: Text + type: object + required: + - text + title: OpenAIChatCompletionContentPartTextParam + description: Text content part for OpenAI-compatible chat completion messages. + OpenAIChatCompletionRequestWithExtraBody: + properties: + model: + type: string + title: Model + messages: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Input' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Input' + type: array + minItems: 1 + title: Messages + frequency_penalty: + anyOf: + - type: number + - type: 'null' + title: Frequency Penalty + function_call: + anyOf: + - type: string + - additionalProperties: true + type: object + - type: 'null' + title: Function Call + functions: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Functions + logit_bias: + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Logit Bias + logprobs: + anyOf: + - type: boolean + - type: 'null' + title: Logprobs + max_completion_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Completion Tokens + max_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Tokens + n: + anyOf: + - type: integer + - type: 'null' + title: N + parallel_tool_calls: + anyOf: + - type: boolean + - type: 'null' + title: Parallel Tool Calls + presence_penalty: + anyOf: + - type: number + - type: 'null' + title: Presence Penalty + response_format: + anyOf: + - oneOf: + - $ref: '#/components/schemas/OpenAIResponseFormatText' + - $ref: '#/components/schemas/OpenAIResponseFormatJSONSchema' + - $ref: '#/components/schemas/OpenAIResponseFormatJSONObject' + discriminator: + propertyName: type + mapping: + json_object: '#/components/schemas/OpenAIResponseFormatJSONObject' + json_schema: '#/components/schemas/OpenAIResponseFormatJSONSchema' + text: '#/components/schemas/OpenAIResponseFormatText' + - type: 'null' + title: Response Format + seed: + anyOf: + - type: integer + - type: 'null' + title: Seed + stop: + anyOf: + - type: string + - items: + type: string + type: array + - type: 'null' + title: Stop + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + stream_options: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Stream Options + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + tool_choice: + anyOf: + - type: string + - additionalProperties: true + type: object + - type: 'null' + title: Tool Choice + tools: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Tools + top_logprobs: + anyOf: + - type: integer + - type: 'null' + title: Top Logprobs + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + user: + anyOf: + - type: string + - type: 'null' + title: User + additionalProperties: true + type: object + required: + - model + - messages + title: OpenAIChatCompletionRequestWithExtraBody + description: Request parameters for OpenAI-compatible chat completion endpoint. + OpenAIChatCompletionToolCall: + properties: + index: + anyOf: + - type: integer + - type: 'null' + title: Index + id: + anyOf: + - type: string + - type: 'null' + title: Id + type: + type: string + const: function + title: Type + default: function + function: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' + - type: 'null' + type: object + title: OpenAIChatCompletionToolCall + description: Tool call specification for OpenAI-compatible chat completion responses. + OpenAIChatCompletionToolCallFunction: + properties: + name: + anyOf: + - type: string + - type: 'null' + title: Name + arguments: + anyOf: + - type: string + - type: 'null' + title: Arguments + type: object + title: OpenAIChatCompletionToolCallFunction + description: Function call details for OpenAI-compatible tool calls. + OpenAIChatCompletionUsage: + properties: + prompt_tokens: + type: integer + title: Prompt Tokens + completion_tokens: + type: integer + title: Completion Tokens + total_tokens: + type: integer + title: Total Tokens + prompt_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails' + - type: 'null' + completion_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails' + - type: 'null' + type: object + required: + - prompt_tokens + - completion_tokens + - total_tokens + title: OpenAIChatCompletionUsage + description: Usage information for OpenAI chat completion. + OpenAIChatCompletionUsageCompletionTokensDetails: + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens + type: object + title: OpenAIChatCompletionUsageCompletionTokensDetails + description: Token details for output tokens in OpenAI chat completion usage. + OpenAIChatCompletionUsagePromptTokensDetails: + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens + type: object + title: OpenAIChatCompletionUsagePromptTokensDetails + description: Token details for prompt tokens in OpenAI chat completion usage. + OpenAIChoice-Input: + properties: + message: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Message + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Input' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Input' + finish_reason: + type: string + title: Finish Reason + index: + type: integer + title: Index + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Input' + - type: 'null' + type: object + required: + - message + - finish_reason + - index + title: OpenAIChoice + description: A choice from an OpenAI-compatible chat completion response. + OpenAIChoice-Output: + properties: + message: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Output' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Output' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Message + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Output' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Output' + finish_reason: + type: string + title: Finish Reason + index: + type: integer + title: Index + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + - type: 'null' + type: object + required: + - message + - finish_reason + - index + title: OpenAIChoice + description: A choice from an OpenAI-compatible chat completion response. + OpenAIChoiceLogprobs-Input: + properties: + content: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + title: Content + refusal: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + title: Refusal + type: object + title: OpenAIChoiceLogprobs + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. + OpenAIChoiceLogprobs-Output: + properties: + content: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + title: Content + refusal: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + title: Refusal + type: object + title: OpenAIChoiceLogprobs + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. + OpenAICompletion: + properties: + id: + type: string + title: Id + choices: + items: + $ref: '#/components/schemas/OpenAICompletionChoice-Output' + type: array + title: Choices + created: + type: integer + title: Created + model: + type: string + title: Model + object: + type: string + const: text_completion + title: Object + default: text_completion + type: object + required: + - id + - choices + - created + - model + title: OpenAICompletion + description: "Response from an OpenAI-compatible completion request.\n\n:id: The ID of the completion\n:choices: List of choices\n:created: The Unix timestamp in seconds when the completion was created\n:model: The model that was used to generate the completion\n:object: The object type, which will be \"text_completion\"" + OpenAICompletionChoice-Input: + properties: + finish_reason: + type: string + title: Finish Reason + text: + type: string + title: Text + index: + type: integer + title: Index + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Input' + - type: 'null' + type: object + required: + - finish_reason + - text + - index + title: OpenAICompletionChoice + description: "A choice from an OpenAI-compatible completion response.\n\n:finish_reason: The reason the model stopped generating\n:text: The text of the choice\n:index: The index of the choice\n:logprobs: (Optional) The log probabilities for the tokens in the choice" + OpenAICompletionChoice-Output: + properties: + finish_reason: + type: string + title: Finish Reason + text: + type: string + title: Text + index: + type: integer + title: Index + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + - type: 'null' + type: object + required: + - finish_reason + - text + - index + title: OpenAICompletionChoice + description: "A choice from an OpenAI-compatible completion response.\n\n:finish_reason: The reason the model stopped generating\n:text: The text of the choice\n:index: The index of the choice\n:logprobs: (Optional) The log probabilities for the tokens in the choice" + OpenAICompletionRequestWithExtraBody: + properties: + model: + type: string + title: Model + prompt: + anyOf: + - type: string + - items: + type: string + type: array + - items: + type: integer + type: array + - items: + items: + type: integer + type: array + type: array + title: Prompt + best_of: + anyOf: + - type: integer + - type: 'null' + title: Best Of + echo: + anyOf: + - type: boolean + - type: 'null' + title: Echo + frequency_penalty: + anyOf: + - type: number + - type: 'null' + title: Frequency Penalty + logit_bias: + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Logit Bias + logprobs: + anyOf: + - type: integer + maximum: 5.0 + minimum: 0.0 + - type: 'null' + title: Logprobs + max_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Tokens + n: + anyOf: + - type: integer + - type: 'null' + title: N + presence_penalty: + anyOf: + - type: number + - type: 'null' + title: Presence Penalty + seed: + anyOf: + - type: integer + - type: 'null' + title: Seed + stop: + anyOf: + - type: string + - items: + type: string + type: array + - type: 'null' + title: Stop + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + stream_options: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Stream Options + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + user: + anyOf: + - type: string + - type: 'null' + title: User + suffix: + anyOf: + - type: string + - type: 'null' + title: Suffix + additionalProperties: true + type: object + required: + - model + - prompt + title: OpenAICompletionRequestWithExtraBody + description: Request parameters for OpenAI-compatible completion endpoint. + OpenAICompletionWithInputMessages: + properties: + id: + type: string + title: Id + choices: + items: + $ref: '#/components/schemas/OpenAIChoice-Output' + type: array + title: Choices + object: + type: string + const: chat.completion + title: Object + default: chat.completion + created: + type: integer + title: Created + model: + type: string + title: Model + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsage' + - type: 'null' + input_messages: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Output' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Output' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Output' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Output' + type: array + title: Input Messages + type: object + required: + - id + - choices + - created + - model + - input_messages + title: OpenAICompletionWithInputMessages + OpenAICreateVectorStoreFileBatchRequestWithExtraBody: + properties: + file_ids: + items: + type: string + type: array + title: File Ids + attributes: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Attributes + chunking_strategy: + anyOf: + - oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + - type: 'null' + title: Chunking Strategy + additionalProperties: true + type: object + required: + - file_ids + title: OpenAICreateVectorStoreFileBatchRequestWithExtraBody + description: Request to create a vector store file batch with extra_body support. + OpenAICreateVectorStoreRequestWithExtraBody: + properties: + name: + anyOf: + - type: string + - type: 'null' + title: Name + file_ids: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: File Ids + expires_after: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After + chunking_strategy: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Chunking Strategy + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + additionalProperties: true + type: object + title: OpenAICreateVectorStoreRequestWithExtraBody + description: Request to create a vector store with extra_body support. + OpenAIDeleteResponseObject: + properties: + id: + type: string + title: Id + description: Unique identifier of the deleted response + object: + type: string + const: response + title: Object + description: Object type identifier, always "response" + default: response + deleted: + type: boolean + title: Deleted + description: Deletion confirmation flag, always True + default: true + type: object + required: + - id + title: OpenAIDeleteResponseObject + description: "Response object confirming deletion of an OpenAI response.\n\n:param id: Unique identifier of the deleted response\n:param object: Object type identifier, always \"response\"\n:param deleted: Deletion confirmation flag, always True" + OpenAIDeveloperMessageParam: + properties: + role: + type: string + const: developer + title: Role + default: developer + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + type: object + required: + - content + title: OpenAIDeveloperMessageParam + description: A message from the developer in an OpenAI-compatible chat completion request. + OpenAIEmbeddingData: + properties: + object: + type: string + const: embedding + title: Object + default: embedding + embedding: + anyOf: + - items: + type: number + type: array + - type: string + title: Embedding + index: + type: integer + title: Index + type: object + required: + - embedding + - index + title: OpenAIEmbeddingData + description: A single embedding data object from an OpenAI-compatible embeddings response. + OpenAIEmbeddingUsage: + properties: + prompt_tokens: + type: integer + title: Prompt Tokens + total_tokens: + type: integer + title: Total Tokens + type: object + required: + - prompt_tokens + - total_tokens + title: OpenAIEmbeddingUsage + description: Usage information for an OpenAI-compatible embeddings response. + OpenAIEmbeddingsRequestWithExtraBody: + properties: + model: + type: string + title: Model + input: + anyOf: + - type: string + - items: + type: string + type: array + title: Input + encoding_format: + anyOf: + - type: string + - type: 'null' + title: Encoding Format + default: float + dimensions: + anyOf: + - type: integer + - type: 'null' + title: Dimensions + user: + anyOf: + - type: string + - type: 'null' + title: User + additionalProperties: true + type: object + required: + - model + - input + title: OpenAIEmbeddingsRequestWithExtraBody + description: Request parameters for OpenAI-compatible embeddings endpoint. + OpenAIEmbeddingsResponse: + properties: + object: + type: string + const: list + title: Object + default: list + data: + items: + $ref: '#/components/schemas/OpenAIEmbeddingData' + type: array + title: Data + model: + type: string + title: Model + usage: + $ref: '#/components/schemas/OpenAIEmbeddingUsage' + type: object + required: + - data + - model + - usage + title: OpenAIEmbeddingsResponse + description: Response from an OpenAI-compatible embeddings request. + OpenAIFile: + properties: + type: + type: string + const: file + title: Type + default: file + file: + $ref: '#/components/schemas/OpenAIFileFile' + type: object + required: + - file + title: OpenAIFile + OpenAIFileDeleteResponse: + properties: + id: + type: string + title: Id + description: The file identifier that was deleted. + object: + type: string + const: file + title: Object + description: The object type, which is always 'file'. + default: file + deleted: + type: boolean + title: Deleted + description: Whether the file was successfully deleted. + type: object + required: + - id + - deleted + title: OpenAIFileDeleteResponse + description: Response for deleting a file in OpenAI Files API. + OpenAIFileFile: + properties: + file_id: + anyOf: + - type: string + - type: 'null' + title: File Id + filename: + anyOf: + - type: string + - type: 'null' + title: Filename + type: object + title: OpenAIFileFile + OpenAIFileObject: + properties: + object: + type: string + const: file + title: Object + description: The object type, which is always 'file'. + default: file + id: + type: string + title: Id + description: The file identifier, which can be referenced in the API endpoints. + bytes: + type: integer + title: Bytes + description: The size of the file, in bytes. + created_at: + type: integer + title: Created At + description: The Unix timestamp (in seconds) for when the file was created. + expires_at: + type: integer + title: Expires At + description: The Unix timestamp (in seconds) for when the file expires. + filename: + type: string + title: Filename + description: The name of the file. + purpose: + $ref: '#/components/schemas/OpenAIFilePurpose' + description: The intended purpose of the file. + type: object + required: + - id + - bytes + - created_at + - expires_at + - filename + - purpose + title: OpenAIFileObject + description: OpenAI File object as defined in the OpenAI Files API. + OpenAIFilePurpose: + type: string + enum: + - assistants + - batch + title: OpenAIFilePurpose + description: Valid purpose values for OpenAI Files API. + OpenAIImageURL: + properties: + url: + type: string + title: Url + detail: + anyOf: + - type: string + - type: 'null' + title: Detail + type: object + required: + - url + title: OpenAIImageURL + description: Image URL specification for OpenAI-compatible chat completion messages. + OpenAIJSONSchema: + properties: + name: + type: string + title: Name + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + type: object + title: OpenAIJSONSchema + description: JSON schema specification for OpenAI-compatible structured response format. + OpenAIResponseAnnotationCitation: + properties: + type: + type: string + const: url_citation + title: Type + description: Annotation type identifier, always "url_citation" + default: url_citation + end_index: + type: integer + title: End Index + description: End position of the citation span in the content + start_index: + type: integer + title: Start Index + description: Start position of the citation span in the content + title: + type: string + title: Title + description: Title of the referenced web resource + url: + type: string + title: Url + description: URL of the referenced web resource + type: object + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + type: string + const: container_file_citation + title: Type + default: container_file_citation + container_id: + type: string + title: Container Id + end_index: + type: integer + title: End Index + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + start_index: + type: integer + title: Start Index + type: object + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + OpenAIResponseAnnotationFileCitation: + properties: + type: + type: string + const: file_citation + title: Type + description: Annotation type identifier, always "file_citation" + default: file_citation + file_id: + type: string + title: File Id + description: Unique identifier of the referenced file + filename: + type: string + title: Filename + description: Name of the referenced file + index: + type: integer + title: Index + description: Position index of the citation within the content + type: object + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + OpenAIResponseAnnotationFilePath: + properties: + type: + type: string + const: file_path + title: Type + default: file_path + file_id: + type: string + title: File Id + index: + type: integer + title: Index + type: object + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + OpenAIResponseContentPartRefusal: + properties: + type: + type: string + const: refusal + title: Type + description: Content part type identifier, always "refusal" + default: refusal + refusal: + type: string + title: Refusal + description: Refusal text supplied by the model + type: object + required: + - refusal + title: OpenAIResponseContentPartRefusal + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + OpenAIResponseError: + properties: + code: + type: string + title: Code + description: Error code identifying the type of failure + message: + type: string + title: Message + description: Human-readable error message describing the failure + type: object + required: + - code + - message + title: OpenAIResponseError + description: "Error details for failed OpenAI response requests.\n\n:param code: Error code identifying the type of failure\n:param message: Human-readable error message describing the failure" + OpenAIResponseFormatJSONObject: + properties: + type: + type: string + const: json_object + title: Type + default: json_object + type: object + title: OpenAIResponseFormatJSONObject + description: JSON object response format for OpenAI-compatible chat completion requests. + OpenAIResponseFormatJSONSchema: + properties: + type: + type: string + const: json_schema + title: Type + default: json_schema + json_schema: + $ref: '#/components/schemas/OpenAIJSONSchema' + type: object + required: + - json_schema + title: OpenAIResponseFormatJSONSchema + description: JSON schema response format for OpenAI-compatible chat completion requests. + OpenAIResponseFormatText: + properties: + type: + type: string + const: text + title: Type + default: text + type: object + title: OpenAIResponseFormatText + description: Text response format for OpenAI-compatible chat completion requests. + OpenAIResponseInputFunctionToolCallOutput: + properties: + call_id: + type: string + title: Call Id + output: + type: string + title: Output + type: + type: string + const: function_call_output + title: Type + default: function_call_output + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + type: object + required: + - call_id + - output + title: OpenAIResponseInputFunctionToolCallOutput + description: This represents the output of a function call that gets passed back to the model. + OpenAIResponseInputMessageContentFile: + properties: + type: + type: string + const: input_file + title: Type + description: The type of the input item. Always `input_file`. + default: input_file + file_data: + anyOf: + - type: string + - type: 'null' + title: File Data + description: The data of the file to be sent to the model. + file_id: + anyOf: + - type: string + - type: 'null' + title: File Id + description: The ID of the file to be sent to the model. + file_url: + anyOf: + - type: string + - type: 'null' + title: File Url + description: The URL of the file to be sent to the model. + filename: + anyOf: + - type: string + - type: 'null' + title: Filename + description: The name of the file to be sent to the model. + type: object + title: OpenAIResponseInputMessageContentFile + description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + OpenAIResponseInputMessageContentImage: + properties: + detail: + anyOf: + - type: string + const: low + - type: string + const: high + - type: string + const: auto + title: Detail + description: Level of detail for image processing, can be "low", "high", or "auto" + default: auto + type: + type: string + const: input_image + title: Type + description: Content type identifier, always "input_image" + default: input_image + file_id: + anyOf: + - type: string + - type: 'null' + title: File Id + description: The ID of the file to be sent to the model. + image_url: + anyOf: + - type: string + - type: 'null' + title: Image Url + description: URL of the image content + type: object + title: OpenAIResponseInputMessageContentImage + description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + OpenAIResponseInputMessageContentText: + properties: + text: + type: string + title: Text + description: The text content of the input message + type: + type: string + const: input_text + title: Type + description: Content type identifier, always "input_text" + default: input_text + type: object + required: + - text + title: OpenAIResponseInputMessageContentText + description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + OpenAIResponseInputToolFileSearch: + properties: + type: + type: string + const: file_search + title: Type + description: Tool type identifier, always "file_search" + default: file_search + vector_store_ids: + items: + type: string + type: array + title: Vector Store Ids + description: List of vector store identifiers to search within + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Filters + description: Additional filters to apply to the search + max_num_results: + anyOf: + - type: integer + maximum: 50.0 + minimum: 1.0 + - type: 'null' + title: Max Num Results + description: Maximum number of search results to return (1-50) + default: 10 + ranking_options: + anyOf: + - $ref: '#/components/schemas/SearchRankingOptions' + - type: 'null' + description: Options for ranking and scoring search results + type: object + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + description: "File search tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"file_search\"\n:param vector_store_ids: List of vector store identifiers to search within\n:param filters: (Optional) Additional filters to apply to the search\n:param max_num_results: (Optional) Maximum number of search results to return (1-50)\n:param ranking_options: (Optional) Options for ranking and scoring search results" + OpenAIResponseInputToolFunction: + properties: + type: + type: string + const: function + title: Type + description: Tool type identifier, always "function" + default: function + name: + type: string + title: Name + description: Name of the function that can be called + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Description of what the function does + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Parameters + description: JSON schema defining the function's parameters + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + description: Whether to enforce strict parameter validation + type: object + required: + - name + title: OpenAIResponseInputToolFunction + description: "Function tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"function\"\n:param name: Name of the function that can be called\n:param description: (Optional) Description of what the function does\n:param parameters: (Optional) JSON schema defining the function's parameters\n:param strict: (Optional) Whether to enforce strict parameter validation" + OpenAIResponseInputToolMCP: + properties: + type: + type: string + const: mcp + title: Type + description: Tool type identifier, always "mcp" + default: mcp + server_label: + type: string + title: Server Label + description: Label to identify this MCP server + server_url: + type: string + title: Server Url + description: URL endpoint of the MCP server + headers: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Headers + description: HTTP headers to include when connecting to the server + require_approval: + anyOf: + - type: string + const: always + - type: string + const: never + - $ref: '#/components/schemas/ApprovalFilter' + title: Require Approval + description: Approval requirement for tool calls ("always", "never", or filter) + default: never + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + title: Allowed Tools + description: Restriction on which tools can be used from this server + type: object + required: + - server_label + - server_url + title: OpenAIResponseInputToolMCP + description: "Model Context Protocol (MCP) tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param server_url: URL endpoint of the MCP server\n:param headers: (Optional) HTTP headers to include when connecting to the server\n:param require_approval: Approval requirement for tool calls (\"always\", \"never\", or filter)\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + OpenAIResponseInputToolWebSearch: + properties: + type: + anyOf: + - type: string + const: web_search + - type: string + const: web_search_preview + - type: string + const: web_search_preview_2025_03_11 + title: Type + description: Web search tool type variant to use + default: web_search + search_context_size: + anyOf: + - type: string + pattern: ^low|medium|high$ + - type: 'null' + title: Search Context Size + description: Size of search context, must be "low", "medium", or "high" + default: medium + type: object + title: OpenAIResponseInputToolWebSearch + description: "Web search tool configuration for OpenAI response inputs.\n\n:param type: Web search tool type variant to use\n:param search_context_size: (Optional) Size of search context, must be \"low\", \"medium\", or \"high\"" + OpenAIResponseMCPApprovalRequest: + properties: + arguments: + type: string + title: Arguments + id: + type: string + title: Id + name: + type: string + title: Name + server_label: + type: string + title: Server Label + type: + type: string + const: mcp_approval_request + title: Type + default: mcp_approval_request + type: object + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + description: A request for human approval of a tool invocation. + OpenAIResponseMCPApprovalResponse: + properties: + approval_request_id: + type: string + title: Approval Request Id + approve: + type: boolean + title: Approve + type: + type: string + const: mcp_approval_response + title: Type + default: mcp_approval_response + id: + anyOf: + - type: string + - type: 'null' + title: Id + reason: + anyOf: + - type: string + - type: 'null' + title: Reason + type: object + required: + - approval_request_id + - approve + title: OpenAIResponseMCPApprovalResponse + description: A response to an MCP approval request. + OpenAIResponseMessage-Input: + properties: + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - type: string + const: system + - type: string + const: developer + - type: string + const: user + - type: string + const: assistant + title: Role + type: + type: string + const: message + title: Type + default: message + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + type: object + required: + - content + - role + title: OpenAIResponseMessage + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + OpenAIResponseMessage-Output: + properties: + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - type: string + const: system + - type: string + const: developer + - type: string + const: user + - type: string + const: assistant + title: Role + type: + type: string + const: message + title: Type + default: message + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status + type: object + required: + - content + - role + title: OpenAIResponseMessage + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + OpenAIResponseObject: + properties: + created_at: + type: integer + title: Created At + description: Unix timestamp when the response was created + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + description: Error details if the response generation failed + id: + type: string + title: Id + description: Unique identifier for this response + model: + type: string + title: Model + description: Model identifier used for generation + object: + type: string + const: response + title: Object + description: Object type identifier, always "response" + default: response + output: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + title: Output + description: List of generated output items (messages, tool calls, etc.) + parallel_tool_calls: + type: boolean + title: Parallel Tool Calls + description: Whether tool calls can be executed in parallel + default: false + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + description: ID of the previous response in a conversation + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + description: Reference to a prompt template and its variables. + status: + type: string + title: Status + description: Current status of the response generation + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Sampling temperature used for generation + text: + $ref: '#/components/schemas/OpenAIResponseText' + description: Text formatting configuration for the response + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + description: Nucleus sampling parameter used for generation + tools: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + type: array + - type: 'null' + title: Tools + description: An array of tools the model may call while generating a response. + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + description: Truncation strategy applied to the response + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + description: Token usage information for the response + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + description: System message inserted into the model's context + type: object + required: + - created_at + - id + - model + - output + - status + title: OpenAIResponseObject + description: "Complete OpenAI response object containing generation results and metadata.\n\n:param created_at: Unix timestamp when the response was created\n:param error: (Optional) Error details if the response generation failed\n:param id: Unique identifier for this response\n:param model: Model identifier used for generation\n:param object: Object type identifier, always \"response\"\n:param output: List of generated output items (messages, tool calls, etc.)\n:param parallel_tool_calls: Whether tool calls can be executed in parallel\n:param previous_response_id: (Optional) ID of the previous response in a conversation\n:param prompt: (Optional) Reference to a prompt template and its variables.\n:param status: Current status of the response generation\n:param temperature: (Optional) Sampling temperature used for generation\n:param text: Text formatting configuration for the response\n:param top_p: (Optional) Nucleus sampling parameter used for generation\n:param tools: (Optional) An array of tools the model may call while generating a response.\n:param truncation: (Optional) Truncation strategy applied to the response\n:param usage: (Optional) Token usage information for the response\n:param instructions: (Optional) System message inserted into the model's context" + OpenAIResponseObjectWithInput-Input: + properties: + created_at: + type: integer + title: Created At + description: Unix timestamp when the response was created + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + description: Error details if the response generation failed + id: + type: string + title: Id + description: Unique identifier for this response + model: + type: string + title: Model + description: Model identifier used for generation + object: + type: string + const: response + title: Object + description: Object type identifier, always "response" + default: response + output: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Input' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + title: Output + description: List of generated output items (messages, tool calls, etc.) + parallel_tool_calls: + type: boolean + title: Parallel Tool Calls + description: Whether tool calls can be executed in parallel + default: false + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + description: ID of the previous response in a conversation + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + description: Reference to a prompt template and its variables. + status: + type: string + title: Status + description: Current status of the response generation + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Sampling temperature used for generation + text: + $ref: '#/components/schemas/OpenAIResponseText' + description: Text formatting configuration for the response + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + description: Nucleus sampling parameter used for generation + tools: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + type: array + - type: 'null' + title: Tools + description: An array of tools the model may call while generating a response. + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + description: Truncation strategy applied to the response + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + description: Token usage information for the response + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + description: System message inserted into the model's context + input: + items: + anyOf: + - oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Input' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + type: array + title: Input + description: List of input items that led to this response + type: object + required: + - created_at + - id + - model + - output + - status + - input + title: OpenAIResponseObjectWithInput + description: "OpenAI response object extended with input context information.\n\n:param input: List of input items that led to this response" + OpenAIResponseObjectWithInput-Output: + properties: + created_at: + type: integer + title: Created At + description: Unix timestamp when the response was created + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + description: Error details if the response generation failed + id: + type: string + title: Id + description: Unique identifier for this response + model: + type: string + title: Model + description: Model identifier used for generation + object: + type: string + const: response + title: Object + description: Object type identifier, always "response" + default: response + output: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + title: Output + description: List of generated output items (messages, tool calls, etc.) + parallel_tool_calls: + type: boolean + title: Parallel Tool Calls + description: Whether tool calls can be executed in parallel + default: false + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + description: ID of the previous response in a conversation + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + description: Reference to a prompt template and its variables. + status: + type: string + title: Status + description: Current status of the response generation + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Sampling temperature used for generation + text: + $ref: '#/components/schemas/OpenAIResponseText' + description: Text formatting configuration for the response + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + description: Nucleus sampling parameter used for generation + tools: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + type: array + - type: 'null' + title: Tools + description: An array of tools the model may call while generating a response. + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + description: Truncation strategy applied to the response + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + description: Token usage information for the response + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + description: System message inserted into the model's context + input: + items: + anyOf: + - oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + type: array + title: Input + description: List of input items that led to this response + type: object + required: + - created_at + - id + - model + - output + - status + - input + title: OpenAIResponseObjectWithInput + description: "OpenAI response object extended with input context information.\n\n:param input: List of input items that led to this response" + OpenAIResponseOutputMessageContentOutputText: + properties: + text: + type: string + title: Text + type: + type: string + const: output_text + title: Type + default: output_text + annotations: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + discriminator: + propertyName: type + mapping: + container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' + url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' + type: array + title: Annotations + type: object + required: + - text + title: OpenAIResponseOutputMessageContentOutputText + OpenAIResponseOutputMessageFileSearchToolCall: + properties: + id: + type: string + title: Id + description: Unique identifier for this tool call + queries: + items: + type: string + type: array + title: Queries + description: List of search queries executed + status: + type: string + title: Status + description: Current status of the file search operation + type: + type: string + const: file_search_call + title: Type + description: Tool call type identifier, always "file_search_call" + default: file_search_call + results: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' + type: array + - type: 'null' + title: Results + description: Search results returned by the file search operation + type: object + required: + - id + - queries + - status + title: OpenAIResponseOutputMessageFileSearchToolCall + description: "File search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param queries: List of search queries executed\n:param status: Current status of the file search operation\n:param type: Tool call type identifier, always \"file_search_call\"\n:param results: (Optional) Search results returned by the file search operation" + OpenAIResponseOutputMessageFileSearchToolCallResults: + properties: + attributes: + additionalProperties: true + type: object + title: Attributes + description: Key-value attributes associated with the file + file_id: + type: string + title: File Id + description: Unique identifier of the file containing the result + filename: + type: string + title: Filename + description: Name of the file containing the result + score: + type: number + title: Score + description: Relevance score for this search result (between 0 and 1) + text: + type: string + title: Text + description: Text content of the search result + type: object + required: + - attributes + - file_id + - filename + - score + - text + title: OpenAIResponseOutputMessageFileSearchToolCallResults + description: "Search results returned by the file search operation.\n\n:param attributes: (Optional) Key-value attributes associated with the file\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result (between 0 and 1)\n:param text: Text content of the search result" + OpenAIResponseOutputMessageFunctionToolCall: + properties: + call_id: + type: string + title: Call Id + description: Unique identifier for the function call + name: + type: string + title: Name + description: Name of the function being called + arguments: + type: string + title: Arguments + description: JSON string containing the function arguments + type: + type: string + const: function_call + title: Type + description: Tool call type identifier, always "function_call" + default: function_call + id: + anyOf: + - type: string + - type: 'null' + title: Id + description: Additional identifier for the tool call + status: + anyOf: + - type: string + - type: 'null' + title: Status + description: Current status of the function call execution + type: object + required: + - call_id + - name + - arguments + title: OpenAIResponseOutputMessageFunctionToolCall + description: "Function tool call output message for OpenAI responses.\n\n:param call_id: Unique identifier for the function call\n:param name: Name of the function being called\n:param arguments: JSON string containing the function arguments\n:param type: Tool call type identifier, always \"function_call\"\n:param id: (Optional) Additional identifier for the tool call\n:param status: (Optional) Current status of the function call execution" + OpenAIResponseOutputMessageMCPCall: + properties: + id: + type: string + title: Id + description: Unique identifier for this MCP call + type: + type: string + const: mcp_call + title: Type + description: Tool call type identifier, always "mcp_call" + default: mcp_call + arguments: + type: string + title: Arguments + description: JSON string containing the MCP call arguments + name: + type: string + title: Name + description: Name of the MCP method being called + server_label: + type: string + title: Server Label + description: Label identifying the MCP server handling the call + error: + anyOf: + - type: string + - type: 'null' + title: Error + description: Error message if the MCP call failed + output: + anyOf: + - type: string + - type: 'null' + title: Output + description: Output result from the successful MCP call + type: object + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + description: "Model Context Protocol (MCP) call output message for OpenAI responses.\n\n:param id: Unique identifier for this MCP call\n:param type: Tool call type identifier, always \"mcp_call\"\n:param arguments: JSON string containing the MCP call arguments\n:param name: Name of the MCP method being called\n:param server_label: Label identifying the MCP server handling the call\n:param error: (Optional) Error message if the MCP call failed\n:param output: (Optional) Output result from the successful MCP call" + OpenAIResponseOutputMessageMCPListTools: + properties: + id: + type: string + title: Id + description: Unique identifier for this MCP list tools operation + type: + type: string + const: mcp_list_tools + title: Type + description: Tool call type identifier, always "mcp_list_tools" + default: mcp_list_tools + server_label: + type: string + title: Server Label + description: Label identifying the MCP server providing the tools + tools: + items: + $ref: '#/components/schemas/MCPListToolsTool' + type: array + title: Tools + description: List of available tools provided by the MCP server + type: object + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + description: "MCP list tools output message containing available tools from an MCP server.\n\n:param id: Unique identifier for this MCP list tools operation\n:param type: Tool call type identifier, always \"mcp_list_tools\"\n:param server_label: Label identifying the MCP server providing the tools\n:param tools: List of available tools provided by the MCP server" + OpenAIResponseOutputMessageWebSearchToolCall: + properties: + id: + type: string + title: Id + description: Unique identifier for this tool call + status: + type: string + title: Status + description: Current status of the web search operation + type: + type: string + const: web_search_call + title: Type + description: Tool call type identifier, always "web_search_call" + default: web_search_call + type: object + required: + - id + - status + title: OpenAIResponseOutputMessageWebSearchToolCall + description: "Web search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param status: Current status of the web search operation\n:param type: Tool call type identifier, always \"web_search_call\"" + OpenAIResponsePrompt: + properties: + id: + type: string + title: Id + description: Unique identifier of the prompt template + variables: + anyOf: + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: object + - type: 'null' + title: Variables + description: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files. + version: + anyOf: + - type: string + - type: 'null' + title: Version + description: Version number of the prompt to use (defaults to latest if not specified) + type: object + required: + - id + title: OpenAIResponsePrompt + description: "OpenAI compatible Prompt object that is used in OpenAI responses.\n\n:param id: Unique identifier of the prompt template\n:param variables: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types\nlike images or files.\n:param version: Version number of the prompt to use (defaults to latest if not specified)" + OpenAIResponseText: + properties: + format: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseTextFormat' + - type: 'null' + description: Text format configuration specifying output format requirements + type: object + title: OpenAIResponseText + description: "Text response configuration for OpenAI responses.\n\n:param format: (Optional) Text format configuration specifying output format requirements" + OpenAIResponseTextFormat: + properties: + type: + anyOf: + - type: string + const: text + - type: string + const: json_schema + - type: string + const: json_object + title: Type + name: + anyOf: + - type: string + - type: 'null' + title: Name + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + type: object + title: OpenAIResponseTextFormat + description: "Configuration for Responses API text format.\n\n:param type: Must be \"text\", \"json_schema\", or \"json_object\" to identify the format type\n:param name: The name of the response format. Only used for json_schema.\n:param schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model. Only used for json_schema.\n:param description: (Optional) A description of the response format. Only used for json_schema.\n:param strict: (Optional) Whether to strictly enforce the JSON schema. If true, the response must match the schema exactly. Only used for json_schema." + OpenAIResponseToolMCP: + properties: + type: + type: string + const: mcp + title: Type + description: Tool type identifier, always "mcp" + default: mcp + server_label: + type: string + title: Server Label + description: Label to identify this MCP server + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + title: Allowed Tools + description: Restriction on which tools can be used from this server + type: object + required: + - server_label + title: OpenAIResponseToolMCP + description: "Model Context Protocol (MCP) tool configuration for OpenAI response object.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + OpenAIResponseUsage: + properties: + input_tokens: + type: integer + title: Input Tokens + description: Number of tokens in the input + output_tokens: + type: integer + title: Output Tokens + description: Number of tokens in the output + total_tokens: + type: integer + title: Total Tokens + description: Total tokens used (input + output) + input_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' + - type: 'null' + description: Detailed breakdown of input token usage + output_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + - type: 'null' + description: Detailed breakdown of output token usage + type: object + required: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + description: "Usage information for OpenAI response.\n\n:param input_tokens: Number of tokens in the input\n:param output_tokens: Number of tokens in the output\n:param total_tokens: Total tokens used (input + output)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + OpenAIResponseUsageInputTokensDetails: + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens + description: Number of tokens retrieved from cache + type: object + title: OpenAIResponseUsageInputTokensDetails + description: "Token details for input tokens in OpenAI response usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + OpenAIResponseUsageOutputTokensDetails: + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens + description: Number of tokens used for reasoning (o1/o3 models) + type: object + title: OpenAIResponseUsageOutputTokensDetails + description: "Token details for output tokens in OpenAI response usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + OpenAISystemMessageParam: + properties: + role: + type: string + const: system + title: Role + default: system + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + type: object + required: + - content + title: OpenAISystemMessageParam + description: A system message providing instructions or context to the model. + OpenAITokenLogProb: + properties: + token: + type: string + title: Token + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + type: number + title: Logprob + top_logprobs: + items: + $ref: '#/components/schemas/OpenAITopLogProb' + type: array + title: Top Logprobs + type: object + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + description: "The log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token\n:top_logprobs: The top log probabilities for the token" + OpenAIToolMessageParam: + properties: + role: + type: string + const: tool + title: Role + default: tool + tool_call_id: + type: string + title: Tool Call Id + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + type: object + required: + - tool_call_id + - content + title: OpenAIToolMessageParam + description: A message representing the result of a tool invocation in an OpenAI-compatible chat completion request. + OpenAITopLogProb: + properties: + token: + type: string + title: Token + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + type: number + title: Logprob + type: object + required: + - token + - logprob + title: OpenAITopLogProb + description: "The top log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token" + OpenAIUserMessageParam-Input: + properties: + role: + type: string + const: user + title: Role + default: user + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/OpenAIFile' + image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + type: object + required: + - content + title: OpenAIUserMessageParam + description: A message from the user in an OpenAI-compatible chat completion request. + OpenAIUserMessageParam-Output: + properties: + role: + type: string + const: user + title: Role + default: user + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/OpenAIFile' + image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + type: object + required: + - content + title: OpenAIUserMessageParam + description: A message from the user in an OpenAI-compatible chat completion request. + OptimizerConfig: + properties: + optimizer_type: + $ref: '#/components/schemas/OptimizerType' + lr: + type: number + title: Lr + weight_decay: + type: number + title: Weight Decay + num_warmup_steps: + type: integer + title: Num Warmup Steps + type: object + required: + - optimizer_type + - lr + - weight_decay + - num_warmup_steps + title: OptimizerConfig + description: Configuration parameters for the optimization algorithm. + OptimizerType: + type: string + enum: + - adam + - adamw + - sgd + title: OptimizerType + description: Available optimizer algorithms for training. + Order: + type: string + enum: + - asc + - desc + title: Order + description: Sort order for paginated responses. + OutputTokensDetails: + properties: + reasoning_tokens: + type: integer + title: Reasoning Tokens + additionalProperties: true + type: object + required: + - reasoning_tokens + title: OutputTokensDetails + PaginatedResponse: + properties: + data: + items: + additionalProperties: true + type: object + type: array + title: Data + description: The list of items for the current page. + has_more: + type: boolean + title: Has More + description: Whether there are more items available after this set. + url: + anyOf: + - type: string + - type: 'null' + title: Url + description: The URL for accessing this list. + type: object + required: + - data + - has_more + - url + title: PaginatedResponse + description: A generic paginated response that follows a simple format. + PostTrainingJob: + properties: + job_uuid: + type: string + title: Job Uuid + description: The UUID of the job + type: object + required: + - job_uuid + title: PostTrainingJob + PostTrainingJobArtifactsResponse: + properties: + job_uuid: + type: string + title: Job Uuid + description: The UUID of the job + checkpoints: + items: + $ref: '#/components/schemas/Checkpoint' + type: array + title: Checkpoints + type: object + required: + - job_uuid + title: PostTrainingJobArtifactsResponse + description: Artifacts of a finetuning job. + PostTrainingJobStatusResponse: + properties: + job_uuid: + type: string + title: Job Uuid + status: + $ref: '#/components/schemas/JobStatus' + scheduled_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Scheduled At + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + resources_allocated: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Resources Allocated + checkpoints: + items: + $ref: '#/components/schemas/Checkpoint' + type: array + title: Checkpoints + type: object + required: + - job_uuid + - status + title: PostTrainingJobStatusResponse + description: Status of a finetuning job. + PostTrainingMetric: + properties: + epoch: + type: integer + title: Epoch + description: Training epoch number. + train_loss: + type: number + title: Train Loss + description: Loss value on the training dataset. + validation_loss: + type: number + title: Validation Loss + description: Loss value on the validation dataset. + perplexity: + type: number + title: Perplexity + description: Perplexity metric indicating model confidence. + type: object + required: + - epoch + - train_loss + - validation_loss + - perplexity + title: PostTrainingMetric + description: Training metrics captured during post-training jobs. + PreferenceOptimizeRequest: + properties: + job_uuid: + type: string + title: Job Uuid + description: The UUID of the job to create + finetuned_model: + type: string + title: Finetuned Model + description: The model to fine-tune + algorithm_config: + $ref: '#/components/schemas/DPOAlignmentConfig' + description: The algorithm configuration + training_config: + $ref: '#/components/schemas/TrainingConfig' + description: The training configuration + hyperparam_search_config: + additionalProperties: true + type: object + title: Hyperparam Search Config + description: The hyperparam search configuration + logger_config: + additionalProperties: true + type: object + title: Logger Config + description: The logger configuration + type: object + required: + - job_uuid + - finetuned_model + - algorithm_config + - training_config + - hyperparam_search_config + - logger_config + title: PreferenceOptimizeRequest + description: Request to run preference optimization of a model. + Prompt: + properties: + prompt: + anyOf: + - type: string + - type: 'null' + title: Prompt + description: The system prompt text with variable placeholders. Variables are only supported when using the Responses API. + version: + type: integer + minimum: 1.0 + title: Version + description: Version (integer starting at 1, incremented on save). + prompt_id: + type: string + title: Prompt Id + description: Unique identifier formatted as 'pmpt_<48-digit-hash>'. + variables: + items: + type: string + type: array + title: Variables + description: List of prompt variable names that can be used in the prompt template. + is_default: + type: boolean + title: Is Default + description: Boolean indicating whether this version is the default version for this prompt. + default: false + type: object + required: + - version + - prompt_id + title: Prompt + description: A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack. + ProviderInfo: + properties: + api: + type: string + title: Api + description: The API name this provider implements + provider_id: + type: string + title: Provider Id + description: Unique identifier for the provider + provider_type: + type: string + title: Provider Type + description: The type of provider implementation + config: + additionalProperties: true + type: object + title: Config + description: Configuration parameters for the provider + health: + additionalProperties: true + type: object + title: Health + description: Current health status of the provider + type: object + required: + - api + - provider_id + - provider_type + - config + - health + title: ProviderInfo + description: Information about a registered provider including its configuration and health status. + QATFinetuningConfig: + properties: + type: + type: string + const: QAT + title: Type + default: QAT + quantizer_name: + type: string + title: Quantizer Name + group_size: + type: integer + title: Group Size + type: object + required: + - quantizer_name + - group_size + title: QATFinetuningConfig + description: Configuration for Quantization-Aware Training (QAT) fine-tuning. + QueryChunksRequest: + properties: + vector_store_id: + type: string + title: Vector Store Id + description: The identifier of the vector database to query. + query: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Query + description: The query to search for. + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + description: The parameters of the query. + type: object + required: + - vector_store_id + - query + title: QueryChunksRequest + description: Request to query chunks from a vector database. + QueryChunksResponse: + properties: + chunks: + items: + $ref: '#/components/schemas/Chunk-Output' + type: array + title: Chunks + scores: + items: + type: number + type: array + title: Scores + type: object + required: + - chunks + - scores + title: QueryChunksResponse + description: Response from querying chunks in a vector database. + RAGDocument: + properties: + document_id: + type: string + title: Document Id + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + title: Content + mime_type: + anyOf: + - type: string + - type: 'null' + title: Mime Type + metadata: + additionalProperties: true + type: object + title: Metadata + type: object + required: + - document_id + - content + title: RAGDocument + description: "A document to be used for document ingestion in the RAG Tool.\n\n:param document_id: The unique identifier for the document.\n:param content: The content of the document.\n:param mime_type: The MIME type of the document.\n:param metadata: Additional metadata for the document." + RAGQueryConfig: + properties: + query_generator_config: + oneOf: + - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' + title: Query Generator Config + default: + type: default + separator: ' ' + discriminator: + propertyName: type + mapping: + default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' + max_tokens_in_context: + type: integer + title: Max Tokens In Context + default: 4096 + max_chunks: + type: integer + title: Max Chunks + default: 5 + chunk_template: + type: string + title: Chunk Template + default: "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n" + mode: + anyOf: + - $ref: '#/components/schemas/RAGSearchMode' + - type: 'null' + default: vector + ranker: + anyOf: + - oneOf: + - $ref: '#/components/schemas/RRFRanker' + - $ref: '#/components/schemas/WeightedRanker' + discriminator: + propertyName: type + mapping: + rrf: '#/components/schemas/RRFRanker' + weighted: '#/components/schemas/WeightedRanker' + - type: 'null' + title: Ranker + type: object + title: RAGQueryConfig + description: "Configuration for the RAG query generation.\n\n:param query_generator_config: Configuration for the query generator.\n:param max_tokens_in_context: Maximum number of tokens in the context.\n:param max_chunks: Maximum number of chunks to retrieve.\n:param chunk_template: Template for formatting each retrieved chunk in the context.\n Available placeholders: {index} (1-based chunk ordinal), {chunk.content} (chunk content string), {metadata} (chunk metadata dict).\n Default: \"Result {index}\\nContent: {chunk.content}\\nMetadata: {metadata}\\n\"\n:param mode: Search mode for retrieval—either \"vector\", \"keyword\", or \"hybrid\". Default \"vector\".\n:param ranker: Configuration for the ranker to use in hybrid search. Defaults to RRF ranker." + RAGQueryResult: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + title: Content + metadata: + additionalProperties: true + type: object + title: Metadata + type: object + title: RAGQueryResult + description: "Result of a RAG query containing retrieved content and metadata.\n\n:param content: (Optional) The retrieved content from the query\n:param metadata: Additional metadata about the query result" + RAGSearchMode: + type: string + enum: + - vector + - keyword + - hybrid + title: RAGSearchMode + description: "Search modes for RAG query retrieval:\n- VECTOR: Uses vector similarity search for semantic matching\n- KEYWORD: Uses keyword-based search for exact matching\n- HYBRID: Combines both vector and keyword search for better results" + RRFRanker: + properties: + type: + type: string + const: rrf + title: Type + default: rrf + impact_factor: + type: number + title: Impact Factor + default: 60.0 + minimum: 0.0 + type: object + title: RRFRanker + description: "Reciprocal Rank Fusion (RRF) ranker configuration.\n\n:param type: The type of ranker, always \"rrf\"\n:param impact_factor: The impact factor for RRF scoring. Higher values give more weight to higher-ranked results.\n Must be greater than 0" + RegexParserScoringFnParams: + properties: + type: + type: string + const: regex_parser + title: Type + default: regex_parser + parsing_regexes: + items: + type: string + type: array + title: Parsing Regexes + description: Regex to extract the answer from generated response + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row + type: object + title: RegexParserScoringFnParams + description: Parameters for regex parser scoring function configuration. + RegisterBenchmarkRequest: + properties: + benchmark_id: + type: string + title: Benchmark Id + description: The ID of the benchmark to register + dataset_id: + type: string + title: Dataset Id + description: The ID of the dataset to use for the benchmark + scoring_functions: + items: + type: string + type: array + title: Scoring Functions + description: The scoring functions to use for the benchmark + provider_benchmark_id: + anyOf: + - type: string + - type: 'null' + title: Provider Benchmark Id + description: The ID of the provider benchmark to use for the benchmark + provider_id: + anyOf: + - type: string + - type: 'null' + title: Provider Id + description: The ID of the provider to use for the benchmark + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: The metadata to use for the benchmark + type: object + required: + - benchmark_id + - dataset_id + - scoring_functions + title: RegisterBenchmarkRequest + description: Request model for registering a benchmark. + RegisterDatasetRequest: + properties: + purpose: + $ref: '#/components/schemas/DatasetPurpose' + description: The purpose of the dataset + source: + oneOf: + - $ref: '#/components/schemas/URIDataSource' + - $ref: '#/components/schemas/RowsDataSource' + title: Source + description: The data source of the dataset + discriminator: + propertyName: type + mapping: + rows: '#/components/schemas/RowsDataSource' + uri: '#/components/schemas/URIDataSource' + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: The metadata for the dataset + dataset_id: + anyOf: + - type: string + - type: 'null' + title: Dataset Id + description: The ID of the dataset. If not provided, an ID will be generated + type: object + required: + - purpose + - source + title: RegisterDatasetRequest + description: Request model for registering a dataset. + RegisterModelRequest: + properties: + model_id: + type: string + title: Model Id + description: The identifier of the model to register. + provider_model_id: + anyOf: + - type: string + - type: 'null' + title: Provider Model Id + description: The identifier of the model in the provider. + provider_id: + anyOf: + - type: string + - type: 'null' + title: Provider Id + description: The identifier of the provider. + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Any additional metadata for this model. + model_type: + anyOf: + - $ref: '#/components/schemas/ModelType' + - type: 'null' + description: The type of model to register. + type: object + required: + - model_id + title: RegisterModelRequest + description: Request model for registering a new model. + RegisterScoringFunctionRequest: + properties: + scoring_fn_id: + type: string + title: Scoring Fn Id + description: The ID of the scoring function to register + description: + type: string + title: Description + description: The description of the scoring function + return_type: + oneOf: + - $ref: '#/components/schemas/StringType' + - $ref: '#/components/schemas/NumberType' + - $ref: '#/components/schemas/BooleanType' + - $ref: '#/components/schemas/ArrayType' + - $ref: '#/components/schemas/ObjectType' + - $ref: '#/components/schemas/JsonType' + - $ref: '#/components/schemas/UnionType' + - $ref: '#/components/schemas/ChatCompletionInputType' + - $ref: '#/components/schemas/CompletionInputType' + - $ref: '#/components/schemas/AgentTurnInputType' + title: Return Type + description: The return type of the scoring function + discriminator: + propertyName: type + mapping: + agent_turn_input: '#/components/schemas/AgentTurnInputType' + array: '#/components/schemas/ArrayType' + boolean: '#/components/schemas/BooleanType' + chat_completion_input: '#/components/schemas/ChatCompletionInputType' + completion_input: '#/components/schemas/CompletionInputType' + json: '#/components/schemas/JsonType' + number: '#/components/schemas/NumberType' + object: '#/components/schemas/ObjectType' + string: '#/components/schemas/StringType' + union: '#/components/schemas/UnionType' + provider_scoring_fn_id: + anyOf: + - type: string + - type: 'null' + title: Provider Scoring Fn Id + description: The ID of the provider scoring function to use for the scoring function + provider_id: + anyOf: + - type: string + - type: 'null' + title: Provider Id + description: The ID of the provider to use for the scoring function + params: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' + title: Params + description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval + type: object + required: + - scoring_fn_id + - description + - return_type + title: RegisterScoringFunctionRequest + description: Request model for registering a scoring function. + RegisterShieldRequest: + properties: + shield_id: + type: string + title: Shield Id + description: The identifier of the shield to register + provider_shield_id: + anyOf: + - type: string + - type: 'null' + title: Provider Shield Id + description: The identifier of the shield in the provider + provider_id: + anyOf: + - type: string + - type: 'null' + title: Provider Id + description: The identifier of the provider + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + description: The parameters of the shield + type: object + required: + - shield_id + title: RegisterShieldRequest + description: Request model for registering a shield. + RegisterToolGroupRequest: + properties: + toolgroup_id: + type: string + title: Toolgroup Id + description: The ID of the tool group to register + provider_id: + type: string + title: Provider Id + description: The ID of the provider to use for the tool group + mcp_endpoint: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + description: The MCP endpoint to use for the tool group + args: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Args + description: A dictionary of arguments to pass to the tool group + type: object + required: + - toolgroup_id + - provider_id + title: RegisterToolGroupRequest + description: Request model for registering a tool group. + RerankData: + properties: + index: + type: integer + title: Index + relevance_score: + type: number + title: Relevance Score + type: object + required: + - index + - relevance_score + title: RerankData + description: A single rerank result from a reranking response. + RerankResponse: + properties: + data: + items: + $ref: '#/components/schemas/RerankData' + type: array + title: Data + type: object + required: + - data + title: RerankResponse + description: Response from a reranking request. + ResponseGuardrailSpec: + properties: + type: + type: string + title: Type + description: The type/identifier of the guardrail. + type: object + required: + - type + title: ResponseGuardrailSpec + description: Specification for a guardrail to apply during response generation. + RouteInfo: + properties: + route: + type: string + title: Route + description: The API endpoint path + method: + type: string + title: Method + description: HTTP method for the route + provider_types: + items: + type: string + type: array + title: Provider Types + description: List of provider types that implement this route + type: object + required: + - route + - method + - provider_types + title: RouteInfo + description: Information about an API route including its path, method, and implementing providers. + RowsDataSource: + properties: + type: + type: string + const: rows + title: Type + description: The type of data source + default: rows + rows: + items: + additionalProperties: true + type: object + type: array + title: Rows + description: "The dataset is stored in rows. E.g. [{'messages': [{'role': 'user', 'content': 'Hello, world!'}, {'role': 'assistant', 'content': 'Hello, world!'}]}]" + type: object + required: + - rows + title: RowsDataSource + description: A dataset stored in rows. + RunModerationRequest: + properties: + input: + anyOf: + - type: string + - items: + type: string + type: array + title: Input + description: Input (or inputs) to classify. Can be a single string, an array of strings, or an array of multi-modal input objects similar to other models. + model: + anyOf: + - type: string + - type: 'null' + title: Model + description: The content moderation model you would like to use. + type: object + required: + - input + title: RunModerationRequest + description: Request model for running moderation. + RunShieldRequest: + properties: + shield_id: + type: string + title: Shield Id + description: The identifier of the shield to run. + messages: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Input' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Input' + type: array + title: Messages + description: The messages to run the shield on. + params: + additionalProperties: true + type: object + title: Params + description: The parameters of the shield. + type: object + required: + - shield_id + - messages + - params + title: RunShieldRequest + description: Request model for running a shield. + RunShieldResponse: + properties: + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + description: Safety violation detected by the shield, if any. + type: object + title: RunShieldResponse + description: Response from running a safety shield. + SafetyViolation: + properties: + violation_level: + $ref: '#/components/schemas/ViolationLevel' + description: Severity level of the violation. + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + description: Message to convey to the user about the violation. + metadata: + additionalProperties: true + type: object + title: Metadata + description: Additional metadata including specific violation codes for debugging and telemetry. + type: object + required: + - violation_level + title: SafetyViolation + description: Details of a safety violation detected by content moderation. + SamplingParams: + properties: + strategy: + oneOf: + - $ref: '#/components/schemas/GreedySamplingStrategy' + - $ref: '#/components/schemas/TopPSamplingStrategy' + - $ref: '#/components/schemas/TopKSamplingStrategy' + title: Strategy + discriminator: + propertyName: type + mapping: + greedy: '#/components/schemas/GreedySamplingStrategy' + top_k: '#/components/schemas/TopKSamplingStrategy' + top_p: '#/components/schemas/TopPSamplingStrategy' + max_tokens: + anyOf: + - type: integer + minimum: 0.0 + - type: 'null' + title: Max Tokens + repetition_penalty: + anyOf: + - type: number + minimum: 0.0 + - type: 'null' + title: Repetition Penalty + default: 1.0 + stop: + anyOf: + - items: + type: string + type: array + minItems: 1 + - type: 'null' + title: Stop + type: object + title: SamplingParams + description: Sampling parameters. + ScoreBatchRequest: + properties: + dataset_id: + type: string + title: Dataset Id + description: The ID of the dataset to score + scoring_functions: + additionalProperties: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' + type: object + title: Scoring Functions + description: The scoring functions to use for the scoring + save_results_dataset: + type: boolean + title: Save Results Dataset + description: Whether to save the results to a dataset + default: false + type: object + required: + - dataset_id + - scoring_functions + title: ScoreBatchRequest + description: Request for batch scoring operations. + ScoreBatchResponse: + properties: + dataset_id: + anyOf: + - type: string + - type: 'null' + title: Dataset Id + description: The identifier of the dataset that was scored + results: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' + type: object + title: Results + description: A map of scoring function name to ScoringResult + type: object + required: + - results + title: ScoreBatchResponse + description: Response from batch scoring operations on datasets. + ScoreRequest: + properties: + input_rows: + items: + additionalProperties: true + type: object + type: array + title: Input Rows + description: The rows to score + scoring_functions: + additionalProperties: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' + type: object + title: Scoring Functions + description: The scoring functions to use for the scoring + type: object + required: + - input_rows + - scoring_functions + title: ScoreRequest + description: Request for scoring a list of rows. + ScoreResponse: + properties: + results: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' + type: object + title: Results + description: A map of scoring function name to ScoringResult + type: object + required: + - results + title: ScoreResponse + description: The response from scoring. + ScoringFn: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: scoring_function + title: Type + default: scoring_function + description: + anyOf: + - type: string + - type: 'null' + title: Description + metadata: + additionalProperties: true + type: object + title: Metadata + description: Any additional metadata for this definition + return_type: + oneOf: + - $ref: '#/components/schemas/StringType' + - $ref: '#/components/schemas/NumberType' + - $ref: '#/components/schemas/BooleanType' + - $ref: '#/components/schemas/ArrayType' + - $ref: '#/components/schemas/ObjectType' + - $ref: '#/components/schemas/JsonType' + - $ref: '#/components/schemas/UnionType' + - $ref: '#/components/schemas/ChatCompletionInputType' + - $ref: '#/components/schemas/CompletionInputType' + - $ref: '#/components/schemas/AgentTurnInputType' + title: Return Type + description: The return type of the deterministic function + discriminator: + propertyName: type + mapping: + agent_turn_input: '#/components/schemas/AgentTurnInputType' + array: '#/components/schemas/ArrayType' + boolean: '#/components/schemas/BooleanType' + chat_completion_input: '#/components/schemas/ChatCompletionInputType' + completion_input: '#/components/schemas/CompletionInputType' + json: '#/components/schemas/JsonType' + number: '#/components/schemas/NumberType' + object: '#/components/schemas/ObjectType' + string: '#/components/schemas/StringType' + union: '#/components/schemas/UnionType' + params: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' + title: Params + description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval + type: object + required: + - identifier + - provider_id + - return_type + title: ScoringFn + description: A scoring function resource for evaluating model outputs. + ScoringResult: + properties: + score_rows: + items: + additionalProperties: true + type: object + type: array + title: Score Rows + description: The scoring result for each row. Each row is a map of column name to value + aggregated_results: + additionalProperties: true + type: object + title: Aggregated Results + description: Map of metric name to aggregated value + type: object + required: + - score_rows + - aggregated_results + title: ScoringResult + description: A scoring result for a single row. + SearchRankingOptions: + properties: + ranker: + anyOf: + - type: string + - type: 'null' + title: Ranker + score_threshold: + anyOf: + - type: number + - type: 'null' + title: Score Threshold + default: 0.0 + type: object + title: SearchRankingOptions + description: Options for ranking and filtering search results. + Session: + properties: + session_id: + type: string + title: Session Id + description: Unique identifier for the conversation session + session_name: + type: string + title: Session Name + description: Human-readable name for the session + turns: + items: + $ref: '#/components/schemas/Turn' + type: array + title: Turns + description: List of all turns that have occurred in this session + started_at: + type: string + format: date-time + title: Started At + description: Timestamp when the session was created + type: object + required: + - session_id + - session_name + - turns + - started_at + title: Session + description: A single session of an interaction with an Agentic System. + SetDefaultVersionRequest: + properties: + version: + type: integer + title: Version + description: The version to set as default. + type: object + required: + - version + title: SetDefaultVersionRequest + description: Request model for setting a prompt version as default. + Shield: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: shield + title: Type + description: The resource type, always shield + default: shield + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + description: Configuration parameters for the shield + type: object + required: + - identifier + - provider_id + title: Shield + description: A safety shield resource that can be used to check content. + ShieldCallStep-Input: + properties: + turn_id: + type: string + title: Turn Id + description: The ID of the turn. + step_id: + type: string + title: Step Id + description: The ID of the step. + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At + description: The time the step started. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: The time the step completed. + step_type: + type: string + const: shield_call + title: Step Type + default: shield_call + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + description: The violation from the shield call. + type: object + required: + - turn_id + - step_id + title: ShieldCallStep + description: A shield call step in an agent turn. + ShieldCallStep-Output: + properties: + turn_id: + type: string + title: Turn Id + description: The ID of the turn. + step_id: + type: string + title: Step Id + description: The ID of the step. + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At + description: The time the step started. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: The time the step completed. + step_type: + type: string + const: shield_call + title: Step Type + default: shield_call + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + description: The violation from the shield call. + type: object + required: + - turn_id + - step_id + title: ShieldCallStep + description: A shield call step in an agent turn. + StopReason: + type: string + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + StringType: + properties: + type: + type: string + const: string + title: Type + default: string + type: object + title: StringType + description: "Parameter type for string values.\n\n:param type: Discriminator type. Always \"string\"" + SupervisedFineTuneRequest: + properties: + job_uuid: + type: string + title: Job Uuid + description: The UUID of the job to create + training_config: + $ref: '#/components/schemas/TrainingConfig' + description: The training configuration + hyperparam_search_config: + additionalProperties: true + type: object + title: Hyperparam Search Config + description: The hyperparam search configuration + logger_config: + additionalProperties: true + type: object + title: Logger Config + description: The logger configuration + model: + anyOf: + - type: string + - type: 'null' + title: Model + description: Model descriptor for training if not in provider config` + checkpoint_dir: + anyOf: + - type: string + - type: 'null' + title: Checkpoint Dir + description: The directory to save checkpoint(s) to + algorithm_config: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LoraFinetuningConfig' + - $ref: '#/components/schemas/QATFinetuningConfig' + discriminator: + propertyName: type + mapping: + LoRA: '#/components/schemas/LoraFinetuningConfig' + QAT: '#/components/schemas/QATFinetuningConfig' + - type: 'null' + title: Algorithm Config + description: The algorithm configuration + type: object + required: + - job_uuid + - training_config + - hyperparam_search_config + - logger_config + title: SupervisedFineTuneRequest + description: Request to run supervised fine-tuning of a model. + SystemMessage: + properties: + role: + type: string + const: system + title: Role + default: system + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + type: object + required: + - content + title: SystemMessage + description: A system message providing instructions or context to the model. + SystemMessageBehavior: + type: string + enum: + - append + - replace + title: SystemMessageBehavior + description: "Config for how to override the default system prompt.\n\nhttps://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt-\n'{{function_definitions}}' to indicate where the function definitions should be inserted." + TextContentItem: + properties: + type: + type: string + const: text + title: Type + default: text + text: + type: string + title: Text + type: object + required: + - text + title: TextContentItem + description: A text content item. + ToolCall: + properties: + call_id: + type: string + title: Call Id + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + type: string + title: Arguments + type: object + required: + - call_id + - tool_name + - arguments + title: ToolCall + ToolChoice: + type: string + enum: + - auto + - required + - none + title: ToolChoice + description: Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model. + ToolConfig: + properties: + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: string + - type: 'null' + title: Tool Choice + default: auto + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + system_message_behavior: + anyOf: + - $ref: '#/components/schemas/SystemMessageBehavior' + - type: 'null' + default: append + type: object + title: ToolConfig + description: "Configuration for tool use.\n\n- `ToolPromptFormat.json`: The tool calls are formatted as a JSON object.\n- `ToolPromptFormat.function_tag`: The tool calls are enclosed in a tag.\n- `ToolPromptFormat.python_list`: The tool calls are output as Python syntax -- a list of function calls.\n- `SystemMessageBehavior.append`: Appends the provided system message to the default system prompt.\n- `SystemMessageBehavior.replace`: Replaces the default system prompt with the provided system message. The system message can include the string\n '{{function_definitions}}' to indicate where the function definitions should be inserted." + ToolDef: + properties: + toolgroup_id: + anyOf: + - type: string + - type: 'null' + title: Toolgroup Id + description: ID of the tool group this tool belongs to + name: + type: string + title: Name + description: Name of the tool + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Human-readable description of what the tool does + input_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Input Schema + description: JSON Schema for tool inputs (MCP inputSchema) + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Output Schema + description: JSON Schema for tool outputs (MCP outputSchema) + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Additional metadata about the tool + type: object + required: + - name + title: ToolDef + description: Tool definition used in runtime contexts. + ToolExecutionStep-Input: + properties: + turn_id: + type: string + title: Turn Id + description: The ID of the turn. + step_id: + type: string + title: Step Id + description: The ID of the step. + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At + description: The time the step started. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: The time the step completed. + step_type: + type: string + const: tool_execution + title: Step Type + default: tool_execution + tool_calls: + items: + $ref: '#/components/schemas/ToolCall' + type: array + title: Tool Calls + description: The tool calls to execute. + tool_responses: + items: + $ref: '#/components/schemas/ToolResponse-Input' + type: array + title: Tool Responses + description: The tool responses from the tool calls. + type: object + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + description: A tool execution step in an agent turn. + ToolExecutionStep-Output: + properties: + turn_id: + type: string + title: Turn Id + description: The ID of the turn. + step_id: + type: string + title: Step Id + description: The ID of the step. + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At + description: The time the step started. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: The time the step completed. + step_type: + type: string + const: tool_execution + title: Step Type + default: tool_execution + tool_calls: + items: + $ref: '#/components/schemas/ToolCall' + type: array + title: Tool Calls + description: The tool calls to execute. + tool_responses: + items: + $ref: '#/components/schemas/ToolResponse-Output' + type: array + title: Tool Responses + description: The tool responses from the tool calls. + type: object + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + description: A tool execution step in an agent turn. + ToolGroup: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: tool_group + title: Type + description: Type of resource, always 'tool_group' + default: tool_group + mcp_endpoint: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + description: Model Context Protocol endpoint for remote tools + args: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Args + description: Additional arguments for the tool group + type: object + required: + - identifier + - provider_id + title: ToolGroup + description: A group of related tools managed together. + ToolInvocationResult: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + title: Content + description: The output content from the tool execution + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + description: Error message if the tool execution failed + error_code: + anyOf: + - type: integer + - type: 'null' + title: Error Code + description: Numeric error code if the tool execution failed + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Additional metadata about the tool execution + type: object + title: ToolInvocationResult + description: Result of a tool invocation. + ToolPromptFormat: + type: string + enum: + - json + - function_tag + - python_list + title: ToolPromptFormat + description: "Prompt format for calling custom / zero shot tools.\n\n:cvar json: JSON format for calling tools. It takes the form:\n {\n \"type\": \"function\",\n \"function\" : {\n \"name\": \"function_name\",\n \"description\": \"function_description\",\n \"parameters\": {...}\n }\n }\n:cvar function_tag: Function tag format, pseudo-XML. This looks like:\n (parameters)\n\n:cvar python_list: Python list. The output is a valid Python expression that can be\n evaluated to a list. Each element in the list is a function call. Example:\n [\"function_name(param1, param2)\", \"function_name(param1, param2)\"]" + ToolResponse-Input: + properties: + call_id: + type: string + minLength: 1 + title: Call Id + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + type: object + required: + - call_id + - tool_name + - content + title: ToolResponse + description: Response from a tool invocation. + ToolResponse-Output: + properties: + call_id: + type: string + minLength: 1 + title: Call Id + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + type: object + required: + - call_id + - tool_name + - content + title: ToolResponse + description: Response from a tool invocation. + ToolResponseMessage-Input: + properties: + role: + type: string + const: tool + title: Role + default: tool + call_id: + type: string + title: Call Id + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + type: object + required: + - call_id + - content + title: ToolResponseMessage + description: A message representing the result of a tool invocation. + ToolResponseMessage-Output: + properties: + role: + type: string + const: tool + title: Role + default: tool + call_id: + type: string + title: Call Id + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + type: object + required: + - call_id + - content + title: ToolResponseMessage + description: A message representing the result of a tool invocation. + TopKSamplingStrategy: + properties: + type: + type: string + const: top_k + title: Type + default: top_k + top_k: + type: integer + minimum: 1.0 + title: Top K + type: object + required: + - top_k + title: TopKSamplingStrategy + description: Top-k sampling strategy that restricts sampling to the k most likely tokens. + TopPSamplingStrategy: + properties: + type: + type: string + const: top_p + title: Type + default: top_p + temperature: + anyOf: + - type: number + minimum: 0.0 + - type: 'null' + title: Temperature + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + default: 0.95 + type: object + required: + - temperature + title: TopPSamplingStrategy + description: Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p. + TrainingConfig: + properties: + n_epochs: + type: integer + title: N Epochs + max_steps_per_epoch: + type: integer + title: Max Steps Per Epoch + default: 1 + gradient_accumulation_steps: + type: integer + title: Gradient Accumulation Steps + default: 1 + max_validation_steps: + anyOf: + - type: integer + - type: 'null' + title: Max Validation Steps + default: 1 + data_config: + anyOf: + - $ref: '#/components/schemas/DataConfig' + - type: 'null' + optimizer_config: + anyOf: + - $ref: '#/components/schemas/OptimizerConfig' + - type: 'null' + efficiency_config: + anyOf: + - $ref: '#/components/schemas/EfficiencyConfig' + - type: 'null' + dtype: + anyOf: + - type: string + - type: 'null' + title: Dtype + default: bf16 + type: object + required: + - n_epochs + title: TrainingConfig + description: Comprehensive configuration for the training process. + Turn: + properties: + turn_id: + type: string + title: Turn Id + description: Unique identifier for the turn within a session + session_id: + type: string + title: Session Id + description: Unique identifier for the conversation session + input_messages: + items: + anyOf: + - $ref: '#/components/schemas/UserMessage-Output' + - $ref: '#/components/schemas/ToolResponseMessage-Output' + type: array + title: Input Messages + description: List of messages that initiated this turn + steps: + items: + oneOf: + - $ref: '#/components/schemas/InferenceStep-Output' + - $ref: '#/components/schemas/ToolExecutionStep-Output' + - $ref: '#/components/schemas/ShieldCallStep-Output' + - $ref: '#/components/schemas/MemoryRetrievalStep-Output' + discriminator: + propertyName: step_type + mapping: + inference: '#/components/schemas/InferenceStep-Output' + memory_retrieval: '#/components/schemas/MemoryRetrievalStep-Output' + shield_call: '#/components/schemas/ShieldCallStep-Output' + tool_execution: '#/components/schemas/ToolExecutionStep-Output' + type: array + title: Steps + description: Ordered list of processing steps executed during this turn + output_message: + $ref: '#/components/schemas/CompletionMessage-Output' + description: The model's generated response containing content and metadata + output_attachments: + anyOf: + - items: + $ref: '#/components/schemas/Attachment-Output' + type: array + - type: 'null' + title: Output Attachments + description: Files or media attached to the agent's response + started_at: + type: string + format: date-time + title: Started At + description: Timestamp when the turn began + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: Timestamp when the turn finished, if completed + type: object + required: + - turn_id + - session_id + - input_messages + - steps + - output_message + - started_at + title: Turn + description: A single turn in an interaction with an Agentic System. + URIDataSource: + properties: + type: + type: string + const: uri + title: Type + description: The type of data source + default: uri + uri: + type: string + title: Uri + description: The dataset can be obtained from a URI. E.g. 'https://mywebsite.com/mydata.jsonl', 'lsfs://mydata.jsonl', 'data:csv;base64,{base64_content}' + type: object + required: + - uri + title: URIDataSource + description: A dataset that can be obtained from a URI. + URL: + properties: + uri: + type: string + title: Uri + type: object + required: + - uri + title: URL + description: A URL reference to external content. + UnionType: + properties: + type: + type: string + const: union + title: Type + default: union + type: object + title: UnionType + description: "Parameter type for union values.\n\n:param type: Discriminator type. Always \"union\"" + UpdatePromptRequest: + properties: + prompt: + type: string + title: Prompt + description: The updated prompt text content. + version: + type: integer + title: Version + description: The current version of the prompt being updated. + variables: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Variables + description: Updated list of variable names that can be used in the prompt template. + set_as_default: + type: boolean + title: Set As Default + description: Set the new version as the default (default=True). + default: true + type: object + required: + - prompt + - version + title: UpdatePromptRequest + description: Request model for updating an existing prompt. + UserMessage-Input: + properties: + role: + type: string + const: user + title: Role + default: user + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + title: Context + type: object + required: + - content + title: UserMessage + description: A message from the user in a chat conversation. + UserMessage-Output: + properties: + role: + type: string + const: user + title: Role + default: user + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + title: Context + type: object + required: + - content + title: UserMessage + description: A message from the user in a chat conversation. + VectorStoreChunkingStrategyAuto: + properties: + type: + type: string + const: auto + title: Type + default: auto + type: object + title: VectorStoreChunkingStrategyAuto + description: Automatic chunking strategy for vector store files. + VectorStoreChunkingStrategyStatic: + properties: + type: + type: string + const: static + title: Type + default: static + static: + $ref: '#/components/schemas/VectorStoreChunkingStrategyStaticConfig' + type: object + required: + - static + title: VectorStoreChunkingStrategyStatic + description: Static chunking strategy with configurable parameters. + VectorStoreChunkingStrategyStaticConfig: + properties: + chunk_overlap_tokens: + type: integer + title: Chunk Overlap Tokens + default: 400 + max_chunk_size_tokens: + type: integer + maximum: 4096.0 + minimum: 100.0 + title: Max Chunk Size Tokens + default: 800 + type: object + title: VectorStoreChunkingStrategyStaticConfig + description: Configuration for static chunking strategy. + VectorStoreContent: + properties: + type: + type: string + const: text + title: Type + text: + type: string + title: Text + type: object + required: + - type + - text + title: VectorStoreContent + description: Content item from a vector store file or search result. + VectorStoreDeleteResponse: + properties: + id: + type: string + title: Id + object: + type: string + title: Object + default: vector_store.deleted + deleted: + type: boolean + title: Deleted + default: true + type: object + required: + - id + title: VectorStoreDeleteResponse + description: Response from deleting a vector store. + VectorStoreFileBatchObject: + properties: + id: + type: string + title: Id + object: + type: string + title: Object + default: vector_store.file_batch + created_at: + type: integer + title: Created At + vector_store_id: + type: string + title: Vector Store Id + status: + anyOf: + - type: string + const: completed + - type: string + const: in_progress + - type: string + const: cancelled + - type: string + const: failed + title: Status + file_counts: + $ref: '#/components/schemas/VectorStoreFileCounts' + type: object + required: + - id + - created_at + - vector_store_id + - status + - file_counts + title: VectorStoreFileBatchObject + description: OpenAI Vector Store File Batch object. + VectorStoreFileContentsResponse: + properties: + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + attributes: + additionalProperties: true + type: object + title: Attributes + content: + items: + $ref: '#/components/schemas/VectorStoreContent' + type: array + title: Content + type: object + required: + - file_id + - filename + - attributes + - content + title: VectorStoreFileContentsResponse + description: Response from retrieving the contents of a vector store file. + VectorStoreFileCounts: + properties: + completed: + type: integer + title: Completed + cancelled: + type: integer + title: Cancelled + failed: + type: integer + title: Failed + in_progress: + type: integer + title: In Progress + total: + type: integer + title: Total + type: object + required: + - completed + - cancelled + - failed + - in_progress + - total + title: VectorStoreFileCounts + description: File processing status counts for a vector store. + VectorStoreFileDeleteResponse: + properties: + id: + type: string + title: Id + object: + type: string + title: Object + default: vector_store.file.deleted + deleted: + type: boolean + title: Deleted + default: true + type: object + required: + - id + title: VectorStoreFileDeleteResponse + description: Response from deleting a vector store file. + VectorStoreFileLastError: + properties: + code: + anyOf: + - type: string + const: server_error + - type: string + const: rate_limit_exceeded + title: Code + message: + type: string + title: Message + type: object + required: + - code + - message + title: VectorStoreFileLastError + description: Error information for failed vector store file processing. + VectorStoreFileObject: + properties: + id: + type: string + title: Id + object: + type: string + title: Object + default: vector_store.file + attributes: + additionalProperties: true + type: object + title: Attributes + chunking_strategy: + oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + title: Chunking Strategy + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + created_at: + type: integer + title: Created At + last_error: + anyOf: + - $ref: '#/components/schemas/VectorStoreFileLastError' + - type: 'null' + status: + anyOf: + - type: string + const: completed + - type: string + const: in_progress + - type: string + const: cancelled + - type: string + const: failed + title: Status + usage_bytes: + type: integer + title: Usage Bytes + default: 0 + vector_store_id: + type: string + title: Vector Store Id + type: object + required: + - id + - chunking_strategy + - created_at + - status + - vector_store_id + title: VectorStoreFileObject + description: OpenAI Vector Store File object. + VectorStoreFilesListInBatchResponse: + properties: + object: + type: string + title: Object + default: list + data: + items: + $ref: '#/components/schemas/VectorStoreFileObject' + type: array + title: Data + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + has_more: + type: boolean + title: Has More + default: false + type: object + required: + - data + title: VectorStoreFilesListInBatchResponse + description: Response from listing files in a vector store file batch. + VectorStoreListFilesResponse: + properties: + object: + type: string + title: Object + default: list + data: + items: + $ref: '#/components/schemas/VectorStoreFileObject' + type: array + title: Data + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + has_more: + type: boolean + title: Has More + default: false + type: object + required: + - data + title: VectorStoreListFilesResponse + description: Response from listing files in a vector store. + VectorStoreListResponse: + properties: + object: + type: string + title: Object + default: list + data: + items: + $ref: '#/components/schemas/VectorStoreObject' + type: array + title: Data + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + has_more: + type: boolean + title: Has More + default: false + type: object + required: + - data + title: VectorStoreListResponse + description: Response from listing vector stores. + VectorStoreModifyRequest: + properties: + name: + anyOf: + - type: string + - type: 'null' + title: Name + expires_after: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + type: object + title: VectorStoreModifyRequest + description: Request to modify a vector store. + VectorStoreObject: + properties: + id: + type: string + title: Id + object: + type: string + title: Object + default: vector_store + created_at: + type: integer + title: Created At + name: + anyOf: + - type: string + - type: 'null' + title: Name + usage_bytes: + type: integer + title: Usage Bytes + default: 0 + file_counts: + $ref: '#/components/schemas/VectorStoreFileCounts' + status: + type: string + title: Status + default: completed + expires_after: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After + expires_at: + anyOf: + - type: integer + - type: 'null' + title: Expires At + last_active_at: + anyOf: + - type: integer + - type: 'null' + title: Last Active At + metadata: + additionalProperties: true + type: object + title: Metadata + type: object + required: + - id + - created_at + - file_counts + title: VectorStoreObject + description: OpenAI Vector Store object. + VectorStoreSearchResponse: + properties: + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + score: + type: number + title: Score + attributes: + anyOf: + - additionalProperties: + anyOf: + - type: string + - type: number + - type: boolean + type: object + - type: 'null' + title: Attributes + content: + items: + $ref: '#/components/schemas/VectorStoreContent' + type: array + title: Content + type: object + required: + - file_id + - filename + - score + - content + title: VectorStoreSearchResponse + description: Response from searching a vector store. + VectorStoreSearchResponsePage: + properties: + object: + type: string + title: Object + default: vector_store.search_results.page + search_query: + type: string + title: Search Query + data: + items: + $ref: '#/components/schemas/VectorStoreSearchResponse' + type: array + title: Data + has_more: + type: boolean + title: Has More + default: false + next_page: + anyOf: + - type: string + - type: 'null' + title: Next Page + type: object + required: + - search_query + - data + title: VectorStoreSearchResponsePage + description: Paginated response from searching a vector store. + VersionInfo: + properties: + version: + type: string + title: Version + description: Version number of the service + type: object + required: + - version + title: VersionInfo + description: Version information for the service. + ViolationLevel: + type: string + enum: + - info + - warn + - error + title: ViolationLevel + description: "Severity level of a safety violation.\n\n:cvar INFO: Informational level violation that does not require action\n:cvar WARN: Warning level violation that suggests caution but allows continuation\n:cvar ERROR: Error level violation that requires blocking or intervention" + WeightedRanker: + properties: + type: + type: string + const: weighted + title: Type + default: weighted + alpha: + type: number + maximum: 1.0 + minimum: 0.0 + title: Alpha + description: Weight factor between 0 and 1. 0 means only keyword scores, 1 means only vector scores. + default: 0.5 + type: object + title: WeightedRanker + description: "Weighted ranker configuration that combines vector and keyword scores.\n\n:param type: The type of ranker, always \"weighted\"\n:param alpha: Weight factor between 0 and 1.\n 0 means only use keyword scores,\n 1 means only use vector scores,\n values in between blend both scores." + _URLOrData: + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data + type: object + title: _URLOrData + description: A URL or a base64 encoded string. + AgentConfig: + $defs: + AgentToolGroupWithArgs: + properties: + name: + title: Name + type: string + args: + additionalProperties: true + title: Args + type: object + required: + - name + - args + title: AgentToolGroupWithArgs + type: object + GrammarResponseFormat: + description: Configuration for grammar-guided response generation. + properties: + type: + const: grammar + default: grammar + title: Type + type: string + bnf: + additionalProperties: true + minProperties: 1 + title: Bnf + type: object + required: + - bnf + title: GrammarResponseFormat + type: object + GreedySamplingStrategy: + description: Greedy sampling strategy that selects the highest probability token at each step. + properties: + type: + const: greedy + default: greedy + title: Type + type: string + title: GreedySamplingStrategy + type: object + JsonSchemaResponseFormat: + description: Configuration for JSON schema-guided response generation. + properties: + type: + const: json_schema + default: json_schema + title: Type + type: string + json_schema: + additionalProperties: true + minProperties: 1 + title: Json Schema + type: object + required: + - json_schema + title: JsonSchemaResponseFormat + type: object + SamplingParams: + description: Sampling parameters. + properties: + strategy: + discriminator: + mapping: + greedy: '#/$defs/GreedySamplingStrategy' + top_k: '#/$defs/TopKSamplingStrategy' + top_p: '#/$defs/TopPSamplingStrategy' + propertyName: type + oneOf: + - $ref: '#/components/schemas/GreedySamplingStrategy' + - $ref: '#/components/schemas/TopPSamplingStrategy' + - $ref: '#/components/schemas/TopKSamplingStrategy' + title: Strategy + max_tokens: + anyOf: + - minimum: 0 + type: integer + - type: 'null' + default: + title: Max Tokens + repetition_penalty: + anyOf: + - minimum: 0.0 + type: number + - type: 'null' + default: 1.0 + title: Repetition Penalty + stop: + anyOf: + - items: + type: string + minItems: 1 + type: array + - type: 'null' + default: + title: Stop + title: SamplingParams + type: object + SystemMessageBehavior: + description: "Config for how to override the default system prompt.\n\nhttps://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt-\n'{{function_definitions}}' to indicate where the function definitions should be inserted." + enum: + - append + - replace + title: SystemMessageBehavior + type: string + ToolChoice: + description: Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model. + enum: + - auto + - required + - none + title: ToolChoice + type: string + ToolConfig: + description: "Configuration for tool use.\n\n- `ToolPromptFormat.json`: The tool calls are formatted as a JSON object.\n- `ToolPromptFormat.function_tag`: The tool calls are enclosed in a tag.\n- `ToolPromptFormat.python_list`: The tool calls are output as Python syntax -- a list of function calls.\n- `SystemMessageBehavior.append`: Appends the provided system message to the default system prompt.\n- `SystemMessageBehavior.replace`: Replaces the default system prompt with the provided system message. The system message can include the string\n '{{function_definitions}}' to indicate where the function definitions should be inserted." + properties: + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: string + - type: 'null' + default: auto + title: Tool Choice + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + default: + system_message_behavior: + anyOf: + - $ref: '#/components/schemas/SystemMessageBehavior' + - type: 'null' + default: append + title: ToolConfig + type: object + ToolDef: + description: Tool definition used in runtime contexts. + properties: + toolgroup_id: + anyOf: + - type: string + - type: 'null' + default: + description: ID of the tool group this tool belongs to + title: Toolgroup Id + name: + description: Name of the tool + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + default: + description: Human-readable description of what the tool does + title: Description + input_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + description: JSON Schema for tool inputs (MCP inputSchema) + title: Input Schema + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + description: JSON Schema for tool outputs (MCP outputSchema) + title: Output Schema + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + description: Additional metadata about the tool + title: Metadata + required: + - name + title: ToolDef + type: object + ToolPromptFormat: + description: "Prompt format for calling custom / zero shot tools.\n\n:cvar json: JSON format for calling tools. It takes the form:\n {\n \"type\": \"function\",\n \"function\" : {\n \"name\": \"function_name\",\n \"description\": \"function_description\",\n \"parameters\": {...}\n }\n }\n:cvar function_tag: Function tag format, pseudo-XML. This looks like:\n (parameters)\n\n:cvar python_list: Python list. The output is a valid Python expression that can be\n evaluated to a list. Each element in the list is a function call. Example:\n [\"function_name(param1, param2)\", \"function_name(param1, param2)\"]" + enum: + - json + - function_tag + - python_list + title: ToolPromptFormat + type: string + TopKSamplingStrategy: + description: Top-k sampling strategy that restricts sampling to the k most likely tokens. + properties: + type: + const: top_k + default: top_k + title: Type + type: string + top_k: + minimum: 1 + title: Top K + type: integer + required: + - top_k + title: TopKSamplingStrategy + type: object + TopPSamplingStrategy: + description: Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p. + properties: + type: + const: top_p + default: top_p + title: Type + type: string + temperature: + anyOf: + - type: number + minimum: 0.0 + - type: 'null' + title: Temperature + top_p: + anyOf: + - type: number + - type: 'null' + default: 0.95 + title: Top P + required: + - temperature + title: TopPSamplingStrategy + type: object + description: Configuration for an agent. + properties: + sampling_params: + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' + input_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Input Shields + output_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields + toolgroups: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups + client_tools: + anyOf: + - items: + $ref: '#/components/schemas/ToolDef' + type: array + - type: 'null' + title: Client Tools + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: 'null' + default: + deprecated: true + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + default: + deprecated: true + tool_config: + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' + default: + max_infer_iters: + anyOf: + - type: integer + - type: 'null' + default: 10 + title: Max Infer Iters + model: + description: The model identifier to use for the agent + title: Model + type: string + instructions: + description: The system instructions for the agent + title: Instructions + type: string + name: + anyOf: + - type: string + - type: 'null' + default: + description: Optional name for the agent, used in telemetry and identification + title: Name + enable_session_persistence: + anyOf: + - type: boolean + - type: 'null' + default: false + description: Optional flag indicating whether session data has to be persisted + title: Enable Session Persistence + response_format: + anyOf: + - discriminator: + mapping: + grammar: '#/$defs/GrammarResponseFormat' + json_schema: '#/$defs/JsonSchemaResponseFormat' + propertyName: type + oneOf: + - $ref: '#/components/schemas/JsonSchemaResponseFormat' + - $ref: '#/components/schemas/GrammarResponseFormat' + - type: 'null' + default: + description: Optional response format configuration + title: Response Format + required: + - model + - instructions + title: AgentConfig + type: object + AgentTurnResponseEvent: + $defs: + AgentTurnResponseStepCompletePayload: + description: Payload for step completion events in agent turn responses. + properties: + event_type: + const: step_complete + default: step_complete + description: Type of event being reported + title: Event Type + type: string + step_type: + $ref: '#/components/schemas/StepType' + description: Type of step being executed + step_id: + description: Unique identifier for the step within a turn + title: Step Id + type: string + step_details: + description: Complete details of the executed step + discriminator: + mapping: + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/components/schemas/InferenceStep' + - $ref: '#/components/schemas/ToolExecutionStep' + - $ref: '#/components/schemas/ShieldCallStep' + - $ref: '#/components/schemas/MemoryRetrievalStep' + title: Step Details + required: + - step_type + - step_id + - step_details + title: AgentTurnResponseStepCompletePayload + type: object + AgentTurnResponseStepProgressPayload: + description: Payload for step progress events in agent turn responses. + properties: + event_type: + const: step_progress + default: step_progress + description: Type of event being reported + title: Event Type + type: string + step_type: + $ref: '#/components/schemas/StepType' + description: Type of step being executed + step_id: + description: Unique identifier for the step within a turn + title: Step Id + type: string + delta: + description: Incremental content changes during step execution + discriminator: + mapping: + image: '#/$defs/ImageDelta' + text: '#/$defs/TextDelta' + tool_call: '#/$defs/ToolCallDelta' + propertyName: type + oneOf: + - $ref: '#/components/schemas/TextDelta' + - $ref: '#/components/schemas/ImageDelta' + - $ref: '#/components/schemas/ToolCallDelta' + title: Delta + required: + - step_type + - step_id + - delta + title: AgentTurnResponseStepProgressPayload + type: object + AgentTurnResponseStepStartPayload: + description: Payload for step start events in agent turn responses. + properties: + event_type: + const: step_start + default: step_start + description: Type of event being reported + title: Event Type + type: string + step_type: + $ref: '#/components/schemas/StepType' + description: Type of step being executed + step_id: + description: Unique identifier for the step within a turn + title: Step Id + type: string + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + description: Additional metadata for the step + title: Metadata + required: + - step_type + - step_id + title: AgentTurnResponseStepStartPayload + type: object + AgentTurnResponseTurnAwaitingInputPayload: + description: Payload for turn awaiting input events in agent turn responses. + properties: + event_type: + const: turn_awaiting_input + default: turn_awaiting_input + description: Type of event being reported + title: Event Type + type: string + turn: + $ref: '#/components/schemas/Turn' + description: Turn data when waiting for external tool responses + required: + - turn + title: AgentTurnResponseTurnAwaitingInputPayload + type: object + AgentTurnResponseTurnCompletePayload: + description: Payload for turn completion events in agent turn responses. + properties: + event_type: + const: turn_complete + default: turn_complete + description: Type of event being reported + title: Event Type + type: string + turn: + $ref: '#/components/schemas/Turn' + description: Complete turn data including all steps and results + required: + - turn + title: AgentTurnResponseTurnCompletePayload + type: object + AgentTurnResponseTurnStartPayload: + description: Payload for turn start events in agent turn responses. + properties: + event_type: + const: turn_start + default: turn_start + description: Type of event being reported + title: Event Type + type: string + turn_id: + description: Unique identifier for the turn within a session + title: Turn Id + type: string + required: + - turn_id + title: AgentTurnResponseTurnStartPayload + type: object + Attachment: + description: An attachment to an agent turn. + properties: + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + description: The content of the attachment. + title: Content + mime_type: + description: The MIME type of the attachment. + title: Mime Type + type: string + required: + - content + - mime_type + title: Attachment + type: object + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + CompletionMessage: + description: "A message containing the model's (assistant) response in a chat conversation.\n\n- `StopReason.end_of_turn`: The model finished generating the entire response.\n- `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n- `StopReason.out_of_tokens`: The model ran out of token budget." + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' + title: Tool Calls + required: + - content + - stop_reason + title: CompletionMessage + type: object + ImageContentItem: + description: A image content item. + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + ImageDelta: + description: An image content delta for streaming responses. + properties: + type: + const: image + default: image + title: Type + type: string + image: + format: binary + title: Image + type: string + required: + - image + title: ImageDelta + type: object + InferenceStep: + description: An inference step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: inference + default: inference + title: Step Type + type: string + model_response: + $ref: '#/components/schemas/CompletionMessage' + description: The response from the LLM. + required: + - turn_id + - step_id + - model_response + title: InferenceStep + type: object + MemoryRetrievalStep: + description: A memory retrieval step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: memory_retrieval + default: memory_retrieval + title: Step Type + type: string + vector_store_ids: + description: The IDs of the vector databases to retrieve context from. + title: Vector Store Ids + type: string + inserted_context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + description: The context retrieved from the vector databases. + title: Inserted Context + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + type: object + SafetyViolation: + description: Details of a safety violation detected by content moderation. + properties: + violation_level: + $ref: '#/components/schemas/ViolationLevel' + description: Severity level of the violation. + user_message: + anyOf: + - type: string + - type: 'null' + default: + description: Message to convey to the user about the violation. + title: User Message + metadata: + additionalProperties: true + description: Additional metadata including specific violation codes for debugging and telemetry. + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + type: object + ShieldCallStep: + description: A shield call step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: shield_call + default: shield_call + title: Step Type + type: string + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + default: + description: The violation from the shield call. + required: + - turn_id + - step_id + title: ShieldCallStep + type: object + StepType: + description: Type of the step in an agent turn. + enum: + - inference + - tool_execution + - shield_call + - memory_retrieval + title: StepType + type: string + StopReason: + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + type: string + TextContentItem: + description: A text content item. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + TextDelta: + description: A text content delta for streaming responses. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextDelta + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolCallDelta: + description: A tool call content delta for streaming responses. + properties: + type: + const: tool_call + default: tool_call + title: Type + type: string + tool_call: + anyOf: + - type: string + - $ref: '#/components/schemas/ToolCall' + title: Tool Call + parse_status: + $ref: '#/components/schemas/ToolCallParseStatus' + required: + - tool_call + - parse_status + title: ToolCallDelta + type: object + ToolCallParseStatus: + description: Status of tool call parsing during streaming. + enum: + - started + - in_progress + - failed + - succeeded + title: ToolCallParseStatus + type: string + ToolExecutionStep: + description: A tool execution step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: tool_execution + default: tool_execution + title: Step Type + type: string + tool_calls: + description: The tool calls to execute. + items: + $ref: '#/components/schemas/ToolCall' + title: Tool Calls + type: array + tool_responses: + description: The tool responses from the tool calls. + items: + $ref: '#/components/schemas/ToolResponse' + title: Tool Responses + type: array + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + type: object + ToolResponse: + description: Response from a tool invocation. + properties: + call_id: + minLength: 1 + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + title: Metadata + required: + - call_id + - tool_name + - content + title: ToolResponse + type: object + ToolResponseMessage: + description: A message representing the result of a tool invocation. + properties: + role: + const: tool + default: tool + title: Role + type: string + call_id: + title: Call Id + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + required: + - call_id + - content + title: ToolResponseMessage + type: object + Turn: + description: A single turn in an interaction with an Agentic System. + properties: + turn_id: + description: Unique identifier for the turn within a session + title: Turn Id + type: string + session_id: + description: Unique identifier for the conversation session + title: Session Id + type: string + input_messages: + description: List of messages that initiated this turn + items: + anyOf: + - $ref: '#/components/schemas/UserMessage' + - $ref: '#/components/schemas/ToolResponseMessage' + title: Input Messages + type: array + steps: + description: Ordered list of processing steps executed during this turn + items: + discriminator: + mapping: + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/components/schemas/InferenceStep' + - $ref: '#/components/schemas/ToolExecutionStep' + - $ref: '#/components/schemas/ShieldCallStep' + - $ref: '#/components/schemas/MemoryRetrievalStep' + title: Steps + type: array + output_message: + $ref: '#/components/schemas/CompletionMessage' + description: The model's generated response containing content and metadata + output_attachments: + anyOf: + - items: + $ref: '#/components/schemas/Attachment' + type: array + - type: 'null' + description: Files or media attached to the agent's response + title: Output Attachments + started_at: + description: Timestamp when the turn began + format: date-time + title: Started At + type: string + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: Timestamp when the turn finished, if completed + title: Completed At + required: + - turn_id + - session_id + - input_messages + - steps + - output_message + - started_at + title: Turn + type: object + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + UserMessage: + description: A message from the user in a chat conversation. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + default: + title: Context + required: + - content + title: UserMessage + type: object + ViolationLevel: + description: "Severity level of a safety violation.\n\n:cvar INFO: Informational level violation that does not require action\n:cvar WARN: Warning level violation that suggests caution but allows continuation\n:cvar ERROR: Error level violation that requires blocking or intervention" + enum: + - info + - warn + - error + title: ViolationLevel + type: string + _URLOrData: + description: A URL or a base64 encoded string. + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + default: + title: Data + title: _URLOrData + type: object + description: An event in an agent turn response stream. + properties: + payload: + description: Event-specific payload containing event data + discriminator: + mapping: + step_complete: '#/$defs/AgentTurnResponseStepCompletePayload' + step_progress: '#/$defs/AgentTurnResponseStepProgressPayload' + step_start: '#/$defs/AgentTurnResponseStepStartPayload' + turn_awaiting_input: '#/$defs/AgentTurnResponseTurnAwaitingInputPayload' + turn_complete: '#/$defs/AgentTurnResponseTurnCompletePayload' + turn_start: '#/$defs/AgentTurnResponseTurnStartPayload' + propertyName: event_type + oneOf: + - $ref: '#/components/schemas/AgentTurnResponseStepStartPayload' + - $ref: '#/components/schemas/AgentTurnResponseStepProgressPayload' + - $ref: '#/components/schemas/AgentTurnResponseStepCompletePayload' + - $ref: '#/components/schemas/AgentTurnResponseTurnStartPayload' + - $ref: '#/components/schemas/AgentTurnResponseTurnCompletePayload' + - $ref: '#/components/schemas/AgentTurnResponseTurnAwaitingInputPayload' + title: Payload + required: + - payload + title: AgentTurnResponseEvent + type: object + AgentTurnResponseStepCompletePayload: + $defs: + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + CompletionMessage: + description: "A message containing the model's (assistant) response in a chat conversation.\n\n- `StopReason.end_of_turn`: The model finished generating the entire response.\n- `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n- `StopReason.out_of_tokens`: The model ran out of token budget." + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' + title: Tool Calls + required: + - content + - stop_reason + title: CompletionMessage + type: object + ImageContentItem: + description: A image content item. + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + InferenceStep: + description: An inference step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: inference + default: inference + title: Step Type + type: string + model_response: + $ref: '#/components/schemas/CompletionMessage' + description: The response from the LLM. + required: + - turn_id + - step_id + - model_response + title: InferenceStep + type: object + MemoryRetrievalStep: + description: A memory retrieval step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: memory_retrieval + default: memory_retrieval + title: Step Type + type: string + vector_store_ids: + description: The IDs of the vector databases to retrieve context from. + title: Vector Store Ids + type: string + inserted_context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + description: The context retrieved from the vector databases. + title: Inserted Context + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + type: object + SafetyViolation: + description: Details of a safety violation detected by content moderation. + properties: + violation_level: + $ref: '#/components/schemas/ViolationLevel' + description: Severity level of the violation. + user_message: + anyOf: + - type: string + - type: 'null' + default: + description: Message to convey to the user about the violation. + title: User Message + metadata: + additionalProperties: true + description: Additional metadata including specific violation codes for debugging and telemetry. + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + type: object + ShieldCallStep: + description: A shield call step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: shield_call + default: shield_call + title: Step Type + type: string + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + default: + description: The violation from the shield call. + required: + - turn_id + - step_id + title: ShieldCallStep + type: object + StepType: + description: Type of the step in an agent turn. + enum: + - inference + - tool_execution + - shield_call + - memory_retrieval + title: StepType + type: string + StopReason: + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + type: string + TextContentItem: + description: A text content item. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolExecutionStep: + description: A tool execution step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: tool_execution + default: tool_execution + title: Step Type + type: string + tool_calls: + description: The tool calls to execute. + items: + $ref: '#/components/schemas/ToolCall' + title: Tool Calls + type: array + tool_responses: + description: The tool responses from the tool calls. + items: + $ref: '#/components/schemas/ToolResponse' + title: Tool Responses + type: array + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + type: object + ToolResponse: + description: Response from a tool invocation. + properties: + call_id: + minLength: 1 + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + title: Metadata + required: + - call_id + - tool_name + - content + title: ToolResponse + type: object + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + ViolationLevel: + description: "Severity level of a safety violation.\n\n:cvar INFO: Informational level violation that does not require action\n:cvar WARN: Warning level violation that suggests caution but allows continuation\n:cvar ERROR: Error level violation that requires blocking or intervention" + enum: + - info + - warn + - error + title: ViolationLevel + type: string + _URLOrData: + description: A URL or a base64 encoded string. + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + default: + title: Data + title: _URLOrData + type: object + description: Payload for step completion events in agent turn responses. + properties: + event_type: + const: step_complete + default: step_complete + description: Type of event being reported + title: Event Type + type: string + step_type: + $ref: '#/components/schemas/StepType' + description: Type of step being executed + step_id: + description: Unique identifier for the step within a turn + title: Step Id + type: string + step_details: + description: Complete details of the executed step + discriminator: + mapping: + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/components/schemas/InferenceStep' + - $ref: '#/components/schemas/ToolExecutionStep' + - $ref: '#/components/schemas/ShieldCallStep' + - $ref: '#/components/schemas/MemoryRetrievalStep' + title: Step Details + required: + - step_type + - step_id + - step_details + title: AgentTurnResponseStepCompletePayload + type: object + AgentTurnResponseStepProgressPayload: + $defs: + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + ImageDelta: + description: An image content delta for streaming responses. + properties: + type: + const: image + default: image + title: Type + type: string + image: + format: binary + title: Image + type: string + required: + - image + title: ImageDelta + type: object + StepType: + description: Type of the step in an agent turn. + enum: + - inference + - tool_execution + - shield_call + - memory_retrieval + title: StepType + type: string + TextDelta: + description: A text content delta for streaming responses. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextDelta + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolCallDelta: + description: A tool call content delta for streaming responses. + properties: + type: + const: tool_call + default: tool_call + title: Type + type: string + tool_call: + anyOf: + - type: string + - $ref: '#/components/schemas/ToolCall' + title: Tool Call + parse_status: + $ref: '#/components/schemas/ToolCallParseStatus' + required: + - tool_call + - parse_status + title: ToolCallDelta + type: object + ToolCallParseStatus: + description: Status of tool call parsing during streaming. + enum: + - started + - in_progress + - failed + - succeeded + title: ToolCallParseStatus + type: string + description: Payload for step progress events in agent turn responses. + properties: + event_type: + const: step_progress + default: step_progress + description: Type of event being reported + title: Event Type + type: string + step_type: + $ref: '#/components/schemas/StepType' + description: Type of step being executed + step_id: + description: Unique identifier for the step within a turn + title: Step Id + type: string + delta: + description: Incremental content changes during step execution + discriminator: + mapping: + image: '#/$defs/ImageDelta' + text: '#/$defs/TextDelta' + tool_call: '#/$defs/ToolCallDelta' + propertyName: type + oneOf: + - $ref: '#/components/schemas/TextDelta' + - $ref: '#/components/schemas/ImageDelta' + - $ref: '#/components/schemas/ToolCallDelta' + title: Delta + required: + - step_type + - step_id + - delta + title: AgentTurnResponseStepProgressPayload + type: object + AgentTurnResponseStepStartPayload: + $defs: + StepType: + description: Type of the step in an agent turn. + enum: + - inference + - tool_execution + - shield_call + - memory_retrieval + title: StepType + type: string + description: Payload for step start events in agent turn responses. + properties: + event_type: + const: step_start + default: step_start + description: Type of event being reported + title: Event Type + type: string + step_type: + $ref: '#/components/schemas/StepType' + description: Type of step being executed + step_id: + description: Unique identifier for the step within a turn + title: Step Id + type: string + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + description: Additional metadata for the step + title: Metadata + required: + - step_type + - step_id + title: AgentTurnResponseStepStartPayload + type: object + AgentTurnResponseStreamChunk: + $defs: + AgentTurnResponseEvent: + description: An event in an agent turn response stream. + properties: + payload: + description: Event-specific payload containing event data + discriminator: + mapping: + step_complete: '#/$defs/AgentTurnResponseStepCompletePayload' + step_progress: '#/$defs/AgentTurnResponseStepProgressPayload' + step_start: '#/$defs/AgentTurnResponseStepStartPayload' + turn_awaiting_input: '#/$defs/AgentTurnResponseTurnAwaitingInputPayload' + turn_complete: '#/$defs/AgentTurnResponseTurnCompletePayload' + turn_start: '#/$defs/AgentTurnResponseTurnStartPayload' + propertyName: event_type + oneOf: + - $ref: '#/components/schemas/AgentTurnResponseStepStartPayload' + - $ref: '#/components/schemas/AgentTurnResponseStepProgressPayload' + - $ref: '#/components/schemas/AgentTurnResponseStepCompletePayload' + - $ref: '#/components/schemas/AgentTurnResponseTurnStartPayload' + - $ref: '#/components/schemas/AgentTurnResponseTurnCompletePayload' + - $ref: '#/components/schemas/AgentTurnResponseTurnAwaitingInputPayload' + title: Payload + required: + - payload + title: AgentTurnResponseEvent + type: object + AgentTurnResponseStepCompletePayload: + description: Payload for step completion events in agent turn responses. + properties: + event_type: + const: step_complete + default: step_complete + description: Type of event being reported + title: Event Type + type: string + step_type: + $ref: '#/components/schemas/StepType' + description: Type of step being executed + step_id: + description: Unique identifier for the step within a turn + title: Step Id + type: string + step_details: + description: Complete details of the executed step + discriminator: + mapping: + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/components/schemas/InferenceStep' + - $ref: '#/components/schemas/ToolExecutionStep' + - $ref: '#/components/schemas/ShieldCallStep' + - $ref: '#/components/schemas/MemoryRetrievalStep' + title: Step Details + required: + - step_type + - step_id + - step_details + title: AgentTurnResponseStepCompletePayload + type: object + AgentTurnResponseStepProgressPayload: + description: Payload for step progress events in agent turn responses. + properties: + event_type: + const: step_progress + default: step_progress + description: Type of event being reported + title: Event Type + type: string + step_type: + $ref: '#/components/schemas/StepType' + description: Type of step being executed + step_id: + description: Unique identifier for the step within a turn + title: Step Id + type: string + delta: + description: Incremental content changes during step execution + discriminator: + mapping: + image: '#/$defs/ImageDelta' + text: '#/$defs/TextDelta' + tool_call: '#/$defs/ToolCallDelta' + propertyName: type + oneOf: + - $ref: '#/components/schemas/TextDelta' + - $ref: '#/components/schemas/ImageDelta' + - $ref: '#/components/schemas/ToolCallDelta' + title: Delta + required: + - step_type + - step_id + - delta + title: AgentTurnResponseStepProgressPayload + type: object + AgentTurnResponseStepStartPayload: + description: Payload for step start events in agent turn responses. + properties: + event_type: + const: step_start + default: step_start + description: Type of event being reported + title: Event Type + type: string + step_type: + $ref: '#/components/schemas/StepType' + description: Type of step being executed + step_id: + description: Unique identifier for the step within a turn + title: Step Id + type: string + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + description: Additional metadata for the step + title: Metadata + required: + - step_type + - step_id + title: AgentTurnResponseStepStartPayload + type: object + AgentTurnResponseTurnAwaitingInputPayload: + description: Payload for turn awaiting input events in agent turn responses. + properties: + event_type: + const: turn_awaiting_input + default: turn_awaiting_input + description: Type of event being reported + title: Event Type + type: string + turn: + $ref: '#/components/schemas/Turn' + description: Turn data when waiting for external tool responses + required: + - turn + title: AgentTurnResponseTurnAwaitingInputPayload + type: object + AgentTurnResponseTurnCompletePayload: + description: Payload for turn completion events in agent turn responses. + properties: + event_type: + const: turn_complete + default: turn_complete + description: Type of event being reported + title: Event Type + type: string + turn: + $ref: '#/components/schemas/Turn' + description: Complete turn data including all steps and results + required: + - turn + title: AgentTurnResponseTurnCompletePayload + type: object + AgentTurnResponseTurnStartPayload: + description: Payload for turn start events in agent turn responses. + properties: + event_type: + const: turn_start + default: turn_start + description: Type of event being reported + title: Event Type + type: string + turn_id: + description: Unique identifier for the turn within a session + title: Turn Id + type: string + required: + - turn_id + title: AgentTurnResponseTurnStartPayload + type: object + Attachment: + description: An attachment to an agent turn. + properties: + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + description: The content of the attachment. + title: Content + mime_type: + description: The MIME type of the attachment. + title: Mime Type + type: string + required: + - content + - mime_type + title: Attachment + type: object + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + CompletionMessage: + description: "A message containing the model's (assistant) response in a chat conversation.\n\n- `StopReason.end_of_turn`: The model finished generating the entire response.\n- `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n- `StopReason.out_of_tokens`: The model ran out of token budget." + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' + title: Tool Calls + required: + - content + - stop_reason + title: CompletionMessage + type: object + ImageContentItem: + description: A image content item. + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + ImageDelta: + description: An image content delta for streaming responses. + properties: + type: + const: image + default: image + title: Type + type: string + image: + format: binary + title: Image + type: string + required: + - image + title: ImageDelta + type: object + InferenceStep: + description: An inference step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: inference + default: inference + title: Step Type + type: string + model_response: + $ref: '#/components/schemas/CompletionMessage' + description: The response from the LLM. + required: + - turn_id + - step_id + - model_response + title: InferenceStep + type: object + MemoryRetrievalStep: + description: A memory retrieval step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: memory_retrieval + default: memory_retrieval + title: Step Type + type: string + vector_store_ids: + description: The IDs of the vector databases to retrieve context from. + title: Vector Store Ids + type: string + inserted_context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + description: The context retrieved from the vector databases. + title: Inserted Context + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + type: object + SafetyViolation: + description: Details of a safety violation detected by content moderation. + properties: + violation_level: + $ref: '#/components/schemas/ViolationLevel' + description: Severity level of the violation. + user_message: + anyOf: + - type: string + - type: 'null' + default: + description: Message to convey to the user about the violation. + title: User Message + metadata: + additionalProperties: true + description: Additional metadata including specific violation codes for debugging and telemetry. + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + type: object + ShieldCallStep: + description: A shield call step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: shield_call + default: shield_call + title: Step Type + type: string + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + default: + description: The violation from the shield call. + required: + - turn_id + - step_id + title: ShieldCallStep + type: object + StepType: + description: Type of the step in an agent turn. + enum: + - inference + - tool_execution + - shield_call + - memory_retrieval + title: StepType + type: string + StopReason: + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + type: string + TextContentItem: + description: A text content item. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + TextDelta: + description: A text content delta for streaming responses. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextDelta + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolCallDelta: + description: A tool call content delta for streaming responses. + properties: + type: + const: tool_call + default: tool_call + title: Type + type: string + tool_call: + anyOf: + - type: string + - $ref: '#/components/schemas/ToolCall' + title: Tool Call + parse_status: + $ref: '#/components/schemas/ToolCallParseStatus' + required: + - tool_call + - parse_status + title: ToolCallDelta + type: object + ToolCallParseStatus: + description: Status of tool call parsing during streaming. + enum: + - started + - in_progress + - failed + - succeeded + title: ToolCallParseStatus + type: string + ToolExecutionStep: + description: A tool execution step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: tool_execution + default: tool_execution + title: Step Type + type: string + tool_calls: + description: The tool calls to execute. + items: + $ref: '#/components/schemas/ToolCall' + title: Tool Calls + type: array + tool_responses: + description: The tool responses from the tool calls. + items: + $ref: '#/components/schemas/ToolResponse' + title: Tool Responses + type: array + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + type: object + ToolResponse: + description: Response from a tool invocation. + properties: + call_id: + minLength: 1 + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + title: Metadata + required: + - call_id + - tool_name + - content + title: ToolResponse + type: object + ToolResponseMessage: + description: A message representing the result of a tool invocation. + properties: + role: + const: tool + default: tool + title: Role + type: string + call_id: + title: Call Id + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + required: + - call_id + - content + title: ToolResponseMessage + type: object + Turn: + description: A single turn in an interaction with an Agentic System. + properties: + turn_id: + description: Unique identifier for the turn within a session + title: Turn Id + type: string + session_id: + description: Unique identifier for the conversation session + title: Session Id + type: string + input_messages: + description: List of messages that initiated this turn + items: + anyOf: + - $ref: '#/components/schemas/UserMessage' + - $ref: '#/components/schemas/ToolResponseMessage' + title: Input Messages + type: array + steps: + description: Ordered list of processing steps executed during this turn + items: + discriminator: + mapping: + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/components/schemas/InferenceStep' + - $ref: '#/components/schemas/ToolExecutionStep' + - $ref: '#/components/schemas/ShieldCallStep' + - $ref: '#/components/schemas/MemoryRetrievalStep' + title: Steps + type: array + output_message: + $ref: '#/components/schemas/CompletionMessage' + description: The model's generated response containing content and metadata + output_attachments: + anyOf: + - items: + $ref: '#/components/schemas/Attachment' + type: array + - type: 'null' + description: Files or media attached to the agent's response + title: Output Attachments + started_at: + description: Timestamp when the turn began + format: date-time + title: Started At + type: string + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: Timestamp when the turn finished, if completed + title: Completed At + required: + - turn_id + - session_id + - input_messages + - steps + - output_message + - started_at + title: Turn + type: object + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + UserMessage: + description: A message from the user in a chat conversation. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + default: + title: Context + required: + - content + title: UserMessage + type: object + ViolationLevel: + description: "Severity level of a safety violation.\n\n:cvar INFO: Informational level violation that does not require action\n:cvar WARN: Warning level violation that suggests caution but allows continuation\n:cvar ERROR: Error level violation that requires blocking or intervention" + enum: + - info + - warn + - error + title: ViolationLevel + type: string + _URLOrData: + description: A URL or a base64 encoded string. + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + default: + title: Data + title: _URLOrData + type: object + description: Streamed agent turn completion response. + properties: + event: + $ref: '#/components/schemas/AgentTurnResponseEvent' + description: Individual event in the agent turn response stream + required: + - event + title: AgentTurnResponseStreamChunk + type: object + AgentTurnResponseTurnAwaitingInputPayload: + $defs: + Attachment: + description: An attachment to an agent turn. + properties: + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + description: The content of the attachment. + title: Content + mime_type: + description: The MIME type of the attachment. + title: Mime Type + type: string + required: + - content + - mime_type + title: Attachment + type: object + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + CompletionMessage: + description: "A message containing the model's (assistant) response in a chat conversation.\n\n- `StopReason.end_of_turn`: The model finished generating the entire response.\n- `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n- `StopReason.out_of_tokens`: The model ran out of token budget." + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' + title: Tool Calls + required: + - content + - stop_reason + title: CompletionMessage + type: object + ImageContentItem: + description: A image content item. + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + InferenceStep: + description: An inference step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: inference + default: inference + title: Step Type + type: string + model_response: + $ref: '#/components/schemas/CompletionMessage' + description: The response from the LLM. + required: + - turn_id + - step_id + - model_response + title: InferenceStep + type: object + MemoryRetrievalStep: + description: A memory retrieval step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: memory_retrieval + default: memory_retrieval + title: Step Type + type: string + vector_store_ids: + description: The IDs of the vector databases to retrieve context from. + title: Vector Store Ids + type: string + inserted_context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + description: The context retrieved from the vector databases. + title: Inserted Context + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + type: object + SafetyViolation: + description: Details of a safety violation detected by content moderation. + properties: + violation_level: + $ref: '#/components/schemas/ViolationLevel' + description: Severity level of the violation. + user_message: + anyOf: + - type: string + - type: 'null' + default: + description: Message to convey to the user about the violation. + title: User Message + metadata: + additionalProperties: true + description: Additional metadata including specific violation codes for debugging and telemetry. + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + type: object + ShieldCallStep: + description: A shield call step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: shield_call + default: shield_call + title: Step Type + type: string + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + default: + description: The violation from the shield call. + required: + - turn_id + - step_id + title: ShieldCallStep + type: object + StopReason: + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + type: string + TextContentItem: + description: A text content item. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolExecutionStep: + description: A tool execution step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: tool_execution + default: tool_execution + title: Step Type + type: string + tool_calls: + description: The tool calls to execute. + items: + $ref: '#/components/schemas/ToolCall' + title: Tool Calls + type: array + tool_responses: + description: The tool responses from the tool calls. + items: + $ref: '#/components/schemas/ToolResponse' + title: Tool Responses + type: array + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + type: object + ToolResponse: + description: Response from a tool invocation. + properties: + call_id: + minLength: 1 + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + title: Metadata + required: + - call_id + - tool_name + - content + title: ToolResponse + type: object + ToolResponseMessage: + description: A message representing the result of a tool invocation. + properties: + role: + const: tool + default: tool + title: Role + type: string + call_id: + title: Call Id + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + required: + - call_id + - content + title: ToolResponseMessage + type: object + Turn: + description: A single turn in an interaction with an Agentic System. + properties: + turn_id: + description: Unique identifier for the turn within a session + title: Turn Id + type: string + session_id: + description: Unique identifier for the conversation session + title: Session Id + type: string + input_messages: + description: List of messages that initiated this turn + items: + anyOf: + - $ref: '#/components/schemas/UserMessage' + - $ref: '#/components/schemas/ToolResponseMessage' + title: Input Messages + type: array + steps: + description: Ordered list of processing steps executed during this turn + items: + discriminator: + mapping: + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/components/schemas/InferenceStep' + - $ref: '#/components/schemas/ToolExecutionStep' + - $ref: '#/components/schemas/ShieldCallStep' + - $ref: '#/components/schemas/MemoryRetrievalStep' + title: Steps + type: array + output_message: + $ref: '#/components/schemas/CompletionMessage' + description: The model's generated response containing content and metadata + output_attachments: + anyOf: + - items: + $ref: '#/components/schemas/Attachment' + type: array + - type: 'null' + description: Files or media attached to the agent's response + title: Output Attachments + started_at: + description: Timestamp when the turn began + format: date-time + title: Started At + type: string + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: Timestamp when the turn finished, if completed + title: Completed At + required: + - turn_id + - session_id + - input_messages + - steps + - output_message + - started_at + title: Turn + type: object + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + UserMessage: + description: A message from the user in a chat conversation. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + default: + title: Context + required: + - content + title: UserMessage + type: object + ViolationLevel: + description: "Severity level of a safety violation.\n\n:cvar INFO: Informational level violation that does not require action\n:cvar WARN: Warning level violation that suggests caution but allows continuation\n:cvar ERROR: Error level violation that requires blocking or intervention" + enum: + - info + - warn + - error + title: ViolationLevel + type: string + _URLOrData: + description: A URL or a base64 encoded string. + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + default: + title: Data + title: _URLOrData + type: object + description: Payload for turn awaiting input events in agent turn responses. + properties: + event_type: + const: turn_awaiting_input + default: turn_awaiting_input + description: Type of event being reported + title: Event Type + type: string + turn: + $ref: '#/components/schemas/Turn' + description: Turn data when waiting for external tool responses + required: + - turn + title: AgentTurnResponseTurnAwaitingInputPayload + type: object + AgentTurnResponseTurnCompletePayload: + $defs: + Attachment: + description: An attachment to an agent turn. + properties: + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + description: The content of the attachment. + title: Content + mime_type: + description: The MIME type of the attachment. + title: Mime Type + type: string + required: + - content + - mime_type + title: Attachment + type: object + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + CompletionMessage: + description: "A message containing the model's (assistant) response in a chat conversation.\n\n- `StopReason.end_of_turn`: The model finished generating the entire response.\n- `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n- `StopReason.out_of_tokens`: The model ran out of token budget." + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' + title: Tool Calls + required: + - content + - stop_reason + title: CompletionMessage + type: object + ImageContentItem: + description: A image content item. + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + InferenceStep: + description: An inference step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: inference + default: inference + title: Step Type + type: string + model_response: + $ref: '#/components/schemas/CompletionMessage' + description: The response from the LLM. + required: + - turn_id + - step_id + - model_response + title: InferenceStep + type: object + MemoryRetrievalStep: + description: A memory retrieval step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: memory_retrieval + default: memory_retrieval + title: Step Type + type: string + vector_store_ids: + description: The IDs of the vector databases to retrieve context from. + title: Vector Store Ids + type: string + inserted_context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + description: The context retrieved from the vector databases. + title: Inserted Context + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + type: object + SafetyViolation: + description: Details of a safety violation detected by content moderation. + properties: + violation_level: + $ref: '#/components/schemas/ViolationLevel' + description: Severity level of the violation. + user_message: + anyOf: + - type: string + - type: 'null' + default: + description: Message to convey to the user about the violation. + title: User Message + metadata: + additionalProperties: true + description: Additional metadata including specific violation codes for debugging and telemetry. + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + type: object + ShieldCallStep: + description: A shield call step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: shield_call + default: shield_call + title: Step Type + type: string + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + default: + description: The violation from the shield call. + required: + - turn_id + - step_id + title: ShieldCallStep + type: object + StopReason: + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + type: string + TextContentItem: + description: A text content item. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolExecutionStep: + description: A tool execution step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: tool_execution + default: tool_execution + title: Step Type + type: string + tool_calls: + description: The tool calls to execute. + items: + $ref: '#/components/schemas/ToolCall' + title: Tool Calls + type: array + tool_responses: + description: The tool responses from the tool calls. + items: + $ref: '#/components/schemas/ToolResponse' + title: Tool Responses + type: array + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + type: object + ToolResponse: + description: Response from a tool invocation. + properties: + call_id: + minLength: 1 + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + title: Metadata + required: + - call_id + - tool_name + - content + title: ToolResponse + type: object + ToolResponseMessage: + description: A message representing the result of a tool invocation. + properties: + role: + const: tool + default: tool + title: Role + type: string + call_id: + title: Call Id + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + required: + - call_id + - content + title: ToolResponseMessage + type: object + Turn: + description: A single turn in an interaction with an Agentic System. + properties: + turn_id: + description: Unique identifier for the turn within a session + title: Turn Id + type: string + session_id: + description: Unique identifier for the conversation session + title: Session Id + type: string + input_messages: + description: List of messages that initiated this turn + items: + anyOf: + - $ref: '#/components/schemas/UserMessage' + - $ref: '#/components/schemas/ToolResponseMessage' + title: Input Messages + type: array + steps: + description: Ordered list of processing steps executed during this turn + items: + discriminator: + mapping: + inference: '#/$defs/InferenceStep' + memory_retrieval: '#/$defs/MemoryRetrievalStep' + shield_call: '#/$defs/ShieldCallStep' + tool_execution: '#/$defs/ToolExecutionStep' + propertyName: step_type + oneOf: + - $ref: '#/components/schemas/InferenceStep' + - $ref: '#/components/schemas/ToolExecutionStep' + - $ref: '#/components/schemas/ShieldCallStep' + - $ref: '#/components/schemas/MemoryRetrievalStep' + title: Steps + type: array + output_message: + $ref: '#/components/schemas/CompletionMessage' + description: The model's generated response containing content and metadata + output_attachments: + anyOf: + - items: + $ref: '#/components/schemas/Attachment' + type: array + - type: 'null' + description: Files or media attached to the agent's response + title: Output Attachments + started_at: + description: Timestamp when the turn began + format: date-time + title: Started At + type: string + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: Timestamp when the turn finished, if completed + title: Completed At + required: + - turn_id + - session_id + - input_messages + - steps + - output_message + - started_at + title: Turn + type: object + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + UserMessage: + description: A message from the user in a chat conversation. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + default: + title: Context + required: + - content + title: UserMessage + type: object + ViolationLevel: + description: "Severity level of a safety violation.\n\n:cvar INFO: Informational level violation that does not require action\n:cvar WARN: Warning level violation that suggests caution but allows continuation\n:cvar ERROR: Error level violation that requires blocking or intervention" + enum: + - info + - warn + - error + title: ViolationLevel + type: string + _URLOrData: + description: A URL or a base64 encoded string. + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + default: + title: Data + title: _URLOrData + type: object + description: Payload for turn completion events in agent turn responses. + properties: + event_type: + const: turn_complete + default: turn_complete + description: Type of event being reported + title: Event Type + type: string + turn: + $ref: '#/components/schemas/Turn' + description: Complete turn data including all steps and results + required: + - turn + title: AgentTurnResponseTurnCompletePayload + type: object + AgentTurnResponseTurnStartPayload: + description: Payload for turn start events in agent turn responses. + properties: + event_type: + const: turn_start + default: turn_start + description: Type of event being reported + title: Event Type + type: string + turn_id: + description: Unique identifier for the turn within a session + title: Turn Id + type: string + required: + - turn_id + title: AgentTurnResponseTurnStartPayload + type: object + InferenceStep: + $defs: + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + CompletionMessage: + description: "A message containing the model's (assistant) response in a chat conversation.\n\n- `StopReason.end_of_turn`: The model finished generating the entire response.\n- `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n- `StopReason.out_of_tokens`: The model ran out of token budget." + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' + title: Tool Calls + required: + - content + - stop_reason + title: CompletionMessage + type: object + ImageContentItem: + description: A image content item. + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + StopReason: + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + type: string + TextContentItem: + description: A text content item. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + _URLOrData: + description: A URL or a base64 encoded string. + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + default: + title: Data + title: _URLOrData + type: object + description: An inference step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: inference + default: inference + title: Step Type + type: string + model_response: + $ref: '#/components/schemas/CompletionMessage' + description: The response from the LLM. + required: + - turn_id + - step_id + - model_response + title: InferenceStep + type: object + MemoryRetrievalStep: + $defs: + ImageContentItem: + description: A image content item. + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + TextContentItem: + description: A text content item. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + _URLOrData: + description: A URL or a base64 encoded string. + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + default: + title: Data + title: _URLOrData + type: object + description: A memory retrieval step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: memory_retrieval + default: memory_retrieval + title: Step Type + type: string + vector_store_ids: + description: The IDs of the vector databases to retrieve context from. + title: Vector Store Ids + type: string + inserted_context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + description: The context retrieved from the vector databases. + title: Inserted Context + required: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + type: object + ShieldCallStep: + $defs: + SafetyViolation: + description: Details of a safety violation detected by content moderation. + properties: + violation_level: + $ref: '#/components/schemas/ViolationLevel' + description: Severity level of the violation. + user_message: + anyOf: + - type: string + - type: 'null' + default: + description: Message to convey to the user about the violation. + title: User Message + metadata: + additionalProperties: true + description: Additional metadata including specific violation codes for debugging and telemetry. + title: Metadata + type: object + required: + - violation_level + title: SafetyViolation + type: object + ViolationLevel: + description: "Severity level of a safety violation.\n\n:cvar INFO: Informational level violation that does not require action\n:cvar WARN: Warning level violation that suggests caution but allows continuation\n:cvar ERROR: Error level violation that requires blocking or intervention" + enum: + - info + - warn + - error + title: ViolationLevel + type: string + description: A shield call step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: shield_call + default: shield_call + title: Step Type + type: string + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + default: + description: The violation from the shield call. + required: + - turn_id + - step_id + title: ShieldCallStep + type: object + ToolExecutionStep: + $defs: + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + ImageContentItem: + description: A image content item. + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + TextContentItem: + description: A text content item. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolResponse: + description: Response from a tool invocation. + properties: + call_id: + minLength: 1 + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + title: Metadata + required: + - call_id + - tool_name + - content + title: ToolResponse + type: object + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + _URLOrData: + description: A URL or a base64 encoded string. + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + default: + title: Data + title: _URLOrData + type: object + description: A tool execution step in an agent turn. + properties: + turn_id: + description: The ID of the turn. + title: Turn Id + type: string + step_id: + description: The ID of the step. + title: Step Id + type: string + started_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step started. + title: Started At + completed_at: + anyOf: + - format: date-time + type: string + - type: 'null' + default: + description: The time the step completed. + title: Completed At + step_type: + const: tool_execution + default: tool_execution + title: Step Type + type: string + tool_calls: + description: The tool calls to execute. + items: + $ref: '#/components/schemas/ToolCall' + title: Tool Calls + type: array + tool_responses: + description: The tool responses from the tool calls. + items: + $ref: '#/components/schemas/ToolResponse' + title: Tool Responses + type: array + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + type: object + ConversationMessage: + description: OpenAI-compatible message item for conversations. + properties: + id: + description: unique identifier for this message + title: Id + type: string + content: + description: message content + items: + additionalProperties: true + type: object + title: Content + type: array + role: + description: message role + title: Role + type: string + status: + description: message status + title: Status + type: string + type: + const: message + default: message + title: Type + type: string + object: + const: message + default: message + title: Object + type: string + required: + - id + - content + - role + - status + title: ConversationMessage + type: object + Bf16QuantizationConfig: + description: Configuration for BFloat16 precision (typically no quantization). + properties: + type: + const: bf16 + default: bf16 + title: Type + type: string + title: Bf16QuantizationConfig + type: object + ChatCompletionRequest: + $defs: + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + CompletionMessage: + description: "A message containing the model's (assistant) response in a chat conversation.\n\n- `StopReason.end_of_turn`: The model finished generating the entire response.\n- `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n- `StopReason.out_of_tokens`: The model ran out of token budget." + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' + title: Tool Calls + required: + - content + - stop_reason + title: CompletionMessage + type: object + GrammarResponseFormat: + description: Configuration for grammar-guided response generation. + properties: + type: + const: grammar + default: grammar + title: Type + type: string + bnf: + additionalProperties: true + minProperties: 1 + title: Bnf + type: object + required: + - bnf + title: GrammarResponseFormat + type: object + GreedySamplingStrategy: + description: Greedy sampling strategy that selects the highest probability token at each step. + properties: + type: + const: greedy + default: greedy + title: Type + type: string + title: GreedySamplingStrategy + type: object + ImageContentItem: + description: A image content item. + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + JsonSchemaResponseFormat: + description: Configuration for JSON schema-guided response generation. + properties: + type: + const: json_schema + default: json_schema + title: Type + type: string + json_schema: + additionalProperties: true + minProperties: 1 + title: Json Schema + type: object + required: + - json_schema + title: JsonSchemaResponseFormat + type: object + LogProbConfig: + description: Configuration for log probability generation. + properties: + top_k: + anyOf: + - minimum: 0 + type: integer + - type: 'null' + default: 0 + title: Top K + title: LogProbConfig + type: object + SamplingParams: + description: Sampling parameters. + properties: + strategy: + discriminator: + mapping: + greedy: '#/$defs/GreedySamplingStrategy' + top_k: '#/$defs/TopKSamplingStrategy' + top_p: '#/$defs/TopPSamplingStrategy' + propertyName: type + oneOf: + - $ref: '#/components/schemas/GreedySamplingStrategy' + - $ref: '#/components/schemas/TopPSamplingStrategy' + - $ref: '#/components/schemas/TopKSamplingStrategy' + title: Strategy + max_tokens: + anyOf: + - minimum: 0 + type: integer + - type: 'null' + default: + title: Max Tokens + repetition_penalty: + anyOf: + - minimum: 0.0 + type: number + - type: 'null' + default: 1.0 + title: Repetition Penalty + stop: + anyOf: + - items: + type: string + minItems: 1 + type: array + - type: 'null' + default: + title: Stop + title: SamplingParams + type: object + StopReason: + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + type: string + SystemMessage: + description: A system message providing instructions or context to the model. + properties: + role: + const: system + default: system + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + required: + - content + title: SystemMessage + type: object + SystemMessageBehavior: + description: "Config for how to override the default system prompt.\n\nhttps://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt-\n'{{function_definitions}}' to indicate where the function definitions should be inserted." + enum: + - append + - replace + title: SystemMessageBehavior + type: string + TextContentItem: + description: A text content item. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolChoice: + description: Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model. + enum: + - auto + - required + - none + title: ToolChoice + type: string + ToolConfig: + description: "Configuration for tool use.\n\n- `ToolPromptFormat.json`: The tool calls are formatted as a JSON object.\n- `ToolPromptFormat.function_tag`: The tool calls are enclosed in a tag.\n- `ToolPromptFormat.python_list`: The tool calls are output as Python syntax -- a list of function calls.\n- `SystemMessageBehavior.append`: Appends the provided system message to the default system prompt.\n- `SystemMessageBehavior.replace`: Replaces the default system prompt with the provided system message. The system message can include the string\n '{{function_definitions}}' to indicate where the function definitions should be inserted." + properties: + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: string + - type: 'null' + default: auto + title: Tool Choice + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + default: + system_message_behavior: + anyOf: + - $ref: '#/components/schemas/SystemMessageBehavior' + - type: 'null' + default: append + title: ToolConfig + type: object + ToolDefinition: + properties: + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + description: + anyOf: + - type: string + - type: 'null' + default: + title: Description + input_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + title: Input Schema + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + title: Output Schema + required: + - tool_name + title: ToolDefinition + type: object + ToolPromptFormat: + description: "Prompt format for calling custom / zero shot tools.\n\n:cvar json: JSON format for calling tools. It takes the form:\n {\n \"type\": \"function\",\n \"function\" : {\n \"name\": \"function_name\",\n \"description\": \"function_description\",\n \"parameters\": {...}\n }\n }\n:cvar function_tag: Function tag format, pseudo-XML. This looks like:\n (parameters)\n\n:cvar python_list: Python list. The output is a valid Python expression that can be\n evaluated to a list. Each element in the list is a function call. Example:\n [\"function_name(param1, param2)\", \"function_name(param1, param2)\"]" + enum: + - json + - function_tag + - python_list + title: ToolPromptFormat + type: string + ToolResponseMessage: + description: A message representing the result of a tool invocation. + properties: + role: + const: tool + default: tool + title: Role + type: string + call_id: + title: Call Id + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + required: + - call_id + - content + title: ToolResponseMessage + type: object + TopKSamplingStrategy: + description: Top-k sampling strategy that restricts sampling to the k most likely tokens. + properties: + type: + const: top_k + default: top_k + title: Type + type: string + top_k: + minimum: 1 + title: Top K + type: integer + required: + - top_k + title: TopKSamplingStrategy + type: object + TopPSamplingStrategy: + description: Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p. + properties: + type: + const: top_p + default: top_p + title: Type + type: string + temperature: + anyOf: + - type: number + minimum: 0.0 + - type: 'null' + title: Temperature + top_p: + anyOf: + - type: number + - type: 'null' + default: 0.95 + title: Top P + required: + - temperature + title: TopPSamplingStrategy + type: object + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + UserMessage: + description: A message from the user in a chat conversation. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + default: + title: Context + required: + - content + title: UserMessage + type: object + _URLOrData: + description: A URL or a base64 encoded string. + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + default: + title: Data + title: _URLOrData + type: object + properties: + messages: + items: + discriminator: + mapping: + assistant: '#/$defs/CompletionMessage' + system: '#/$defs/SystemMessage' + tool: '#/$defs/ToolResponseMessage' + user: '#/$defs/UserMessage' + propertyName: role + oneOf: + - $ref: '#/components/schemas/UserMessage' + - $ref: '#/components/schemas/SystemMessage' + - $ref: '#/components/schemas/ToolResponseMessage' + - $ref: '#/components/schemas/CompletionMessage' + title: Messages + type: array + sampling_params: + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' + tools: + anyOf: + - items: + $ref: '#/components/schemas/ToolDefinition' + type: array + - type: 'null' + title: Tools + tool_config: + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' + response_format: + anyOf: + - discriminator: + mapping: + grammar: '#/$defs/GrammarResponseFormat' + json_schema: '#/$defs/JsonSchemaResponseFormat' + propertyName: type + oneOf: + - $ref: '#/components/schemas/JsonSchemaResponseFormat' + - $ref: '#/components/schemas/GrammarResponseFormat' + - type: 'null' + default: + title: Response Format + stream: + anyOf: + - type: boolean + - type: 'null' + default: false + title: Stream + logprobs: + anyOf: + - $ref: '#/components/schemas/LogProbConfig' + - type: 'null' + default: + required: + - messages + title: ChatCompletionRequest + type: object + ChatCompletionResponse: + $defs: + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + CompletionMessage: + description: "A message containing the model's (assistant) response in a chat conversation.\n\n- `StopReason.end_of_turn`: The model finished generating the entire response.\n- `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n- `StopReason.out_of_tokens`: The model ran out of token budget." + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' + title: Tool Calls + required: + - content + - stop_reason + title: CompletionMessage + type: object + ImageContentItem: + description: A image content item. + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + MetricInResponse: + description: "A metric value included in API responses.\n:param metric: The name of the metric\n:param value: The numeric value of the metric\n:param unit: (Optional) The unit of measurement for the metric value" + properties: + metric: + title: Metric + type: string + value: + anyOf: + - type: integer + - type: number + title: Value + unit: + anyOf: + - type: string + - type: 'null' + default: + title: Unit + required: + - metric + - value + title: MetricInResponse + type: object + StopReason: + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + type: string + TextContentItem: + description: A text content item. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + TokenLogProbs: + description: Log probabilities for generated tokens. + properties: + logprobs_by_token: + additionalProperties: + type: number + minProperties: 1 + title: Logprobs By Token + type: object + required: + - logprobs_by_token + title: TokenLogProbs + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + _URLOrData: + description: A URL or a base64 encoded string. + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + default: + title: Data + title: _URLOrData + type: object + description: Response from a chat completion request. + properties: + metrics: + anyOf: + - items: + $ref: '#/components/schemas/MetricInResponse' + type: array + - type: 'null' + default: + title: Metrics + completion_message: + $ref: '#/components/schemas/CompletionMessage' + logprobs: + anyOf: + - items: + $ref: '#/components/schemas/TokenLogProbs' + type: array + - type: 'null' + default: + title: Logprobs + required: + - completion_message + title: ChatCompletionResponse + type: object + ChatCompletionResponseEvent: + $defs: + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + ChatCompletionResponseEventType: + description: Types of events that can occur during chat completion. + enum: + - start + - complete + - progress + title: ChatCompletionResponseEventType + type: string + ImageDelta: + description: An image content delta for streaming responses. + properties: + type: + const: image + default: image + title: Type + type: string + image: + format: binary + title: Image + type: string + required: + - image + title: ImageDelta + type: object + StopReason: + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + type: string + TextDelta: + description: A text content delta for streaming responses. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextDelta + type: object + TokenLogProbs: + description: Log probabilities for generated tokens. + properties: + logprobs_by_token: + additionalProperties: + type: number + minProperties: 1 + title: Logprobs By Token + type: object + required: + - logprobs_by_token + title: TokenLogProbs + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolCallDelta: + description: A tool call content delta for streaming responses. + properties: + type: + const: tool_call + default: tool_call + title: Type + type: string + tool_call: + anyOf: + - type: string + - $ref: '#/components/schemas/ToolCall' + title: Tool Call + parse_status: + $ref: '#/components/schemas/ToolCallParseStatus' + required: + - tool_call + - parse_status + title: ToolCallDelta + type: object + ToolCallParseStatus: + description: Status of tool call parsing during streaming. + enum: + - started + - in_progress + - failed + - succeeded + title: ToolCallParseStatus + type: string + description: An event during chat completion generation. + properties: + event_type: + $ref: '#/components/schemas/ChatCompletionResponseEventType' + delta: + discriminator: + mapping: + image: '#/$defs/ImageDelta' + text: '#/$defs/TextDelta' + tool_call: '#/$defs/ToolCallDelta' + propertyName: type + oneOf: + - $ref: '#/components/schemas/TextDelta' + - $ref: '#/components/schemas/ImageDelta' + - $ref: '#/components/schemas/ToolCallDelta' + title: Delta + logprobs: + anyOf: + - items: + $ref: '#/components/schemas/TokenLogProbs' + type: array + - type: 'null' + default: + title: Logprobs + stop_reason: + anyOf: + - $ref: '#/components/schemas/StopReason' + - type: 'null' + default: + required: + - event_type + - delta + title: ChatCompletionResponseEvent + type: object + ChatCompletionResponseStreamChunk: + $defs: + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + ChatCompletionResponseEvent: + description: An event during chat completion generation. + properties: + event_type: + $ref: '#/components/schemas/ChatCompletionResponseEventType' + delta: + discriminator: + mapping: + image: '#/$defs/ImageDelta' + text: '#/$defs/TextDelta' + tool_call: '#/$defs/ToolCallDelta' + propertyName: type + oneOf: + - $ref: '#/components/schemas/TextDelta' + - $ref: '#/components/schemas/ImageDelta' + - $ref: '#/components/schemas/ToolCallDelta' + title: Delta + logprobs: + anyOf: + - items: + $ref: '#/components/schemas/TokenLogProbs' + type: array + - type: 'null' + default: + title: Logprobs + stop_reason: + anyOf: + - $ref: '#/components/schemas/StopReason' + - type: 'null' + default: + required: + - event_type + - delta + title: ChatCompletionResponseEvent + type: object + ChatCompletionResponseEventType: + description: Types of events that can occur during chat completion. + enum: + - start + - complete + - progress + title: ChatCompletionResponseEventType + type: string + ImageDelta: + description: An image content delta for streaming responses. + properties: + type: + const: image + default: image + title: Type + type: string + image: + format: binary + title: Image + type: string + required: + - image + title: ImageDelta + type: object + MetricInResponse: + description: "A metric value included in API responses.\n:param metric: The name of the metric\n:param value: The numeric value of the metric\n:param unit: (Optional) The unit of measurement for the metric value" + properties: + metric: + title: Metric + type: string + value: + anyOf: + - type: integer + - type: number + title: Value + unit: + anyOf: + - type: string + - type: 'null' + default: + title: Unit + required: + - metric + - value + title: MetricInResponse + type: object + StopReason: + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + type: string + TextDelta: + description: A text content delta for streaming responses. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextDelta + type: object + TokenLogProbs: + description: Log probabilities for generated tokens. + properties: + logprobs_by_token: + additionalProperties: + type: number + minProperties: 1 + title: Logprobs By Token + type: object + required: + - logprobs_by_token + title: TokenLogProbs + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolCallDelta: + description: A tool call content delta for streaming responses. + properties: + type: + const: tool_call + default: tool_call + title: Type + type: string + tool_call: + anyOf: + - type: string + - $ref: '#/components/schemas/ToolCall' + title: Tool Call + parse_status: + $ref: '#/components/schemas/ToolCallParseStatus' + required: + - tool_call + - parse_status + title: ToolCallDelta + type: object + ToolCallParseStatus: + description: Status of tool call parsing during streaming. + enum: + - started + - in_progress + - failed + - succeeded + title: ToolCallParseStatus + type: string + description: A chunk of a streamed chat completion response. + properties: + metrics: + anyOf: + - items: + $ref: '#/components/schemas/MetricInResponse' + type: array + - type: 'null' + default: + title: Metrics + event: + $ref: '#/components/schemas/ChatCompletionResponseEvent' + required: + - event + title: ChatCompletionResponseStreamChunk + type: object + CompletionMessage: + $defs: + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + ImageContentItem: + description: A image content item. + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + StopReason: + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + type: string + TextContentItem: + description: A text content item. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + _URLOrData: + description: A URL or a base64 encoded string. + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + default: + title: Data + title: _URLOrData + type: object + description: "A message containing the model's (assistant) response in a chat conversation.\n\n- `StopReason.end_of_turn`: The model finished generating the entire response.\n- `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n- `StopReason.out_of_tokens`: The model ran out of token budget." + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' + title: Tool Calls + required: + - content + - stop_reason + title: CompletionMessage + type: object + CompletionResponse: + $defs: + MetricInResponse: + description: "A metric value included in API responses.\n:param metric: The name of the metric\n:param value: The numeric value of the metric\n:param unit: (Optional) The unit of measurement for the metric value" + properties: + metric: + title: Metric + type: string + value: + anyOf: + - type: integer + - type: number + title: Value + unit: + anyOf: + - type: string + - type: 'null' + default: + title: Unit + required: + - metric + - value + title: MetricInResponse + type: object + StopReason: + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + type: string + TokenLogProbs: + description: Log probabilities for generated tokens. + properties: + logprobs_by_token: + additionalProperties: + type: number + minProperties: 1 + title: Logprobs By Token + type: object + required: + - logprobs_by_token + title: TokenLogProbs + type: object + description: Response from a completion request. + properties: + metrics: + anyOf: + - items: + $ref: '#/components/schemas/MetricInResponse' + type: array + - type: 'null' + default: + title: Metrics + content: + title: Content + type: string + stop_reason: + $ref: '#/components/schemas/StopReason' + logprobs: + anyOf: + - items: + $ref: '#/components/schemas/TokenLogProbs' + type: array + - type: 'null' + default: + title: Logprobs + required: + - content + - stop_reason + title: CompletionResponse + type: object + CompletionResponseStreamChunk: + $defs: + MetricInResponse: + description: "A metric value included in API responses.\n:param metric: The name of the metric\n:param value: The numeric value of the metric\n:param unit: (Optional) The unit of measurement for the metric value" + properties: + metric: + title: Metric + type: string + value: + anyOf: + - type: integer + - type: number + title: Value + unit: + anyOf: + - type: string + - type: 'null' + default: + title: Unit + required: + - metric + - value + title: MetricInResponse + type: object + StopReason: + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + type: string + TokenLogProbs: + description: Log probabilities for generated tokens. + properties: + logprobs_by_token: + additionalProperties: + type: number + minProperties: 1 + title: Logprobs By Token + type: object + required: + - logprobs_by_token + title: TokenLogProbs + type: object + description: A chunk of a streamed completion response. + properties: + metrics: + anyOf: + - items: + $ref: '#/components/schemas/MetricInResponse' + type: array + - type: 'null' + default: + title: Metrics + delta: + title: Delta + type: string + stop_reason: + anyOf: + - $ref: '#/components/schemas/StopReason' + - type: 'null' + default: + logprobs: + anyOf: + - items: + $ref: '#/components/schemas/TokenLogProbs' + type: array + - type: 'null' + default: + title: Logprobs + required: + - delta + title: CompletionResponseStreamChunk + type: object + EmbeddingsResponse: + description: Response containing generated embeddings. + properties: + embeddings: + items: + items: + type: number + type: array + title: Embeddings + type: array + required: + - embeddings + title: EmbeddingsResponse + type: object + Fp8QuantizationConfig: + description: Configuration for 8-bit floating point quantization. + properties: + type: + const: fp8_mixed + default: fp8_mixed + title: Type + type: string + title: Fp8QuantizationConfig + type: object + Int4QuantizationConfig: + description: Configuration for 4-bit integer quantization. + properties: + type: + const: int4_mixed + default: int4_mixed + title: Type + type: string + scheme: + anyOf: + - minLength: 1 + type: string + - type: 'null' + default: int4_weight_int8_dynamic_activation + title: Scheme + title: Int4QuantizationConfig + type: object + OpenAIAssistantMessageParam: + $defs: + OpenAIChatCompletionContentPartTextParam: + description: Text content part for OpenAI-compatible chat completion messages. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: OpenAIChatCompletionContentPartTextParam + type: object + OpenAIChatCompletionToolCall: + description: Tool call specification for OpenAI-compatible chat completion responses. + properties: + index: + anyOf: + - type: integer + - type: 'null' + default: + title: Index + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + type: + const: function + default: function + title: Type + type: string + function: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' + - type: 'null' + default: + title: OpenAIChatCompletionToolCall + type: object + OpenAIChatCompletionToolCallFunction: + description: Function call details for OpenAI-compatible tool calls. + properties: + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + arguments: + anyOf: + - type: string + - type: 'null' + default: + title: Arguments + title: OpenAIChatCompletionToolCallFunction + type: object + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + - type: 'null' + default: + title: Content + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + default: + title: Tool Calls + title: OpenAIAssistantMessageParam + type: object + OpenAIChatCompletion: + $defs: + OpenAIAssistantMessageParam: + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + - type: 'null' + default: + title: Content + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + default: + title: Tool Calls + title: OpenAIAssistantMessageParam + type: object + OpenAIChatCompletionContentPartImageParam: + description: Image content part for OpenAI-compatible chat completion messages. + properties: + type: + const: image_url + default: image_url + title: Type + type: string + image_url: + $ref: '#/components/schemas/OpenAIImageURL' + required: + - image_url + title: OpenAIChatCompletionContentPartImageParam + type: object + OpenAIChatCompletionContentPartTextParam: + description: Text content part for OpenAI-compatible chat completion messages. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: OpenAIChatCompletionContentPartTextParam + type: object + OpenAIChatCompletionToolCall: + description: Tool call specification for OpenAI-compatible chat completion responses. + properties: + index: + anyOf: + - type: integer + - type: 'null' + default: + title: Index + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + type: + const: function + default: function + title: Type + type: string + function: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' + - type: 'null' + default: + title: OpenAIChatCompletionToolCall + type: object + OpenAIChatCompletionToolCallFunction: + description: Function call details for OpenAI-compatible tool calls. + properties: + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + arguments: + anyOf: + - type: string + - type: 'null' + default: + title: Arguments + title: OpenAIChatCompletionToolCallFunction + type: object + OpenAIChatCompletionUsage: + description: Usage information for OpenAI chat completion. + properties: + prompt_tokens: + title: Prompt Tokens + type: integer + completion_tokens: + title: Completion Tokens + type: integer + total_tokens: + title: Total Tokens + type: integer + prompt_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails' + - type: 'null' + default: + completion_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails' + - type: 'null' + default: + required: + - prompt_tokens + - completion_tokens + - total_tokens + title: OpenAIChatCompletionUsage + type: object + OpenAIChatCompletionUsageCompletionTokensDetails: + description: Token details for output tokens in OpenAI chat completion usage. + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + default: + title: Reasoning Tokens + title: OpenAIChatCompletionUsageCompletionTokensDetails + type: object + OpenAIChatCompletionUsagePromptTokensDetails: + description: Token details for prompt tokens in OpenAI chat completion usage. + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + default: + title: Cached Tokens + title: OpenAIChatCompletionUsagePromptTokensDetails + type: object + OpenAIChoice: + description: A choice from an OpenAI-compatible chat completion response. + properties: + message: + discriminator: + mapping: + assistant: '#/$defs/OpenAIAssistantMessageParam' + developer: '#/$defs/OpenAIDeveloperMessageParam' + system: '#/$defs/OpenAISystemMessageParam' + tool: '#/$defs/OpenAIToolMessageParam' + user: '#/$defs/OpenAIUserMessageParam' + propertyName: role + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Message + finish_reason: + title: Finish Reason + type: string + index: + title: Index + type: integer + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs' + - type: 'null' + default: + required: + - message + - finish_reason + - index + title: OpenAIChoice + type: object + OpenAIChoiceLogprobs: + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. + properties: + content: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + default: + title: Content + refusal: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + default: + title: Refusal + title: OpenAIChoiceLogprobs + type: object + OpenAIDeveloperMessageParam: + description: A message from the developer in an OpenAI-compatible chat completion request. + properties: + role: + const: developer + default: developer + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + required: + - content + title: OpenAIDeveloperMessageParam + type: object + OpenAIFile: + properties: + type: + const: file + default: file + title: Type + type: string + file: + $ref: '#/components/schemas/OpenAIFileFile' + required: + - file + title: OpenAIFile + type: object + OpenAIFileFile: + properties: + file_id: + anyOf: + - type: string + - type: 'null' + default: + title: File Id + filename: + anyOf: + - type: string + - type: 'null' + default: + title: Filename + title: OpenAIFileFile + type: object + OpenAIImageURL: + description: Image URL specification for OpenAI-compatible chat completion messages. + properties: + url: + title: Url + type: string + detail: + anyOf: + - type: string + - type: 'null' + default: + title: Detail + required: + - url + title: OpenAIImageURL + type: object + OpenAISystemMessageParam: + description: A system message providing instructions or context to the model. + properties: + role: + const: system + default: system + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + required: + - content + title: OpenAISystemMessageParam + type: object + OpenAITokenLogProb: + description: "The log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token\n:top_logprobs: The top log probabilities for the token" + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + default: + title: Bytes + logprob: + title: Logprob + type: number + top_logprobs: + items: + $ref: '#/components/schemas/OpenAITopLogProb' + title: Top Logprobs + type: array + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + type: object + OpenAIToolMessageParam: + description: A message representing the result of a tool invocation in an OpenAI-compatible chat completion request. + properties: + role: + const: tool + default: tool + title: Role + type: string + tool_call_id: + title: Tool Call Id + type: string + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + required: + - tool_call_id + - content + title: OpenAIToolMessageParam + type: object + OpenAITopLogProb: + description: "The top log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token" + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + default: + title: Bytes + logprob: + title: Logprob + type: number + required: + - token + - logprob + title: OpenAITopLogProb + type: object + OpenAIUserMessageParam: + description: A message from the user in an OpenAI-compatible chat completion request. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + file: '#/$defs/OpenAIFile' + image_url: '#/$defs/OpenAIChatCompletionContentPartImageParam' + text: '#/$defs/OpenAIChatCompletionContentPartTextParam' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + required: + - content + title: OpenAIUserMessageParam + type: object + description: Response from an OpenAI-compatible chat completion request. + properties: + id: + title: Id + type: string + choices: + items: + $ref: '#/components/schemas/OpenAIChoice' + title: Choices + type: array + object: + const: chat.completion + default: chat.completion + title: Object + type: string + created: + title: Created + type: integer + model: + title: Model + type: string + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsage' + - type: 'null' + default: + required: + - id + - choices + - created + - model + title: OpenAIChatCompletion + type: object + OpenAIChatCompletionChunk: + $defs: + OpenAIChatCompletionToolCall: + description: Tool call specification for OpenAI-compatible chat completion responses. + properties: + index: + anyOf: + - type: integer + - type: 'null' + default: + title: Index + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + type: + const: function + default: function + title: Type + type: string + function: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' + - type: 'null' + default: + title: OpenAIChatCompletionToolCall + type: object + OpenAIChatCompletionToolCallFunction: + description: Function call details for OpenAI-compatible tool calls. + properties: + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + arguments: + anyOf: + - type: string + - type: 'null' + default: + title: Arguments + title: OpenAIChatCompletionToolCallFunction + type: object + OpenAIChatCompletionUsage: + description: Usage information for OpenAI chat completion. + properties: + prompt_tokens: + title: Prompt Tokens + type: integer + completion_tokens: + title: Completion Tokens + type: integer + total_tokens: + title: Total Tokens + type: integer + prompt_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails' + - type: 'null' + default: + completion_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails' + - type: 'null' + default: + required: + - prompt_tokens + - completion_tokens + - total_tokens + title: OpenAIChatCompletionUsage + type: object + OpenAIChatCompletionUsageCompletionTokensDetails: + description: Token details for output tokens in OpenAI chat completion usage. + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + default: + title: Reasoning Tokens + title: OpenAIChatCompletionUsageCompletionTokensDetails + type: object + OpenAIChatCompletionUsagePromptTokensDetails: + description: Token details for prompt tokens in OpenAI chat completion usage. + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + default: + title: Cached Tokens + title: OpenAIChatCompletionUsagePromptTokensDetails + type: object + OpenAIChoiceDelta: + description: A delta from an OpenAI-compatible chat completion streaming response. + properties: + content: + anyOf: + - type: string + - type: 'null' + default: + title: Content + refusal: + anyOf: + - type: string + - type: 'null' + default: + title: Refusal + role: + anyOf: + - type: string + - type: 'null' + default: + title: Role + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + default: + title: Tool Calls + reasoning_content: + anyOf: + - type: string + - type: 'null' + default: + title: Reasoning Content + title: OpenAIChoiceDelta + type: object + OpenAIChoiceLogprobs: + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. + properties: + content: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + default: + title: Content + refusal: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + default: + title: Refusal + title: OpenAIChoiceLogprobs + type: object + OpenAIChunkChoice: + description: A chunk choice from an OpenAI-compatible chat completion streaming response. + properties: + delta: + $ref: '#/components/schemas/OpenAIChoiceDelta' + finish_reason: + title: Finish Reason + type: string + index: + title: Index + type: integer + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs' + - type: 'null' + default: + required: + - delta + - finish_reason + - index + title: OpenAIChunkChoice + type: object + OpenAITokenLogProb: + description: "The log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token\n:top_logprobs: The top log probabilities for the token" + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + default: + title: Bytes + logprob: + title: Logprob + type: number + top_logprobs: + items: + $ref: '#/components/schemas/OpenAITopLogProb' + title: Top Logprobs + type: array + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + type: object + OpenAITopLogProb: + description: "The top log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token" + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + default: + title: Bytes + logprob: + title: Logprob + type: number + required: + - token + - logprob + title: OpenAITopLogProb + type: object + description: Chunk from a streaming response to an OpenAI-compatible chat completion request. + properties: + id: + title: Id + type: string + choices: + items: + $ref: '#/components/schemas/OpenAIChunkChoice' + title: Choices + type: array + object: + const: chat.completion.chunk + default: chat.completion.chunk + title: Object + type: string + created: + title: Created + type: integer + model: + title: Model + type: string + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsage' + - type: 'null' + default: + required: + - id + - choices + - created + - model + title: OpenAIChatCompletionChunk + type: object + OpenAIChoice: + $defs: + OpenAIAssistantMessageParam: + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. + properties: + role: + const: assistant + default: assistant + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + - type: 'null' + default: + title: Content + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + default: + title: Tool Calls + title: OpenAIAssistantMessageParam + type: object + OpenAIChatCompletionContentPartImageParam: + description: Image content part for OpenAI-compatible chat completion messages. + properties: + type: + const: image_url + default: image_url + title: Type + type: string + image_url: + $ref: '#/components/schemas/OpenAIImageURL' + required: + - image_url + title: OpenAIChatCompletionContentPartImageParam + type: object + OpenAIChatCompletionContentPartTextParam: + description: Text content part for OpenAI-compatible chat completion messages. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: OpenAIChatCompletionContentPartTextParam + type: object + OpenAIChatCompletionToolCall: + description: Tool call specification for OpenAI-compatible chat completion responses. + properties: + index: + anyOf: + - type: integer + - type: 'null' + default: + title: Index + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + type: + const: function + default: function + title: Type + type: string + function: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' + - type: 'null' + default: + title: OpenAIChatCompletionToolCall + type: object + OpenAIChatCompletionToolCallFunction: + description: Function call details for OpenAI-compatible tool calls. + properties: + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + arguments: + anyOf: + - type: string + - type: 'null' + default: + title: Arguments + title: OpenAIChatCompletionToolCallFunction + type: object + OpenAIChoiceLogprobs: + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. + properties: + content: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + default: + title: Content + refusal: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + default: + title: Refusal + title: OpenAIChoiceLogprobs + type: object + OpenAIDeveloperMessageParam: + description: A message from the developer in an OpenAI-compatible chat completion request. + properties: + role: + const: developer + default: developer + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + required: + - content + title: OpenAIDeveloperMessageParam + type: object + OpenAIFile: + properties: + type: + const: file + default: file + title: Type + type: string + file: + $ref: '#/components/schemas/OpenAIFileFile' + required: + - file + title: OpenAIFile + type: object + OpenAIFileFile: + properties: + file_id: + anyOf: + - type: string + - type: 'null' + default: + title: File Id + filename: + anyOf: + - type: string + - type: 'null' + default: + title: Filename + title: OpenAIFileFile + type: object + OpenAIImageURL: + description: Image URL specification for OpenAI-compatible chat completion messages. + properties: + url: + title: Url + type: string + detail: + anyOf: + - type: string + - type: 'null' + default: + title: Detail + required: + - url + title: OpenAIImageURL + type: object + OpenAISystemMessageParam: + description: A system message providing instructions or context to the model. + properties: + role: + const: system + default: system + title: Role + type: string + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + required: + - content + title: OpenAISystemMessageParam + type: object + OpenAITokenLogProb: + description: "The log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token\n:top_logprobs: The top log probabilities for the token" + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + default: + title: Bytes + logprob: + title: Logprob + type: number + top_logprobs: + items: + $ref: '#/components/schemas/OpenAITopLogProb' + title: Top Logprobs + type: array + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + type: object + OpenAIToolMessageParam: + description: A message representing the result of a tool invocation in an OpenAI-compatible chat completion request. + properties: + role: + const: tool + default: tool + title: Role + type: string + tool_call_id: + title: Tool Call Id + type: string + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + required: + - tool_call_id + - content + title: OpenAIToolMessageParam + type: object + OpenAITopLogProb: + description: "The top log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token" + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + default: + title: Bytes + logprob: + title: Logprob + type: number + required: + - token + - logprob + title: OpenAITopLogProb + type: object + OpenAIUserMessageParam: + description: A message from the user in an OpenAI-compatible chat completion request. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + file: '#/$defs/OpenAIFile' + image_url: '#/$defs/OpenAIChatCompletionContentPartImageParam' + text: '#/$defs/OpenAIChatCompletionContentPartTextParam' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + required: + - content + title: OpenAIUserMessageParam + type: object + description: A choice from an OpenAI-compatible chat completion response. + properties: + message: + discriminator: + mapping: + assistant: '#/$defs/OpenAIAssistantMessageParam' + developer: '#/$defs/OpenAIDeveloperMessageParam' + system: '#/$defs/OpenAISystemMessageParam' + tool: '#/$defs/OpenAIToolMessageParam' + user: '#/$defs/OpenAIUserMessageParam' + propertyName: role + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Message + finish_reason: + title: Finish Reason + type: string + index: + title: Index + type: integer + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs' + - type: 'null' + default: + required: + - message + - finish_reason + - index + title: OpenAIChoice + type: object + OpenAIChoiceDelta: + $defs: + OpenAIChatCompletionToolCall: + description: Tool call specification for OpenAI-compatible chat completion responses. + properties: + index: + anyOf: + - type: integer + - type: 'null' + default: + title: Index + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + type: + const: function + default: function + title: Type + type: string + function: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' + - type: 'null' + default: + title: OpenAIChatCompletionToolCall + type: object + OpenAIChatCompletionToolCallFunction: + description: Function call details for OpenAI-compatible tool calls. + properties: + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + arguments: + anyOf: + - type: string + - type: 'null' + default: + title: Arguments + title: OpenAIChatCompletionToolCallFunction + type: object + description: A delta from an OpenAI-compatible chat completion streaming response. + properties: + content: + anyOf: + - type: string + - type: 'null' + default: + title: Content + refusal: + anyOf: + - type: string + - type: 'null' + default: + title: Refusal + role: + anyOf: + - type: string + - type: 'null' + default: + title: Role + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + default: + title: Tool Calls + reasoning_content: + anyOf: + - type: string + - type: 'null' + default: + title: Reasoning Content + title: OpenAIChoiceDelta + type: object + OpenAIChoiceLogprobs: + $defs: + OpenAITokenLogProb: + description: "The log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token\n:top_logprobs: The top log probabilities for the token" + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + default: + title: Bytes + logprob: + title: Logprob + type: number + top_logprobs: + items: + $ref: '#/components/schemas/OpenAITopLogProb' + title: Top Logprobs + type: array + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + type: object + OpenAITopLogProb: + description: "The top log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token" + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + default: + title: Bytes + logprob: + title: Logprob + type: number + required: + - token + - logprob + title: OpenAITopLogProb + type: object + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. + properties: + content: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + default: + title: Content + refusal: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + default: + title: Refusal + title: OpenAIChoiceLogprobs + type: object + OpenAIChunkChoice: + $defs: + OpenAIChatCompletionToolCall: + description: Tool call specification for OpenAI-compatible chat completion responses. + properties: + index: + anyOf: + - type: integer + - type: 'null' + default: + title: Index + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + type: + const: function + default: function + title: Type + type: string + function: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' + - type: 'null' + default: + title: OpenAIChatCompletionToolCall + type: object + OpenAIChatCompletionToolCallFunction: + description: Function call details for OpenAI-compatible tool calls. + properties: + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + arguments: + anyOf: + - type: string + - type: 'null' + default: + title: Arguments + title: OpenAIChatCompletionToolCallFunction + type: object + OpenAIChoiceDelta: + description: A delta from an OpenAI-compatible chat completion streaming response. + properties: + content: + anyOf: + - type: string + - type: 'null' + default: + title: Content + refusal: + anyOf: + - type: string + - type: 'null' + default: + title: Refusal + role: + anyOf: + - type: string + - type: 'null' + default: + title: Role + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + default: + title: Tool Calls + reasoning_content: + anyOf: + - type: string + - type: 'null' + default: + title: Reasoning Content + title: OpenAIChoiceDelta + type: object + OpenAIChoiceLogprobs: + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. + properties: + content: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + default: + title: Content + refusal: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + default: + title: Refusal + title: OpenAIChoiceLogprobs + type: object + OpenAITokenLogProb: + description: "The log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token\n:top_logprobs: The top log probabilities for the token" + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + default: + title: Bytes + logprob: + title: Logprob + type: number + top_logprobs: + items: + $ref: '#/components/schemas/OpenAITopLogProb' + title: Top Logprobs + type: array + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + type: object + OpenAITopLogProb: + description: "The top log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token" + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + default: + title: Bytes + logprob: + title: Logprob + type: number + required: + - token + - logprob + title: OpenAITopLogProb + type: object + description: A chunk choice from an OpenAI-compatible chat completion streaming response. + properties: + delta: + $ref: '#/components/schemas/OpenAIChoiceDelta' + finish_reason: + title: Finish Reason + type: string + index: + title: Index + type: integer + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs' + - type: 'null' + default: + required: + - delta + - finish_reason + - index + title: OpenAIChunkChoice + type: object + OpenAICompletionChoice: + $defs: + OpenAIChoiceLogprobs: + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. + properties: + content: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + default: + title: Content + refusal: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + default: + title: Refusal + title: OpenAIChoiceLogprobs + type: object + OpenAITokenLogProb: + description: "The log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token\n:top_logprobs: The top log probabilities for the token" + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + default: + title: Bytes + logprob: + title: Logprob + type: number + top_logprobs: + items: + $ref: '#/components/schemas/OpenAITopLogProb' + title: Top Logprobs + type: array + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + type: object + OpenAITopLogProb: + description: "The top log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token" + properties: + token: + title: Token + type: string + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + default: + title: Bytes + logprob: + title: Logprob + type: number + required: + - token + - logprob + title: OpenAITopLogProb + type: object + description: "A choice from an OpenAI-compatible completion response.\n\n:finish_reason: The reason the model stopped generating\n:text: The text of the choice\n:index: The index of the choice\n:logprobs: (Optional) The log probabilities for the tokens in the choice" + properties: + finish_reason: + title: Finish Reason + type: string + text: + title: Text + type: string + index: + title: Index + type: integer + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs' + - type: 'null' + default: + required: + - finish_reason + - text + - index + title: OpenAICompletionChoice + type: object + OpenAICompletionLogprobs: + description: "The log probabilities for the tokens in the message from an OpenAI-compatible completion response.\n\n:text_offset: (Optional) The offset of the token in the text\n:token_logprobs: (Optional) The log probabilities for the tokens\n:tokens: (Optional) The tokens\n:top_logprobs: (Optional) The top log probabilities for the tokens" + properties: + text_offset: + anyOf: + - items: + type: integer + type: array + - type: 'null' + default: + title: Text Offset + token_logprobs: + anyOf: + - items: + type: number + type: array + - type: 'null' + default: + title: Token Logprobs + tokens: + anyOf: + - items: + type: string + type: array + - type: 'null' + default: + title: Tokens + top_logprobs: + anyOf: + - items: + additionalProperties: + type: number + type: object + type: array + - type: 'null' + default: + title: Top Logprobs + title: OpenAICompletionLogprobs + type: object + OpenAIUserMessageParam: + $defs: + OpenAIChatCompletionContentPartImageParam: + description: Image content part for OpenAI-compatible chat completion messages. + properties: + type: + const: image_url + default: image_url + title: Type + type: string + image_url: + $ref: '#/components/schemas/OpenAIImageURL' + required: + - image_url + title: OpenAIChatCompletionContentPartImageParam + type: object + OpenAIChatCompletionContentPartTextParam: + description: Text content part for OpenAI-compatible chat completion messages. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: OpenAIChatCompletionContentPartTextParam + type: object + OpenAIFile: + properties: + type: + const: file + default: file + title: Type + type: string + file: + $ref: '#/components/schemas/OpenAIFileFile' + required: + - file + title: OpenAIFile + type: object + OpenAIFileFile: + properties: + file_id: + anyOf: + - type: string + - type: 'null' + default: + title: File Id + filename: + anyOf: + - type: string + - type: 'null' + default: + title: Filename + title: OpenAIFileFile + type: object + OpenAIImageURL: + description: Image URL specification for OpenAI-compatible chat completion messages. + properties: + url: + title: Url + type: string + detail: + anyOf: + - type: string + - type: 'null' + default: + title: Detail + required: + - url + title: OpenAIImageURL + type: object + description: A message from the user in an OpenAI-compatible chat completion request. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + file: '#/$defs/OpenAIFile' + image_url: '#/$defs/OpenAIChatCompletionContentPartImageParam' + text: '#/$defs/OpenAIChatCompletionContentPartTextParam' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + required: + - content + title: OpenAIUserMessageParam + type: object + TokenLogProbs: + description: Log probabilities for generated tokens. + properties: + logprobs_by_token: + additionalProperties: + type: number + minProperties: 1 + title: Logprobs By Token + type: object + required: + - logprobs_by_token + title: TokenLogProbs + type: object + ToolResponse: + $defs: + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + ImageContentItem: + description: A image content item. + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + TextContentItem: + description: A text content item. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + _URLOrData: + description: A URL or a base64 encoded string. + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + default: + title: Data + title: _URLOrData + type: object + description: Response from a tool invocation. + properties: + call_id: + minLength: 1 + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + title: Metadata + required: + - call_id + - tool_name + - content + title: ToolResponse + type: object + ToolResponseMessage: + $defs: + ImageContentItem: + description: A image content item. + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + TextContentItem: + description: A text content item. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + _URLOrData: + description: A URL or a base64 encoded string. + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + default: + title: Data + title: _URLOrData + type: object + description: A message representing the result of a tool invocation. + properties: + role: + const: tool + default: tool + title: Role + type: string + call_id: + title: Call Id + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + required: + - call_id + - content + title: ToolResponseMessage + type: object + UserMessage: + $defs: + ImageContentItem: + description: A image content item. + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + TextContentItem: + description: A text content item. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + _URLOrData: + description: A URL or a base64 encoded string. + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + default: + title: Data + title: _URLOrData + type: object + description: A message from the user in a chat conversation. + properties: + role: + const: user + default: user + title: Role + type: string + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + context: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + default: + title: Context + required: + - content + title: UserMessage + type: object + OpenAIModel: + description: A model from OpenAI. + properties: + id: + description: The ID of the model. + title: Id + type: string + object: + const: model + default: model + description: The object type, which will be 'model'. + title: Object + type: string + created: + description: The Unix timestamp in seconds when the model was created. + title: Created + type: integer + owned_by: + description: The owner of the model. + title: Owned By + type: string + required: + - id + - created + - owned_by + title: OpenAIModel + type: object + PostTrainingJobLogStream: + description: Stream of logs from a finetuning job. + properties: + job_uuid: + title: Job Uuid + type: string + log_lines: + items: + type: string + title: Log Lines + type: array + required: + - job_uuid + - log_lines + title: PostTrainingJobLogStream + type: object + PostTrainingRLHFRequest: + $defs: + DPOAlignmentConfig: + description: Configuration for Direct Preference Optimization (DPO) alignment. + properties: + beta: + title: Beta + type: number + loss_type: + $ref: '#/components/schemas/DPOLossType' + default: sigmoid + required: + - beta + title: DPOAlignmentConfig + type: object + DPOLossType: + enum: + - sigmoid + - hinge + - ipo + - kto_pair + title: DPOLossType + type: string + DataConfig: + description: Configuration for training data and data loading. + properties: + dataset_id: + title: Dataset Id + type: string + batch_size: + title: Batch Size + type: integer + shuffle: + title: Shuffle + type: boolean + data_format: + $ref: '#/components/schemas/DatasetFormat' + validation_dataset_id: + anyOf: + - type: string + - type: 'null' + default: + title: Validation Dataset Id + packed: + anyOf: + - type: boolean + - type: 'null' + default: false + title: Packed + train_on_input: + anyOf: + - type: boolean + - type: 'null' + default: false + title: Train On Input + required: + - dataset_id + - batch_size + - shuffle + - data_format + title: DataConfig + type: object + DatasetFormat: + description: Format of the training dataset. + enum: + - instruct + - dialog + title: DatasetFormat + type: string + EfficiencyConfig: + description: Configuration for memory and compute efficiency optimizations. + properties: + enable_activation_checkpointing: + anyOf: + - type: boolean + - type: 'null' + default: false + title: Enable Activation Checkpointing + enable_activation_offloading: + anyOf: + - type: boolean + - type: 'null' + default: false + title: Enable Activation Offloading + memory_efficient_fsdp_wrap: + anyOf: + - type: boolean + - type: 'null' + default: false + title: Memory Efficient Fsdp Wrap + fsdp_cpu_offload: + anyOf: + - type: boolean + - type: 'null' + default: false + title: Fsdp Cpu Offload + title: EfficiencyConfig + type: object + OptimizerConfig: + description: Configuration parameters for the optimization algorithm. + properties: + optimizer_type: + $ref: '#/components/schemas/OptimizerType' + lr: + title: Lr + type: number + weight_decay: + title: Weight Decay + type: number + num_warmup_steps: + title: Num Warmup Steps + type: integer + required: + - optimizer_type + - lr + - weight_decay + - num_warmup_steps + title: OptimizerConfig + type: object + OptimizerType: + description: Available optimizer algorithms for training. + enum: + - adam + - adamw + - sgd + title: OptimizerType + type: string + RLHFAlgorithm: + description: Available reinforcement learning from human feedback algorithms. + enum: + - dpo + title: RLHFAlgorithm + type: string + TrainingConfig: + description: Comprehensive configuration for the training process. + properties: + n_epochs: + title: N Epochs + type: integer + max_steps_per_epoch: + default: 1 + title: Max Steps Per Epoch + type: integer + gradient_accumulation_steps: + default: 1 + title: Gradient Accumulation Steps + type: integer + max_validation_steps: + anyOf: + - type: integer + - type: 'null' + default: 1 + title: Max Validation Steps + data_config: + anyOf: + - $ref: '#/components/schemas/DataConfig' + - type: 'null' + default: + optimizer_config: + anyOf: + - $ref: '#/components/schemas/OptimizerConfig' + - type: 'null' + default: + efficiency_config: + anyOf: + - $ref: '#/components/schemas/EfficiencyConfig' + - type: 'null' + default: + dtype: + anyOf: + - type: string + - type: 'null' + default: bf16 + title: Dtype + required: + - n_epochs + title: TrainingConfig + type: object + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + description: Request to finetune a model using reinforcement learning from human feedback. + properties: + job_uuid: + title: Job Uuid + type: string + finetuned_model: + $ref: '#/components/schemas/URL' + dataset_id: + title: Dataset Id + type: string + validation_dataset_id: + title: Validation Dataset Id + type: string + algorithm: + $ref: '#/components/schemas/RLHFAlgorithm' + algorithm_config: + $ref: '#/components/schemas/DPOAlignmentConfig' + optimizer_config: + $ref: '#/components/schemas/OptimizerConfig' + training_config: + $ref: '#/components/schemas/TrainingConfig' + hyperparam_search_config: + additionalProperties: true + title: Hyperparam Search Config + type: object + logger_config: + additionalProperties: true + title: Logger Config + type: object + required: + - job_uuid + - finetuned_model + - dataset_id + - validation_dataset_id + - algorithm + - algorithm_config + - optimizer_config + - training_config + - hyperparam_search_config + - logger_config + title: PostTrainingRLHFRequest + type: object + ToolGroupInput: + $defs: + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + description: Input data for registering a tool group. + properties: + toolgroup_id: + description: Unique identifier for the tool group + title: Toolgroup Id + type: string + provider_id: + description: ID of the provider that will handle this tool group + title: Provider Id + type: string + args: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + description: Additional arguments to pass to the provider + title: Args + mcp_endpoint: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + description: Model Context Protocol endpoint for remote tools + required: + - toolgroup_id + - provider_id + title: ToolGroupInput + type: object + Chunk: + $defs: + ChunkMetadata: + description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." + properties: + chunk_id: + anyOf: + - type: string + - type: 'null' + default: + title: Chunk Id + document_id: + anyOf: + - type: string + - type: 'null' + default: + title: Document Id + source: + anyOf: + - type: string + - type: 'null' + default: + title: Source + created_timestamp: + anyOf: + - type: integer + - type: 'null' + default: + title: Created Timestamp + updated_timestamp: + anyOf: + - type: integer + - type: 'null' + default: + title: Updated Timestamp + chunk_window: + anyOf: + - type: string + - type: 'null' + default: + title: Chunk Window + chunk_tokenizer: + anyOf: + - type: string + - type: 'null' + default: + title: Chunk Tokenizer + chunk_embedding_model: + anyOf: + - type: string + - type: 'null' + default: + title: Chunk Embedding Model + chunk_embedding_dimension: + anyOf: + - type: integer + - type: 'null' + default: + title: Chunk Embedding Dimension + content_token_count: + anyOf: + - type: integer + - type: 'null' + default: + title: Content Token Count + metadata_token_count: + anyOf: + - type: integer + - type: 'null' + default: + title: Metadata Token Count + title: ChunkMetadata + type: object + ImageContentItem: + description: A image content item. + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + TextContentItem: + description: A text content item. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextContentItem + type: object + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + _URLOrData: + description: A URL or a base64 encoded string. + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + default: + title: Data + title: _URLOrData + type: object + description: A chunk of content that can be inserted into a vector database. + properties: + content: + anyOf: + - type: string + - discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + - items: + discriminator: + mapping: + image: '#/$defs/ImageContentItem' + text: '#/$defs/TextContentItem' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/TextContentItem' + type: array + title: Content + chunk_id: + title: Chunk Id + type: string + metadata: + additionalProperties: true + title: Metadata + type: object + embedding: + anyOf: + - items: + type: number + type: array + - type: 'null' + default: + title: Embedding + chunk_metadata: + anyOf: + - $ref: '#/components/schemas/ChunkMetadata' + - type: 'null' + default: + required: + - content + - chunk_id + title: Chunk + type: object + VectorStoreCreateRequest: + description: Request to create a vector store. + properties: + name: + anyOf: + - type: string + - type: 'null' + default: + title: Name + file_ids: + items: + type: string + title: File Ids + type: array + expires_after: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + title: Expires After + chunking_strategy: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + title: Chunking Strategy + metadata: + additionalProperties: true + title: Metadata + type: object + title: VectorStoreCreateRequest + type: object + VectorStoreSearchRequest: + description: Request to search a vector store. + properties: + query: + anyOf: + - type: string + - items: + type: string + type: array + title: Query + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + title: Filters + max_num_results: + default: 10 + title: Max Num Results + type: integer + ranking_options: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + title: Ranking Options + rewrite_query: + default: false + title: Rewrite Query + type: boolean + required: + - query + title: VectorStoreSearchRequest + type: object + OpenAIResponseContentPartOutputText: + $defs: + OpenAIResponseAnnotationCitation: + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + properties: + type: + const: url_citation + default: url_citation + description: Annotation type identifier, always "url_citation" + title: Type + type: string + end_index: + description: End position of the citation span in the content + title: End Index + type: integer + start_index: + description: Start position of the citation span in the content + title: Start Index + type: integer + title: + description: Title of the referenced web resource + title: Title + type: string + url: + description: URL of the referenced web resource + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + properties: + type: + const: file_citation + default: file_citation + description: Annotation type identifier, always "file_citation" + title: Type + type: string + file_id: + description: Unique identifier of the referenced file + title: File Id + type: string + filename: + description: Name of the referenced file + title: Filename + type: string + index: + description: Position index of the citation within the content + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + description: "Text content within a streamed response part.\n\n:param type: Content part type identifier, always \"output_text\"\n:param text: Text emitted for this content part\n:param annotations: Structured annotations associated with the text\n:param logprobs: (Optional) Token log probability details" + properties: + type: + const: output_text + default: output_text + description: Content part type identifier, always "output_text" + title: Type + type: string + text: + description: Text emitted for this content part + title: Text + type: string + annotations: + description: Structured annotations associated with the text + items: + discriminator: + mapping: + container_file_citation: '#/$defs/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/$defs/OpenAIResponseAnnotationFileCitation' + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + logprobs: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + default: + description: Token log probability details + title: Logprobs + required: + - text + title: OpenAIResponseContentPartOutputText + type: object + OpenAIResponseContentPartReasoningSummary: + description: "Reasoning summary part in a streamed response.\n\n:param type: Content part type identifier, always \"summary_text\"\n:param text: Summary text" + properties: + type: + const: summary_text + default: summary_text + description: Content part type identifier, always "summary_text" + title: Type + type: string + text: + description: Summary text + title: Text + type: string + required: + - text + title: OpenAIResponseContentPartReasoningSummary + type: object + OpenAIResponseContentPartReasoningText: + description: "Reasoning text emitted as part of a streamed response.\n\n:param type: Content part type identifier, always \"reasoning_text\"\n:param text: Reasoning text supplied by the model" + properties: + type: + const: reasoning_text + default: reasoning_text + description: Content part type identifier, always "reasoning_text" + title: Type + type: string + text: + description: Reasoning text supplied by the model + title: Text + type: string + required: + - text + title: OpenAIResponseContentPartReasoningText + type: object + OpenAIResponseMessage: + $defs: + OpenAIResponseAnnotationCitation: + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + properties: + type: + const: url_citation + default: url_citation + description: Annotation type identifier, always "url_citation" + title: Type + type: string + end_index: + description: End position of the citation span in the content + title: End Index + type: integer + start_index: + description: Start position of the citation span in the content + title: Start Index + type: integer + title: + description: Title of the referenced web resource + title: Title + type: string + url: + description: URL of the referenced web resource + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + properties: + type: + const: file_citation + default: file_citation + description: Annotation type identifier, always "file_citation" + title: Type + type: string + file_id: + description: Unique identifier of the referenced file + title: File Id + type: string + filename: + description: Name of the referenced file + title: Filename + type: string + index: + description: Position index of the citation within the content + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + properties: + type: + const: refusal + default: refusal + description: Content part type identifier, always "refusal" + title: Type + type: string + refusal: + description: Refusal text supplied by the model + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + OpenAIResponseInputMessageContentFile: + description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + properties: + type: + const: input_file + default: input_file + description: The type of the input item. Always `input_file`. + title: Type + type: string + file_data: + anyOf: + - type: string + - type: 'null' + default: + description: The data of the file to be sent to the model. + title: File Data + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + file_url: + anyOf: + - type: string + - type: 'null' + default: + description: The URL of the file to be sent to the model. + title: File Url + filename: + anyOf: + - type: string + - type: 'null' + default: + description: The name of the file to be sent to the model. + title: Filename + title: OpenAIResponseInputMessageContentFile + type: object + OpenAIResponseInputMessageContentImage: + description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + description: Level of detail for image processing, can be "low", "high", or "auto" + title: Detail + type: + const: input_image + default: input_image + description: Content type identifier, always "input_image" + title: Type + type: string + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + image_url: + anyOf: + - type: string + - type: 'null' + default: + description: URL of the image content + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: + description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + properties: + text: + description: The text content of the input message + title: Text + type: string + type: + const: input_text + default: input_text + description: Content type identifier, always "input_text" + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseOutputMessageContentOutputText: + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: '#/$defs/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/$defs/OpenAIResponseAnnotationFileCitation' + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: OpenAIResponseOutputMessageContentOutputText + type: object + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: array + - items: + discriminator: + mapping: + output_text: '#/$defs/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + OpenAIResponseObjectStreamResponseCompleted: + $defs: + AllowedToolsFilter: + description: "Filter configuration for restricting which MCP tools can be used.\n\n:param tool_names: (Optional) List of specific tool names that are allowed" + properties: + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + default: + description: List of specific tool names that are allowed + title: Tool Names + title: AllowedToolsFilter + type: object + MCPListToolsTool: + description: "Tool definition returned by MCP list tools operation.\n\n:param input_schema: JSON schema defining the tool's input parameters\n:param name: Name of the tool\n:param description: (Optional) Description of what the tool does" + properties: + input_schema: + additionalProperties: true + description: JSON schema defining the tool's input parameters + title: Input Schema + type: object + name: + description: Name of the tool + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + default: + description: Description of what the tool does + title: Description + required: + - input_schema + - name + title: MCPListToolsTool + type: object + OpenAIResponseAnnotationCitation: + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + properties: + type: + const: url_citation + default: url_citation + description: Annotation type identifier, always "url_citation" + title: Type + type: string + end_index: + description: End position of the citation span in the content + title: End Index + type: integer + start_index: + description: Start position of the citation span in the content + title: Start Index + type: integer + title: + description: Title of the referenced web resource + title: Title + type: string + url: + description: URL of the referenced web resource + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + properties: + type: + const: file_citation + default: file_citation + description: Annotation type identifier, always "file_citation" + title: Type + type: string + file_id: + description: Unique identifier of the referenced file + title: File Id + type: string + filename: + description: Name of the referenced file + title: Filename + type: string + index: + description: Position index of the citation within the content + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + properties: + type: + const: refusal + default: refusal + description: Content part type identifier, always "refusal" + title: Type + type: string + refusal: + description: Refusal text supplied by the model + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + OpenAIResponseError: + description: "Error details for failed OpenAI response requests.\n\n:param code: Error code identifying the type of failure\n:param message: Human-readable error message describing the failure" + properties: + code: + description: Error code identifying the type of failure + title: Code + type: string + message: + description: Human-readable error message describing the failure + title: Message + type: string + required: + - code + - message + title: OpenAIResponseError + type: object + OpenAIResponseInputMessageContentFile: + description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + properties: + type: + const: input_file + default: input_file + description: The type of the input item. Always `input_file`. + title: Type + type: string + file_data: + anyOf: + - type: string + - type: 'null' + default: + description: The data of the file to be sent to the model. + title: File Data + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + file_url: + anyOf: + - type: string + - type: 'null' + default: + description: The URL of the file to be sent to the model. + title: File Url + filename: + anyOf: + - type: string + - type: 'null' + default: + description: The name of the file to be sent to the model. + title: Filename + title: OpenAIResponseInputMessageContentFile + type: object + OpenAIResponseInputMessageContentImage: + description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + description: Level of detail for image processing, can be "low", "high", or "auto" + title: Detail + type: + const: input_image + default: input_image + description: Content type identifier, always "input_image" + title: Type + type: string + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + image_url: + anyOf: + - type: string + - type: 'null' + default: + description: URL of the image content + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: + description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + properties: + text: + description: The text content of the input message + title: Text + type: string + type: + const: input_text + default: input_text + description: Content type identifier, always "input_text" + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseInputToolFileSearch: + description: "File search tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"file_search\"\n:param vector_store_ids: List of vector store identifiers to search within\n:param filters: (Optional) Additional filters to apply to the search\n:param max_num_results: (Optional) Maximum number of search results to return (1-50)\n:param ranking_options: (Optional) Options for ranking and scoring search results" + properties: + type: + const: file_search + default: file_search + description: Tool type identifier, always "file_search" + title: Type + type: string + vector_store_ids: + description: List of vector store identifiers to search within + items: + type: string + title: Vector Store Ids + type: array + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + description: Additional filters to apply to the search + title: Filters + max_num_results: + anyOf: + - maximum: 50 + minimum: 1 + type: integer + - type: 'null' + default: 10 + description: Maximum number of search results to return (1-50) + title: Max Num Results + ranking_options: + anyOf: + - $ref: '#/components/schemas/SearchRankingOptions' + - type: 'null' + default: + description: Options for ranking and scoring search results + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + type: object + OpenAIResponseInputToolFunction: + description: "Function tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"function\"\n:param name: Name of the function that can be called\n:param description: (Optional) Description of what the function does\n:param parameters: (Optional) JSON schema defining the function's parameters\n:param strict: (Optional) Whether to enforce strict parameter validation" + properties: + type: + const: function + default: function + description: Tool type identifier, always "function" + title: Type + type: string + name: + description: Name of the function that can be called + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + default: + description: Description of what the function does + title: Description + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + description: JSON schema defining the function's parameters + title: Parameters + strict: + anyOf: + - type: boolean + - type: 'null' + default: + description: Whether to enforce strict parameter validation + title: Strict + required: + - name + title: OpenAIResponseInputToolFunction + type: object + OpenAIResponseInputToolWebSearch: + description: "Web search tool configuration for OpenAI response inputs.\n\n:param type: Web search tool type variant to use\n:param search_context_size: (Optional) Size of search context, must be \"low\", \"medium\", or \"high\"" + properties: + type: + anyOf: + - const: web_search + type: string + - const: web_search_preview + type: string + - const: web_search_preview_2025_03_11 + type: string + default: web_search + description: Web search tool type variant to use + title: Type + search_context_size: + anyOf: + - pattern: ^low|medium|high$ + type: string + - type: 'null' + default: medium + description: Size of search context, must be "low", "medium", or "high" + title: Search Context Size + title: OpenAIResponseInputToolWebSearch + type: object + OpenAIResponseMCPApprovalRequest: + description: A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments + type: string + id: + title: Id + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMessage: + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: array + - items: + discriminator: + mapping: + output_text: '#/$defs/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + OpenAIResponseObject: + description: "Complete OpenAI response object containing generation results and metadata.\n\n:param created_at: Unix timestamp when the response was created\n:param error: (Optional) Error details if the response generation failed\n:param id: Unique identifier for this response\n:param model: Model identifier used for generation\n:param object: Object type identifier, always \"response\"\n:param output: List of generated output items (messages, tool calls, etc.)\n:param parallel_tool_calls: Whether tool calls can be executed in parallel\n:param previous_response_id: (Optional) ID of the previous response in a conversation\n:param prompt: (Optional) Reference to a prompt template and its variables.\n:param status: Current status of the response generation\n:param temperature: (Optional) Sampling temperature used for generation\n:param text: Text formatting configuration for the response\n:param top_p: (Optional) Nucleus sampling parameter used for generation\n:param tools: (Optional) An array of tools the model may call while generating a response.\n:param truncation: (Optional) Truncation strategy applied to the response\n:param usage: (Optional) Token usage information for the response\n:param instructions: (Optional) System message inserted into the model's context" + properties: + created_at: + description: Unix timestamp when the response was created + title: Created At + type: integer + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + default: + description: Error details if the response generation failed + id: + description: Unique identifier for this response + title: Id + type: string + model: + description: Model identifier used for generation + title: Model + type: string + object: + const: response + default: response + description: Object type identifier, always "response" + title: Object + type: string + output: + description: List of generated output items (messages, tool calls, etc.) + items: + discriminator: + mapping: + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + title: Output + type: array + parallel_tool_calls: + default: false + description: Whether tool calls can be executed in parallel + title: Parallel Tool Calls + type: boolean + previous_response_id: + anyOf: + - type: string + - type: 'null' + default: + description: ID of the previous response in a conversation + title: Previous Response Id + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + default: + description: Reference to a prompt template and its variables. + status: + description: Current status of the response generation + title: Status + type: string + temperature: + anyOf: + - type: number + - type: 'null' + default: + description: Sampling temperature used for generation + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + description: Text formatting configuration for the response + top_p: + anyOf: + - type: number + - type: 'null' + default: + description: Nucleus sampling parameter used for generation + title: Top P + tools: + anyOf: + - items: + discriminator: + mapping: + file_search: '#/$defs/OpenAIResponseInputToolFileSearch' + function: '#/$defs/OpenAIResponseInputToolFunction' + mcp: '#/$defs/OpenAIResponseToolMCP' + web_search: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + type: array + - type: 'null' + default: + description: An array of tools the model may call while generating a response. + title: Tools + truncation: + anyOf: + - type: string + - type: 'null' + default: + description: Truncation strategy applied to the response + title: Truncation + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + default: + description: Token usage information for the response + instructions: + anyOf: + - type: string + - type: 'null' + default: + description: System message inserted into the model's context + title: Instructions + required: + - created_at + - id + - model + - output + - status + title: OpenAIResponseObject + type: object + OpenAIResponseOutputMessageContentOutputText: + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: '#/$defs/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/$defs/OpenAIResponseAnnotationFileCitation' + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: OpenAIResponseOutputMessageContentOutputText + type: object + OpenAIResponseOutputMessageFileSearchToolCall: + description: "File search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param queries: List of search queries executed\n:param status: Current status of the file search operation\n:param type: Tool call type identifier, always \"file_search_call\"\n:param results: (Optional) Search results returned by the file search operation" + properties: + id: + description: Unique identifier for this tool call + title: Id + type: string + queries: + description: List of search queries executed + items: + type: string + title: Queries + type: array + status: + description: Current status of the file search operation + title: Status + type: string + type: + const: file_search_call + default: file_search_call + description: Tool call type identifier, always "file_search_call" + title: Type + type: string + results: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' + type: array + - type: 'null' + default: + description: Search results returned by the file search operation + title: Results + required: + - id + - queries + - status + title: OpenAIResponseOutputMessageFileSearchToolCall + type: object + OpenAIResponseOutputMessageFileSearchToolCallResults: + description: "Search results returned by the file search operation.\n\n:param attributes: (Optional) Key-value attributes associated with the file\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result (between 0 and 1)\n:param text: Text content of the search result" + properties: + attributes: + additionalProperties: true + description: Key-value attributes associated with the file + title: Attributes + type: object + file_id: + description: Unique identifier of the file containing the result + title: File Id + type: string + filename: + description: Name of the file containing the result + title: Filename + type: string + score: + description: Relevance score for this search result (between 0 and 1) + title: Score + type: number + text: + description: Text content of the search result + title: Text + type: string + required: + - attributes + - file_id + - filename + - score + - text + title: OpenAIResponseOutputMessageFileSearchToolCallResults + type: object + OpenAIResponseOutputMessageFunctionToolCall: + description: "Function tool call output message for OpenAI responses.\n\n:param call_id: Unique identifier for the function call\n:param name: Name of the function being called\n:param arguments: JSON string containing the function arguments\n:param type: Tool call type identifier, always \"function_call\"\n:param id: (Optional) Additional identifier for the tool call\n:param status: (Optional) Current status of the function call execution" + properties: + call_id: + description: Unique identifier for the function call + title: Call Id + type: string + name: + description: Name of the function being called + title: Name + type: string + arguments: + description: JSON string containing the function arguments + title: Arguments + type: string + type: + const: function_call + default: function_call + description: Tool call type identifier, always "function_call" + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + description: Additional identifier for the tool call + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + description: Current status of the function call execution + title: Status + required: + - call_id + - name + - arguments + title: OpenAIResponseOutputMessageFunctionToolCall + type: object + OpenAIResponseOutputMessageMCPCall: + description: "Model Context Protocol (MCP) call output message for OpenAI responses.\n\n:param id: Unique identifier for this MCP call\n:param type: Tool call type identifier, always \"mcp_call\"\n:param arguments: JSON string containing the MCP call arguments\n:param name: Name of the MCP method being called\n:param server_label: Label identifying the MCP server handling the call\n:param error: (Optional) Error message if the MCP call failed\n:param output: (Optional) Output result from the successful MCP call" + properties: + id: + description: Unique identifier for this MCP call + title: Id + type: string + type: + const: mcp_call + default: mcp_call + description: Tool call type identifier, always "mcp_call" + title: Type + type: string + arguments: + description: JSON string containing the MCP call arguments + title: Arguments + type: string + name: + description: Name of the MCP method being called + title: Name + type: string + server_label: + description: Label identifying the MCP server handling the call + title: Server Label + type: string + error: + anyOf: + - type: string + - type: 'null' + default: + description: Error message if the MCP call failed + title: Error + output: + anyOf: + - type: string + - type: 'null' + default: + description: Output result from the successful MCP call + title: Output + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + type: object + OpenAIResponseOutputMessageMCPListTools: + description: "MCP list tools output message containing available tools from an MCP server.\n\n:param id: Unique identifier for this MCP list tools operation\n:param type: Tool call type identifier, always \"mcp_list_tools\"\n:param server_label: Label identifying the MCP server providing the tools\n:param tools: List of available tools provided by the MCP server" + properties: + id: + description: Unique identifier for this MCP list tools operation + title: Id + type: string + type: + const: mcp_list_tools + default: mcp_list_tools + description: Tool call type identifier, always "mcp_list_tools" + title: Type + type: string + server_label: + description: Label identifying the MCP server providing the tools + title: Server Label + type: string + tools: + description: List of available tools provided by the MCP server + items: + $ref: '#/components/schemas/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + type: object + OpenAIResponseOutputMessageWebSearchToolCall: + description: "Web search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param status: Current status of the web search operation\n:param type: Tool call type identifier, always \"web_search_call\"" + properties: + id: + description: Unique identifier for this tool call + title: Id + type: string + status: + description: Current status of the web search operation + title: Status + type: string + type: + const: web_search_call + default: web_search_call + description: Tool call type identifier, always "web_search_call" + title: Type + type: string + required: + - id + - status + title: OpenAIResponseOutputMessageWebSearchToolCall + type: object + OpenAIResponsePrompt: + description: "OpenAI compatible Prompt object that is used in OpenAI responses.\n\n:param id: Unique identifier of the prompt template\n:param variables: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types\nlike images or files.\n:param version: Version number of the prompt to use (defaults to latest if not specified)" + properties: + id: + description: Unique identifier of the prompt template + title: Id + type: string + variables: + anyOf: + - additionalProperties: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: object + - type: 'null' + default: + description: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files. + title: Variables + version: + anyOf: + - type: string + - type: 'null' + default: + description: Version number of the prompt to use (defaults to latest if not specified) + title: Version + required: + - id + title: OpenAIResponsePrompt + type: object + OpenAIResponseText: + description: "Text response configuration for OpenAI responses.\n\n:param format: (Optional) Text format configuration specifying output format requirements" + properties: + format: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseTextFormat' + - type: 'null' + default: + description: Text format configuration specifying output format requirements + title: OpenAIResponseText + type: object + OpenAIResponseTextFormat: + description: "Configuration for Responses API text format.\n\n:param type: Must be \"text\", \"json_schema\", or \"json_object\" to identify the format type\n:param name: The name of the response format. Only used for json_schema.\n:param schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model. Only used for json_schema.\n:param description: (Optional) A description of the response format. Only used for json_schema.\n:param strict: (Optional) Whether to strictly enforce the JSON schema. If true, the response must match the schema exactly. Only used for json_schema." + properties: + type: + anyOf: + - const: text + type: string + - const: json_schema + type: string + - const: json_object + type: string + title: Type + name: + anyOf: + - type: string + - type: 'null' + title: Name + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + title: OpenAIResponseTextFormat + type: object + OpenAIResponseToolMCP: + description: "Model Context Protocol (MCP) tool configuration for OpenAI response object.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + properties: + type: + const: mcp + default: mcp + description: Tool type identifier, always "mcp" + title: Type + type: string + server_label: + description: Label to identify this MCP server + title: Server Label + type: string + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + default: + description: Restriction on which tools can be used from this server + title: Allowed Tools + required: + - server_label + title: OpenAIResponseToolMCP + type: object + OpenAIResponseUsage: + description: "Usage information for OpenAI response.\n\n:param input_tokens: Number of tokens in the input\n:param output_tokens: Number of tokens in the output\n:param total_tokens: Total tokens used (input + output)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + properties: + input_tokens: + description: Number of tokens in the input + title: Input Tokens + type: integer + output_tokens: + description: Number of tokens in the output + title: Output Tokens + type: integer + total_tokens: + description: Total tokens used (input + output) + title: Total Tokens + type: integer + input_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' + - type: 'null' + default: + description: Detailed breakdown of input token usage + output_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + - type: 'null' + default: + description: Detailed breakdown of output token usage + required: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + type: object + OpenAIResponseUsageInputTokensDetails: + description: "Token details for input tokens in OpenAI response usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + default: + description: Number of tokens retrieved from cache + title: Cached Tokens + title: OpenAIResponseUsageInputTokensDetails + type: object + OpenAIResponseUsageOutputTokensDetails: + description: "Token details for output tokens in OpenAI response usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + default: + description: Number of tokens used for reasoning (o1/o3 models) + title: Reasoning Tokens + title: OpenAIResponseUsageOutputTokensDetails + type: object + SearchRankingOptions: + description: Options for ranking and filtering search results. + properties: + ranker: + anyOf: + - type: string + - type: 'null' + default: + title: Ranker + score_threshold: + anyOf: + - type: number + - type: 'null' + default: 0.0 + title: Score Threshold + title: SearchRankingOptions + type: object + description: "Streaming event indicating a response has been completed.\n\n:param response: Completed response object\n:param type: Event type identifier, always \"response.completed\"" + properties: + response: + $ref: '#/components/schemas/OpenAIResponseObject' + description: Completed response object + type: + const: response.completed + default: response.completed + description: Event type identifier, always "response.completed" + title: Type + type: string + required: + - response + title: OpenAIResponseObjectStreamResponseCompleted + type: object + OpenAIResponseObjectStreamResponseContentPartAdded: + $defs: + OpenAIResponseAnnotationCitation: + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + properties: + type: + const: url_citation + default: url_citation + description: Annotation type identifier, always "url_citation" + title: Type + type: string + end_index: + description: End position of the citation span in the content + title: End Index + type: integer + start_index: + description: Start position of the citation span in the content + title: Start Index + type: integer + title: + description: Title of the referenced web resource + title: Title + type: string + url: + description: URL of the referenced web resource + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + properties: + type: + const: file_citation + default: file_citation + description: Annotation type identifier, always "file_citation" + title: Type + type: string + file_id: + description: Unique identifier of the referenced file + title: File Id + type: string + filename: + description: Name of the referenced file + title: Filename + type: string + index: + description: Position index of the citation within the content + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartOutputText: + description: "Text content within a streamed response part.\n\n:param type: Content part type identifier, always \"output_text\"\n:param text: Text emitted for this content part\n:param annotations: Structured annotations associated with the text\n:param logprobs: (Optional) Token log probability details" + properties: + type: + const: output_text + default: output_text + description: Content part type identifier, always "output_text" + title: Type + type: string + text: + description: Text emitted for this content part + title: Text + type: string + annotations: + description: Structured annotations associated with the text + items: + discriminator: + mapping: + container_file_citation: '#/$defs/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/$defs/OpenAIResponseAnnotationFileCitation' + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + logprobs: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + default: + description: Token log probability details + title: Logprobs + required: + - text + title: OpenAIResponseContentPartOutputText + type: object + OpenAIResponseContentPartReasoningText: + description: "Reasoning text emitted as part of a streamed response.\n\n:param type: Content part type identifier, always \"reasoning_text\"\n:param text: Reasoning text supplied by the model" + properties: + type: + const: reasoning_text + default: reasoning_text + description: Content part type identifier, always "reasoning_text" + title: Type + type: string + text: + description: Reasoning text supplied by the model + title: Text + type: string + required: + - text + title: OpenAIResponseContentPartReasoningText + type: object + OpenAIResponseContentPartRefusal: + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + properties: + type: + const: refusal + default: refusal + description: Content part type identifier, always "refusal" + title: Type + type: string + refusal: + description: Refusal text supplied by the model + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + description: "Streaming event for when a new content part is added to a response item.\n\n:param content_index: Index position of the part within the content array\n:param response_id: Unique identifier of the response containing this content\n:param item_id: Unique identifier of the output item containing this content part\n:param output_index: Index position of the output item in the response\n:param part: The content part that was added\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.content_part.added\"" + properties: + content_index: + description: Index position of the part within the content array + title: Content Index + type: integer + response_id: + description: Unique identifier of the response containing this content + title: Response Id + type: string + item_id: + description: Unique identifier of the output item containing this content part + title: Item Id + type: string + output_index: + description: Index position of the output item in the response + title: Output Index + type: integer + part: + description: The content part that was added + discriminator: + mapping: + output_text: '#/$defs/OpenAIResponseContentPartOutputText' + reasoning_text: '#/$defs/OpenAIResponseContentPartReasoningText' + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseContentPartOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + - $ref: '#/components/schemas/OpenAIResponseContentPartReasoningText' + title: Part + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.content_part.added + default: response.content_part.added + description: Event type identifier, always "response.content_part.added" + title: Type + type: string + required: + - content_index + - response_id + - item_id + - output_index + - part + - sequence_number + title: OpenAIResponseObjectStreamResponseContentPartAdded + type: object + OpenAIResponseObjectStreamResponseContentPartDone: + $defs: + OpenAIResponseAnnotationCitation: + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + properties: + type: + const: url_citation + default: url_citation + description: Annotation type identifier, always "url_citation" + title: Type + type: string + end_index: + description: End position of the citation span in the content + title: End Index + type: integer + start_index: + description: Start position of the citation span in the content + title: Start Index + type: integer + title: + description: Title of the referenced web resource + title: Title + type: string + url: + description: URL of the referenced web resource + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + properties: + type: + const: file_citation + default: file_citation + description: Annotation type identifier, always "file_citation" + title: Type + type: string + file_id: + description: Unique identifier of the referenced file + title: File Id + type: string + filename: + description: Name of the referenced file + title: Filename + type: string + index: + description: Position index of the citation within the content + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartOutputText: + description: "Text content within a streamed response part.\n\n:param type: Content part type identifier, always \"output_text\"\n:param text: Text emitted for this content part\n:param annotations: Structured annotations associated with the text\n:param logprobs: (Optional) Token log probability details" + properties: + type: + const: output_text + default: output_text + description: Content part type identifier, always "output_text" + title: Type + type: string + text: + description: Text emitted for this content part + title: Text + type: string + annotations: + description: Structured annotations associated with the text + items: + discriminator: + mapping: + container_file_citation: '#/$defs/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/$defs/OpenAIResponseAnnotationFileCitation' + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + logprobs: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + default: + description: Token log probability details + title: Logprobs + required: + - text + title: OpenAIResponseContentPartOutputText + type: object + OpenAIResponseContentPartReasoningText: + description: "Reasoning text emitted as part of a streamed response.\n\n:param type: Content part type identifier, always \"reasoning_text\"\n:param text: Reasoning text supplied by the model" + properties: + type: + const: reasoning_text + default: reasoning_text + description: Content part type identifier, always "reasoning_text" + title: Type + type: string + text: + description: Reasoning text supplied by the model + title: Text + type: string + required: + - text + title: OpenAIResponseContentPartReasoningText + type: object + OpenAIResponseContentPartRefusal: + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + properties: + type: + const: refusal + default: refusal + description: Content part type identifier, always "refusal" + title: Type + type: string + refusal: + description: Refusal text supplied by the model + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + description: "Streaming event for when a content part is completed.\n\n:param content_index: Index position of the part within the content array\n:param response_id: Unique identifier of the response containing this content\n:param item_id: Unique identifier of the output item containing this content part\n:param output_index: Index position of the output item in the response\n:param part: The completed content part\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.content_part.done\"" + properties: + content_index: + description: Index position of the part within the content array + title: Content Index + type: integer + response_id: + description: Unique identifier of the response containing this content + title: Response Id + type: string + item_id: + description: Unique identifier of the output item containing this content part + title: Item Id + type: string + output_index: + description: Index position of the output item in the response + title: Output Index + type: integer + part: + description: The completed content part + discriminator: + mapping: + output_text: '#/$defs/OpenAIResponseContentPartOutputText' + reasoning_text: '#/$defs/OpenAIResponseContentPartReasoningText' + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseContentPartOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + - $ref: '#/components/schemas/OpenAIResponseContentPartReasoningText' + title: Part + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.content_part.done + default: response.content_part.done + description: Event type identifier, always "response.content_part.done" + title: Type + type: string + required: + - content_index + - response_id + - item_id + - output_index + - part + - sequence_number + title: OpenAIResponseObjectStreamResponseContentPartDone + type: object + OpenAIResponseObjectStreamResponseCreated: + $defs: + AllowedToolsFilter: + description: "Filter configuration for restricting which MCP tools can be used.\n\n:param tool_names: (Optional) List of specific tool names that are allowed" + properties: + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + default: + description: List of specific tool names that are allowed + title: Tool Names + title: AllowedToolsFilter + type: object + MCPListToolsTool: + description: "Tool definition returned by MCP list tools operation.\n\n:param input_schema: JSON schema defining the tool's input parameters\n:param name: Name of the tool\n:param description: (Optional) Description of what the tool does" + properties: + input_schema: + additionalProperties: true + description: JSON schema defining the tool's input parameters + title: Input Schema + type: object + name: + description: Name of the tool + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + default: + description: Description of what the tool does + title: Description + required: + - input_schema + - name + title: MCPListToolsTool + type: object + OpenAIResponseAnnotationCitation: + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + properties: + type: + const: url_citation + default: url_citation + description: Annotation type identifier, always "url_citation" + title: Type + type: string + end_index: + description: End position of the citation span in the content + title: End Index + type: integer + start_index: + description: Start position of the citation span in the content + title: Start Index + type: integer + title: + description: Title of the referenced web resource + title: Title + type: string + url: + description: URL of the referenced web resource + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + properties: + type: + const: file_citation + default: file_citation + description: Annotation type identifier, always "file_citation" + title: Type + type: string + file_id: + description: Unique identifier of the referenced file + title: File Id + type: string + filename: + description: Name of the referenced file + title: Filename + type: string + index: + description: Position index of the citation within the content + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + properties: + type: + const: refusal + default: refusal + description: Content part type identifier, always "refusal" + title: Type + type: string + refusal: + description: Refusal text supplied by the model + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + OpenAIResponseError: + description: "Error details for failed OpenAI response requests.\n\n:param code: Error code identifying the type of failure\n:param message: Human-readable error message describing the failure" + properties: + code: + description: Error code identifying the type of failure + title: Code + type: string + message: + description: Human-readable error message describing the failure + title: Message + type: string + required: + - code + - message + title: OpenAIResponseError + type: object + OpenAIResponseInputMessageContentFile: + description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + properties: + type: + const: input_file + default: input_file + description: The type of the input item. Always `input_file`. + title: Type + type: string + file_data: + anyOf: + - type: string + - type: 'null' + default: + description: The data of the file to be sent to the model. + title: File Data + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + file_url: + anyOf: + - type: string + - type: 'null' + default: + description: The URL of the file to be sent to the model. + title: File Url + filename: + anyOf: + - type: string + - type: 'null' + default: + description: The name of the file to be sent to the model. + title: Filename + title: OpenAIResponseInputMessageContentFile + type: object + OpenAIResponseInputMessageContentImage: + description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + description: Level of detail for image processing, can be "low", "high", or "auto" + title: Detail + type: + const: input_image + default: input_image + description: Content type identifier, always "input_image" + title: Type + type: string + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + image_url: + anyOf: + - type: string + - type: 'null' + default: + description: URL of the image content + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: + description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + properties: + text: + description: The text content of the input message + title: Text + type: string + type: + const: input_text + default: input_text + description: Content type identifier, always "input_text" + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseInputToolFileSearch: + description: "File search tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"file_search\"\n:param vector_store_ids: List of vector store identifiers to search within\n:param filters: (Optional) Additional filters to apply to the search\n:param max_num_results: (Optional) Maximum number of search results to return (1-50)\n:param ranking_options: (Optional) Options for ranking and scoring search results" + properties: + type: + const: file_search + default: file_search + description: Tool type identifier, always "file_search" + title: Type + type: string + vector_store_ids: + description: List of vector store identifiers to search within + items: + type: string + title: Vector Store Ids + type: array + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + description: Additional filters to apply to the search + title: Filters + max_num_results: + anyOf: + - maximum: 50 + minimum: 1 + type: integer + - type: 'null' + default: 10 + description: Maximum number of search results to return (1-50) + title: Max Num Results + ranking_options: + anyOf: + - $ref: '#/components/schemas/SearchRankingOptions' + - type: 'null' + default: + description: Options for ranking and scoring search results + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + type: object + OpenAIResponseInputToolFunction: + description: "Function tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"function\"\n:param name: Name of the function that can be called\n:param description: (Optional) Description of what the function does\n:param parameters: (Optional) JSON schema defining the function's parameters\n:param strict: (Optional) Whether to enforce strict parameter validation" + properties: + type: + const: function + default: function + description: Tool type identifier, always "function" + title: Type + type: string + name: + description: Name of the function that can be called + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + default: + description: Description of what the function does + title: Description + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + description: JSON schema defining the function's parameters + title: Parameters + strict: + anyOf: + - type: boolean + - type: 'null' + default: + description: Whether to enforce strict parameter validation + title: Strict + required: + - name + title: OpenAIResponseInputToolFunction + type: object + OpenAIResponseInputToolWebSearch: + description: "Web search tool configuration for OpenAI response inputs.\n\n:param type: Web search tool type variant to use\n:param search_context_size: (Optional) Size of search context, must be \"low\", \"medium\", or \"high\"" + properties: + type: + anyOf: + - const: web_search + type: string + - const: web_search_preview + type: string + - const: web_search_preview_2025_03_11 + type: string + default: web_search + description: Web search tool type variant to use + title: Type + search_context_size: + anyOf: + - pattern: ^low|medium|high$ + type: string + - type: 'null' + default: medium + description: Size of search context, must be "low", "medium", or "high" + title: Search Context Size + title: OpenAIResponseInputToolWebSearch + type: object + OpenAIResponseMCPApprovalRequest: + description: A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments + type: string + id: + title: Id + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMessage: + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: array + - items: + discriminator: + mapping: + output_text: '#/$defs/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + OpenAIResponseObject: + description: "Complete OpenAI response object containing generation results and metadata.\n\n:param created_at: Unix timestamp when the response was created\n:param error: (Optional) Error details if the response generation failed\n:param id: Unique identifier for this response\n:param model: Model identifier used for generation\n:param object: Object type identifier, always \"response\"\n:param output: List of generated output items (messages, tool calls, etc.)\n:param parallel_tool_calls: Whether tool calls can be executed in parallel\n:param previous_response_id: (Optional) ID of the previous response in a conversation\n:param prompt: (Optional) Reference to a prompt template and its variables.\n:param status: Current status of the response generation\n:param temperature: (Optional) Sampling temperature used for generation\n:param text: Text formatting configuration for the response\n:param top_p: (Optional) Nucleus sampling parameter used for generation\n:param tools: (Optional) An array of tools the model may call while generating a response.\n:param truncation: (Optional) Truncation strategy applied to the response\n:param usage: (Optional) Token usage information for the response\n:param instructions: (Optional) System message inserted into the model's context" + properties: + created_at: + description: Unix timestamp when the response was created + title: Created At + type: integer + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + default: + description: Error details if the response generation failed + id: + description: Unique identifier for this response + title: Id + type: string + model: + description: Model identifier used for generation + title: Model + type: string + object: + const: response + default: response + description: Object type identifier, always "response" + title: Object + type: string + output: + description: List of generated output items (messages, tool calls, etc.) + items: + discriminator: + mapping: + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + title: Output + type: array + parallel_tool_calls: + default: false + description: Whether tool calls can be executed in parallel + title: Parallel Tool Calls + type: boolean + previous_response_id: + anyOf: + - type: string + - type: 'null' + default: + description: ID of the previous response in a conversation + title: Previous Response Id + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + default: + description: Reference to a prompt template and its variables. + status: + description: Current status of the response generation + title: Status + type: string + temperature: + anyOf: + - type: number + - type: 'null' + default: + description: Sampling temperature used for generation + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + description: Text formatting configuration for the response + top_p: + anyOf: + - type: number + - type: 'null' + default: + description: Nucleus sampling parameter used for generation + title: Top P + tools: + anyOf: + - items: + discriminator: + mapping: + file_search: '#/$defs/OpenAIResponseInputToolFileSearch' + function: '#/$defs/OpenAIResponseInputToolFunction' + mcp: '#/$defs/OpenAIResponseToolMCP' + web_search: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + type: array + - type: 'null' + default: + description: An array of tools the model may call while generating a response. + title: Tools + truncation: + anyOf: + - type: string + - type: 'null' + default: + description: Truncation strategy applied to the response + title: Truncation + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + default: + description: Token usage information for the response + instructions: + anyOf: + - type: string + - type: 'null' + default: + description: System message inserted into the model's context + title: Instructions + required: + - created_at + - id + - model + - output + - status + title: OpenAIResponseObject + type: object + OpenAIResponseOutputMessageContentOutputText: + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: '#/$defs/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/$defs/OpenAIResponseAnnotationFileCitation' + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: OpenAIResponseOutputMessageContentOutputText + type: object + OpenAIResponseOutputMessageFileSearchToolCall: + description: "File search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param queries: List of search queries executed\n:param status: Current status of the file search operation\n:param type: Tool call type identifier, always \"file_search_call\"\n:param results: (Optional) Search results returned by the file search operation" + properties: + id: + description: Unique identifier for this tool call + title: Id + type: string + queries: + description: List of search queries executed + items: + type: string + title: Queries + type: array + status: + description: Current status of the file search operation + title: Status + type: string + type: + const: file_search_call + default: file_search_call + description: Tool call type identifier, always "file_search_call" + title: Type + type: string + results: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' + type: array + - type: 'null' + default: + description: Search results returned by the file search operation + title: Results + required: + - id + - queries + - status + title: OpenAIResponseOutputMessageFileSearchToolCall + type: object + OpenAIResponseOutputMessageFileSearchToolCallResults: + description: "Search results returned by the file search operation.\n\n:param attributes: (Optional) Key-value attributes associated with the file\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result (between 0 and 1)\n:param text: Text content of the search result" + properties: + attributes: + additionalProperties: true + description: Key-value attributes associated with the file + title: Attributes + type: object + file_id: + description: Unique identifier of the file containing the result + title: File Id + type: string + filename: + description: Name of the file containing the result + title: Filename + type: string + score: + description: Relevance score for this search result (between 0 and 1) + title: Score + type: number + text: + description: Text content of the search result + title: Text + type: string + required: + - attributes + - file_id + - filename + - score + - text + title: OpenAIResponseOutputMessageFileSearchToolCallResults + type: object + OpenAIResponseOutputMessageFunctionToolCall: + description: "Function tool call output message for OpenAI responses.\n\n:param call_id: Unique identifier for the function call\n:param name: Name of the function being called\n:param arguments: JSON string containing the function arguments\n:param type: Tool call type identifier, always \"function_call\"\n:param id: (Optional) Additional identifier for the tool call\n:param status: (Optional) Current status of the function call execution" + properties: + call_id: + description: Unique identifier for the function call + title: Call Id + type: string + name: + description: Name of the function being called + title: Name + type: string + arguments: + description: JSON string containing the function arguments + title: Arguments + type: string + type: + const: function_call + default: function_call + description: Tool call type identifier, always "function_call" + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + description: Additional identifier for the tool call + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + description: Current status of the function call execution + title: Status + required: + - call_id + - name + - arguments + title: OpenAIResponseOutputMessageFunctionToolCall + type: object + OpenAIResponseOutputMessageMCPCall: + description: "Model Context Protocol (MCP) call output message for OpenAI responses.\n\n:param id: Unique identifier for this MCP call\n:param type: Tool call type identifier, always \"mcp_call\"\n:param arguments: JSON string containing the MCP call arguments\n:param name: Name of the MCP method being called\n:param server_label: Label identifying the MCP server handling the call\n:param error: (Optional) Error message if the MCP call failed\n:param output: (Optional) Output result from the successful MCP call" + properties: + id: + description: Unique identifier for this MCP call + title: Id + type: string + type: + const: mcp_call + default: mcp_call + description: Tool call type identifier, always "mcp_call" + title: Type + type: string + arguments: + description: JSON string containing the MCP call arguments + title: Arguments + type: string + name: + description: Name of the MCP method being called + title: Name + type: string + server_label: + description: Label identifying the MCP server handling the call + title: Server Label + type: string + error: + anyOf: + - type: string + - type: 'null' + default: + description: Error message if the MCP call failed + title: Error + output: + anyOf: + - type: string + - type: 'null' + default: + description: Output result from the successful MCP call + title: Output + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + type: object + OpenAIResponseOutputMessageMCPListTools: + description: "MCP list tools output message containing available tools from an MCP server.\n\n:param id: Unique identifier for this MCP list tools operation\n:param type: Tool call type identifier, always \"mcp_list_tools\"\n:param server_label: Label identifying the MCP server providing the tools\n:param tools: List of available tools provided by the MCP server" + properties: + id: + description: Unique identifier for this MCP list tools operation + title: Id + type: string + type: + const: mcp_list_tools + default: mcp_list_tools + description: Tool call type identifier, always "mcp_list_tools" + title: Type + type: string + server_label: + description: Label identifying the MCP server providing the tools + title: Server Label + type: string + tools: + description: List of available tools provided by the MCP server + items: + $ref: '#/components/schemas/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + type: object + OpenAIResponseOutputMessageWebSearchToolCall: + description: "Web search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param status: Current status of the web search operation\n:param type: Tool call type identifier, always \"web_search_call\"" + properties: + id: + description: Unique identifier for this tool call + title: Id + type: string + status: + description: Current status of the web search operation + title: Status + type: string + type: + const: web_search_call + default: web_search_call + description: Tool call type identifier, always "web_search_call" + title: Type + type: string + required: + - id + - status + title: OpenAIResponseOutputMessageWebSearchToolCall + type: object + OpenAIResponsePrompt: + description: "OpenAI compatible Prompt object that is used in OpenAI responses.\n\n:param id: Unique identifier of the prompt template\n:param variables: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types\nlike images or files.\n:param version: Version number of the prompt to use (defaults to latest if not specified)" + properties: + id: + description: Unique identifier of the prompt template + title: Id + type: string + variables: + anyOf: + - additionalProperties: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: object + - type: 'null' + default: + description: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files. + title: Variables + version: + anyOf: + - type: string + - type: 'null' + default: + description: Version number of the prompt to use (defaults to latest if not specified) + title: Version + required: + - id + title: OpenAIResponsePrompt + type: object + OpenAIResponseText: + description: "Text response configuration for OpenAI responses.\n\n:param format: (Optional) Text format configuration specifying output format requirements" + properties: + format: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseTextFormat' + - type: 'null' + default: + description: Text format configuration specifying output format requirements + title: OpenAIResponseText + type: object + OpenAIResponseTextFormat: + description: "Configuration for Responses API text format.\n\n:param type: Must be \"text\", \"json_schema\", or \"json_object\" to identify the format type\n:param name: The name of the response format. Only used for json_schema.\n:param schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model. Only used for json_schema.\n:param description: (Optional) A description of the response format. Only used for json_schema.\n:param strict: (Optional) Whether to strictly enforce the JSON schema. If true, the response must match the schema exactly. Only used for json_schema." + properties: + type: + anyOf: + - const: text + type: string + - const: json_schema + type: string + - const: json_object + type: string + title: Type + name: + anyOf: + - type: string + - type: 'null' + title: Name + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + title: OpenAIResponseTextFormat + type: object + OpenAIResponseToolMCP: + description: "Model Context Protocol (MCP) tool configuration for OpenAI response object.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + properties: + type: + const: mcp + default: mcp + description: Tool type identifier, always "mcp" + title: Type + type: string + server_label: + description: Label to identify this MCP server + title: Server Label + type: string + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + default: + description: Restriction on which tools can be used from this server + title: Allowed Tools + required: + - server_label + title: OpenAIResponseToolMCP + type: object + OpenAIResponseUsage: + description: "Usage information for OpenAI response.\n\n:param input_tokens: Number of tokens in the input\n:param output_tokens: Number of tokens in the output\n:param total_tokens: Total tokens used (input + output)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + properties: + input_tokens: + description: Number of tokens in the input + title: Input Tokens + type: integer + output_tokens: + description: Number of tokens in the output + title: Output Tokens + type: integer + total_tokens: + description: Total tokens used (input + output) + title: Total Tokens + type: integer + input_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' + - type: 'null' + default: + description: Detailed breakdown of input token usage + output_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + - type: 'null' + default: + description: Detailed breakdown of output token usage + required: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + type: object + OpenAIResponseUsageInputTokensDetails: + description: "Token details for input tokens in OpenAI response usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + default: + description: Number of tokens retrieved from cache + title: Cached Tokens + title: OpenAIResponseUsageInputTokensDetails + type: object + OpenAIResponseUsageOutputTokensDetails: + description: "Token details for output tokens in OpenAI response usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + default: + description: Number of tokens used for reasoning (o1/o3 models) + title: Reasoning Tokens + title: OpenAIResponseUsageOutputTokensDetails + type: object + SearchRankingOptions: + description: Options for ranking and filtering search results. + properties: + ranker: + anyOf: + - type: string + - type: 'null' + default: + title: Ranker + score_threshold: + anyOf: + - type: number + - type: 'null' + default: 0.0 + title: Score Threshold + title: SearchRankingOptions + type: object + description: "Streaming event indicating a new response has been created.\n\n:param response: The response object that was created\n:param type: Event type identifier, always \"response.created\"" + properties: + response: + $ref: '#/components/schemas/OpenAIResponseObject' + description: The response object that was created + type: + const: response.created + default: response.created + description: Event type identifier, always "response.created" + title: Type + type: string + required: + - response + title: OpenAIResponseObjectStreamResponseCreated + type: object + OpenAIResponseObjectStreamResponseFailed: + $defs: + AllowedToolsFilter: + description: "Filter configuration for restricting which MCP tools can be used.\n\n:param tool_names: (Optional) List of specific tool names that are allowed" + properties: + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + default: + description: List of specific tool names that are allowed + title: Tool Names + title: AllowedToolsFilter + type: object + MCPListToolsTool: + description: "Tool definition returned by MCP list tools operation.\n\n:param input_schema: JSON schema defining the tool's input parameters\n:param name: Name of the tool\n:param description: (Optional) Description of what the tool does" + properties: + input_schema: + additionalProperties: true + description: JSON schema defining the tool's input parameters + title: Input Schema + type: object + name: + description: Name of the tool + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + default: + description: Description of what the tool does + title: Description + required: + - input_schema + - name + title: MCPListToolsTool + type: object + OpenAIResponseAnnotationCitation: + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + properties: + type: + const: url_citation + default: url_citation + description: Annotation type identifier, always "url_citation" + title: Type + type: string + end_index: + description: End position of the citation span in the content + title: End Index + type: integer + start_index: + description: Start position of the citation span in the content + title: Start Index + type: integer + title: + description: Title of the referenced web resource + title: Title + type: string + url: + description: URL of the referenced web resource + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + properties: + type: + const: file_citation + default: file_citation + description: Annotation type identifier, always "file_citation" + title: Type + type: string + file_id: + description: Unique identifier of the referenced file + title: File Id + type: string + filename: + description: Name of the referenced file + title: Filename + type: string + index: + description: Position index of the citation within the content + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + properties: + type: + const: refusal + default: refusal + description: Content part type identifier, always "refusal" + title: Type + type: string + refusal: + description: Refusal text supplied by the model + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + OpenAIResponseError: + description: "Error details for failed OpenAI response requests.\n\n:param code: Error code identifying the type of failure\n:param message: Human-readable error message describing the failure" + properties: + code: + description: Error code identifying the type of failure + title: Code + type: string + message: + description: Human-readable error message describing the failure + title: Message + type: string + required: + - code + - message + title: OpenAIResponseError + type: object + OpenAIResponseInputMessageContentFile: + description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + properties: + type: + const: input_file + default: input_file + description: The type of the input item. Always `input_file`. + title: Type + type: string + file_data: + anyOf: + - type: string + - type: 'null' + default: + description: The data of the file to be sent to the model. + title: File Data + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + file_url: + anyOf: + - type: string + - type: 'null' + default: + description: The URL of the file to be sent to the model. + title: File Url + filename: + anyOf: + - type: string + - type: 'null' + default: + description: The name of the file to be sent to the model. + title: Filename + title: OpenAIResponseInputMessageContentFile + type: object + OpenAIResponseInputMessageContentImage: + description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + description: Level of detail for image processing, can be "low", "high", or "auto" + title: Detail + type: + const: input_image + default: input_image + description: Content type identifier, always "input_image" + title: Type + type: string + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + image_url: + anyOf: + - type: string + - type: 'null' + default: + description: URL of the image content + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: + description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + properties: + text: + description: The text content of the input message + title: Text + type: string + type: + const: input_text + default: input_text + description: Content type identifier, always "input_text" + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseInputToolFileSearch: + description: "File search tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"file_search\"\n:param vector_store_ids: List of vector store identifiers to search within\n:param filters: (Optional) Additional filters to apply to the search\n:param max_num_results: (Optional) Maximum number of search results to return (1-50)\n:param ranking_options: (Optional) Options for ranking and scoring search results" + properties: + type: + const: file_search + default: file_search + description: Tool type identifier, always "file_search" + title: Type + type: string + vector_store_ids: + description: List of vector store identifiers to search within + items: + type: string + title: Vector Store Ids + type: array + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + description: Additional filters to apply to the search + title: Filters + max_num_results: + anyOf: + - maximum: 50 + minimum: 1 + type: integer + - type: 'null' + default: 10 + description: Maximum number of search results to return (1-50) + title: Max Num Results + ranking_options: + anyOf: + - $ref: '#/components/schemas/SearchRankingOptions' + - type: 'null' + default: + description: Options for ranking and scoring search results + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + type: object + OpenAIResponseInputToolFunction: + description: "Function tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"function\"\n:param name: Name of the function that can be called\n:param description: (Optional) Description of what the function does\n:param parameters: (Optional) JSON schema defining the function's parameters\n:param strict: (Optional) Whether to enforce strict parameter validation" + properties: + type: + const: function + default: function + description: Tool type identifier, always "function" + title: Type + type: string + name: + description: Name of the function that can be called + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + default: + description: Description of what the function does + title: Description + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + description: JSON schema defining the function's parameters + title: Parameters + strict: + anyOf: + - type: boolean + - type: 'null' + default: + description: Whether to enforce strict parameter validation + title: Strict + required: + - name + title: OpenAIResponseInputToolFunction + type: object + OpenAIResponseInputToolWebSearch: + description: "Web search tool configuration for OpenAI response inputs.\n\n:param type: Web search tool type variant to use\n:param search_context_size: (Optional) Size of search context, must be \"low\", \"medium\", or \"high\"" + properties: + type: + anyOf: + - const: web_search + type: string + - const: web_search_preview + type: string + - const: web_search_preview_2025_03_11 + type: string + default: web_search + description: Web search tool type variant to use + title: Type + search_context_size: + anyOf: + - pattern: ^low|medium|high$ + type: string + - type: 'null' + default: medium + description: Size of search context, must be "low", "medium", or "high" + title: Search Context Size + title: OpenAIResponseInputToolWebSearch + type: object + OpenAIResponseMCPApprovalRequest: + description: A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments + type: string + id: + title: Id + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMessage: + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: array + - items: + discriminator: + mapping: + output_text: '#/$defs/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + OpenAIResponseObject: + description: "Complete OpenAI response object containing generation results and metadata.\n\n:param created_at: Unix timestamp when the response was created\n:param error: (Optional) Error details if the response generation failed\n:param id: Unique identifier for this response\n:param model: Model identifier used for generation\n:param object: Object type identifier, always \"response\"\n:param output: List of generated output items (messages, tool calls, etc.)\n:param parallel_tool_calls: Whether tool calls can be executed in parallel\n:param previous_response_id: (Optional) ID of the previous response in a conversation\n:param prompt: (Optional) Reference to a prompt template and its variables.\n:param status: Current status of the response generation\n:param temperature: (Optional) Sampling temperature used for generation\n:param text: Text formatting configuration for the response\n:param top_p: (Optional) Nucleus sampling parameter used for generation\n:param tools: (Optional) An array of tools the model may call while generating a response.\n:param truncation: (Optional) Truncation strategy applied to the response\n:param usage: (Optional) Token usage information for the response\n:param instructions: (Optional) System message inserted into the model's context" + properties: + created_at: + description: Unix timestamp when the response was created + title: Created At + type: integer + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + default: + description: Error details if the response generation failed + id: + description: Unique identifier for this response + title: Id + type: string + model: + description: Model identifier used for generation + title: Model + type: string + object: + const: response + default: response + description: Object type identifier, always "response" + title: Object + type: string + output: + description: List of generated output items (messages, tool calls, etc.) + items: + discriminator: + mapping: + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + title: Output + type: array + parallel_tool_calls: + default: false + description: Whether tool calls can be executed in parallel + title: Parallel Tool Calls + type: boolean + previous_response_id: + anyOf: + - type: string + - type: 'null' + default: + description: ID of the previous response in a conversation + title: Previous Response Id + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + default: + description: Reference to a prompt template and its variables. + status: + description: Current status of the response generation + title: Status + type: string + temperature: + anyOf: + - type: number + - type: 'null' + default: + description: Sampling temperature used for generation + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + description: Text formatting configuration for the response + top_p: + anyOf: + - type: number + - type: 'null' + default: + description: Nucleus sampling parameter used for generation + title: Top P + tools: + anyOf: + - items: + discriminator: + mapping: + file_search: '#/$defs/OpenAIResponseInputToolFileSearch' + function: '#/$defs/OpenAIResponseInputToolFunction' + mcp: '#/$defs/OpenAIResponseToolMCP' + web_search: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + type: array + - type: 'null' + default: + description: An array of tools the model may call while generating a response. + title: Tools + truncation: + anyOf: + - type: string + - type: 'null' + default: + description: Truncation strategy applied to the response + title: Truncation + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + default: + description: Token usage information for the response + instructions: + anyOf: + - type: string + - type: 'null' + default: + description: System message inserted into the model's context + title: Instructions + required: + - created_at + - id + - model + - output + - status + title: OpenAIResponseObject + type: object + OpenAIResponseOutputMessageContentOutputText: + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: '#/$defs/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/$defs/OpenAIResponseAnnotationFileCitation' + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: OpenAIResponseOutputMessageContentOutputText + type: object + OpenAIResponseOutputMessageFileSearchToolCall: + description: "File search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param queries: List of search queries executed\n:param status: Current status of the file search operation\n:param type: Tool call type identifier, always \"file_search_call\"\n:param results: (Optional) Search results returned by the file search operation" + properties: + id: + description: Unique identifier for this tool call + title: Id + type: string + queries: + description: List of search queries executed + items: + type: string + title: Queries + type: array + status: + description: Current status of the file search operation + title: Status + type: string + type: + const: file_search_call + default: file_search_call + description: Tool call type identifier, always "file_search_call" + title: Type + type: string + results: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' + type: array + - type: 'null' + default: + description: Search results returned by the file search operation + title: Results + required: + - id + - queries + - status + title: OpenAIResponseOutputMessageFileSearchToolCall + type: object + OpenAIResponseOutputMessageFileSearchToolCallResults: + description: "Search results returned by the file search operation.\n\n:param attributes: (Optional) Key-value attributes associated with the file\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result (between 0 and 1)\n:param text: Text content of the search result" + properties: + attributes: + additionalProperties: true + description: Key-value attributes associated with the file + title: Attributes + type: object + file_id: + description: Unique identifier of the file containing the result + title: File Id + type: string + filename: + description: Name of the file containing the result + title: Filename + type: string + score: + description: Relevance score for this search result (between 0 and 1) + title: Score + type: number + text: + description: Text content of the search result + title: Text + type: string + required: + - attributes + - file_id + - filename + - score + - text + title: OpenAIResponseOutputMessageFileSearchToolCallResults + type: object + OpenAIResponseOutputMessageFunctionToolCall: + description: "Function tool call output message for OpenAI responses.\n\n:param call_id: Unique identifier for the function call\n:param name: Name of the function being called\n:param arguments: JSON string containing the function arguments\n:param type: Tool call type identifier, always \"function_call\"\n:param id: (Optional) Additional identifier for the tool call\n:param status: (Optional) Current status of the function call execution" + properties: + call_id: + description: Unique identifier for the function call + title: Call Id + type: string + name: + description: Name of the function being called + title: Name + type: string + arguments: + description: JSON string containing the function arguments + title: Arguments + type: string + type: + const: function_call + default: function_call + description: Tool call type identifier, always "function_call" + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + description: Additional identifier for the tool call + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + description: Current status of the function call execution + title: Status + required: + - call_id + - name + - arguments + title: OpenAIResponseOutputMessageFunctionToolCall + type: object + OpenAIResponseOutputMessageMCPCall: + description: "Model Context Protocol (MCP) call output message for OpenAI responses.\n\n:param id: Unique identifier for this MCP call\n:param type: Tool call type identifier, always \"mcp_call\"\n:param arguments: JSON string containing the MCP call arguments\n:param name: Name of the MCP method being called\n:param server_label: Label identifying the MCP server handling the call\n:param error: (Optional) Error message if the MCP call failed\n:param output: (Optional) Output result from the successful MCP call" + properties: + id: + description: Unique identifier for this MCP call + title: Id + type: string + type: + const: mcp_call + default: mcp_call + description: Tool call type identifier, always "mcp_call" + title: Type + type: string + arguments: + description: JSON string containing the MCP call arguments + title: Arguments + type: string + name: + description: Name of the MCP method being called + title: Name + type: string + server_label: + description: Label identifying the MCP server handling the call + title: Server Label + type: string + error: + anyOf: + - type: string + - type: 'null' + default: + description: Error message if the MCP call failed + title: Error + output: + anyOf: + - type: string + - type: 'null' + default: + description: Output result from the successful MCP call + title: Output + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + type: object + OpenAIResponseOutputMessageMCPListTools: + description: "MCP list tools output message containing available tools from an MCP server.\n\n:param id: Unique identifier for this MCP list tools operation\n:param type: Tool call type identifier, always \"mcp_list_tools\"\n:param server_label: Label identifying the MCP server providing the tools\n:param tools: List of available tools provided by the MCP server" + properties: + id: + description: Unique identifier for this MCP list tools operation + title: Id + type: string + type: + const: mcp_list_tools + default: mcp_list_tools + description: Tool call type identifier, always "mcp_list_tools" + title: Type + type: string + server_label: + description: Label identifying the MCP server providing the tools + title: Server Label + type: string + tools: + description: List of available tools provided by the MCP server + items: + $ref: '#/components/schemas/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + type: object + OpenAIResponseOutputMessageWebSearchToolCall: + description: "Web search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param status: Current status of the web search operation\n:param type: Tool call type identifier, always \"web_search_call\"" + properties: + id: + description: Unique identifier for this tool call + title: Id + type: string + status: + description: Current status of the web search operation + title: Status + type: string + type: + const: web_search_call + default: web_search_call + description: Tool call type identifier, always "web_search_call" + title: Type + type: string + required: + - id + - status + title: OpenAIResponseOutputMessageWebSearchToolCall + type: object + OpenAIResponsePrompt: + description: "OpenAI compatible Prompt object that is used in OpenAI responses.\n\n:param id: Unique identifier of the prompt template\n:param variables: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types\nlike images or files.\n:param version: Version number of the prompt to use (defaults to latest if not specified)" + properties: + id: + description: Unique identifier of the prompt template + title: Id + type: string + variables: + anyOf: + - additionalProperties: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: object + - type: 'null' + default: + description: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files. + title: Variables + version: + anyOf: + - type: string + - type: 'null' + default: + description: Version number of the prompt to use (defaults to latest if not specified) + title: Version + required: + - id + title: OpenAIResponsePrompt + type: object + OpenAIResponseText: + description: "Text response configuration for OpenAI responses.\n\n:param format: (Optional) Text format configuration specifying output format requirements" + properties: + format: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseTextFormat' + - type: 'null' + default: + description: Text format configuration specifying output format requirements + title: OpenAIResponseText + type: object + OpenAIResponseTextFormat: + description: "Configuration for Responses API text format.\n\n:param type: Must be \"text\", \"json_schema\", or \"json_object\" to identify the format type\n:param name: The name of the response format. Only used for json_schema.\n:param schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model. Only used for json_schema.\n:param description: (Optional) A description of the response format. Only used for json_schema.\n:param strict: (Optional) Whether to strictly enforce the JSON schema. If true, the response must match the schema exactly. Only used for json_schema." + properties: + type: + anyOf: + - const: text + type: string + - const: json_schema + type: string + - const: json_object + type: string + title: Type + name: + anyOf: + - type: string + - type: 'null' + title: Name + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + title: OpenAIResponseTextFormat + type: object + OpenAIResponseToolMCP: + description: "Model Context Protocol (MCP) tool configuration for OpenAI response object.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + properties: + type: + const: mcp + default: mcp + description: Tool type identifier, always "mcp" + title: Type + type: string + server_label: + description: Label to identify this MCP server + title: Server Label + type: string + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + default: + description: Restriction on which tools can be used from this server + title: Allowed Tools + required: + - server_label + title: OpenAIResponseToolMCP + type: object + OpenAIResponseUsage: + description: "Usage information for OpenAI response.\n\n:param input_tokens: Number of tokens in the input\n:param output_tokens: Number of tokens in the output\n:param total_tokens: Total tokens used (input + output)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + properties: + input_tokens: + description: Number of tokens in the input + title: Input Tokens + type: integer + output_tokens: + description: Number of tokens in the output + title: Output Tokens + type: integer + total_tokens: + description: Total tokens used (input + output) + title: Total Tokens + type: integer + input_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' + - type: 'null' + default: + description: Detailed breakdown of input token usage + output_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + - type: 'null' + default: + description: Detailed breakdown of output token usage + required: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + type: object + OpenAIResponseUsageInputTokensDetails: + description: "Token details for input tokens in OpenAI response usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + default: + description: Number of tokens retrieved from cache + title: Cached Tokens + title: OpenAIResponseUsageInputTokensDetails + type: object + OpenAIResponseUsageOutputTokensDetails: + description: "Token details for output tokens in OpenAI response usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + default: + description: Number of tokens used for reasoning (o1/o3 models) + title: Reasoning Tokens + title: OpenAIResponseUsageOutputTokensDetails + type: object + SearchRankingOptions: + description: Options for ranking and filtering search results. + properties: + ranker: + anyOf: + - type: string + - type: 'null' + default: + title: Ranker + score_threshold: + anyOf: + - type: number + - type: 'null' + default: 0.0 + title: Score Threshold + title: SearchRankingOptions + type: object + description: "Streaming event emitted when a response fails.\n\n:param response: Response object describing the failure\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.failed\"" + properties: + response: + $ref: '#/components/schemas/OpenAIResponseObject' + description: Response object describing the failure + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.failed + default: response.failed + description: Event type identifier, always "response.failed" + title: Type + type: string + required: + - response + - sequence_number + title: OpenAIResponseObjectStreamResponseFailed + type: object + OpenAIResponseObjectStreamResponseFileSearchCallCompleted: + description: "Streaming event for completed file search calls.\n\n:param item_id: Unique identifier of the completed file search call\n:param output_index: Index position of the item in the output list\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.file_search_call.completed\"" + properties: + item_id: + description: Unique identifier of the completed file search call + title: Item Id + type: string + output_index: + description: Index position of the item in the output list + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.file_search_call.completed + default: response.file_search_call.completed + description: Event type identifier, always "response.file_search_call.completed" + title: Type + type: string + required: + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseFileSearchCallCompleted + type: object + OpenAIResponseObjectStreamResponseFileSearchCallInProgress: + description: "Streaming event for file search calls in progress.\n\n:param item_id: Unique identifier of the file search call\n:param output_index: Index position of the item in the output list\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.file_search_call.in_progress\"" + properties: + item_id: + description: Unique identifier of the file search call + title: Item Id + type: string + output_index: + description: Index position of the item in the output list + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.file_search_call.in_progress + default: response.file_search_call.in_progress + description: Event type identifier, always "response.file_search_call.in_progress" + title: Type + type: string + required: + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseFileSearchCallInProgress + type: object + OpenAIResponseObjectStreamResponseFileSearchCallSearching: + description: "Streaming event for file search currently searching.\n\n:param item_id: Unique identifier of the file search call\n:param output_index: Index position of the item in the output list\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.file_search_call.searching\"" + properties: + item_id: + description: Unique identifier of the file search call + title: Item Id + type: string + output_index: + description: Index position of the item in the output list + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.file_search_call.searching + default: response.file_search_call.searching + description: Event type identifier, always "response.file_search_call.searching" + title: Type + type: string + required: + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseFileSearchCallSearching + type: object + OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta: + description: "Streaming event for incremental function call argument updates.\n\n:param delta: Incremental function call arguments being added\n:param item_id: Unique identifier of the function call being updated\n:param output_index: Index position of the item in the output list\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.function_call_arguments.delta\"" + properties: + delta: + description: Incremental function call arguments being added + title: Delta + type: string + item_id: + description: Unique identifier of the function call being updated + title: Item Id + type: string + output_index: + description: Index position of the item in the output list + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.function_call_arguments.delta + default: response.function_call_arguments.delta + description: Event type identifier, always "response.function_call_arguments.delta" + title: Type + type: string + required: + - delta + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta + type: object + OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone: + description: "Streaming event for when function call arguments are completed.\n\n:param arguments: Final complete arguments JSON string for the function call\n:param item_id: Unique identifier of the completed function call\n:param output_index: Index position of the item in the output list\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.function_call_arguments.done\"" + properties: + arguments: + description: Final complete arguments JSON string for the function call + title: Arguments + type: string + item_id: + description: Unique identifier of the completed function call + title: Item Id + type: string + output_index: + description: Index position of the item in the output list + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.function_call_arguments.done + default: response.function_call_arguments.done + description: Event type identifier, always "response.function_call_arguments.done" + title: Type + type: string + required: + - arguments + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone + type: object + OpenAIResponseObjectStreamResponseInProgress: + $defs: + AllowedToolsFilter: + description: "Filter configuration for restricting which MCP tools can be used.\n\n:param tool_names: (Optional) List of specific tool names that are allowed" + properties: + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + default: + description: List of specific tool names that are allowed + title: Tool Names + title: AllowedToolsFilter + type: object + MCPListToolsTool: + description: "Tool definition returned by MCP list tools operation.\n\n:param input_schema: JSON schema defining the tool's input parameters\n:param name: Name of the tool\n:param description: (Optional) Description of what the tool does" + properties: + input_schema: + additionalProperties: true + description: JSON schema defining the tool's input parameters + title: Input Schema + type: object + name: + description: Name of the tool + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + default: + description: Description of what the tool does + title: Description + required: + - input_schema + - name + title: MCPListToolsTool + type: object + OpenAIResponseAnnotationCitation: + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + properties: + type: + const: url_citation + default: url_citation + description: Annotation type identifier, always "url_citation" + title: Type + type: string + end_index: + description: End position of the citation span in the content + title: End Index + type: integer + start_index: + description: Start position of the citation span in the content + title: Start Index + type: integer + title: + description: Title of the referenced web resource + title: Title + type: string + url: + description: URL of the referenced web resource + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + properties: + type: + const: file_citation + default: file_citation + description: Annotation type identifier, always "file_citation" + title: Type + type: string + file_id: + description: Unique identifier of the referenced file + title: File Id + type: string + filename: + description: Name of the referenced file + title: Filename + type: string + index: + description: Position index of the citation within the content + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + properties: + type: + const: refusal + default: refusal + description: Content part type identifier, always "refusal" + title: Type + type: string + refusal: + description: Refusal text supplied by the model + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + OpenAIResponseError: + description: "Error details for failed OpenAI response requests.\n\n:param code: Error code identifying the type of failure\n:param message: Human-readable error message describing the failure" + properties: + code: + description: Error code identifying the type of failure + title: Code + type: string + message: + description: Human-readable error message describing the failure + title: Message + type: string + required: + - code + - message + title: OpenAIResponseError + type: object + OpenAIResponseInputMessageContentFile: + description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + properties: + type: + const: input_file + default: input_file + description: The type of the input item. Always `input_file`. + title: Type + type: string + file_data: + anyOf: + - type: string + - type: 'null' + default: + description: The data of the file to be sent to the model. + title: File Data + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + file_url: + anyOf: + - type: string + - type: 'null' + default: + description: The URL of the file to be sent to the model. + title: File Url + filename: + anyOf: + - type: string + - type: 'null' + default: + description: The name of the file to be sent to the model. + title: Filename + title: OpenAIResponseInputMessageContentFile + type: object + OpenAIResponseInputMessageContentImage: + description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + description: Level of detail for image processing, can be "low", "high", or "auto" + title: Detail + type: + const: input_image + default: input_image + description: Content type identifier, always "input_image" + title: Type + type: string + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + image_url: + anyOf: + - type: string + - type: 'null' + default: + description: URL of the image content + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: + description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + properties: + text: + description: The text content of the input message + title: Text + type: string + type: + const: input_text + default: input_text + description: Content type identifier, always "input_text" + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseInputToolFileSearch: + description: "File search tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"file_search\"\n:param vector_store_ids: List of vector store identifiers to search within\n:param filters: (Optional) Additional filters to apply to the search\n:param max_num_results: (Optional) Maximum number of search results to return (1-50)\n:param ranking_options: (Optional) Options for ranking and scoring search results" + properties: + type: + const: file_search + default: file_search + description: Tool type identifier, always "file_search" + title: Type + type: string + vector_store_ids: + description: List of vector store identifiers to search within + items: + type: string + title: Vector Store Ids + type: array + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + description: Additional filters to apply to the search + title: Filters + max_num_results: + anyOf: + - maximum: 50 + minimum: 1 + type: integer + - type: 'null' + default: 10 + description: Maximum number of search results to return (1-50) + title: Max Num Results + ranking_options: + anyOf: + - $ref: '#/components/schemas/SearchRankingOptions' + - type: 'null' + default: + description: Options for ranking and scoring search results + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + type: object + OpenAIResponseInputToolFunction: + description: "Function tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"function\"\n:param name: Name of the function that can be called\n:param description: (Optional) Description of what the function does\n:param parameters: (Optional) JSON schema defining the function's parameters\n:param strict: (Optional) Whether to enforce strict parameter validation" + properties: + type: + const: function + default: function + description: Tool type identifier, always "function" + title: Type + type: string + name: + description: Name of the function that can be called + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + default: + description: Description of what the function does + title: Description + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + description: JSON schema defining the function's parameters + title: Parameters + strict: + anyOf: + - type: boolean + - type: 'null' + default: + description: Whether to enforce strict parameter validation + title: Strict + required: + - name + title: OpenAIResponseInputToolFunction + type: object + OpenAIResponseInputToolWebSearch: + description: "Web search tool configuration for OpenAI response inputs.\n\n:param type: Web search tool type variant to use\n:param search_context_size: (Optional) Size of search context, must be \"low\", \"medium\", or \"high\"" + properties: + type: + anyOf: + - const: web_search + type: string + - const: web_search_preview + type: string + - const: web_search_preview_2025_03_11 + type: string + default: web_search + description: Web search tool type variant to use + title: Type + search_context_size: + anyOf: + - pattern: ^low|medium|high$ + type: string + - type: 'null' + default: medium + description: Size of search context, must be "low", "medium", or "high" + title: Search Context Size + title: OpenAIResponseInputToolWebSearch + type: object + OpenAIResponseMCPApprovalRequest: + description: A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments + type: string + id: + title: Id + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMessage: + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: array + - items: + discriminator: + mapping: + output_text: '#/$defs/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + OpenAIResponseObject: + description: "Complete OpenAI response object containing generation results and metadata.\n\n:param created_at: Unix timestamp when the response was created\n:param error: (Optional) Error details if the response generation failed\n:param id: Unique identifier for this response\n:param model: Model identifier used for generation\n:param object: Object type identifier, always \"response\"\n:param output: List of generated output items (messages, tool calls, etc.)\n:param parallel_tool_calls: Whether tool calls can be executed in parallel\n:param previous_response_id: (Optional) ID of the previous response in a conversation\n:param prompt: (Optional) Reference to a prompt template and its variables.\n:param status: Current status of the response generation\n:param temperature: (Optional) Sampling temperature used for generation\n:param text: Text formatting configuration for the response\n:param top_p: (Optional) Nucleus sampling parameter used for generation\n:param tools: (Optional) An array of tools the model may call while generating a response.\n:param truncation: (Optional) Truncation strategy applied to the response\n:param usage: (Optional) Token usage information for the response\n:param instructions: (Optional) System message inserted into the model's context" + properties: + created_at: + description: Unix timestamp when the response was created + title: Created At + type: integer + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + default: + description: Error details if the response generation failed + id: + description: Unique identifier for this response + title: Id + type: string + model: + description: Model identifier used for generation + title: Model + type: string + object: + const: response + default: response + description: Object type identifier, always "response" + title: Object + type: string + output: + description: List of generated output items (messages, tool calls, etc.) + items: + discriminator: + mapping: + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + title: Output + type: array + parallel_tool_calls: + default: false + description: Whether tool calls can be executed in parallel + title: Parallel Tool Calls + type: boolean + previous_response_id: + anyOf: + - type: string + - type: 'null' + default: + description: ID of the previous response in a conversation + title: Previous Response Id + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + default: + description: Reference to a prompt template and its variables. + status: + description: Current status of the response generation + title: Status + type: string + temperature: + anyOf: + - type: number + - type: 'null' + default: + description: Sampling temperature used for generation + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + description: Text formatting configuration for the response + top_p: + anyOf: + - type: number + - type: 'null' + default: + description: Nucleus sampling parameter used for generation + title: Top P + tools: + anyOf: + - items: + discriminator: + mapping: + file_search: '#/$defs/OpenAIResponseInputToolFileSearch' + function: '#/$defs/OpenAIResponseInputToolFunction' + mcp: '#/$defs/OpenAIResponseToolMCP' + web_search: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + type: array + - type: 'null' + default: + description: An array of tools the model may call while generating a response. + title: Tools + truncation: + anyOf: + - type: string + - type: 'null' + default: + description: Truncation strategy applied to the response + title: Truncation + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + default: + description: Token usage information for the response + instructions: + anyOf: + - type: string + - type: 'null' + default: + description: System message inserted into the model's context + title: Instructions + required: + - created_at + - id + - model + - output + - status + title: OpenAIResponseObject + type: object + OpenAIResponseOutputMessageContentOutputText: + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: '#/$defs/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/$defs/OpenAIResponseAnnotationFileCitation' + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: OpenAIResponseOutputMessageContentOutputText + type: object + OpenAIResponseOutputMessageFileSearchToolCall: + description: "File search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param queries: List of search queries executed\n:param status: Current status of the file search operation\n:param type: Tool call type identifier, always \"file_search_call\"\n:param results: (Optional) Search results returned by the file search operation" + properties: + id: + description: Unique identifier for this tool call + title: Id + type: string + queries: + description: List of search queries executed + items: + type: string + title: Queries + type: array + status: + description: Current status of the file search operation + title: Status + type: string + type: + const: file_search_call + default: file_search_call + description: Tool call type identifier, always "file_search_call" + title: Type + type: string + results: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' + type: array + - type: 'null' + default: + description: Search results returned by the file search operation + title: Results + required: + - id + - queries + - status + title: OpenAIResponseOutputMessageFileSearchToolCall + type: object + OpenAIResponseOutputMessageFileSearchToolCallResults: + description: "Search results returned by the file search operation.\n\n:param attributes: (Optional) Key-value attributes associated with the file\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result (between 0 and 1)\n:param text: Text content of the search result" + properties: + attributes: + additionalProperties: true + description: Key-value attributes associated with the file + title: Attributes + type: object + file_id: + description: Unique identifier of the file containing the result + title: File Id + type: string + filename: + description: Name of the file containing the result + title: Filename + type: string + score: + description: Relevance score for this search result (between 0 and 1) + title: Score + type: number + text: + description: Text content of the search result + title: Text + type: string + required: + - attributes + - file_id + - filename + - score + - text + title: OpenAIResponseOutputMessageFileSearchToolCallResults + type: object + OpenAIResponseOutputMessageFunctionToolCall: + description: "Function tool call output message for OpenAI responses.\n\n:param call_id: Unique identifier for the function call\n:param name: Name of the function being called\n:param arguments: JSON string containing the function arguments\n:param type: Tool call type identifier, always \"function_call\"\n:param id: (Optional) Additional identifier for the tool call\n:param status: (Optional) Current status of the function call execution" + properties: + call_id: + description: Unique identifier for the function call + title: Call Id + type: string + name: + description: Name of the function being called + title: Name + type: string + arguments: + description: JSON string containing the function arguments + title: Arguments + type: string + type: + const: function_call + default: function_call + description: Tool call type identifier, always "function_call" + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + description: Additional identifier for the tool call + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + description: Current status of the function call execution + title: Status + required: + - call_id + - name + - arguments + title: OpenAIResponseOutputMessageFunctionToolCall + type: object + OpenAIResponseOutputMessageMCPCall: + description: "Model Context Protocol (MCP) call output message for OpenAI responses.\n\n:param id: Unique identifier for this MCP call\n:param type: Tool call type identifier, always \"mcp_call\"\n:param arguments: JSON string containing the MCP call arguments\n:param name: Name of the MCP method being called\n:param server_label: Label identifying the MCP server handling the call\n:param error: (Optional) Error message if the MCP call failed\n:param output: (Optional) Output result from the successful MCP call" + properties: + id: + description: Unique identifier for this MCP call + title: Id + type: string + type: + const: mcp_call + default: mcp_call + description: Tool call type identifier, always "mcp_call" + title: Type + type: string + arguments: + description: JSON string containing the MCP call arguments + title: Arguments + type: string + name: + description: Name of the MCP method being called + title: Name + type: string + server_label: + description: Label identifying the MCP server handling the call + title: Server Label + type: string + error: + anyOf: + - type: string + - type: 'null' + default: + description: Error message if the MCP call failed + title: Error + output: + anyOf: + - type: string + - type: 'null' + default: + description: Output result from the successful MCP call + title: Output + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + type: object + OpenAIResponseOutputMessageMCPListTools: + description: "MCP list tools output message containing available tools from an MCP server.\n\n:param id: Unique identifier for this MCP list tools operation\n:param type: Tool call type identifier, always \"mcp_list_tools\"\n:param server_label: Label identifying the MCP server providing the tools\n:param tools: List of available tools provided by the MCP server" + properties: + id: + description: Unique identifier for this MCP list tools operation + title: Id + type: string + type: + const: mcp_list_tools + default: mcp_list_tools + description: Tool call type identifier, always "mcp_list_tools" + title: Type + type: string + server_label: + description: Label identifying the MCP server providing the tools + title: Server Label + type: string + tools: + description: List of available tools provided by the MCP server + items: + $ref: '#/components/schemas/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + type: object + OpenAIResponseOutputMessageWebSearchToolCall: + description: "Web search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param status: Current status of the web search operation\n:param type: Tool call type identifier, always \"web_search_call\"" + properties: + id: + description: Unique identifier for this tool call + title: Id + type: string + status: + description: Current status of the web search operation + title: Status + type: string + type: + const: web_search_call + default: web_search_call + description: Tool call type identifier, always "web_search_call" + title: Type + type: string + required: + - id + - status + title: OpenAIResponseOutputMessageWebSearchToolCall + type: object + OpenAIResponsePrompt: + description: "OpenAI compatible Prompt object that is used in OpenAI responses.\n\n:param id: Unique identifier of the prompt template\n:param variables: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types\nlike images or files.\n:param version: Version number of the prompt to use (defaults to latest if not specified)" + properties: + id: + description: Unique identifier of the prompt template + title: Id + type: string + variables: + anyOf: + - additionalProperties: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: object + - type: 'null' + default: + description: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files. + title: Variables + version: + anyOf: + - type: string + - type: 'null' + default: + description: Version number of the prompt to use (defaults to latest if not specified) + title: Version + required: + - id + title: OpenAIResponsePrompt + type: object + OpenAIResponseText: + description: "Text response configuration for OpenAI responses.\n\n:param format: (Optional) Text format configuration specifying output format requirements" + properties: + format: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseTextFormat' + - type: 'null' + default: + description: Text format configuration specifying output format requirements + title: OpenAIResponseText + type: object + OpenAIResponseTextFormat: + description: "Configuration for Responses API text format.\n\n:param type: Must be \"text\", \"json_schema\", or \"json_object\" to identify the format type\n:param name: The name of the response format. Only used for json_schema.\n:param schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model. Only used for json_schema.\n:param description: (Optional) A description of the response format. Only used for json_schema.\n:param strict: (Optional) Whether to strictly enforce the JSON schema. If true, the response must match the schema exactly. Only used for json_schema." + properties: + type: + anyOf: + - const: text + type: string + - const: json_schema + type: string + - const: json_object + type: string + title: Type + name: + anyOf: + - type: string + - type: 'null' + title: Name + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + title: OpenAIResponseTextFormat + type: object + OpenAIResponseToolMCP: + description: "Model Context Protocol (MCP) tool configuration for OpenAI response object.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + properties: + type: + const: mcp + default: mcp + description: Tool type identifier, always "mcp" + title: Type + type: string + server_label: + description: Label to identify this MCP server + title: Server Label + type: string + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + default: + description: Restriction on which tools can be used from this server + title: Allowed Tools + required: + - server_label + title: OpenAIResponseToolMCP + type: object + OpenAIResponseUsage: + description: "Usage information for OpenAI response.\n\n:param input_tokens: Number of tokens in the input\n:param output_tokens: Number of tokens in the output\n:param total_tokens: Total tokens used (input + output)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + properties: + input_tokens: + description: Number of tokens in the input + title: Input Tokens + type: integer + output_tokens: + description: Number of tokens in the output + title: Output Tokens + type: integer + total_tokens: + description: Total tokens used (input + output) + title: Total Tokens + type: integer + input_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' + - type: 'null' + default: + description: Detailed breakdown of input token usage + output_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + - type: 'null' + default: + description: Detailed breakdown of output token usage + required: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + type: object + OpenAIResponseUsageInputTokensDetails: + description: "Token details for input tokens in OpenAI response usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + default: + description: Number of tokens retrieved from cache + title: Cached Tokens + title: OpenAIResponseUsageInputTokensDetails + type: object + OpenAIResponseUsageOutputTokensDetails: + description: "Token details for output tokens in OpenAI response usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + default: + description: Number of tokens used for reasoning (o1/o3 models) + title: Reasoning Tokens + title: OpenAIResponseUsageOutputTokensDetails + type: object + SearchRankingOptions: + description: Options for ranking and filtering search results. + properties: + ranker: + anyOf: + - type: string + - type: 'null' + default: + title: Ranker + score_threshold: + anyOf: + - type: number + - type: 'null' + default: 0.0 + title: Score Threshold + title: SearchRankingOptions + type: object + description: "Streaming event indicating the response remains in progress.\n\n:param response: Current response state while in progress\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.in_progress\"" + properties: + response: + $ref: '#/components/schemas/OpenAIResponseObject' + description: Current response state while in progress + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.in_progress + default: response.in_progress + description: Event type identifier, always "response.in_progress" + title: Type + type: string + required: + - response + - sequence_number + title: OpenAIResponseObjectStreamResponseInProgress + type: object + OpenAIResponseObjectStreamResponseIncomplete: + $defs: + AllowedToolsFilter: + description: "Filter configuration for restricting which MCP tools can be used.\n\n:param tool_names: (Optional) List of specific tool names that are allowed" + properties: + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + default: + description: List of specific tool names that are allowed + title: Tool Names + title: AllowedToolsFilter + type: object + MCPListToolsTool: + description: "Tool definition returned by MCP list tools operation.\n\n:param input_schema: JSON schema defining the tool's input parameters\n:param name: Name of the tool\n:param description: (Optional) Description of what the tool does" + properties: + input_schema: + additionalProperties: true + description: JSON schema defining the tool's input parameters + title: Input Schema + type: object + name: + description: Name of the tool + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + default: + description: Description of what the tool does + title: Description + required: + - input_schema + - name + title: MCPListToolsTool + type: object + OpenAIResponseAnnotationCitation: + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + properties: + type: + const: url_citation + default: url_citation + description: Annotation type identifier, always "url_citation" + title: Type + type: string + end_index: + description: End position of the citation span in the content + title: End Index + type: integer + start_index: + description: Start position of the citation span in the content + title: Start Index + type: integer + title: + description: Title of the referenced web resource + title: Title + type: string + url: + description: URL of the referenced web resource + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + properties: + type: + const: file_citation + default: file_citation + description: Annotation type identifier, always "file_citation" + title: Type + type: string + file_id: + description: Unique identifier of the referenced file + title: File Id + type: string + filename: + description: Name of the referenced file + title: Filename + type: string + index: + description: Position index of the citation within the content + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + properties: + type: + const: refusal + default: refusal + description: Content part type identifier, always "refusal" + title: Type + type: string + refusal: + description: Refusal text supplied by the model + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + OpenAIResponseError: + description: "Error details for failed OpenAI response requests.\n\n:param code: Error code identifying the type of failure\n:param message: Human-readable error message describing the failure" + properties: + code: + description: Error code identifying the type of failure + title: Code + type: string + message: + description: Human-readable error message describing the failure + title: Message + type: string + required: + - code + - message + title: OpenAIResponseError + type: object + OpenAIResponseInputMessageContentFile: + description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + properties: + type: + const: input_file + default: input_file + description: The type of the input item. Always `input_file`. + title: Type + type: string + file_data: + anyOf: + - type: string + - type: 'null' + default: + description: The data of the file to be sent to the model. + title: File Data + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + file_url: + anyOf: + - type: string + - type: 'null' + default: + description: The URL of the file to be sent to the model. + title: File Url + filename: + anyOf: + - type: string + - type: 'null' + default: + description: The name of the file to be sent to the model. + title: Filename + title: OpenAIResponseInputMessageContentFile + type: object + OpenAIResponseInputMessageContentImage: + description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + description: Level of detail for image processing, can be "low", "high", or "auto" + title: Detail + type: + const: input_image + default: input_image + description: Content type identifier, always "input_image" + title: Type + type: string + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + image_url: + anyOf: + - type: string + - type: 'null' + default: + description: URL of the image content + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: + description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + properties: + text: + description: The text content of the input message + title: Text + type: string + type: + const: input_text + default: input_text + description: Content type identifier, always "input_text" + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseInputToolFileSearch: + description: "File search tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"file_search\"\n:param vector_store_ids: List of vector store identifiers to search within\n:param filters: (Optional) Additional filters to apply to the search\n:param max_num_results: (Optional) Maximum number of search results to return (1-50)\n:param ranking_options: (Optional) Options for ranking and scoring search results" + properties: + type: + const: file_search + default: file_search + description: Tool type identifier, always "file_search" + title: Type + type: string + vector_store_ids: + description: List of vector store identifiers to search within + items: + type: string + title: Vector Store Ids + type: array + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + description: Additional filters to apply to the search + title: Filters + max_num_results: + anyOf: + - maximum: 50 + minimum: 1 + type: integer + - type: 'null' + default: 10 + description: Maximum number of search results to return (1-50) + title: Max Num Results + ranking_options: + anyOf: + - $ref: '#/components/schemas/SearchRankingOptions' + - type: 'null' + default: + description: Options for ranking and scoring search results + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + type: object + OpenAIResponseInputToolFunction: + description: "Function tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"function\"\n:param name: Name of the function that can be called\n:param description: (Optional) Description of what the function does\n:param parameters: (Optional) JSON schema defining the function's parameters\n:param strict: (Optional) Whether to enforce strict parameter validation" + properties: + type: + const: function + default: function + description: Tool type identifier, always "function" + title: Type + type: string + name: + description: Name of the function that can be called + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + default: + description: Description of what the function does + title: Description + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + description: JSON schema defining the function's parameters + title: Parameters + strict: + anyOf: + - type: boolean + - type: 'null' + default: + description: Whether to enforce strict parameter validation + title: Strict + required: + - name + title: OpenAIResponseInputToolFunction + type: object + OpenAIResponseInputToolWebSearch: + description: "Web search tool configuration for OpenAI response inputs.\n\n:param type: Web search tool type variant to use\n:param search_context_size: (Optional) Size of search context, must be \"low\", \"medium\", or \"high\"" + properties: + type: + anyOf: + - const: web_search + type: string + - const: web_search_preview + type: string + - const: web_search_preview_2025_03_11 + type: string + default: web_search + description: Web search tool type variant to use + title: Type + search_context_size: + anyOf: + - pattern: ^low|medium|high$ + type: string + - type: 'null' + default: medium + description: Size of search context, must be "low", "medium", or "high" + title: Search Context Size + title: OpenAIResponseInputToolWebSearch + type: object + OpenAIResponseMCPApprovalRequest: + description: A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments + type: string + id: + title: Id + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMessage: + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: array + - items: + discriminator: + mapping: + output_text: '#/$defs/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + OpenAIResponseObject: + description: "Complete OpenAI response object containing generation results and metadata.\n\n:param created_at: Unix timestamp when the response was created\n:param error: (Optional) Error details if the response generation failed\n:param id: Unique identifier for this response\n:param model: Model identifier used for generation\n:param object: Object type identifier, always \"response\"\n:param output: List of generated output items (messages, tool calls, etc.)\n:param parallel_tool_calls: Whether tool calls can be executed in parallel\n:param previous_response_id: (Optional) ID of the previous response in a conversation\n:param prompt: (Optional) Reference to a prompt template and its variables.\n:param status: Current status of the response generation\n:param temperature: (Optional) Sampling temperature used for generation\n:param text: Text formatting configuration for the response\n:param top_p: (Optional) Nucleus sampling parameter used for generation\n:param tools: (Optional) An array of tools the model may call while generating a response.\n:param truncation: (Optional) Truncation strategy applied to the response\n:param usage: (Optional) Token usage information for the response\n:param instructions: (Optional) System message inserted into the model's context" + properties: + created_at: + description: Unix timestamp when the response was created + title: Created At + type: integer + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + default: + description: Error details if the response generation failed + id: + description: Unique identifier for this response + title: Id + type: string + model: + description: Model identifier used for generation + title: Model + type: string + object: + const: response + default: response + description: Object type identifier, always "response" + title: Object + type: string + output: + description: List of generated output items (messages, tool calls, etc.) + items: + discriminator: + mapping: + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + title: Output + type: array + parallel_tool_calls: + default: false + description: Whether tool calls can be executed in parallel + title: Parallel Tool Calls + type: boolean + previous_response_id: + anyOf: + - type: string + - type: 'null' + default: + description: ID of the previous response in a conversation + title: Previous Response Id + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + default: + description: Reference to a prompt template and its variables. + status: + description: Current status of the response generation + title: Status + type: string + temperature: + anyOf: + - type: number + - type: 'null' + default: + description: Sampling temperature used for generation + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + description: Text formatting configuration for the response + top_p: + anyOf: + - type: number + - type: 'null' + default: + description: Nucleus sampling parameter used for generation + title: Top P + tools: + anyOf: + - items: + discriminator: + mapping: + file_search: '#/$defs/OpenAIResponseInputToolFileSearch' + function: '#/$defs/OpenAIResponseInputToolFunction' + mcp: '#/$defs/OpenAIResponseToolMCP' + web_search: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + type: array + - type: 'null' + default: + description: An array of tools the model may call while generating a response. + title: Tools + truncation: + anyOf: + - type: string + - type: 'null' + default: + description: Truncation strategy applied to the response + title: Truncation + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + default: + description: Token usage information for the response + instructions: + anyOf: + - type: string + - type: 'null' + default: + description: System message inserted into the model's context + title: Instructions + required: + - created_at + - id + - model + - output + - status + title: OpenAIResponseObject + type: object + OpenAIResponseOutputMessageContentOutputText: + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: '#/$defs/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/$defs/OpenAIResponseAnnotationFileCitation' + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: OpenAIResponseOutputMessageContentOutputText + type: object + OpenAIResponseOutputMessageFileSearchToolCall: + description: "File search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param queries: List of search queries executed\n:param status: Current status of the file search operation\n:param type: Tool call type identifier, always \"file_search_call\"\n:param results: (Optional) Search results returned by the file search operation" + properties: + id: + description: Unique identifier for this tool call + title: Id + type: string + queries: + description: List of search queries executed + items: + type: string + title: Queries + type: array + status: + description: Current status of the file search operation + title: Status + type: string + type: + const: file_search_call + default: file_search_call + description: Tool call type identifier, always "file_search_call" + title: Type + type: string + results: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' + type: array + - type: 'null' + default: + description: Search results returned by the file search operation + title: Results + required: + - id + - queries + - status + title: OpenAIResponseOutputMessageFileSearchToolCall + type: object + OpenAIResponseOutputMessageFileSearchToolCallResults: + description: "Search results returned by the file search operation.\n\n:param attributes: (Optional) Key-value attributes associated with the file\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result (between 0 and 1)\n:param text: Text content of the search result" + properties: + attributes: + additionalProperties: true + description: Key-value attributes associated with the file + title: Attributes + type: object + file_id: + description: Unique identifier of the file containing the result + title: File Id + type: string + filename: + description: Name of the file containing the result + title: Filename + type: string + score: + description: Relevance score for this search result (between 0 and 1) + title: Score + type: number + text: + description: Text content of the search result + title: Text + type: string + required: + - attributes + - file_id + - filename + - score + - text + title: OpenAIResponseOutputMessageFileSearchToolCallResults + type: object + OpenAIResponseOutputMessageFunctionToolCall: + description: "Function tool call output message for OpenAI responses.\n\n:param call_id: Unique identifier for the function call\n:param name: Name of the function being called\n:param arguments: JSON string containing the function arguments\n:param type: Tool call type identifier, always \"function_call\"\n:param id: (Optional) Additional identifier for the tool call\n:param status: (Optional) Current status of the function call execution" + properties: + call_id: + description: Unique identifier for the function call + title: Call Id + type: string + name: + description: Name of the function being called + title: Name + type: string + arguments: + description: JSON string containing the function arguments + title: Arguments + type: string + type: + const: function_call + default: function_call + description: Tool call type identifier, always "function_call" + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + description: Additional identifier for the tool call + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + description: Current status of the function call execution + title: Status + required: + - call_id + - name + - arguments + title: OpenAIResponseOutputMessageFunctionToolCall + type: object + OpenAIResponseOutputMessageMCPCall: + description: "Model Context Protocol (MCP) call output message for OpenAI responses.\n\n:param id: Unique identifier for this MCP call\n:param type: Tool call type identifier, always \"mcp_call\"\n:param arguments: JSON string containing the MCP call arguments\n:param name: Name of the MCP method being called\n:param server_label: Label identifying the MCP server handling the call\n:param error: (Optional) Error message if the MCP call failed\n:param output: (Optional) Output result from the successful MCP call" + properties: + id: + description: Unique identifier for this MCP call + title: Id + type: string + type: + const: mcp_call + default: mcp_call + description: Tool call type identifier, always "mcp_call" + title: Type + type: string + arguments: + description: JSON string containing the MCP call arguments + title: Arguments + type: string + name: + description: Name of the MCP method being called + title: Name + type: string + server_label: + description: Label identifying the MCP server handling the call + title: Server Label + type: string + error: + anyOf: + - type: string + - type: 'null' + default: + description: Error message if the MCP call failed + title: Error + output: + anyOf: + - type: string + - type: 'null' + default: + description: Output result from the successful MCP call + title: Output + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + type: object + OpenAIResponseOutputMessageMCPListTools: + description: "MCP list tools output message containing available tools from an MCP server.\n\n:param id: Unique identifier for this MCP list tools operation\n:param type: Tool call type identifier, always \"mcp_list_tools\"\n:param server_label: Label identifying the MCP server providing the tools\n:param tools: List of available tools provided by the MCP server" + properties: + id: + description: Unique identifier for this MCP list tools operation + title: Id + type: string + type: + const: mcp_list_tools + default: mcp_list_tools + description: Tool call type identifier, always "mcp_list_tools" + title: Type + type: string + server_label: + description: Label identifying the MCP server providing the tools + title: Server Label + type: string + tools: + description: List of available tools provided by the MCP server + items: + $ref: '#/components/schemas/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + type: object + OpenAIResponseOutputMessageWebSearchToolCall: + description: "Web search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param status: Current status of the web search operation\n:param type: Tool call type identifier, always \"web_search_call\"" + properties: + id: + description: Unique identifier for this tool call + title: Id + type: string + status: + description: Current status of the web search operation + title: Status + type: string + type: + const: web_search_call + default: web_search_call + description: Tool call type identifier, always "web_search_call" + title: Type + type: string + required: + - id + - status + title: OpenAIResponseOutputMessageWebSearchToolCall + type: object + OpenAIResponsePrompt: + description: "OpenAI compatible Prompt object that is used in OpenAI responses.\n\n:param id: Unique identifier of the prompt template\n:param variables: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types\nlike images or files.\n:param version: Version number of the prompt to use (defaults to latest if not specified)" + properties: + id: + description: Unique identifier of the prompt template + title: Id + type: string + variables: + anyOf: + - additionalProperties: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: object + - type: 'null' + default: + description: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files. + title: Variables + version: + anyOf: + - type: string + - type: 'null' + default: + description: Version number of the prompt to use (defaults to latest if not specified) + title: Version + required: + - id + title: OpenAIResponsePrompt + type: object + OpenAIResponseText: + description: "Text response configuration for OpenAI responses.\n\n:param format: (Optional) Text format configuration specifying output format requirements" + properties: + format: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseTextFormat' + - type: 'null' + default: + description: Text format configuration specifying output format requirements + title: OpenAIResponseText + type: object + OpenAIResponseTextFormat: + description: "Configuration for Responses API text format.\n\n:param type: Must be \"text\", \"json_schema\", or \"json_object\" to identify the format type\n:param name: The name of the response format. Only used for json_schema.\n:param schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model. Only used for json_schema.\n:param description: (Optional) A description of the response format. Only used for json_schema.\n:param strict: (Optional) Whether to strictly enforce the JSON schema. If true, the response must match the schema exactly. Only used for json_schema." + properties: + type: + anyOf: + - const: text + type: string + - const: json_schema + type: string + - const: json_object + type: string + title: Type + name: + anyOf: + - type: string + - type: 'null' + title: Name + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + title: OpenAIResponseTextFormat + type: object + OpenAIResponseToolMCP: + description: "Model Context Protocol (MCP) tool configuration for OpenAI response object.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + properties: + type: + const: mcp + default: mcp + description: Tool type identifier, always "mcp" + title: Type + type: string + server_label: + description: Label to identify this MCP server + title: Server Label + type: string + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + default: + description: Restriction on which tools can be used from this server + title: Allowed Tools + required: + - server_label + title: OpenAIResponseToolMCP + type: object + OpenAIResponseUsage: + description: "Usage information for OpenAI response.\n\n:param input_tokens: Number of tokens in the input\n:param output_tokens: Number of tokens in the output\n:param total_tokens: Total tokens used (input + output)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + properties: + input_tokens: + description: Number of tokens in the input + title: Input Tokens + type: integer + output_tokens: + description: Number of tokens in the output + title: Output Tokens + type: integer + total_tokens: + description: Total tokens used (input + output) + title: Total Tokens + type: integer + input_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' + - type: 'null' + default: + description: Detailed breakdown of input token usage + output_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + - type: 'null' + default: + description: Detailed breakdown of output token usage + required: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + type: object + OpenAIResponseUsageInputTokensDetails: + description: "Token details for input tokens in OpenAI response usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + default: + description: Number of tokens retrieved from cache + title: Cached Tokens + title: OpenAIResponseUsageInputTokensDetails + type: object + OpenAIResponseUsageOutputTokensDetails: + description: "Token details for output tokens in OpenAI response usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + default: + description: Number of tokens used for reasoning (o1/o3 models) + title: Reasoning Tokens + title: OpenAIResponseUsageOutputTokensDetails + type: object + SearchRankingOptions: + description: Options for ranking and filtering search results. + properties: + ranker: + anyOf: + - type: string + - type: 'null' + default: + title: Ranker + score_threshold: + anyOf: + - type: number + - type: 'null' + default: 0.0 + title: Score Threshold + title: SearchRankingOptions + type: object + description: "Streaming event emitted when a response ends in an incomplete state.\n\n:param response: Response object describing the incomplete state\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.incomplete\"" + properties: + response: + $ref: '#/components/schemas/OpenAIResponseObject' + description: Response object describing the incomplete state + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.incomplete + default: response.incomplete + description: Event type identifier, always "response.incomplete" + title: Type + type: string + required: + - response + - sequence_number + title: OpenAIResponseObjectStreamResponseIncomplete + type: object + OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta: + properties: + delta: + title: Delta + type: string + item_id: + title: Item Id + type: string + output_index: + title: Output Index + type: integer + sequence_number: + title: Sequence Number + type: integer + type: + const: response.mcp_call.arguments.delta + default: response.mcp_call.arguments.delta + title: Type + type: string + required: + - delta + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta + type: object + OpenAIResponseObjectStreamResponseMcpCallArgumentsDone: + properties: + arguments: + title: Arguments + type: string + item_id: + title: Item Id + type: string + output_index: + title: Output Index + type: integer + sequence_number: + title: Sequence Number + type: integer + type: + const: response.mcp_call.arguments.done + default: response.mcp_call.arguments.done + title: Type + type: string + required: + - arguments + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseMcpCallArgumentsDone + type: object + OpenAIResponseObjectStreamResponseMcpCallCompleted: + description: "Streaming event for completed MCP calls.\n\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.mcp_call.completed\"" + properties: + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.mcp_call.completed + default: response.mcp_call.completed + description: Event type identifier, always "response.mcp_call.completed" + title: Type + type: string + required: + - sequence_number + title: OpenAIResponseObjectStreamResponseMcpCallCompleted + type: object + OpenAIResponseObjectStreamResponseMcpCallFailed: + description: "Streaming event for failed MCP calls.\n\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.mcp_call.failed\"" + properties: + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.mcp_call.failed + default: response.mcp_call.failed + description: Event type identifier, always "response.mcp_call.failed" + title: Type + type: string + required: + - sequence_number + title: OpenAIResponseObjectStreamResponseMcpCallFailed + type: object + OpenAIResponseObjectStreamResponseMcpCallInProgress: + description: "Streaming event for MCP calls in progress.\n\n:param item_id: Unique identifier of the MCP call\n:param output_index: Index position of the item in the output list\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.mcp_call.in_progress\"" + properties: + item_id: + description: Unique identifier of the MCP call + title: Item Id + type: string + output_index: + description: Index position of the item in the output list + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.mcp_call.in_progress + default: response.mcp_call.in_progress + description: Event type identifier, always "response.mcp_call.in_progress" + title: Type + type: string + required: + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseMcpCallInProgress + type: object + OpenAIResponseObjectStreamResponseMcpListToolsCompleted: + properties: + sequence_number: + title: Sequence Number + type: integer + type: + const: response.mcp_list_tools.completed + default: response.mcp_list_tools.completed + title: Type + type: string + required: + - sequence_number + title: OpenAIResponseObjectStreamResponseMcpListToolsCompleted + type: object + OpenAIResponseObjectStreamResponseMcpListToolsFailed: + properties: + sequence_number: + title: Sequence Number + type: integer + type: + const: response.mcp_list_tools.failed + default: response.mcp_list_tools.failed + title: Type + type: string + required: + - sequence_number + title: OpenAIResponseObjectStreamResponseMcpListToolsFailed + type: object + OpenAIResponseObjectStreamResponseMcpListToolsInProgress: + properties: + sequence_number: + title: Sequence Number + type: integer + type: + const: response.mcp_list_tools.in_progress + default: response.mcp_list_tools.in_progress + title: Type + type: string + required: + - sequence_number + title: OpenAIResponseObjectStreamResponseMcpListToolsInProgress + type: object + OpenAIResponseObjectStreamResponseOutputItemAdded: + $defs: + MCPListToolsTool: + description: "Tool definition returned by MCP list tools operation.\n\n:param input_schema: JSON schema defining the tool's input parameters\n:param name: Name of the tool\n:param description: (Optional) Description of what the tool does" + properties: + input_schema: + additionalProperties: true + description: JSON schema defining the tool's input parameters + title: Input Schema + type: object + name: + description: Name of the tool + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + default: + description: Description of what the tool does + title: Description + required: + - input_schema + - name + title: MCPListToolsTool + type: object + OpenAIResponseAnnotationCitation: + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + properties: + type: + const: url_citation + default: url_citation + description: Annotation type identifier, always "url_citation" + title: Type + type: string + end_index: + description: End position of the citation span in the content + title: End Index + type: integer + start_index: + description: Start position of the citation span in the content + title: Start Index + type: integer + title: + description: Title of the referenced web resource + title: Title + type: string + url: + description: URL of the referenced web resource + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + properties: + type: + const: file_citation + default: file_citation + description: Annotation type identifier, always "file_citation" + title: Type + type: string + file_id: + description: Unique identifier of the referenced file + title: File Id + type: string + filename: + description: Name of the referenced file + title: Filename + type: string + index: + description: Position index of the citation within the content + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + properties: + type: + const: refusal + default: refusal + description: Content part type identifier, always "refusal" + title: Type + type: string + refusal: + description: Refusal text supplied by the model + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + OpenAIResponseInputMessageContentFile: + description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + properties: + type: + const: input_file + default: input_file + description: The type of the input item. Always `input_file`. + title: Type + type: string + file_data: + anyOf: + - type: string + - type: 'null' + default: + description: The data of the file to be sent to the model. + title: File Data + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + file_url: + anyOf: + - type: string + - type: 'null' + default: + description: The URL of the file to be sent to the model. + title: File Url + filename: + anyOf: + - type: string + - type: 'null' + default: + description: The name of the file to be sent to the model. + title: Filename + title: OpenAIResponseInputMessageContentFile + type: object + OpenAIResponseInputMessageContentImage: + description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + description: Level of detail for image processing, can be "low", "high", or "auto" + title: Detail + type: + const: input_image + default: input_image + description: Content type identifier, always "input_image" + title: Type + type: string + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + image_url: + anyOf: + - type: string + - type: 'null' + default: + description: URL of the image content + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: + description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + properties: + text: + description: The text content of the input message + title: Text + type: string + type: + const: input_text + default: input_text + description: Content type identifier, always "input_text" + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseMCPApprovalRequest: + description: A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments + type: string + id: + title: Id + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMessage: + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: array + - items: + discriminator: + mapping: + output_text: '#/$defs/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + OpenAIResponseOutputMessageContentOutputText: + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: '#/$defs/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/$defs/OpenAIResponseAnnotationFileCitation' + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: OpenAIResponseOutputMessageContentOutputText + type: object + OpenAIResponseOutputMessageFileSearchToolCall: + description: "File search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param queries: List of search queries executed\n:param status: Current status of the file search operation\n:param type: Tool call type identifier, always \"file_search_call\"\n:param results: (Optional) Search results returned by the file search operation" + properties: + id: + description: Unique identifier for this tool call + title: Id + type: string + queries: + description: List of search queries executed + items: + type: string + title: Queries + type: array + status: + description: Current status of the file search operation + title: Status + type: string + type: + const: file_search_call + default: file_search_call + description: Tool call type identifier, always "file_search_call" + title: Type + type: string + results: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' + type: array + - type: 'null' + default: + description: Search results returned by the file search operation + title: Results + required: + - id + - queries + - status + title: OpenAIResponseOutputMessageFileSearchToolCall + type: object + OpenAIResponseOutputMessageFileSearchToolCallResults: + description: "Search results returned by the file search operation.\n\n:param attributes: (Optional) Key-value attributes associated with the file\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result (between 0 and 1)\n:param text: Text content of the search result" + properties: + attributes: + additionalProperties: true + description: Key-value attributes associated with the file + title: Attributes + type: object + file_id: + description: Unique identifier of the file containing the result + title: File Id + type: string + filename: + description: Name of the file containing the result + title: Filename + type: string + score: + description: Relevance score for this search result (between 0 and 1) + title: Score + type: number + text: + description: Text content of the search result + title: Text + type: string + required: + - attributes + - file_id + - filename + - score + - text + title: OpenAIResponseOutputMessageFileSearchToolCallResults + type: object + OpenAIResponseOutputMessageFunctionToolCall: + description: "Function tool call output message for OpenAI responses.\n\n:param call_id: Unique identifier for the function call\n:param name: Name of the function being called\n:param arguments: JSON string containing the function arguments\n:param type: Tool call type identifier, always \"function_call\"\n:param id: (Optional) Additional identifier for the tool call\n:param status: (Optional) Current status of the function call execution" + properties: + call_id: + description: Unique identifier for the function call + title: Call Id + type: string + name: + description: Name of the function being called + title: Name + type: string + arguments: + description: JSON string containing the function arguments + title: Arguments + type: string + type: + const: function_call + default: function_call + description: Tool call type identifier, always "function_call" + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + description: Additional identifier for the tool call + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + description: Current status of the function call execution + title: Status + required: + - call_id + - name + - arguments + title: OpenAIResponseOutputMessageFunctionToolCall + type: object + OpenAIResponseOutputMessageMCPCall: + description: "Model Context Protocol (MCP) call output message for OpenAI responses.\n\n:param id: Unique identifier for this MCP call\n:param type: Tool call type identifier, always \"mcp_call\"\n:param arguments: JSON string containing the MCP call arguments\n:param name: Name of the MCP method being called\n:param server_label: Label identifying the MCP server handling the call\n:param error: (Optional) Error message if the MCP call failed\n:param output: (Optional) Output result from the successful MCP call" + properties: + id: + description: Unique identifier for this MCP call + title: Id + type: string + type: + const: mcp_call + default: mcp_call + description: Tool call type identifier, always "mcp_call" + title: Type + type: string + arguments: + description: JSON string containing the MCP call arguments + title: Arguments + type: string + name: + description: Name of the MCP method being called + title: Name + type: string + server_label: + description: Label identifying the MCP server handling the call + title: Server Label + type: string + error: + anyOf: + - type: string + - type: 'null' + default: + description: Error message if the MCP call failed + title: Error + output: + anyOf: + - type: string + - type: 'null' + default: + description: Output result from the successful MCP call + title: Output + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + type: object + OpenAIResponseOutputMessageMCPListTools: + description: "MCP list tools output message containing available tools from an MCP server.\n\n:param id: Unique identifier for this MCP list tools operation\n:param type: Tool call type identifier, always \"mcp_list_tools\"\n:param server_label: Label identifying the MCP server providing the tools\n:param tools: List of available tools provided by the MCP server" + properties: + id: + description: Unique identifier for this MCP list tools operation + title: Id + type: string + type: + const: mcp_list_tools + default: mcp_list_tools + description: Tool call type identifier, always "mcp_list_tools" + title: Type + type: string + server_label: + description: Label identifying the MCP server providing the tools + title: Server Label + type: string + tools: + description: List of available tools provided by the MCP server + items: + $ref: '#/components/schemas/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + type: object + OpenAIResponseOutputMessageWebSearchToolCall: + description: "Web search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param status: Current status of the web search operation\n:param type: Tool call type identifier, always \"web_search_call\"" + properties: + id: + description: Unique identifier for this tool call + title: Id + type: string + status: + description: Current status of the web search operation + title: Status + type: string + type: + const: web_search_call + default: web_search_call + description: Tool call type identifier, always "web_search_call" + title: Type + type: string + required: + - id + - status + title: OpenAIResponseOutputMessageWebSearchToolCall + type: object + description: "Streaming event for when a new output item is added to the response.\n\n:param response_id: Unique identifier of the response containing this output\n:param item: The output item that was added (message, tool call, etc.)\n:param output_index: Index position of this item in the output list\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.output_item.added\"" + properties: + response_id: + description: Unique identifier of the response containing this output + title: Response Id + type: string + item: + description: The output item that was added (message, tool call, etc.) + discriminator: + mapping: + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + title: Item + output_index: + description: Index position of this item in the output list + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.output_item.added + default: response.output_item.added + description: Event type identifier, always "response.output_item.added" + title: Type + type: string + required: + - response_id + - item + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseOutputItemAdded + type: object + OpenAIResponseObjectStreamResponseOutputItemDone: + $defs: + MCPListToolsTool: + description: "Tool definition returned by MCP list tools operation.\n\n:param input_schema: JSON schema defining the tool's input parameters\n:param name: Name of the tool\n:param description: (Optional) Description of what the tool does" + properties: + input_schema: + additionalProperties: true + description: JSON schema defining the tool's input parameters + title: Input Schema + type: object + name: + description: Name of the tool + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + default: + description: Description of what the tool does + title: Description + required: + - input_schema + - name + title: MCPListToolsTool + type: object + OpenAIResponseAnnotationCitation: + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + properties: + type: + const: url_citation + default: url_citation + description: Annotation type identifier, always "url_citation" + title: Type + type: string + end_index: + description: End position of the citation span in the content + title: End Index + type: integer + start_index: + description: Start position of the citation span in the content + title: Start Index + type: integer + title: + description: Title of the referenced web resource + title: Title + type: string + url: + description: URL of the referenced web resource + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + properties: + type: + const: file_citation + default: file_citation + description: Annotation type identifier, always "file_citation" + title: Type + type: string + file_id: + description: Unique identifier of the referenced file + title: File Id + type: string + filename: + description: Name of the referenced file + title: Filename + type: string + index: + description: Position index of the citation within the content + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + properties: + type: + const: refusal + default: refusal + description: Content part type identifier, always "refusal" + title: Type + type: string + refusal: + description: Refusal text supplied by the model + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + OpenAIResponseInputMessageContentFile: + description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + properties: + type: + const: input_file + default: input_file + description: The type of the input item. Always `input_file`. + title: Type + type: string + file_data: + anyOf: + - type: string + - type: 'null' + default: + description: The data of the file to be sent to the model. + title: File Data + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + file_url: + anyOf: + - type: string + - type: 'null' + default: + description: The URL of the file to be sent to the model. + title: File Url + filename: + anyOf: + - type: string + - type: 'null' + default: + description: The name of the file to be sent to the model. + title: Filename + title: OpenAIResponseInputMessageContentFile + type: object + OpenAIResponseInputMessageContentImage: + description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + description: Level of detail for image processing, can be "low", "high", or "auto" + title: Detail + type: + const: input_image + default: input_image + description: Content type identifier, always "input_image" + title: Type + type: string + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + image_url: + anyOf: + - type: string + - type: 'null' + default: + description: URL of the image content + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: + description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + properties: + text: + description: The text content of the input message + title: Text + type: string + type: + const: input_text + default: input_text + description: Content type identifier, always "input_text" + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseMCPApprovalRequest: + description: A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments + type: string + id: + title: Id + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMessage: + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: array + - items: + discriminator: + mapping: + output_text: '#/$defs/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + OpenAIResponseOutputMessageContentOutputText: + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: '#/$defs/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/$defs/OpenAIResponseAnnotationFileCitation' + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: OpenAIResponseOutputMessageContentOutputText + type: object + OpenAIResponseOutputMessageFileSearchToolCall: + description: "File search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param queries: List of search queries executed\n:param status: Current status of the file search operation\n:param type: Tool call type identifier, always \"file_search_call\"\n:param results: (Optional) Search results returned by the file search operation" + properties: + id: + description: Unique identifier for this tool call + title: Id + type: string + queries: + description: List of search queries executed + items: + type: string + title: Queries + type: array + status: + description: Current status of the file search operation + title: Status + type: string + type: + const: file_search_call + default: file_search_call + description: Tool call type identifier, always "file_search_call" + title: Type + type: string + results: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' + type: array + - type: 'null' + default: + description: Search results returned by the file search operation + title: Results + required: + - id + - queries + - status + title: OpenAIResponseOutputMessageFileSearchToolCall + type: object + OpenAIResponseOutputMessageFileSearchToolCallResults: + description: "Search results returned by the file search operation.\n\n:param attributes: (Optional) Key-value attributes associated with the file\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result (between 0 and 1)\n:param text: Text content of the search result" + properties: + attributes: + additionalProperties: true + description: Key-value attributes associated with the file + title: Attributes + type: object + file_id: + description: Unique identifier of the file containing the result + title: File Id + type: string + filename: + description: Name of the file containing the result + title: Filename + type: string + score: + description: Relevance score for this search result (between 0 and 1) + title: Score + type: number + text: + description: Text content of the search result + title: Text + type: string + required: + - attributes + - file_id + - filename + - score + - text + title: OpenAIResponseOutputMessageFileSearchToolCallResults + type: object + OpenAIResponseOutputMessageFunctionToolCall: + description: "Function tool call output message for OpenAI responses.\n\n:param call_id: Unique identifier for the function call\n:param name: Name of the function being called\n:param arguments: JSON string containing the function arguments\n:param type: Tool call type identifier, always \"function_call\"\n:param id: (Optional) Additional identifier for the tool call\n:param status: (Optional) Current status of the function call execution" + properties: + call_id: + description: Unique identifier for the function call + title: Call Id + type: string + name: + description: Name of the function being called + title: Name + type: string + arguments: + description: JSON string containing the function arguments + title: Arguments + type: string + type: + const: function_call + default: function_call + description: Tool call type identifier, always "function_call" + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + description: Additional identifier for the tool call + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + description: Current status of the function call execution + title: Status + required: + - call_id + - name + - arguments + title: OpenAIResponseOutputMessageFunctionToolCall + type: object + OpenAIResponseOutputMessageMCPCall: + description: "Model Context Protocol (MCP) call output message for OpenAI responses.\n\n:param id: Unique identifier for this MCP call\n:param type: Tool call type identifier, always \"mcp_call\"\n:param arguments: JSON string containing the MCP call arguments\n:param name: Name of the MCP method being called\n:param server_label: Label identifying the MCP server handling the call\n:param error: (Optional) Error message if the MCP call failed\n:param output: (Optional) Output result from the successful MCP call" + properties: + id: + description: Unique identifier for this MCP call + title: Id + type: string + type: + const: mcp_call + default: mcp_call + description: Tool call type identifier, always "mcp_call" + title: Type + type: string + arguments: + description: JSON string containing the MCP call arguments + title: Arguments + type: string + name: + description: Name of the MCP method being called + title: Name + type: string + server_label: + description: Label identifying the MCP server handling the call + title: Server Label + type: string + error: + anyOf: + - type: string + - type: 'null' + default: + description: Error message if the MCP call failed + title: Error + output: + anyOf: + - type: string + - type: 'null' + default: + description: Output result from the successful MCP call + title: Output + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + type: object + OpenAIResponseOutputMessageMCPListTools: + description: "MCP list tools output message containing available tools from an MCP server.\n\n:param id: Unique identifier for this MCP list tools operation\n:param type: Tool call type identifier, always \"mcp_list_tools\"\n:param server_label: Label identifying the MCP server providing the tools\n:param tools: List of available tools provided by the MCP server" + properties: + id: + description: Unique identifier for this MCP list tools operation + title: Id + type: string + type: + const: mcp_list_tools + default: mcp_list_tools + description: Tool call type identifier, always "mcp_list_tools" + title: Type + type: string + server_label: + description: Label identifying the MCP server providing the tools + title: Server Label + type: string + tools: + description: List of available tools provided by the MCP server + items: + $ref: '#/components/schemas/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + type: object + OpenAIResponseOutputMessageWebSearchToolCall: + description: "Web search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param status: Current status of the web search operation\n:param type: Tool call type identifier, always \"web_search_call\"" + properties: + id: + description: Unique identifier for this tool call + title: Id + type: string + status: + description: Current status of the web search operation + title: Status + type: string + type: + const: web_search_call + default: web_search_call + description: Tool call type identifier, always "web_search_call" + title: Type + type: string + required: + - id + - status + title: OpenAIResponseOutputMessageWebSearchToolCall + type: object + description: "Streaming event for when an output item is completed.\n\n:param response_id: Unique identifier of the response containing this output\n:param item: The completed output item (message, tool call, etc.)\n:param output_index: Index position of this item in the output list\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.output_item.done\"" + properties: + response_id: + description: Unique identifier of the response containing this output + title: Response Id + type: string + item: + description: The completed output item (message, tool call, etc.) + discriminator: + mapping: + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + title: Item + output_index: + description: Index position of this item in the output list + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.output_item.done + default: response.output_item.done + description: Event type identifier, always "response.output_item.done" + title: Type + type: string + required: + - response_id + - item + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseOutputItemDone + type: object + OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded: + $defs: + OpenAIResponseAnnotationCitation: + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + properties: + type: + const: url_citation + default: url_citation + description: Annotation type identifier, always "url_citation" + title: Type + type: string + end_index: + description: End position of the citation span in the content + title: End Index + type: integer + start_index: + description: Start position of the citation span in the content + title: Start Index + type: integer + title: + description: Title of the referenced web resource + title: Title + type: string + url: + description: URL of the referenced web resource + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + properties: + type: + const: file_citation + default: file_citation + description: Annotation type identifier, always "file_citation" + title: Type + type: string + file_id: + description: Unique identifier of the referenced file + title: File Id + type: string + filename: + description: Name of the referenced file + title: Filename + type: string + index: + description: Position index of the citation within the content + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + description: "Streaming event for when an annotation is added to output text.\n\n:param item_id: Unique identifier of the item to which the annotation is being added\n:param output_index: Index position of the output item in the response's output array\n:param content_index: Index position of the content part within the output item\n:param annotation_index: Index of the annotation within the content part\n:param annotation: The annotation object being added\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.output_text.annotation.added\"" + properties: + item_id: + description: Unique identifier of the item to which the annotation is being added + title: Item Id + type: string + output_index: + description: Index position of the output item in the response's output array + title: Output Index + type: integer + content_index: + description: Index position of the content part within the output item + title: Content Index + type: integer + annotation_index: + description: Index of the annotation within the content part + title: Annotation Index + type: integer + annotation: + description: The annotation object being added + discriminator: + mapping: + container_file_citation: '#/$defs/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/$defs/OpenAIResponseAnnotationFileCitation' + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + title: Annotation + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.output_text.annotation.added + default: response.output_text.annotation.added + description: Event type identifier, always "response.output_text.annotation.added" + title: Type + type: string + required: + - item_id + - output_index + - content_index + - annotation_index + - annotation + - sequence_number + title: OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded + type: object + OpenAIResponseObjectStreamResponseOutputTextDelta: + description: "Streaming event for incremental text content updates.\n\n:param content_index: Index position within the text content\n:param delta: Incremental text content being added\n:param item_id: Unique identifier of the output item being updated\n:param output_index: Index position of the item in the output list\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.output_text.delta\"" + properties: + content_index: + description: Index position within the text content + title: Content Index + type: integer + delta: + description: Incremental text content being added + title: Delta + type: string + item_id: + description: Unique identifier of the output item being updated + title: Item Id + type: string + output_index: + description: Index position of the item in the output list + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.output_text.delta + default: response.output_text.delta + description: Event type identifier, always "response.output_text.delta" + title: Type + type: string + required: + - content_index + - delta + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseOutputTextDelta + type: object + OpenAIResponseObjectStreamResponseOutputTextDone: + description: "Streaming event for when text output is completed.\n\n:param content_index: Index position within the text content\n:param text: Final complete text content of the output item\n:param item_id: Unique identifier of the completed output item\n:param output_index: Index position of the item in the output list\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.output_text.done\"" + properties: + content_index: + description: Index position within the text content + title: Content Index + type: integer + text: + description: Final complete text content of the output item + title: Text + type: string + item_id: + description: Unique identifier of the completed output item + title: Item Id + type: string + output_index: + description: Index position of the item in the output list + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.output_text.done + default: response.output_text.done + description: Event type identifier, always "response.output_text.done" + title: Type + type: string + required: + - content_index + - text + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseOutputTextDone + type: object + OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded: + $defs: + OpenAIResponseContentPartReasoningSummary: + description: "Reasoning summary part in a streamed response.\n\n:param type: Content part type identifier, always \"summary_text\"\n:param text: Summary text" + properties: + type: + const: summary_text + default: summary_text + description: Content part type identifier, always "summary_text" + title: Type + type: string + text: + description: Summary text + title: Text + type: string + required: + - text + title: OpenAIResponseContentPartReasoningSummary + type: object + description: "Streaming event for when a new reasoning summary part is added.\n\n:param item_id: Unique identifier of the output item\n:param output_index: Index position of the output item\n:param part: The summary part that was added\n:param sequence_number: Sequential number for ordering streaming events\n:param summary_index: Index of the summary part within the reasoning summary\n:param type: Event type identifier, always \"response.reasoning_summary_part.added\"" + properties: + item_id: + description: Unique identifier of the output item + title: Item Id + type: string + output_index: + description: Index position of the output item + title: Output Index + type: integer + part: + $ref: '#/components/schemas/OpenAIResponseContentPartReasoningSummary' + description: The summary part that was added + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + summary_index: + description: Index of the summary part within the reasoning summary + title: Summary Index + type: integer + type: + const: response.reasoning_summary_part.added + default: response.reasoning_summary_part.added + description: Event type identifier, always "response.reasoning_summary_part.added" + title: Type + type: string + required: + - item_id + - output_index + - part + - sequence_number + - summary_index + title: OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded + type: object + OpenAIResponseObjectStreamResponseReasoningSummaryPartDone: + $defs: + OpenAIResponseContentPartReasoningSummary: + description: "Reasoning summary part in a streamed response.\n\n:param type: Content part type identifier, always \"summary_text\"\n:param text: Summary text" + properties: + type: + const: summary_text + default: summary_text + description: Content part type identifier, always "summary_text" + title: Type + type: string + text: + description: Summary text + title: Text + type: string + required: + - text + title: OpenAIResponseContentPartReasoningSummary + type: object + description: "Streaming event for when a reasoning summary part is completed.\n\n:param item_id: Unique identifier of the output item\n:param output_index: Index position of the output item\n:param part: The completed summary part\n:param sequence_number: Sequential number for ordering streaming events\n:param summary_index: Index of the summary part within the reasoning summary\n:param type: Event type identifier, always \"response.reasoning_summary_part.done\"" + properties: + item_id: + description: Unique identifier of the output item + title: Item Id + type: string + output_index: + description: Index position of the output item + title: Output Index + type: integer + part: + $ref: '#/components/schemas/OpenAIResponseContentPartReasoningSummary' + description: The completed summary part + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + summary_index: + description: Index of the summary part within the reasoning summary + title: Summary Index + type: integer + type: + const: response.reasoning_summary_part.done + default: response.reasoning_summary_part.done + description: Event type identifier, always "response.reasoning_summary_part.done" + title: Type + type: string + required: + - item_id + - output_index + - part + - sequence_number + - summary_index + title: OpenAIResponseObjectStreamResponseReasoningSummaryPartDone + type: object + OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta: + description: "Streaming event for incremental reasoning summary text updates.\n\n:param delta: Incremental summary text being added\n:param item_id: Unique identifier of the output item\n:param output_index: Index position of the output item\n:param sequence_number: Sequential number for ordering streaming events\n:param summary_index: Index of the summary part within the reasoning summary\n:param type: Event type identifier, always \"response.reasoning_summary_text.delta\"" + properties: + delta: + description: Incremental summary text being added + title: Delta + type: string + item_id: + description: Unique identifier of the output item + title: Item Id + type: string + output_index: + description: Index position of the output item + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + summary_index: + description: Index of the summary part within the reasoning summary + title: Summary Index + type: integer + type: + const: response.reasoning_summary_text.delta + default: response.reasoning_summary_text.delta + description: Event type identifier, always "response.reasoning_summary_text.delta" + title: Type + type: string + required: + - delta + - item_id + - output_index + - sequence_number + - summary_index + title: OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta + type: object + OpenAIResponseObjectStreamResponseReasoningSummaryTextDone: + description: "Streaming event for when reasoning summary text is completed.\n\n:param text: Final complete summary text\n:param item_id: Unique identifier of the output item\n:param output_index: Index position of the output item\n:param sequence_number: Sequential number for ordering streaming events\n:param summary_index: Index of the summary part within the reasoning summary\n:param type: Event type identifier, always \"response.reasoning_summary_text.done\"" + properties: + text: + description: Final complete summary text + title: Text + type: string + item_id: + description: Unique identifier of the output item + title: Item Id + type: string + output_index: + description: Index position of the output item + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + summary_index: + description: Index of the summary part within the reasoning summary + title: Summary Index + type: integer + type: + const: response.reasoning_summary_text.done + default: response.reasoning_summary_text.done + description: Event type identifier, always "response.reasoning_summary_text.done" + title: Type + type: string + required: + - text + - item_id + - output_index + - sequence_number + - summary_index + title: OpenAIResponseObjectStreamResponseReasoningSummaryTextDone + type: object + OpenAIResponseObjectStreamResponseReasoningTextDelta: + description: "Streaming event for incremental reasoning text updates.\n\n:param content_index: Index position of the reasoning content part\n:param delta: Incremental reasoning text being added\n:param item_id: Unique identifier of the output item being updated\n:param output_index: Index position of the item in the output list\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.reasoning_text.delta\"" + properties: + content_index: + description: Index position of the reasoning content part + title: Content Index + type: integer + delta: + description: Incremental reasoning text being added + title: Delta + type: string + item_id: + description: Unique identifier of the output item being updated + title: Item Id + type: string + output_index: + description: Index position of the item in the output list + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.reasoning_text.delta + default: response.reasoning_text.delta + description: Event type identifier, always "response.reasoning_text.delta" + title: Type + type: string + required: + - content_index + - delta + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseReasoningTextDelta + type: object + OpenAIResponseObjectStreamResponseReasoningTextDone: + description: "Streaming event for when reasoning text is completed.\n\n:param content_index: Index position of the reasoning content part\n:param text: Final complete reasoning text\n:param item_id: Unique identifier of the completed output item\n:param output_index: Index position of the item in the output list\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.reasoning_text.done\"" + properties: + content_index: + description: Index position of the reasoning content part + title: Content Index + type: integer + text: + description: Final complete reasoning text + title: Text + type: string + item_id: + description: Unique identifier of the completed output item + title: Item Id + type: string + output_index: + description: Index position of the item in the output list + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.reasoning_text.done + default: response.reasoning_text.done + description: Event type identifier, always "response.reasoning_text.done" + title: Type + type: string + required: + - content_index + - text + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseReasoningTextDone + type: object + OpenAIResponseObjectStreamResponseRefusalDelta: + description: "Streaming event for incremental refusal text updates.\n\n:param content_index: Index position of the content part\n:param delta: Incremental refusal text being added\n:param item_id: Unique identifier of the output item\n:param output_index: Index position of the item in the output list\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.refusal.delta\"" + properties: + content_index: + description: Index position of the content part + title: Content Index + type: integer + delta: + description: Incremental refusal text being added + title: Delta + type: string + item_id: + description: Unique identifier of the output item + title: Item Id + type: string + output_index: + description: Index position of the item in the output list + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.refusal.delta + default: response.refusal.delta + description: Event type identifier, always "response.refusal.delta" + title: Type + type: string + required: + - content_index + - delta + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseRefusalDelta + type: object + OpenAIResponseObjectStreamResponseRefusalDone: + description: "Streaming event for when refusal text is completed.\n\n:param content_index: Index position of the content part\n:param refusal: Final complete refusal text\n:param item_id: Unique identifier of the output item\n:param output_index: Index position of the item in the output list\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.refusal.done\"" + properties: + content_index: + description: Index position of the content part + title: Content Index + type: integer + refusal: + description: Final complete refusal text + title: Refusal + type: string + item_id: + description: Unique identifier of the output item + title: Item Id + type: string + output_index: + description: Index position of the item in the output list + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.refusal.done + default: response.refusal.done + description: Event type identifier, always "response.refusal.done" + title: Type + type: string + required: + - content_index + - refusal + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseRefusalDone + type: object + OpenAIResponseObjectStreamResponseWebSearchCallCompleted: + description: "Streaming event for completed web search calls.\n\n:param item_id: Unique identifier of the completed web search call\n:param output_index: Index position of the item in the output list\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.web_search_call.completed\"" + properties: + item_id: + description: Unique identifier of the completed web search call + title: Item Id + type: string + output_index: + description: Index position of the item in the output list + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.web_search_call.completed + default: response.web_search_call.completed + description: Event type identifier, always "response.web_search_call.completed" + title: Type + type: string + required: + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseWebSearchCallCompleted + type: object + OpenAIResponseObjectStreamResponseWebSearchCallInProgress: + description: "Streaming event for web search calls in progress.\n\n:param item_id: Unique identifier of the web search call\n:param output_index: Index position of the item in the output list\n:param sequence_number: Sequential number for ordering streaming events\n:param type: Event type identifier, always \"response.web_search_call.in_progress\"" + properties: + item_id: + description: Unique identifier of the web search call + title: Item Id + type: string + output_index: + description: Index position of the item in the output list + title: Output Index + type: integer + sequence_number: + description: Sequential number for ordering streaming events + title: Sequence Number + type: integer + type: + const: response.web_search_call.in_progress + default: response.web_search_call.in_progress + description: Event type identifier, always "response.web_search_call.in_progress" + title: Type + type: string + required: + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseWebSearchCallInProgress + type: object + OpenAIResponseObjectStreamResponseWebSearchCallSearching: + properties: + item_id: + title: Item Id + type: string + output_index: + title: Output Index + type: integer + sequence_number: + title: Sequence Number + type: integer + type: + const: response.web_search_call.searching + default: response.web_search_call.searching + title: Type + type: string + required: + - item_id + - output_index + - sequence_number + title: OpenAIResponseObjectStreamResponseWebSearchCallSearching + type: object + OpenAIResponseObjectWithInput: + $defs: + AllowedToolsFilter: + description: "Filter configuration for restricting which MCP tools can be used.\n\n:param tool_names: (Optional) List of specific tool names that are allowed" + properties: + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + default: + description: List of specific tool names that are allowed + title: Tool Names + title: AllowedToolsFilter + type: object + MCPListToolsTool: + description: "Tool definition returned by MCP list tools operation.\n\n:param input_schema: JSON schema defining the tool's input parameters\n:param name: Name of the tool\n:param description: (Optional) Description of what the tool does" + properties: + input_schema: + additionalProperties: true + description: JSON schema defining the tool's input parameters + title: Input Schema + type: object + name: + description: Name of the tool + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + default: + description: Description of what the tool does + title: Description + required: + - input_schema + - name + title: MCPListToolsTool + type: object + OpenAIResponseAnnotationCitation: + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + properties: + type: + const: url_citation + default: url_citation + description: Annotation type identifier, always "url_citation" + title: Type + type: string + end_index: + description: End position of the citation span in the content + title: End Index + type: integer + start_index: + description: Start position of the citation span in the content + title: Start Index + type: integer + title: + description: Title of the referenced web resource + title: Title + type: string + url: + description: URL of the referenced web resource + title: Url + type: string + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + type: object + OpenAIResponseAnnotationContainerFileCitation: + properties: + type: + const: container_file_citation + default: container_file_citation + title: Type + type: string + container_id: + title: Container Id + type: string + end_index: + title: End Index + type: integer + file_id: + title: File Id + type: string + filename: + title: Filename + type: string + start_index: + title: Start Index + type: integer + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + type: object + OpenAIResponseAnnotationFileCitation: + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + properties: + type: + const: file_citation + default: file_citation + description: Annotation type identifier, always "file_citation" + title: Type + type: string + file_id: + description: Unique identifier of the referenced file + title: File Id + type: string + filename: + description: Name of the referenced file + title: Filename + type: string + index: + description: Position index of the citation within the content + title: Index + type: integer + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + type: object + OpenAIResponseAnnotationFilePath: + properties: + type: + const: file_path + default: file_path + title: Type + type: string + file_id: + title: File Id + type: string + index: + title: Index + type: integer + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + type: object + OpenAIResponseContentPartRefusal: + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + properties: + type: + const: refusal + default: refusal + description: Content part type identifier, always "refusal" + title: Type + type: string + refusal: + description: Refusal text supplied by the model + title: Refusal + type: string + required: + - refusal + title: OpenAIResponseContentPartRefusal + type: object + OpenAIResponseError: + description: "Error details for failed OpenAI response requests.\n\n:param code: Error code identifying the type of failure\n:param message: Human-readable error message describing the failure" + properties: + code: + description: Error code identifying the type of failure + title: Code + type: string + message: + description: Human-readable error message describing the failure + title: Message + type: string + required: + - code + - message + title: OpenAIResponseError + type: object + OpenAIResponseInputFunctionToolCallOutput: + description: This represents the output of a function call that gets passed back to the model. + properties: + call_id: + title: Call Id + type: string + output: + title: Output + type: string + type: + const: function_call_output + default: function_call_output + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + title: Status + required: + - call_id + - output + title: OpenAIResponseInputFunctionToolCallOutput + type: object + OpenAIResponseInputMessageContentFile: + description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + properties: + type: + const: input_file + default: input_file + description: The type of the input item. Always `input_file`. + title: Type + type: string + file_data: + anyOf: + - type: string + - type: 'null' + default: + description: The data of the file to be sent to the model. + title: File Data + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + file_url: + anyOf: + - type: string + - type: 'null' + default: + description: The URL of the file to be sent to the model. + title: File Url + filename: + anyOf: + - type: string + - type: 'null' + default: + description: The name of the file to be sent to the model. + title: Filename + title: OpenAIResponseInputMessageContentFile + type: object + OpenAIResponseInputMessageContentImage: + description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + properties: + detail: + anyOf: + - const: low + type: string + - const: high + type: string + - const: auto + type: string + default: auto + description: Level of detail for image processing, can be "low", "high", or "auto" + title: Detail + type: + const: input_image + default: input_image + description: Content type identifier, always "input_image" + title: Type + type: string + file_id: + anyOf: + - type: string + - type: 'null' + default: + description: The ID of the file to be sent to the model. + title: File Id + image_url: + anyOf: + - type: string + - type: 'null' + default: + description: URL of the image content + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: + description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + properties: + text: + description: The text content of the input message + title: Text + type: string + type: + const: input_text + default: input_text + description: Content type identifier, always "input_text" + title: Type + type: string + required: + - text + title: OpenAIResponseInputMessageContentText + type: object + OpenAIResponseInputToolFileSearch: + description: "File search tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"file_search\"\n:param vector_store_ids: List of vector store identifiers to search within\n:param filters: (Optional) Additional filters to apply to the search\n:param max_num_results: (Optional) Maximum number of search results to return (1-50)\n:param ranking_options: (Optional) Options for ranking and scoring search results" + properties: + type: + const: file_search + default: file_search + description: Tool type identifier, always "file_search" + title: Type + type: string + vector_store_ids: + description: List of vector store identifiers to search within + items: + type: string + title: Vector Store Ids + type: array + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + description: Additional filters to apply to the search + title: Filters + max_num_results: + anyOf: + - maximum: 50 + minimum: 1 + type: integer + - type: 'null' + default: 10 + description: Maximum number of search results to return (1-50) + title: Max Num Results + ranking_options: + anyOf: + - $ref: '#/components/schemas/SearchRankingOptions' + - type: 'null' + default: + description: Options for ranking and scoring search results + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + type: object + OpenAIResponseInputToolFunction: + description: "Function tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"function\"\n:param name: Name of the function that can be called\n:param description: (Optional) Description of what the function does\n:param parameters: (Optional) JSON schema defining the function's parameters\n:param strict: (Optional) Whether to enforce strict parameter validation" + properties: + type: + const: function + default: function + description: Tool type identifier, always "function" + title: Type + type: string + name: + description: Name of the function that can be called + title: Name + type: string + description: + anyOf: + - type: string + - type: 'null' + default: + description: Description of what the function does + title: Description + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + default: + description: JSON schema defining the function's parameters + title: Parameters + strict: + anyOf: + - type: boolean + - type: 'null' + default: + description: Whether to enforce strict parameter validation + title: Strict + required: + - name + title: OpenAIResponseInputToolFunction + type: object + OpenAIResponseInputToolWebSearch: + description: "Web search tool configuration for OpenAI response inputs.\n\n:param type: Web search tool type variant to use\n:param search_context_size: (Optional) Size of search context, must be \"low\", \"medium\", or \"high\"" + properties: + type: + anyOf: + - const: web_search + type: string + - const: web_search_preview + type: string + - const: web_search_preview_2025_03_11 + type: string + default: web_search + description: Web search tool type variant to use + title: Type + search_context_size: + anyOf: + - pattern: ^low|medium|high$ + type: string + - type: 'null' + default: medium + description: Size of search context, must be "low", "medium", or "high" + title: Search Context Size + title: OpenAIResponseInputToolWebSearch + type: object + OpenAIResponseMCPApprovalRequest: + description: A request for human approval of a tool invocation. + properties: + arguments: + title: Arguments + type: string + id: + title: Id + type: string + name: + title: Name + type: string + server_label: + title: Server Label + type: string + type: + const: mcp_approval_request + default: mcp_approval_request + title: Type + type: string + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + type: object + OpenAIResponseMCPApprovalResponse: + description: A response to an MCP approval request. + properties: + approval_request_id: + title: Approval Request Id + type: string + approve: + title: Approve + type: boolean + type: + const: mcp_approval_response + default: mcp_approval_response + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + reason: + anyOf: + - type: string + - type: 'null' + default: + title: Reason + required: + - approval_request_id + - approve + title: OpenAIResponseMCPApprovalResponse + type: object + OpenAIResponseMessage: + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + properties: + content: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: array + - items: + discriminator: + mapping: + output_text: '#/$defs/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/$defs/OpenAIResponseContentPartRefusal' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - const: system + type: string + - const: developer + type: string + - const: user + type: string + - const: assistant + type: string + title: Role + type: + const: message + default: message + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + title: Status + required: + - content + - role + title: OpenAIResponseMessage + type: object + OpenAIResponseOutputMessageContentOutputText: + properties: + text: + title: Text + type: string + type: + const: output_text + default: output_text + title: Type + type: string + annotations: + items: + discriminator: + mapping: + container_file_citation: '#/$defs/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/$defs/OpenAIResponseAnnotationFileCitation' + file_path: '#/$defs/OpenAIResponseAnnotationFilePath' + url_citation: '#/$defs/OpenAIResponseAnnotationCitation' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + title: Annotations + type: array + required: + - text + title: OpenAIResponseOutputMessageContentOutputText + type: object + OpenAIResponseOutputMessageFileSearchToolCall: + description: "File search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param queries: List of search queries executed\n:param status: Current status of the file search operation\n:param type: Tool call type identifier, always \"file_search_call\"\n:param results: (Optional) Search results returned by the file search operation" + properties: + id: + description: Unique identifier for this tool call + title: Id + type: string + queries: + description: List of search queries executed + items: + type: string + title: Queries + type: array + status: + description: Current status of the file search operation + title: Status + type: string + type: + const: file_search_call + default: file_search_call + description: Tool call type identifier, always "file_search_call" + title: Type + type: string + results: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' + type: array + - type: 'null' + default: + description: Search results returned by the file search operation + title: Results + required: + - id + - queries + - status + title: OpenAIResponseOutputMessageFileSearchToolCall + type: object + OpenAIResponseOutputMessageFileSearchToolCallResults: + description: "Search results returned by the file search operation.\n\n:param attributes: (Optional) Key-value attributes associated with the file\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result (between 0 and 1)\n:param text: Text content of the search result" + properties: + attributes: + additionalProperties: true + description: Key-value attributes associated with the file + title: Attributes + type: object + file_id: + description: Unique identifier of the file containing the result + title: File Id + type: string + filename: + description: Name of the file containing the result + title: Filename + type: string + score: + description: Relevance score for this search result (between 0 and 1) + title: Score + type: number + text: + description: Text content of the search result + title: Text + type: string + required: + - attributes + - file_id + - filename + - score + - text + title: OpenAIResponseOutputMessageFileSearchToolCallResults + type: object + OpenAIResponseOutputMessageFunctionToolCall: + description: "Function tool call output message for OpenAI responses.\n\n:param call_id: Unique identifier for the function call\n:param name: Name of the function being called\n:param arguments: JSON string containing the function arguments\n:param type: Tool call type identifier, always \"function_call\"\n:param id: (Optional) Additional identifier for the tool call\n:param status: (Optional) Current status of the function call execution" + properties: + call_id: + description: Unique identifier for the function call + title: Call Id + type: string + name: + description: Name of the function being called + title: Name + type: string + arguments: + description: JSON string containing the function arguments + title: Arguments + type: string + type: + const: function_call + default: function_call + description: Tool call type identifier, always "function_call" + title: Type + type: string + id: + anyOf: + - type: string + - type: 'null' + default: + description: Additional identifier for the tool call + title: Id + status: + anyOf: + - type: string + - type: 'null' + default: + description: Current status of the function call execution + title: Status + required: + - call_id + - name + - arguments + title: OpenAIResponseOutputMessageFunctionToolCall + type: object + OpenAIResponseOutputMessageMCPCall: + description: "Model Context Protocol (MCP) call output message for OpenAI responses.\n\n:param id: Unique identifier for this MCP call\n:param type: Tool call type identifier, always \"mcp_call\"\n:param arguments: JSON string containing the MCP call arguments\n:param name: Name of the MCP method being called\n:param server_label: Label identifying the MCP server handling the call\n:param error: (Optional) Error message if the MCP call failed\n:param output: (Optional) Output result from the successful MCP call" + properties: + id: + description: Unique identifier for this MCP call + title: Id + type: string + type: + const: mcp_call + default: mcp_call + description: Tool call type identifier, always "mcp_call" + title: Type + type: string + arguments: + description: JSON string containing the MCP call arguments + title: Arguments + type: string + name: + description: Name of the MCP method being called + title: Name + type: string + server_label: + description: Label identifying the MCP server handling the call + title: Server Label + type: string + error: + anyOf: + - type: string + - type: 'null' + default: + description: Error message if the MCP call failed + title: Error + output: + anyOf: + - type: string + - type: 'null' + default: + description: Output result from the successful MCP call + title: Output + required: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + type: object + OpenAIResponseOutputMessageMCPListTools: + description: "MCP list tools output message containing available tools from an MCP server.\n\n:param id: Unique identifier for this MCP list tools operation\n:param type: Tool call type identifier, always \"mcp_list_tools\"\n:param server_label: Label identifying the MCP server providing the tools\n:param tools: List of available tools provided by the MCP server" + properties: + id: + description: Unique identifier for this MCP list tools operation + title: Id + type: string + type: + const: mcp_list_tools + default: mcp_list_tools + description: Tool call type identifier, always "mcp_list_tools" + title: Type + type: string + server_label: + description: Label identifying the MCP server providing the tools + title: Server Label + type: string + tools: + description: List of available tools provided by the MCP server + items: + $ref: '#/components/schemas/MCPListToolsTool' + title: Tools + type: array + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + type: object + OpenAIResponseOutputMessageWebSearchToolCall: + description: "Web search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param status: Current status of the web search operation\n:param type: Tool call type identifier, always \"web_search_call\"" + properties: + id: + description: Unique identifier for this tool call + title: Id + type: string + status: + description: Current status of the web search operation + title: Status + type: string + type: + const: web_search_call + default: web_search_call + description: Tool call type identifier, always "web_search_call" + title: Type + type: string + required: + - id + - status + title: OpenAIResponseOutputMessageWebSearchToolCall + type: object + OpenAIResponsePrompt: + description: "OpenAI compatible Prompt object that is used in OpenAI responses.\n\n:param id: Unique identifier of the prompt template\n:param variables: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types\nlike images or files.\n:param version: Version number of the prompt to use (defaults to latest if not specified)" + properties: + id: + description: Unique identifier of the prompt template + title: Id + type: string + variables: + anyOf: + - additionalProperties: + discriminator: + mapping: + input_file: '#/$defs/OpenAIResponseInputMessageContentFile' + input_image: '#/$defs/OpenAIResponseInputMessageContentImage' + input_text: '#/$defs/OpenAIResponseInputMessageContentText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + type: object + - type: 'null' + default: + description: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files. + title: Variables + version: + anyOf: + - type: string + - type: 'null' + default: + description: Version number of the prompt to use (defaults to latest if not specified) + title: Version + required: + - id + title: OpenAIResponsePrompt + type: object + OpenAIResponseText: + description: "Text response configuration for OpenAI responses.\n\n:param format: (Optional) Text format configuration specifying output format requirements" + properties: + format: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseTextFormat' + - type: 'null' + default: + description: Text format configuration specifying output format requirements + title: OpenAIResponseText + type: object + OpenAIResponseTextFormat: + description: "Configuration for Responses API text format.\n\n:param type: Must be \"text\", \"json_schema\", or \"json_object\" to identify the format type\n:param name: The name of the response format. Only used for json_schema.\n:param schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model. Only used for json_schema.\n:param description: (Optional) A description of the response format. Only used for json_schema.\n:param strict: (Optional) Whether to strictly enforce the JSON schema. If true, the response must match the schema exactly. Only used for json_schema." + properties: + type: + anyOf: + - const: text + type: string + - const: json_schema + type: string + - const: json_object + type: string + title: Type + name: + anyOf: + - type: string + - type: 'null' + title: Name + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + title: OpenAIResponseTextFormat + type: object + OpenAIResponseToolMCP: + description: "Model Context Protocol (MCP) tool configuration for OpenAI response object.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + properties: + type: + const: mcp + default: mcp + description: Tool type identifier, always "mcp" + title: Type + type: string + server_label: + description: Label to identify this MCP server + title: Server Label + type: string + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + default: + description: Restriction on which tools can be used from this server + title: Allowed Tools + required: + - server_label + title: OpenAIResponseToolMCP + type: object + OpenAIResponseUsage: + description: "Usage information for OpenAI response.\n\n:param input_tokens: Number of tokens in the input\n:param output_tokens: Number of tokens in the output\n:param total_tokens: Total tokens used (input + output)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + properties: + input_tokens: + description: Number of tokens in the input + title: Input Tokens + type: integer + output_tokens: + description: Number of tokens in the output + title: Output Tokens + type: integer + total_tokens: + description: Total tokens used (input + output) + title: Total Tokens + type: integer + input_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' + - type: 'null' + default: + description: Detailed breakdown of input token usage + output_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + - type: 'null' + default: + description: Detailed breakdown of output token usage + required: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + type: object + OpenAIResponseUsageInputTokensDetails: + description: "Token details for input tokens in OpenAI response usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + properties: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + default: + description: Number of tokens retrieved from cache + title: Cached Tokens + title: OpenAIResponseUsageInputTokensDetails + type: object + OpenAIResponseUsageOutputTokensDetails: + description: "Token details for output tokens in OpenAI response usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + default: + description: Number of tokens used for reasoning (o1/o3 models) + title: Reasoning Tokens + title: OpenAIResponseUsageOutputTokensDetails + type: object + SearchRankingOptions: + description: Options for ranking and filtering search results. + properties: + ranker: + anyOf: + - type: string + - type: 'null' + default: + title: Ranker + score_threshold: + anyOf: + - type: number + - type: 'null' + default: 0.0 + title: Score Threshold + title: SearchRankingOptions + type: object + description: "OpenAI response object extended with input context information.\n\n:param input: List of input items that led to this response" + properties: + created_at: + description: Unix timestamp when the response was created + title: Created At + type: integer + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + default: + description: Error details if the response generation failed + id: + description: Unique identifier for this response + title: Id + type: string + model: + description: Model identifier used for generation + title: Model + type: string + object: + const: response + default: response + description: Object type identifier, always "response" + title: Object + type: string + output: + description: List of generated output items (messages, tool calls, etc.) + items: + discriminator: + mapping: + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + title: Output + type: array + parallel_tool_calls: + default: false + description: Whether tool calls can be executed in parallel + title: Parallel Tool Calls + type: boolean + previous_response_id: + anyOf: + - type: string + - type: 'null' + default: + description: ID of the previous response in a conversation + title: Previous Response Id + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + default: + description: Reference to a prompt template and its variables. + status: + description: Current status of the response generation + title: Status + type: string + temperature: + anyOf: + - type: number + - type: 'null' + default: + description: Sampling temperature used for generation + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + description: Text formatting configuration for the response + top_p: + anyOf: + - type: number + - type: 'null' + default: + description: Nucleus sampling parameter used for generation + title: Top P + tools: + anyOf: + - items: + discriminator: + mapping: + file_search: '#/$defs/OpenAIResponseInputToolFileSearch' + function: '#/$defs/OpenAIResponseInputToolFunction' + mcp: '#/$defs/OpenAIResponseToolMCP' + web_search: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + type: array + - type: 'null' + default: + description: An array of tools the model may call while generating a response. + title: Tools + truncation: + anyOf: + - type: string + - type: 'null' + default: + description: Truncation strategy applied to the response + title: Truncation + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + default: + description: Token usage information for the response + instructions: + anyOf: + - type: string + - type: 'null' + default: + description: System message inserted into the model's context + title: Instructions + input: + description: List of input items that led to this response + items: + anyOf: + - discriminator: + mapping: + file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' + message: '#/$defs/OpenAIResponseMessage' + web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage' + title: Input + type: array + required: + - created_at + - id + - model + - output + - status + - input + title: OpenAIResponseObjectWithInput + type: object + ImageContentItem: + $defs: + URL: + description: A URL reference to external content. + properties: + uri: + title: Uri + type: string + required: + - uri + title: URL + type: object + _URLOrData: + description: A URL or a base64 encoded string. + properties: + url: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + default: + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + default: + title: Data + title: _URLOrData + type: object + description: A image content item. + properties: + type: + const: image + default: image + title: Type + type: string + image: + $ref: '#/components/schemas/_URLOrData' + required: + - image + title: ImageContentItem + type: object + ImageDelta: + description: An image content delta for streaming responses. + properties: + type: + const: image + default: image + title: Type + type: string + image: + format: binary + title: Image + type: string + required: + - image + title: ImageDelta + type: object + TextDelta: + description: A text content delta for streaming responses. + properties: + type: + const: text + default: text + title: Type + type: string + text: + title: Text + type: string + required: + - text + title: TextDelta + type: object + ToolCallDelta: + $defs: + BuiltinTool: + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + type: string + ToolCall: + properties: + call_id: + title: Call Id + type: string + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + title: Arguments + type: string + required: + - call_id + - tool_name + - arguments + title: ToolCall + type: object + ToolCallParseStatus: + description: Status of tool call parsing during streaming. + enum: + - started + - in_progress + - failed + - succeeded + title: ToolCallParseStatus + type: string + description: A tool call content delta for streaming responses. + properties: + type: + const: tool_call + default: tool_call + title: Type + type: string + tool_call: + anyOf: + - type: string + - $ref: '#/components/schemas/ToolCall' + title: Tool Call + parse_status: + $ref: '#/components/schemas/ToolCallParseStatus' + required: + - tool_call + - parse_status + title: ToolCallDelta + type: object + DialogType: + description: "Parameter type for dialog data with semantic output labels.\n\n:param type: Discriminator type. Always \"dialog\"" + properties: + type: + const: dialog + default: dialog + title: Type + type: string + title: DialogType + type: object diff --git a/docs/static/experimental-llama-stack-spec.json b/docs/static/experimental-llama-stack-spec.json deleted file mode 100644 index cf426d9682..0000000000 --- a/docs/static/experimental-llama-stack-spec.json +++ /dev/null @@ -1,5135 +0,0 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "Llama Stack API", - "description": "A comprehensive API for building and deploying AI applications", - "version": "1.0.0" - }, - "servers": [ - { - "url": "https://api.llamastack.com", - "description": "Production server" - }, - { - "url": "https://staging-api.llamastack.com", - "description": "Staging server" - } - ], - "paths": { - "/v1beta/datasetio/append-rows/{dataset_id}": { - "post": { - "tags": [ - "V1Beta" - ], - "summary": "Append rows to a dataset.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "append_rows_v1beta_datasetio_append_rows__dataset_id__post", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "dataset_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Path parameter: dataset_id" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1beta/datasetio/iterrows/{dataset_id}": { - "get": { - "tags": [ - "V1Beta" - ], - "summary": "Get a paginated list of rows from a dataset.", - "description": "Query endpoint for proper schema generation.", - "operationId": "iterrows_v1beta_datasetio_iterrows__dataset_id__get", - "parameters": [ - { - "name": "limit", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Limit" - } - }, - { - "name": "start_index", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Start Index" - } - }, - { - "name": "dataset_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Dataset Id" - } - } - ], - "responses": { - "200": { - "description": "A PaginatedResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaginatedResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1beta/datasets": { - "get": { - "tags": [ - "V1Beta" - ], - "summary": "List all datasets.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_datasets_v1beta_datasets_get", - "responses": { - "200": { - "description": "A ListDatasetsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListDatasetsResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - }, - "post": { - "tags": [ - "V1Beta" - ], - "summary": "Register a new dataset.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "register_dataset_v1beta_datasets_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/__main_____datasets_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A Dataset.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Dataset" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1beta/datasets/{dataset_id}": { - "delete": { - "tags": [ - "V1Beta" - ], - "summary": "Unregister a dataset by its ID.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "unregister_dataset_v1beta_datasets__dataset_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "dataset_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Path parameter: dataset_id" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1Beta" - ], - "summary": "Get a dataset by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_dataset_v1beta_datasets__dataset_id__get", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Dataset Id" - } - } - ], - "responses": { - "200": { - "description": "A Dataset.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Dataset" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/agents": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "List all agents.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_agents_v1alpha_agents_get", - "parameters": [ - { - "name": "limit", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Limit" - } - }, - { - "name": "start_index", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Start Index" - } - } - ], - "responses": { - "200": { - "description": "A PaginatedResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaginatedResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Create an agent with the given configuration.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_agent_v1alpha_agents_post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentConfig" - } - } - } - }, - "responses": { - "200": { - "description": "An AgentCreateResponse with the agent ID.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentCreateResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/agents/{agent_id}": { - "delete": { - "tags": [ - "V1Alpha" - ], - "summary": "Delete an agent by its ID and its associated sessions and turns.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "delete_agent_v1alpha_agents__agent_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the agent to delete." - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Describe an agent by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_agent_v1alpha_agents__agent_id__get", - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Agent Id" - }, - "description": "ID of the agent." - } - ], - "responses": { - "200": { - "description": "An Agent of the agent.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Agent" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/agents/{agent_id}/session": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Create a new session for an agent.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_agent_session_v1alpha_agents__agent_id__session_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/__main_____agents_agent_id_session_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "An AgentSessionCreateResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSessionCreateResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the agent to create the session for." - } - ] - } - }, - "/v1alpha/agents/{agent_id}/session/{session_id}": { - "delete": { - "tags": [ - "V1Alpha" - ], - "summary": "Delete an agent session by its ID and its associated turns.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "delete_agents_session_v1alpha_agents__agent_id__session__session_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the session to delete." - }, - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the agent to delete the session for." - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Retrieve an agent session by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_agents_session_v1alpha_agents__agent_id__session__session_id__get", - "parameters": [ - { - "name": "turn_ids", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Turn Ids" - } - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Session Id" - }, - "description": "The ID of the session to get." - }, - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Agent Id" - }, - "description": "The ID of the agent to get the session for." - } - ], - "responses": { - "200": { - "description": "A Session.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Session" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/agents/{agent_id}/session/{session_id}/turn": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Create a new turn for an agent.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/__main_____agents_agent_id_session_session_id_turn_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "If stream=False, returns a Turn object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Turn" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the agent to create the turn for." - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the session to create the turn for." - } - ] - } - }, - "/v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Retrieve an agent turn by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_agents_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__get", - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Agent Id" - }, - "description": "The ID of the agent to get the turn for." - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Session Id" - }, - "description": "The ID of the session to get the turn for." - }, - { - "name": "turn_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Turn Id" - }, - "description": "The ID of the turn to get." - } - ], - "responses": { - "200": { - "description": "A Turn.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Turn" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Resume an agent turn with executed tool call responses.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "resume_agent_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__resume_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A Turn object if stream is False, otherwise an AsyncIterator of AgentTurnResponseStreamChunk objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Turn" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the agent to resume." - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the session to resume." - }, - { - "name": "turn_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the turn to resume." - } - ] - } - }, - "/v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Retrieve an agent step by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_agents_step_v1alpha_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get", - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Agent Id" - }, - "description": "The ID of the agent to get the step for." - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Session Id" - }, - "description": "The ID of the session to get the step for." - }, - { - "name": "turn_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Turn Id" - }, - "description": "The ID of the turn to get the step for." - }, - { - "name": "step_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Step Id" - }, - "description": "The ID of the step to get." - } - ], - "responses": { - "200": { - "description": "An AgentStepResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentStepResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/agents/{agent_id}/sessions": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "List all session(s) of a given agent.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_agent_sessions_v1alpha_agents__agent_id__sessions_get", - "parameters": [ - { - "name": "limit", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Limit" - } - }, - { - "name": "start_index", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Start Index" - } - }, - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Agent Id" - }, - "description": "The ID of the agent to list sessions for." - } - ], - "responses": { - "200": { - "description": "A PaginatedResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaginatedResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/eval/benchmarks": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "List all benchmarks.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_benchmarks_v1alpha_eval_benchmarks_get", - "responses": { - "200": { - "description": "A ListBenchmarksResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListBenchmarksResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Register a benchmark.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "register_benchmark_v1alpha_eval_benchmarks_post", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/eval/benchmarks/{benchmark_id}": { - "delete": { - "tags": [ - "V1Alpha" - ], - "summary": "Unregister a benchmark.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "unregister_benchmark_v1alpha_eval_benchmarks__benchmark_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the benchmark to unregister." - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Get a benchmark by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_benchmark_v1alpha_eval_benchmarks__benchmark_id__get", - "parameters": [ - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Benchmark Id" - }, - "description": "The ID of the benchmark to get." - } - ], - "responses": { - "200": { - "description": "A Benchmark.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Benchmark" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/eval/benchmarks/{benchmark_id}/evaluations": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Evaluate a list of rows on a benchmark.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "evaluate_rows_v1alpha_eval_benchmarks__benchmark_id__evaluations_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BenchmarkConfig" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "EvaluateResponse object containing generations and scores.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluateResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the benchmark to run the evaluation on." - } - ] - } - }, - "/v1alpha/eval/benchmarks/{benchmark_id}/jobs": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Run an evaluation on a benchmark.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "run_eval_v1alpha_eval_benchmarks__benchmark_id__jobs_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BenchmarkConfig" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "The job that was created to run the evaluation.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Job" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the benchmark to run the evaluation on." - } - ] - } - }, - "/v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}": { - "delete": { - "tags": [ - "V1Alpha" - ], - "summary": "Cancel a job.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "job_cancel_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the benchmark to run the evaluation on." - }, - { - "name": "job_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the job to cancel." - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Get the status of a job.", - "description": "Query endpoint for proper schema generation.", - "operationId": "job_status_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__get", - "parameters": [ - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Benchmark Id" - }, - "description": "The ID of the benchmark to run the evaluation on." - }, - { - "name": "job_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Job Id" - }, - "description": "The ID of the job to get the status of." - } - ], - "responses": { - "200": { - "description": "The status of the evaluation job.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Job" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Get the result of a job.", - "description": "Query endpoint for proper schema generation.", - "operationId": "job_result_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__result_get", - "parameters": [ - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Benchmark Id" - }, - "description": "The ID of the benchmark to run the evaluation on." - }, - { - "name": "job_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Job Id" - }, - "description": "The ID of the job to get the result of." - } - ], - "responses": { - "200": { - "description": "The result of the job.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluateResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/inference/rerank": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Rerank a list of documents based on their relevance to a query.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "rerank_v1alpha_inference_rerank_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_inference_rerank_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "RerankResponse with indices sorted by relevance score (descending).", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RerankResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1alpha/post-training/job/artifacts": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Get the artifacts of a training job.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_training_job_artifacts_v1alpha_post_training_job_artifacts_get", - "parameters": [ - { - "name": "job_uuid", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Job Uuid" - } - } - ], - "responses": { - "200": { - "description": "A PostTrainingJobArtifactsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostTrainingJobArtifactsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/post-training/job/cancel": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Cancel a training job.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "cancel_training_job_v1alpha_post_training_job_cancel_post", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/post-training/job/status": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Get the status of a training job.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_training_job_status_v1alpha_post_training_job_status_get", - "parameters": [ - { - "name": "job_uuid", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Job Uuid" - } - } - ], - "responses": { - "200": { - "description": "A PostTrainingJobStatusResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostTrainingJobStatusResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/post-training/jobs": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Get all training jobs.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "get_training_jobs_v1alpha_post_training_jobs_get", - "responses": { - "200": { - "description": "A ListPostTrainingJobsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListPostTrainingJobsResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1alpha/post-training/preference-optimize": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Run preference optimization of a model.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "preference_optimize_v1alpha_post_training_preference_optimize_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DPOAlignmentConfig" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A PostTrainingJob.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostTrainingJob" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1alpha/post-training/supervised-fine-tune": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Run supervised fine-tuning of a model.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "supervised_fine_tune_v1alpha_post_training_supervised_fine_tune_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TrainingConfig" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A PostTrainingJob.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostTrainingJob" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - } - }, - "components": { - "schemas": { - "AgentCandidate": { - "properties": { - "type": { - "type": "string", - "const": "agent", - "title": "Type", - "default": "agent" - }, - "config": { - "$ref": "#/components/schemas/AgentConfig" - } - }, - "type": "object", - "required": [ - "config" - ], - "title": "AgentCandidate", - "description": "An agent candidate for evaluation." - }, - "AgentConfig": { - "properties": { - "sampling_params": { - "$ref": "#/components/schemas/SamplingParams" - }, - "input_shields": { - "title": "Input Shields", - "items": { - "type": "string" - }, - "type": "array" - }, - "output_shields": { - "title": "Output Shields", - "items": { - "type": "string" - }, - "type": "array" - }, - "toolgroups": { - "title": "Toolgroups", - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/AgentToolGroupWithArgs" - } - ] - }, - "type": "array" - }, - "client_tools": { - "title": "Client Tools", - "items": { - "$ref": "#/components/schemas/ToolDef" - }, - "type": "array" - }, - "tool_choice": { - "deprecated": true, - "$ref": "#/components/schemas/ToolChoice" - }, - "tool_prompt_format": { - "deprecated": true, - "$ref": "#/components/schemas/ToolPromptFormat" - }, - "tool_config": { - "$ref": "#/components/schemas/ToolConfig" - }, - "max_infer_iters": { - "title": "Max Infer Iters", - "default": 10, - "type": "integer" - }, - "model": { - "type": "string", - "title": "Model" - }, - "instructions": { - "type": "string", - "title": "Instructions" - }, - "name": { - "title": "Name", - "type": "string" - }, - "enable_session_persistence": { - "title": "Enable Session Persistence", - "default": false, - "type": "boolean" - }, - "response_format": { - "title": "Response Format", - "oneOf": [ - { - "$ref": "#/components/schemas/JsonSchemaResponseFormat" - }, - { - "$ref": "#/components/schemas/GrammarResponseFormat" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "grammar": "#/components/schemas/GrammarResponseFormat", - "json_schema": "#/components/schemas/JsonSchemaResponseFormat" - } - } - } - }, - "type": "object", - "required": [ - "model", - "instructions" - ], - "title": "AgentConfig", - "description": "Configuration for an agent." - }, - "AgentCreateResponse": { - "properties": { - "agent_id": { - "type": "string", - "title": "Agent Id" - } - }, - "type": "object", - "required": [ - "agent_id" - ], - "title": "AgentCreateResponse", - "description": "Response returned when creating a new agent." - }, - "AgentSessionCreateResponse": { - "properties": { - "session_id": { - "type": "string", - "title": "Session Id" - } - }, - "type": "object", - "required": [ - "session_id" - ], - "title": "AgentSessionCreateResponse", - "description": "Response returned when creating a new agent session." - }, - "AgentToolGroupWithArgs": { - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "args": { - "additionalProperties": true, - "type": "object", - "title": "Args" - } - }, - "type": "object", - "required": [ - "name", - "args" - ], - "title": "AgentToolGroupWithArgs" - }, - "AggregationFunctionType": { - "type": "string", - "enum": [ - "average", - "weighted_average", - "median", - "categorical_count", - "accuracy" - ], - "title": "AggregationFunctionType", - "description": "Types of aggregation functions for scoring results." - }, - "Attachment-Output": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - }, - { - "$ref": "#/components/schemas/URL" - } - ], - "title": "Content" - }, - "mime_type": { - "type": "string", - "title": "Mime Type" - } - }, - "type": "object", - "required": [ - "content", - "mime_type" - ], - "title": "Attachment", - "description": "An attachment to an agent turn." - }, - "BasicScoringFnParams": { - "properties": { - "type": { - "type": "string", - "const": "basic", - "title": "Type", - "default": "basic" - }, - "aggregation_functions": { - "items": { - "$ref": "#/components/schemas/AggregationFunctionType" - }, - "type": "array", - "title": "Aggregation Functions", - "description": "Aggregation functions to apply to the scores of each row" - } - }, - "type": "object", - "title": "BasicScoringFnParams", - "description": "Parameters for basic scoring function configuration." - }, - "Benchmark": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "benchmark", - "title": "Type", - "default": "benchmark" - }, - "dataset_id": { - "type": "string", - "title": "Dataset Id" - }, - "scoring_functions": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Scoring Functions" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata", - "description": "Metadata for this evaluation task" - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id", - "dataset_id", - "scoring_functions" - ], - "title": "Benchmark", - "description": "A benchmark resource for evaluating model performance." - }, - "BenchmarkConfig": { - "properties": { - "eval_candidate": { - "oneOf": [ - { - "$ref": "#/components/schemas/ModelCandidate" - }, - { - "$ref": "#/components/schemas/AgentCandidate" - } - ], - "title": "Eval Candidate", - "discriminator": { - "propertyName": "type", - "mapping": { - "agent": "#/components/schemas/AgentCandidate", - "model": "#/components/schemas/ModelCandidate" - } - } - }, - "scoring_params": { - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" - }, - { - "$ref": "#/components/schemas/RegexParserScoringFnParams" - }, - { - "$ref": "#/components/schemas/BasicScoringFnParams" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "basic": "#/components/schemas/BasicScoringFnParams", - "llm_as_judge": "#/components/schemas/LLMAsJudgeScoringFnParams", - "regex_parser": "#/components/schemas/RegexParserScoringFnParams" - } - } - }, - "type": "object", - "title": "Scoring Params", - "description": "Map between scoring function id and parameters for each scoring function you want to run" - }, - "num_examples": { - "title": "Num Examples", - "description": "Number of examples to evaluate (useful for testing), if not provided, all examples in the dataset will be evaluated", - "type": "integer" - } - }, - "type": "object", - "required": [ - "eval_candidate" - ], - "title": "BenchmarkConfig", - "description": "A benchmark configuration for evaluation." - }, - "BuiltinTool": { - "type": "string", - "enum": [ - "brave_search", - "wolfram_alpha", - "photogen", - "code_interpreter" - ], - "title": "BuiltinTool" - }, - "CompletionMessage-Output": { - "properties": { - "role": { - "type": "string", - "const": "assistant", - "title": "Role", - "default": "assistant" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "stop_reason": { - "$ref": "#/components/schemas/StopReason" - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/ToolCall" - }, - "type": "array" - } - }, - "type": "object", - "required": [ - "content", - "stop_reason" - ], - "title": "CompletionMessage", - "description": "A message containing the model's (assistant) response in a chat conversation." - }, - "DPOAlignmentConfig": { - "properties": { - "beta": { - "type": "number", - "title": "Beta" - }, - "loss_type": { - "$ref": "#/components/schemas/DPOLossType", - "default": "sigmoid" - } - }, - "type": "object", - "required": [ - "beta" - ], - "title": "DPOAlignmentConfig", - "description": "Configuration for Direct Preference Optimization (DPO) alignment." - }, - "DPOLossType": { - "type": "string", - "enum": [ - "sigmoid", - "hinge", - "ipo", - "kto_pair" - ], - "title": "DPOLossType" - }, - "DataConfig": { - "properties": { - "dataset_id": { - "type": "string", - "title": "Dataset Id" - }, - "batch_size": { - "type": "integer", - "title": "Batch Size" - }, - "shuffle": { - "type": "boolean", - "title": "Shuffle" - }, - "data_format": { - "$ref": "#/components/schemas/DatasetFormat" - }, - "validation_dataset_id": { - "title": "Validation Dataset Id", - "type": "string" - }, - "packed": { - "title": "Packed", - "default": false, - "type": "boolean" - }, - "train_on_input": { - "title": "Train On Input", - "default": false, - "type": "boolean" - } - }, - "type": "object", - "required": [ - "dataset_id", - "batch_size", - "shuffle", - "data_format" - ], - "title": "DataConfig", - "description": "Configuration for training data and data loading." - }, - "Dataset": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "dataset", - "title": "Type", - "default": "dataset" - }, - "purpose": { - "$ref": "#/components/schemas/DatasetPurpose" - }, - "source": { - "oneOf": [ - { - "$ref": "#/components/schemas/URIDataSource" - }, - { - "$ref": "#/components/schemas/RowsDataSource" - } - ], - "title": "Source", - "discriminator": { - "propertyName": "type", - "mapping": { - "rows": "#/components/schemas/RowsDataSource", - "uri": "#/components/schemas/URIDataSource" - } - } - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata", - "description": "Any additional metadata for this dataset" - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id", - "purpose", - "source" - ], - "title": "Dataset", - "description": "Dataset resource for storing and accessing training or evaluation data." - }, - "DatasetFormat": { - "type": "string", - "enum": [ - "instruct", - "dialog" - ], - "title": "DatasetFormat", - "description": "Format of the training dataset." - }, - "DatasetPurpose": { - "type": "string", - "enum": [ - "post-training/messages", - "eval/question-answer", - "eval/messages-answer" - ], - "title": "DatasetPurpose", - "description": "Purpose of the dataset. Each purpose has a required input data schema." - }, - "Document": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - }, - { - "$ref": "#/components/schemas/URL" - } - ], - "title": "Content" - }, - "mime_type": { - "type": "string", - "title": "Mime Type" - } - }, - "type": "object", - "required": [ - "content", - "mime_type" - ], - "title": "Document", - "description": "A document to be used by an agent." - }, - "EfficiencyConfig": { - "properties": { - "enable_activation_checkpointing": { - "title": "Enable Activation Checkpointing", - "default": false, - "type": "boolean" - }, - "enable_activation_offloading": { - "title": "Enable Activation Offloading", - "default": false, - "type": "boolean" - }, - "memory_efficient_fsdp_wrap": { - "title": "Memory Efficient Fsdp Wrap", - "default": false, - "type": "boolean" - }, - "fsdp_cpu_offload": { - "title": "Fsdp Cpu Offload", - "default": false, - "type": "boolean" - } - }, - "type": "object", - "title": "EfficiencyConfig", - "description": "Configuration for memory and compute efficiency optimizations." - }, - "EvaluateResponse": { - "properties": { - "generations": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Generations" - }, - "scores": { - "additionalProperties": { - "$ref": "#/components/schemas/ScoringResult" - }, - "type": "object", - "title": "Scores" - } - }, - "type": "object", - "required": [ - "generations", - "scores" - ], - "title": "EvaluateResponse", - "description": "The response from an evaluation." - }, - "GrammarResponseFormat": { - "properties": { - "type": { - "type": "string", - "const": "grammar", - "title": "Type", - "default": "grammar" - }, - "bnf": { - "additionalProperties": true, - "type": "object", - "title": "Bnf" - } - }, - "type": "object", - "required": [ - "bnf" - ], - "title": "GrammarResponseFormat", - "description": "Configuration for grammar-guided response generation." - }, - "GreedySamplingStrategy": { - "properties": { - "type": { - "type": "string", - "const": "greedy", - "title": "Type", - "default": "greedy" - } - }, - "type": "object", - "title": "GreedySamplingStrategy", - "description": "Greedy sampling strategy that selects the highest probability token at each step." - }, - "ImageContentItem-Input": { - "properties": { - "type": { - "type": "string", - "const": "image", - "title": "Type", - "default": "image" - }, - "image": { - "$ref": "#/components/schemas/_URLOrData" - } - }, - "type": "object", - "required": [ - "image" - ], - "title": "ImageContentItem", - "description": "A image content item" - }, - "ImageContentItem-Output": { - "properties": { - "type": { - "type": "string", - "const": "image", - "title": "Type", - "default": "image" - }, - "image": { - "$ref": "#/components/schemas/_URLOrData" - } - }, - "type": "object", - "required": [ - "image" - ], - "title": "ImageContentItem", - "description": "A image content item" - }, - "InferenceStep-Output": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "step_id": { - "type": "string", - "title": "Step Id" - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - }, - "step_type": { - "type": "string", - "const": "inference", - "title": "Step Type", - "default": "inference" - }, - "model_response": { - "$ref": "#/components/schemas/CompletionMessage-Output" - } - }, - "type": "object", - "required": [ - "turn_id", - "step_id", - "model_response" - ], - "title": "InferenceStep", - "description": "An inference step in an agent turn." - }, - "Job": { - "properties": { - "job_id": { - "type": "string", - "title": "Job Id" - }, - "status": { - "$ref": "#/components/schemas/JobStatus" - } - }, - "type": "object", - "required": [ - "job_id", - "status" - ], - "title": "Job", - "description": "A job execution instance with status tracking." - }, - "JobStatus": { - "type": "string", - "enum": [ - "completed", - "in_progress", - "failed", - "scheduled", - "cancelled" - ], - "title": "JobStatus", - "description": "Status of a job execution." - }, - "JsonSchemaResponseFormat": { - "properties": { - "type": { - "type": "string", - "const": "json_schema", - "title": "Type", - "default": "json_schema" - }, - "json_schema": { - "additionalProperties": true, - "type": "object", - "title": "Json Schema" - } - }, - "type": "object", - "required": [ - "json_schema" - ], - "title": "JsonSchemaResponseFormat", - "description": "Configuration for JSON schema-guided response generation." - }, - "LLMAsJudgeScoringFnParams": { - "properties": { - "type": { - "type": "string", - "const": "llm_as_judge", - "title": "Type", - "default": "llm_as_judge" - }, - "judge_model": { - "type": "string", - "title": "Judge Model" - }, - "prompt_template": { - "title": "Prompt Template", - "type": "string" - }, - "judge_score_regexes": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Judge Score Regexes", - "description": "Regexes to extract the answer from generated response" - }, - "aggregation_functions": { - "items": { - "$ref": "#/components/schemas/AggregationFunctionType" - }, - "type": "array", - "title": "Aggregation Functions", - "description": "Aggregation functions to apply to the scores of each row" - } - }, - "type": "object", - "required": [ - "judge_model" - ], - "title": "LLMAsJudgeScoringFnParams", - "description": "Parameters for LLM-as-judge scoring function configuration." - }, - "ListBenchmarksResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Benchmark" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListBenchmarksResponse" - }, - "ListDatasetsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Dataset" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListDatasetsResponse", - "description": "Response from listing datasets." - }, - "ListPostTrainingJobsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/PostTrainingJob" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListPostTrainingJobsResponse" - }, - "MemoryRetrievalStep-Output": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "step_id": { - "type": "string", - "title": "Step Id" - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - }, - "step_type": { - "type": "string", - "const": "memory_retrieval", - "title": "Step Type", - "default": "memory_retrieval" - }, - "vector_store_ids": { - "type": "string", - "title": "Vector Store Ids" - }, - "inserted_context": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Inserted Context" - } - }, - "type": "object", - "required": [ - "turn_id", - "step_id", - "vector_store_ids", - "inserted_context" - ], - "title": "MemoryRetrievalStep", - "description": "A memory retrieval step in an agent turn." - }, - "ModelCandidate": { - "properties": { - "type": { - "type": "string", - "const": "model", - "title": "Type", - "default": "model" - }, - "model": { - "type": "string", - "title": "Model" - }, - "sampling_params": { - "$ref": "#/components/schemas/SamplingParams" - }, - "system_message": { - "$ref": "#/components/schemas/SystemMessage" - } - }, - "type": "object", - "required": [ - "model", - "sampling_params" - ], - "title": "ModelCandidate", - "description": "A model candidate for evaluation." - }, - "OptimizerConfig": { - "properties": { - "optimizer_type": { - "$ref": "#/components/schemas/OptimizerType" - }, - "lr": { - "type": "number", - "title": "Lr" - }, - "weight_decay": { - "type": "number", - "title": "Weight Decay" - }, - "num_warmup_steps": { - "type": "integer", - "title": "Num Warmup Steps" - } - }, - "type": "object", - "required": [ - "optimizer_type", - "lr", - "weight_decay", - "num_warmup_steps" - ], - "title": "OptimizerConfig", - "description": "Configuration parameters for the optimization algorithm." - }, - "OptimizerType": { - "type": "string", - "enum": [ - "adam", - "adamw", - "sgd" - ], - "title": "OptimizerType", - "description": "Available optimizer algorithms for training." - }, - "PostTrainingJob": { - "properties": { - "job_uuid": { - "type": "string", - "title": "Job Uuid" - } - }, - "type": "object", - "required": [ - "job_uuid" - ], - "title": "PostTrainingJob" - }, - "RegexParserScoringFnParams": { - "properties": { - "type": { - "type": "string", - "const": "regex_parser", - "title": "Type", - "default": "regex_parser" - }, - "parsing_regexes": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Parsing Regexes", - "description": "Regex to extract the answer from generated response" - }, - "aggregation_functions": { - "items": { - "$ref": "#/components/schemas/AggregationFunctionType" - }, - "type": "array", - "title": "Aggregation Functions", - "description": "Aggregation functions to apply to the scores of each row" - } - }, - "type": "object", - "title": "RegexParserScoringFnParams", - "description": "Parameters for regex parser scoring function configuration." - }, - "RerankData": { - "properties": { - "index": { - "type": "integer", - "title": "Index" - }, - "relevance_score": { - "type": "number", - "title": "Relevance Score" - } - }, - "type": "object", - "required": [ - "index", - "relevance_score" - ], - "title": "RerankData", - "description": "A single rerank result from a reranking response." - }, - "RerankResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/RerankData" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "RerankResponse", - "description": "Response from a reranking request." - }, - "RowsDataSource": { - "properties": { - "type": { - "type": "string", - "const": "rows", - "title": "Type", - "default": "rows" - }, - "rows": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Rows" - } - }, - "type": "object", - "required": [ - "rows" - ], - "title": "RowsDataSource", - "description": "A dataset stored in rows." - }, - "SafetyViolation": { - "properties": { - "violation_level": { - "$ref": "#/components/schemas/ViolationLevel" - }, - "user_message": { - "title": "User Message", - "type": "string" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "violation_level" - ], - "title": "SafetyViolation", - "description": "Details of a safety violation detected by content moderation." - }, - "SamplingParams": { - "properties": { - "strategy": { - "oneOf": [ - { - "$ref": "#/components/schemas/GreedySamplingStrategy" - }, - { - "$ref": "#/components/schemas/TopPSamplingStrategy" - }, - { - "$ref": "#/components/schemas/TopKSamplingStrategy" - } - ], - "title": "Strategy", - "discriminator": { - "propertyName": "type", - "mapping": { - "greedy": "#/components/schemas/GreedySamplingStrategy", - "top_k": "#/components/schemas/TopKSamplingStrategy", - "top_p": "#/components/schemas/TopPSamplingStrategy" - } - } - }, - "max_tokens": { - "title": "Max Tokens", - "type": "integer" - }, - "repetition_penalty": { - "title": "Repetition Penalty", - "default": 1.0, - "type": "number" - }, - "stop": { - "title": "Stop", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object", - "title": "SamplingParams", - "description": "Sampling parameters." - }, - "ScoringResult": { - "properties": { - "score_rows": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Score Rows" - }, - "aggregated_results": { - "additionalProperties": true, - "type": "object", - "title": "Aggregated Results" - } - }, - "type": "object", - "required": [ - "score_rows", - "aggregated_results" - ], - "title": "ScoringResult", - "description": "A scoring result for a single row." - }, - "ShieldCallStep-Output": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "step_id": { - "type": "string", - "title": "Step Id" - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - }, - "step_type": { - "type": "string", - "const": "shield_call", - "title": "Step Type", - "default": "shield_call" - }, - "violation": { - "$ref": "#/components/schemas/SafetyViolation" - } - }, - "type": "object", - "required": [ - "turn_id", - "step_id", - "violation" - ], - "title": "ShieldCallStep", - "description": "A shield call step in an agent turn." - }, - "StopReason": { - "type": "string", - "enum": [ - "end_of_turn", - "end_of_message", - "out_of_tokens" - ], - "title": "StopReason" - }, - "SystemMessage": { - "properties": { - "role": { - "type": "string", - "const": "system", - "title": "Role", - "default": "system" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "SystemMessage", - "description": "A system message providing instructions or context to the model." - }, - "SystemMessageBehavior": { - "type": "string", - "enum": [ - "append", - "replace" - ], - "title": "SystemMessageBehavior", - "description": "Config for how to override the default system prompt." - }, - "TextContentItem": { - "properties": { - "type": { - "type": "string", - "const": "text", - "title": "Type", - "default": "text" - }, - "text": { - "type": "string", - "title": "Text" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "TextContentItem", - "description": "A text content item" - }, - "ToolCall": { - "properties": { - "call_id": { - "type": "string", - "title": "Call Id" - }, - "tool_name": { - "anyOf": [ - { - "$ref": "#/components/schemas/BuiltinTool" - }, - { - "type": "string" - } - ], - "title": "Tool Name" - }, - "arguments": { - "type": "string", - "title": "Arguments" - } - }, - "type": "object", - "required": [ - "call_id", - "tool_name", - "arguments" - ], - "title": "ToolCall" - }, - "ToolChoice": { - "type": "string", - "enum": [ - "auto", - "required", - "none" - ], - "title": "ToolChoice", - "description": "Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model." - }, - "ToolConfig": { - "properties": { - "tool_choice": { - "anyOf": [ - { - "$ref": "#/components/schemas/ToolChoice" - }, - { - "type": "string" - } - ], - "title": "Tool Choice", - "default": "auto" - }, - "tool_prompt_format": { - "$ref": "#/components/schemas/ToolPromptFormat" - }, - "system_message_behavior": { - "default": "append", - "$ref": "#/components/schemas/SystemMessageBehavior" - } - }, - "type": "object", - "title": "ToolConfig", - "description": "Configuration for tool use." - }, - "ToolDef": { - "properties": { - "toolgroup_id": { - "title": "Toolgroup Id", - "type": "string" - }, - "name": { - "type": "string", - "title": "Name" - }, - "description": { - "title": "Description", - "type": "string" - }, - "input_schema": { - "title": "Input Schema", - "additionalProperties": true, - "type": "object" - }, - "output_schema": { - "title": "Output Schema", - "additionalProperties": true, - "type": "object" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "required": [ - "name" - ], - "title": "ToolDef", - "description": "Tool definition used in runtime contexts." - }, - "ToolExecutionStep-Output": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "step_id": { - "type": "string", - "title": "Step Id" - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - }, - "step_type": { - "type": "string", - "const": "tool_execution", - "title": "Step Type", - "default": "tool_execution" - }, - "tool_calls": { - "items": { - "$ref": "#/components/schemas/ToolCall" - }, - "type": "array", - "title": "Tool Calls" - }, - "tool_responses": { - "items": { - "$ref": "#/components/schemas/ToolResponse-Output" - }, - "type": "array", - "title": "Tool Responses" - } - }, - "type": "object", - "required": [ - "turn_id", - "step_id", - "tool_calls", - "tool_responses" - ], - "title": "ToolExecutionStep", - "description": "A tool execution step in an agent turn." - }, - "ToolPromptFormat": { - "type": "string", - "enum": [ - "json", - "function_tag", - "python_list" - ], - "title": "ToolPromptFormat", - "description": "Prompt format for calling custom / zero shot tools." - }, - "ToolResponse-Input": { - "properties": { - "call_id": { - "type": "string", - "title": "Call Id" - }, - "tool_name": { - "anyOf": [ - { - "$ref": "#/components/schemas/BuiltinTool" - }, - { - "type": "string" - } - ], - "title": "Tool Name" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "required": [ - "call_id", - "tool_name", - "content" - ], - "title": "ToolResponse", - "description": "Response from a tool invocation." - }, - "ToolResponse-Output": { - "properties": { - "call_id": { - "type": "string", - "title": "Call Id" - }, - "tool_name": { - "anyOf": [ - { - "$ref": "#/components/schemas/BuiltinTool" - }, - { - "type": "string" - } - ], - "title": "Tool Name" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "required": [ - "call_id", - "tool_name", - "content" - ], - "title": "ToolResponse", - "description": "Response from a tool invocation." - }, - "ToolResponseMessage-Output": { - "properties": { - "role": { - "type": "string", - "const": "tool", - "title": "Role", - "default": "tool" - }, - "call_id": { - "type": "string", - "title": "Call Id" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - } - }, - "type": "object", - "required": [ - "call_id", - "content" - ], - "title": "ToolResponseMessage", - "description": "A message representing the result of a tool invocation." - }, - "TopKSamplingStrategy": { - "properties": { - "type": { - "type": "string", - "const": "top_k", - "title": "Type", - "default": "top_k" - }, - "top_k": { - "type": "integer", - "minimum": 1.0, - "title": "Top K" - } - }, - "type": "object", - "required": [ - "top_k" - ], - "title": "TopKSamplingStrategy", - "description": "Top-k sampling strategy that restricts sampling to the k most likely tokens." - }, - "TopPSamplingStrategy": { - "properties": { - "type": { - "type": "string", - "const": "top_p", - "title": "Type", - "default": "top_p" - }, - "temperature": { - "title": "Temperature", - "type": "number", - "minimum": 0.0 - }, - "top_p": { - "title": "Top P", - "default": 0.95, - "type": "number" - } - }, - "type": "object", - "required": [ - "temperature" - ], - "title": "TopPSamplingStrategy", - "description": "Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p." - }, - "TrainingConfig": { - "properties": { - "n_epochs": { - "type": "integer", - "title": "N Epochs" - }, - "max_steps_per_epoch": { - "type": "integer", - "title": "Max Steps Per Epoch", - "default": 1 - }, - "gradient_accumulation_steps": { - "type": "integer", - "title": "Gradient Accumulation Steps", - "default": 1 - }, - "max_validation_steps": { - "title": "Max Validation Steps", - "default": 1, - "type": "integer" - }, - "data_config": { - "$ref": "#/components/schemas/DataConfig" - }, - "optimizer_config": { - "$ref": "#/components/schemas/OptimizerConfig" - }, - "efficiency_config": { - "$ref": "#/components/schemas/EfficiencyConfig" - }, - "dtype": { - "title": "Dtype", - "default": "bf16", - "type": "string" - } - }, - "type": "object", - "required": [ - "n_epochs" - ], - "title": "TrainingConfig", - "description": "Comprehensive configuration for the training process." - }, - "Turn": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "session_id": { - "type": "string", - "title": "Session Id" - }, - "input_messages": { - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/UserMessage-Output" - }, - { - "$ref": "#/components/schemas/ToolResponseMessage-Output" - } - ] - }, - "type": "array", - "title": "Input Messages" - }, - "steps": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/InferenceStep-Output" - }, - { - "$ref": "#/components/schemas/ToolExecutionStep-Output" - }, - { - "$ref": "#/components/schemas/ShieldCallStep-Output" - }, - { - "$ref": "#/components/schemas/MemoryRetrievalStep-Output" - } - ], - "discriminator": { - "propertyName": "step_type", - "mapping": { - "inference": "#/components/schemas/InferenceStep-Output", - "memory_retrieval": "#/components/schemas/MemoryRetrievalStep-Output", - "shield_call": "#/components/schemas/ShieldCallStep-Output", - "tool_execution": "#/components/schemas/ToolExecutionStep-Output" - } - } - }, - "type": "array", - "title": "Steps" - }, - "output_message": { - "$ref": "#/components/schemas/CompletionMessage-Output" - }, - "output_attachments": { - "title": "Output Attachments", - "items": { - "$ref": "#/components/schemas/Attachment-Output" - }, - "type": "array" - }, - "started_at": { - "type": "string", - "format": "date-time", - "title": "Started At" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - } - }, - "type": "object", - "required": [ - "turn_id", - "session_id", - "input_messages", - "steps", - "output_message", - "started_at" - ], - "title": "Turn", - "description": "A single turn in an interaction with an Agentic System." - }, - "URIDataSource": { - "properties": { - "type": { - "type": "string", - "const": "uri", - "title": "Type", - "default": "uri" - }, - "uri": { - "type": "string", - "title": "Uri" - } - }, - "type": "object", - "required": [ - "uri" - ], - "title": "URIDataSource", - "description": "A dataset that can be obtained from a URI." - }, - "URL": { - "properties": { - "uri": { - "type": "string", - "title": "Uri" - } - }, - "type": "object", - "required": [ - "uri" - ], - "title": "URL", - "description": "A URL reference to external content." - }, - "UserMessage-Input": { - "properties": { - "role": { - "type": "string", - "const": "user", - "title": "Role", - "default": "user" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "context": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Context" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "UserMessage", - "description": "A message from the user in a chat conversation." - }, - "UserMessage-Output": { - "properties": { - "role": { - "type": "string", - "const": "user", - "title": "Role", - "default": "user" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "context": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Context" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "UserMessage", - "description": "A message from the user in a chat conversation." - }, - "ViolationLevel": { - "type": "string", - "enum": [ - "info", - "warn", - "error" - ], - "title": "ViolationLevel", - "description": "Severity level of a safety violation." - }, - "_URLOrData": { - "properties": { - "url": { - "$ref": "#/components/schemas/URL" - }, - "data": { - "contentEncoding": "base64", - "title": "Data", - "type": "string" - } - }, - "type": "object", - "title": "_URLOrData", - "description": "A URL or a base64 encoded string" - }, - "__main_____agents_agent_id_session_Request": { - "properties": { - "agent_id": { - "type": "string", - "title": "Agent Id" - }, - "session_name": { - "type": "string", - "title": "Session Name" - } - }, - "type": "object", - "required": [ - "agent_id", - "session_name" - ], - "title": "_agents_agent_id_session_Request" - }, - "__main_____agents_agent_id_session_session_id_turn_Request": { - "properties": { - "agent_id": { - "type": "string", - "title": "Agent Id" - }, - "session_id": { - "type": "string", - "title": "Session Id" - }, - "messages": { - "$ref": "#/components/schemas/UserMessage-Input" - }, - "stream": { - "type": "boolean", - "title": "Stream", - "default": false - }, - "documents": { - "$ref": "#/components/schemas/Document" - }, - "toolgroups": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/AgentToolGroupWithArgs" - } - ], - "title": "Toolgroups" - }, - "tool_config": { - "$ref": "#/components/schemas/ToolConfig" - } - }, - "type": "object", - "required": [ - "agent_id", - "session_id", - "messages", - "documents", - "toolgroups", - "tool_config" - ], - "title": "_agents_agent_id_session_session_id_turn_Request" - }, - "__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request": { - "properties": { - "agent_id": { - "type": "string", - "title": "Agent Id" - }, - "session_id": { - "type": "string", - "title": "Session Id" - }, - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "tool_responses": { - "$ref": "#/components/schemas/ToolResponse-Input" - }, - "stream": { - "type": "boolean", - "title": "Stream", - "default": false - } - }, - "type": "object", - "required": [ - "agent_id", - "session_id", - "turn_id", - "tool_responses" - ], - "title": "_agents_agent_id_session_session_id_turn_turn_id_resume_Request" - }, - "__main_____datasets_Request": { - "properties": { - "purpose": { - "$ref": "#/components/schemas/DatasetPurpose" - }, - "metadata": { - "type": "string", - "title": "Metadata" - }, - "dataset_id": { - "type": "string", - "title": "Dataset Id" - } - }, - "type": "object", - "required": [ - "purpose", - "metadata", - "dataset_id" - ], - "title": "_datasets_Request" - }, - "_inference_rerank_Request": { - "properties": { - "model": { - "type": "string", - "title": "Model" - }, - "query": { - "type": "string", - "title": "Query" - }, - "items": { - "type": "string", - "title": "Items" - }, - "max_num_results": { - "type": "integer", - "title": "Max Num Results" - } - }, - "type": "object", - "required": [ - "model", - "query", - "items", - "max_num_results" - ], - "title": "_inference_rerank_Request" - }, - "Error": { - "description": "Error response from the API. Roughly follows RFC 7807.", - "properties": { - "status": { - "title": "Status", - "type": "integer" - }, - "title": { - "title": "Title", - "type": "string" - }, - "detail": { - "title": "Detail", - "type": "string" - }, - "instance": { - "title": "Instance", - "type": "string", - "nullable": true - } - }, - "required": [ - "status", - "title", - "detail" - ], - "title": "Error", - "type": "object" - }, - "Agent": { - "description": "An agent instance with configuration and metadata.", - "properties": { - "agent_id": { - "title": "Agent Id", - "type": "string" - }, - "agent_config": { - "$ref": "#/components/schemas/AgentConfig" - }, - "created_at": { - "format": "date-time", - "title": "Created At", - "type": "string" - } - }, - "required": [ - "agent_id", - "agent_config", - "created_at" - ], - "title": "Agent", - "type": "object" - }, - "AgentStepResponse": { - "description": "Response containing details of a specific agent step.", - "properties": { - "step": { - "discriminator": { - "mapping": { - "inference": "#/$defs/InferenceStep", - "memory_retrieval": "#/$defs/MemoryRetrievalStep", - "shield_call": "#/$defs/ShieldCallStep", - "tool_execution": "#/$defs/ToolExecutionStep" - }, - "propertyName": "step_type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/InferenceStep" - }, - { - "$ref": "#/components/schemas/ToolExecutionStep" - }, - { - "$ref": "#/components/schemas/ShieldCallStep" - }, - { - "$ref": "#/components/schemas/MemoryRetrievalStep" - } - ], - "title": "Step" - } - }, - "required": [ - "step" - ], - "title": "AgentStepResponse", - "type": "object" - }, - "CompletionMessage": { - "description": "A message containing the model's (assistant) response in a chat conversation.", - "properties": { - "role": { - "const": "assistant", - "default": "assistant", - "title": "Role", - "type": "string" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - { - "items": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - "type": "array" - } - ], - "title": "Content" - }, - "stop_reason": { - "$ref": "#/components/schemas/StopReason" - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/ToolCall" - }, - "type": "array" - } - }, - "required": [ - "content", - "stop_reason" - ], - "title": "CompletionMessage", - "type": "object" - }, - "InferenceStep": { - "description": "An inference step in an agent turn.", - "properties": { - "turn_id": { - "title": "Turn Id", - "type": "string" - }, - "step_id": { - "title": "Step Id", - "type": "string" - }, - "started_at": { - "title": "Started At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "completed_at": { - "title": "Completed At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "step_type": { - "const": "inference", - "default": "inference", - "title": "Step Type", - "type": "string" - }, - "model_response": { - "$ref": "#/components/schemas/CompletionMessage" - } - }, - "required": [ - "turn_id", - "step_id", - "model_response" - ], - "title": "InferenceStep", - "type": "object" - }, - "MemoryRetrievalStep": { - "description": "A memory retrieval step in an agent turn.", - "properties": { - "turn_id": { - "title": "Turn Id", - "type": "string" - }, - "step_id": { - "title": "Step Id", - "type": "string" - }, - "started_at": { - "title": "Started At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "completed_at": { - "title": "Completed At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "step_type": { - "const": "memory_retrieval", - "default": "memory_retrieval", - "title": "Step Type", - "type": "string" - }, - "vector_store_ids": { - "title": "Vector Store Ids", - "type": "string" - }, - "inserted_context": { - "anyOf": [ - { - "type": "string" - }, - { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - { - "items": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - "type": "array" - } - ], - "title": "Inserted Context" - } - }, - "required": [ - "turn_id", - "step_id", - "vector_store_ids", - "inserted_context" - ], - "title": "MemoryRetrievalStep", - "type": "object" - }, - "PaginatedResponse": { - "description": "A generic paginated response that follows a simple format.", - "properties": { - "data": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "title": "Data", - "type": "array" - }, - "has_more": { - "title": "Has More", - "type": "boolean" - }, - "url": { - "title": "Url", - "type": "string", - "nullable": true - } - }, - "required": [ - "data", - "has_more" - ], - "title": "PaginatedResponse", - "type": "object" - }, - "Session": { - "description": "A single session of an interaction with an Agentic System.", - "properties": { - "session_id": { - "title": "Session Id", - "type": "string" - }, - "session_name": { - "title": "Session Name", - "type": "string" - }, - "turns": { - "items": { - "$ref": "#/components/schemas/Turn" - }, - "title": "Turns", - "type": "array" - }, - "started_at": { - "format": "date-time", - "title": "Started At", - "type": "string" - } - }, - "required": [ - "session_id", - "session_name", - "turns", - "started_at" - ], - "title": "Session", - "type": "object" - }, - "ShieldCallStep": { - "description": "A shield call step in an agent turn.", - "properties": { - "turn_id": { - "title": "Turn Id", - "type": "string" - }, - "step_id": { - "title": "Step Id", - "type": "string" - }, - "started_at": { - "title": "Started At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "completed_at": { - "title": "Completed At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "step_type": { - "const": "shield_call", - "default": "shield_call", - "title": "Step Type", - "type": "string" - }, - "violation": { - "$ref": "#/components/schemas/SafetyViolation" - } - }, - "required": [ - "turn_id", - "step_id", - "violation" - ], - "title": "ShieldCallStep", - "type": "object" - }, - "ToolExecutionStep": { - "description": "A tool execution step in an agent turn.", - "properties": { - "turn_id": { - "title": "Turn Id", - "type": "string" - }, - "step_id": { - "title": "Step Id", - "type": "string" - }, - "started_at": { - "title": "Started At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "completed_at": { - "title": "Completed At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "step_type": { - "const": "tool_execution", - "default": "tool_execution", - "title": "Step Type", - "type": "string" - }, - "tool_calls": { - "items": { - "$ref": "#/components/schemas/ToolCall" - }, - "title": "Tool Calls", - "type": "array" - }, - "tool_responses": { - "items": { - "$ref": "#/components/schemas/ToolResponse" - }, - "title": "Tool Responses", - "type": "array" - } - }, - "required": [ - "turn_id", - "step_id", - "tool_calls", - "tool_responses" - ], - "title": "ToolExecutionStep", - "type": "object" - }, - "ToolResponse": { - "description": "Response from a tool invocation.", - "properties": { - "call_id": { - "title": "Call Id", - "type": "string" - }, - "tool_name": { - "anyOf": [ - { - "$ref": "#/components/schemas/BuiltinTool" - }, - { - "type": "string" - } - ], - "title": "Tool Name" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - { - "items": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - "type": "array" - } - ], - "title": "Content" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object", - "nullable": true - } - }, - "required": [ - "call_id", - "tool_name", - "content" - ], - "title": "ToolResponse", - "type": "object" - }, - "Checkpoint": { - "description": "Checkpoint created during training runs.", - "properties": { - "identifier": { - "title": "Identifier", - "type": "string" - }, - "created_at": { - "format": "date-time", - "title": "Created At", - "type": "string" - }, - "epoch": { - "title": "Epoch", - "type": "integer" - }, - "post_training_job_id": { - "title": "Post Training Job Id", - "type": "string" - }, - "path": { - "title": "Path", - "type": "string" - }, - "training_metrics": { - "$ref": "#/components/schemas/PostTrainingMetric", - "nullable": true - } - }, - "required": [ - "identifier", - "created_at", - "epoch", - "post_training_job_id", - "path" - ], - "title": "Checkpoint", - "type": "object" - }, - "PostTrainingJobArtifactsResponse": { - "description": "Artifacts of a finetuning job.", - "properties": { - "job_uuid": { - "title": "Job Uuid", - "type": "string" - }, - "checkpoints": { - "items": { - "$ref": "#/components/schemas/Checkpoint" - }, - "title": "Checkpoints", - "type": "array" - } - }, - "required": [ - "job_uuid" - ], - "title": "PostTrainingJobArtifactsResponse", - "type": "object" - }, - "PostTrainingJobStatusResponse": { - "description": "Status of a finetuning job.", - "properties": { - "job_uuid": { - "title": "Job Uuid", - "type": "string" - }, - "status": { - "$ref": "#/components/schemas/JobStatus" - }, - "scheduled_at": { - "title": "Scheduled At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "started_at": { - "title": "Started At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "completed_at": { - "title": "Completed At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "resources_allocated": { - "title": "Resources Allocated", - "additionalProperties": true, - "type": "object", - "nullable": true - }, - "checkpoints": { - "items": { - "$ref": "#/components/schemas/Checkpoint" - }, - "title": "Checkpoints", - "type": "array" - } - }, - "required": [ - "job_uuid", - "status" - ], - "title": "PostTrainingJobStatusResponse", - "type": "object" - }, - "ImageContentItem": { - "description": "A image content item", - "properties": { - "type": { - "const": "image", - "default": "image", - "title": "Type", - "type": "string" - }, - "image": { - "$ref": "#/components/schemas/_URLOrData" - } - }, - "required": [ - "image" - ], - "title": "ImageContentItem", - "type": "object" - }, - "PostTrainingMetric": { - "description": "Training metrics captured during post-training jobs.", - "properties": { - "epoch": { - "title": "Epoch", - "type": "integer" - }, - "train_loss": { - "title": "Train Loss", - "type": "number" - }, - "validation_loss": { - "title": "Validation Loss", - "type": "number" - }, - "perplexity": { - "title": "Perplexity", - "type": "number" - } - }, - "required": [ - "epoch", - "train_loss", - "validation_loss", - "perplexity" - ], - "title": "PostTrainingMetric", - "type": "object" - } - }, - "responses": { - "BadRequest400": { - "description": "The request was invalid or malformed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - }, - "example": { - "status": 400, - "title": "Bad Request", - "detail": "The request was invalid or malformed" - } - } - } - }, - "TooManyRequests429": { - "description": "The client has sent too many requests in a given amount of time", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - }, - "example": { - "status": 429, - "title": "Too Many Requests", - "detail": "You have exceeded the rate limit. Please try again later." - } - } - } - }, - "InternalServerError500": { - "description": "The server encountered an unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - }, - "example": { - "status": 500, - "title": "Internal Server Error", - "detail": "An unexpected error occurred. Our team has been notified." - } - } - } - }, - "DefaultError": { - "description": "An unexpected error occurred", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - } - } -} \ No newline at end of file diff --git a/docs/static/experimental-llama-stack-spec.yaml b/docs/static/experimental-llama-stack-spec.yaml index cd7cbdb23c..47692cbe9b 100644 --- a/docs/static/experimental-llama-stack-spec.yaml +++ b/docs/static/experimental-llama-stack-spec.yaml @@ -12,557 +12,728 @@ paths: /v1beta/datasetio/append-rows/{dataset_id}: post: tags: - - V1Beta + - DatasetIO summary: Append rows to a dataset. - description: Generic endpoint - this would be replaced with actual implementation. + description: Append rows to a dataset. operationId: append_rows_v1beta_datasetio_append_rows__dataset_id__post parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - name: dataset_id in: path required: true schema: type: string - description: 'Path parameter: dataset_id' + description: The ID of the dataset to append the rows to + title: Dataset Id + description: The ID of the dataset to append the rows to + requestBody: + required: true + content: + application/json: + schema: + type: array + items: + type: object + additionalProperties: true + description: The rows to append to the dataset. + title: Body responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1beta/datasetio/iterrows/{dataset_id}: get: tags: - - V1Beta + - DatasetIO summary: Get a paginated list of rows from a dataset. - description: Query endpoint for proper schema generation. + description: Get a paginated list of rows from a dataset using offset-based pagination. operationId: iterrows_v1beta_datasetio_iterrows__dataset_id__get parameters: - - name: limit - in: query + - name: dataset_id + in: path required: true schema: - type: integer - title: Limit + type: string + description: The ID of the dataset to get the rows from + title: Dataset Id + description: The ID of the dataset to get the rows from - name: start_index in: query - required: true + required: false schema: - type: integer + anyOf: + - type: integer + - type: 'null' + description: Index into dataset for the first row to get. Get all rows if None. title: Start Index - - name: dataset_id - in: path - required: true + description: Index into dataset for the first row to get. Get all rows if None. + - name: limit + in: query + required: false schema: - type: string - title: Dataset Id + anyOf: + - type: integer + - type: 'null' + description: The number of rows to get. + title: Limit + description: The number of rows to get. responses: '200': - description: A PaginatedResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/PaginatedResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1beta/datasets: get: tags: - - V1Beta - summary: List all datasets. - description: Response-only endpoint for proper schema generation. + - Datasets + summary: List all datasets + description: List all datasets operationId: list_datasets_v1beta_datasets_get responses: '200': - description: A ListDatasetsResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListDatasetsResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1Beta - summary: Register a new dataset. - description: Typed endpoint for proper schema generation. + - Datasets + summary: Register a new dataset + description: Register a new dataset operationId: register_dataset_v1beta_datasets_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/__main_____datasets_Request' + $ref: '#/components/schemas/RegisterDatasetRequest' required: true responses: '200': - description: A Dataset. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Dataset' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1beta/datasets/{dataset_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1beta/datasets/{{dataset_id}}: delete: tags: - - V1Beta - summary: Unregister a dataset by its ID. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: unregister_dataset_v1beta_datasets__dataset_id__delete + - Datasets + summary: Unregister a dataset by its ID + description: Unregister a dataset by its ID + operationId: unregister_dataset_v1beta_datasets___dataset_id___delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - name: dataset_id in: path required: true schema: type: string - description: 'Path parameter: dataset_id' + description: The ID of the dataset to unregister + title: Dataset Id + description: The ID of the dataset to unregister responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1Beta - summary: Get a dataset by its ID. - description: Query endpoint for proper schema generation. - operationId: get_dataset_v1beta_datasets__dataset_id__get + - Datasets + summary: Get a dataset by its ID + description: Get a dataset by its ID + operationId: get_dataset_v1beta_datasets___dataset_id___get parameters: - name: dataset_id in: path required: true schema: type: string + description: The ID of the dataset to get title: Dataset Id + description: The ID of the dataset to get responses: '200': - description: A Dataset. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Dataset' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1alpha/agents: get: tags: - - V1Alpha + - Agents summary: List all agents. - description: Query endpoint for proper schema generation. + description: List all agents. operationId: list_agents_v1alpha_agents_get parameters: - - name: limit - in: query - required: true - schema: - type: integer - title: Limit - name: start_index in: query - required: true + required: false schema: - type: integer + anyOf: + - type: integer + - type: 'null' + description: The index to start the pagination from. title: Start Index + description: The index to start the pagination from. + - name: limit + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The number of agents to return. + title: Limit + description: The number of agents to return. responses: '200': - description: A PaginatedResponse. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/PaginatedResponse' + schema: {} '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1Alpha - summary: Create an agent with the given configuration. - description: Typed endpoint for proper schema generation. + - Agents + summary: Create an agent. + description: Create an agent with the given configuration. operationId: create_agent_v1alpha_agents_post requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/AgentConfig' + $ref: '#/components/schemas/AgentConfig-Input' responses: '200': - description: An AgentCreateResponse with the agent ID. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/AgentCreateResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents/{agent_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}: delete: tags: - - V1Alpha - summary: Delete an agent by its ID and its associated sessions and turns. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: delete_agent_v1alpha_agents__agent_id__delete + - Agents + summary: Delete an agent. + description: Delete an agent by its ID. + operationId: delete_agent_v1alpha_agents___agent_id___delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - name: agent_id in: path required: true schema: type: string + description: The ID of the agent to delete. + title: Agent Id description: The ID of the agent to delete. responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1Alpha - summary: Describe an agent by its ID. - description: Query endpoint for proper schema generation. - operationId: get_agent_v1alpha_agents__agent_id__get + - Agents + summary: Describe an agent. + description: Describe an agent by its ID. + operationId: get_agent_v1alpha_agents___agent_id___get parameters: - name: agent_id in: path required: true schema: type: string + description: ID of the agent. title: Agent Id description: ID of the agent. responses: '200': - description: An Agent of the agent. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Agent' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents/{agent_id}/session: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session: post: tags: - - V1Alpha + - Agents summary: Create a new session for an agent. - description: Typed endpoint for proper schema generation. - operationId: create_agent_session_v1alpha_agents__agent_id__session_post + description: Create a new session for an agent. + operationId: create_agent_session_v1alpha_agents___agent_id___session_post + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to create the session for. + title: Agent Id + description: The ID of the agent to create the session for. requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/__main_____agents_agent_id_session_Request' - required: true + $ref: '#/components/schemas/CreateAgentSessionRequest' responses: '200': - description: An AgentSessionCreateResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/AgentSessionCreateResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session/{{session_id}}: + delete: + tags: + - Agents + summary: Delete an agent session. + description: Delete an agent session by its ID. + operationId: delete_agents_session_v1alpha_agents___agent_id___session___session_id___delete parameters: - name: agent_id in: path required: true schema: type: string - description: The ID of the agent to create the session for. - /v1alpha/agents/{agent_id}/session/{session_id}: - delete: - tags: - - V1Alpha - summary: Delete an agent session by its ID and its associated turns. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: delete_agents_session_v1alpha_agents__agent_id__session__session_id__delete - parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs + description: The ID of the agent to delete the session for. + title: Agent Id + description: The ID of the agent to delete the session for. - name: session_id in: path required: true schema: type: string + description: The ID of the session to delete. + title: Session Id description: The ID of the session to delete. - - name: agent_id - in: path - required: true - schema: - type: string - description: The ID of the agent to delete the session for. responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - get: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: tags: - - V1Alpha - summary: Retrieve an agent session by its ID. - description: Query endpoint for proper schema generation. - operationId: get_agents_session_v1alpha_agents__agent_id__session__session_id__get + - Agents + summary: Retrieve an agent session. + description: Retrieve an agent session by its ID. + operationId: get_agents_session_v1alpha_agents___agent_id___session___session_id___get parameters: - - name: turn_ids - in: query + - name: agent_id + in: path required: true schema: type: string - title: Turn Ids + description: The ID of the agent to get the session for. + title: Agent Id + description: The ID of the agent to get the session for. - name: session_id in: path required: true schema: type: string + description: The ID of the session to get. title: Session Id description: The ID of the session to get. - - name: agent_id - in: path - required: true + - name: turn_ids + in: query + required: false schema: - type: string - title: Agent Id - description: The ID of the agent to get the session for. + anyOf: + - type: array + items: + type: string + - type: 'null' + description: List of turn IDs to filter the session by. + title: Turn Ids + description: List of turn IDs to filter the session by. responses: '200': - description: A Session. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Session' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents/{agent_id}/session/{session_id}/turn: - post: - tags: - - V1Alpha - summary: Create a new turn for an agent. - description: Typed endpoint for proper schema generation. - operationId: create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/__main_____agents_agent_id_session_session_id_turn_Request' - required: true - responses: - '200': - description: If stream=False, returns a Turn object. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Turn' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session/{{session_id}}/turn: + post: + tags: + - Agents + summary: Create a new turn for an agent. + description: Create a new turn for an agent. + operationId: create_agent_turn_v1alpha_agents___agent_id___session___session_id___turn_post parameters: - name: agent_id in: path required: true schema: type: string + description: The ID of the agent to create the turn for. + title: Agent Id description: The ID of the agent to create the turn for. - name: session_id in: path required: true schema: type: string + description: The ID of the session to create the turn for. + title: Session Id description: The ID of the session to create the turn for. - /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTurnCreateRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session/{{session_id}}/turn/{{turn_id}}: get: tags: - - V1Alpha - summary: Retrieve an agent turn by its ID. - description: Query endpoint for proper schema generation. - operationId: get_agents_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__get + - Agents + summary: Retrieve an agent turn. + description: Retrieve an agent turn by its ID. + operationId: get_agents_turn_v1alpha_agents___agent_id___session___session_id___turn___turn_id___get parameters: - name: agent_id in: path required: true schema: type: string + description: The ID of the agent to get the turn for. title: Agent Id description: The ID of the agent to get the turn for. - name: session_id @@ -570,6 +741,7 @@ paths: required: true schema: type: string + description: The ID of the session to get the turn for. title: Session Id description: The ID of the session to get the turn for. - name: turn_id @@ -577,92 +749,122 @@ paths: required: true schema: type: string + description: The ID of the turn to get. title: Turn Id description: The ID of the turn to get. responses: '200': - description: A Turn. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Turn' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume: - post: - tags: - - V1Alpha - summary: Resume an agent turn with executed tool call responses. - description: Typed endpoint for proper schema generation. - operationId: resume_agent_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__resume_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request' - required: true - responses: - '200': - description: A Turn object if stream is False, otherwise an AsyncIterator - of AgentTurnResponseStreamChunk objects. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Turn' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session/{{session_id}}/turn/{{turn_id}}/resume: + post: + tags: + - Agents + summary: Resume an agent turn. + description: Resume an agent turn with executed tool call responses. + operationId: resume_agent_turn_v1alpha_agents___agent_id___session___session_id___turn___turn_id___resume_post parameters: - name: agent_id in: path required: true schema: type: string + description: The ID of the agent to resume. + title: Agent Id description: The ID of the agent to resume. - name: session_id in: path required: true schema: type: string + description: The ID of the session to resume. + title: Session Id description: The ID of the session to resume. - name: turn_id in: path required: true schema: type: string + description: The ID of the turn to resume. + title: Turn Id description: The ID of the turn to resume. - /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AgentTurnResumeRequest' + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session/{{session_id}}/turn/{{turn_id}}/step/{{step_id}}: get: tags: - - V1Alpha - summary: Retrieve an agent step by its ID. - description: Query endpoint for proper schema generation. - operationId: get_agents_step_v1alpha_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get + - Agents + summary: Retrieve an agent step. + description: Retrieve an agent step by its ID. + operationId: get_agents_step_v1alpha_agents___agent_id___session___session_id___turn___turn_id___step___step_id___get parameters: - name: agent_id in: path required: true schema: type: string + description: The ID of the agent to get the step for. title: Agent Id description: The ID of the agent to get the step for. - name: session_id @@ -670,6 +872,7 @@ paths: required: true schema: type: string + description: The ID of the session to get the step for. title: Session Id description: The ID of the session to get the step for. - name: turn_id @@ -677,6 +880,7 @@ paths: required: true schema: type: string + description: The ID of the turn to get the step for. title: Turn Id description: The ID of the turn to get the step for. - name: step_id @@ -684,454 +888,588 @@ paths: required: true schema: type: string + description: The ID of the step to get. title: Step Id description: The ID of the step to get. responses: '200': - description: An AgentStepResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/AgentStepResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents/{agent_id}/sessions: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/sessions: get: tags: - - V1Alpha - summary: List all session(s) of a given agent. - description: Query endpoint for proper schema generation. - operationId: list_agent_sessions_v1alpha_agents__agent_id__sessions_get + - Agents + summary: List all sessions of an agent. + description: List all session(s) of a given agent. + operationId: list_agent_sessions_v1alpha_agents___agent_id___sessions_get parameters: - - name: limit - in: query - required: true - schema: - type: integer - title: Limit - - name: start_index - in: query - required: true - schema: - type: integer - title: Start Index - name: agent_id in: path required: true schema: type: string + description: The ID of the agent to list sessions for. title: Agent Id description: The ID of the agent to list sessions for. + - name: start_index + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The index to start the pagination from. + title: Start Index + description: The index to start the pagination from. + - name: limit + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The number of sessions to return. + title: Limit + description: The number of sessions to return. responses: '200': - description: A PaginatedResponse. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/PaginatedResponse' + schema: {} '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1alpha/eval/benchmarks: get: tags: - - V1Alpha - summary: List all benchmarks. - description: Response-only endpoint for proper schema generation. + - Benchmarks + summary: List all benchmarks + description: List all benchmarks operationId: list_benchmarks_v1alpha_eval_benchmarks_get responses: '200': - description: A ListBenchmarksResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListBenchmarksResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1Alpha - summary: Register a benchmark. - description: Generic endpoint - this would be replaced with actual implementation. + - Benchmarks + summary: Register a benchmark + description: Register a benchmark operationId: register_benchmark_v1alpha_eval_benchmarks_post - parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterBenchmarkRequest' required: true - schema: - title: Kwargs responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/eval/benchmarks/{benchmark_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks/{{benchmark_id}}: delete: tags: - - V1Alpha - summary: Unregister a benchmark. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: unregister_benchmark_v1alpha_eval_benchmarks__benchmark_id__delete + - Benchmarks + summary: Unregister a benchmark + description: Unregister a benchmark + operationId: unregister_benchmark_v1alpha_eval_benchmarks___benchmark_id___delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - name: benchmark_id in: path required: true schema: type: string - description: The ID of the benchmark to unregister. + description: The ID of the benchmark to unregister + title: Benchmark Id + description: The ID of the benchmark to unregister responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1Alpha - summary: Get a benchmark by its ID. - description: Query endpoint for proper schema generation. - operationId: get_benchmark_v1alpha_eval_benchmarks__benchmark_id__get + - Benchmarks + summary: Get a benchmark by its ID + description: Get a benchmark by its ID + operationId: get_benchmark_v1alpha_eval_benchmarks___benchmark_id___get parameters: - name: benchmark_id in: path required: true schema: type: string + description: The ID of the benchmark to get title: Benchmark Id - description: The ID of the benchmark to get. + description: The ID of the benchmark to get responses: '200': - description: A Benchmark. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Benchmark' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/eval/benchmarks/{benchmark_id}/evaluations: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks/{{benchmark_id}}/evaluations: + post: tags: - - V1Alpha - summary: Evaluate a list of rows on a benchmark. - description: Typed endpoint for proper schema generation. - operationId: evaluate_rows_v1alpha_eval_benchmarks__benchmark_id__evaluations_post + - Eval + summary: Evaluate a list of rows on a benchmark + description: Evaluate a list of rows on a benchmark + operationId: evaluate_rows_v1alpha_eval_benchmarks___benchmark_id___evaluations_post + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/BenchmarkConfig' - required: true + $ref: '#/components/schemas/EvaluateRowsRequest' responses: '200': - description: EvaluateResponse object containing generations and scores. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/EvaluateResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks/{{benchmark_id}}/jobs: + post: + tags: + - Eval + summary: Run an evaluation on a benchmark + description: Run an evaluation on a benchmark + operationId: run_eval_v1alpha_eval_benchmarks___benchmark_id___jobs_post parameters: - name: benchmark_id in: path required: true schema: type: string - description: The ID of the benchmark to run the evaluation on. - /v1alpha/eval/benchmarks/{benchmark_id}/jobs: - post: - tags: - - V1Alpha - summary: Run an evaluation on a benchmark. - description: Typed endpoint for proper schema generation. - operationId: run_eval_v1alpha_eval_benchmarks__benchmark_id__jobs_post + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on requestBody: + required: true content: application/json: schema: $ref: '#/components/schemas/BenchmarkConfig' - required: true responses: '200': - description: The job that was created to run the evaluation. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Job' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: benchmark_id - in: path - required: true - schema: - type: string - description: The ID of the benchmark to run the evaluation on. - /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks/{{benchmark_id}}/jobs/{{job_id}}: delete: tags: - - V1Alpha - summary: Cancel a job. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: job_cancel_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__delete + - Eval + summary: Cancel a job + description: Cancel a job + operationId: job_cancel_v1alpha_eval_benchmarks___benchmark_id___jobs___job_id___delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - name: benchmark_id in: path required: true schema: type: string - description: The ID of the benchmark to run the evaluation on. + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on - name: job_id in: path required: true schema: type: string - description: The ID of the job to cancel. + description: The ID of the job to cancel + title: Job Id + description: The ID of the job to cancel responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1Alpha - summary: Get the status of a job. - description: Query endpoint for proper schema generation. - operationId: job_status_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__get + - Eval + summary: Get the status of a job + description: Get the status of a job + operationId: job_status_v1alpha_eval_benchmarks___benchmark_id___jobs___job_id___get parameters: - name: benchmark_id in: path required: true schema: type: string + description: The ID of the benchmark to run the evaluation on title: Benchmark Id - description: The ID of the benchmark to run the evaluation on. + description: The ID of the benchmark to run the evaluation on - name: job_id in: path required: true schema: type: string + description: The ID of the job to get the status of title: Job Id - description: The ID of the job to get the status of. + description: The ID of the job to get the status of responses: '200': - description: The status of the evaluation job. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Job' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks/{{benchmark_id}}/jobs/{{job_id}}/result: get: tags: - - V1Alpha - summary: Get the result of a job. - description: Query endpoint for proper schema generation. - operationId: job_result_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__result_get + - Eval + summary: Get the result of a job + description: Get the result of a job + operationId: job_result_v1alpha_eval_benchmarks___benchmark_id___jobs___job_id___result_get parameters: - name: benchmark_id in: path required: true schema: type: string + description: The ID of the benchmark to run the evaluation on title: Benchmark Id - description: The ID of the benchmark to run the evaluation on. + description: The ID of the benchmark to run the evaluation on - name: job_id in: path required: true schema: type: string + description: The ID of the job to get the result of title: Job Id - description: The ID of the job to get the result of. + description: The ID of the job to get the result of responses: '200': - description: The result of the job. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/EvaluateResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1alpha/inference/rerank: post: tags: - - V1Alpha - summary: Rerank a list of documents based on their relevance to a query. - description: Typed endpoint for proper schema generation. + - Inference + summary: Rerank a list of documents. + description: Rerank a list of documents based on their relevance to a query. operationId: rerank_v1alpha_inference_rerank_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_inference_rerank_Request' + $ref: '#/components/schemas/Body_rerank_v1alpha_inference_rerank_post' required: true responses: '200': - description: RerankResponse with indices sorted by relevance score (descending). + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/RerankResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1alpha/post-training/job/artifacts: get: tags: - - V1Alpha - summary: Get the artifacts of a training job. - description: Query endpoint for proper schema generation. + - Post Training + summary: Get the artifacts of a training job + description: Get the artifacts of a training job operationId: get_training_job_artifacts_v1alpha_post_training_job_artifacts_get parameters: - name: job_uuid @@ -1139,68 +1477,89 @@ paths: required: true schema: type: string + description: The UUID of the job to get the artifacts of title: Job Uuid + description: The UUID of the job to get the artifacts of responses: '200': - description: A PostTrainingJobArtifactsResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/PostTrainingJobArtifactsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1alpha/post-training/job/cancel: post: tags: - - V1Alpha - summary: Cancel a training job. - description: Generic endpoint - this would be replaced with actual implementation. + - Post Training + summary: Cancel a training job + description: Cancel a training job operationId: cancel_training_job_v1alpha_post_training_job_cancel_post parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs + - name: job_uuid in: query required: true schema: - title: Kwargs + type: string + description: The UUID of the job to cancel + title: Job Uuid + description: The UUID of the job to cancel responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1alpha/post-training/job/status: get: tags: - - V1Alpha - summary: Get the status of a training job. - description: Query endpoint for proper schema generation. + - Post Training + summary: Get the status of a training job + description: Get the status of a training job operationId: get_training_job_status_v1alpha_post_training_job_status_get parameters: - name: job_uuid @@ -1208,193 +1567,391 @@ paths: required: true schema: type: string + description: The UUID of the job to get the status of title: Job Uuid + description: The UUID of the job to get the status of responses: '200': - description: A PostTrainingJobStatusResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/PostTrainingJobStatusResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1alpha/post-training/jobs: get: tags: - - V1Alpha - summary: Get all training jobs. - description: Response-only endpoint for proper schema generation. + - Post Training + summary: Get all training jobs + description: Get all training jobs operationId: get_training_jobs_v1alpha_post_training_jobs_get responses: '200': - description: A ListPostTrainingJobsResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListPostTrainingJobsResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1alpha/post-training/preference-optimize: post: tags: - - V1Alpha - summary: Run preference optimization of a model. - description: Typed endpoint for proper schema generation. + - Post Training + summary: Run preference optimization of a model + description: Run preference optimization of a model operationId: preference_optimize_v1alpha_post_training_preference_optimize_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/DPOAlignmentConfig' + $ref: '#/components/schemas/PreferenceOptimizeRequest' required: true responses: '200': - description: A PostTrainingJob. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/PostTrainingJob' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1alpha/post-training/supervised-fine-tune: post: tags: - - V1Alpha - summary: Run supervised fine-tuning of a model. - description: Typed endpoint for proper schema generation. + - Post Training + summary: Run supervised fine-tuning of a model + description: Run supervised fine-tuning of a model operationId: supervised_fine_tune_v1alpha_post_training_supervised_fine_tune_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/TrainingConfig' + $ref: '#/components/schemas/SupervisedFineTuneRequest' required: true responses: '200': - description: A PostTrainingJob. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/PostTrainingJob' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' components: schemas: + Agent: + properties: + agent_id: + type: string + title: Agent Id + description: Unique identifier for the agent + agent_config: + $ref: '#/components/schemas/AgentConfig-Output' + description: Configuration settings for the agent + created_at: + type: string + format: date-time + title: Created At + description: Timestamp when the agent was created + type: object + required: + - agent_id + - agent_config + - created_at + title: Agent + description: An agent instance with configuration and metadata. AgentCandidate: properties: type: type: string const: agent title: Type + description: The type of candidate. default: agent config: - $ref: '#/components/schemas/AgentConfig' + $ref: '#/components/schemas/AgentConfig-Input' + description: The configuration for the agent candidate. type: object required: - config title: AgentCandidate description: An agent candidate for evaluation. - AgentConfig: + AgentConfig-Input: properties: sampling_params: - $ref: '#/components/schemas/SamplingParams' + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' input_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' title: Input Shields - items: - type: string - type: array output_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' title: Output Shields - items: - type: string - type: array toolgroups: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array + - type: 'null' title: Toolgroups - items: - anyOf: - - type: string - - $ref: '#/components/schemas/AgentToolGroupWithArgs' - type: array client_tools: + anyOf: + - items: + $ref: '#/components/schemas/ToolDef' + type: array + - type: 'null' title: Client Tools - items: - $ref: '#/components/schemas/ToolDef' - type: array tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: 'null' deprecated: true - $ref: '#/components/schemas/ToolChoice' tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' deprecated: true - $ref: '#/components/schemas/ToolPromptFormat' tool_config: - $ref: '#/components/schemas/ToolConfig' + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' max_infer_iters: + anyOf: + - type: integer + - type: 'null' title: Max Infer Iters default: 10 - type: integer model: type: string title: Model + description: The model identifier to use for the agent instructions: type: string title: Instructions + description: The system instructions for the agent name: + anyOf: + - type: string + - type: 'null' title: Name - type: string + description: Optional name for the agent, used in telemetry and identification enable_session_persistence: + anyOf: + - type: boolean + - type: 'null' title: Enable Session Persistence + description: Optional flag indicating whether session data has to be persisted default: false - type: boolean response_format: - title: Response Format - oneOf: - - $ref: '#/components/schemas/JsonSchemaResponseFormat' - - $ref: '#/components/schemas/GrammarResponseFormat' - discriminator: - propertyName: type - mapping: - grammar: '#/components/schemas/GrammarResponseFormat' - json_schema: '#/components/schemas/JsonSchemaResponseFormat' + anyOf: + - oneOf: + - $ref: '#/components/schemas/JsonSchemaResponseFormat' + - $ref: '#/components/schemas/GrammarResponseFormat' + discriminator: + propertyName: type + mapping: + grammar: '#/components/schemas/GrammarResponseFormat' + json_schema: '#/components/schemas/JsonSchemaResponseFormat' + - type: 'null' + title: Response Format + description: Optional response format configuration + type: object + required: + - model + - instructions + title: AgentConfig + description: Configuration for an agent. + AgentConfig-Output: + properties: + sampling_params: + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' + input_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Input Shields + output_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields + toolgroups: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups + client_tools: + anyOf: + - items: + $ref: '#/components/schemas/ToolDef' + type: array + - type: 'null' + title: Client Tools + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: 'null' + deprecated: true + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + deprecated: true + tool_config: + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' + max_infer_iters: + anyOf: + - type: integer + - type: 'null' + title: Max Infer Iters + default: 10 + model: + type: string + title: Model + description: The model identifier to use for the agent + instructions: + type: string + title: Instructions + description: The system instructions for the agent + name: + anyOf: + - type: string + - type: 'null' + title: Name + description: Optional name for the agent, used in telemetry and identification + enable_session_persistence: + anyOf: + - type: boolean + - type: 'null' + title: Enable Session Persistence + description: Optional flag indicating whether session data has to be persisted + default: false + response_format: + anyOf: + - oneOf: + - $ref: '#/components/schemas/JsonSchemaResponseFormat' + - $ref: '#/components/schemas/GrammarResponseFormat' + discriminator: + propertyName: type + mapping: + grammar: '#/components/schemas/GrammarResponseFormat' + json_schema: '#/components/schemas/JsonSchemaResponseFormat' + - type: 'null' + title: Response Format + description: Optional response format configuration type: object required: - model @@ -1406,6 +1963,7 @@ components: agent_id: type: string title: Agent Id + description: Unique identifier for the created agent type: object required: - agent_id @@ -1416,11 +1974,34 @@ components: session_id: type: string title: Session Id + description: Unique identifier for the created session type: object required: - session_id title: AgentSessionCreateResponse description: Response returned when creating a new agent session. + AgentStepResponse: + properties: + step: + oneOf: + - $ref: '#/components/schemas/InferenceStep-Output' + - $ref: '#/components/schemas/ToolExecutionStep-Output' + - $ref: '#/components/schemas/ShieldCallStep-Output' + - $ref: '#/components/schemas/MemoryRetrievalStep-Output' + title: Step + description: The complete step data and execution details + discriminator: + propertyName: step_type + mapping: + inference: '#/components/schemas/InferenceStep-Output' + memory_retrieval: '#/components/schemas/MemoryRetrievalStep-Output' + shield_call: '#/components/schemas/ShieldCallStep-Output' + tool_execution: '#/components/schemas/ToolExecutionStep-Output' + type: object + required: + - step + title: AgentStepResponse + description: Response containing details of a specific agent step. AgentToolGroupWithArgs: properties: name: @@ -1435,6 +2016,142 @@ components: - name - args title: AgentToolGroupWithArgs + AgentTurnCreateRequest: + properties: + sampling_params: + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' + input_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Input Shields + output_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields + toolgroups: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups + description: List of tool groups to make available for this turn + client_tools: + anyOf: + - items: + $ref: '#/components/schemas/ToolDef' + type: array + - type: 'null' + title: Client Tools + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: 'null' + deprecated: true + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + deprecated: true + tool_config: + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' + description: Tool configuration to override agent defaults + max_infer_iters: + anyOf: + - type: integer + - type: 'null' + title: Max Infer Iters + default: 10 + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + agent_id: + type: string + title: Agent Id + description: Unique identifier for the agent + session_id: + type: string + title: Session Id + description: Unique identifier for the conversation session + messages: + items: + anyOf: + - $ref: '#/components/schemas/UserMessage-Input' + - $ref: '#/components/schemas/ToolResponseMessage-Input' + type: array + title: Messages + description: List of messages to start the turn with + documents: + anyOf: + - items: + $ref: '#/components/schemas/Document' + type: array + - type: 'null' + title: Documents + description: List of documents to provide to the agent + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + description: Whether to stream the response + default: false + type: object + required: + - agent_id + - session_id + - messages + title: AgentTurnCreateRequest + description: Request to create a new turn for an agent. + AgentTurnResumeRequest: + properties: + agent_id: + type: string + title: Agent Id + description: Unique identifier for the agent + session_id: + type: string + title: Session Id + description: Unique identifier for the conversation session + turn_id: + type: string + title: Turn Id + description: Unique identifier for the turn within a session + tool_responses: + items: + $ref: '#/components/schemas/ToolResponse-Input' + type: array + title: Tool Responses + description: List of tool responses to submit to continue the turn + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + description: Whether to stream the response + default: false + type: object + required: + - agent_id + - session_id + - turn_id + - tool_responses + title: AgentTurnResumeRequest + description: Request to resume an agent turn with tool responses. AggregationFunctionType: type: string enum: @@ -1470,9 +2187,11 @@ components: type: array - $ref: '#/components/schemas/URL' title: Content + description: The content of the attachment. mime_type: type: string title: Mime Type + description: The MIME type of the attachment. type: object required: - content @@ -1502,9 +2221,11 @@ components: title: Identifier description: Unique identifier for this resource in llama stack provider_resource_id: + anyOf: + - type: string + - type: 'null' title: Provider Resource Id description: Unique identifier for this resource in the provider - type: string provider_id: type: string title: Provider Id @@ -1513,15 +2234,18 @@ components: type: string const: benchmark title: Type + description: The resource type, always benchmark default: benchmark dataset_id: type: string title: Dataset Id + description: The ID of the dataset to use for the benchmark scoring_functions: items: type: string type: array title: Scoring Functions + description: The scoring functions to use for the benchmark metadata: additionalProperties: true type: object @@ -1542,6 +2266,7 @@ components: - $ref: '#/components/schemas/ModelCandidate' - $ref: '#/components/schemas/AgentCandidate' title: Eval Candidate + description: The candidate to evaluate. discriminator: propertyName: type mapping: @@ -1561,18 +2286,52 @@ components: regex_parser: '#/components/schemas/RegexParserScoringFnParams' type: object title: Scoring Params - description: Map between scoring function id and parameters for each scoring - function you want to run + description: Map between scoring function id and parameters for each scoring function you want to run. num_examples: + anyOf: + - type: integer + - type: 'null' title: Num Examples - description: Number of examples to evaluate (useful for testing), if not - provided, all examples in the dataset will be evaluated - type: integer + description: The number of examples to evaluate. If not provided, all examples in the dataset will be evaluated. type: object required: - eval_candidate title: BenchmarkConfig description: A benchmark configuration for evaluation. + Body_rerank_v1alpha_inference_rerank_post: + properties: + model: + type: string + title: Model + description: The identifier of the reranking model to use. + query: + anyOf: + - type: string + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + title: Query + description: The search query to rank items against. + items: + items: + anyOf: + - type: string + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + type: array + title: Items + description: List of items to rerank. + max_num_results: + anyOf: + - type: integer + - type: 'null' + title: Max Num Results + description: 'Maximum number of results to return. Default: returns all.' + type: object + required: + - model + - query + - items + title: Body_rerank_v1alpha_inference_rerank_post BuiltinTool: type: string enum: @@ -1581,6 +2340,44 @@ components: - photogen - code_interpreter title: BuiltinTool + Checkpoint: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for the checkpoint. + created_at: + type: string + format: date-time + title: Created At + description: Timestamp when the checkpoint was created. + epoch: + type: integer + title: Epoch + description: Training epoch when the checkpoint was saved. + post_training_job_id: + type: string + title: Post Training Job Id + description: Identifier of the training job that created this checkpoint. + path: + type: string + title: Path + description: File system path where the checkpoint is stored. + training_metrics: + anyOf: + - $ref: '#/components/schemas/PostTrainingMetric' + - type: 'null' + description: Training metrics associated with this checkpoint. + type: object + required: + - identifier + - created_at + - epoch + - post_training_job_id + - path + - training_metrics + title: Checkpoint + description: Checkpoint created during training runs. CompletionMessage-Output: properties: role: @@ -1613,17 +2410,34 @@ components: stop_reason: $ref: '#/components/schemas/StopReason' tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' title: Tool Calls - items: - $ref: '#/components/schemas/ToolCall' - type: array type: object required: - content - stop_reason title: CompletionMessage - description: A message containing the model's (assistant) response in a chat - conversation. + description: "A message containing the model's (assistant) response in a chat conversation.\n\n- `StopReason.end_of_turn`: The model finished generating the entire response.\n- `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n- `StopReason.out_of_tokens`: The model ran out of token budget." + CreateAgentSessionRequest: + properties: + agent_id: + type: string + title: Agent Id + description: The ID of the agent to create the session for + session_name: + type: string + title: Session Name + description: The name of the session to create + type: object + required: + - agent_id + - session_name + title: CreateAgentSessionRequest + description: Request to create a new session for an agent. DPOAlignmentConfig: properties: beta: @@ -1659,16 +2473,22 @@ components: data_format: $ref: '#/components/schemas/DatasetFormat' validation_dataset_id: + anyOf: + - type: string + - type: 'null' title: Validation Dataset Id - type: string packed: + anyOf: + - type: boolean + - type: 'null' title: Packed default: false - type: boolean train_on_input: + anyOf: + - type: boolean + - type: 'null' title: Train On Input default: false - type: boolean type: object required: - dataset_id @@ -1684,9 +2504,11 @@ components: title: Identifier description: Unique identifier for this resource in llama stack provider_resource_id: + anyOf: + - type: string + - type: 'null' title: Provider Resource Id description: Unique identifier for this resource in the provider - type: string provider_id: type: string title: Provider Id @@ -1695,6 +2517,7 @@ components: type: string const: dataset title: Type + description: Type of resource, always 'dataset' for datasets default: dataset purpose: $ref: '#/components/schemas/DatasetPurpose' @@ -1720,8 +2543,7 @@ components: - purpose - source title: Dataset - description: Dataset resource for storing and accessing training or evaluation - data. + description: Dataset resource for storing and accessing training or evaluation data. DatasetFormat: type: string enum: @@ -1736,8 +2558,7 @@ components: - eval/question-answer - eval/messages-answer title: DatasetPurpose - description: Purpose of the dataset. Each purpose has a required input data - schema. + description: "Purpose of the dataset. Each purpose has a required input data schema.\n\n {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello, world!\"},\n {\"role\": \"assistant\", \"content\": \"Hello, world!\"},\n ]\n }\n {\n \"question\": \"What is the capital of France?\",\n \"answer\": \"Paris\"\n }\n {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello, my name is John Doe.\"},\n {\"role\": \"assistant\", \"content\": \"Hello, John Doe. How can I help you today?\"},\n {\"role\": \"user\", \"content\": \"What's my name?\"},\n ],\n \"answer\": \"John Doe\"\n }" Document: properties: content: @@ -1763,9 +2584,11 @@ components: type: array - $ref: '#/components/schemas/URL' title: Content + description: The content of the document. mime_type: type: string title: Mime Type + description: The MIME type of the document. type: object required: - content @@ -1775,24 +2598,59 @@ components: EfficiencyConfig: properties: enable_activation_checkpointing: + anyOf: + - type: boolean + - type: 'null' title: Enable Activation Checkpointing default: false - type: boolean enable_activation_offloading: + anyOf: + - type: boolean + - type: 'null' title: Enable Activation Offloading default: false - type: boolean memory_efficient_fsdp_wrap: + anyOf: + - type: boolean + - type: 'null' title: Memory Efficient Fsdp Wrap default: false - type: boolean fsdp_cpu_offload: + anyOf: + - type: boolean + - type: 'null' title: Fsdp Cpu Offload default: false - type: boolean type: object title: EfficiencyConfig description: Configuration for memory and compute efficiency optimizations. + Error: + properties: + status: + type: integer + title: Status + description: HTTP status code + title: + type: string + title: Title + description: Error title, a short summary of the error which is invariant for an error type + detail: + type: string + title: Detail + description: Error detail, a longer human-readable description of the error + instance: + anyOf: + - type: string + - type: 'null' + title: Instance + description: (Optional) A URL which can be used to retrieve more information about the specific occurrence of the error + type: object + required: + - status + - title + - detail + title: Error + description: Error response from the API. Roughly follows RFC 7807. EvaluateResponse: properties: generations: @@ -1801,17 +2659,44 @@ components: type: object type: array title: Generations + description: The generations from the evaluation. scores: additionalProperties: $ref: '#/components/schemas/ScoringResult' type: object title: Scores + description: The scores from the evaluation. Each key in the dict is a scoring function name. type: object required: - generations - scores title: EvaluateResponse description: The response from an evaluation. + EvaluateRowsRequest: + properties: + input_rows: + items: + additionalProperties: true + type: object + type: array + title: Input Rows + description: The rows to evaluate. + scoring_functions: + items: + type: string + type: array + title: Scoring Functions + description: The scoring functions to use for the evaluation. + benchmark_config: + $ref: '#/components/schemas/BenchmarkConfig' + description: The configuration for the benchmark. + type: object + required: + - input_rows + - scoring_functions + - benchmark_config + title: EvaluateRowsRequest + description: Request model for evaluating rows. GrammarResponseFormat: properties: type: @@ -1837,8 +2722,7 @@ components: default: greedy type: object title: GreedySamplingStrategy - description: Greedy sampling strategy that selects the highest probability token - at each step. + description: Greedy sampling strategy that selects the highest probability token at each step. ImageContentItem-Input: properties: type: @@ -1852,7 +2736,7 @@ components: required: - image title: ImageContentItem - description: A image content item + description: A image content item. ImageContentItem-Output: properties: type: @@ -1866,23 +2750,31 @@ components: required: - image title: ImageContentItem - description: A image content item + description: A image content item. InferenceStep-Output: properties: turn_id: type: string title: Turn Id + description: The ID of the turn. step_id: type: string title: Step Id + description: The ID of the step. started_at: + anyOf: + - type: string + format: date-time + - type: 'null' title: Started At - type: string - format: date-time + description: The time the step started. completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' title: Completed At - type: string - format: date-time + description: The time the step completed. step_type: type: string const: inference @@ -1890,6 +2782,7 @@ components: default: inference model_response: $ref: '#/components/schemas/CompletionMessage-Output' + description: The response from the LLM. type: object required: - turn_id @@ -1919,7 +2812,7 @@ components: - scheduled - cancelled title: JobStatus - description: Status of a job execution. + description: "Status of a job execution.\n:cvar completed: Job has finished successfully\n:cvar in_progress: Job is currently running\n:cvar failed: Job has failed during execution\n:cvar scheduled: Job is scheduled but not yet started\n:cvar cancelled: Job was cancelled before completion" JsonSchemaResponseFormat: properties: type: @@ -1947,8 +2840,10 @@ components: type: string title: Judge Model prompt_template: + anyOf: + - type: string + - type: 'null' title: Prompt Template - type: string judge_score_regexes: items: type: string @@ -1973,10 +2868,12 @@ components: $ref: '#/components/schemas/Benchmark' type: array title: Data + description: List of benchmark resources type: object required: - data title: ListBenchmarksResponse + description: Response model for listing benchmarks. ListDatasetsResponse: properties: data: @@ -1984,6 +2881,7 @@ components: $ref: '#/components/schemas/Dataset' type: array title: Data + description: List of datasets type: object required: - data @@ -1996,26 +2894,80 @@ components: $ref: '#/components/schemas/PostTrainingJob' type: array title: Data + description: The list of training jobs type: object required: - data title: ListPostTrainingJobsResponse + LoraFinetuningConfig: + properties: + type: + type: string + const: LoRA + title: Type + default: LoRA + lora_attn_modules: + items: + type: string + type: array + title: Lora Attn Modules + apply_lora_to_mlp: + type: boolean + title: Apply Lora To Mlp + apply_lora_to_output: + type: boolean + title: Apply Lora To Output + rank: + type: integer + title: Rank + alpha: + type: integer + title: Alpha + use_dora: + anyOf: + - type: boolean + - type: 'null' + title: Use Dora + default: false + quantize_base: + anyOf: + - type: boolean + - type: 'null' + title: Quantize Base + default: false + type: object + required: + - lora_attn_modules + - apply_lora_to_mlp + - apply_lora_to_output + - rank + - alpha + title: LoraFinetuningConfig + description: Configuration for Low-Rank Adaptation (LoRA) fine-tuning. MemoryRetrievalStep-Output: properties: turn_id: type: string title: Turn Id + description: The ID of the turn. step_id: type: string title: Step Id + description: The ID of the step. started_at: + anyOf: + - type: string + format: date-time + - type: 'null' title: Started At - type: string - format: date-time + description: The time the step started. completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' title: Completed At - type: string - format: date-time + description: The time the step completed. step_type: type: string const: memory_retrieval @@ -2024,6 +2976,7 @@ components: vector_store_ids: type: string title: Vector Store Ids + description: The IDs of the vector databases to retrieve context from. inserted_context: anyOf: - type: string @@ -2046,6 +2999,7 @@ components: text: '#/components/schemas/TextContentItem' type: array title: Inserted Context + description: The context retrieved from the vector databases. type: object required: - turn_id @@ -2060,20 +3014,70 @@ components: type: string const: model title: Type + description: The type of candidate. default: model model: type: string title: Model + description: The model ID to evaluate. sampling_params: $ref: '#/components/schemas/SamplingParams' + description: The sampling parameters for the model. system_message: - $ref: '#/components/schemas/SystemMessage' + anyOf: + - $ref: '#/components/schemas/SystemMessage' + - type: 'null' + description: The system message providing instructions or context to the model. type: object required: - model - sampling_params title: ModelCandidate description: A model candidate for evaluation. + OpenAIChatCompletionContentPartImageParam: + properties: + type: + type: string + const: image_url + title: Type + default: image_url + image_url: + $ref: '#/components/schemas/OpenAIImageURL' + type: object + required: + - image_url + title: OpenAIChatCompletionContentPartImageParam + description: Image content part for OpenAI-compatible chat completion messages. + OpenAIChatCompletionContentPartTextParam: + properties: + type: + type: string + const: text + title: Type + default: text + text: + type: string + title: Text + type: object + required: + - text + title: OpenAIChatCompletionContentPartTextParam + description: Text content part for OpenAI-compatible chat completion messages. + OpenAIImageURL: + properties: + url: + type: string + title: Url + detail: + anyOf: + - type: string + - type: 'null' + title: Detail + type: object + required: + - url + title: OpenAIImageURL + description: Image URL specification for OpenAI-compatible chat completion messages. OptimizerConfig: properties: optimizer_type: @@ -2103,15 +3107,181 @@ components: - sgd title: OptimizerType description: Available optimizer algorithms for training. + PaginatedResponse: + properties: + data: + items: + additionalProperties: true + type: object + type: array + title: Data + description: The list of items for the current page. + has_more: + type: boolean + title: Has More + description: Whether there are more items available after this set. + url: + anyOf: + - type: string + - type: 'null' + title: Url + description: The URL for accessing this list. + type: object + required: + - data + - has_more + - url + title: PaginatedResponse + description: A generic paginated response that follows a simple format. PostTrainingJob: properties: job_uuid: type: string title: Job Uuid + description: The UUID of the job type: object required: - job_uuid title: PostTrainingJob + PostTrainingJobArtifactsResponse: + properties: + job_uuid: + type: string + title: Job Uuid + description: The UUID of the job + checkpoints: + items: + $ref: '#/components/schemas/Checkpoint' + type: array + title: Checkpoints + type: object + required: + - job_uuid + title: PostTrainingJobArtifactsResponse + description: Artifacts of a finetuning job. + PostTrainingJobStatusResponse: + properties: + job_uuid: + type: string + title: Job Uuid + status: + $ref: '#/components/schemas/JobStatus' + scheduled_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Scheduled At + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + resources_allocated: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Resources Allocated + checkpoints: + items: + $ref: '#/components/schemas/Checkpoint' + type: array + title: Checkpoints + type: object + required: + - job_uuid + - status + title: PostTrainingJobStatusResponse + description: Status of a finetuning job. + PostTrainingMetric: + properties: + epoch: + type: integer + title: Epoch + description: Training epoch number. + train_loss: + type: number + title: Train Loss + description: Loss value on the training dataset. + validation_loss: + type: number + title: Validation Loss + description: Loss value on the validation dataset. + perplexity: + type: number + title: Perplexity + description: Perplexity metric indicating model confidence. + type: object + required: + - epoch + - train_loss + - validation_loss + - perplexity + title: PostTrainingMetric + description: Training metrics captured during post-training jobs. + PreferenceOptimizeRequest: + properties: + job_uuid: + type: string + title: Job Uuid + description: The UUID of the job to create + finetuned_model: + type: string + title: Finetuned Model + description: The model to fine-tune + algorithm_config: + $ref: '#/components/schemas/DPOAlignmentConfig' + description: The algorithm configuration + training_config: + $ref: '#/components/schemas/TrainingConfig' + description: The training configuration + hyperparam_search_config: + additionalProperties: true + type: object + title: Hyperparam Search Config + description: The hyperparam search configuration + logger_config: + additionalProperties: true + type: object + title: Logger Config + description: The logger configuration + type: object + required: + - job_uuid + - finetuned_model + - algorithm_config + - training_config + - hyperparam_search_config + - logger_config + title: PreferenceOptimizeRequest + description: Request to run preference optimization of a model. + QATFinetuningConfig: + properties: + type: + type: string + const: QAT + title: Type + default: QAT + quantizer_name: + type: string + title: Quantizer Name + group_size: + type: integer + title: Group Size + type: object + required: + - quantizer_name + - group_size + title: QATFinetuningConfig + description: Configuration for Quantization-Aware Training (QAT) fine-tuning. RegexParserScoringFnParams: properties: type: @@ -2134,30 +3304,107 @@ components: type: object title: RegexParserScoringFnParams description: Parameters for regex parser scoring function configuration. - RerankData: - properties: - index: - type: integer - title: Index - relevance_score: - type: number - title: Relevance Score - type: object - required: - - index - - relevance_score - title: RerankData - description: A single rerank result from a reranking response. - RerankResponse: + RegisterBenchmarkRequest: properties: - data: + benchmark_id: + type: string + title: Benchmark Id + description: The ID of the benchmark to register + dataset_id: + type: string + title: Dataset Id + description: The ID of the dataset to use for the benchmark + scoring_functions: items: - $ref: '#/components/schemas/RerankData' + type: string type: array - title: Data + title: Scoring Functions + description: The scoring functions to use for the benchmark + provider_benchmark_id: + anyOf: + - type: string + - type: 'null' + title: Provider Benchmark Id + description: The ID of the provider benchmark to use for the benchmark + provider_id: + anyOf: + - type: string + - type: 'null' + title: Provider Id + description: The ID of the provider to use for the benchmark + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: The metadata to use for the benchmark type: object required: - - data + - benchmark_id + - dataset_id + - scoring_functions + title: RegisterBenchmarkRequest + description: Request model for registering a benchmark. + RegisterDatasetRequest: + properties: + purpose: + $ref: '#/components/schemas/DatasetPurpose' + description: The purpose of the dataset + source: + oneOf: + - $ref: '#/components/schemas/URIDataSource' + - $ref: '#/components/schemas/RowsDataSource' + title: Source + description: The data source of the dataset + discriminator: + propertyName: type + mapping: + rows: '#/components/schemas/RowsDataSource' + uri: '#/components/schemas/URIDataSource' + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: The metadata for the dataset + dataset_id: + anyOf: + - type: string + - type: 'null' + title: Dataset Id + description: The ID of the dataset. If not provided, an ID will be generated + type: object + required: + - purpose + - source + title: RegisterDatasetRequest + description: Request model for registering a dataset. + RerankData: + properties: + index: + type: integer + title: Index + relevance_score: + type: number + title: Relevance Score + type: object + required: + - index + - relevance_score + title: RerankData + description: A single rerank result from a reranking response. + RerankResponse: + properties: + data: + items: + $ref: '#/components/schemas/RerankData' + type: array + title: Data + type: object + required: + - data title: RerankResponse description: Response from a reranking request. RowsDataSource: @@ -2166,6 +3413,7 @@ components: type: string const: rows title: Type + description: The type of data source default: rows rows: items: @@ -2173,6 +3421,7 @@ components: type: object type: array title: Rows + description: "The dataset is stored in rows. E.g. [{'messages': [{'role': 'user', 'content': 'Hello, world!'}, {'role': 'assistant', 'content': 'Hello, world!'}]}]" type: object required: - rows @@ -2182,13 +3431,18 @@ components: properties: violation_level: $ref: '#/components/schemas/ViolationLevel' + description: Severity level of the violation. user_message: + anyOf: + - type: string + - type: 'null' title: User Message - type: string + description: Message to convey to the user about the violation. metadata: additionalProperties: true type: object title: Metadata + description: Additional metadata including specific violation codes for debugging and telemetry. type: object required: - violation_level @@ -2209,17 +3463,23 @@ components: top_k: '#/components/schemas/TopKSamplingStrategy' top_p: '#/components/schemas/TopPSamplingStrategy' max_tokens: + anyOf: + - type: integer + - type: 'null' title: Max Tokens - type: integer repetition_penalty: + anyOf: + - type: number + - type: 'null' title: Repetition Penalty default: 1.0 - type: number stop: + anyOf: + - items: + type: string + type: array + - type: 'null' title: Stop - items: - type: string - type: array type: object title: SamplingParams description: Sampling parameters. @@ -2231,44 +3491,85 @@ components: type: object type: array title: Score Rows + description: The scoring result for each row. Each row is a map of column name to value aggregated_results: additionalProperties: true type: object title: Aggregated Results + description: Map of metric name to aggregated value type: object required: - score_rows - aggregated_results title: ScoringResult description: A scoring result for a single row. + Session: + properties: + session_id: + type: string + title: Session Id + description: Unique identifier for the conversation session + session_name: + type: string + title: Session Name + description: Human-readable name for the session + turns: + items: + $ref: '#/components/schemas/Turn' + type: array + title: Turns + description: List of all turns that have occurred in this session + started_at: + type: string + format: date-time + title: Started At + description: Timestamp when the session was created + type: object + required: + - session_id + - session_name + - turns + - started_at + title: Session + description: A single session of an interaction with an Agentic System. ShieldCallStep-Output: properties: turn_id: type: string title: Turn Id + description: The ID of the turn. step_id: type: string title: Step Id + description: The ID of the step. started_at: + anyOf: + - type: string + format: date-time + - type: 'null' title: Started At - type: string - format: date-time + description: The time the step started. completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' title: Completed At - type: string - format: date-time + description: The time the step completed. step_type: type: string const: shield_call title: Step Type default: shield_call violation: - $ref: '#/components/schemas/SafetyViolation' + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + description: The violation from the shield call. type: object required: - turn_id - step_id - - violation title: ShieldCallStep description: A shield call step in an agent turn. StopReason: @@ -2278,6 +3579,58 @@ components: - end_of_message - out_of_tokens title: StopReason + SupervisedFineTuneRequest: + properties: + job_uuid: + type: string + title: Job Uuid + description: The UUID of the job to create + training_config: + $ref: '#/components/schemas/TrainingConfig' + description: The training configuration + hyperparam_search_config: + additionalProperties: true + type: object + title: Hyperparam Search Config + description: The hyperparam search configuration + logger_config: + additionalProperties: true + type: object + title: Logger Config + description: The logger configuration + model: + anyOf: + - type: string + - type: 'null' + title: Model + description: Model descriptor for training if not in provider config` + checkpoint_dir: + anyOf: + - type: string + - type: 'null' + title: Checkpoint Dir + description: The directory to save checkpoint(s) to + algorithm_config: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LoraFinetuningConfig' + - $ref: '#/components/schemas/QATFinetuningConfig' + discriminator: + propertyName: type + mapping: + LoRA: '#/components/schemas/LoraFinetuningConfig' + QAT: '#/components/schemas/QATFinetuningConfig' + - type: 'null' + title: Algorithm Config + description: The algorithm configuration + type: object + required: + - job_uuid + - training_config + - hyperparam_search_config + - logger_config + title: SupervisedFineTuneRequest + description: Request to run supervised fine-tuning of a model. SystemMessage: properties: role: @@ -2318,7 +3671,7 @@ components: - append - replace title: SystemMessageBehavior - description: Config for how to override the default system prompt. + description: "Config for how to override the default system prompt.\n\nhttps://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt-\n'{{function_definitions}}' to indicate where the function definitions should be inserted." TextContentItem: properties: type: @@ -2333,7 +3686,7 @@ components: required: - text title: TextContentItem - description: A text content item + description: A text content item. ToolCall: properties: call_id: @@ -2360,48 +3713,67 @@ components: - required - none title: ToolChoice - description: Whether tool use is required or automatic. This is a hint to the - model which may not be followed. It depends on the Instruction Following capabilities - of the model. + description: Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model. ToolConfig: properties: tool_choice: anyOf: - $ref: '#/components/schemas/ToolChoice' - type: string + - type: 'null' title: Tool Choice default: auto tool_prompt_format: - $ref: '#/components/schemas/ToolPromptFormat' + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' system_message_behavior: + anyOf: + - $ref: '#/components/schemas/SystemMessageBehavior' + - type: 'null' default: append - $ref: '#/components/schemas/SystemMessageBehavior' type: object title: ToolConfig - description: Configuration for tool use. + description: "Configuration for tool use.\n\n- `ToolPromptFormat.json`: The tool calls are formatted as a JSON object.\n- `ToolPromptFormat.function_tag`: The tool calls are enclosed in a tag.\n- `ToolPromptFormat.python_list`: The tool calls are output as Python syntax -- a list of function calls.\n- `SystemMessageBehavior.append`: Appends the provided system message to the default system prompt.\n- `SystemMessageBehavior.replace`: Replaces the default system prompt with the provided system message. The system message can include the string\n '{{function_definitions}}' to indicate where the function definitions should be inserted." ToolDef: properties: toolgroup_id: + anyOf: + - type: string + - type: 'null' title: Toolgroup Id - type: string + description: ID of the tool group this tool belongs to name: type: string title: Name + description: Name of the tool description: + anyOf: + - type: string + - type: 'null' title: Description - type: string + description: Human-readable description of what the tool does input_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' title: Input Schema - additionalProperties: true - type: object + description: JSON Schema for tool inputs (MCP inputSchema) output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' title: Output Schema - additionalProperties: true - type: object + description: JSON Schema for tool outputs (MCP outputSchema) metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' title: Metadata - additionalProperties: true - type: object + description: Additional metadata about the tool type: object required: - name @@ -2412,17 +3784,25 @@ components: turn_id: type: string title: Turn Id + description: The ID of the turn. step_id: type: string title: Step Id + description: The ID of the step. started_at: + anyOf: + - type: string + format: date-time + - type: 'null' title: Started At - type: string - format: date-time + description: The time the step started. completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' title: Completed At - type: string - format: date-time + description: The time the step completed. step_type: type: string const: tool_execution @@ -2433,11 +3813,13 @@ components: $ref: '#/components/schemas/ToolCall' type: array title: Tool Calls + description: The tool calls to execute. tool_responses: items: $ref: '#/components/schemas/ToolResponse-Output' type: array title: Tool Responses + description: The tool responses from the tool calls. type: object required: - turn_id @@ -2453,7 +3835,7 @@ components: - function_tag - python_list title: ToolPromptFormat - description: Prompt format for calling custom / zero shot tools. + description: "Prompt format for calling custom / zero shot tools.\n\n:cvar json: JSON format for calling tools. It takes the form:\n {\n \"type\": \"function\",\n \"function\" : {\n \"name\": \"function_name\",\n \"description\": \"function_description\",\n \"parameters\": {...}\n }\n }\n:cvar function_tag: Function tag format, pseudo-XML. This looks like:\n (parameters)\n\n:cvar python_list: Python list. The output is a valid Python expression that can be\n evaluated to a list. Each element in the list is a function call. Example:\n [\"function_name(param1, param2)\", \"function_name(param1, param2)\"]" ToolResponse-Input: properties: call_id: @@ -2487,9 +3869,11 @@ components: type: array title: Content metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' title: Metadata - additionalProperties: true - type: object type: object required: - call_id @@ -2530,9 +3914,11 @@ components: type: array title: Content metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' title: Metadata - additionalProperties: true - type: object type: object required: - call_id @@ -2540,6 +3926,44 @@ components: - content title: ToolResponse description: Response from a tool invocation. + ToolResponseMessage-Input: + properties: + role: + type: string + const: tool + title: Role + default: tool + call_id: + type: string + title: Call Id + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + type: object + required: + - call_id + - content + title: ToolResponseMessage + description: A message representing the result of a tool invocation. ToolResponseMessage-Output: properties: role: @@ -2593,8 +4017,7 @@ components: required: - top_k title: TopKSamplingStrategy - description: Top-k sampling strategy that restricts sampling to the k most likely - tokens. + description: Top-k sampling strategy that restricts sampling to the k most likely tokens. TopPSamplingStrategy: properties: type: @@ -2603,19 +4026,22 @@ components: title: Type default: top_p temperature: + anyOf: + - type: number + minimum: 0.0 + - type: 'null' title: Temperature - type: number - minimum: 0.0 top_p: + anyOf: + - type: number + - type: 'null' title: Top P default: 0.95 - type: number type: object required: - temperature title: TopPSamplingStrategy - description: Top-p (nucleus) sampling strategy that samples from the smallest - set of tokens with cumulative probability >= p. + description: Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p. TrainingConfig: properties: n_epochs: @@ -2630,19 +4056,29 @@ components: title: Gradient Accumulation Steps default: 1 max_validation_steps: + anyOf: + - type: integer + - type: 'null' title: Max Validation Steps default: 1 - type: integer data_config: - $ref: '#/components/schemas/DataConfig' + anyOf: + - $ref: '#/components/schemas/DataConfig' + - type: 'null' optimizer_config: - $ref: '#/components/schemas/OptimizerConfig' + anyOf: + - $ref: '#/components/schemas/OptimizerConfig' + - type: 'null' efficiency_config: - $ref: '#/components/schemas/EfficiencyConfig' + anyOf: + - $ref: '#/components/schemas/EfficiencyConfig' + - type: 'null' dtype: + anyOf: + - type: string + - type: 'null' title: Dtype default: bf16 - type: string type: object required: - n_epochs @@ -2653,9 +4089,11 @@ components: turn_id: type: string title: Turn Id + description: Unique identifier for the turn within a session session_id: type: string title: Session Id + description: Unique identifier for the conversation session input_messages: items: anyOf: @@ -2663,6 +4101,7 @@ components: - $ref: '#/components/schemas/ToolResponseMessage-Output' type: array title: Input Messages + description: List of messages that initiated this turn steps: items: oneOf: @@ -2679,21 +4118,30 @@ components: tool_execution: '#/components/schemas/ToolExecutionStep-Output' type: array title: Steps + description: Ordered list of processing steps executed during this turn output_message: $ref: '#/components/schemas/CompletionMessage-Output' + description: The model's generated response containing content and metadata output_attachments: + anyOf: + - items: + $ref: '#/components/schemas/Attachment-Output' + type: array + - type: 'null' title: Output Attachments - items: - $ref: '#/components/schemas/Attachment-Output' - type: array + description: Files or media attached to the agent's response started_at: type: string format: date-time title: Started At + description: Timestamp when the turn began completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' title: Completed At - type: string - format: date-time + description: Timestamp when the turn finished, if completed type: object required: - turn_id @@ -2710,10 +4158,12 @@ components: type: string const: uri title: Type + description: The type of data source default: uri uri: type: string title: Uri + description: The dataset can be obtained from a URI. E.g. 'https://mywebsite.com/mydata.jsonl', 'lsfs://mydata.jsonl', 'data:csv;base64,{base64_content}' type: object required: - uri @@ -2779,6 +4229,7 @@ components: image: '#/components/schemas/ImageContentItem-Input' text: '#/components/schemas/TextContentItem' type: array + - type: 'null' title: Context type: object required: @@ -2835,6 +4286,7 @@ components: image: '#/components/schemas/ImageContentItem-Output' text: '#/components/schemas/TextContentItem' type: array + - type: 'null' title: Context type: object required: @@ -2848,632 +4300,19 @@ components: - warn - error title: ViolationLevel - description: Severity level of a safety violation. + description: "Severity level of a safety violation.\n\n:cvar INFO: Informational level violation that does not require action\n:cvar WARN: Warning level violation that suggests caution but allows continuation\n:cvar ERROR: Error level violation that requires blocking or intervention" _URLOrData: properties: url: - $ref: '#/components/schemas/URL' + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' data: + anyOf: + - type: string + - type: 'null' contentEncoding: base64 title: Data - type: string type: object title: _URLOrData - description: A URL or a base64 encoded string - __main_____agents_agent_id_session_Request: - properties: - agent_id: - type: string - title: Agent Id - session_name: - type: string - title: Session Name - type: object - required: - - agent_id - - session_name - title: _agents_agent_id_session_Request - __main_____agents_agent_id_session_session_id_turn_Request: - properties: - agent_id: - type: string - title: Agent Id - session_id: - type: string - title: Session Id - messages: - $ref: '#/components/schemas/UserMessage-Input' - stream: - type: boolean - title: Stream - default: false - documents: - $ref: '#/components/schemas/Document' - toolgroups: - anyOf: - - type: string - - $ref: '#/components/schemas/AgentToolGroupWithArgs' - title: Toolgroups - tool_config: - $ref: '#/components/schemas/ToolConfig' - type: object - required: - - agent_id - - session_id - - messages - - documents - - toolgroups - - tool_config - title: _agents_agent_id_session_session_id_turn_Request - __main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request: - properties: - agent_id: - type: string - title: Agent Id - session_id: - type: string - title: Session Id - turn_id: - type: string - title: Turn Id - tool_responses: - $ref: '#/components/schemas/ToolResponse-Input' - stream: - type: boolean - title: Stream - default: false - type: object - required: - - agent_id - - session_id - - turn_id - - tool_responses - title: _agents_agent_id_session_session_id_turn_turn_id_resume_Request - __main_____datasets_Request: - properties: - purpose: - $ref: '#/components/schemas/DatasetPurpose' - metadata: - type: string - title: Metadata - dataset_id: - type: string - title: Dataset Id - type: object - required: - - purpose - - metadata - - dataset_id - title: _datasets_Request - _inference_rerank_Request: - properties: - model: - type: string - title: Model - query: - type: string - title: Query - items: - type: string - title: Items - max_num_results: - type: integer - title: Max Num Results - type: object - required: - - model - - query - - items - - max_num_results - title: _inference_rerank_Request - Error: - description: Error response from the API. Roughly follows RFC 7807. - properties: - status: - title: Status - type: integer - title: - title: Title - type: string - detail: - title: Detail - type: string - instance: - title: Instance - type: string - nullable: true - required: - - status - - title - - detail - title: Error - type: object - Agent: - description: An agent instance with configuration and metadata. - properties: - agent_id: - title: Agent Id - type: string - agent_config: - $ref: '#/components/schemas/AgentConfig' - created_at: - format: date-time - title: Created At - type: string - required: - - agent_id - - agent_config - - created_at - title: Agent - type: object - AgentStepResponse: - description: Response containing details of a specific agent step. - properties: - step: - discriminator: - mapping: - inference: '#/$defs/InferenceStep' - memory_retrieval: '#/$defs/MemoryRetrievalStep' - shield_call: '#/$defs/ShieldCallStep' - tool_execution: '#/$defs/ToolExecutionStep' - propertyName: step_type - oneOf: - - $ref: '#/components/schemas/InferenceStep' - - $ref: '#/components/schemas/ToolExecutionStep' - - $ref: '#/components/schemas/ShieldCallStep' - - $ref: '#/components/schemas/MemoryRetrievalStep' - title: Step - required: - - step - title: AgentStepResponse - type: object - CompletionMessage: - description: A message containing the model's (assistant) response in a chat - conversation. - properties: - role: - const: assistant - default: assistant - title: Role - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' - type: array - title: Content - stop_reason: - $ref: '#/components/schemas/StopReason' - tool_calls: - title: Tool Calls - items: - $ref: '#/components/schemas/ToolCall' - type: array - required: - - content - - stop_reason - title: CompletionMessage - type: object - InferenceStep: - description: An inference step in an agent turn. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - title: Started At - format: date-time - type: string - nullable: true - completed_at: - title: Completed At - format: date-time - type: string - nullable: true - step_type: - const: inference - default: inference - title: Step Type - type: string - model_response: - $ref: '#/components/schemas/CompletionMessage' - required: - - turn_id - - step_id - - model_response - title: InferenceStep - type: object - MemoryRetrievalStep: - description: A memory retrieval step in an agent turn. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - title: Started At - format: date-time - type: string - nullable: true - completed_at: - title: Completed At - format: date-time - type: string - nullable: true - step_type: - const: memory_retrieval - default: memory_retrieval - title: Step Type - type: string - vector_store_ids: - title: Vector Store Ids - type: string - inserted_context: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' - type: array - title: Inserted Context - required: - - turn_id - - step_id - - vector_store_ids - - inserted_context - title: MemoryRetrievalStep - type: object - PaginatedResponse: - description: A generic paginated response that follows a simple format. - properties: - data: - items: - additionalProperties: true - type: object - title: Data - type: array - has_more: - title: Has More - type: boolean - url: - title: Url - type: string - nullable: true - required: - - data - - has_more - title: PaginatedResponse - type: object - Session: - description: A single session of an interaction with an Agentic System. - properties: - session_id: - title: Session Id - type: string - session_name: - title: Session Name - type: string - turns: - items: - $ref: '#/components/schemas/Turn' - title: Turns - type: array - started_at: - format: date-time - title: Started At - type: string - required: - - session_id - - session_name - - turns - - started_at - title: Session - type: object - ShieldCallStep: - description: A shield call step in an agent turn. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - title: Started At - format: date-time - type: string - nullable: true - completed_at: - title: Completed At - format: date-time - type: string - nullable: true - step_type: - const: shield_call - default: shield_call - title: Step Type - type: string - violation: - $ref: '#/components/schemas/SafetyViolation' - required: - - turn_id - - step_id - - violation - title: ShieldCallStep - type: object - ToolExecutionStep: - description: A tool execution step in an agent turn. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - title: Started At - format: date-time - type: string - nullable: true - completed_at: - title: Completed At - format: date-time - type: string - nullable: true - step_type: - const: tool_execution - default: tool_execution - title: Step Type - type: string - tool_calls: - items: - $ref: '#/components/schemas/ToolCall' - title: Tool Calls - type: array - tool_responses: - items: - $ref: '#/components/schemas/ToolResponse' - title: Tool Responses - type: array - required: - - turn_id - - step_id - - tool_calls - - tool_responses - title: ToolExecutionStep - type: object - ToolResponse: - description: Response from a tool invocation. - properties: - call_id: - title: Call Id - type: string - tool_name: - anyOf: - - $ref: '#/components/schemas/BuiltinTool' - - type: string - title: Tool Name - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' - type: array - title: Content - metadata: - title: Metadata - additionalProperties: true - type: object - nullable: true - required: - - call_id - - tool_name - - content - title: ToolResponse - type: object - Checkpoint: - description: Checkpoint created during training runs. - properties: - identifier: - title: Identifier - type: string - created_at: - format: date-time - title: Created At - type: string - epoch: - title: Epoch - type: integer - post_training_job_id: - title: Post Training Job Id - type: string - path: - title: Path - type: string - training_metrics: - $ref: '#/components/schemas/PostTrainingMetric' - nullable: true - required: - - identifier - - created_at - - epoch - - post_training_job_id - - path - title: Checkpoint - type: object - PostTrainingJobArtifactsResponse: - description: Artifacts of a finetuning job. - properties: - job_uuid: - title: Job Uuid - type: string - checkpoints: - items: - $ref: '#/components/schemas/Checkpoint' - title: Checkpoints - type: array - required: - - job_uuid - title: PostTrainingJobArtifactsResponse - type: object - PostTrainingJobStatusResponse: - description: Status of a finetuning job. - properties: - job_uuid: - title: Job Uuid - type: string - status: - $ref: '#/components/schemas/JobStatus' - scheduled_at: - title: Scheduled At - format: date-time - type: string - nullable: true - started_at: - title: Started At - format: date-time - type: string - nullable: true - completed_at: - title: Completed At - format: date-time - type: string - nullable: true - resources_allocated: - title: Resources Allocated - additionalProperties: true - type: object - nullable: true - checkpoints: - items: - $ref: '#/components/schemas/Checkpoint' - title: Checkpoints - type: array - required: - - job_uuid - - status - title: PostTrainingJobStatusResponse - type: object - ImageContentItem: - description: A image content item - properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/components/schemas/_URLOrData' - required: - - image - title: ImageContentItem - type: object - PostTrainingMetric: - description: Training metrics captured during post-training jobs. - properties: - epoch: - title: Epoch - type: integer - train_loss: - title: Train Loss - type: number - validation_loss: - title: Validation Loss - type: number - perplexity: - title: Perplexity - type: number - required: - - epoch - - train_loss - - validation_loss - - perplexity - title: PostTrainingMetric - type: object - responses: - BadRequest400: - description: The request was invalid or malformed - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 400 - title: Bad Request - detail: The request was invalid or malformed - TooManyRequests429: - description: The client has sent too many requests in a given amount of time - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 429 - title: Too Many Requests - detail: You have exceeded the rate limit. Please try again later. - InternalServerError500: - description: The server encountered an unexpected error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 500 - title: Internal Server Error - detail: An unexpected error occurred. Our team has been notified. - DefaultError: - description: An unexpected error occurred - content: - application/json: - schema: - $ref: '#/components/schemas/Error' + description: A URL or a base64 encoded string. diff --git a/docs/static/llama-stack-spec.json b/docs/static/llama-stack-spec.json deleted file mode 100644 index 396640dab0..0000000000 --- a/docs/static/llama-stack-spec.json +++ /dev/null @@ -1,11541 +0,0 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "Llama Stack API", - "description": "A comprehensive API for building and deploying AI applications", - "version": "1.0.0" - }, - "servers": [ - { - "url": "https://api.llamastack.com", - "description": "Production server" - }, - { - "url": "https://staging-api.llamastack.com", - "description": "Staging server" - } - ], - "paths": { - "/v1/batches": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all batches for the current user.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_batches_v1_batches_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - } - ], - "responses": { - "200": { - "description": "A list of batch objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListBatchesResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Create a new batch for processing multiple API requests.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_batch_v1_batches_post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_batches_Request" - } - } - } - }, - "responses": { - "200": { - "description": "The created batch object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Batch" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/batches/{batch_id}": { - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve information about a specific batch.", - "description": "Query endpoint for proper schema generation.", - "operationId": "retrieve_batch_v1_batches__batch_id__get", - "parameters": [ - { - "name": "batch_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Batch Id" - }, - "description": "The ID of the batch to retrieve." - } - ], - "responses": { - "200": { - "description": "The batch object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Batch" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/batches/{batch_id}/cancel": { - "post": { - "tags": [ - "V1" - ], - "summary": "Cancel a batch that is in progress.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "cancel_batch_v1_batches__batch_id__cancel_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_batches_batch_id_cancel_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "The updated batch object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Batch" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "batch_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the batch to cancel." - } - ] - } - }, - "/v1/chat/completions": { - "get": { - "tags": [ - "V1" - ], - "summary": "List chat completions.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_chat_completions_v1_chat_completions_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "model", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Model" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "$ref": "#/components/schemas/Order", - "default": "desc" - } - } - ], - "responses": { - "200": { - "description": "A ListOpenAIChatCompletionResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListOpenAIChatCompletionResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Create chat completions.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_chat_completion_v1_chat_completions_post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIChatCompletionRequestWithExtraBody" - } - } - } - }, - "responses": { - "200": { - "description": "An OpenAIChatCompletion.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIChatCompletion" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/chat/completions/{completion_id}": { - "get": { - "tags": [ - "V1" - ], - "summary": "Get chat completion.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_chat_completion_v1_chat_completions__completion_id__get", - "parameters": [ - { - "name": "completion_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Completion Id" - }, - "description": "ID of the chat completion." - } - ], - "responses": { - "200": { - "description": "A OpenAICompletionWithInputMessages.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAICompletionWithInputMessages" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/completions": { - "post": { - "tags": [ - "V1" - ], - "summary": "Create completion.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_completion_v1_completions_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAICompletionRequestWithExtraBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "An OpenAICompletion.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAICompletion" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/conversations": { - "post": { - "tags": [ - "V1" - ], - "summary": "Create a conversation.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_conversation_v1_conversations_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_conversations_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "The created conversation object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Conversation" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/conversations/{conversation_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete a conversation.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_delete_conversation_v1_conversations__conversation_id__delete", - "parameters": [ - { - "name": "conversation_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Conversation Id" - }, - "description": "The conversation identifier." - } - ], - "responses": { - "200": { - "description": "The deleted conversation resource.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConversationDeletedResource" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve a conversation.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_conversation_v1_conversations__conversation_id__get", - "parameters": [ - { - "name": "conversation_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Conversation Id" - }, - "description": "The conversation identifier." - } - ], - "responses": { - "200": { - "description": "The conversation object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Conversation" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Update a conversation.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "update_conversation_v1_conversations__conversation_id__post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_conversations_conversation_id_Request" - } - } - } - }, - "responses": { - "200": { - "description": "The updated conversation object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Conversation" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - }, - "parameters": [ - { - "name": "conversation_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The conversation identifier." - } - ] - } - }, - "/v1/conversations/{conversation_id}/items": { - "get": { - "tags": [ - "V1" - ], - "summary": "List items.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_items_v1_conversations__conversation_id__items_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "include", - "in": "query", - "required": true, - "schema": { - "$ref": "#/components/schemas/ConversationItemInclude" - } - }, - { - "name": "limit", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Order" - } - }, - { - "name": "conversation_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Conversation Id" - }, - "description": "The conversation identifier." - } - ], - "responses": { - "200": { - "description": "List of conversation items.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConversationItemList" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Create items.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "add_items_v1_conversations__conversation_id__items_post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_conversations_conversation_id_items_Request" - } - } - } - }, - "responses": { - "200": { - "description": "List of created items.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConversationItemList" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - }, - "parameters": [ - { - "name": "conversation_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The conversation identifier." - } - ] - } - }, - "/v1/conversations/{conversation_id}/items/{item_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete an item.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_delete_conversation_item_v1_conversations__conversation_id__items__item_id__delete", - "parameters": [ - { - "name": "conversation_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Conversation Id" - }, - "description": "The conversation identifier." - }, - { - "name": "item_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Item Id" - }, - "description": "The item identifier." - } - ], - "responses": { - "200": { - "description": "The deleted item resource.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConversationItemDeletedResource" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve an item.", - "description": "Query endpoint for proper schema generation.", - "operationId": "retrieve_v1_conversations__conversation_id__items__item_id__get", - "parameters": [ - { - "name": "conversation_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Conversation Id" - }, - "description": "The conversation identifier." - }, - { - "name": "item_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Item Id" - }, - "description": "The item identifier." - } - ], - "responses": { - "200": { - "description": "The conversation item.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIResponseMessage" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/embeddings": { - "post": { - "tags": [ - "V1" - ], - "summary": "Create embeddings.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_embeddings_v1_embeddings_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "An OpenAIEmbeddingsResponse containing the embeddings.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIEmbeddingsResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/files": { - "get": { - "tags": [ - "V1" - ], - "summary": "List files.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_list_files_v1_files_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "purpose", - "in": "query", - "required": true, - "schema": { - "$ref": "#/components/schemas/OpenAIFilePurpose" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 10000, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "$ref": "#/components/schemas/Order", - "default": "desc" - } - } - ], - "responses": { - "200": { - "description": "An ListOpenAIFileResponse containing the list of files.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListOpenAIFileResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Upload file.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "openai_upload_file_v1_files_post", - "responses": { - "200": { - "description": "An OpenAIFileObject representing the uploaded file.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIFileObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/files/{file_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete file.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_delete_file_v1_files__file_id__delete", - "parameters": [ - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "File Id" - }, - "description": "The ID of the file to use for this request." - } - ], - "responses": { - "200": { - "description": "An OpenAIFileDeleteResponse indicating successful deletion.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIFileDeleteResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve file.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_retrieve_file_v1_files__file_id__get", - "parameters": [ - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "File Id" - }, - "description": "The ID of the file to use for this request." - } - ], - "responses": { - "200": { - "description": "An OpenAIFileObject containing file information.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIFileObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/files/{file_id}/content": { - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve file content.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "openai_retrieve_file_content_v1_files__file_id__content_get", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the file to use for this request." - } - ], - "responses": { - "200": { - "description": "The raw file content as a binary response.", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/health": { - "get": { - "tags": [ - "V1" - ], - "summary": "Get health status.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "health_v1_health_get", - "responses": { - "200": { - "description": "Health information indicating if the service is operational.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HealthInfo" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/inspect/routes": { - "get": { - "tags": [ - "V1" - ], - "summary": "List routes.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_routes_v1_inspect_routes_get", - "responses": { - "200": { - "description": "Response containing information about all available routes.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListRoutesResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/models": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all models.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_models_v1_models_get", - "responses": { - "200": { - "description": "A ListModelsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListModelsResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Register model.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "register_model_v1_models_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_models_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A Model.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Model" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/models/{model_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Unregister model.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "unregister_model_v1_models__model_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "model_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Path parameter: model_id" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Get model.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_model_v1_models__model_id__get", - "parameters": [ - { - "name": "model_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Model Id" - } - } - ], - "responses": { - "200": { - "description": "A Model.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Model" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/moderations": { - "post": { - "tags": [ - "V1" - ], - "summary": "Create moderation.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "run_moderation_v1_moderations_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_moderations_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A moderation object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModerationObject" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/prompts": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all prompts.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_prompts_v1_prompts_get", - "responses": { - "200": { - "description": "A ListPromptsResponse containing all prompts.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListPromptsResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Create prompt.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_prompt_v1_prompts_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_prompts_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "The created Prompt resource.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Prompt" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/prompts/{prompt_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete prompt.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "delete_prompt_v1_prompts__prompt_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "prompt_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The identifier of the prompt to delete." - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Get prompt.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_prompt_v1_prompts__prompt_id__get", - "parameters": [ - { - "name": "version", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Version" - } - }, - { - "name": "prompt_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Prompt Id" - }, - "description": "The identifier of the prompt to get." - } - ], - "responses": { - "200": { - "description": "A Prompt resource.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Prompt" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Update prompt.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "update_prompt_v1_prompts__prompt_id__post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_prompts_prompt_id_Request" - } - } - } - }, - "responses": { - "200": { - "description": "The updated Prompt resource with incremented version.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Prompt" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - }, - "parameters": [ - { - "name": "prompt_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The identifier of the prompt to update." - } - ] - } - }, - "/v1/prompts/{prompt_id}/set-default-version": { - "post": { - "tags": [ - "V1" - ], - "summary": "Set prompt version.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "set_default_version_v1_prompts__prompt_id__set_default_version_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_prompts_prompt_id_set_default_version_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "The prompt with the specified version now set as default.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Prompt" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "prompt_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The identifier of the prompt." - } - ] - } - }, - "/v1/prompts/{prompt_id}/versions": { - "get": { - "tags": [ - "V1" - ], - "summary": "List prompt versions.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_prompt_versions_v1_prompts__prompt_id__versions_get", - "parameters": [ - { - "name": "prompt_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Prompt Id" - }, - "description": "The identifier of the prompt to list versions for." - } - ], - "responses": { - "200": { - "description": "A ListPromptsResponse containing all versions of the prompt.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListPromptsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/providers": { - "get": { - "tags": [ - "V1" - ], - "summary": "List providers.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_providers_v1_providers_get", - "responses": { - "200": { - "description": "A ListProvidersResponse containing information about all providers.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListProvidersResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/providers/{provider_id}": { - "get": { - "tags": [ - "V1" - ], - "summary": "Get provider.", - "description": "Query endpoint for proper schema generation.", - "operationId": "inspect_provider_v1_providers__provider_id__get", - "parameters": [ - { - "name": "provider_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Provider Id" - }, - "description": "The ID of the provider to inspect." - } - ], - "responses": { - "200": { - "description": "A ProviderInfo object containing the provider's details.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProviderInfo" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/responses": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all responses.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_openai_responses_v1_responses_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "model", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Model" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 50, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "$ref": "#/components/schemas/Order", - "default": "desc" - } - } - ], - "responses": { - "200": { - "description": "A ListOpenAIResponseObject.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListOpenAIResponseObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Create a model response.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_openai_response_v1_responses_post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_responses_Request" - } - } - } - }, - "responses": { - "200": { - "description": "An OpenAIResponseObject.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIResponseObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/responses/{response_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete a response.", - "description": "Query endpoint for proper schema generation.", - "operationId": "delete_openai_response_v1_responses__response_id__delete", - "parameters": [ - { - "name": "response_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Response Id" - }, - "description": "The ID of the OpenAI response to delete." - } - ], - "responses": { - "200": { - "description": "An OpenAIDeleteResponseObject", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIDeleteResponseObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Get a model response.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_openai_response_v1_responses__response_id__get", - "parameters": [ - { - "name": "response_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Response Id" - }, - "description": "The ID of the OpenAI response to retrieve." - } - ], - "responses": { - "200": { - "description": "An OpenAIResponseObject.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIResponseObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/responses/{response_id}/input_items": { - "get": { - "tags": [ - "V1" - ], - "summary": "List input items.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_openai_response_input_items_v1_responses__response_id__input_items_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "before", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Before" - } - }, - { - "name": "include", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Include" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "$ref": "#/components/schemas/Order", - "default": "desc" - } - }, - { - "name": "response_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Response Id" - }, - "description": "The ID of the response to retrieve input items for." - } - ], - "responses": { - "200": { - "description": "An ListOpenAIResponseInputItem.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListOpenAIResponseInputItem" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/safety/run-shield": { - "post": { - "tags": [ - "V1" - ], - "summary": "Run shield.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "run_shield_v1_safety_run_shield_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_safety_run_shield_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A RunShieldResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RunShieldResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/scoring-functions": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all scoring functions.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_scoring_functions_v1_scoring_functions_get", - "responses": { - "200": { - "description": "A ListScoringFunctionsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListScoringFunctionsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Register a scoring function.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "register_scoring_function_v1_scoring_functions_post", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/scoring-functions/{scoring_fn_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Unregister a scoring function.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "unregister_scoring_function_v1_scoring_functions__scoring_fn_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "scoring_fn_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Path parameter: scoring_fn_id" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Get a scoring function by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_scoring_function_v1_scoring_functions__scoring_fn_id__get", - "parameters": [ - { - "name": "scoring_fn_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Scoring Fn Id" - } - } - ], - "responses": { - "200": { - "description": "A ScoringFn.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScoringFn" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/scoring/score": { - "post": { - "tags": [ - "V1" - ], - "summary": "Score a list of rows.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "score_v1_scoring_score_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_scoring_score_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A ScoreResponse object containing rows and aggregated results.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScoreResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/scoring/score-batch": { - "post": { - "tags": [ - "V1" - ], - "summary": "Score a batch of rows.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "score_batch_v1_scoring_score_batch_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_scoring_score_batch_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A ScoreBatchResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScoreBatchResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/shields": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all shields.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_shields_v1_shields_get", - "responses": { - "200": { - "description": "A ListShieldsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListShieldsResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Register a shield.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "register_shield_v1_shields_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_shields_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A Shield.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Shield" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/shields/{identifier}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Unregister a shield.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "unregister_shield_v1_shields__identifier__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "identifier", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Path parameter: identifier" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Get a shield by its identifier.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_shield_v1_shields__identifier__get", - "parameters": [ - { - "name": "identifier", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Identifier" - } - } - ], - "responses": { - "200": { - "description": "A Shield.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Shield" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/tool-runtime/invoke": { - "post": { - "tags": [ - "V1" - ], - "summary": "Run a tool with the given arguments.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "invoke_tool_v1_tool_runtime_invoke_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_tool_runtime_invoke_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A ToolInvocationResult.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ToolInvocationResult" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/tool-runtime/list-tools": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all tools in the runtime.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_runtime_tools_v1_tool_runtime_list_tools_get", - "parameters": [ - { - "name": "tool_group_id", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Tool Group Id" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/URL" - } - } - } - }, - "responses": { - "200": { - "description": "A ListToolDefsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListToolDefsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/tool-runtime/rag-tool/insert": { - "post": { - "tags": [ - "V1" - ], - "summary": "Index documents so they can be used by the RAG system.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "rag_tool_insert_v1_tool_runtime_rag_tool_insert_post", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/tool-runtime/rag-tool/query": { - "post": { - "tags": [ - "V1" - ], - "summary": "Query the RAG system for context; typically invoked by the agent.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "rag_tool_query_v1_tool_runtime_rag_tool_query_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_tool_runtime_rag_tool_query_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "RAGQueryResult containing the retrieved content and metadata", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RAGQueryResult" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/toolgroups": { - "get": { - "tags": [ - "V1" - ], - "summary": "List tool groups with optional provider.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_tool_groups_v1_toolgroups_get", - "responses": { - "200": { - "description": "A ListToolGroupsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListToolGroupsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Register a tool group.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "register_tool_group_v1_toolgroups_post", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/toolgroups/{toolgroup_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Unregister a tool group.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "unregister_toolgroup_v1_toolgroups__toolgroup_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "toolgroup_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Path parameter: toolgroup_id" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Get a tool group by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_tool_group_v1_toolgroups__toolgroup_id__get", - "parameters": [ - { - "name": "toolgroup_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Toolgroup Id" - } - } - ], - "responses": { - "200": { - "description": "A ToolGroup.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ToolGroup" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/tools": { - "get": { - "tags": [ - "V1" - ], - "summary": "List tools with optional tool group.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_tools_v1_tools_get", - "parameters": [ - { - "name": "toolgroup_id", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Toolgroup Id" - } - } - ], - "responses": { - "200": { - "description": "A ListToolDefsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListToolDefsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/tools/{tool_name}": { - "get": { - "tags": [ - "V1" - ], - "summary": "Get a tool by its name.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_tool_v1_tools__tool_name__get", - "parameters": [ - { - "name": "tool_name", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Tool Name" - } - } - ], - "responses": { - "200": { - "description": "A ToolDef.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ToolDef" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/vector-io/insert": { - "post": { - "tags": [ - "V1" - ], - "summary": "Insert chunks into a vector database.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "insert_chunks_v1_vector_io_insert_post", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/vector-io/query": { - "post": { - "tags": [ - "V1" - ], - "summary": "Query chunks from a vector database.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "query_chunks_v1_vector_io_query_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_vector_io_query_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A QueryChunksResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryChunksResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/vector_stores": { - "get": { - "tags": [ - "V1" - ], - "summary": "Returns a list of vector stores.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_list_vector_stores_v1_vector_stores_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "before", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Before" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "desc", - "title": "Order" - } - } - ], - "responses": { - "200": { - "description": "A VectorStoreListResponse containing the list of vector stores.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreListResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Creates a vector store.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_create_vector_store_v1_vector_stores_post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody" - } - } - } - }, - "responses": { - "200": { - "description": "A VectorStoreObject representing the created vector store.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/vector_stores/{vector_store_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete a vector store.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_delete_vector_store_v1_vector_stores__vector_store_id__delete", - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store to delete." - } - ], - "responses": { - "200": { - "description": "A VectorStoreDeleteResponse indicating the deletion status.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreDeleteResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieves a vector store.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_retrieve_vector_store_v1_vector_stores__vector_store_id__get", - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store to retrieve." - } - ], - "responses": { - "200": { - "description": "A VectorStoreObject representing the vector store.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Updates a vector store.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_update_vector_store_v1_vector_stores__vector_store_id__post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_vector_stores_vector_store_id_Request" - } - } - } - }, - "responses": { - "200": { - "description": "A VectorStoreObject representing the updated vector store.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - }, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store to update." - } - ] - } - }, - "/v1/vector_stores/{vector_store_id}/file_batches": { - "post": { - "tags": [ - "V1" - ], - "summary": "Create a vector store file batch.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_create_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A VectorStoreFileBatchObject representing the created file batch.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileBatchObject" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store to create the file batch for." - } - ] - } - }, - "/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}": { - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve a vector store file batch.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_retrieve_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__get", - "parameters": [ - { - "name": "batch_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Batch Id" - }, - "description": "The ID of the file batch to retrieve." - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store containing the file batch." - } - ], - "responses": { - "200": { - "description": "A VectorStoreFileBatchObject representing the file batch.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileBatchObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel": { - "post": { - "tags": [ - "V1" - ], - "summary": "Cancels a vector store file batch.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A VectorStoreFileBatchObject representing the cancelled file batch.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileBatchObject" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "batch_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the file batch to cancel." - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store containing the file batch." - } - ] - } - }, - "/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files": { - "get": { - "tags": [ - "V1" - ], - "summary": "Returns a list of vector store files in a batch.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_list_files_in_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "before", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Before" - } - }, - { - "name": "filter", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Filter" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "desc", - "title": "Order" - } - }, - { - "name": "batch_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Batch Id" - }, - "description": "The ID of the file batch to list files from." - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store containing the file batch." - } - ], - "responses": { - "200": { - "description": "A VectorStoreFilesListInBatchResponse containing the list of files in the batch.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFilesListInBatchResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/vector_stores/{vector_store_id}/files": { - "get": { - "tags": [ - "V1" - ], - "summary": "List files in a vector store.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_list_files_in_vector_store_v1_vector_stores__vector_store_id__files_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "before", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Before" - } - }, - { - "name": "filter", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Filter" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "desc", - "title": "Order" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store to list files from." - } - ], - "responses": { - "200": { - "description": "A VectorStoreListFilesResponse containing the list of files.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreListFilesResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Attach a file to a vector store.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_vector_stores_vector_store_id_files_Request" - } - } - } - }, - "responses": { - "200": { - "description": "A VectorStoreFileObject representing the attached file.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - }, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store to attach the file to." - } - ] - } - }, - "/v1/vector_stores/{vector_store_id}/files/{file_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete a vector store file.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete", - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store containing the file to delete." - }, - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "File Id" - }, - "description": "The ID of the file to delete." - } - ], - "responses": { - "200": { - "description": "A VectorStoreFileDeleteResponse indicating the deletion status.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileDeleteResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieves a vector store file.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get", - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store containing the file to retrieve." - }, - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "File Id" - }, - "description": "The ID of the file to retrieve." - } - ], - "responses": { - "200": { - "description": "A VectorStoreFileObject representing the file.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Updates a vector store file.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_vector_stores_vector_store_id_files_file_id_Request" - } - } - } - }, - "responses": { - "200": { - "description": "A VectorStoreFileObject representing the updated file.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - }, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store containing the file to update." - }, - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the file to update." - } - ] - } - }, - "/v1/vector_stores/{vector_store_id}/files/{file_id}/content": { - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieves the contents of a vector store file.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get", - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store containing the file to retrieve." - }, - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "File Id" - }, - "description": "The ID of the file to retrieve." - } - ], - "responses": { - "200": { - "description": "A list of InterleavedContent representing the file contents.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileContentsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/vector_stores/{vector_store_id}/search": { - "post": { - "tags": [ - "V1" - ], - "summary": "Search for chunks in a vector store.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_search_vector_store_v1_vector_stores__vector_store_id__search_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_vector_stores_vector_store_id_search_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A VectorStoreSearchResponse containing the search results.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreSearchResponsePage" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store to search." - } - ] - } - }, - "/v1/version": { - "get": { - "tags": [ - "V1" - ], - "summary": "Get version.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "version_v1_version_get", - "responses": { - "200": { - "description": "Version information containing the service version number.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VersionInfo" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - } - }, - "components": { - "schemas": { - "AgentTurnInputType": { - "properties": { - "type": { - "type": "string", - "const": "agent_turn_input", - "title": "Type", - "default": "agent_turn_input" - } - }, - "type": "object", - "title": "AgentTurnInputType", - "description": "Parameter type for agent turn input." - }, - "AggregationFunctionType": { - "type": "string", - "enum": [ - "average", - "weighted_average", - "median", - "categorical_count", - "accuracy" - ], - "title": "AggregationFunctionType", - "description": "Types of aggregation functions for scoring results." - }, - "AllowedToolsFilter": { - "properties": { - "tool_names": { - "title": "Tool Names", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object", - "title": "AllowedToolsFilter", - "description": "Filter configuration for restricting which MCP tools can be used." - }, - "ApprovalFilter": { - "properties": { - "always": { - "title": "Always", - "items": { - "type": "string" - }, - "type": "array" - }, - "never": { - "title": "Never", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object", - "title": "ApprovalFilter", - "description": "Filter configuration for MCP tool approval requirements." - }, - "ArrayType": { - "properties": { - "type": { - "type": "string", - "const": "array", - "title": "Type", - "default": "array" - } - }, - "type": "object", - "title": "ArrayType", - "description": "Parameter type for array values." - }, - "BasicScoringFnParams": { - "properties": { - "type": { - "type": "string", - "const": "basic", - "title": "Type", - "default": "basic" - }, - "aggregation_functions": { - "items": { - "$ref": "#/components/schemas/AggregationFunctionType" - }, - "type": "array", - "title": "Aggregation Functions", - "description": "Aggregation functions to apply to the scores of each row" - } - }, - "type": "object", - "title": "BasicScoringFnParams", - "description": "Parameters for basic scoring function configuration." - }, - "Batch": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "completion_window": { - "type": "string", - "title": "Completion Window" - }, - "created_at": { - "type": "integer", - "title": "Created At" - }, - "endpoint": { - "type": "string", - "title": "Endpoint" - }, - "input_file_id": { - "type": "string", - "title": "Input File Id" - }, - "object": { - "type": "string", - "const": "batch", - "title": "Object" - }, - "status": { - "type": "string", - "enum": [ - "validating", - "failed", - "in_progress", - "finalizing", - "completed", - "expired", - "cancelling", - "cancelled" - ], - "title": "Status" - }, - "cancelled_at": { - "title": "Cancelled At", - "type": "integer" - }, - "cancelling_at": { - "title": "Cancelling At", - "type": "integer" - }, - "completed_at": { - "title": "Completed At", - "type": "integer" - }, - "error_file_id": { - "title": "Error File Id", - "type": "string" - }, - "errors": { - "$ref": "#/components/schemas/Errors" - }, - "expired_at": { - "title": "Expired At", - "type": "integer" - }, - "expires_at": { - "title": "Expires At", - "type": "integer" - }, - "failed_at": { - "title": "Failed At", - "type": "integer" - }, - "finalizing_at": { - "title": "Finalizing At", - "type": "integer" - }, - "in_progress_at": { - "title": "In Progress At", - "type": "integer" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "model": { - "title": "Model", - "type": "string" - }, - "output_file_id": { - "title": "Output File Id", - "type": "string" - }, - "request_counts": { - "$ref": "#/components/schemas/BatchRequestCounts" - }, - "usage": { - "$ref": "#/components/schemas/BatchUsage" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "completion_window", - "created_at", - "endpoint", - "input_file_id", - "object", - "status" - ], - "title": "Batch" - }, - "BatchError": { - "properties": { - "code": { - "title": "Code", - "type": "string" - }, - "line": { - "title": "Line", - "type": "integer" - }, - "message": { - "title": "Message", - "type": "string" - }, - "param": { - "title": "Param", - "type": "string" - } - }, - "additionalProperties": true, - "type": "object", - "title": "BatchError" - }, - "BatchRequestCounts": { - "properties": { - "completed": { - "type": "integer", - "title": "Completed" - }, - "failed": { - "type": "integer", - "title": "Failed" - }, - "total": { - "type": "integer", - "title": "Total" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "completed", - "failed", - "total" - ], - "title": "BatchRequestCounts" - }, - "BatchUsage": { - "properties": { - "input_tokens": { - "type": "integer", - "title": "Input Tokens" - }, - "input_tokens_details": { - "$ref": "#/components/schemas/InputTokensDetails" - }, - "output_tokens": { - "type": "integer", - "title": "Output Tokens" - }, - "output_tokens_details": { - "$ref": "#/components/schemas/OutputTokensDetails" - }, - "total_tokens": { - "type": "integer", - "title": "Total Tokens" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "input_tokens", - "input_tokens_details", - "output_tokens", - "output_tokens_details", - "total_tokens" - ], - "title": "BatchUsage" - }, - "BooleanType": { - "properties": { - "type": { - "type": "string", - "const": "boolean", - "title": "Type", - "default": "boolean" - } - }, - "type": "object", - "title": "BooleanType", - "description": "Parameter type for boolean values." - }, - "ChatCompletionInputType": { - "properties": { - "type": { - "type": "string", - "const": "chat_completion_input", - "title": "Type", - "default": "chat_completion_input" - } - }, - "type": "object", - "title": "ChatCompletionInputType", - "description": "Parameter type for chat completion input." - }, - "Chunk-Output": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "chunk_id": { - "type": "string", - "title": "Chunk Id" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - }, - "embedding": { - "title": "Embedding", - "items": { - "type": "number" - }, - "type": "array" - }, - "chunk_metadata": { - "$ref": "#/components/schemas/ChunkMetadata" - } - }, - "type": "object", - "required": [ - "content", - "chunk_id" - ], - "title": "Chunk", - "description": "A chunk of content that can be inserted into a vector database." - }, - "ChunkMetadata": { - "properties": { - "chunk_id": { - "title": "Chunk Id", - "type": "string" - }, - "document_id": { - "title": "Document Id", - "type": "string" - }, - "source": { - "title": "Source", - "type": "string" - }, - "created_timestamp": { - "title": "Created Timestamp", - "type": "integer" - }, - "updated_timestamp": { - "title": "Updated Timestamp", - "type": "integer" - }, - "chunk_window": { - "title": "Chunk Window", - "type": "string" - }, - "chunk_tokenizer": { - "title": "Chunk Tokenizer", - "type": "string" - }, - "chunk_embedding_model": { - "title": "Chunk Embedding Model", - "type": "string" - }, - "chunk_embedding_dimension": { - "title": "Chunk Embedding Dimension", - "type": "integer" - }, - "content_token_count": { - "title": "Content Token Count", - "type": "integer" - }, - "metadata_token_count": { - "title": "Metadata Token Count", - "type": "integer" - } - }, - "type": "object", - "title": "ChunkMetadata", - "description": "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." - }, - "CompletionInputType": { - "properties": { - "type": { - "type": "string", - "const": "completion_input", - "title": "Type", - "default": "completion_input" - } - }, - "type": "object", - "title": "CompletionInputType", - "description": "Parameter type for completion input." - }, - "Conversation": { - "properties": { - "id": { - "type": "string", - "title": "Id", - "description": "The unique ID of the conversation." - }, - "object": { - "type": "string", - "const": "conversation", - "title": "Object", - "description": "The object type, which is always conversation.", - "default": "conversation" - }, - "created_at": { - "type": "integer", - "title": "Created At", - "description": "The time at which the conversation was created, measured in seconds since the Unix epoch." - }, - "metadata": { - "title": "Metadata", - "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.", - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "items": { - "title": "Items", - "description": "Initial items to include in the conversation context. You may add up to 20 items at a time.", - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - } - }, - "type": "object", - "required": [ - "id", - "created_at" - ], - "title": "Conversation", - "description": "OpenAI-compatible conversation object." - }, - "ConversationItemInclude": { - "type": "string", - "enum": [ - "web_search_call.action.sources", - "code_interpreter_call.outputs", - "computer_call_output.output.image_url", - "file_search_call.results", - "message.input_image.image_url", - "message.output_text.logprobs", - "reasoning.encrypted_content" - ], - "title": "ConversationItemInclude", - "description": "Specify additional output data to include in the model response." - }, - "ConversationItemList": { - "properties": { - "object": { - "type": "string", - "title": "Object", - "description": "Object type", - "default": "list" - }, - "data": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage-Output" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", - "function_call_output": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput", - "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", - "mcp_approval_response": "#/components/schemas/OpenAIResponseMCPApprovalResponse", - "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", - "message": "#/components/schemas/OpenAIResponseMessage-Output", - "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - } - } - }, - "type": "array", - "title": "Data", - "description": "List of conversation items" - }, - "first_id": { - "title": "First Id", - "description": "The ID of the first item in the list", - "type": "string" - }, - "last_id": { - "title": "Last Id", - "description": "The ID of the last item in the list", - "type": "string" - }, - "has_more": { - "type": "boolean", - "title": "Has More", - "description": "Whether there are more items available", - "default": false - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ConversationItemList", - "description": "List of conversation items with pagination." - }, - "DefaultRAGQueryGeneratorConfig": { - "properties": { - "type": { - "type": "string", - "const": "default", - "title": "Type", - "default": "default" - }, - "separator": { - "type": "string", - "title": "Separator", - "default": " " - } - }, - "type": "object", - "title": "DefaultRAGQueryGeneratorConfig", - "description": "Configuration for the default RAG query generator." - }, - "Errors": { - "properties": { - "data": { - "title": "Data", - "items": { - "$ref": "#/components/schemas/BatchError" - }, - "type": "array" - }, - "object": { - "title": "Object", - "type": "string" - } - }, - "additionalProperties": true, - "type": "object", - "title": "Errors" - }, - "HealthInfo": { - "properties": { - "status": { - "$ref": "#/components/schemas/HealthStatus" - } - }, - "type": "object", - "required": [ - "status" - ], - "title": "HealthInfo", - "description": "Health status information for the service." - }, - "HealthStatus": { - "type": "string", - "enum": [ - "OK", - "Error", - "Not Implemented" - ], - "title": "HealthStatus" - }, - "ImageContentItem-Output": { - "properties": { - "type": { - "type": "string", - "const": "image", - "title": "Type", - "default": "image" - }, - "image": { - "$ref": "#/components/schemas/_URLOrData" - } - }, - "type": "object", - "required": [ - "image" - ], - "title": "ImageContentItem", - "description": "A image content item" - }, - "InputTokensDetails": { - "properties": { - "cached_tokens": { - "type": "integer", - "title": "Cached Tokens" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "cached_tokens" - ], - "title": "InputTokensDetails" - }, - "JsonType": { - "properties": { - "type": { - "type": "string", - "const": "json", - "title": "Type", - "default": "json" - } - }, - "type": "object", - "title": "JsonType", - "description": "Parameter type for JSON values." - }, - "LLMAsJudgeScoringFnParams": { - "properties": { - "type": { - "type": "string", - "const": "llm_as_judge", - "title": "Type", - "default": "llm_as_judge" - }, - "judge_model": { - "type": "string", - "title": "Judge Model" - }, - "prompt_template": { - "title": "Prompt Template", - "type": "string" - }, - "judge_score_regexes": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Judge Score Regexes", - "description": "Regexes to extract the answer from generated response" - }, - "aggregation_functions": { - "items": { - "$ref": "#/components/schemas/AggregationFunctionType" - }, - "type": "array", - "title": "Aggregation Functions", - "description": "Aggregation functions to apply to the scores of each row" - } - }, - "type": "object", - "required": [ - "judge_model" - ], - "title": "LLMAsJudgeScoringFnParams", - "description": "Parameters for LLM-as-judge scoring function configuration." - }, - "LLMRAGQueryGeneratorConfig": { - "properties": { - "type": { - "type": "string", - "const": "llm", - "title": "Type", - "default": "llm" - }, - "model": { - "type": "string", - "title": "Model" - }, - "template": { - "type": "string", - "title": "Template" - } - }, - "type": "object", - "required": [ - "model", - "template" - ], - "title": "LLMRAGQueryGeneratorConfig", - "description": "Configuration for the LLM-based RAG query generator." - }, - "ListModelsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Model" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListModelsResponse" - }, - "ListPromptsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Prompt" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListPromptsResponse", - "description": "Response model to list prompts." - }, - "ListProvidersResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ProviderInfo" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListProvidersResponse", - "description": "Response containing a list of all available providers." - }, - "ListRoutesResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/RouteInfo" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListRoutesResponse", - "description": "Response containing a list of all available API routes." - }, - "ListScoringFunctionsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ScoringFn-Output" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListScoringFunctionsResponse" - }, - "ListShieldsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Shield" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListShieldsResponse" - }, - "ListToolGroupsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ToolGroup" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListToolGroupsResponse", - "description": "Response containing a list of tool groups." - }, - "MCPListToolsTool": { - "properties": { - "input_schema": { - "additionalProperties": true, - "type": "object", - "title": "Input Schema" - }, - "name": { - "type": "string", - "title": "Name" - }, - "description": { - "title": "Description", - "type": "string" - } - }, - "type": "object", - "required": [ - "input_schema", - "name" - ], - "title": "MCPListToolsTool", - "description": "Tool definition returned by MCP list tools operation." - }, - "Model": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "model", - "title": "Type", - "default": "model" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata", - "description": "Any additional metadata for this model" - }, - "model_type": { - "$ref": "#/components/schemas/ModelType", - "default": "llm" - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id" - ], - "title": "Model", - "description": "A model resource representing an AI model registered in Llama Stack." - }, - "ModelType": { - "type": "string", - "enum": [ - "llm", - "embedding", - "rerank" - ], - "title": "ModelType", - "description": "Enumeration of supported model types in Llama Stack." - }, - "ModerationObject": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "model": { - "type": "string", - "title": "Model" - }, - "results": { - "items": { - "$ref": "#/components/schemas/ModerationObjectResults" - }, - "type": "array", - "title": "Results" - } - }, - "type": "object", - "required": [ - "id", - "model", - "results" - ], - "title": "ModerationObject", - "description": "A moderation object." - }, - "ModerationObjectResults": { - "properties": { - "flagged": { - "type": "boolean", - "title": "Flagged" - }, - "categories": { - "title": "Categories", - "additionalProperties": { - "type": "boolean" - }, - "type": "object" - }, - "category_applied_input_types": { - "title": "Category Applied Input Types", - "additionalProperties": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": "object" - }, - "category_scores": { - "title": "Category Scores", - "additionalProperties": { - "type": "number" - }, - "type": "object" - }, - "user_message": { - "title": "User Message", - "type": "string" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "flagged" - ], - "title": "ModerationObjectResults", - "description": "A moderation object." - }, - "NumberType": { - "properties": { - "type": { - "type": "string", - "const": "number", - "title": "Type", - "default": "number" - } - }, - "type": "object", - "title": "NumberType", - "description": "Parameter type for numeric values." - }, - "ObjectType": { - "properties": { - "type": { - "type": "string", - "const": "object", - "title": "Type", - "default": "object" - } - }, - "type": "object", - "title": "ObjectType", - "description": "Parameter type for object values." - }, - "OpenAIAssistantMessageParam-Input": { - "properties": { - "role": { - "type": "string", - "const": "assistant", - "title": "Role", - "default": "assistant" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" - }, - "type": "array" - } - }, - "type": "object", - "title": "OpenAIAssistantMessageParam", - "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request." - }, - "OpenAIAssistantMessageParam-Output": { - "properties": { - "role": { - "type": "string", - "const": "assistant", - "title": "Role", - "default": "assistant" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" - }, - "type": "array" - } - }, - "type": "object", - "title": "OpenAIAssistantMessageParam", - "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request." - }, - "OpenAIChatCompletion": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "choices": { - "items": { - "$ref": "#/components/schemas/OpenAIChoice-Output" - }, - "type": "array", - "title": "Choices" - }, - "object": { - "type": "string", - "const": "chat.completion", - "title": "Object", - "default": "chat.completion" - }, - "created": { - "type": "integer", - "title": "Created" - }, - "model": { - "type": "string", - "title": "Model" - }, - "usage": { - "$ref": "#/components/schemas/OpenAIChatCompletionUsage" - } - }, - "type": "object", - "required": [ - "id", - "choices", - "created", - "model" - ], - "title": "OpenAIChatCompletion", - "description": "Response from an OpenAI-compatible chat completion request." - }, - "OpenAIChatCompletionContentPartImageParam": { - "properties": { - "type": { - "type": "string", - "const": "image_url", - "title": "Type", - "default": "image_url" - }, - "image_url": { - "$ref": "#/components/schemas/OpenAIImageURL" - } - }, - "type": "object", - "required": [ - "image_url" - ], - "title": "OpenAIChatCompletionContentPartImageParam", - "description": "Image content part for OpenAI-compatible chat completion messages." - }, - "OpenAIChatCompletionContentPartTextParam": { - "properties": { - "type": { - "type": "string", - "const": "text", - "title": "Type", - "default": "text" - }, - "text": { - "type": "string", - "title": "Text" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "OpenAIChatCompletionContentPartTextParam", - "description": "Text content part for OpenAI-compatible chat completion messages." - }, - "OpenAIChatCompletionRequestWithExtraBody": { - "properties": { - "model": { - "type": "string", - "title": "Model" - }, - "messages": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIUserMessageParam-Input" - }, - { - "$ref": "#/components/schemas/OpenAISystemMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIAssistantMessageParam-Input" - }, - { - "$ref": "#/components/schemas/OpenAIToolMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" - } - ], - "discriminator": { - "propertyName": "role", - "mapping": { - "assistant": "#/components/schemas/OpenAIAssistantMessageParam-Input", - "developer": "#/components/schemas/OpenAIDeveloperMessageParam", - "system": "#/components/schemas/OpenAISystemMessageParam", - "tool": "#/components/schemas/OpenAIToolMessageParam", - "user": "#/components/schemas/OpenAIUserMessageParam-Input" - } - } - }, - "type": "array", - "minItems": 1, - "title": "Messages" - }, - "frequency_penalty": { - "title": "Frequency Penalty", - "type": "number" - }, - "function_call": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": true, - "type": "object" - } - ], - "title": "Function Call" - }, - "functions": { - "title": "Functions", - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - "logit_bias": { - "title": "Logit Bias", - "additionalProperties": { - "type": "number" - }, - "type": "object" - }, - "logprobs": { - "title": "Logprobs", - "type": "boolean" - }, - "max_completion_tokens": { - "title": "Max Completion Tokens", - "type": "integer" - }, - "max_tokens": { - "title": "Max Tokens", - "type": "integer" - }, - "n": { - "title": "N", - "type": "integer" - }, - "parallel_tool_calls": { - "title": "Parallel Tool Calls", - "type": "boolean" - }, - "presence_penalty": { - "title": "Presence Penalty", - "type": "number" - }, - "response_format": { - "title": "Response Format", - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseFormatText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseFormatJSONSchema" - }, - { - "$ref": "#/components/schemas/OpenAIResponseFormatJSONObject" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "json_object": "#/components/schemas/OpenAIResponseFormatJSONObject", - "json_schema": "#/components/schemas/OpenAIResponseFormatJSONSchema", - "text": "#/components/schemas/OpenAIResponseFormatText" - } - } - }, - "seed": { - "title": "Seed", - "type": "integer" - }, - "stop": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ], - "title": "Stop" - }, - "stream": { - "title": "Stream", - "type": "boolean" - }, - "stream_options": { - "title": "Stream Options", - "additionalProperties": true, - "type": "object" - }, - "temperature": { - "title": "Temperature", - "type": "number" - }, - "tool_choice": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": true, - "type": "object" - } - ], - "title": "Tool Choice" - }, - "tools": { - "title": "Tools", - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - "top_logprobs": { - "title": "Top Logprobs", - "type": "integer" - }, - "top_p": { - "title": "Top P", - "type": "number" - }, - "user": { - "title": "User", - "type": "string" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "model", - "messages" - ], - "title": "OpenAIChatCompletionRequestWithExtraBody", - "description": "Request parameters for OpenAI-compatible chat completion endpoint." - }, - "OpenAIChatCompletionToolCall": { - "properties": { - "index": { - "title": "Index", - "type": "integer" - }, - "id": { - "title": "Id", - "type": "string" - }, - "type": { - "type": "string", - "const": "function", - "title": "Type", - "default": "function" - }, - "function": { - "$ref": "#/components/schemas/OpenAIChatCompletionToolCallFunction" - } - }, - "type": "object", - "title": "OpenAIChatCompletionToolCall", - "description": "Tool call specification for OpenAI-compatible chat completion responses." - }, - "OpenAIChatCompletionToolCallFunction": { - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "arguments": { - "title": "Arguments", - "type": "string" - } - }, - "type": "object", - "title": "OpenAIChatCompletionToolCallFunction", - "description": "Function call details for OpenAI-compatible tool calls." - }, - "OpenAIChatCompletionUsage": { - "properties": { - "prompt_tokens": { - "type": "integer", - "title": "Prompt Tokens" - }, - "completion_tokens": { - "type": "integer", - "title": "Completion Tokens" - }, - "total_tokens": { - "type": "integer", - "title": "Total Tokens" - }, - "prompt_tokens_details": { - "$ref": "#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails" - }, - "completion_tokens_details": { - "$ref": "#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails" - } - }, - "type": "object", - "required": [ - "prompt_tokens", - "completion_tokens", - "total_tokens" - ], - "title": "OpenAIChatCompletionUsage", - "description": "Usage information for OpenAI chat completion." - }, - "OpenAIChatCompletionUsageCompletionTokensDetails": { - "properties": { - "reasoning_tokens": { - "title": "Reasoning Tokens", - "type": "integer" - } - }, - "type": "object", - "title": "OpenAIChatCompletionUsageCompletionTokensDetails", - "description": "Token details for output tokens in OpenAI chat completion usage." - }, - "OpenAIChatCompletionUsagePromptTokensDetails": { - "properties": { - "cached_tokens": { - "title": "Cached Tokens", - "type": "integer" - } - }, - "type": "object", - "title": "OpenAIChatCompletionUsagePromptTokensDetails", - "description": "Token details for prompt tokens in OpenAI chat completion usage." - }, - "OpenAIChoice-Output": { - "properties": { - "message": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIUserMessageParam-Output" - }, - { - "$ref": "#/components/schemas/OpenAISystemMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIAssistantMessageParam-Output" - }, - { - "$ref": "#/components/schemas/OpenAIToolMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" - } - ], - "title": "Message", - "discriminator": { - "propertyName": "role", - "mapping": { - "assistant": "#/components/schemas/OpenAIAssistantMessageParam-Output", - "developer": "#/components/schemas/OpenAIDeveloperMessageParam", - "system": "#/components/schemas/OpenAISystemMessageParam", - "tool": "#/components/schemas/OpenAIToolMessageParam", - "user": "#/components/schemas/OpenAIUserMessageParam-Output" - } - } - }, - "finish_reason": { - "type": "string", - "title": "Finish Reason" - }, - "index": { - "type": "integer", - "title": "Index" - }, - "logprobs": { - "$ref": "#/components/schemas/OpenAIChoiceLogprobs-Output" - } - }, - "type": "object", - "required": [ - "message", - "finish_reason", - "index" - ], - "title": "OpenAIChoice", - "description": "A choice from an OpenAI-compatible chat completion response." - }, - "OpenAIChoiceLogprobs-Output": { - "properties": { - "content": { - "title": "Content", - "items": { - "$ref": "#/components/schemas/OpenAITokenLogProb" - }, - "type": "array" - }, - "refusal": { - "title": "Refusal", - "items": { - "$ref": "#/components/schemas/OpenAITokenLogProb" - }, - "type": "array" - } - }, - "type": "object", - "title": "OpenAIChoiceLogprobs", - "description": "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response." - }, - "OpenAICompletion": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "choices": { - "items": { - "$ref": "#/components/schemas/OpenAICompletionChoice-Output" - }, - "type": "array", - "title": "Choices" - }, - "created": { - "type": "integer", - "title": "Created" - }, - "model": { - "type": "string", - "title": "Model" - }, - "object": { - "type": "string", - "const": "text_completion", - "title": "Object", - "default": "text_completion" - } - }, - "type": "object", - "required": [ - "id", - "choices", - "created", - "model" - ], - "title": "OpenAICompletion", - "description": "Response from an OpenAI-compatible completion request." - }, - "OpenAICompletionChoice-Output": { - "properties": { - "finish_reason": { - "type": "string", - "title": "Finish Reason" - }, - "text": { - "type": "string", - "title": "Text" - }, - "index": { - "type": "integer", - "title": "Index" - }, - "logprobs": { - "$ref": "#/components/schemas/OpenAIChoiceLogprobs-Output" - } - }, - "type": "object", - "required": [ - "finish_reason", - "text", - "index" - ], - "title": "OpenAICompletionChoice", - "description": "A choice from an OpenAI-compatible completion response." - }, - "OpenAICompletionRequestWithExtraBody": { - "properties": { - "model": { - "type": "string", - "title": "Model" - }, - "prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "items": { - "type": "integer" - }, - "type": "array" - }, - { - "items": { - "items": { - "type": "integer" - }, - "type": "array" - }, - "type": "array" - } - ], - "title": "Prompt" - }, - "best_of": { - "title": "Best Of", - "type": "integer" - }, - "echo": { - "title": "Echo", - "type": "boolean" - }, - "frequency_penalty": { - "title": "Frequency Penalty", - "type": "number" - }, - "logit_bias": { - "title": "Logit Bias", - "additionalProperties": { - "type": "number" - }, - "type": "object" - }, - "logprobs": { - "title": "Logprobs", - "type": "boolean" - }, - "max_tokens": { - "title": "Max Tokens", - "type": "integer" - }, - "n": { - "title": "N", - "type": "integer" - }, - "presence_penalty": { - "title": "Presence Penalty", - "type": "number" - }, - "seed": { - "title": "Seed", - "type": "integer" - }, - "stop": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ], - "title": "Stop" - }, - "stream": { - "title": "Stream", - "type": "boolean" - }, - "stream_options": { - "title": "Stream Options", - "additionalProperties": true, - "type": "object" - }, - "temperature": { - "title": "Temperature", - "type": "number" - }, - "top_p": { - "title": "Top P", - "type": "number" - }, - "user": { - "title": "User", - "type": "string" - }, - "suffix": { - "title": "Suffix", - "type": "string" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "model", - "prompt" - ], - "title": "OpenAICompletionRequestWithExtraBody", - "description": "Request parameters for OpenAI-compatible completion endpoint." - }, - "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": { - "properties": { - "file_ids": { - "items": { - "type": "string" - }, - "type": "array", - "title": "File Ids" - }, - "attributes": { - "title": "Attributes", - "additionalProperties": true, - "type": "object" - }, - "chunking_strategy": { - "title": "Chunking Strategy", - "oneOf": [ - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" - }, - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "auto": "#/components/schemas/VectorStoreChunkingStrategyAuto", - "static": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - } - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "file_ids" - ], - "title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody", - "description": "Request to create a vector store file batch with extra_body support." - }, - "OpenAICreateVectorStoreRequestWithExtraBody": { - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "file_ids": { - "title": "File Ids", - "items": { - "type": "string" - }, - "type": "array" - }, - "expires_after": { - "title": "Expires After", - "additionalProperties": true, - "type": "object" - }, - "chunking_strategy": { - "title": "Chunking Strategy", - "additionalProperties": true, - "type": "object" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "additionalProperties": true, - "type": "object", - "title": "OpenAICreateVectorStoreRequestWithExtraBody", - "description": "Request to create a vector store with extra_body support." - }, - "OpenAIDeveloperMessageParam": { - "properties": { - "role": { - "type": "string", - "const": "developer", - "title": "Role", - "default": "developer" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "OpenAIDeveloperMessageParam", - "description": "A message from the developer in an OpenAI-compatible chat completion request." - }, - "OpenAIEmbeddingData": { - "properties": { - "object": { - "type": "string", - "const": "embedding", - "title": "Object", - "default": "embedding" - }, - "embedding": { - "anyOf": [ - { - "items": { - "type": "number" - }, - "type": "array" - }, - { - "type": "string" - } - ], - "title": "Embedding" - }, - "index": { - "type": "integer", - "title": "Index" - } - }, - "type": "object", - "required": [ - "embedding", - "index" - ], - "title": "OpenAIEmbeddingData", - "description": "A single embedding data object from an OpenAI-compatible embeddings response." - }, - "OpenAIEmbeddingUsage": { - "properties": { - "prompt_tokens": { - "type": "integer", - "title": "Prompt Tokens" - }, - "total_tokens": { - "type": "integer", - "title": "Total Tokens" - } - }, - "type": "object", - "required": [ - "prompt_tokens", - "total_tokens" - ], - "title": "OpenAIEmbeddingUsage", - "description": "Usage information for an OpenAI-compatible embeddings response." - }, - "OpenAIEmbeddingsRequestWithExtraBody": { - "properties": { - "model": { - "type": "string", - "title": "Model" - }, - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ], - "title": "Input" - }, - "encoding_format": { - "title": "Encoding Format", - "default": "float", - "type": "string" - }, - "dimensions": { - "title": "Dimensions", - "type": "integer" - }, - "user": { - "title": "User", - "type": "string" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "model", - "input" - ], - "title": "OpenAIEmbeddingsRequestWithExtraBody", - "description": "Request parameters for OpenAI-compatible embeddings endpoint." - }, - "OpenAIEmbeddingsResponse": { - "properties": { - "object": { - "type": "string", - "const": "list", - "title": "Object", - "default": "list" - }, - "data": { - "items": { - "$ref": "#/components/schemas/OpenAIEmbeddingData" - }, - "type": "array", - "title": "Data" - }, - "model": { - "type": "string", - "title": "Model" - }, - "usage": { - "$ref": "#/components/schemas/OpenAIEmbeddingUsage" - } - }, - "type": "object", - "required": [ - "data", - "model", - "usage" - ], - "title": "OpenAIEmbeddingsResponse", - "description": "Response from an OpenAI-compatible embeddings request." - }, - "OpenAIFile": { - "properties": { - "type": { - "type": "string", - "const": "file", - "title": "Type", - "default": "file" - }, - "file": { - "$ref": "#/components/schemas/OpenAIFileFile" - } - }, - "type": "object", - "required": [ - "file" - ], - "title": "OpenAIFile" - }, - "OpenAIFileFile": { - "properties": { - "file_data": { - "title": "File Data", - "type": "string" - }, - "file_id": { - "title": "File Id", - "type": "string" - }, - "filename": { - "title": "Filename", - "type": "string" - } - }, - "type": "object", - "title": "OpenAIFileFile" - }, - "OpenAIFileObject": { - "properties": { - "object": { - "type": "string", - "const": "file", - "title": "Object", - "default": "file" - }, - "id": { - "type": "string", - "title": "Id" - }, - "bytes": { - "type": "integer", - "title": "Bytes" - }, - "created_at": { - "type": "integer", - "title": "Created At" - }, - "expires_at": { - "type": "integer", - "title": "Expires At" - }, - "filename": { - "type": "string", - "title": "Filename" - }, - "purpose": { - "$ref": "#/components/schemas/OpenAIFilePurpose" - } - }, - "type": "object", - "required": [ - "id", - "bytes", - "created_at", - "expires_at", - "filename", - "purpose" - ], - "title": "OpenAIFileObject", - "description": "OpenAI File object as defined in the OpenAI Files API." - }, - "OpenAIFilePurpose": { - "type": "string", - "enum": [ - "assistants", - "batch" - ], - "title": "OpenAIFilePurpose", - "description": "Valid purpose values for OpenAI Files API." - }, - "OpenAIImageURL": { - "properties": { - "url": { - "type": "string", - "title": "Url" - }, - "detail": { - "title": "Detail", - "type": "string" - } - }, - "type": "object", - "required": [ - "url" - ], - "title": "OpenAIImageURL", - "description": "Image URL specification for OpenAI-compatible chat completion messages." - }, - "OpenAIJSONSchema": { - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "description": { - "title": "Description", - "type": "string" - }, - "strict": { - "title": "Strict", - "type": "boolean" - }, - "schema": { - "title": "Schema", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "title": "OpenAIJSONSchema", - "description": "JSON schema specification for OpenAI-compatible structured response format." - }, - "OpenAIResponseAnnotationCitation": { - "properties": { - "type": { - "type": "string", - "const": "url_citation", - "title": "Type", - "default": "url_citation" - }, - "end_index": { - "type": "integer", - "title": "End Index" - }, - "start_index": { - "type": "integer", - "title": "Start Index" - }, - "title": { - "type": "string", - "title": "Title" - }, - "url": { - "type": "string", - "title": "Url" - } - }, - "type": "object", - "required": [ - "end_index", - "start_index", - "title", - "url" - ], - "title": "OpenAIResponseAnnotationCitation", - "description": "URL citation annotation for referencing external web resources." - }, - "OpenAIResponseAnnotationContainerFileCitation": { - "properties": { - "type": { - "type": "string", - "const": "container_file_citation", - "title": "Type", - "default": "container_file_citation" - }, - "container_id": { - "type": "string", - "title": "Container Id" - }, - "end_index": { - "type": "integer", - "title": "End Index" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "filename": { - "type": "string", - "title": "Filename" - }, - "start_index": { - "type": "integer", - "title": "Start Index" - } - }, - "type": "object", - "required": [ - "container_id", - "end_index", - "file_id", - "filename", - "start_index" - ], - "title": "OpenAIResponseAnnotationContainerFileCitation" - }, - "OpenAIResponseAnnotationFileCitation": { - "properties": { - "type": { - "type": "string", - "const": "file_citation", - "title": "Type", - "default": "file_citation" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "filename": { - "type": "string", - "title": "Filename" - }, - "index": { - "type": "integer", - "title": "Index" - } - }, - "type": "object", - "required": [ - "file_id", - "filename", - "index" - ], - "title": "OpenAIResponseAnnotationFileCitation", - "description": "File citation annotation for referencing specific files in response content." - }, - "OpenAIResponseAnnotationFilePath": { - "properties": { - "type": { - "type": "string", - "const": "file_path", - "title": "Type", - "default": "file_path" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "index": { - "type": "integer", - "title": "Index" - } - }, - "type": "object", - "required": [ - "file_id", - "index" - ], - "title": "OpenAIResponseAnnotationFilePath" - }, - "OpenAIResponseContentPartRefusal": { - "properties": { - "type": { - "type": "string", - "const": "refusal", - "title": "Type", - "default": "refusal" - }, - "refusal": { - "type": "string", - "title": "Refusal" - } - }, - "type": "object", - "required": [ - "refusal" - ], - "title": "OpenAIResponseContentPartRefusal", - "description": "Refusal content within a streamed response part." - }, - "OpenAIResponseError": { - "properties": { - "code": { - "type": "string", - "title": "Code" - }, - "message": { - "type": "string", - "title": "Message" - } - }, - "type": "object", - "required": [ - "code", - "message" - ], - "title": "OpenAIResponseError", - "description": "Error details for failed OpenAI response requests." - }, - "OpenAIResponseFormatJSONObject": { - "properties": { - "type": { - "type": "string", - "const": "json_object", - "title": "Type", - "default": "json_object" - } - }, - "type": "object", - "title": "OpenAIResponseFormatJSONObject", - "description": "JSON object response format for OpenAI-compatible chat completion requests." - }, - "OpenAIResponseFormatJSONSchema": { - "properties": { - "type": { - "type": "string", - "const": "json_schema", - "title": "Type", - "default": "json_schema" - }, - "json_schema": { - "$ref": "#/components/schemas/OpenAIJSONSchema" - } - }, - "type": "object", - "required": [ - "json_schema" - ], - "title": "OpenAIResponseFormatJSONSchema", - "description": "JSON schema response format for OpenAI-compatible chat completion requests." - }, - "OpenAIResponseFormatText": { - "properties": { - "type": { - "type": "string", - "const": "text", - "title": "Type", - "default": "text" - } - }, - "type": "object", - "title": "OpenAIResponseFormatText", - "description": "Text response format for OpenAI-compatible chat completion requests." - }, - "OpenAIResponseInputFunctionToolCallOutput": { - "properties": { - "call_id": { - "type": "string", - "title": "Call Id" - }, - "output": { - "type": "string", - "title": "Output" - }, - "type": { - "type": "string", - "const": "function_call_output", - "title": "Type", - "default": "function_call_output" - }, - "id": { - "title": "Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "type": "object", - "required": [ - "call_id", - "output" - ], - "title": "OpenAIResponseInputFunctionToolCallOutput", - "description": "This represents the output of a function call that gets passed back to the model." - }, - "OpenAIResponseInputMessageContentFile": { - "properties": { - "type": { - "type": "string", - "const": "input_file", - "title": "Type", - "default": "input_file" - }, - "file_data": { - "title": "File Data", - "type": "string" - }, - "file_id": { - "title": "File Id", - "type": "string" - }, - "file_url": { - "title": "File Url", - "type": "string" - }, - "filename": { - "title": "Filename", - "type": "string" - } - }, - "type": "object", - "title": "OpenAIResponseInputMessageContentFile", - "description": "File content for input messages in OpenAI response format." - }, - "OpenAIResponseInputMessageContentImage": { - "properties": { - "detail": { - "anyOf": [ - { - "type": "string", - "const": "low" - }, - { - "type": "string", - "const": "high" - }, - { - "type": "string", - "const": "auto" - } - ], - "title": "Detail", - "default": "auto" - }, - "type": { - "type": "string", - "const": "input_image", - "title": "Type", - "default": "input_image" - }, - "file_id": { - "title": "File Id", - "type": "string" - }, - "image_url": { - "title": "Image Url", - "type": "string" - } - }, - "type": "object", - "title": "OpenAIResponseInputMessageContentImage", - "description": "Image content for input messages in OpenAI response format." - }, - "OpenAIResponseInputMessageContentText": { - "properties": { - "text": { - "type": "string", - "title": "Text" - }, - "type": { - "type": "string", - "const": "input_text", - "title": "Type", - "default": "input_text" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "OpenAIResponseInputMessageContentText", - "description": "Text content for input messages in OpenAI response format." - }, - "OpenAIResponseInputToolFileSearch": { - "properties": { - "type": { - "type": "string", - "const": "file_search", - "title": "Type", - "default": "file_search" - }, - "vector_store_ids": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Vector Store Ids" - }, - "filters": { - "title": "Filters", - "additionalProperties": true, - "type": "object" - }, - "max_num_results": { - "title": "Max Num Results", - "default": 10, - "type": "integer", - "maximum": 50.0, - "minimum": 1.0 - }, - "ranking_options": { - "$ref": "#/components/schemas/SearchRankingOptions" - } - }, - "type": "object", - "required": [ - "vector_store_ids" - ], - "title": "OpenAIResponseInputToolFileSearch", - "description": "File search tool configuration for OpenAI response inputs." - }, - "OpenAIResponseInputToolFunction": { - "properties": { - "type": { - "type": "string", - "const": "function", - "title": "Type", - "default": "function" - }, - "name": { - "type": "string", - "title": "Name" - }, - "description": { - "title": "Description", - "type": "string" - }, - "parameters": { - "title": "Parameters", - "additionalProperties": true, - "type": "object" - }, - "strict": { - "title": "Strict", - "type": "boolean" - } - }, - "type": "object", - "required": [ - "name", - "parameters" - ], - "title": "OpenAIResponseInputToolFunction", - "description": "Function tool configuration for OpenAI response inputs." - }, - "OpenAIResponseInputToolMCP": { - "properties": { - "type": { - "type": "string", - "const": "mcp", - "title": "Type", - "default": "mcp" - }, - "server_label": { - "type": "string", - "title": "Server Label" - }, - "server_url": { - "type": "string", - "title": "Server Url" - }, - "headers": { - "title": "Headers", - "additionalProperties": true, - "type": "object" - }, - "require_approval": { - "anyOf": [ - { - "type": "string", - "const": "always" - }, - { - "type": "string", - "const": "never" - }, - { - "$ref": "#/components/schemas/ApprovalFilter" - } - ], - "title": "Require Approval", - "default": "never" - }, - "allowed_tools": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "$ref": "#/components/schemas/AllowedToolsFilter" - } - ], - "title": "Allowed Tools" - } - }, - "type": "object", - "required": [ - "server_label", - "server_url" - ], - "title": "OpenAIResponseInputToolMCP", - "description": "Model Context Protocol (MCP) tool configuration for OpenAI response inputs." - }, - "OpenAIResponseInputToolWebSearch": { - "properties": { - "type": { - "anyOf": [ - { - "type": "string", - "const": "web_search" - }, - { - "type": "string", - "const": "web_search_preview" - }, - { - "type": "string", - "const": "web_search_preview_2025_03_11" - } - ], - "title": "Type", - "default": "web_search" - }, - "search_context_size": { - "title": "Search Context Size", - "default": "medium", - "type": "string", - "pattern": "^low|medium|high$" - } - }, - "type": "object", - "title": "OpenAIResponseInputToolWebSearch", - "description": "Web search tool configuration for OpenAI response inputs." - }, - "OpenAIResponseMCPApprovalRequest": { - "properties": { - "arguments": { - "type": "string", - "title": "Arguments" - }, - "id": { - "type": "string", - "title": "Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "server_label": { - "type": "string", - "title": "Server Label" - }, - "type": { - "type": "string", - "const": "mcp_approval_request", - "title": "Type", - "default": "mcp_approval_request" - } - }, - "type": "object", - "required": [ - "arguments", - "id", - "name", - "server_label" - ], - "title": "OpenAIResponseMCPApprovalRequest", - "description": "A request for human approval of a tool invocation." - }, - "OpenAIResponseMCPApprovalResponse": { - "properties": { - "approval_request_id": { - "type": "string", - "title": "Approval Request Id" - }, - "approve": { - "type": "boolean", - "title": "Approve" - }, - "type": { - "type": "string", - "const": "mcp_approval_response", - "title": "Type", - "default": "mcp_approval_response" - }, - "id": { - "title": "Id", - "type": "string" - }, - "reason": { - "title": "Reason", - "type": "string" - } - }, - "type": "object", - "required": [ - "approval_request_id", - "approve" - ], - "title": "OpenAIResponseMCPApprovalResponse", - "description": "A response to an MCP approval request." - }, - "OpenAIResponseMessage-Input": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", - "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", - "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" - } - } - }, - "type": "array" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "output_text": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText", - "refusal": "#/components/schemas/OpenAIResponseContentPartRefusal" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "role": { - "anyOf": [ - { - "type": "string", - "const": "system" - }, - { - "type": "string", - "const": "developer" - }, - { - "type": "string", - "const": "user" - }, - { - "type": "string", - "const": "assistant" - } - ], - "title": "Role" - }, - "type": { - "type": "string", - "const": "message", - "title": "Type", - "default": "message" - }, - "id": { - "title": "Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "type": "object", - "required": [ - "content", - "role" - ], - "title": "OpenAIResponseMessage", - "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." - }, - "OpenAIResponseMessage-Output": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", - "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", - "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" - } - } - }, - "type": "array" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "output_text": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText", - "refusal": "#/components/schemas/OpenAIResponseContentPartRefusal" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "role": { - "anyOf": [ - { - "type": "string", - "const": "system" - }, - { - "type": "string", - "const": "developer" - }, - { - "type": "string", - "const": "user" - }, - { - "type": "string", - "const": "assistant" - } - ], - "title": "Role" - }, - "type": { - "type": "string", - "const": "message", - "title": "Type", - "default": "message" - }, - "id": { - "title": "Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "type": "object", - "required": [ - "content", - "role" - ], - "title": "OpenAIResponseMessage", - "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." - }, - "OpenAIResponseObject": { - "properties": { - "created_at": { - "type": "integer", - "title": "Created At" - }, - "error": { - "$ref": "#/components/schemas/OpenAIResponseError" - }, - "id": { - "type": "string", - "title": "Id" - }, - "model": { - "type": "string", - "title": "Model" - }, - "object": { - "type": "string", - "const": "response", - "title": "Object", - "default": "response" - }, - "output": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage-Output" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", - "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", - "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", - "message": "#/components/schemas/OpenAIResponseMessage-Output", - "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - } - } - }, - "type": "array", - "title": "Output" - }, - "parallel_tool_calls": { - "type": "boolean", - "title": "Parallel Tool Calls", - "default": false - }, - "previous_response_id": { - "title": "Previous Response Id", - "type": "string" - }, - "prompt": { - "$ref": "#/components/schemas/OpenAIResponsePrompt" - }, - "status": { - "type": "string", - "title": "Status" - }, - "temperature": { - "title": "Temperature", - "type": "number" - }, - "text": { - "$ref": "#/components/schemas/OpenAIResponseText", - "default": { - "format": { - "type": "text" - } - } - }, - "top_p": { - "title": "Top P", - "type": "number" - }, - "tools": { - "title": "Tools", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" - }, - { - "$ref": "#/components/schemas/OpenAIResponseToolMCP" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "file_search": "#/components/schemas/OpenAIResponseInputToolFileSearch", - "function": "#/components/schemas/OpenAIResponseInputToolFunction", - "mcp": "#/components/schemas/OpenAIResponseToolMCP", - "web_search": "#/components/schemas/OpenAIResponseInputToolWebSearch", - "web_search_preview": "#/components/schemas/OpenAIResponseInputToolWebSearch", - "web_search_preview_2025_03_11": "#/components/schemas/OpenAIResponseInputToolWebSearch" - } - } - }, - "type": "array" - }, - "truncation": { - "title": "Truncation", - "type": "string" - }, - "usage": { - "$ref": "#/components/schemas/OpenAIResponseUsage" - }, - "instructions": { - "title": "Instructions", - "type": "string" - } - }, - "type": "object", - "required": [ - "created_at", - "id", - "model", - "output", - "status" - ], - "title": "OpenAIResponseObject", - "description": "Complete OpenAI response object containing generation results and metadata." - }, - "OpenAIResponseOutputMessageContentOutputText": { - "properties": { - "text": { - "type": "string", - "title": "Text" - }, - "type": { - "type": "string", - "const": "output_text", - "title": "Type", - "default": "output_text" - }, - "annotations": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationFileCitation" - }, - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationCitation" - }, - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation" - }, - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationFilePath" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "container_file_citation": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation", - "file_citation": "#/components/schemas/OpenAIResponseAnnotationFileCitation", - "file_path": "#/components/schemas/OpenAIResponseAnnotationFilePath", - "url_citation": "#/components/schemas/OpenAIResponseAnnotationCitation" - } - } - }, - "type": "array", - "title": "Annotations" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "OpenAIResponseOutputMessageContentOutputText" - }, - "OpenAIResponseOutputMessageFileSearchToolCall": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "queries": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Queries" - }, - "status": { - "type": "string", - "title": "Status" - }, - "type": { - "type": "string", - "const": "file_search_call", - "title": "Type", - "default": "file_search_call" - }, - "results": { - "title": "Results", - "items": { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults" - }, - "type": "array" - } - }, - "type": "object", - "required": [ - "id", - "queries", - "status" - ], - "title": "OpenAIResponseOutputMessageFileSearchToolCall", - "description": "File search tool call output message for OpenAI responses." - }, - "OpenAIResponseOutputMessageFileSearchToolCallResults": { - "properties": { - "attributes": { - "additionalProperties": true, - "type": "object", - "title": "Attributes" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "filename": { - "type": "string", - "title": "Filename" - }, - "score": { - "type": "number", - "title": "Score" - }, - "text": { - "type": "string", - "title": "Text" - } - }, - "type": "object", - "required": [ - "attributes", - "file_id", - "filename", - "score", - "text" - ], - "title": "OpenAIResponseOutputMessageFileSearchToolCallResults", - "description": "Search results returned by the file search operation." - }, - "OpenAIResponseOutputMessageFunctionToolCall": { - "properties": { - "call_id": { - "type": "string", - "title": "Call Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "arguments": { - "type": "string", - "title": "Arguments" - }, - "type": { - "type": "string", - "const": "function_call", - "title": "Type", - "default": "function_call" - }, - "id": { - "title": "Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "type": "object", - "required": [ - "call_id", - "name", - "arguments" - ], - "title": "OpenAIResponseOutputMessageFunctionToolCall", - "description": "Function tool call output message for OpenAI responses." - }, - "OpenAIResponseOutputMessageMCPCall": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "type": { - "type": "string", - "const": "mcp_call", - "title": "Type", - "default": "mcp_call" - }, - "arguments": { - "type": "string", - "title": "Arguments" - }, - "name": { - "type": "string", - "title": "Name" - }, - "server_label": { - "type": "string", - "title": "Server Label" - }, - "error": { - "title": "Error", - "type": "string" - }, - "output": { - "title": "Output", - "type": "string" - } - }, - "type": "object", - "required": [ - "id", - "arguments", - "name", - "server_label" - ], - "title": "OpenAIResponseOutputMessageMCPCall", - "description": "Model Context Protocol (MCP) call output message for OpenAI responses." - }, - "OpenAIResponseOutputMessageMCPListTools": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "type": { - "type": "string", - "const": "mcp_list_tools", - "title": "Type", - "default": "mcp_list_tools" - }, - "server_label": { - "type": "string", - "title": "Server Label" - }, - "tools": { - "items": { - "$ref": "#/components/schemas/MCPListToolsTool" - }, - "type": "array", - "title": "Tools" - } - }, - "type": "object", - "required": [ - "id", - "server_label", - "tools" - ], - "title": "OpenAIResponseOutputMessageMCPListTools", - "description": "MCP list tools output message containing available tools from an MCP server." - }, - "OpenAIResponseOutputMessageWebSearchToolCall": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "status": { - "type": "string", - "title": "Status" - }, - "type": { - "type": "string", - "const": "web_search_call", - "title": "Type", - "default": "web_search_call" - } - }, - "type": "object", - "required": [ - "id", - "status" - ], - "title": "OpenAIResponseOutputMessageWebSearchToolCall", - "description": "Web search tool call output message for OpenAI responses." - }, - "OpenAIResponsePrompt": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "variables": { - "title": "Variables", - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", - "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", - "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" - } - } - }, - "type": "object" - }, - "version": { - "title": "Version", - "type": "string" - } - }, - "type": "object", - "required": [ - "id" - ], - "title": "OpenAIResponsePrompt", - "description": "OpenAI compatible Prompt object that is used in OpenAI responses." - }, - "OpenAIResponseText": { - "properties": { - "format": { - "$ref": "#/components/schemas/OpenAIResponseTextFormat" - } - }, - "type": "object", - "title": "OpenAIResponseText", - "description": "Text response configuration for OpenAI responses." - }, - "OpenAIResponseTextFormat": { - "properties": { - "type": { - "anyOf": [ - { - "type": "string", - "const": "text" - }, - { - "type": "string", - "const": "json_schema" - }, - { - "type": "string", - "const": "json_object" - } - ], - "title": "Type" - }, - "name": { - "title": "Name", - "type": "string" - }, - "schema": { - "title": "Schema", - "additionalProperties": true, - "type": "object" - }, - "description": { - "title": "Description", - "type": "string" - }, - "strict": { - "title": "Strict", - "type": "boolean" - } - }, - "type": "object", - "title": "OpenAIResponseTextFormat", - "description": "Configuration for Responses API text format." - }, - "OpenAIResponseToolMCP": { - "properties": { - "type": { - "type": "string", - "const": "mcp", - "title": "Type", - "default": "mcp" - }, - "server_label": { - "type": "string", - "title": "Server Label" - }, - "allowed_tools": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "$ref": "#/components/schemas/AllowedToolsFilter" - } - ], - "title": "Allowed Tools" - } - }, - "type": "object", - "required": [ - "server_label" - ], - "title": "OpenAIResponseToolMCP", - "description": "Model Context Protocol (MCP) tool configuration for OpenAI response object." - }, - "OpenAIResponseUsage": { - "properties": { - "input_tokens": { - "type": "integer", - "title": "Input Tokens" - }, - "output_tokens": { - "type": "integer", - "title": "Output Tokens" - }, - "total_tokens": { - "type": "integer", - "title": "Total Tokens" - }, - "input_tokens_details": { - "$ref": "#/components/schemas/OpenAIResponseUsageInputTokensDetails" - }, - "output_tokens_details": { - "$ref": "#/components/schemas/OpenAIResponseUsageOutputTokensDetails" - } - }, - "type": "object", - "required": [ - "input_tokens", - "output_tokens", - "total_tokens" - ], - "title": "OpenAIResponseUsage", - "description": "Usage information for OpenAI response." - }, - "OpenAIResponseUsageInputTokensDetails": { - "properties": { - "cached_tokens": { - "title": "Cached Tokens", - "type": "integer" - } - }, - "type": "object", - "title": "OpenAIResponseUsageInputTokensDetails", - "description": "Token details for input tokens in OpenAI response usage." - }, - "OpenAIResponseUsageOutputTokensDetails": { - "properties": { - "reasoning_tokens": { - "title": "Reasoning Tokens", - "type": "integer" - } - }, - "type": "object", - "title": "OpenAIResponseUsageOutputTokensDetails", - "description": "Token details for output tokens in OpenAI response usage." - }, - "OpenAISystemMessageParam": { - "properties": { - "role": { - "type": "string", - "const": "system", - "title": "Role", - "default": "system" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "OpenAISystemMessageParam", - "description": "A system message providing instructions or context to the model." - }, - "OpenAITokenLogProb": { - "properties": { - "token": { - "type": "string", - "title": "Token" - }, - "bytes": { - "title": "Bytes", - "items": { - "type": "integer" - }, - "type": "array" - }, - "logprob": { - "type": "number", - "title": "Logprob" - }, - "top_logprobs": { - "items": { - "$ref": "#/components/schemas/OpenAITopLogProb" - }, - "type": "array", - "title": "Top Logprobs" - } - }, - "type": "object", - "required": [ - "token", - "logprob", - "top_logprobs" - ], - "title": "OpenAITokenLogProb", - "description": "The log probability for a token from an OpenAI-compatible chat completion response." - }, - "OpenAIToolMessageParam": { - "properties": { - "role": { - "type": "string", - "const": "tool", - "title": "Role", - "default": "tool" - }, - "tool_call_id": { - "type": "string", - "title": "Tool Call Id" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content" - } - }, - "type": "object", - "required": [ - "tool_call_id", - "content" - ], - "title": "OpenAIToolMessageParam", - "description": "A message representing the result of a tool invocation in an OpenAI-compatible chat completion request." - }, - "OpenAITopLogProb": { - "properties": { - "token": { - "type": "string", - "title": "Token" - }, - "bytes": { - "title": "Bytes", - "items": { - "type": "integer" - }, - "type": "array" - }, - "logprob": { - "type": "number", - "title": "Logprob" - } - }, - "type": "object", - "required": [ - "token", - "logprob" - ], - "title": "OpenAITopLogProb", - "description": "The top log probability for a token from an OpenAI-compatible chat completion response." - }, - "OpenAIUserMessageParam-Input": { - "properties": { - "role": { - "type": "string", - "const": "user", - "title": "Role", - "default": "user" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" - }, - { - "$ref": "#/components/schemas/OpenAIFile" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "file": "#/components/schemas/OpenAIFile", - "image_url": "#/components/schemas/OpenAIChatCompletionContentPartImageParam", - "text": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "OpenAIUserMessageParam", - "description": "A message from the user in an OpenAI-compatible chat completion request." - }, - "OpenAIUserMessageParam-Output": { - "properties": { - "role": { - "type": "string", - "const": "user", - "title": "Role", - "default": "user" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" - }, - { - "$ref": "#/components/schemas/OpenAIFile" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "file": "#/components/schemas/OpenAIFile", - "image_url": "#/components/schemas/OpenAIChatCompletionContentPartImageParam", - "text": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "OpenAIUserMessageParam", - "description": "A message from the user in an OpenAI-compatible chat completion request." - }, - "Order": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "title": "Order", - "description": "Sort order for paginated responses." - }, - "OutputTokensDetails": { - "properties": { - "reasoning_tokens": { - "type": "integer", - "title": "Reasoning Tokens" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "reasoning_tokens" - ], - "title": "OutputTokensDetails" - }, - "Prompt": { - "properties": { - "prompt": { - "title": "Prompt", - "description": "The system prompt with variable placeholders", - "type": "string" - }, - "version": { - "type": "integer", - "minimum": 1.0, - "title": "Version", - "description": "Version (integer starting at 1, incremented on save)" - }, - "prompt_id": { - "type": "string", - "title": "Prompt Id", - "description": "Unique identifier in format 'pmpt_<48-digit-hash>'" - }, - "variables": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Variables", - "description": "List of variable names that can be used in the prompt template" - }, - "is_default": { - "type": "boolean", - "title": "Is Default", - "description": "Boolean indicating whether this version is the default version", - "default": false - } - }, - "type": "object", - "required": [ - "version", - "prompt_id" - ], - "title": "Prompt", - "description": "A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack." - }, - "ProviderInfo": { - "properties": { - "api": { - "type": "string", - "title": "Api" - }, - "provider_id": { - "type": "string", - "title": "Provider Id" - }, - "provider_type": { - "type": "string", - "title": "Provider Type" - }, - "config": { - "additionalProperties": true, - "type": "object", - "title": "Config" - }, - "health": { - "additionalProperties": true, - "type": "object", - "title": "Health" - } - }, - "type": "object", - "required": [ - "api", - "provider_id", - "provider_type", - "config", - "health" - ], - "title": "ProviderInfo", - "description": "Information about a registered provider including its configuration and health status." - }, - "QueryChunksResponse": { - "properties": { - "chunks": { - "items": { - "$ref": "#/components/schemas/Chunk-Output" - }, - "type": "array", - "title": "Chunks" - }, - "scores": { - "items": { - "type": "number" - }, - "type": "array", - "title": "Scores" - } - }, - "type": "object", - "required": [ - "chunks", - "scores" - ], - "title": "QueryChunksResponse", - "description": "Response from querying chunks in a vector database." - }, - "RAGQueryConfig": { - "properties": { - "query_generator_config": { - "oneOf": [ - { - "$ref": "#/components/schemas/DefaultRAGQueryGeneratorConfig" - }, - { - "$ref": "#/components/schemas/LLMRAGQueryGeneratorConfig" - } - ], - "title": "Query Generator Config", - "default": { - "type": "default", - "separator": " " - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "default": "#/components/schemas/DefaultRAGQueryGeneratorConfig", - "llm": "#/components/schemas/LLMRAGQueryGeneratorConfig" - } - } - }, - "max_tokens_in_context": { - "type": "integer", - "title": "Max Tokens In Context", - "default": 4096 - }, - "max_chunks": { - "type": "integer", - "title": "Max Chunks", - "default": 5 - }, - "chunk_template": { - "type": "string", - "title": "Chunk Template", - "default": "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n" - }, - "mode": { - "default": "vector", - "$ref": "#/components/schemas/RAGSearchMode" - }, - "ranker": { - "title": "Ranker", - "oneOf": [ - { - "$ref": "#/components/schemas/RRFRanker" - }, - { - "$ref": "#/components/schemas/WeightedRanker" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "rrf": "#/components/schemas/RRFRanker", - "weighted": "#/components/schemas/WeightedRanker" - } - } - } - }, - "type": "object", - "title": "RAGQueryConfig", - "description": "Configuration for the RAG query generation." - }, - "RAGQueryResult": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - } - }, - "type": "object", - "title": "RAGQueryResult", - "description": "Result of a RAG query containing retrieved content and metadata." - }, - "RAGSearchMode": { - "type": "string", - "enum": [ - "vector", - "keyword", - "hybrid" - ], - "title": "RAGSearchMode", - "description": "Search modes for RAG query retrieval:\n- VECTOR: Uses vector similarity search for semantic matching\n- KEYWORD: Uses keyword-based search for exact matching\n- HYBRID: Combines both vector and keyword search for better results" - }, - "RRFRanker": { - "properties": { - "type": { - "type": "string", - "const": "rrf", - "title": "Type", - "default": "rrf" - }, - "impact_factor": { - "type": "number", - "title": "Impact Factor", - "default": 60.0, - "minimum": 0.0 - } - }, - "type": "object", - "title": "RRFRanker", - "description": "Reciprocal Rank Fusion (RRF) ranker configuration." - }, - "RegexParserScoringFnParams": { - "properties": { - "type": { - "type": "string", - "const": "regex_parser", - "title": "Type", - "default": "regex_parser" - }, - "parsing_regexes": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Parsing Regexes", - "description": "Regex to extract the answer from generated response" - }, - "aggregation_functions": { - "items": { - "$ref": "#/components/schemas/AggregationFunctionType" - }, - "type": "array", - "title": "Aggregation Functions", - "description": "Aggregation functions to apply to the scores of each row" - } - }, - "type": "object", - "title": "RegexParserScoringFnParams", - "description": "Parameters for regex parser scoring function configuration." - }, - "RouteInfo": { - "properties": { - "route": { - "type": "string", - "title": "Route" - }, - "method": { - "type": "string", - "title": "Method" - }, - "provider_types": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Provider Types" - } - }, - "type": "object", - "required": [ - "route", - "method", - "provider_types" - ], - "title": "RouteInfo", - "description": "Information about an API route including its path, method, and implementing providers." - }, - "RunShieldResponse": { - "properties": { - "violation": { - "$ref": "#/components/schemas/SafetyViolation" - } - }, - "type": "object", - "title": "RunShieldResponse", - "description": "Response from running a safety shield." - }, - "SafetyViolation": { - "properties": { - "violation_level": { - "$ref": "#/components/schemas/ViolationLevel" - }, - "user_message": { - "title": "User Message", - "type": "string" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "violation_level" - ], - "title": "SafetyViolation", - "description": "Details of a safety violation detected by content moderation." - }, - "ScoreBatchResponse": { - "properties": { - "dataset_id": { - "title": "Dataset Id", - "type": "string" - }, - "results": { - "additionalProperties": { - "$ref": "#/components/schemas/ScoringResult" - }, - "type": "object", - "title": "Results" - } - }, - "type": "object", - "required": [ - "results" - ], - "title": "ScoreBatchResponse", - "description": "Response from batch scoring operations on datasets." - }, - "ScoreResponse": { - "properties": { - "results": { - "additionalProperties": { - "$ref": "#/components/schemas/ScoringResult" - }, - "type": "object", - "title": "Results" - } - }, - "type": "object", - "required": [ - "results" - ], - "title": "ScoreResponse", - "description": "The response from scoring." - }, - "ScoringFn-Output": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "scoring_function", - "title": "Type", - "default": "scoring_function" - }, - "description": { - "title": "Description", - "type": "string" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata", - "description": "Any additional metadata for this definition" - }, - "return_type": { - "oneOf": [ - { - "$ref": "#/components/schemas/StringType" - }, - { - "$ref": "#/components/schemas/NumberType" - }, - { - "$ref": "#/components/schemas/BooleanType" - }, - { - "$ref": "#/components/schemas/ArrayType" - }, - { - "$ref": "#/components/schemas/ObjectType" - }, - { - "$ref": "#/components/schemas/JsonType" - }, - { - "$ref": "#/components/schemas/UnionType" - }, - { - "$ref": "#/components/schemas/ChatCompletionInputType" - }, - { - "$ref": "#/components/schemas/CompletionInputType" - }, - { - "$ref": "#/components/schemas/AgentTurnInputType" - } - ], - "title": "Return Type", - "description": "The return type of the deterministic function", - "discriminator": { - "propertyName": "type", - "mapping": { - "agent_turn_input": "#/components/schemas/AgentTurnInputType", - "array": "#/components/schemas/ArrayType", - "boolean": "#/components/schemas/BooleanType", - "chat_completion_input": "#/components/schemas/ChatCompletionInputType", - "completion_input": "#/components/schemas/CompletionInputType", - "json": "#/components/schemas/JsonType", - "number": "#/components/schemas/NumberType", - "object": "#/components/schemas/ObjectType", - "string": "#/components/schemas/StringType", - "union": "#/components/schemas/UnionType" - } - } - }, - "params": { - "title": "Params", - "description": "The parameters for the scoring function for benchmark eval, these can be overridden for app eval", - "oneOf": [ - { - "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" - }, - { - "$ref": "#/components/schemas/RegexParserScoringFnParams" - }, - { - "$ref": "#/components/schemas/BasicScoringFnParams" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "basic": "#/components/schemas/BasicScoringFnParams", - "llm_as_judge": "#/components/schemas/LLMAsJudgeScoringFnParams", - "regex_parser": "#/components/schemas/RegexParserScoringFnParams" - } - } - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id", - "return_type" - ], - "title": "ScoringFn", - "description": "A scoring function resource for evaluating model outputs." - }, - "ScoringResult": { - "properties": { - "score_rows": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Score Rows" - }, - "aggregated_results": { - "additionalProperties": true, - "type": "object", - "title": "Aggregated Results" - } - }, - "type": "object", - "required": [ - "score_rows", - "aggregated_results" - ], - "title": "ScoringResult", - "description": "A scoring result for a single row." - }, - "SearchRankingOptions": { - "properties": { - "ranker": { - "title": "Ranker", - "type": "string" - }, - "score_threshold": { - "title": "Score Threshold", - "default": 0.0, - "type": "number" - } - }, - "type": "object", - "title": "SearchRankingOptions", - "description": "Options for ranking and filtering search results." - }, - "Shield": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "shield", - "title": "Type", - "default": "shield" - }, - "params": { - "title": "Params", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id" - ], - "title": "Shield", - "description": "A safety shield resource that can be used to check content." - }, - "StringType": { - "properties": { - "type": { - "type": "string", - "const": "string", - "title": "Type", - "default": "string" - } - }, - "type": "object", - "title": "StringType", - "description": "Parameter type for string values." - }, - "TextContentItem": { - "properties": { - "type": { - "type": "string", - "const": "text", - "title": "Type", - "default": "text" - }, - "text": { - "type": "string", - "title": "Text" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "TextContentItem", - "description": "A text content item" - }, - "ToolDef": { - "properties": { - "toolgroup_id": { - "title": "Toolgroup Id", - "type": "string" - }, - "name": { - "type": "string", - "title": "Name" - }, - "description": { - "title": "Description", - "type": "string" - }, - "input_schema": { - "title": "Input Schema", - "additionalProperties": true, - "type": "object" - }, - "output_schema": { - "title": "Output Schema", - "additionalProperties": true, - "type": "object" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "required": [ - "name" - ], - "title": "ToolDef", - "description": "Tool definition used in runtime contexts." - }, - "ToolGroup": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "tool_group", - "title": "Type", - "default": "tool_group" - }, - "mcp_endpoint": { - "$ref": "#/components/schemas/URL" - }, - "args": { - "title": "Args", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id" - ], - "title": "ToolGroup", - "description": "A group of related tools managed together." - }, - "ToolInvocationResult": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "error_message": { - "title": "Error Message", - "type": "string" - }, - "error_code": { - "title": "Error Code", - "type": "integer" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "title": "ToolInvocationResult", - "description": "Result of a tool invocation." - }, - "URL": { - "properties": { - "uri": { - "type": "string", - "title": "Uri" - } - }, - "type": "object", - "required": [ - "uri" - ], - "title": "URL", - "description": "A URL reference to external content." - }, - "UnionType": { - "properties": { - "type": { - "type": "string", - "const": "union", - "title": "Type", - "default": "union" - } - }, - "type": "object", - "title": "UnionType", - "description": "Parameter type for union values." - }, - "VectorStoreChunkingStrategyAuto": { - "properties": { - "type": { - "type": "string", - "const": "auto", - "title": "Type", - "default": "auto" - } - }, - "type": "object", - "title": "VectorStoreChunkingStrategyAuto", - "description": "Automatic chunking strategy for vector store files." - }, - "VectorStoreChunkingStrategyStatic": { - "properties": { - "type": { - "type": "string", - "const": "static", - "title": "Type", - "default": "static" - }, - "static": { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyStaticConfig" - } - }, - "type": "object", - "required": [ - "static" - ], - "title": "VectorStoreChunkingStrategyStatic", - "description": "Static chunking strategy with configurable parameters." - }, - "VectorStoreChunkingStrategyStaticConfig": { - "properties": { - "chunk_overlap_tokens": { - "type": "integer", - "title": "Chunk Overlap Tokens", - "default": 400 - }, - "max_chunk_size_tokens": { - "type": "integer", - "maximum": 4096.0, - "minimum": 100.0, - "title": "Max Chunk Size Tokens", - "default": 800 - } - }, - "type": "object", - "title": "VectorStoreChunkingStrategyStaticConfig", - "description": "Configuration for static chunking strategy." - }, - "VectorStoreContent": { - "properties": { - "type": { - "type": "string", - "const": "text", - "title": "Type" - }, - "text": { - "type": "string", - "title": "Text" - } - }, - "type": "object", - "required": [ - "type", - "text" - ], - "title": "VectorStoreContent", - "description": "Content item from a vector store file or search result." - }, - "VectorStoreFileBatchObject": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "object": { - "type": "string", - "title": "Object", - "default": "vector_store.file_batch" - }, - "created_at": { - "type": "integer", - "title": "Created At" - }, - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "status": { - "anyOf": [ - { - "type": "string", - "const": "completed" - }, - { - "type": "string", - "const": "in_progress" - }, - { - "type": "string", - "const": "cancelled" - }, - { - "type": "string", - "const": "failed" - } - ], - "title": "Status" - }, - "file_counts": { - "$ref": "#/components/schemas/VectorStoreFileCounts" - } - }, - "type": "object", - "required": [ - "id", - "created_at", - "vector_store_id", - "status", - "file_counts" - ], - "title": "VectorStoreFileBatchObject", - "description": "OpenAI Vector Store File Batch object." - }, - "VectorStoreFileCounts": { - "properties": { - "completed": { - "type": "integer", - "title": "Completed" - }, - "cancelled": { - "type": "integer", - "title": "Cancelled" - }, - "failed": { - "type": "integer", - "title": "Failed" - }, - "in_progress": { - "type": "integer", - "title": "In Progress" - }, - "total": { - "type": "integer", - "title": "Total" - } - }, - "type": "object", - "required": [ - "completed", - "cancelled", - "failed", - "in_progress", - "total" - ], - "title": "VectorStoreFileCounts", - "description": "File processing status counts for a vector store." - }, - "VectorStoreFileLastError": { - "properties": { - "code": { - "anyOf": [ - { - "type": "string", - "const": "server_error" - }, - { - "type": "string", - "const": "rate_limit_exceeded" - } - ], - "title": "Code" - }, - "message": { - "type": "string", - "title": "Message" - } - }, - "type": "object", - "required": [ - "code", - "message" - ], - "title": "VectorStoreFileLastError", - "description": "Error information for failed vector store file processing." - }, - "VectorStoreFileObject": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "object": { - "type": "string", - "title": "Object", - "default": "vector_store.file" - }, - "attributes": { - "additionalProperties": true, - "type": "object", - "title": "Attributes" - }, - "chunking_strategy": { - "oneOf": [ - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" - }, - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - ], - "title": "Chunking Strategy", - "discriminator": { - "propertyName": "type", - "mapping": { - "auto": "#/components/schemas/VectorStoreChunkingStrategyAuto", - "static": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - } - }, - "created_at": { - "type": "integer", - "title": "Created At" - }, - "last_error": { - "$ref": "#/components/schemas/VectorStoreFileLastError" - }, - "status": { - "anyOf": [ - { - "type": "string", - "const": "completed" - }, - { - "type": "string", - "const": "in_progress" - }, - { - "type": "string", - "const": "cancelled" - }, - { - "type": "string", - "const": "failed" - } - ], - "title": "Status" - }, - "usage_bytes": { - "type": "integer", - "title": "Usage Bytes", - "default": 0 - }, - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - } - }, - "type": "object", - "required": [ - "id", - "chunking_strategy", - "created_at", - "status", - "vector_store_id" - ], - "title": "VectorStoreFileObject", - "description": "OpenAI Vector Store File object." - }, - "VectorStoreObject": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "object": { - "type": "string", - "title": "Object", - "default": "vector_store" - }, - "created_at": { - "type": "integer", - "title": "Created At" - }, - "name": { - "title": "Name", - "type": "string" - }, - "usage_bytes": { - "type": "integer", - "title": "Usage Bytes", - "default": 0 - }, - "file_counts": { - "$ref": "#/components/schemas/VectorStoreFileCounts" - }, - "status": { - "type": "string", - "title": "Status", - "default": "completed" - }, - "expires_after": { - "title": "Expires After", - "additionalProperties": true, - "type": "object" - }, - "expires_at": { - "title": "Expires At", - "type": "integer" - }, - "last_active_at": { - "title": "Last Active At", - "type": "integer" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "id", - "created_at", - "file_counts" - ], - "title": "VectorStoreObject", - "description": "OpenAI Vector Store object." - }, - "VectorStoreSearchResponse": { - "properties": { - "file_id": { - "type": "string", - "title": "File Id" - }, - "filename": { - "type": "string", - "title": "Filename" - }, - "score": { - "type": "number", - "title": "Score" - }, - "attributes": { - "title": "Attributes", - "additionalProperties": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - } - ] - }, - "type": "object" - }, - "content": { - "items": { - "$ref": "#/components/schemas/VectorStoreContent" - }, - "type": "array", - "title": "Content" - } - }, - "type": "object", - "required": [ - "file_id", - "filename", - "score", - "content" - ], - "title": "VectorStoreSearchResponse", - "description": "Response from searching a vector store." - }, - "VectorStoreSearchResponsePage": { - "properties": { - "object": { - "type": "string", - "title": "Object", - "default": "vector_store.search_results.page" - }, - "search_query": { - "type": "string", - "title": "Search Query" - }, - "data": { - "items": { - "$ref": "#/components/schemas/VectorStoreSearchResponse" - }, - "type": "array", - "title": "Data" - }, - "has_more": { - "type": "boolean", - "title": "Has More", - "default": false - }, - "next_page": { - "title": "Next Page", - "type": "string" - } - }, - "type": "object", - "required": [ - "search_query", - "data" - ], - "title": "VectorStoreSearchResponsePage", - "description": "Paginated response from searching a vector store." - }, - "VersionInfo": { - "properties": { - "version": { - "type": "string", - "title": "Version" - } - }, - "type": "object", - "required": [ - "version" - ], - "title": "VersionInfo", - "description": "Version information for the service." - }, - "ViolationLevel": { - "type": "string", - "enum": [ - "info", - "warn", - "error" - ], - "title": "ViolationLevel", - "description": "Severity level of a safety violation." - }, - "WeightedRanker": { - "properties": { - "type": { - "type": "string", - "const": "weighted", - "title": "Type", - "default": "weighted" - }, - "alpha": { - "type": "number", - "maximum": 1.0, - "minimum": 0.0, - "title": "Alpha", - "description": "Weight factor between 0 and 1. 0 means only keyword scores, 1 means only vector scores.", - "default": 0.5 - } - }, - "type": "object", - "title": "WeightedRanker", - "description": "Weighted ranker configuration that combines vector and keyword scores." - }, - "_URLOrData": { - "properties": { - "url": { - "$ref": "#/components/schemas/URL" - }, - "data": { - "contentEncoding": "base64", - "title": "Data", - "type": "string" - } - }, - "type": "object", - "title": "_URLOrData", - "description": "A URL or a base64 encoded string" - }, - "_batches_Request": { - "properties": { - "input_file_id": { - "type": "string", - "title": "Input File Id" - }, - "endpoint": { - "type": "string", - "title": "Endpoint" - }, - "completion_window": { - "type": "string", - "title": "Completion Window" - }, - "metadata": { - "type": "string", - "title": "Metadata" - }, - "idempotency_key": { - "type": "string", - "title": "Idempotency Key" - } - }, - "type": "object", - "required": [ - "input_file_id", - "endpoint", - "completion_window", - "metadata", - "idempotency_key" - ], - "title": "_batches_Request" - }, - "_batches_batch_id_cancel_Request": { - "properties": { - "batch_id": { - "type": "string", - "title": "Batch Id" - } - }, - "type": "object", - "required": [ - "batch_id" - ], - "title": "_batches_batch_id_cancel_Request" - }, - "_conversations_Request": { - "properties": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage-Input" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - } - ], - "title": "Items", - "discriminator": { - "propertyName": "type", - "mapping": { - "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", - "function_call_output": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput", - "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", - "mcp_approval_response": "#/components/schemas/OpenAIResponseMCPApprovalResponse", - "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", - "message": "#/components/schemas/OpenAIResponseMessage-Input", - "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - } - } - }, - "metadata": { - "type": "string", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "items", - "metadata" - ], - "title": "_conversations_Request" - }, - "_conversations_conversation_id_Request": { - "properties": { - "conversation_id": { - "type": "string", - "title": "Conversation Id" - }, - "metadata": { - "type": "string", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "conversation_id", - "metadata" - ], - "title": "_conversations_conversation_id_Request" - }, - "_conversations_conversation_id_items_Request": { - "properties": { - "conversation_id": { - "type": "string", - "title": "Conversation Id" - }, - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage-Input" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - } - ], - "title": "Items" - } - }, - "type": "object", - "required": [ - "conversation_id", - "items" - ], - "title": "_conversations_conversation_id_items_Request" - }, - "_models_Request": { - "properties": { - "model_id": { - "type": "string", - "title": "Model Id" - }, - "provider_model_id": { - "type": "string", - "title": "Provider Model Id" - }, - "provider_id": { - "type": "string", - "title": "Provider Id" - }, - "metadata": { - "type": "string", - "title": "Metadata" - }, - "model_type": { - "$ref": "#/components/schemas/ModelType" - } - }, - "type": "object", - "required": [ - "model_id", - "provider_model_id", - "provider_id", - "metadata", - "model_type" - ], - "title": "_models_Request" - }, - "_moderations_Request": { - "properties": { - "input": { - "type": "string", - "title": "Input" - }, - "model": { - "type": "string", - "title": "Model" - } - }, - "type": "object", - "required": [ - "input", - "model" - ], - "title": "_moderations_Request" - }, - "_prompts_Request": { - "properties": { - "prompt": { - "type": "string", - "title": "Prompt" - }, - "variables": { - "type": "string", - "title": "Variables" - } - }, - "type": "object", - "required": [ - "prompt", - "variables" - ], - "title": "_prompts_Request" - }, - "_prompts_prompt_id_Request": { - "properties": { - "prompt_id": { - "type": "string", - "title": "Prompt Id" - }, - "prompt": { - "type": "string", - "title": "Prompt" - }, - "version": { - "type": "integer", - "title": "Version" - }, - "variables": { - "type": "string", - "title": "Variables" - }, - "set_as_default": { - "type": "boolean", - "title": "Set As Default", - "default": true - } - }, - "type": "object", - "required": [ - "prompt_id", - "prompt", - "version", - "variables" - ], - "title": "_prompts_prompt_id_Request" - }, - "_prompts_prompt_id_set_default_version_Request": { - "properties": { - "prompt_id": { - "type": "string", - "title": "Prompt Id" - }, - "version": { - "type": "integer", - "title": "Version" - } - }, - "type": "object", - "required": [ - "prompt_id", - "version" - ], - "title": "_prompts_prompt_id_set_default_version_Request" - }, - "_responses_Request": { - "properties": { - "input": { - "type": "string", - "title": "Input" - }, - "model": { - "type": "string", - "title": "Model" - }, - "prompt": { - "$ref": "#/components/schemas/OpenAIResponsePrompt" - }, - "instructions": { - "type": "string", - "title": "Instructions" - }, - "previous_response_id": { - "type": "string", - "title": "Previous Response Id" - }, - "conversation": { - "type": "string", - "title": "Conversation" - }, - "store": { - "type": "boolean", - "title": "Store", - "default": true - }, - "stream": { - "type": "boolean", - "title": "Stream", - "default": false - }, - "temperature": { - "type": "number", - "title": "Temperature" - }, - "text": { - "$ref": "#/components/schemas/OpenAIResponseText" - }, - "tools": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolMCP" - } - ], - "title": "Tools", - "discriminator": { - "propertyName": "type", - "mapping": { - "file_search": "#/components/schemas/OpenAIResponseInputToolFileSearch", - "function": "#/components/schemas/OpenAIResponseInputToolFunction", - "mcp": "#/components/schemas/OpenAIResponseInputToolMCP", - "web_search": "#/components/schemas/OpenAIResponseInputToolWebSearch", - "web_search_preview": "#/components/schemas/OpenAIResponseInputToolWebSearch", - "web_search_preview_2025_03_11": "#/components/schemas/OpenAIResponseInputToolWebSearch" - } - } - }, - "include": { - "type": "string", - "title": "Include" - }, - "max_infer_iters": { - "type": "integer", - "title": "Max Infer Iters", - "default": 10 - } - }, - "type": "object", - "required": [ - "input", - "model", - "prompt", - "instructions", - "previous_response_id", - "conversation", - "temperature", - "text", - "tools", - "include" - ], - "title": "_responses_Request" - }, - "_scoring_score_Request": { - "properties": { - "input_rows": { - "type": "string", - "title": "Input Rows" - }, - "scoring_functions": { - "type": "string", - "title": "Scoring Functions" - } - }, - "type": "object", - "required": [ - "input_rows", - "scoring_functions" - ], - "title": "_scoring_score_Request" - }, - "_scoring_score_batch_Request": { - "properties": { - "dataset_id": { - "type": "string", - "title": "Dataset Id" - }, - "scoring_functions": { - "type": "string", - "title": "Scoring Functions" - }, - "save_results_dataset": { - "type": "boolean", - "title": "Save Results Dataset", - "default": false - } - }, - "type": "object", - "required": [ - "dataset_id", - "scoring_functions" - ], - "title": "_scoring_score_batch_Request" - }, - "_shields_Request": { - "properties": { - "shield_id": { - "type": "string", - "title": "Shield Id" - }, - "provider_shield_id": { - "type": "string", - "title": "Provider Shield Id" - }, - "provider_id": { - "type": "string", - "title": "Provider Id" - }, - "params": { - "type": "string", - "title": "Params" - } - }, - "type": "object", - "required": [ - "shield_id", - "provider_shield_id", - "provider_id", - "params" - ], - "title": "_shields_Request" - }, - "_tool_runtime_invoke_Request": { - "properties": { - "tool_name": { - "type": "string", - "title": "Tool Name" - }, - "kwargs": { - "type": "string", - "title": "Kwargs" - } - }, - "type": "object", - "required": [ - "tool_name", - "kwargs" - ], - "title": "_tool_runtime_invoke_Request" - }, - "_tool_runtime_rag_tool_query_Request": { - "properties": { - "content": { - "type": "string", - "title": "Content" - }, - "vector_store_ids": { - "type": "string", - "title": "Vector Store Ids" - }, - "query_config": { - "$ref": "#/components/schemas/RAGQueryConfig" - } - }, - "type": "object", - "required": [ - "content", - "vector_store_ids", - "query_config" - ], - "title": "_tool_runtime_rag_tool_query_Request" - }, - "_vector_io_query_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "query": { - "type": "string", - "title": "Query" - }, - "params": { - "type": "string", - "title": "Params" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "query", - "params" - ], - "title": "_vector_io_query_Request" - }, - "_vector_stores_vector_store_id_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "expires_after": { - "type": "string", - "title": "Expires After" - }, - "metadata": { - "type": "string", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "name", - "expires_after", - "metadata" - ], - "title": "_vector_stores_vector_store_id_Request" - }, - "_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request": { - "properties": { - "batch_id": { - "type": "string", - "title": "Batch Id" - }, - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - } - }, - "type": "object", - "required": [ - "batch_id", - "vector_store_id" - ], - "title": "_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request" - }, - "_vector_stores_vector_store_id_files_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "attributes": { - "type": "string", - "title": "Attributes" - }, - "chunking_strategy": { - "anyOf": [ - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" - }, - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - ], - "title": "Chunking Strategy" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "file_id", - "attributes", - "chunking_strategy" - ], - "title": "_vector_stores_vector_store_id_files_Request" - }, - "_vector_stores_vector_store_id_files_file_id_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "attributes": { - "type": "string", - "title": "Attributes" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "file_id", - "attributes" - ], - "title": "_vector_stores_vector_store_id_files_file_id_Request" - }, - "_vector_stores_vector_store_id_search_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "query": { - "type": "string", - "title": "Query" - }, - "filters": { - "type": "string", - "title": "Filters" - }, - "max_num_results": { - "type": "integer", - "title": "Max Num Results", - "default": 10 - }, - "ranking_options": { - "$ref": "#/components/schemas/SearchRankingOptions" - }, - "rewrite_query": { - "type": "boolean", - "title": "Rewrite Query", - "default": false - }, - "search_mode": { - "type": "string", - "title": "Search Mode", - "default": "vector" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "query", - "filters", - "ranking_options" - ], - "title": "_vector_stores_vector_store_id_search_Request" - }, - "Error": { - "description": "Error response from the API. Roughly follows RFC 7807.", - "properties": { - "status": { - "title": "Status", - "type": "integer" - }, - "title": { - "title": "Title", - "type": "string" - }, - "detail": { - "title": "Detail", - "type": "string" - }, - "instance": { - "title": "Instance", - "type": "string", - "nullable": true - } - }, - "required": [ - "status", - "title", - "detail" - ], - "title": "Error", - "type": "object" - }, - "ListOpenAIResponseInputItem": { - "description": "List container for OpenAI response input items.", - "properties": { - "data": { - "items": { - "anyOf": [ - { - "discriminator": { - "mapping": { - "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", - "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", - "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", - "message": "#/$defs/OpenAIResponseMessage", - "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - } - ] - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - } - ] - }, - "title": "Data", - "type": "array" - }, - "object": { - "const": "list", - "default": "list", - "title": "Object", - "type": "string" - } - }, - "required": [ - "data" - ], - "title": "ListOpenAIResponseInputItem", - "type": "object" - }, - "ListOpenAIResponseObject": { - "description": "Paginated list of OpenAI response objects with navigation metadata.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/OpenAIResponseObjectWithInput" - }, - "title": "Data", - "type": "array" - }, - "has_more": { - "title": "Has More", - "type": "boolean" - }, - "first_id": { - "title": "First Id", - "type": "string" - }, - "last_id": { - "title": "Last Id", - "type": "string" - }, - "object": { - "const": "list", - "default": "list", - "title": "Object", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "first_id", - "last_id" - ], - "title": "ListOpenAIResponseObject", - "type": "object" - }, - "OpenAIDeleteResponseObject": { - "description": "Response object confirming deletion of an OpenAI response.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "object": { - "const": "response", - "default": "response", - "title": "Object", - "type": "string" - }, - "deleted": { - "default": true, - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id" - ], - "title": "OpenAIDeleteResponseObject", - "type": "object" - }, - "ListBatchesResponse": { - "description": "Response containing a list of batch objects.", - "properties": { - "object": { - "const": "list", - "default": "list", - "title": "Object", - "type": "string" - }, - "data": { - "description": "List of batch objects", - "items": { - "$ref": "#/components/schemas/Batch" - }, - "title": "Data", - "type": "array" - }, - "first_id": { - "description": "ID of the first batch in the list", - "title": "First Id", - "type": "string", - "nullable": true - }, - "last_id": { - "description": "ID of the last batch in the list", - "title": "Last Id", - "type": "string", - "nullable": true - }, - "has_more": { - "default": false, - "description": "Whether there are more batches available", - "title": "Has More", - "type": "boolean" - } - }, - "required": [ - "data" - ], - "title": "ListBatchesResponse", - "type": "object" - }, - "ConversationDeletedResource": { - "description": "Response for deleted conversation.", - "properties": { - "id": { - "description": "The deleted conversation identifier", - "title": "Id", - "type": "string" - }, - "object": { - "default": "conversation.deleted", - "description": "Object type", - "title": "Object", - "type": "string" - }, - "deleted": { - "default": true, - "description": "Whether the object was deleted", - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id" - ], - "title": "ConversationDeletedResource", - "type": "object" - }, - "ConversationItemDeletedResource": { - "description": "Response for deleted conversation item.", - "properties": { - "id": { - "description": "The deleted item identifier", - "title": "Id", - "type": "string" - }, - "object": { - "default": "conversation.item.deleted", - "description": "Object type", - "title": "Object", - "type": "string" - }, - "deleted": { - "default": true, - "description": "Whether the object was deleted", - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id" - ], - "title": "ConversationItemDeletedResource", - "type": "object" - }, - "ListOpenAIFileResponse": { - "description": "Response for listing files in OpenAI Files API.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/OpenAIFileObject" - }, - "title": "Data", - "type": "array" - }, - "has_more": { - "title": "Has More", - "type": "boolean" - }, - "first_id": { - "title": "First Id", - "type": "string" - }, - "last_id": { - "title": "Last Id", - "type": "string" - }, - "object": { - "const": "list", - "default": "list", - "title": "Object", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "first_id", - "last_id" - ], - "title": "ListOpenAIFileResponse", - "type": "object" - }, - "OpenAIFileDeleteResponse": { - "description": "Response for deleting a file in OpenAI Files API.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "object": { - "const": "file", - "default": "file", - "title": "Object", - "type": "string" - }, - "deleted": { - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id", - "deleted" - ], - "title": "OpenAIFileDeleteResponse", - "type": "object" - }, - "ListOpenAIChatCompletionResponse": { - "description": "Response from listing OpenAI-compatible chat completions.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/OpenAICompletionWithInputMessages" - }, - "title": "Data", - "type": "array" - }, - "has_more": { - "title": "Has More", - "type": "boolean" - }, - "first_id": { - "title": "First Id", - "type": "string" - }, - "last_id": { - "title": "Last Id", - "type": "string" - }, - "object": { - "const": "list", - "default": "list", - "title": "Object", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "first_id", - "last_id" - ], - "title": "ListOpenAIChatCompletionResponse", - "type": "object" - }, - "OpenAIAssistantMessageParam": { - "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.", - "properties": { - "role": { - "const": "assistant", - "default": "assistant", - "title": "Role", - "type": "string" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content", - "nullable": true - }, - "name": { - "title": "Name", - "type": "string", - "nullable": true - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" - }, - "type": "array", - "nullable": true - } - }, - "title": "OpenAIAssistantMessageParam", - "type": "object" - }, - "OpenAIChoice": { - "description": "A choice from an OpenAI-compatible chat completion response.", - "properties": { - "message": { - "discriminator": { - "mapping": { - "assistant": "#/$defs/OpenAIAssistantMessageParam", - "developer": "#/$defs/OpenAIDeveloperMessageParam", - "system": "#/$defs/OpenAISystemMessageParam", - "tool": "#/$defs/OpenAIToolMessageParam", - "user": "#/$defs/OpenAIUserMessageParam" - }, - "propertyName": "role" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIUserMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAISystemMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIAssistantMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIToolMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" - } - ], - "title": "Message" - }, - "finish_reason": { - "title": "Finish Reason", - "type": "string" - }, - "index": { - "title": "Index", - "type": "integer" - }, - "logprobs": { - "$ref": "#/components/schemas/OpenAIChoiceLogprobs", - "nullable": true - } - }, - "required": [ - "message", - "finish_reason", - "index" - ], - "title": "OpenAIChoice", - "type": "object" - }, - "OpenAIChoiceLogprobs": { - "description": "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response.", - "properties": { - "content": { - "title": "Content", - "items": { - "$ref": "#/components/schemas/OpenAITokenLogProb" - }, - "type": "array", - "nullable": true - }, - "refusal": { - "title": "Refusal", - "items": { - "$ref": "#/components/schemas/OpenAITokenLogProb" - }, - "type": "array", - "nullable": true - } - }, - "title": "OpenAIChoiceLogprobs", - "type": "object" - }, - "OpenAICompletionWithInputMessages": { - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "choices": { - "items": { - "$ref": "#/components/schemas/OpenAIChoice" - }, - "title": "Choices", - "type": "array" - }, - "object": { - "const": "chat.completion", - "default": "chat.completion", - "title": "Object", - "type": "string" - }, - "created": { - "title": "Created", - "type": "integer" - }, - "model": { - "title": "Model", - "type": "string" - }, - "usage": { - "$ref": "#/components/schemas/OpenAIChatCompletionUsage", - "nullable": true - }, - "input_messages": { - "items": { - "discriminator": { - "mapping": { - "assistant": "#/$defs/OpenAIAssistantMessageParam", - "developer": "#/$defs/OpenAIDeveloperMessageParam", - "system": "#/$defs/OpenAISystemMessageParam", - "tool": "#/$defs/OpenAIToolMessageParam", - "user": "#/$defs/OpenAIUserMessageParam" - }, - "propertyName": "role" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIUserMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAISystemMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIAssistantMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIToolMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" - } - ] - }, - "title": "Input Messages", - "type": "array" - } - }, - "required": [ - "id", - "choices", - "created", - "model", - "input_messages" - ], - "title": "OpenAICompletionWithInputMessages", - "type": "object" - }, - "OpenAIUserMessageParam": { - "description": "A message from the user in an OpenAI-compatible chat completion request.", - "properties": { - "role": { - "const": "user", - "default": "user", - "title": "Role", - "type": "string" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "discriminator": { - "mapping": { - "file": "#/$defs/OpenAIFile", - "image_url": "#/$defs/OpenAIChatCompletionContentPartImageParam", - "text": "#/$defs/OpenAIChatCompletionContentPartTextParam" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" - }, - { - "$ref": "#/components/schemas/OpenAIFile" - } - ] - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string", - "nullable": true - } - }, - "required": [ - "content" - ], - "title": "OpenAIUserMessageParam", - "type": "object" - }, - "ScoringFn": { - "description": "A scoring function resource for evaluating model outputs.", - "properties": { - "identifier": { - "description": "Unique identifier for this resource in llama stack", - "title": "Identifier", - "type": "string" - }, - "provider_resource_id": { - "description": "Unique identifier for this resource in the provider", - "title": "Provider Resource Id", - "type": "string", - "nullable": true - }, - "provider_id": { - "description": "ID of the provider that owns this resource", - "title": "Provider Id", - "type": "string" - }, - "type": { - "const": "scoring_function", - "default": "scoring_function", - "title": "Type", - "type": "string" - }, - "description": { - "title": "Description", - "type": "string", - "nullable": true - }, - "metadata": { - "additionalProperties": true, - "description": "Any additional metadata for this definition", - "title": "Metadata", - "type": "object" - }, - "return_type": { - "description": "The return type of the deterministic function", - "discriminator": { - "mapping": { - "agent_turn_input": "#/$defs/AgentTurnInputType", - "array": "#/$defs/ArrayType", - "boolean": "#/$defs/BooleanType", - "chat_completion_input": "#/$defs/ChatCompletionInputType", - "completion_input": "#/$defs/CompletionInputType", - "json": "#/$defs/JsonType", - "number": "#/$defs/NumberType", - "object": "#/$defs/ObjectType", - "string": "#/$defs/StringType", - "union": "#/$defs/UnionType" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/StringType" - }, - { - "$ref": "#/components/schemas/NumberType" - }, - { - "$ref": "#/components/schemas/BooleanType" - }, - { - "$ref": "#/components/schemas/ArrayType" - }, - { - "$ref": "#/components/schemas/ObjectType" - }, - { - "$ref": "#/components/schemas/JsonType" - }, - { - "$ref": "#/components/schemas/UnionType" - }, - { - "$ref": "#/components/schemas/ChatCompletionInputType" - }, - { - "$ref": "#/components/schemas/CompletionInputType" - }, - { - "$ref": "#/components/schemas/AgentTurnInputType" - } - ], - "title": "Return Type" - }, - "params": { - "description": "The parameters for the scoring function for benchmark eval, these can be overridden for app eval", - "title": "Params", - "discriminator": { - "mapping": { - "basic": "#/$defs/BasicScoringFnParams", - "llm_as_judge": "#/$defs/LLMAsJudgeScoringFnParams", - "regex_parser": "#/$defs/RegexParserScoringFnParams" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" - }, - { - "$ref": "#/components/schemas/RegexParserScoringFnParams" - }, - { - "$ref": "#/components/schemas/BasicScoringFnParams" - } - ], - "nullable": true - } - }, - "required": [ - "identifier", - "provider_id", - "return_type" - ], - "title": "ScoringFn", - "type": "object" - }, - "ListToolDefsResponse": { - "description": "Response containing a list of tool definitions.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ToolDef" - }, - "title": "Data", - "type": "array" - } - }, - "required": [ - "data" - ], - "title": "ListToolDefsResponse", - "type": "object" - }, - "VectorStoreDeleteResponse": { - "description": "Response from deleting a vector store.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "object": { - "default": "vector_store.deleted", - "title": "Object", - "type": "string" - }, - "deleted": { - "default": true, - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id" - ], - "title": "VectorStoreDeleteResponse", - "type": "object" - }, - "VectorStoreFileContentsResponse": { - "description": "Response from retrieving the contents of a vector store file.", - "properties": { - "file_id": { - "title": "File Id", - "type": "string" - }, - "filename": { - "title": "Filename", - "type": "string" - }, - "attributes": { - "additionalProperties": true, - "title": "Attributes", - "type": "object" - }, - "content": { - "items": { - "$ref": "#/components/schemas/VectorStoreContent" - }, - "title": "Content", - "type": "array" - } - }, - "required": [ - "file_id", - "filename", - "attributes", - "content" - ], - "title": "VectorStoreFileContentsResponse", - "type": "object" - }, - "VectorStoreFileDeleteResponse": { - "description": "Response from deleting a vector store file.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "object": { - "default": "vector_store.file.deleted", - "title": "Object", - "type": "string" - }, - "deleted": { - "default": true, - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id" - ], - "title": "VectorStoreFileDeleteResponse", - "type": "object" - }, - "VectorStoreFilesListInBatchResponse": { - "description": "Response from listing files in a vector store file batch.", - "properties": { - "object": { - "default": "list", - "title": "Object", - "type": "string" - }, - "data": { - "items": { - "$ref": "#/components/schemas/VectorStoreFileObject" - }, - "title": "Data", - "type": "array" - }, - "first_id": { - "title": "First Id", - "type": "string", - "nullable": true - }, - "last_id": { - "title": "Last Id", - "type": "string", - "nullable": true - }, - "has_more": { - "default": false, - "title": "Has More", - "type": "boolean" - } - }, - "required": [ - "data" - ], - "title": "VectorStoreFilesListInBatchResponse", - "type": "object" - }, - "VectorStoreListFilesResponse": { - "description": "Response from listing files in a vector store.", - "properties": { - "object": { - "default": "list", - "title": "Object", - "type": "string" - }, - "data": { - "items": { - "$ref": "#/components/schemas/VectorStoreFileObject" - }, - "title": "Data", - "type": "array" - }, - "first_id": { - "title": "First Id", - "type": "string", - "nullable": true - }, - "last_id": { - "title": "Last Id", - "type": "string", - "nullable": true - }, - "has_more": { - "default": false, - "title": "Has More", - "type": "boolean" - } - }, - "required": [ - "data" - ], - "title": "VectorStoreListFilesResponse", - "type": "object" - }, - "VectorStoreListResponse": { - "description": "Response from listing vector stores.", - "properties": { - "object": { - "default": "list", - "title": "Object", - "type": "string" - }, - "data": { - "items": { - "$ref": "#/components/schemas/VectorStoreObject" - }, - "title": "Data", - "type": "array" - }, - "first_id": { - "title": "First Id", - "type": "string", - "nullable": true - }, - "last_id": { - "title": "Last Id", - "type": "string", - "nullable": true - }, - "has_more": { - "default": false, - "title": "Has More", - "type": "boolean" - } - }, - "required": [ - "data" - ], - "title": "VectorStoreListResponse", - "type": "object" - }, - "OpenAIResponseMessage": { - "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios.", - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "discriminator": { - "mapping": { - "input_file": "#/$defs/OpenAIResponseInputMessageContentFile", - "input_image": "#/$defs/OpenAIResponseInputMessageContentImage", - "input_text": "#/$defs/OpenAIResponseInputMessageContentText" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" - } - ] - }, - "type": "array" - }, - { - "items": { - "discriminator": { - "mapping": { - "output_text": "#/$defs/OpenAIResponseOutputMessageContentOutputText", - "refusal": "#/$defs/OpenAIResponseContentPartRefusal" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" - } - ] - }, - "type": "array" - } - ], - "title": "Content" - }, - "role": { - "anyOf": [ - { - "const": "system", - "type": "string" - }, - { - "const": "developer", - "type": "string" - }, - { - "const": "user", - "type": "string" - }, - { - "const": "assistant", - "type": "string" - } - ], - "title": "Role" - }, - "type": { - "const": "message", - "default": "message", - "title": "Type", - "type": "string" - }, - "id": { - "title": "Id", - "type": "string", - "nullable": true - }, - "status": { - "title": "Status", - "type": "string", - "nullable": true - } - }, - "required": [ - "content", - "role" - ], - "title": "OpenAIResponseMessage", - "type": "object" - }, - "OpenAIResponseObjectWithInput": { - "description": "OpenAI response object extended with input context information.", - "properties": { - "created_at": { - "title": "Created At", - "type": "integer" - }, - "error": { - "$ref": "#/components/schemas/OpenAIResponseError", - "nullable": true - }, - "id": { - "title": "Id", - "type": "string" - }, - "model": { - "title": "Model", - "type": "string" - }, - "object": { - "const": "response", - "default": "response", - "title": "Object", - "type": "string" - }, - "output": { - "items": { - "discriminator": { - "mapping": { - "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", - "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", - "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", - "message": "#/$defs/OpenAIResponseMessage", - "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - } - ] - }, - "title": "Output", - "type": "array" - }, - "parallel_tool_calls": { - "default": false, - "title": "Parallel Tool Calls", - "type": "boolean" - }, - "previous_response_id": { - "title": "Previous Response Id", - "type": "string", - "nullable": true - }, - "prompt": { - "$ref": "#/components/schemas/OpenAIResponsePrompt", - "nullable": true - }, - "status": { - "title": "Status", - "type": "string" - }, - "temperature": { - "title": "Temperature", - "type": "number", - "nullable": true - }, - "text": { - "$ref": "#/components/schemas/OpenAIResponseText", - "default": { - "format": { - "type": "text" - } - } - }, - "top_p": { - "title": "Top P", - "type": "number", - "nullable": true - }, - "tools": { - "title": "Tools", - "items": { - "discriminator": { - "mapping": { - "file_search": "#/$defs/OpenAIResponseInputToolFileSearch", - "function": "#/$defs/OpenAIResponseInputToolFunction", - "mcp": "#/$defs/OpenAIResponseToolMCP", - "web_search": "#/$defs/OpenAIResponseInputToolWebSearch", - "web_search_preview": "#/$defs/OpenAIResponseInputToolWebSearch", - "web_search_preview_2025_03_11": "#/$defs/OpenAIResponseInputToolWebSearch" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" - }, - { - "$ref": "#/components/schemas/OpenAIResponseToolMCP" - } - ] - }, - "type": "array", - "nullable": true - }, - "truncation": { - "title": "Truncation", - "type": "string", - "nullable": true - }, - "usage": { - "$ref": "#/components/schemas/OpenAIResponseUsage", - "nullable": true - }, - "instructions": { - "title": "Instructions", - "type": "string", - "nullable": true - }, - "input": { - "items": { - "anyOf": [ - { - "discriminator": { - "mapping": { - "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", - "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", - "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", - "message": "#/$defs/OpenAIResponseMessage", - "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - } - ] - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - } - ] - }, - "title": "Input", - "type": "array" - } - }, - "required": [ - "created_at", - "id", - "model", - "output", - "status", - "input" - ], - "title": "OpenAIResponseObjectWithInput", - "type": "object" - }, - "_safety_run_shield_Request": { - "properties": { - "shield_id": { - "title": "Shield Id", - "type": "string" - }, - "messages": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAIUserMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAISystemMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIAssistantMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIToolMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" - } - ], - "title": "Messages" - }, - "params": { - "title": "Params", - "type": "string" - } - }, - "required": [ - "shield_id", - "messages", - "params" - ], - "title": "_safety_run_shield_Request", - "type": "object" - } - }, - "responses": { - "BadRequest400": { - "description": "The request was invalid or malformed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - }, - "example": { - "status": 400, - "title": "Bad Request", - "detail": "The request was invalid or malformed" - } - } - } - }, - "TooManyRequests429": { - "description": "The client has sent too many requests in a given amount of time", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - }, - "example": { - "status": 429, - "title": "Too Many Requests", - "detail": "You have exceeded the rate limit. Please try again later." - } - } - } - }, - "InternalServerError500": { - "description": "The server encountered an unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - }, - "example": { - "status": 500, - "title": "Internal Server Error", - "detail": "An unexpected error occurred. Our team has been notified." - } - } - } - }, - "DefaultError": { - "description": "An unexpected error occurred", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - } - } -} \ No newline at end of file diff --git a/docs/static/llama-stack-spec.yaml b/docs/static/llama-stack-spec.yaml index b1b3ca8cda..4f8219ff2f 100644 --- a/docs/static/llama-stack-spec.yaml +++ b/docs/static/llama-stack-spec.yaml @@ -12,80 +12,112 @@ paths: /v1/batches: get: tags: - - V1 + - Batches summary: List all batches for the current user. - description: Query endpoint for proper schema generation. + description: List all batches for the current user. operationId: list_batches_v1_batches_get parameters: - name: after in: query - required: true + required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: A cursor for pagination; returns batches after this batch ID. title: After + description: A cursor for pagination; returns batches after this batch ID. - name: limit in: query required: false schema: type: integer + maximum: 100 + minimum: 1 + description: Number of batches to return (default 20, max 100). default: 20 title: Limit + description: Number of batches to return (default 20, max 100). responses: '200': - description: A list of batch objects. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListBatchesResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 + - Batches summary: Create a new batch for processing multiple API requests. - description: Typed endpoint for proper schema generation. + description: Create a new batch for processing multiple API requests. operationId: create_batch_v1_batches_post requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/_batches_Request' + $ref: '#/components/schemas/CreateBatchRequest' responses: '200': - description: The created batch object. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Batch' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/batches/{batch_id}: get: tags: - - V1 + - Batches summary: Retrieve information about a specific batch. - description: Query endpoint for proper schema generation. + description: Retrieve information about a specific batch. operationId: retrieve_batch_v1_batches__batch_id__get parameters: - name: batch_id @@ -93,123 +125,173 @@ paths: required: true schema: type: string + description: The ID of the batch to retrieve. title: Batch Id description: The ID of the batch to retrieve. responses: '200': - description: The batch object. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Batch' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/batches/{batch_id}/cancel: post: tags: - - V1 + - Batches summary: Cancel a batch that is in progress. - description: Typed endpoint for proper schema generation. + description: Cancel a batch that is in progress. operationId: cancel_batch_v1_batches__batch_id__cancel_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_batches_batch_id_cancel_Request' + parameters: + - name: batch_id + in: path required: true + schema: + type: string + description: The ID of the batch to cancel. + title: Batch Id + description: The ID of the batch to cancel. responses: '200': - description: The updated batch object. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Batch' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: batch_id - in: path - required: true - schema: - type: string - description: The ID of the batch to cancel. + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/chat/completions: get: tags: - - V1 + - Inference summary: List chat completions. - description: Query endpoint for proper schema generation. + description: List chat completions. operationId: list_chat_completions_v1_chat_completions_get parameters: - name: after in: query - required: true + required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: The ID of the last chat completion to return. title: After - - name: model - in: query - required: true - schema: - type: string - title: Model + description: The ID of the last chat completion to return. - name: limit in: query required: false schema: - type: integer + anyOf: + - type: integer + - type: 'null' + description: The maximum number of chat completions to return. default: 20 title: Limit + description: The maximum number of chat completions to return. + - name: model + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: The model to filter by. + title: Model + description: The model to filter by. - name: order in: query required: false schema: - $ref: '#/components/schemas/Order' + anyOf: + - $ref: '#/components/schemas/Order' + - type: 'null' + description: "The order to sort the chat completions by: 'asc' or 'desc'. Defaults to 'desc'." default: desc + title: Order + description: "The order to sort the chat completions by: 'asc' or 'desc'. Defaults to 'desc'." responses: '200': - description: A ListOpenAIChatCompletionResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListOpenAIChatCompletionResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 + - Inference summary: Create chat completions. - description: Typed endpoint for proper schema generation. + description: Create chat completions. operationId: openai_chat_completion_v1_chat_completions_post requestBody: required: true @@ -219,29 +301,40 @@ paths: $ref: '#/components/schemas/OpenAIChatCompletionRequestWithExtraBody' responses: '200': - description: An OpenAIChatCompletion. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/OpenAIChatCompletion' + schema: {} '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/chat/completions/{completion_id}: get: tags: - - V1 + - Inference summary: Get chat completion. - description: Query endpoint for proper schema generation. + description: Get chat completion. operationId: get_chat_completion_v1_chat_completions__completion_id__get parameters: - name: completion_id @@ -249,33 +342,46 @@ paths: required: true schema: type: string + description: ID of the chat completion. title: Completion Id description: ID of the chat completion. responses: '200': - description: A OpenAICompletionWithInputMessages. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/OpenAICompletionWithInputMessages' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/completions: post: tags: - - V1 + - Inference summary: Create completion. - description: Typed endpoint for proper schema generation. + description: Create completion. operationId: openai_completion_v1_completions_post requestBody: content: @@ -285,61 +391,85 @@ paths: required: true responses: '200': - description: An OpenAICompletion. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/OpenAICompletion' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/conversations: post: tags: - - V1 - summary: Create a conversation. - description: Typed endpoint for proper schema generation. + - Conversations + summary: Create a conversation + description: Create a conversation operationId: create_conversation_v1_conversations_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_conversations_Request' + $ref: '#/components/schemas/ConversationCreateRequest' required: true responses: '200': - description: The created conversation object. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Conversation' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/conversations/{conversation_id}: delete: tags: - - V1 - summary: Delete a conversation. - description: Query endpoint for proper schema generation. + - Conversations + summary: Delete a conversation + description: Delete a conversation with the given ID operationId: openai_delete_conversation_v1_conversations__conversation_id__delete parameters: - name: conversation_id @@ -347,32 +477,45 @@ paths: required: true schema: type: string + description: The conversation identifier title: Conversation Id - description: The conversation identifier. + description: The conversation identifier responses: '200': - description: The deleted conversation resource. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ConversationDeletedResource' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 - summary: Retrieve a conversation. - description: Query endpoint for proper schema generation. + - Conversations + summary: Retrieve a conversation + description: Get a conversation with the given ID operationId: get_conversation_v1_conversations__conversation_id__get parameters: - name: conversation_id @@ -380,166 +523,242 @@ paths: required: true schema: type: string + description: The conversation identifier title: Conversation Id - description: The conversation identifier. + description: The conversation identifier responses: '200': - description: The conversation object. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Conversation' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Update a conversation. - description: Typed endpoint for proper schema generation. + - Conversations + summary: Update a conversation + description: Update a conversation's metadata with the given ID operationId: update_conversation_v1_conversations__conversation_id__post + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + description: The conversation identifier + title: Conversation Id + description: The conversation identifier requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/_conversations_conversation_id_Request' + $ref: '#/components/schemas/ConversationUpdateRequest' responses: '200': - description: The updated conversation object. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Conversation' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/conversations/{conversation_id}/items: + get: + tags: + - Conversations + summary: List items + description: List items in the conversation + operationId: list_items_v1_conversations__conversation_id__items_get parameters: - name: conversation_id in: path required: true schema: type: string - description: The conversation identifier. - /v1/conversations/{conversation_id}/items: - get: - tags: - - V1 - summary: List items. - description: Query endpoint for proper schema generation. - operationId: list_items_v1_conversations__conversation_id__items_get - parameters: + description: The conversation identifier + title: Conversation Id + description: The conversation identifier - name: after in: query - required: true + required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: An item ID to list items after, used in pagination title: After + description: An item ID to list items after, used in pagination - name: include in: query - required: true + required: false schema: - $ref: '#/components/schemas/ConversationItemInclude' + anyOf: + - type: array + items: + $ref: '#/components/schemas/ConversationItemInclude' + - type: 'null' + description: Specify additional output data to include in the response + title: Include + description: Specify additional output data to include in the response - name: limit in: query - required: true + required: false schema: - type: integer + anyOf: + - type: integer + - type: 'null' + description: A limit on the number of objects to be returned (1-100, default 20) title: Limit + description: A limit on the number of objects to be returned (1-100, default 20) - name: order in: query - required: true + required: false schema: - type: string + anyOf: + - enum: + - asc + - desc + type: string + - type: 'null' + description: The order to return items in (asc or desc, default desc) title: Order - - name: conversation_id - in: path - required: true - schema: - type: string - title: Conversation Id - description: The conversation identifier. + description: The order to return items in (asc or desc, default desc) responses: '200': - description: List of conversation items. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ConversationItemList' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Create items. - description: Typed endpoint for proper schema generation. + - Conversations + summary: Create items + description: Create items in the conversation operationId: add_items_v1_conversations__conversation_id__items_post + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + description: The conversation identifier + title: Conversation Id + description: The conversation identifier requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/_conversations_conversation_id_items_Request' + $ref: '#/components/schemas/ConversationItemCreateRequest' responses: '200': - description: List of created items. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ConversationItemList' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - parameters: - - name: conversation_id - in: path - required: true - schema: - type: string - description: The conversation identifier. + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/conversations/{conversation_id}/items/{item_id}: delete: tags: - - V1 - summary: Delete an item. - description: Query endpoint for proper schema generation. + - Conversations + summary: Delete an item + description: Delete a conversation item operationId: openai_delete_conversation_item_v1_conversations__conversation_id__items__item_id__delete parameters: - name: conversation_id @@ -547,39 +766,53 @@ paths: required: true schema: type: string + description: The conversation identifier title: Conversation Id - description: The conversation identifier. + description: The conversation identifier - name: item_id in: path required: true schema: type: string + description: The item identifier title: Item Id - description: The item identifier. + description: The item identifier responses: '200': - description: The deleted item resource. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ConversationItemDeletedResource' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 - summary: Retrieve an item. - description: Query endpoint for proper schema generation. + - Conversations + summary: Retrieve an item + description: Retrieve a conversation item operationId: retrieve_v1_conversations__conversation_id__items__item_id__get parameters: - name: conversation_id @@ -587,40 +820,76 @@ paths: required: true schema: type: string + description: The conversation identifier title: Conversation Id - description: The conversation identifier. + description: The conversation identifier - name: item_id in: path required: true schema: type: string + description: The item identifier title: Item Id - description: The item identifier. + description: The item identifier responses: '200': - description: The conversation item. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAIResponseMessage' + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + discriminator: + propertyName: type + mapping: + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + title: Response Retrieve V1 Conversations Conversation Id Items Item Id Get '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/embeddings: post: tags: - - V1 + - Inference summary: Create embeddings. - description: Typed endpoint for proper schema generation. + description: Create embeddings. operationId: openai_embeddings_v1_embeddings_post requestBody: content: @@ -630,105 +899,165 @@ paths: required: true responses: '200': - description: An OpenAIEmbeddingsResponse containing the embeddings. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/OpenAIEmbeddingsResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/files: get: tags: - - V1 + - Files summary: List files. - description: Query endpoint for proper schema generation. + description: Returns a list of files that belong to the user's organization. operationId: openai_list_files_v1_files_get parameters: - name: after in: query - required: true + required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. title: After - - name: purpose - in: query - required: true - schema: - $ref: '#/components/schemas/OpenAIFilePurpose' + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. - name: limit in: query required: false schema: - type: integer + anyOf: + - type: integer + - type: 'null' + description: A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000. default: 10000 title: Limit + description: A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000. - name: order in: query required: false schema: - $ref: '#/components/schemas/Order' + anyOf: + - $ref: '#/components/schemas/Order' + - type: 'null' + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. default: desc + title: Order + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + - name: purpose + in: query + required: false + schema: + anyOf: + - $ref: '#/components/schemas/OpenAIFilePurpose' + - type: 'null' + description: Only return files with the given purpose. + title: Purpose + description: Only return files with the given purpose. responses: '200': - description: An ListOpenAIFileResponse containing the list of files. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListOpenAIFileResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 + - Files summary: Upload file. - description: Response-only endpoint for proper schema generation. + description: Upload a file that can be used across various endpoints. operationId: openai_upload_file_v1_files_post + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/Body_openai_upload_file_v1_files_post' responses: '200': - description: An OpenAIFileObject representing the uploaded file. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/OpenAIFileObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/files/{file_id}: delete: tags: - - V1 + - Files summary: Delete file. - description: Query endpoint for proper schema generation. + description: Delete a file. operationId: openai_delete_file_v1_files__file_id__delete parameters: - name: file_id @@ -736,32 +1065,45 @@ paths: required: true schema: type: string + description: The ID of the file to use for this request. title: File Id description: The ID of the file to use for this request. responses: '200': - description: An OpenAIFileDeleteResponse indicating successful deletion. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/OpenAIFileDeleteResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 + - Files summary: Retrieve file. - description: Query endpoint for proper schema generation. + description: Returns information about a specific file. operationId: openai_retrieve_file_v1_files__file_id__get parameters: - name: file_id @@ -769,254 +1111,288 @@ paths: required: true schema: type: string + description: The ID of the file to use for this request. title: File Id description: The ID of the file to use for this request. responses: '200': - description: An OpenAIFileObject containing file information. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/OpenAIFileObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/files/{file_id}/content: get: tags: - - V1 + - Files summary: Retrieve file content. - description: Generic endpoint - this would be replaced with actual implementation. + description: Returns the contents of the specified file. operationId: openai_retrieve_file_content_v1_files__file_id__content_get parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - name: file_id in: path required: true schema: type: string + description: The ID of the file to use for this request. + title: File Id description: The ID of the file to use for this request. responses: '200': - description: The raw file content as a binary response. + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/health: get: tags: - - V1 + - Inspect summary: Get health status. - description: Response-only endpoint for proper schema generation. + description: Get the current health status of the service. operationId: health_v1_health_get responses: '200': - description: Health information indicating if the service is operational. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/HealthInfo' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/inspect/routes: get: tags: - - V1 + - Inspect summary: List routes. - description: Response-only endpoint for proper schema generation. + description: List all available API routes with their methods and implementing providers. operationId: list_routes_v1_inspect_routes_get responses: '200': - description: Response containing information about all available routes. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListRoutesResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - tags: - - Inspect - summary: List routes. - description: >- - List routes. - - List all available API routes with their methods and implementing providers. - parameters: - - name: api_filter - in: query - description: >- - Optional filter to control which routes are returned. Can be an API level - ('v1', 'v1alpha', 'v1beta') to show non-deprecated routes at that level, - or 'deprecated' to show deprecated routes across all levels. If not specified, - returns only non-deprecated v1 routes. - required: false - schema: - type: string - enum: - - v1 - - v1alpha - - v1beta - - deprecated - deprecated: false + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/models: get: tags: - - V1 + - Models summary: List all models. - description: Response-only endpoint for proper schema generation. + description: List all models registered in Llama Stack. operationId: list_models_v1_models_get responses: '200': - description: A OpenAIListModelsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAIListModelsResponse' + $ref: '#/components/schemas/ListModelsResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - Models - summary: List models using the OpenAI API. - description: List models using the OpenAI API. - parameters: [] - deprecated: false + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 + - Models summary: Register model. - description: Typed endpoint for proper schema generation. + description: Register a new model in Llama Stack. operationId: register_model_v1_models_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_models_Request' + $ref: '#/components/schemas/RegisterModelRequest' required: true responses: '200': - description: A Model. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Model' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/models/{model_id}: delete: tags: - - V1 + - Models summary: Unregister model. - description: Generic endpoint - this would be replaced with actual implementation. + description: Unregister a model from Llama Stack. operationId: unregister_model_v1_models__model_id__delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - - name: model_id - in: path + - name: model_id + in: path required: true schema: type: string - description: 'Path parameter: model_id' + description: The identifier of the model to unregister. + title: Model Id + description: The identifier of the model to unregister. responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 + - Models summary: Get model. - description: Query endpoint for proper schema generation. + description: Get a model by its identifier. operationId: get_model_v1_models__model_id__get parameters: - name: model_id @@ -1024,279 +1400,375 @@ paths: required: true schema: type: string + description: The identifier of the model to get. title: Model Id + description: The identifier of the model to get. responses: '200': - description: A Model. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Model' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/moderations: post: tags: - - V1 + - Safety summary: Create moderation. - description: Typed endpoint for proper schema generation. + description: Classifies if text and/or image inputs are potentially harmful. operationId: run_moderation_v1_moderations_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_moderations_Request' + $ref: '#/components/schemas/RunModerationRequest' required: true responses: '200': - description: A moderation object. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ModerationObject' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/prompts: get: tags: - - V1 - summary: List all prompts. - description: Response-only endpoint for proper schema generation. + - Prompts + summary: List all prompts + description: List all prompts registered in Llama Stack operationId: list_prompts_v1_prompts_get responses: '200': - description: A ListPromptsResponse containing all prompts. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListPromptsResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Create prompt. - description: Typed endpoint for proper schema generation. + - Prompts + summary: Create prompt + description: Create a new prompt operationId: create_prompt_v1_prompts_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_prompts_Request' + $ref: '#/components/schemas/CreatePromptRequest' required: true responses: '200': - description: The created Prompt resource. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Prompt' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/prompts/{prompt_id}: delete: tags: - - V1 - summary: Delete prompt. - description: Generic endpoint - this would be replaced with actual implementation. + - Prompts + summary: Delete prompt + description: Delete a prompt operationId: delete_prompt_v1_prompts__prompt_id__delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - name: prompt_id in: path required: true schema: type: string - description: The identifier of the prompt to delete. + description: The identifier of the prompt to delete + title: Prompt Id + description: The identifier of the prompt to delete responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 - summary: Get prompt. - description: Query endpoint for proper schema generation. + - Prompts + summary: Get prompt + description: Get a prompt by its identifier and optional version operationId: get_prompt_v1_prompts__prompt_id__get parameters: - - name: version - in: query - required: true - schema: - type: integer - title: Version - name: prompt_id in: path required: true schema: type: string + description: The identifier of the prompt to get title: Prompt Id - description: The identifier of the prompt to get. + description: The identifier of the prompt to get + - name: version + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The version of the prompt to get (defaults to latest) + title: Version + description: The version of the prompt to get (defaults to latest) responses: '200': - description: A Prompt resource. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Prompt' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Update prompt. - description: Typed endpoint for proper schema generation. + - Prompts + summary: Update prompt + description: Update an existing prompt (increments version) operationId: update_prompt_v1_prompts__prompt_id__post + parameters: + - name: prompt_id + in: path + required: true + schema: + type: string + description: The identifier of the prompt to update + title: Prompt Id + description: The identifier of the prompt to update requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/_prompts_prompt_id_Request' + $ref: '#/components/schemas/UpdatePromptRequest' responses: '200': - description: The updated Prompt resource with incremented version. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Prompt' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/prompts/{prompt_id}/set-default-version: + post: + tags: + - Prompts + summary: Set prompt version + description: Set which version of a prompt should be the default in get_prompt (latest) + operationId: set_default_version_v1_prompts__prompt_id__set_default_version_post parameters: - name: prompt_id in: path required: true schema: type: string - description: The identifier of the prompt to update. - /v1/prompts/{prompt_id}/set-default-version: - post: - tags: - - V1 - summary: Set prompt version. - description: Typed endpoint for proper schema generation. - operationId: set_default_version_v1_prompts__prompt_id__set_default_version_post + description: The identifier of the prompt + title: Prompt Id + description: The identifier of the prompt requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/_prompts_prompt_id_set_default_version_Request' - required: true + $ref: '#/components/schemas/SetDefaultVersionRequest' responses: '200': - description: The prompt with the specified version now set as default. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Prompt' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: prompt_id - in: path - required: true - schema: - type: string - description: The identifier of the prompt. + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/prompts/{prompt_id}/versions: get: tags: - - V1 - summary: List prompt versions. - description: Query endpoint for proper schema generation. + - Prompts + summary: List prompt versions + description: List all versions of a specific prompt operationId: list_prompt_versions_v1_prompts__prompt_id__versions_get parameters: - name: prompt_id @@ -1304,59 +1776,84 @@ paths: required: true schema: type: string + description: The identifier of the prompt to list versions for title: Prompt Id - description: The identifier of the prompt to list versions for. + description: The identifier of the prompt to list versions for responses: '200': - description: A ListPromptsResponse containing all versions of the prompt. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListPromptsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/providers: get: tags: - - V1 - summary: List providers. - description: Response-only endpoint for proper schema generation. + - Providers + summary: List providers + description: List all available providers operationId: list_providers_v1_providers_get responses: '200': - description: A ListProvidersResponse containing information about all providers. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListProvidersResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/providers/{provider_id}: get: tags: - - V1 - summary: Get provider. - description: Query endpoint for proper schema generation. + - Providers + summary: Get provider + description: Get detailed information about a specific provider operationId: inspect_provider_v1_providers__provider_id__get parameters: - name: provider_id @@ -1364,116 +1861,169 @@ paths: required: true schema: type: string + description: The ID of the provider to inspect title: Provider Id - description: The ID of the provider to inspect. + description: The ID of the provider to inspect responses: '200': - description: A ProviderInfo object containing the provider's details. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ProviderInfo' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/responses: get: tags: - - V1 + - Agents summary: List all responses. - description: Query endpoint for proper schema generation. + description: List all responses. operationId: list_openai_responses_v1_responses_get parameters: - name: after in: query - required: true + required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: The ID of the last response to return. title: After - - name: model - in: query - required: true - schema: - type: string - title: Model + description: The ID of the last response to return. - name: limit in: query required: false schema: - type: integer + anyOf: + - type: integer + - type: 'null' + description: The number of responses to return. default: 50 title: Limit + description: The number of responses to return. + - name: model + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: The model to filter responses by. + title: Model + description: The model to filter responses by. - name: order in: query required: false schema: - $ref: '#/components/schemas/Order' + anyOf: + - $ref: '#/components/schemas/Order' + - type: 'null' + description: The order to sort responses by when sorted by created_at ('asc' or 'desc'). default: desc + title: Order + description: The order to sort responses by when sorted by created_at ('asc' or 'desc'). responses: '200': - description: A ListOpenAIResponseObject. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListOpenAIResponseObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - post: - tags: - - V1 + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: + tags: + - Agents summary: Create a model response. - description: Typed endpoint for proper schema generation. + description: Create a model response. operationId: create_openai_response_v1_responses_post requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/_responses_Request' + $ref: '#/components/schemas/CreateOpenAIResponseRequest' responses: '200': - description: An OpenAIResponseObject. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/OpenAIResponseObject' + schema: {} '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/responses/{response_id}: delete: tags: - - V1 + - Agents summary: Delete a response. - description: Query endpoint for proper schema generation. + description: Delete a response. operationId: delete_openai_response_v1_responses__response_id__delete parameters: - name: response_id @@ -1481,32 +2031,45 @@ paths: required: true schema: type: string + description: The ID of the OpenAI response to delete. title: Response Id description: The ID of the OpenAI response to delete. responses: '200': - description: An OpenAIDeleteResponseObject + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/OpenAIDeleteResponseObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 + - Agents summary: Get a model response. - description: Query endpoint for proper schema generation. + description: Get a model response. operationId: get_openai_response_v1_responses__response_id__get parameters: - name: response_id @@ -1514,232 +2077,312 @@ paths: required: true schema: type: string + description: The ID of the OpenAI response to retrieve. title: Response Id description: The ID of the OpenAI response to retrieve. responses: '200': - description: An OpenAIResponseObject. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/OpenAIResponseObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/responses/{response_id}/input_items: get: tags: - - V1 + - Agents summary: List input items. - description: Query endpoint for proper schema generation. + description: List input items. operationId: list_openai_response_input_items_v1_responses__response_id__input_items_get parameters: - - name: after - in: query + - name: response_id + in: path required: true schema: type: string + description: The ID of the response to retrieve input items for. + title: Response Id + description: The ID of the response to retrieve input items for. + - name: after + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: An item ID to list items after, used for pagination. title: After + description: An item ID to list items after, used for pagination. - name: before in: query - required: true + required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: An item ID to list items before, used for pagination. title: Before + description: An item ID to list items before, used for pagination. - name: include in: query - required: true + required: false schema: - type: string + anyOf: + - type: array + items: + type: string + - type: 'null' + description: Additional fields to include in the response. title: Include + description: Additional fields to include in the response. - name: limit in: query required: false schema: - type: integer + anyOf: + - type: integer + maximum: 100 + minimum: 1 + - type: 'null' + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. default: 20 title: Limit + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - name: order in: query required: false schema: - $ref: '#/components/schemas/Order' + anyOf: + - $ref: '#/components/schemas/Order' + - type: 'null' + description: The order to return the input items in. Default is desc. default: desc - - name: response_id - in: path - required: true - schema: - type: string - title: Response Id - description: The ID of the response to retrieve input items for. + title: Order + description: The order to return the input items in. Default is desc. responses: '200': - description: An ListOpenAIResponseInputItem. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListOpenAIResponseInputItem' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/safety/run-shield: post: tags: - - V1 + - Safety summary: Run shield. - description: Typed endpoint for proper schema generation. + description: Run a shield. operationId: run_shield_v1_safety_run_shield_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_safety_run_shield_Request' + $ref: '#/components/schemas/RunShieldRequest' required: true responses: '200': - description: A RunShieldResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/RunShieldResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/scoring-functions: get: tags: - - V1 - summary: List all scoring functions. - description: Response-only endpoint for proper schema generation. + - Scoring Functions + summary: List all scoring functions + description: List all scoring functions operationId: list_scoring_functions_v1_scoring_functions_get responses: '200': - description: A ListScoringFunctionsResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListScoringFunctionsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Register a scoring function. - description: Generic endpoint - this would be replaced with actual implementation. + - Scoring Functions + summary: Register a scoring function + description: Register a scoring function operationId: register_scoring_function_v1_scoring_functions_post - parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterScoringFunctionRequest' required: true - schema: - title: Kwargs responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/scoring-functions/{scoring_fn_id}: delete: tags: - - V1 - summary: Unregister a scoring function. - description: Generic endpoint - this would be replaced with actual implementation. + - Scoring Functions + summary: Unregister a scoring function + description: Unregister a scoring function operationId: unregister_scoring_function_v1_scoring_functions__scoring_fn_id__delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - name: scoring_fn_id in: path required: true schema: type: string - description: 'Path parameter: scoring_fn_id' + description: The ID of the scoring function to unregister + title: Scoring Fn Id + description: The ID of the scoring function to unregister responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 - summary: Get a scoring function by its ID. - description: Query endpoint for proper schema generation. + - Scoring Functions + summary: Get a scoring function by its ID + description: Get a scoring function by its ID operationId: get_scoring_function_v1_scoring_functions__scoring_fn_id__get parameters: - name: scoring_fn_id @@ -1747,194 +2390,257 @@ paths: required: true schema: type: string + description: The ID of the scoring function to get title: Scoring Fn Id + description: The ID of the scoring function to get responses: '200': - description: A ScoringFn. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ScoringFn' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/scoring/score: post: tags: - - V1 - summary: Score a list of rows. - description: Typed endpoint for proper schema generation. + - Scoring + summary: Score a list of rows + description: Score a list of rows operationId: score_v1_scoring_score_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_scoring_score_Request' + $ref: '#/components/schemas/ScoreRequest' required: true responses: '200': - description: A ScoreResponse object containing rows and aggregated results. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ScoreResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/scoring/score-batch: post: tags: - - V1 - summary: Score a batch of rows. - description: Typed endpoint for proper schema generation. + - Scoring + summary: Score a batch of rows + description: Score a batch of rows from a dataset operationId: score_batch_v1_scoring_score_batch_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_scoring_score_batch_Request' + $ref: '#/components/schemas/ScoreBatchRequest' required: true responses: '200': - description: A ScoreBatchResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ScoreBatchResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/shields: get: tags: - - V1 - summary: List all shields. - description: Response-only endpoint for proper schema generation. + - Shields + summary: List all shields + description: List all shields operationId: list_shields_v1_shields_get responses: '200': - description: A ListShieldsResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListShieldsResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Register a shield. - description: Typed endpoint for proper schema generation. + - Shields + summary: Register a shield + description: Register a shield operationId: register_shield_v1_shields_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_shields_Request' + $ref: '#/components/schemas/RegisterShieldRequest' required: true responses: '200': - description: A Shield. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Shield' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/shields/{identifier}: delete: tags: - - V1 - summary: Unregister a shield. - description: Generic endpoint - this would be replaced with actual implementation. + - Shields + summary: Unregister a shield + description: Unregister a shield operationId: unregister_shield_v1_shields__identifier__delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - name: identifier in: path required: true schema: type: string - description: 'Path parameter: identifier' + description: The identifier of the shield to unregister + title: Identifier + description: The identifier of the shield to unregister responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 - summary: Get a shield by its identifier. - description: Query endpoint for proper schema generation. + - Shields + summary: Get a shield by its identifier + description: Get a shield by its identifier operationId: get_shield_v1_shields__identifier__get parameters: - name: identifier @@ -1942,311 +2648,352 @@ paths: required: true schema: type: string + description: The identifier of the shield to get title: Identifier + description: The identifier of the shield to get responses: '200': - description: A Shield. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/Shield' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - tags: - - Shields - summary: Get a shield by its identifier. - description: Get a shield by its identifier. - parameters: - - name: identifier - in: path - description: The identifier of the shield to get. - required: true - schema: - type: string - deprecated: false - delete: - responses: - '200': - description: OK - '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - Shields - summary: Unregister a shield. - description: Unregister a shield. - parameters: - - name: identifier - in: path - description: >- - The identifier of the shield to unregister. - required: true - schema: - type: string - deprecated: false + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/tool-runtime/invoke: post: tags: - - V1 - summary: Run a tool with the given arguments. - description: Typed endpoint for proper schema generation. + - Tool Runtime + summary: Run a tool with the given arguments + description: Run a tool with the given arguments operationId: invoke_tool_v1_tool_runtime_invoke_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_tool_runtime_invoke_Request' + $ref: '#/components/schemas/InvokeToolRequest' required: true responses: '200': - description: A ToolInvocationResult. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ToolInvocationResult' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/tool-runtime/list-tools: get: tags: - - V1 - summary: List all tools in the runtime. - description: Query endpoint for proper schema generation. + - Tool Runtime + summary: List all tools in the runtime + description: List all tools in the runtime operationId: list_runtime_tools_v1_tool_runtime_list_tools_get parameters: - name: tool_group_id in: query - required: true + required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: The ID of the tool group to list tools for title: Tool Group Id - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/URL' + description: The ID of the tool group to list tools for + - name: mcp_endpoint + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: The MCP endpoint URL to use for the tool group + title: Mcp Endpoint + description: The MCP endpoint URL to use for the tool group responses: '200': - description: A ListToolDefsResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListToolDefsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/tool-runtime/rag-tool/insert: post: tags: - - V1 - summary: Index documents so they can be used by the RAG system. - description: Generic endpoint - this would be replaced with actual implementation. + - Tool Runtime + summary: Insert documents into the RAG system. + description: Index documents so they can be used by the RAG system. operationId: rag_tool_insert_v1_tool_runtime_rag_tool_insert_post - parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Body_rag_tool_insert_v1_tool_runtime_rag_tool_insert_post' required: true - schema: - title: Kwargs responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/tool-runtime/rag-tool/query: post: tags: - - V1 - summary: Query the RAG system for context; typically invoked by the agent. - description: Typed endpoint for proper schema generation. + - Tool Runtime + summary: Query the RAG system for context. + description: Query the RAG system for context; typically invoked by the agent. operationId: rag_tool_query_v1_tool_runtime_rag_tool_query_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_tool_runtime_rag_tool_query_Request' + $ref: '#/components/schemas/Body_rag_tool_query_v1_tool_runtime_rag_tool_query_post' required: true responses: '200': - description: RAGQueryResult containing the retrieved content and metadata + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/RAGQueryResult' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/toolgroups: get: tags: - - V1 - summary: List tool groups with optional provider. - description: Response-only endpoint for proper schema generation. + - Tool Groups + summary: List tool groups + description: List tool groups with optional provider operationId: list_tool_groups_v1_toolgroups_get responses: '200': - description: A ListToolGroupsResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListToolGroupsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Register a tool group. - description: Generic endpoint - this would be replaced with actual implementation. + - Tool Groups + summary: Register a tool group + description: Register a tool group operationId: register_tool_group_v1_toolgroups_post - parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterToolGroupRequest' required: true - schema: - title: Kwargs responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/toolgroups/{toolgroup_id}: delete: tags: - - V1 - summary: Unregister a tool group. - description: Generic endpoint - this would be replaced with actual implementation. + - Tool Groups + summary: Unregister a tool group + description: Unregister a tool group operationId: unregister_toolgroup_v1_toolgroups__toolgroup_id__delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - name: toolgroup_id in: path required: true schema: type: string - description: 'Path parameter: toolgroup_id' + description: The ID of the tool group to unregister + title: Toolgroup Id + description: The ID of the tool group to unregister responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 - summary: Get a tool group by its ID. - description: Query endpoint for proper schema generation. + - Tool Groups + summary: Get a tool group by its ID + description: Get a tool group by its ID operationId: get_tool_group_v1_toolgroups__toolgroup_id__get parameters: - name: toolgroup_id @@ -2254,65 +3001,95 @@ paths: required: true schema: type: string + description: The ID of the tool group to get title: Toolgroup Id + description: The ID of the tool group to get responses: '200': - description: A ToolGroup. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ToolGroup' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/tools: get: tags: - - V1 - summary: List tools with optional tool group. - description: Query endpoint for proper schema generation. + - Tool Groups + summary: List tools + description: List tools with optional tool group operationId: list_tools_v1_tools_get parameters: - name: toolgroup_id in: query - required: true + required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: The ID of the tool group to list tools for title: Toolgroup Id + description: The ID of the tool group to list tools for responses: '200': - description: A ListToolDefsResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ListToolDefsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/tools/{tool_name}: get: tags: - - V1 - summary: Get a tool by its name. - description: Query endpoint for proper schema generation. + - Tool Groups + summary: Get a tool by its name + description: Get a tool by its name operationId: get_tool_v1_tools__tool_name__get parameters: - name: tool_name @@ -2320,152 +3097,212 @@ paths: required: true schema: type: string + description: The name of the tool to get title: Tool Name + description: The name of the tool to get responses: '200': - description: A ToolDef. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ToolDef' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/vector-io/insert: post: tags: - - V1 + - Vector IO summary: Insert chunks into a vector database. - description: Generic endpoint - this would be replaced with actual implementation. + description: Insert chunks into a vector database. operationId: insert_chunks_v1_vector_io_insert_post - parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InsertChunksRequest' required: true - schema: - title: Kwargs responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/vector-io/query: post: tags: - - V1 + - Vector IO summary: Query chunks from a vector database. - description: Typed endpoint for proper schema generation. + description: Query chunks from a vector database. operationId: query_chunks_v1_vector_io_query_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_vector_io_query_Request' + $ref: '#/components/schemas/QueryChunksRequest' required: true responses: '200': - description: A QueryChunksResponse. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/QueryChunksResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/vector_stores: get: tags: - - V1 + - Vector IO summary: Returns a list of vector stores. - description: Query endpoint for proper schema generation. + description: Returns a list of vector stores. operationId: openai_list_vector_stores_v1_vector_stores_get parameters: - - name: after - in: query - required: true - schema: - type: string - title: After - - name: before - in: query - required: true - schema: - type: string - title: Before - name: limit in: query required: false schema: - type: integer + anyOf: + - type: integer + maximum: 100 + minimum: 1 + - type: 'null' + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. default: 20 title: Limit + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - name: order in: query required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. default: desc title: Order + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + - name: after + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + title: After + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + - name: before + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. + title: Before + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. responses: '200': - description: A VectorStoreListResponse containing the list of vector stores. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VectorStoreListResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 + - Vector IO summary: Creates a vector store. - description: Typed endpoint for proper schema generation. + description: Creates a vector store. operationId: openai_create_vector_store_v1_vector_stores_post requestBody: required: true @@ -2475,29 +3312,41 @@ paths: $ref: '#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody' responses: '200': - description: A VectorStoreObject representing the created vector store. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VectorStoreObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/vector_stores/{vector_store_id}: delete: tags: - - V1 + - Vector IO summary: Delete a vector store. - description: Query endpoint for proper schema generation. + description: Delete a vector store. operationId: openai_delete_vector_store_v1_vector_stores__vector_store_id__delete parameters: - name: vector_store_id @@ -2505,32 +3354,45 @@ paths: required: true schema: type: string + description: The ID of the vector store to delete. title: Vector Store Id description: The ID of the vector store to delete. responses: '200': - description: A VectorStoreDeleteResponse indicating the deletion status. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VectorStoreDeleteResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 + - Vector IO summary: Retrieves a vector store. - description: Query endpoint for proper schema generation. + description: Retrieves a vector store. operationId: openai_retrieve_vector_store_v1_vector_stores__vector_store_id__get parameters: - name: vector_store_id @@ -2538,373 +3400,530 @@ paths: required: true schema: type: string + description: The ID of the vector store to retrieve. title: Vector Store Id description: The ID of the vector store to retrieve. responses: '200': - description: A VectorStoreObject representing the vector store. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VectorStoreObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 + - Vector IO summary: Updates a vector store. - description: Typed endpoint for proper schema generation. + description: Updates a vector store. operationId: openai_update_vector_store_v1_vector_stores__vector_store_id__post + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: The ID of the vector store to update. + title: Vector Store Id + description: The ID of the vector store to update. requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/_vector_stores_vector_store_id_Request' + $ref: '#/components/schemas/VectorStoreModifyRequest' responses: '200': - description: A VectorStoreObject representing the updated vector store. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VectorStoreObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/file_batches: + post: + tags: + - Vector IO + summary: Create a vector store file batch. + description: Create a vector store file batch. + operationId: openai_create_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches_post parameters: - name: vector_store_id in: path required: true schema: type: string - description: The ID of the vector store to update. - /v1/vector_stores/{vector_store_id}/file_batches: - post: - tags: - - V1 - summary: Create a vector store file batch. - description: Typed endpoint for proper schema generation. - operationId: openai_create_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches_post + description: The ID of the vector store to create the file batch for. + title: Vector Store Id + description: The ID of the vector store to create the file batch for. requestBody: + required: true content: application/json: schema: $ref: '#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody' - required: true responses: '200': - description: A VectorStoreFileBatchObject representing the created file batch. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileBatchObject' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - description: The ID of the vector store to create the file batch for. + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: get: tags: - - V1 + - Vector IO summary: Retrieve a vector store file batch. - description: Query endpoint for proper schema generation. + description: Retrieve a vector store file batch. operationId: openai_retrieve_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__get parameters: - - name: batch_id + - name: vector_store_id in: path required: true schema: type: string - title: Batch Id - description: The ID of the file batch to retrieve. - - name: vector_store_id + description: The ID of the vector store containing the file batch. + title: Vector Store Id + description: The ID of the vector store containing the file batch. + - name: batch_id in: path required: true schema: type: string - title: Vector Store Id - description: The ID of the vector store containing the file batch. + description: The ID of the file batch to retrieve. + title: Batch Id + description: The ID of the file batch to retrieve. responses: '200': - description: A VectorStoreFileBatchObject representing the file batch. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileBatchObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: post: tags: - - V1 + - Vector IO summary: Cancels a vector store file batch. - description: Typed endpoint for proper schema generation. + description: Cancels a vector store file batch. operationId: openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request' + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: The ID of the vector store containing the file batch. + title: Vector Store Id + description: The ID of the vector store containing the file batch. + - name: batch_id + in: path required: true + schema: + type: string + description: The ID of the file batch to cancel. + title: Batch Id + description: The ID of the file batch to cancel. responses: '200': - description: A VectorStoreFileBatchObject representing the cancelled file batch. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileBatchObject' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: + get: + tags: + - Vector IO + summary: Returns a list of vector store files in a batch. + description: Returns a list of vector store files in a batch. + operationId: openai_list_files_in_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get parameters: - - name: batch_id + - name: vector_store_id in: path required: true schema: type: string - description: The ID of the file batch to cancel. - - name: vector_store_id + description: The ID of the vector store containing the file batch. + title: Vector Store Id + description: The ID of the vector store containing the file batch. + - name: batch_id in: path required: true schema: type: string - description: The ID of the vector store containing the file batch. - /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: - get: - tags: - - V1 - summary: Returns a list of vector store files in a batch. - description: Query endpoint for proper schema generation. - operationId: openai_list_files_in_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get - parameters: + description: The ID of the file batch to list files from. + title: Batch Id + description: The ID of the file batch to list files from. - name: after in: query - required: true + required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. title: After + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. - name: before in: query - required: true + required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. title: Before + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. - name: filter in: query - required: true + required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: Filter by file status. One of in_progress, completed, failed, cancelled. title: Filter + description: Filter by file status. One of in_progress, completed, failed, cancelled. - name: limit in: query required: false schema: - type: integer + anyOf: + - type: integer + maximum: 100 + minimum: 1 + - type: 'null' + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. default: 20 title: Limit + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - name: order in: query required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. default: desc title: Order - - name: batch_id - in: path - required: true - schema: - type: string - title: Batch Id - description: The ID of the file batch to list files from. - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - description: The ID of the vector store containing the file batch. + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. responses: '200': - description: A VectorStoreFilesListInBatchResponse containing the list of files in the batch. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VectorStoreFilesListInBatchResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/vector_stores/{vector_store_id}/files: get: tags: - - V1 + - Vector IO summary: List files in a vector store. - description: Query endpoint for proper schema generation. + description: List files in a vector store. operationId: openai_list_files_in_vector_store_v1_vector_stores__vector_store_id__files_get parameters: - - name: after - in: query - required: true - schema: - type: string - title: After - - name: before - in: query - required: true - schema: - type: string - title: Before - - name: filter - in: query + - name: vector_store_id + in: path required: true schema: type: string - title: Filter + description: The ID of the vector store to list files from. + title: Vector Store Id + description: The ID of the vector store to list files from. - name: limit in: query required: false schema: - type: integer + anyOf: + - type: integer + maximum: 100 + minimum: 1 + - type: 'null' + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. default: 20 title: Limit + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - name: order in: query required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. default: desc title: Order - - name: vector_store_id - in: path - required: true + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + - name: after + in: query + required: false schema: - type: string - title: Vector Store Id - description: The ID of the vector store to list files from. + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + title: After + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + - name: before + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. + title: Before + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. + - name: filter + in: query + required: false + schema: + anyOf: + - const: completed + type: string + - const: in_progress + type: string + - const: cancelled + type: string + - const: failed + type: string + - type: 'null' + description: Filter by file status to only return files with the specified status. + title: Filter + description: Filter by file status to only return files with the specified status. responses: '200': - description: A VectorStoreListFilesResponse containing the list of files. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VectorStoreListFilesResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 + - Vector IO summary: Attach a file to a vector store. - description: Typed endpoint for proper schema generation. + description: Attach a file to a vector store. operationId: openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: The ID of the vector store to attach the file to. + title: Vector Store Id + description: The ID of the vector store to attach the file to. requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/_vector_stores_vector_store_id_files_Request' + $ref: '#/components/schemas/Body_openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post' responses: '200': - description: A VectorStoreFileObject representing the attached file. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - description: The ID of the vector store to attach the file to. + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/vector_stores/{vector_store_id}/files/{file_id}: delete: tags: - - V1 + - Vector IO summary: Delete a vector store file. - description: Query endpoint for proper schema generation. + description: Delete a vector store file. operationId: openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete parameters: - name: vector_store_id @@ -2912,6 +3931,7 @@ paths: required: true schema: type: string + description: The ID of the vector store containing the file to delete. title: Vector Store Id description: The ID of the vector store containing the file to delete. - name: file_id @@ -2919,32 +3939,45 @@ paths: required: true schema: type: string + description: The ID of the file to delete. title: File Id description: The ID of the file to delete. responses: '200': - description: A VectorStoreFileDeleteResponse indicating the deletion status. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileDeleteResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 + - Vector IO summary: Retrieves a vector store file. - description: Query endpoint for proper schema generation. + description: Retrieves a vector store file. operationId: openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get parameters: - name: vector_store_id @@ -2952,6 +3985,7 @@ paths: required: true schema: type: string + description: The ID of the vector store containing the file to retrieve. title: Vector Store Id description: The ID of the vector store containing the file to retrieve. - name: file_id @@ -2959,77 +3993,109 @@ paths: required: true schema: type: string + description: The ID of the file to retrieve. title: File Id description: The ID of the file to retrieve. responses: '200': - description: A VectorStoreFileObject representing the file. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 + - Vector IO summary: Updates a vector store file. - description: Typed endpoint for proper schema generation. + description: Updates a vector store file. operationId: openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: The ID of the vector store containing the file to update. + title: Vector Store Id + description: The ID of the vector store containing the file to update. + - name: file_id + in: path + required: true + schema: + type: string + description: The ID of the file to update. + title: File Id + description: The ID of the file to update. requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/_vector_stores_vector_store_id_files_file_id_Request' + type: object + additionalProperties: true + description: The updated key-value attributes to store with the file. + title: Attributes responses: '200': - description: A VectorStoreFileObject representing the updated file. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - description: The ID of the vector store containing the file to update. - - name: file_id - in: path - required: true - schema: - type: string - description: The ID of the file to update. + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/vector_stores/{vector_store_id}/files/{file_id}/content: get: tags: - - V1 + - Vector IO summary: Retrieves the contents of a vector store file. - description: Query endpoint for proper schema generation. + description: Retrieves the contents of a vector store file. operationId: openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get parameters: - name: vector_store_id @@ -3037,6 +4103,7 @@ paths: required: true schema: type: string + description: The ID of the vector store containing the file to retrieve. title: Vector Store Id description: The ID of the vector store containing the file to retrieve. - name: file_id @@ -3044,10683 +4111,5839 @@ paths: required: true schema: type: string + description: The ID of the file to retrieve. title: File Id description: The ID of the file to retrieve. responses: '200': - description: A list of InterleavedContent representing the file contents. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileContentsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/vector_stores/{vector_store_id}/search: post: tags: - - V1 + - Vector IO summary: Search for chunks in a vector store. - description: Typed endpoint for proper schema generation. + description: Search for chunks in a vector store. operationId: openai_search_vector_store_v1_vector_stores__vector_store_id__search_post + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: The ID of the vector store to search. + title: Vector Store Id + description: The ID of the vector store to search. requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/_vector_stores_vector_store_id_search_Request' - required: true + $ref: '#/components/schemas/Body_openai_search_vector_store_v1_vector_stores__vector_store_id__search_post' responses: '200': - description: A VectorStoreSearchResponse containing the search results. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VectorStoreSearchResponsePage' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - description: The ID of the vector store to search. + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' /v1/version: get: tags: - - V1 + - Inspect summary: Get version. - description: Response-only endpoint for proper schema generation. + description: Get the version of the service. operationId: version_v1_version_get responses: '200': - description: Version information containing the service version number. + description: Successful Response content: application/json: schema: $ref: '#/components/schemas/VersionInfo' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' components: schemas: - Error: - type: object + AgentTurnInputType: properties: - status: - type: integer - description: HTTP status code - title: - type: string - description: >- - Error title, a short summary of the error which is invariant for an error - type - detail: - type: string - description: >- - Error detail, a longer human-readable description of the error - instance: + type: type: string - description: >- - (Optional) A URL which can be used to retrieve more information about - the specific occurrence of the error - additionalProperties: false - required: - - status - - title - - detail - title: Error - description: >- - Error response from the API. Roughly follows RFC 7807. - ListBatchesResponse: + const: agent_turn_input + title: Type + default: agent_turn_input type: object - properties: - object: - type: string - const: list - default: list - data: - type: array - items: - type: object - properties: - id: - type: string - completion_window: - type: string - created_at: - type: integer - endpoint: - type: string - input_file_id: - type: string - object: - type: string - const: batch - status: - type: string - enum: - - validating - - failed - - in_progress - - finalizing - - completed - - expired - - cancelling - - cancelled - cancelled_at: - type: integer - cancelling_at: - type: integer - completed_at: - type: integer - error_file_id: - type: string - errors: - type: object - properties: - data: - type: array - items: - type: object - properties: - code: - type: string - line: - type: integer - message: - type: string - param: - type: string - additionalProperties: false - title: BatchError - object: - type: string - additionalProperties: false - title: Errors - expired_at: - type: integer - expires_at: - type: integer - failed_at: - type: integer - finalizing_at: - type: integer - in_progress_at: - type: integer - metadata: - type: object - additionalProperties: - type: string - model: - type: string - output_file_id: - type: string - request_counts: - type: object - properties: - completed: - type: integer - failed: - type: integer - total: - type: integer - additionalProperties: false - required: - - completed - - failed - - total - title: BatchRequestCounts - usage: - type: object - properties: - input_tokens: - type: integer - input_tokens_details: - type: object - properties: - cached_tokens: - type: integer - additionalProperties: false - required: - - cached_tokens - title: InputTokensDetails - output_tokens: - type: integer - output_tokens_details: - type: object - properties: - reasoning_tokens: - type: integer - additionalProperties: false - required: - - reasoning_tokens - title: OutputTokensDetails - total_tokens: - type: integer - additionalProperties: false - required: - - input_tokens - - input_tokens_details - - output_tokens - - output_tokens_details - - total_tokens - title: BatchUsage - additionalProperties: false - required: - - id - - completion_window - - created_at - - endpoint - - input_file_id - - object - - status - title: Batch - first_id: - type: string - last_id: - type: string - has_more: - type: boolean - default: false - additionalProperties: false - required: - - object - - data - - has_more - title: ListBatchesResponse - description: >- - Response containing a list of batch objects. - CreateBatchRequest: + title: AgentTurnInputType + description: "Parameter type for agent turn input.\n\n:param type: Discriminator type. Always \"agent_turn_input\"" + AggregationFunctionType: + type: string + enum: + - average + - weighted_average + - median + - categorical_count + - accuracy + title: AggregationFunctionType + description: Types of aggregation functions for scoring results. + AllowedToolsFilter: + properties: + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Tool Names + description: List of specific tool names that are allowed type: object + title: AllowedToolsFilter + description: "Filter configuration for restricting which MCP tools can be used.\n\n:param tool_names: (Optional) List of specific tool names that are allowed" + ApprovalFilter: properties: - input_file_id: - type: string - description: >- - The ID of an uploaded file containing requests for the batch. - endpoint: - type: string - description: >- - The endpoint to be used for all requests in the batch. - completion_window: + always: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Always + description: List of tool names that always require approval + never: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Never + description: List of tool names that never require approval + type: object + title: ApprovalFilter + description: "Filter configuration for MCP tool approval requirements.\n\n:param always: (Optional) List of tool names that always require approval\n:param never: (Optional) List of tool names that never require approval" + ArrayType: + properties: + type: type: string - const: 24h - description: >- - The time window within which the batch should be processed. - metadata: - type: object - additionalProperties: - type: string - description: Optional metadata for the batch. - idempotency_key: + const: array + title: Type + default: array + type: object + title: ArrayType + description: "Parameter type for array values.\n\n:param type: Discriminator type. Always \"array\"" + BasicScoringFnParams: + properties: + type: type: string - description: >- - Optional idempotency key. When provided, enables idempotent behavior. - additionalProperties: false - required: - - input_file_id - - endpoint - - completion_window - title: CreateBatchRequest - Batch: + const: basic + title: Type + default: basic + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row type: object + title: BasicScoringFnParams + description: Parameters for basic scoring function configuration. + Batch: properties: id: type: string + title: Id completion_window: type: string + title: Completion Window created_at: type: integer + title: Created At endpoint: type: string + title: Endpoint input_file_id: type: string + title: Input File Id object: type: string const: batch + title: Object status: type: string enum: - - validating - - failed - - in_progress - - finalizing - - completed - - expired - - cancelling - - cancelled + - validating + - failed + - in_progress + - finalizing + - completed + - expired + - cancelling + - cancelled + title: Status cancelled_at: - type: integer + anyOf: + - type: integer + - type: 'null' + title: Cancelled At cancelling_at: - type: integer + anyOf: + - type: integer + - type: 'null' + title: Cancelling At completed_at: - type: integer + anyOf: + - type: integer + - type: 'null' + title: Completed At error_file_id: - type: string + anyOf: + - type: string + - type: 'null' + title: Error File Id errors: - type: object - properties: - data: - type: array - items: - type: object - properties: - code: - type: string - line: - type: integer - message: - type: string - param: - type: string - additionalProperties: false - title: BatchError - object: - type: string - additionalProperties: false - title: Errors + anyOf: + - $ref: '#/components/schemas/Errors' + - type: 'null' expired_at: - type: integer + anyOf: + - type: integer + - type: 'null' + title: Expired At expires_at: - type: integer + anyOf: + - type: integer + - type: 'null' + title: Expires At failed_at: - type: integer + anyOf: + - type: integer + - type: 'null' + title: Failed At finalizing_at: - type: integer + anyOf: + - type: integer + - type: 'null' + title: Finalizing At in_progress_at: - type: integer + anyOf: + - type: integer + - type: 'null' + title: In Progress At metadata: - type: object - additionalProperties: - type: string + anyOf: + - additionalProperties: + type: string + type: object + - type: 'null' + title: Metadata model: - type: string + anyOf: + - type: string + - type: 'null' + title: Model output_file_id: - type: string + anyOf: + - type: string + - type: 'null' + title: Output File Id request_counts: - type: object - properties: - completed: - type: integer - failed: - type: integer - total: - type: integer - additionalProperties: false - required: - - completed - - failed - - total - title: BatchRequestCounts + anyOf: + - $ref: '#/components/schemas/BatchRequestCounts' + - type: 'null' usage: - type: object - properties: - input_tokens: - type: integer - input_tokens_details: - type: object - properties: - cached_tokens: - type: integer - additionalProperties: false - required: - - cached_tokens - title: InputTokensDetails - output_tokens: - type: integer - output_tokens_details: - type: object - properties: - reasoning_tokens: - type: integer - additionalProperties: false - required: - - reasoning_tokens - title: OutputTokensDetails - total_tokens: - type: integer - additionalProperties: false - required: - - input_tokens - - input_tokens_details - - output_tokens - - output_tokens_details - - total_tokens - title: BatchUsage - additionalProperties: false - required: - - id - - completion_window - - created_at - - endpoint - - input_file_id - - object - - status + anyOf: + - $ref: '#/components/schemas/BatchUsage' + - type: 'null' + additionalProperties: true + type: object + required: + - id + - completion_window + - created_at + - endpoint + - input_file_id + - object + - status title: Batch - Order: - type: string - enum: - - asc - - desc - title: Order - description: Sort order for paginated responses. - ListOpenAIChatCompletionResponse: + BatchError: + properties: + code: + anyOf: + - type: string + - type: 'null' + title: Code + line: + anyOf: + - type: integer + - type: 'null' + title: Line + message: + anyOf: + - type: string + - type: 'null' + title: Message + param: + anyOf: + - type: string + - type: 'null' + title: Param + additionalProperties: true type: object + title: BatchError + BatchRequestCounts: properties: - data: - type: array - items: - type: object - properties: - id: - type: string - description: The ID of the chat completion - choices: - type: array - items: - $ref: '#/components/schemas/OpenAIChoice' - description: List of choices - object: - type: string - const: chat.completion - default: chat.completion - description: >- - The object type, which will be "chat.completion" - created: - type: integer - description: >- - The Unix timestamp in seconds when the chat completion was created - model: - type: string - description: >- - The model that was used to generate the chat completion - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - description: >- - Token usage information for the completion - input_messages: - type: array - items: - $ref: '#/components/schemas/OpenAIMessageParam' - additionalProperties: false - required: - - id - - choices - - object - - created - - model - - input_messages - title: OpenAICompletionWithInputMessages - description: >- - List of chat completion objects with their input messages - has_more: - type: boolean - description: >- - Whether there are more completions available beyond this list - first_id: - type: string - description: ID of the first completion in this list - last_id: - type: string - description: ID of the last completion in this list - object: - type: string - const: list - default: list - description: >- - Must be "list" to identify this as a list response - additionalProperties: false - required: - - data - - has_more - - first_id - - last_id - - object - title: ListOpenAIChatCompletionResponse - description: >- - Response from listing OpenAI-compatible chat completions. - OpenAIAssistantMessageParam: + completed: + type: integer + title: Completed + failed: + type: integer + title: Failed + total: + type: integer + title: Total + additionalProperties: true type: object + required: + - completed + - failed + - total + title: BatchRequestCounts + BatchUsage: properties: - role: - type: string - const: assistant - default: assistant - description: >- - Must be "assistant" to identify this as the model's response - content: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - description: The content of the model's response - name: - type: string - description: >- - (Optional) The name of the assistant message participant. - tool_calls: - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' - description: >- - List of tool calls. Each tool call is an OpenAIChatCompletionToolCall - object. - additionalProperties: false - required: - - role - title: OpenAIAssistantMessageParam - description: >- - A message containing the model's (assistant) response in an OpenAI-compatible - chat completion request. - "OpenAIChatCompletionContentPartImageParam": + input_tokens: + type: integer + title: Input Tokens + input_tokens_details: + $ref: '#/components/schemas/InputTokensDetails' + output_tokens: + type: integer + title: Output Tokens + output_tokens_details: + $ref: '#/components/schemas/OutputTokensDetails' + total_tokens: + type: integer + title: Total Tokens + additionalProperties: true type: object + required: + - input_tokens + - input_tokens_details + - output_tokens + - output_tokens_details + - total_tokens + title: BatchUsage + Body_openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post: properties: - type: + file_id: type: string - const: image_url - default: image_url - description: >- - Must be "image_url" to identify this as image content - image_url: - $ref: '#/components/schemas/OpenAIImageURL' - description: >- - Image URL specification and processing details - additionalProperties: false - required: - - type - - image_url - title: >- - OpenAIChatCompletionContentPartImageParam - description: >- - Image content part for OpenAI-compatible chat completion messages. - OpenAIChatCompletionContentPartParam: - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - - $ref: '#/components/schemas/OpenAIFile' - discriminator: - propertyName: type - mapping: - text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - file: '#/components/schemas/OpenAIFile' - OpenAIChatCompletionContentPartTextParam: + title: File Id + description: The ID of the file to attach to the vector store. + attributes: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Attributes + description: The key-value attributes stored with the file, which can be used for filtering. + chunking_strategy: + anyOf: + - oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + - type: 'null' + title: Chunking Strategy + description: The chunking strategy to use for the file. type: object - properties: - type: - type: string - const: text - default: text - description: >- - Must be "text" to identify this as text content - text: - type: string - description: The text content of the message - additionalProperties: false required: - - type - - text - title: OpenAIChatCompletionContentPartTextParam - description: >- - Text content part for OpenAI-compatible chat completion messages. - OpenAIChatCompletionToolCall: - type: object + - file_id + title: Body_openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post + Body_openai_search_vector_store_v1_vector_stores__vector_store_id__search_post: properties: - index: - type: integer - description: >- - (Optional) Index of the tool call in the list - id: - type: string - description: >- - (Optional) Unique identifier for the tool call - type: - type: string - const: function - default: function - description: >- - Must be "function" to identify this as a function call - function: - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' - description: (Optional) Function call details - additionalProperties: false - required: - - type - title: OpenAIChatCompletionToolCall - description: >- - Tool call specification for OpenAI-compatible chat completion responses. - OpenAIChatCompletionToolCallFunction: + query: + anyOf: + - type: string + - items: + type: string + type: array + title: Query + description: The query string or array for performing the search. + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Filters + description: Filters based on file attributes to narrow the search results. + max_num_results: + anyOf: + - type: integer + maximum: 50.0 + minimum: 1.0 + - type: 'null' + title: Max Num Results + description: Maximum number of results to return (1 to 50 inclusive, default 10). + default: 10 + ranking_options: + anyOf: + - $ref: '#/components/schemas/SearchRankingOptions' + - type: 'null' + description: Ranking options for fine-tuning the search results. + rewrite_query: + type: boolean + title: Rewrite Query + description: Whether to rewrite the natural language query for vector search (default false). + default: false + search_mode: + anyOf: + - type: string + - type: 'null' + title: Search Mode + description: The search mode to use - 'keyword', 'vector', or 'hybrid' (default 'vector'). + default: vector type: object + required: + - query + title: Body_openai_search_vector_store_v1_vector_stores__vector_store_id__search_post + Body_openai_upload_file_v1_files_post: properties: - name: - type: string - description: (Optional) Name of the function to call - arguments: + file: type: string - description: >- - (Optional) Arguments to pass to the function as a JSON string - additionalProperties: false - title: OpenAIChatCompletionToolCallFunction - description: >- - Function call details for OpenAI-compatible tool calls. - OpenAIChatCompletionUsage: - type: object - properties: - prompt_tokens: - type: integer - description: Number of tokens in the prompt - completion_tokens: - type: integer - description: Number of tokens in the completion - total_tokens: - type: integer - description: Total tokens used (prompt + completion) - prompt_tokens_details: - type: object - properties: - cached_tokens: - type: integer - description: Number of tokens retrieved from cache - additionalProperties: false - title: >- - OpenAIChatCompletionUsagePromptTokensDetails - description: >- - Token details for prompt tokens in OpenAI chat completion usage. - completion_tokens_details: - type: object - properties: - reasoning_tokens: - type: integer - description: >- - Number of tokens used for reasoning (o1/o3 models) - additionalProperties: false - title: >- - OpenAIChatCompletionUsageCompletionTokensDetails - description: >- - Token details for output tokens in OpenAI chat completion usage. - additionalProperties: false - required: - - prompt_tokens - - completion_tokens - - total_tokens - title: OpenAIChatCompletionUsage - description: >- - Usage information for OpenAI chat completion. - OpenAIChoice: + format: binary + title: File + description: The File object to be uploaded. + purpose: + $ref: '#/components/schemas/OpenAIFilePurpose' + description: The intended purpose of the uploaded file. + expires_after: + anyOf: + - $ref: '#/components/schemas/ExpiresAfter' + - type: 'null' + description: Optional form values describing expiration for the file. type: object + required: + - file + - purpose + title: Body_openai_upload_file_v1_files_post + Body_rag_tool_insert_v1_tool_runtime_rag_tool_insert_post: properties: - message: - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - discriminator: - propertyName: role - mapping: - user: '#/components/schemas/OpenAIUserMessageParam' - system: '#/components/schemas/OpenAISystemMessageParam' - assistant: '#/components/schemas/OpenAIAssistantMessageParam' - tool: '#/components/schemas/OpenAIToolMessageParam' - developer: '#/components/schemas/OpenAIDeveloperMessageParam' - description: The message from the model - finish_reason: + documents: + items: + $ref: '#/components/schemas/RAGDocument' + type: array + title: Documents + description: List of documents to index in the RAG system. + vector_store_id: type: string - description: The reason the model stopped generating - index: + title: Vector Store Id + description: ID of the vector database to store the document embeddings. + chunk_size_in_tokens: type: integer - description: The index of the choice - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - description: >- - (Optional) The log probabilities for the tokens in the message - additionalProperties: false - required: - - message - - finish_reason - - index - title: OpenAIChoice - description: >- - A choice from an OpenAI-compatible chat completion response. - OpenAIChoiceLogprobs: + title: Chunk Size In Tokens + description: Size in tokens for document chunking during indexing. + default: 512 type: object + required: + - documents + - vector_store_id + title: Body_rag_tool_insert_v1_tool_runtime_rag_tool_insert_post + Body_rag_tool_query_v1_tool_runtime_rag_tool_query_post: properties: content: - type: array + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + description: The query content to search for in the indexed documents. + vector_store_ids: items: - $ref: '#/components/schemas/OpenAITokenLogProb' - description: >- - (Optional) The log probabilities for the tokens in the message - refusal: + type: string type: array - items: - $ref: '#/components/schemas/OpenAITokenLogProb' - description: >- - (Optional) The log probabilities for the tokens in the message - additionalProperties: false - title: OpenAIChoiceLogprobs - description: >- - The log probabilities for the tokens in the message from an OpenAI-compatible - chat completion response. - OpenAIDeveloperMessageParam: + title: Vector Store Ids + description: List of vector database IDs to search within. + query_config: + anyOf: + - $ref: '#/components/schemas/RAGQueryConfig' + - type: 'null' + description: Configuration parameters for the query operation. type: object - properties: - role: - type: string - const: developer - default: developer - description: >- - Must be "developer" to identify this as a developer message - content: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - description: The content of the developer message - name: - type: string - description: >- - (Optional) The name of the developer message participant. - additionalProperties: false required: - - role - - content - title: OpenAIDeveloperMessageParam - description: >- - A message from the developer in an OpenAI-compatible chat completion request. - OpenAIFile: - type: object + - content + - vector_store_ids + title: Body_rag_tool_query_v1_tool_runtime_rag_tool_query_post + BooleanType: properties: type: type: string - const: file - default: file - file: - $ref: '#/components/schemas/OpenAIFileFile' - additionalProperties: false - required: - - type - - file - title: OpenAIFile - OpenAIFileFile: - type: object - properties: - file_data: - type: string - file_id: - type: string - filename: - type: string - additionalProperties: false - title: OpenAIFileFile - OpenAIImageURL: + const: boolean + title: Type + default: boolean type: object + title: BooleanType + description: "Parameter type for boolean values.\n\n:param type: Discriminator type. Always \"boolean\"" + ChatCompletionInputType: properties: - url: - type: string - description: >- - URL of the image to include in the message - detail: + type: type: string - description: >- - (Optional) Level of detail for image processing. Can be "low", "high", - or "auto" - additionalProperties: false - required: - - url - title: OpenAIImageURL - description: >- - Image URL specification for OpenAI-compatible chat completion messages. - OpenAIMessageParam: - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - discriminator: - propertyName: role - mapping: - user: '#/components/schemas/OpenAIUserMessageParam' - system: '#/components/schemas/OpenAISystemMessageParam' - assistant: '#/components/schemas/OpenAIAssistantMessageParam' - tool: '#/components/schemas/OpenAIToolMessageParam' - developer: '#/components/schemas/OpenAIDeveloperMessageParam' - OpenAISystemMessageParam: + const: chat_completion_input + title: Type + default: chat_completion_input type: object + title: ChatCompletionInputType + description: "Parameter type for chat completion input.\n\n:param type: Discriminator type. Always \"chat_completion_input\"" + Chunk-Input: properties: - role: - type: string - const: system - default: system - description: >- - Must be "system" to identify this as a system message content: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - description: >- - The content of the "system prompt". If multiple system messages are provided, - they are concatenated. The underlying Llama Stack code may also add other - system messages (for example, for formatting tool definitions). - name: - type: string - description: >- - (Optional) The name of the system message participant. - additionalProperties: false - required: - - role - - content - title: OpenAISystemMessageParam - description: >- - A system message providing instructions or context to the model. - OpenAITokenLogProb: - type: object - properties: - token: - type: string - bytes: - type: array - items: - type: integer - logprob: - type: number - top_logprobs: - type: array - items: - $ref: '#/components/schemas/OpenAITopLogProb' - additionalProperties: false - required: - - token - - logprob - - top_logprobs - title: OpenAITokenLogProb - description: >- - The log probability for a token from an OpenAI-compatible chat completion - response. - OpenAIToolMessageParam: - type: object - properties: - role: - type: string - const: tool - default: tool - description: >- - Must be "tool" to identify this as a tool response - tool_call_id: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + chunk_id: type: string - description: >- - Unique identifier for the tool call this response is for - content: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - description: The response content from the tool - additionalProperties: false - required: - - role - - tool_call_id - - content - title: OpenAIToolMessageParam - description: >- - A message representing the result of a tool invocation in an OpenAI-compatible - chat completion request. - OpenAITopLogProb: + title: Chunk Id + metadata: + additionalProperties: true + type: object + title: Metadata + embedding: + anyOf: + - items: + type: number + type: array + - type: 'null' + title: Embedding + chunk_metadata: + anyOf: + - $ref: '#/components/schemas/ChunkMetadata' + - type: 'null' type: object - properties: - token: - type: string - bytes: - type: array - items: - type: integer - logprob: - type: number - additionalProperties: false required: - - token - - logprob - title: OpenAITopLogProb - description: >- - The top log probability for a token from an OpenAI-compatible chat completion - response. - OpenAIUserMessageParam: - type: object + - content + - chunk_id + title: Chunk + description: A chunk of content that can be inserted into a vector database. + Chunk-Output: properties: - role: - type: string - const: user - default: user - description: >- - Must be "user" to identify this as a user message content: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartParam' - description: >- - The content of the message, which can include text and other media - name: - type: string - description: >- - (Optional) The name of the user message participant. - additionalProperties: false - required: - - role - - content - title: OpenAIUserMessageParam - description: >- - A message from the user in an OpenAI-compatible chat completion request. - OpenAIJSONSchema: - type: object - properties: - name: - type: string - description: Name of the schema - description: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + chunk_id: type: string - description: (Optional) Description of the schema - strict: - type: boolean - description: >- - (Optional) Whether to enforce strict adherence to the schema - schema: + title: Chunk Id + metadata: + additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The JSON schema definition - additionalProperties: false - required: - - name - title: OpenAIJSONSchema - description: >- - JSON schema specification for OpenAI-compatible structured response format. - OpenAIResponseFormatJSONObject: + title: Metadata + embedding: + anyOf: + - items: + type: number + type: array + - type: 'null' + title: Embedding + chunk_metadata: + anyOf: + - $ref: '#/components/schemas/ChunkMetadata' + - type: 'null' type: object - properties: - type: - type: string - const: json_object - default: json_object - description: >- - Must be "json_object" to indicate generic JSON object response format - additionalProperties: false required: - - type - title: OpenAIResponseFormatJSONObject - description: >- - JSON object response format for OpenAI-compatible chat completion requests. - OpenAIResponseFormatJSONSchema: + - content + - chunk_id + title: Chunk + description: A chunk of content that can be inserted into a vector database. + ChunkMetadata: + properties: + chunk_id: + anyOf: + - type: string + - type: 'null' + title: Chunk Id + document_id: + anyOf: + - type: string + - type: 'null' + title: Document Id + source: + anyOf: + - type: string + - type: 'null' + title: Source + created_timestamp: + anyOf: + - type: integer + - type: 'null' + title: Created Timestamp + updated_timestamp: + anyOf: + - type: integer + - type: 'null' + title: Updated Timestamp + chunk_window: + anyOf: + - type: string + - type: 'null' + title: Chunk Window + chunk_tokenizer: + anyOf: + - type: string + - type: 'null' + title: Chunk Tokenizer + chunk_embedding_model: + anyOf: + - type: string + - type: 'null' + title: Chunk Embedding Model + chunk_embedding_dimension: + anyOf: + - type: integer + - type: 'null' + title: Chunk Embedding Dimension + content_token_count: + anyOf: + - type: integer + - type: 'null' + title: Content Token Count + metadata_token_count: + anyOf: + - type: integer + - type: 'null' + title: Metadata Token Count type: object + title: ChunkMetadata + description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." + CompletionInputType: properties: type: type: string - const: json_schema - default: json_schema - description: >- - Must be "json_schema" to indicate structured JSON response format - json_schema: - $ref: '#/components/schemas/OpenAIJSONSchema' - description: >- - The JSON schema specification for the response - additionalProperties: false - required: - - type - - json_schema - title: OpenAIResponseFormatJSONSchema - description: >- - JSON schema response format for OpenAI-compatible chat completion requests. - OpenAIResponseFormatParam: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseFormatText' - - $ref: '#/components/schemas/OpenAIResponseFormatJSONSchema' - - $ref: '#/components/schemas/OpenAIResponseFormatJSONObject' - discriminator: - propertyName: type - mapping: - text: '#/components/schemas/OpenAIResponseFormatText' - json_schema: '#/components/schemas/OpenAIResponseFormatJSONSchema' - json_object: '#/components/schemas/OpenAIResponseFormatJSONObject' - OpenAIResponseFormatText: + const: completion_input + title: Type + default: completion_input type: object + title: CompletionInputType + description: "Parameter type for completion input.\n\n:param type: Discriminator type. Always \"completion_input\"" + Conversation: properties: - type: + id: type: string - const: text - default: text - description: >- - Must be "text" to indicate plain text response format - additionalProperties: false + title: Id + description: The unique ID of the conversation. + object: + type: string + const: conversation + title: Object + description: The object type, which is always conversation. + default: conversation + created_at: + type: integer + title: Created At + description: The time at which the conversation was created, measured in seconds since the Unix epoch. + metadata: + anyOf: + - additionalProperties: + type: string + type: object + - type: 'null' + title: Metadata + description: Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. + items: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Items + description: Initial items to include in the conversation context. You may add up to 20 items at a time. + type: object required: - - type - title: OpenAIResponseFormatText - description: >- - Text response format for OpenAI-compatible chat completion requests. - OpenAIChatCompletionRequestWithExtraBody: + - id + - created_at + title: Conversation + description: OpenAI-compatible conversation object. + ConversationCreateRequest: + properties: + items: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Input' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + maxItems: 20 + - type: 'null' + title: Items + description: Initial items to include in the conversation context. You may add up to 20 items at a time. + default: [] + metadata: + anyOf: + - additionalProperties: + type: string + type: object + maxProperties: 16 + - type: 'null' + title: Metadata + description: Set of 16 key-value pairs that can be attached to an object. Useful for storing additional information + default: {} type: object + title: ConversationCreateRequest + description: Request body for creating a conversation. + ConversationDeletedResource: properties: - model: + id: type: string - description: >- - The identifier of the model to use. The model must be registered with - Llama Stack and available via the /models endpoint. - messages: - type: array - items: - $ref: '#/components/schemas/OpenAIMessageParam' - description: List of messages in the conversation. - frequency_penalty: - type: number - description: >- - (Optional) The penalty for repeated tokens. - function_call: - oneOf: - - type: string - - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The function call to use. - functions: - type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) List of functions to use. - logit_bias: - type: object - additionalProperties: - type: number - description: (Optional) The logit bias to use. - logprobs: - type: boolean - description: (Optional) The log probabilities to use. - max_completion_tokens: - type: integer - description: >- - (Optional) The maximum number of tokens to generate. - max_tokens: - type: integer - description: >- - (Optional) The maximum number of tokens to generate. - n: - type: integer - description: >- - (Optional) The number of completions to generate. - parallel_tool_calls: - type: boolean - description: >- - (Optional) Whether to parallelize tool calls. - presence_penalty: - type: number - description: >- - (Optional) The penalty for repeated tokens. - response_format: - $ref: '#/components/schemas/OpenAIResponseFormatParam' - description: (Optional) The response format to use. - seed: - type: integer - description: (Optional) The seed to use. - stop: - oneOf: - - type: string - - type: array - items: - type: string - description: (Optional) The stop tokens to use. - stream: + title: Id + description: The deleted conversation identifier + object: + type: string + title: Object + description: Object type + default: conversation.deleted + deleted: type: boolean - description: >- - (Optional) Whether to stream the response. - stream_options: - type: object - additionalProperties: + title: Deleted + description: Whether the object was deleted + default: true + type: object + required: + - id + title: ConversationDeletedResource + description: Response for deleted conversation. + ConversationItemCreateRequest: + properties: + items: + items: oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The stream options to use. - temperature: - type: number - description: (Optional) The temperature to use. - tool_choice: - oneOf: - - type: string - - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The tool choice to use. - tools: + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Input' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The tools to use. - top_logprobs: - type: integer - description: >- - (Optional) The top log probabilities to use. - top_p: - type: number - description: (Optional) The top p to use. - user: - type: string - description: (Optional) The user to use. - additionalProperties: false - required: - - model - - messages - title: OpenAIChatCompletionRequestWithExtraBody - description: >- - Request parameters for OpenAI-compatible chat completion endpoint. - OpenAIChatCompletion: + maxItems: 20 + title: Items + description: Items to include in the conversation context. You may add up to 20 items at a time. type: object + required: + - items + title: ConversationItemCreateRequest + description: Request body for creating conversation items. + ConversationItemDeletedResource: properties: id: type: string - description: The ID of the chat completion - choices: - type: array - items: - $ref: '#/components/schemas/OpenAIChoice' - description: List of choices + title: Id + description: The deleted item identifier object: type: string - const: chat.completion - default: chat.completion - description: >- - The object type, which will be "chat.completion" - created: - type: integer - description: >- - The Unix timestamp in seconds when the chat completion was created - model: - type: string - description: >- - The model that was used to generate the chat completion - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - description: >- - Token usage information for the completion - additionalProperties: false - required: - - id - - choices - - object - - created - - model - title: OpenAIChatCompletion - description: >- - Response from an OpenAI-compatible chat completion request. - OpenAIChatCompletionChunk: + title: Object + description: Object type + default: conversation.item.deleted + deleted: + type: boolean + title: Deleted + description: Whether the object was deleted + default: true type: object + required: + - id + title: ConversationItemDeletedResource + description: Response for deleted conversation item. + ConversationItemInclude: + type: string + enum: + - web_search_call.action.sources + - code_interpreter_call.outputs + - computer_call_output.output.image_url + - file_search_call.results + - message.input_image.image_url + - message.output_text.logprobs + - reasoning.encrypted_content + title: ConversationItemInclude + description: Specify additional output data to include in the model response. + ConversationItemList: properties: - id: - type: string - description: The ID of the chat completion - choices: - type: array - items: - $ref: '#/components/schemas/OpenAIChunkChoice' - description: List of choices object: type: string - const: chat.completion.chunk - default: chat.completion.chunk - description: >- - The object type, which will be "chat.completion.chunk" - created: - type: integer - description: >- - The Unix timestamp in seconds when the chat completion was created - model: - type: string - description: >- - The model that was used to generate the chat completion - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - description: >- - Token usage information (typically included in final chunk with stream_options) - additionalProperties: false - required: - - id - - choices - - object - - created - - model - title: OpenAIChatCompletionChunk - description: >- - Chunk from a streaming response to an OpenAI-compatible chat completion request. - OpenAIChoiceDelta: + title: Object + description: Object type + default: list + data: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + title: Data + description: List of conversation items + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + description: The ID of the first item in the list + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + description: The ID of the last item in the list + has_more: + type: boolean + title: Has More + description: Whether there are more items available + default: false type: object + required: + - data + title: ConversationItemList + description: List of conversation items with pagination. + ConversationUpdateRequest: properties: - content: - type: string - description: (Optional) The content of the delta - refusal: - type: string - description: (Optional) The refusal of the delta - role: - type: string - description: (Optional) The role of the delta - tool_calls: - type: array - items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' - description: (Optional) The tool calls of the delta - reasoning_content: - type: string - description: >- - (Optional) The reasoning content from the model (non-standard, for o1/o3 - models) - additionalProperties: false - title: OpenAIChoiceDelta - description: >- - A delta from an OpenAI-compatible chat completion streaming response. - OpenAIChunkChoice: - type: object - properties: - delta: - $ref: '#/components/schemas/OpenAIChoiceDelta' - description: The delta from the chunk - finish_reason: - type: string - description: The reason the model stopped generating - index: - type: integer - description: The index of the choice - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - description: >- - (Optional) The log probabilities for the tokens in the message - additionalProperties: false - required: - - delta - - finish_reason - - index - title: OpenAIChunkChoice - description: >- - A chunk choice from an OpenAI-compatible chat completion streaming response. - OpenAICompletionWithInputMessages: + metadata: + additionalProperties: + type: string + type: object + title: Metadata + description: Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. type: object + required: + - metadata + title: ConversationUpdateRequest + description: Request body for updating a conversation. + CreateBatchRequest: properties: - id: + input_file_id: type: string - description: The ID of the chat completion - choices: - type: array - items: - $ref: '#/components/schemas/OpenAIChoice' - description: List of choices - object: + title: Input File Id + description: The ID of an uploaded file containing requests for the batch. + endpoint: type: string - const: chat.completion - default: chat.completion - description: >- - The object type, which will be "chat.completion" - created: - type: integer - description: >- - The Unix timestamp in seconds when the chat completion was created - model: + title: Endpoint + description: The endpoint to be used for all requests in the batch. + completion_window: type: string - description: >- - The model that was used to generate the chat completion - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - description: >- - Token usage information for the completion - input_messages: - type: array - items: - $ref: '#/components/schemas/OpenAIMessageParam' - additionalProperties: false - required: - - id - - choices - - object - - created - - model - - input_messages - title: OpenAICompletionWithInputMessages - OpenAICompletionRequestWithExtraBody: + const: 24h + title: Completion Window + description: The time window within which the batch should be processed. + metadata: + anyOf: + - additionalProperties: + type: string + type: object + - type: 'null' + title: Metadata + description: Optional metadata for the batch. + idempotency_key: + anyOf: + - type: string + - type: 'null' + title: Idempotency Key + description: Optional idempotency key. When provided, enables idempotent behavior. type: object + required: + - input_file_id + - endpoint + - completion_window + title: CreateBatchRequest + description: Request model for creating a batch. + CreateOpenAIResponseRequest: properties: + input: + anyOf: + - type: string + - items: + anyOf: + - oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Input' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + type: array + title: Input + description: Input message(s) to create the response model: type: string - description: >- - The identifier of the model to use. The model must be registered with - Llama Stack and available via the /models endpoint. + title: Model + description: The underlying LLM used for completions prompt: - oneOf: - - type: string - - type: array - items: - type: string - - type: array - items: - type: integer - - type: array - items: - type: array - items: - type: integer - description: The prompt to generate a completion for. - best_of: - type: integer - description: >- - (Optional) The number of completions to generate. - echo: - type: boolean - description: (Optional) Whether to echo the prompt. - frequency_penalty: - type: number - description: >- - (Optional) The penalty for repeated tokens. - logit_bias: - type: object - additionalProperties: - type: number - description: (Optional) The logit bias to use. - logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + description: Prompt object with ID, version, and variables + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + description: System instructions + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + description: If specified, the new response will be a continuation of the previous response + conversation: + anyOf: + - type: string + - type: 'null' + title: Conversation + description: The ID of a conversation to add the response to. Must begin with 'conv_' + store: type: boolean - description: (Optional) The log probabilities to use. - max_tokens: - type: integer - description: >- - (Optional) The maximum number of tokens to generate. - n: - type: integer - description: >- - (Optional) The number of completions to generate. - presence_penalty: - type: number - description: >- - (Optional) The penalty for repeated tokens. - seed: - type: integer - description: (Optional) The seed to use. - stop: - oneOf: - - type: string - - type: array - items: - type: string - description: (Optional) The stop tokens to use. + title: Store + description: Whether to store the response + default: true stream: type: boolean - description: >- - (Optional) Whether to stream the response. - stream_options: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The stream options to use. + title: Stream + description: Whether to stream the response + default: false temperature: - type: number - description: (Optional) The temperature to use. - top_p: - type: number - description: (Optional) The top p to use. - user: - type: string - description: (Optional) The user to use. - suffix: - type: string - description: >- - (Optional) The suffix that should be appended to the completion. - additionalProperties: false - required: - - model - - prompt - title: OpenAICompletionRequestWithExtraBody - description: >- - Request parameters for OpenAI-compatible completion endpoint. - OpenAICompletion: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Sampling temperature + text: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseText' + - type: 'null' + description: Text generation parameters + tools: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseInputToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + type: array + - type: 'null' + title: Tools + description: Tools to make available + include: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Include + description: Additional fields to include in the response + max_infer_iters: + type: integer + title: Max Infer Iters + description: Maximum number of inference iterations (extension to the OpenAI API) + default: 10 + guardrails: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/ResponseGuardrailSpec' + type: array + - type: 'null' + title: Guardrails + description: List of guardrails to apply during response generation type: object + required: + - input + - model + title: CreateOpenAIResponseRequest + description: Request to create a model response. + CreatePromptRequest: properties: - id: - type: string - choices: - type: array - items: - $ref: '#/components/schemas/OpenAICompletionChoice' - created: - type: integer - model: - type: string - object: + prompt: type: string - const: text_completion - default: text_completion - additionalProperties: false - required: - - id - - choices - - created - - model - - object - title: OpenAICompletion - description: >- - Response from an OpenAI-compatible completion request. - OpenAICompletionChoice: + title: Prompt + description: The prompt text content with variable placeholders. + variables: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Variables + description: List of variable names that can be used in the prompt template. type: object + required: + - prompt + title: CreatePromptRequest + description: Request model for creating a new prompt. + DefaultRAGQueryGeneratorConfig: properties: - finish_reason: + type: type: string - text: + const: default + title: Type + default: default + separator: type: string - index: - type: integer - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - additionalProperties: false - required: - - finish_reason - - text - - index - title: OpenAICompletionChoice - description: >- - A choice from an OpenAI-compatible completion response. - ConversationItem: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - OpenAIResponseAnnotationCitation: + title: Separator + default: ' ' type: object + title: DefaultRAGQueryGeneratorConfig + description: "Configuration for the default RAG query generator.\n\n:param type: Type of query generator, always 'default'\n:param separator: String separator used to join query terms" + Error: properties: - type: - type: string - const: url_citation - default: url_citation - description: >- - Annotation type identifier, always "url_citation" - end_index: - type: integer - description: >- - End position of the citation span in the content - start_index: + status: type: integer - description: >- - Start position of the citation span in the content + title: Status + description: HTTP status code title: type: string - description: Title of the referenced web resource - url: + title: Title + description: Error title, a short summary of the error which is invariant for an error type + detail: type: string - description: URL of the referenced web resource - additionalProperties: false + title: Detail + description: Error detail, a longer human-readable description of the error + instance: + anyOf: + - type: string + - type: 'null' + title: Instance + description: (Optional) A URL which can be used to retrieve more information about the specific occurrence of the error + type: object required: - - type - - end_index - - start_index - - title - - url - title: OpenAIResponseAnnotationCitation - description: >- - URL citation annotation for referencing external web resources. - "OpenAIResponseAnnotationContainerFileCitation": + - status + - title + - detail + title: Error + description: Error response from the API. Roughly follows RFC 7807. + Errors: + properties: + data: + anyOf: + - items: + $ref: '#/components/schemas/BatchError' + type: array + - type: 'null' + title: Data + object: + anyOf: + - type: string + - type: 'null' + title: Object + additionalProperties: true type: object + title: Errors + ExpiresAfter: properties: - type: - type: string - const: container_file_citation - default: container_file_citation - container_id: - type: string - end_index: - type: integer - file_id: - type: string - filename: + anchor: type: string - start_index: + const: created_at + title: Anchor + description: Anchor must be 'created_at'. + seconds: type: integer - additionalProperties: false - required: - - type - - container_id - - end_index - - file_id - - filename - - start_index - title: >- - OpenAIResponseAnnotationContainerFileCitation - OpenAIResponseAnnotationFileCitation: + maximum: 2592000.0 + minimum: 3600.0 + title: Seconds + description: Seconds between 3600 and 2592000 (1 hour to 30 days). type: object + required: + - anchor + - seconds + title: ExpiresAfter + description: Control expiration of uploaded files. + HealthInfo: properties: - type: - type: string - const: file_citation - default: file_citation - description: >- - Annotation type identifier, always "file_citation" - file_id: - type: string - description: Unique identifier of the referenced file - filename: - type: string - description: Name of the referenced file - index: - type: integer - description: >- - Position index of the citation within the content - additionalProperties: false - required: - - type - - file_id - - filename - - index - title: OpenAIResponseAnnotationFileCitation - description: >- - File citation annotation for referencing specific files in response content. - OpenAIResponseAnnotationFilePath: + status: + $ref: '#/components/schemas/HealthStatus' + description: Current health status of the service type: object + required: + - status + title: HealthInfo + description: Health status information for the service. + HealthStatus: + type: string + enum: + - OK + - Error + - Not Implemented + title: HealthStatus + ImageContentItem-Input: properties: type: type: string - const: file_path - default: file_path - file_id: - type: string - index: - type: integer - additionalProperties: false - required: - - type - - file_id - - index - title: OpenAIResponseAnnotationFilePath - OpenAIResponseAnnotations: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' - discriminator: - propertyName: type - mapping: - file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' - container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' - OpenAIResponseContentPartRefusal: + const: image + title: Type + default: image + image: + $ref: '#/components/schemas/_URLOrData' type: object + required: + - image + title: ImageContentItem + description: A image content item. + ImageContentItem-Output: properties: type: type: string - const: refusal - default: refusal - description: >- - Content part type identifier, always "refusal" - refusal: - type: string - description: Refusal text supplied by the model - additionalProperties: false + const: image + title: Type + default: image + image: + $ref: '#/components/schemas/_URLOrData' + type: object required: - - type - - refusal - title: OpenAIResponseContentPartRefusal - description: >- - Refusal content within a streamed response part. - "OpenAIResponseInputFunctionToolCallOutput": + - image + title: ImageContentItem + description: A image content item. + InputTokensDetails: + properties: + cached_tokens: + type: integer + title: Cached Tokens + additionalProperties: true type: object + required: + - cached_tokens + title: InputTokensDetails + InsertChunksRequest: properties: - call_id: - type: string - output: - type: string - type: - type: string - const: function_call_output - default: function_call_output - id: - type: string - status: + vector_store_id: type: string - additionalProperties: false - required: - - call_id - - output - - type - title: >- - OpenAIResponseInputFunctionToolCallOutput - description: >- - This represents the output of a function call that gets passed back to the - model. - OpenAIResponseInputMessageContent: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' - discriminator: - propertyName: type - mapping: - input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' - input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' - input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' - OpenAIResponseInputMessageContentFile: + title: Vector Store Id + description: The identifier of the vector database to insert the chunks into. + chunks: + items: + $ref: '#/components/schemas/Chunk-Input' + type: array + title: Chunks + description: The chunks to insert. + ttl_seconds: + anyOf: + - type: integer + - type: 'null' + title: Ttl Seconds + description: The time to live of the chunks. type: object - properties: - type: - type: string - const: input_file - default: input_file - description: >- - The type of the input item. Always `input_file`. - file_data: - type: string - description: >- - The data of the file to be sent to the model. - file_id: - type: string - description: >- - (Optional) The ID of the file to be sent to the model. - file_url: - type: string - description: >- - The URL of the file to be sent to the model. - filename: - type: string - description: >- - The name of the file to be sent to the model. - additionalProperties: false required: - - type - title: OpenAIResponseInputMessageContentFile - description: >- - File content for input messages in OpenAI response format. - OpenAIResponseInputMessageContentImage: - type: object + - vector_store_id + - chunks + title: InsertChunksRequest + description: Request to insert chunks into a vector database. + InvokeToolRequest: properties: - detail: - oneOf: - - type: string - const: low - - type: string - const: high - - type: string - const: auto - default: auto - description: >- - Level of detail for image processing, can be "low", "high", or "auto" - type: - type: string - const: input_image - default: input_image - description: >- - Content type identifier, always "input_image" - file_id: - type: string - description: >- - (Optional) The ID of the file to be sent to the model. - image_url: + tool_name: type: string - description: (Optional) URL of the image content - additionalProperties: false - required: - - detail - - type - title: OpenAIResponseInputMessageContentImage - description: >- - Image content for input messages in OpenAI response format. - OpenAIResponseInputMessageContentText: + title: Tool Name + description: The name of the tool to invoke + kwargs: + additionalProperties: true + type: object + title: Kwargs + description: A dictionary of arguments to pass to the tool type: object - properties: - text: - type: string - description: The text content of the input message - type: - type: string - const: input_text - default: input_text - description: >- - Content type identifier, always "input_text" - additionalProperties: false required: - - text - - type - title: OpenAIResponseInputMessageContentText - description: >- - Text content for input messages in OpenAI response format. - OpenAIResponseMCPApprovalRequest: - type: object + - tool_name + - kwargs + title: InvokeToolRequest + description: Request model for invoking a tool. + JsonType: properties: - arguments: - type: string - id: - type: string - name: - type: string - server_label: - type: string type: type: string - const: mcp_approval_request - default: mcp_approval_request - additionalProperties: false - required: - - arguments - - id - - name - - server_label - - type - title: OpenAIResponseMCPApprovalRequest - description: >- - A request for human approval of a tool invocation. - OpenAIResponseMCPApprovalResponse: + const: json + title: Type + default: json type: object + title: JsonType + description: "Parameter type for JSON values.\n\n:param type: Discriminator type. Always \"json\"" + LLMAsJudgeScoringFnParams: properties: - approval_request_id: - type: string - approve: - type: boolean type: type: string - const: mcp_approval_response - default: mcp_approval_response - id: - type: string - reason: + const: llm_as_judge + title: Type + default: llm_as_judge + judge_model: type: string - additionalProperties: false - required: - - approval_request_id - - approve - - type - title: OpenAIResponseMCPApprovalResponse - description: A response to an MCP approval request. - OpenAIResponseMessage: + title: Judge Model + prompt_template: + anyOf: + - type: string + - type: 'null' + title: Prompt Template + judge_score_regexes: + items: + type: string + type: array + title: Judge Score Regexes + description: Regexes to extract the answer from generated response + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row type: object + required: + - judge_model + title: LLMAsJudgeScoringFnParams + description: Parameters for LLM-as-judge scoring function configuration. + LLMRAGQueryGeneratorConfig: properties: - content: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInputMessageContent' - - type: array - items: - $ref: '#/components/schemas/OpenAIResponseOutputMessageContent' - role: - oneOf: - - type: string - const: system - - type: string - const: developer - - type: string - const: user - - type: string - const: assistant type: type: string - const: message - default: message - id: + const: llm + title: Type + default: llm + model: type: string - status: + title: Model + template: type: string - additionalProperties: false - required: - - content - - role - - type - title: OpenAIResponseMessage - description: >- - Corresponds to the various Message types in the Responses API. They are all - under one type because the Responses API gives them all the same "type" value, - and there is no way to tell them apart in certain scenarios. - OpenAIResponseOutputMessageContent: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' - discriminator: - propertyName: type - mapping: - output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' - "OpenAIResponseOutputMessageContentOutputText": + title: Template type: object + required: + - model + - template + title: LLMRAGQueryGeneratorConfig + description: "Configuration for the LLM-based RAG query generator.\n\n:param type: Type of query generator, always 'llm'\n:param model: Name of the language model to use for query generation\n:param template: Template string for formatting the query generation prompt" + ListBatchesResponse: properties: - text: - type: string - type: + object: type: string - const: output_text - default: output_text - annotations: - type: array + const: list + title: Object + description: The object type, which is always 'list'. + default: list + data: items: - $ref: '#/components/schemas/OpenAIResponseAnnotations' - additionalProperties: false - required: - - text - - type - - annotations - title: >- - OpenAIResponseOutputMessageContentOutputText - "OpenAIResponseOutputMessageFileSearchToolCall": + $ref: '#/components/schemas/Batch' + type: array + title: Data + description: List of batch objects. + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + description: ID of the first batch in the list. + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + description: ID of the last batch in the list. + has_more: + type: boolean + title: Has More + description: Whether there are more batches available. + default: false type: object + required: + - data + title: ListBatchesResponse + description: Response containing a list of batch objects. + ListModelsResponse: properties: - id: - type: string - description: Unique identifier for this tool call - queries: - type: array + data: items: - type: string - description: List of search queries executed - status: - type: string - description: >- - Current status of the file search operation - type: - type: string - const: file_search_call - default: file_search_call - description: >- - Tool call type identifier, always "file_search_call" - results: + $ref: '#/components/schemas/Model' type: array - items: - type: object - properties: - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Key-value attributes associated with the file - file_id: - type: string - description: >- - Unique identifier of the file containing the result - filename: - type: string - description: Name of the file containing the result - score: - type: number - description: >- - Relevance score for this search result (between 0 and 1) - text: - type: string - description: Text content of the search result - additionalProperties: false - required: - - attributes - - file_id - - filename - - score - - text - title: >- - OpenAIResponseOutputMessageFileSearchToolCallResults - description: >- - Search results returned by the file search operation. - description: >- - (Optional) Search results returned by the file search operation - additionalProperties: false - required: - - id - - queries - - status - - type - title: >- - OpenAIResponseOutputMessageFileSearchToolCall - description: >- - File search tool call output message for OpenAI responses. - "OpenAIResponseOutputMessageFunctionToolCall": + title: Data + description: List of model resources. type: object + required: + - data + title: ListModelsResponse + description: Response model for listing models. + ListOpenAIChatCompletionResponse: properties: - call_id: - type: string - description: Unique identifier for the function call - name: - type: string - description: Name of the function being called - arguments: - type: string - description: >- - JSON string containing the function arguments - type: + data: + items: + $ref: '#/components/schemas/OpenAICompletionWithInputMessages' + type: array + title: Data + has_more: + type: boolean + title: Has More + first_id: type: string - const: function_call - default: function_call - description: >- - Tool call type identifier, always "function_call" - id: + title: First Id + last_id: type: string - description: >- - (Optional) Additional identifier for the tool call - status: + title: Last Id + object: type: string - description: >- - (Optional) Current status of the function call execution - additionalProperties: false - required: - - call_id - - name - - arguments - - type - title: >- - OpenAIResponseOutputMessageFunctionToolCall - description: >- - Function tool call output message for OpenAI responses. - OpenAIResponseOutputMessageMCPCall: + const: list + title: Object + default: list type: object + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIChatCompletionResponse + description: Response from listing OpenAI-compatible chat completions. + ListOpenAIFileResponse: properties: - id: - type: string - description: Unique identifier for this MCP call - type: - type: string - const: mcp_call - default: mcp_call - description: >- - Tool call type identifier, always "mcp_call" - arguments: - type: string - description: >- - JSON string containing the MCP call arguments - name: - type: string - description: Name of the MCP method being called - server_label: + data: + items: + $ref: '#/components/schemas/OpenAIFileObject' + type: array + title: Data + description: List of file objects. + has_more: + type: boolean + title: Has More + description: Whether there are more files available beyond this page. + first_id: type: string - description: >- - Label identifying the MCP server handling the call - error: + title: First Id + description: ID of the first file in the list for pagination. + last_id: type: string - description: >- - (Optional) Error message if the MCP call failed - output: + title: Last Id + description: ID of the last file in the list for pagination. + object: type: string - description: >- - (Optional) Output result from the successful MCP call - additionalProperties: false - required: - - id - - type - - arguments - - name - - server_label - title: OpenAIResponseOutputMessageMCPCall - description: >- - Model Context Protocol (MCP) call output message for OpenAI responses. - OpenAIResponseOutputMessageMCPListTools: + const: list + title: Object + description: The object type, which is always 'list'. + default: list type: object + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIFileResponse + description: Response for listing files in OpenAI Files API. + ListOpenAIResponseInputItem: properties: - id: - type: string - description: >- - Unique identifier for this MCP list tools operation - type: - type: string - const: mcp_list_tools - default: mcp_list_tools - description: >- - Tool call type identifier, always "mcp_list_tools" - server_label: - type: string - description: >- - Label identifying the MCP server providing the tools - tools: - type: array + data: items: - type: object - properties: - input_schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - JSON schema defining the tool's input parameters - name: - type: string - description: Name of the tool - description: - type: string - description: >- - (Optional) Description of what the tool does - additionalProperties: false - required: - - input_schema - - name - title: MCPListToolsTool - description: >- - Tool definition returned by MCP list tools operation. - description: >- - List of available tools provided by the MCP server - additionalProperties: false - required: - - id - - type - - server_label - - tools - title: OpenAIResponseOutputMessageMCPListTools - description: >- - MCP list tools output message containing available tools from an MCP server. - "OpenAIResponseOutputMessageWebSearchToolCall": + anyOf: + - oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + type: array + title: Data + description: List of input items + object: + type: string + const: list + title: Object + description: Object type identifier, always "list" + default: list type: object + required: + - data + title: ListOpenAIResponseInputItem + description: "List container for OpenAI response input items.\n\n:param data: List of input items\n:param object: Object type identifier, always \"list\"" + ListOpenAIResponseObject: properties: - id: + data: + items: + $ref: '#/components/schemas/OpenAIResponseObjectWithInput-Output' + type: array + title: Data + description: List of response objects with their input context + has_more: + type: boolean + title: Has More + description: Whether there are more results available beyond this page + first_id: type: string - description: Unique identifier for this tool call - status: + title: First Id + description: Identifier of the first item in this page + last_id: type: string - description: >- - Current status of the web search operation - type: + title: Last Id + description: Identifier of the last item in this page + object: type: string - const: web_search_call - default: web_search_call - description: >- - Tool call type identifier, always "web_search_call" - additionalProperties: false - required: - - id - - status - - type - title: >- - OpenAIResponseOutputMessageWebSearchToolCall - description: >- - Web search tool call output message for OpenAI responses. - CreateConversationRequest: + const: list + title: Object + description: Object type identifier, always "list" + default: list type: object + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIResponseObject + description: "Paginated list of OpenAI response objects with navigation metadata.\n\n:param data: List of response objects with their input context\n:param has_more: Whether there are more results available beyond this page\n:param first_id: Identifier of the first item in this page\n:param last_id: Identifier of the last item in this page\n:param object: Object type identifier, always \"list\"" + ListPromptsResponse: properties: - items: - type: array + data: items: - $ref: '#/components/schemas/ConversationItem' - description: >- - Initial items to include in the conversation context. - metadata: - type: object - additionalProperties: - type: string - description: >- - Set of key-value pairs that can be attached to an object. - additionalProperties: false - title: CreateConversationRequest - Conversation: + $ref: '#/components/schemas/Prompt' + type: array + title: Data + description: List of prompt resources. type: object + required: + - data + title: ListPromptsResponse + description: Response model to list prompts. + ListProvidersResponse: properties: - id: - type: string - object: - type: string - const: conversation - default: conversation - created_at: - type: integer - metadata: - type: object - additionalProperties: - type: string - items: - type: array + data: items: - type: object - title: dict - description: >- - dict() -> new empty dictionary dict(mapping) -> new dictionary initialized - from a mapping object's (key, value) pairs dict(iterable) -> new - dictionary initialized as if via: d = {} for k, v in iterable: d[k] - = v dict(**kwargs) -> new dictionary initialized with the name=value - pairs in the keyword argument list. For example: dict(one=1, two=2) - additionalProperties: false - required: - - id - - object - - created_at - title: Conversation - description: OpenAI-compatible conversation object. - UpdateConversationRequest: + $ref: '#/components/schemas/ProviderInfo' + type: array + title: Data + description: List of provider information objects type: object - properties: - metadata: - type: object - additionalProperties: - type: string - description: >- - Set of key-value pairs that can be attached to an object. - additionalProperties: false required: - - metadata - title: UpdateConversationRequest - ConversationDeletedResource: - type: object + - data + title: ListProvidersResponse + description: Response containing a list of all available providers. + ListRoutesResponse: properties: - id: - type: string - object: - type: string - default: conversation.deleted - deleted: - type: boolean - default: true - additionalProperties: false - required: - - id - - object - - deleted - title: ConversationDeletedResource - description: Response for deleted conversation. - ConversationItemList: + data: + items: + $ref: '#/components/schemas/RouteInfo' + type: array + title: Data + description: List of available route information objects type: object + required: + - data + title: ListRoutesResponse + description: Response containing a list of all available API routes. + ListScoringFunctionsResponse: properties: - object: - type: string - default: list data: - type: array items: - $ref: '#/components/schemas/ConversationItem' - first_id: - type: string - last_id: - type: string - has_more: - type: boolean - default: false - additionalProperties: false - required: - - object - - data - - has_more - title: ConversationItemList - description: >- - List of conversation items with pagination. - AddItemsRequest: + $ref: '#/components/schemas/ScoringFn' + type: array + title: Data + description: List of scoring function resources type: object + required: + - data + title: ListScoringFunctionsResponse + description: Response model for listing scoring functions. + ListShieldsResponse: properties: - items: - type: array + data: items: - $ref: '#/components/schemas/ConversationItem' - description: >- - Items to include in the conversation context. - additionalProperties: false - required: - - items - title: AddItemsRequest - ConversationItemDeletedResource: + $ref: '#/components/schemas/Shield' + type: array + title: Data + description: List of shield resources type: object + required: + - data + title: ListShieldsResponse + description: Response model for listing shields. + ListToolDefsResponse: properties: - id: - type: string - object: - type: string - default: conversation.item.deleted - deleted: - type: boolean - default: true - additionalProperties: false + data: + items: + $ref: '#/components/schemas/ToolDef' + type: array + title: Data + description: List of tool definitions + type: object required: - - id - - object - - deleted - title: ConversationItemDeletedResource - description: Response for deleted conversation item. - OpenAIEmbeddingsRequestWithExtraBody: + - data + title: ListToolDefsResponse + description: Response containing a list of tool definitions. + ListToolGroupsResponse: + properties: + data: + items: + $ref: '#/components/schemas/ToolGroup' + type: array + title: Data + description: List of tool groups type: object + required: + - data + title: ListToolGroupsResponse + description: Response containing a list of tool groups. + MCPListToolsTool: properties: - model: - type: string - description: >- - The identifier of the model to use. The model must be an embedding model - registered with Llama Stack and available via the /models endpoint. - input: - oneOf: - - type: string - - type: array - items: - type: string - description: >- - Input text to embed, encoded as a string or array of strings. To embed - multiple inputs in a single request, pass an array of strings. - encoding_format: + input_schema: + additionalProperties: true + type: object + title: Input Schema + description: JSON schema defining the tool's input parameters + name: type: string - default: float - description: >- - (Optional) The format to return the embeddings in. Can be either "float" - or "base64". Defaults to "float". - dimensions: - type: integer - description: >- - (Optional) The number of dimensions the resulting output embeddings should - have. Only supported in text-embedding-3 and later models. - user: - type: string - description: >- - (Optional) A unique identifier representing your end-user, which can help - OpenAI to monitor and detect abuse. - additionalProperties: false - required: - - model - - input - title: OpenAIEmbeddingsRequestWithExtraBody - description: >- - Request parameters for OpenAI-compatible embeddings endpoint. - OpenAIEmbeddingData: - type: object - properties: - object: - type: string - const: embedding - default: embedding - description: >- - The object type, which will be "embedding" - embedding: - oneOf: - - type: array - items: - type: number - - type: string - description: >- - The embedding vector as a list of floats (when encoding_format="float") - or as a base64-encoded string (when encoding_format="base64") - index: - type: integer - description: >- - The index of the embedding in the input list - additionalProperties: false - required: - - object - - embedding - - index - title: OpenAIEmbeddingData - description: >- - A single embedding data object from an OpenAI-compatible embeddings response. - OpenAIEmbeddingUsage: - type: object - properties: - prompt_tokens: - type: integer - description: The number of tokens in the input - total_tokens: - type: integer - description: The total number of tokens used - additionalProperties: false - required: - - prompt_tokens - - total_tokens - title: OpenAIEmbeddingUsage - description: >- - Usage information for an OpenAI-compatible embeddings response. - OpenAIEmbeddingsResponse: - type: object - properties: - object: - type: string - const: list - default: list - description: The object type, which will be "list" - data: - type: array - items: - $ref: '#/components/schemas/OpenAIEmbeddingData' - description: List of embedding data objects - model: - type: string - description: >- - The model that was used to generate the embeddings - usage: - $ref: '#/components/schemas/OpenAIEmbeddingUsage' - description: Usage information - additionalProperties: false - required: - - object - - data - - model - - usage - title: OpenAIEmbeddingsResponse - description: >- - Response from an OpenAI-compatible embeddings request. - OpenAIFilePurpose: - type: string - enum: - - assistants - - batch - title: OpenAIFilePurpose - description: >- - Valid purpose values for OpenAI Files API. - ListOpenAIFileResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAIFileObject' - description: List of file objects - has_more: - type: boolean - description: >- - Whether there are more files available beyond this page - first_id: - type: string - description: >- - ID of the first file in the list for pagination - last_id: - type: string - description: >- - ID of the last file in the list for pagination - object: - type: string - const: list - default: list - description: The object type, which is always "list" - additionalProperties: false - required: - - data - - has_more - - first_id - - last_id - - object - title: ListOpenAIFileResponse - description: >- - Response for listing files in OpenAI Files API. - OpenAIFileObject: - type: object - properties: - object: - type: string - const: file - default: file - description: The object type, which is always "file" - id: - type: string - description: >- - The file identifier, which can be referenced in the API endpoints - bytes: - type: integer - description: The size of the file, in bytes - created_at: - type: integer - description: >- - The Unix timestamp (in seconds) for when the file was created - expires_at: - type: integer - description: >- - The Unix timestamp (in seconds) for when the file expires - filename: - type: string - description: The name of the file - purpose: - type: string - enum: - - assistants - - batch - description: The intended purpose of the file - additionalProperties: false - required: - - object - - id - - bytes - - created_at - - expires_at - - filename - - purpose - title: OpenAIFileObject - description: >- - OpenAI File object as defined in the OpenAI Files API. - ExpiresAfter: - type: object - properties: - anchor: - type: string - const: created_at - seconds: - type: integer - additionalProperties: false - required: - - anchor - - seconds - title: ExpiresAfter - description: >- - Control expiration of uploaded files. - - Params: - - anchor, must be "created_at" - - seconds, must be int between 3600 and 2592000 (1 hour to 30 days) - OpenAIFileDeleteResponse: - type: object - properties: - id: - type: string - description: The file identifier that was deleted - object: - type: string - const: file - default: file - description: The object type, which is always "file" - deleted: - type: boolean - description: >- - Whether the file was successfully deleted - additionalProperties: false - required: - - id - - object - - deleted - title: OpenAIFileDeleteResponse - description: >- - Response for deleting a file in OpenAI Files API. - Response: - type: object - title: Response - HealthInfo: - type: object - properties: - status: - type: string - enum: - - OK - - Error - - Not Implemented - description: Current health status of the service - additionalProperties: false - required: - - status - title: HealthInfo - description: >- - Health status information for the service. - RouteInfo: - type: object - properties: - route: - type: string - description: The API endpoint path - method: - type: string - description: HTTP method for the route - provider_types: - type: array - items: - type: string - description: >- - List of provider types that implement this route - additionalProperties: false - required: - - route - - method - - provider_types - title: RouteInfo - description: >- - Information about an API route including its path, method, and implementing - providers. - ListRoutesResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/RouteInfo' - description: >- - List of available route information objects - additionalProperties: false - required: - - data - title: ListRoutesResponse - description: >- - Response containing a list of all available API routes. - OpenAIModel: - type: object - properties: - id: - type: string - object: - type: string - const: model - default: model - created: - type: integer - owned_by: - type: string - custom_metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - additionalProperties: false - required: - - id - - object - - created - - owned_by - title: OpenAIModel - description: A model from OpenAI. - OpenAIListModelsResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAIModel' - additionalProperties: false - required: - - data - title: OpenAIListModelsResponse - ModelType: - type: string - enum: - - llm - - embedding - - rerank - title: ModelType - description: >- - Enumeration of supported model types in Llama Stack. - RegisterModelRequest: + title: Name + description: Name of the tool + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Description of what the tool does type: object - properties: - model_id: - type: string - description: The identifier of the model to register. - provider_model_id: - type: string - description: >- - The identifier of the model in the provider. - provider_id: - type: string - description: The identifier of the provider. - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Any additional metadata for this model. - model_type: - $ref: '#/components/schemas/ModelType' - description: The type of model to register. - additionalProperties: false required: - - model_id - title: RegisterModelRequest + - input_schema + - name + title: MCPListToolsTool + description: "Tool definition returned by MCP list tools operation.\n\n:param input_schema: JSON schema defining the tool's input parameters\n:param name: Name of the tool\n:param description: (Optional) Description of what the tool does" Model: - type: object properties: identifier: type: string - description: >- - Unique identifier for this resource in llama stack + title: Identifier + description: Unique identifier for this resource in llama stack provider_resource_id: - type: string - description: >- - Unique identifier for this resource in the provider + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider provider_id: type: string - description: >- - ID of the provider that owns this resource + title: Provider Id + description: ID of the provider that owns this resource type: type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt const: model + title: Type + description: The resource type, always 'model' for model resources. default: model - description: >- - The resource type, always 'model' for model resources metadata: + additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Any additional metadata for this model + title: Metadata + description: Any additional metadata for this model. model_type: $ref: '#/components/schemas/ModelType' + description: The type of model (LLM or embedding model). default: llm - description: >- - The type of model (LLM or embedding model) - additionalProperties: false - required: - - identifier - - provider_id - - type - - metadata - - model_type - title: Model - description: >- - A model resource representing an AI model registered in Llama Stack. - RunModerationRequest: type: object - properties: - input: - oneOf: - - type: string - - type: array - items: - type: string - description: >- - Input (or inputs) to classify. Can be a single string, an array of strings, - or an array of multi-modal input objects similar to other models. - model: - type: string - description: >- - (Optional) The content moderation model you would like to use. - additionalProperties: false required: - - input - title: RunModerationRequest + - identifier + - provider_id + title: Model + description: A model resource representing an AI model registered in Llama Stack. + ModelType: + type: string + enum: + - llm + - embedding + - rerank + title: ModelType + description: Enumeration of supported model types in Llama Stack. ModerationObject: - type: object properties: id: type: string - description: >- - The unique identifier for the moderation request. + title: Id + description: The unique identifier for the moderation request. model: type: string - description: >- - The model used to generate the moderation results. + title: Model + description: The model used to generate the moderation results. results: - type: array items: $ref: '#/components/schemas/ModerationObjectResults' - description: A list of moderation objects - additionalProperties: false + type: array + title: Results + description: A list of moderation objects. + type: object required: - - id - - model - - results - title: ModerationObject - description: A moderation object. + - id + - model + - results + title: ModerationObject + description: A moderation object. ModerationObjectResults: - type: object properties: flagged: type: boolean - description: >- - Whether any of the below categories are flagged. + title: Flagged + description: Whether any of the below categories are flagged. categories: - type: object - additionalProperties: - type: boolean - description: >- - A list of the categories, and whether they are flagged or not. + anyOf: + - additionalProperties: + type: boolean + type: object + - type: 'null' + title: Categories + description: A list of the categories, and whether they are flagged or not. category_applied_input_types: - type: object - additionalProperties: - type: array - items: - type: string - description: >- - A list of the categories along with the input type(s) that the score applies - to. + anyOf: + - additionalProperties: + items: + type: string + type: array + type: object + - type: 'null' + title: Category Applied Input Types + description: A list of the categories along with the input type(s) that the score applies to. category_scores: - type: object - additionalProperties: - type: number - description: >- - A list of the categories along with their scores as predicted by model. + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Category Scores + description: A list of the categories along with their scores as predicted by model. user_message: - type: string + anyOf: + - type: string + - type: 'null' + title: User Message + description: User message. metadata: + additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - additionalProperties: false + title: Metadata + description: Additional metadata. + type: object required: - - flagged - - metadata + - flagged title: ModerationObjectResults description: A moderation object. - Prompt: - type: object + NumberType: properties: - prompt: - type: string - description: >- - The system prompt text with variable placeholders. Variables are only - supported when using the Responses API. - version: - type: integer - description: >- - Version (integer starting at 1, incremented on save) - prompt_id: + type: type: string - description: >- - Unique identifier formatted as 'pmpt_<48-digit-hash>' - variables: - type: array - items: - type: string - description: >- - List of prompt variable names that can be used in the prompt template - is_default: - type: boolean - default: false - description: >- - Boolean indicating whether this version is the default version for this - prompt - additionalProperties: false - required: - - version - - prompt_id - - variables - - is_default - title: Prompt - description: >- - A prompt resource representing a stored OpenAI Compatible prompt template - in Llama Stack. - ListPromptsResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/Prompt' - additionalProperties: false - required: - - data - title: ListPromptsResponse - description: Response model to list prompts. - CreatePromptRequest: + const: number + title: Type + default: number type: object + title: NumberType + description: "Parameter type for numeric values.\n\n:param type: Discriminator type. Always \"number\"" + ObjectType: properties: - prompt: + type: type: string - description: >- - The prompt text content with variable placeholders. - variables: - type: array - items: - type: string - description: >- - List of variable names that can be used in the prompt template. - additionalProperties: false - required: - - prompt - title: CreatePromptRequest - UpdatePromptRequest: + const: object + title: Type + default: object type: object + title: ObjectType + description: "Parameter type for object values.\n\n:param type: Discriminator type. Always \"object\"" + OpenAIAssistantMessageParam-Input: properties: - prompt: + role: type: string - description: The updated prompt text content. - version: - type: integer - description: >- - The current version of the prompt being updated. - variables: - type: array - items: - type: string - description: >- - Updated list of variable names that can be used in the prompt template. - set_as_default: - type: boolean - description: >- - Set the new version as the default (default=True). - additionalProperties: false - required: - - prompt - - version - - set_as_default - title: UpdatePromptRequest - SetDefaultVersionRequest: + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + - type: 'null' + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + title: Tool Calls type: object + title: OpenAIAssistantMessageParam + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. + OpenAIAssistantMessageParam-Output: properties: - version: - type: integer - description: The version to set as default. - additionalProperties: false - required: - - version - title: SetDefaultVersionRequest - ProviderInfo: + role: + type: string + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + - type: 'null' + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + title: Tool Calls type: object + title: OpenAIAssistantMessageParam + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. + OpenAIChatCompletionContentPartImageParam: properties: - api: - type: string - description: The API name this provider implements - provider_id: - type: string - description: Unique identifier for the provider - provider_type: + type: type: string - description: The type of provider implementation - config: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Configuration parameters for the provider - health: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Current health status of the provider - additionalProperties: false - required: - - api - - provider_id - - provider_type - - config - - health - title: ProviderInfo - description: >- - Information about a registered provider including its configuration and health - status. - ListProvidersResponse: + const: image_url + title: Type + default: image_url + image_url: + $ref: '#/components/schemas/OpenAIImageURL' type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/ProviderInfo' - description: List of provider information objects - additionalProperties: false required: - - data - title: ListProvidersResponse - description: >- - Response containing a list of all available providers. - ListOpenAIResponseObject: - type: object + - image_url + title: OpenAIChatCompletionContentPartImageParam + description: Image content part for OpenAI-compatible chat completion messages. + OpenAIChatCompletionContentPartTextParam: properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseObjectWithInput' - description: >- - List of response objects with their input context - has_more: - type: boolean - description: >- - Whether there are more results available beyond this page - first_id: - type: string - description: >- - Identifier of the first item in this page - last_id: + type: type: string - description: Identifier of the last item in this page - object: + const: text + title: Type + default: text + text: type: string - const: list - default: list - description: Object type identifier, always "list" - additionalProperties: false - required: - - data - - has_more - - first_id - - last_id - - object - title: ListOpenAIResponseObject - description: >- - Paginated list of OpenAI response objects with navigation metadata. - OpenAIResponseError: + title: Text type: object - properties: - code: - type: string - description: >- - Error code identifying the type of failure - message: - type: string - description: >- - Human-readable error message describing the failure - additionalProperties: false required: - - code - - message - title: OpenAIResponseError - description: >- - Error details for failed OpenAI response requests. - OpenAIResponseInput: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutput' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseMessage' - OpenAIResponseInputToolFileSearch: - type: object + - text + title: OpenAIChatCompletionContentPartTextParam + description: Text content part for OpenAI-compatible chat completion messages. + OpenAIChatCompletionRequestWithExtraBody: properties: - type: + model: type: string - const: file_search - default: file_search - description: >- - Tool type identifier, always "file_search" - vector_store_ids: - type: array + title: Model + messages: items: - type: string - description: >- - List of vector store identifiers to search within - filters: - type: object - additionalProperties: oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional filters to apply to the search - max_num_results: - type: integer - default: 10 - description: >- - (Optional) Maximum number of search results to return (1-50) - ranking_options: - type: object - properties: - ranker: - type: string - description: >- - (Optional) Name of the ranking algorithm to use - score_threshold: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Input' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Input' + type: array + minItems: 1 + title: Messages + frequency_penalty: + anyOf: + - type: number + - type: 'null' + title: Frequency Penalty + function_call: + anyOf: + - type: string + - additionalProperties: true + type: object + - type: 'null' + title: Function Call + functions: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Functions + logit_bias: + anyOf: + - additionalProperties: type: number - default: 0.0 - description: >- - (Optional) Minimum relevance score threshold for results - additionalProperties: false - description: >- - (Optional) Options for ranking and scoring search results - additionalProperties: false - required: - - type - - vector_store_ids - title: OpenAIResponseInputToolFileSearch - description: >- - File search tool configuration for OpenAI response inputs. - OpenAIResponseInputToolFunction: + type: object + - type: 'null' + title: Logit Bias + logprobs: + anyOf: + - type: boolean + - type: 'null' + title: Logprobs + max_completion_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Completion Tokens + max_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Tokens + n: + anyOf: + - type: integer + - type: 'null' + title: N + parallel_tool_calls: + anyOf: + - type: boolean + - type: 'null' + title: Parallel Tool Calls + presence_penalty: + anyOf: + - type: number + - type: 'null' + title: Presence Penalty + response_format: + anyOf: + - oneOf: + - $ref: '#/components/schemas/OpenAIResponseFormatText' + - $ref: '#/components/schemas/OpenAIResponseFormatJSONSchema' + - $ref: '#/components/schemas/OpenAIResponseFormatJSONObject' + discriminator: + propertyName: type + mapping: + json_object: '#/components/schemas/OpenAIResponseFormatJSONObject' + json_schema: '#/components/schemas/OpenAIResponseFormatJSONSchema' + text: '#/components/schemas/OpenAIResponseFormatText' + - type: 'null' + title: Response Format + seed: + anyOf: + - type: integer + - type: 'null' + title: Seed + stop: + anyOf: + - type: string + - items: + type: string + type: array + - type: 'null' + title: Stop + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + stream_options: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Stream Options + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + tool_choice: + anyOf: + - type: string + - additionalProperties: true + type: object + - type: 'null' + title: Tool Choice + tools: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Tools + top_logprobs: + anyOf: + - type: integer + - type: 'null' + title: Top Logprobs + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + user: + anyOf: + - type: string + - type: 'null' + title: User + additionalProperties: true type: object + required: + - model + - messages + title: OpenAIChatCompletionRequestWithExtraBody + description: Request parameters for OpenAI-compatible chat completion endpoint. + OpenAIChatCompletionToolCall: properties: + index: + anyOf: + - type: integer + - type: 'null' + title: Index + id: + anyOf: + - type: string + - type: 'null' + title: Id type: type: string const: function + title: Type default: function - description: Tool type identifier, always "function" + function: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' + - type: 'null' + type: object + title: OpenAIChatCompletionToolCall + description: Tool call specification for OpenAI-compatible chat completion responses. + OpenAIChatCompletionToolCallFunction: + properties: name: - type: string - description: Name of the function that can be called - description: - type: string - description: >- - (Optional) Description of what the function does - parameters: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON schema defining the function's parameters - strict: - type: boolean - description: >- - (Optional) Whether to enforce strict parameter validation - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: Name + arguments: + anyOf: + - type: string + - type: 'null' + title: Arguments + type: object + title: OpenAIChatCompletionToolCallFunction + description: Function call details for OpenAI-compatible tool calls. + OpenAIChatCompletionUsage: + properties: + prompt_tokens: + type: integer + title: Prompt Tokens + completion_tokens: + type: integer + title: Completion Tokens + total_tokens: + type: integer + title: Total Tokens + prompt_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails' + - type: 'null' + completion_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails' + - type: 'null' + type: object required: - - type - - name - title: OpenAIResponseInputToolFunction - description: >- - Function tool configuration for OpenAI response inputs. - OpenAIResponseInputToolWebSearch: + - prompt_tokens + - completion_tokens + - total_tokens + title: OpenAIChatCompletionUsage + description: Usage information for OpenAI chat completion. + OpenAIChatCompletionUsageCompletionTokensDetails: + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens type: object + title: OpenAIChatCompletionUsageCompletionTokensDetails + description: Token details for output tokens in OpenAI chat completion usage. + OpenAIChatCompletionUsagePromptTokensDetails: properties: - type: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens + type: object + title: OpenAIChatCompletionUsagePromptTokensDetails + description: Token details for prompt tokens in OpenAI chat completion usage. + OpenAIChoice-Output: + properties: + message: oneOf: - - type: string - const: web_search - - type: string - const: web_search_preview - - type: string - const: web_search_preview_2025_03_11 - default: web_search - description: Web search tool type variant to use - search_context_size: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Output' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Output' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Message + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Output' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Output' + finish_reason: type: string - default: medium - description: >- - (Optional) Size of search context, must be "low", "medium", or "high" - additionalProperties: false + title: Finish Reason + index: + type: integer + title: Index + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + - type: 'null' + type: object required: - - type - title: OpenAIResponseInputToolWebSearch - description: >- - Web search tool configuration for OpenAI response inputs. - OpenAIResponseObjectWithInput: + - message + - finish_reason + - index + title: OpenAIChoice + description: A choice from an OpenAI-compatible chat completion response. + OpenAIChoiceLogprobs-Output: + properties: + content: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + title: Content + refusal: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + title: Refusal type: object + title: OpenAIChoiceLogprobs + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. + OpenAICompletion: properties: - created_at: - type: integer - description: >- - Unix timestamp when the response was created - error: - $ref: '#/components/schemas/OpenAIResponseError' - description: >- - (Optional) Error details if the response generation failed id: type: string - description: Unique identifier for this response + title: Id + choices: + items: + $ref: '#/components/schemas/OpenAICompletionChoice-Output' + type: array + title: Choices + created: + type: integer + title: Created model: type: string - description: Model identifier used for generation + title: Model object: type: string - const: response - default: response - description: >- - Object type identifier, always "response" - output: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseOutput' - description: >- - List of generated output items (messages, tool calls, etc.) - parallel_tool_calls: - type: boolean - default: false - description: >- - Whether tool calls can be executed in parallel - previous_response_id: - type: string - description: >- - (Optional) ID of the previous response in a conversation - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - description: >- - (Optional) Reference to a prompt template and its variables. - status: - type: string - description: >- - Current status of the response generation - temperature: - type: number - description: >- - (Optional) Sampling temperature used for generation - text: - $ref: '#/components/schemas/OpenAIResponseText' - description: >- - Text formatting configuration for the response - top_p: - type: number - description: >- - (Optional) Nucleus sampling parameter used for generation - tools: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseTool' - description: >- - (Optional) An array of tools the model may call while generating a response. - truncation: - type: string - description: >- - (Optional) Truncation strategy applied to the response - usage: - $ref: '#/components/schemas/OpenAIResponseUsage' - description: >- - (Optional) Token usage information for the response - instructions: - type: string - description: >- - (Optional) System message inserted into the model's context - input: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInput' - description: >- - List of input items that led to this response - additionalProperties: false - required: - - created_at - - id - - model - - object - - output - - parallel_tool_calls - - status - - text - - input - title: OpenAIResponseObjectWithInput - description: >- - OpenAI response object extended with input context information. - OpenAIResponseOutput: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - OpenAIResponsePrompt: + const: text_completion + title: Object + default: text_completion type: object - properties: - id: - type: string - description: Unique identifier of the prompt template - variables: - type: object - additionalProperties: - $ref: '#/components/schemas/OpenAIResponseInputMessageContent' - description: >- - Dictionary of variable names to OpenAIResponseInputMessageContent structure - for template substitution. The substitution values can either be strings, - or other Response input types like images or files. - version: - type: string - description: >- - Version number of the prompt to use (defaults to latest if not specified) - additionalProperties: false required: - - id - title: OpenAIResponsePrompt - description: >- - OpenAI compatible Prompt object that is used in OpenAI responses. - OpenAIResponseText: - type: object - properties: - format: - type: object - properties: - type: - oneOf: - - type: string - const: text - - type: string - const: json_schema - - type: string - const: json_object - description: >- - Must be "text", "json_schema", or "json_object" to identify the format - type - name: - type: string - description: >- - The name of the response format. Only used for json_schema. - schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The JSON schema the response should conform to. In a Python SDK, this - is often a `pydantic` model. Only used for json_schema. - description: - type: string - description: >- - (Optional) A description of the response format. Only used for json_schema. - strict: - type: boolean - description: >- - (Optional) Whether to strictly enforce the JSON schema. If true, the - response must match the schema exactly. Only used for json_schema. - additionalProperties: false - required: - - type - description: >- - (Optional) Text format configuration specifying output format requirements - additionalProperties: false - title: OpenAIResponseText - description: >- - Text response configuration for OpenAI responses. - OpenAIResponseTool: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseToolMCP' - discriminator: - propertyName: type - mapping: - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseToolMCP' - OpenAIResponseToolMCP: - type: object + - id + - choices + - created + - model + title: OpenAICompletion + description: "Response from an OpenAI-compatible completion request.\n\n:id: The ID of the completion\n:choices: List of choices\n:created: The Unix timestamp in seconds when the completion was created\n:model: The model that was used to generate the completion\n:object: The object type, which will be \"text_completion\"" + OpenAICompletionChoice-Output: properties: - type: + finish_reason: type: string - const: mcp - default: mcp - description: Tool type identifier, always "mcp" - server_label: + title: Finish Reason + text: type: string - description: Label to identify this MCP server - allowed_tools: - oneOf: - - type: array - items: - type: string - - type: object - properties: - tool_names: - type: array - items: - type: string - description: >- - (Optional) List of specific tool names that are allowed - additionalProperties: false - title: AllowedToolsFilter - description: >- - Filter configuration for restricting which MCP tools can be used. - description: >- - (Optional) Restriction on which tools can be used from this server - additionalProperties: false - required: - - type - - server_label - title: OpenAIResponseToolMCP - description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response object. - OpenAIResponseUsage: - type: object - properties: - input_tokens: - type: integer - description: Number of tokens in the input - output_tokens: - type: integer - description: Number of tokens in the output - total_tokens: + title: Text + index: type: integer - description: Total tokens used (input + output) - input_tokens_details: - type: object - properties: - cached_tokens: - type: integer - description: Number of tokens retrieved from cache - additionalProperties: false - description: Detailed breakdown of input token usage - output_tokens_details: - type: object - properties: - reasoning_tokens: - type: integer - description: >- - Number of tokens used for reasoning (o1/o3 models) - additionalProperties: false - description: Detailed breakdown of output token usage - additionalProperties: false - required: - - input_tokens - - output_tokens - - total_tokens - title: OpenAIResponseUsage - description: Usage information for OpenAI response. - ResponseGuardrailSpec: + title: Index + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + - type: 'null' type: object - properties: - type: - type: string - description: The type/identifier of the guardrail. - additionalProperties: false required: - - type - title: ResponseGuardrailSpec - description: >- - Specification for a guardrail to apply during response generation. - OpenAIResponseInputTool: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' - discriminator: - propertyName: type - mapping: - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseInputToolMCP' - OpenAIResponseInputToolMCP: - type: object - properties: - type: - type: string - const: mcp - default: mcp - description: Tool type identifier, always "mcp" - server_label: - type: string - description: Label to identify this MCP server - server_url: - type: string - description: URL endpoint of the MCP server - headers: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) HTTP headers to include when connecting to the server - require_approval: - oneOf: - - type: string - const: always - - type: string - const: never - - type: object - properties: - always: - type: array - items: - type: string - description: >- - (Optional) List of tool names that always require approval - never: - type: array - items: - type: string - description: >- - (Optional) List of tool names that never require approval - additionalProperties: false - title: ApprovalFilter - description: >- - Filter configuration for MCP tool approval requirements. - default: never - description: >- - Approval requirement for tool calls ("always", "never", or filter) - allowed_tools: - oneOf: - - type: array - items: - type: string - - type: object - properties: - tool_names: - type: array - items: - type: string - description: >- - (Optional) List of specific tool names that are allowed - additionalProperties: false - title: AllowedToolsFilter - description: >- - Filter configuration for restricting which MCP tools can be used. - description: >- - (Optional) Restriction on which tools can be used from this server - additionalProperties: false - required: - - type - - server_label - - server_url - - require_approval - title: OpenAIResponseInputToolMCP - description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response inputs. - CreateOpenaiResponseRequest: - type: object + - finish_reason + - text + - index + title: OpenAICompletionChoice + description: "A choice from an OpenAI-compatible completion response.\n\n:finish_reason: The reason the model stopped generating\n:text: The text of the choice\n:index: The index of the choice\n:logprobs: (Optional) The log probabilities for the tokens in the choice" + OpenAICompletionRequestWithExtraBody: properties: - input: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInput' - description: Input message(s) to create the response. model: type: string - description: The underlying LLM used for completions. + title: Model prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - description: >- - (Optional) Prompt object with ID, version, and variables. - instructions: - type: string - previous_response_id: - type: string - description: >- - (Optional) if specified, the new response will be a continuation of the - previous response. This can be used to easily fork-off new responses from - existing responses. - conversation: - type: string - description: >- - (Optional) The ID of a conversation to add the response to. Must begin - with 'conv_'. Input and output messages will be automatically added to - the conversation. - store: - type: boolean + anyOf: + - type: string + - items: + type: string + type: array + - items: + type: integer + type: array + - items: + items: + type: integer + type: array + type: array + title: Prompt + best_of: + anyOf: + - type: integer + - type: 'null' + title: Best Of + echo: + anyOf: + - type: boolean + - type: 'null' + title: Echo + frequency_penalty: + anyOf: + - type: number + - type: 'null' + title: Frequency Penalty + logit_bias: + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Logit Bias + logprobs: + anyOf: + - type: integer + maximum: 5.0 + minimum: 0.0 + - type: 'null' + title: Logprobs + max_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Tokens + n: + anyOf: + - type: integer + - type: 'null' + title: N + presence_penalty: + anyOf: + - type: number + - type: 'null' + title: Presence Penalty + seed: + anyOf: + - type: integer + - type: 'null' + title: Seed + stop: + anyOf: + - type: string + - items: + type: string + type: array + - type: 'null' + title: Stop stream: - type: boolean + anyOf: + - type: boolean + - type: 'null' + title: Stream + stream_options: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Stream Options temperature: - type: number - text: - $ref: '#/components/schemas/OpenAIResponseText' - tools: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInputTool' - include: - type: array - items: - type: string - description: >- - (Optional) Additional fields to include in the response. - max_infer_iters: - type: integer - additionalProperties: false - required: - - input - - model - title: CreateOpenaiResponseRequest - OpenAIResponseObject: + anyOf: + - type: number + - type: 'null' + title: Temperature + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + user: + anyOf: + - type: string + - type: 'null' + title: User + suffix: + anyOf: + - type: string + - type: 'null' + title: Suffix + additionalProperties: true type: object + required: + - model + - prompt + title: OpenAICompletionRequestWithExtraBody + description: Request parameters for OpenAI-compatible completion endpoint. + OpenAICompletionWithInputMessages: properties: - created_at: - type: integer - description: >- - Unix timestamp when the response was created - error: - $ref: '#/components/schemas/OpenAIResponseError' - description: >- - (Optional) Error details if the response generation failed id: type: string - description: Unique identifier for this response - model: - type: string - description: Model identifier used for generation - object: - type: string - const: response - default: response - description: >- - Object type identifier, always "response" - output: - type: array + title: Id + choices: items: - $ref: '#/components/schemas/OpenAIResponseOutput' - description: >- - List of generated output items (messages, tool calls, etc.) - parallel_tool_calls: - type: boolean - default: false - description: >- - Whether tool calls can be executed in parallel - previous_response_id: - type: string - description: >- - (Optional) ID of the previous response in a conversation - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - description: >- - (Optional) Reference to a prompt template and its variables. - status: - type: string - description: >- - Current status of the response generation - temperature: - type: number - description: >- - (Optional) Sampling temperature used for generation - text: - $ref: '#/components/schemas/OpenAIResponseText' - description: >- - Text formatting configuration for the response - top_p: - type: number - description: >- - (Optional) Nucleus sampling parameter used for generation - tools: + $ref: '#/components/schemas/OpenAIChoice-Output' type: array - items: - $ref: '#/components/schemas/OpenAIResponseTool' - description: >- - (Optional) An array of tools the model may call while generating a response. - truncation: + title: Choices + object: type: string - description: >- - (Optional) Truncation strategy applied to the response - usage: - $ref: '#/components/schemas/OpenAIResponseUsage' - description: >- - (Optional) Token usage information for the response - instructions: + const: chat.completion + title: Object + default: chat.completion + created: + type: integer + title: Created + model: type: string - description: >- - (Optional) System message inserted into the model's context - additionalProperties: false - required: - - created_at - - id - - model - - object - - output - - parallel_tool_calls - - status - - text - title: OpenAIResponseObject - description: >- - Complete OpenAI response object containing generation results and metadata. - OpenAIResponseContentPartOutputText: + title: Model + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsage' + - type: 'null' + input_messages: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Output' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Output' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Output' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Output' + type: array + title: Input Messages type: object + required: + - id + - choices + - created + - model + - input_messages + title: OpenAICompletionWithInputMessages + OpenAICreateVectorStoreFileBatchRequestWithExtraBody: properties: - type: - type: string - const: output_text - default: output_text - description: >- - Content part type identifier, always "output_text" - text: - type: string - description: Text emitted for this content part - annotations: - type: array + file_ids: items: - $ref: '#/components/schemas/OpenAIResponseAnnotations' - description: >- - Structured annotations associated with the text - logprobs: + type: string type: array - items: + title: File Ids + attributes: + anyOf: + - additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) Token log probability details - additionalProperties: false - required: - - type - - text - - annotations - title: OpenAIResponseContentPartOutputText - description: >- - Text content within a streamed response part. - "OpenAIResponseContentPartReasoningSummary": + - type: 'null' + title: Attributes + chunking_strategy: + anyOf: + - oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + - type: 'null' + title: Chunking Strategy + additionalProperties: true type: object - properties: - type: - type: string - const: summary_text - default: summary_text - description: >- - Content part type identifier, always "summary_text" - text: - type: string - description: Summary text - additionalProperties: false required: - - type - - text - title: >- - OpenAIResponseContentPartReasoningSummary - description: >- - Reasoning summary part in a streamed response. - OpenAIResponseContentPartReasoningText: - type: object + - file_ids + title: OpenAICreateVectorStoreFileBatchRequestWithExtraBody + description: Request to create a vector store file batch with extra_body support. + OpenAICreateVectorStoreRequestWithExtraBody: properties: - type: - type: string - const: reasoning_text - default: reasoning_text - description: >- - Content part type identifier, always "reasoning_text" - text: - type: string - description: Reasoning text supplied by the model - additionalProperties: false - required: - - type - - text - title: OpenAIResponseContentPartReasoningText - description: >- - Reasoning text emitted as part of a streamed response. - OpenAIResponseObjectStream: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseCreated' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseInProgress' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputItemAdded' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputItemDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallInProgress' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallSearching' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallCompleted' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsInProgress' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsFailed' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsCompleted' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallArgumentsDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallInProgress' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallFailed' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed' - - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted' - discriminator: - propertyName: type - mapping: - response.created: '#/components/schemas/OpenAIResponseObjectStreamResponseCreated' - response.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseInProgress' - response.output_item.added: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputItemAdded' - response.output_item.done: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputItemDone' - response.output_text.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextDelta' - response.output_text.done: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextDone' - response.function_call_arguments.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta' - response.function_call_arguments.done: '#/components/schemas/OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone' - response.web_search_call.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallInProgress' - response.web_search_call.searching: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallSearching' - response.web_search_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseWebSearchCallCompleted' - response.mcp_list_tools.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsInProgress' - response.mcp_list_tools.failed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsFailed' - response.mcp_list_tools.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpListToolsCompleted' - response.mcp_call.arguments.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta' - response.mcp_call.arguments.done: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallArgumentsDone' - response.mcp_call.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallInProgress' - response.mcp_call.failed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallFailed' - response.mcp_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted' - response.content_part.added: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded' - response.content_part.done: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone' - response.reasoning_text.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta' - response.reasoning_text.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone' - response.reasoning_summary_part.added: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded' - response.reasoning_summary_part.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone' - response.reasoning_summary_text.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta' - response.reasoning_summary_text.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone' - response.refusal.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta' - response.refusal.done: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone' - response.output_text.annotation.added: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded' - response.file_search_call.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress' - response.file_search_call.searching: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching' - response.file_search_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted' - response.incomplete: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete' - response.failed: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed' - response.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted' - "OpenAIResponseObjectStreamResponseCompleted": - type: object - properties: - response: - $ref: '#/components/schemas/OpenAIResponseObject' - description: Completed response object - type: - type: string - const: response.completed - default: response.completed - description: >- - Event type identifier, always "response.completed" - additionalProperties: false - required: - - response - - type - title: >- - OpenAIResponseObjectStreamResponseCompleted - description: >- - Streaming event indicating a response has been completed. - "OpenAIResponseObjectStreamResponseContentPartAdded": + name: + anyOf: + - type: string + - type: 'null' + title: Name + file_ids: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: File Ids + expires_after: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After + chunking_strategy: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Chunking Strategy + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + additionalProperties: true type: object + title: OpenAICreateVectorStoreRequestWithExtraBody + description: Request to create a vector store with extra_body support. + OpenAIDeleteResponseObject: properties: - content_index: - type: integer - description: >- - Index position of the part within the content array - response_id: - type: string - description: >- - Unique identifier of the response containing this content - item_id: - type: string - description: >- - Unique identifier of the output item containing this content part - output_index: - type: integer - description: >- - Index position of the output item in the response - part: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseContentPartOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' - - $ref: '#/components/schemas/OpenAIResponseContentPartReasoningText' - discriminator: - propertyName: type - mapping: - output_text: '#/components/schemas/OpenAIResponseContentPartOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' - reasoning_text: '#/components/schemas/OpenAIResponseContentPartReasoningText' - description: The content part that was added - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.content_part.added - default: response.content_part.added - description: >- - Event type identifier, always "response.content_part.added" - additionalProperties: false - required: - - content_index - - response_id - - item_id - - output_index - - part - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseContentPartAdded - description: >- - Streaming event for when a new content part is added to a response item. - "OpenAIResponseObjectStreamResponseContentPartDone": - type: object - properties: - content_index: - type: integer - description: >- - Index position of the part within the content array - response_id: - type: string - description: >- - Unique identifier of the response containing this content - item_id: - type: string - description: >- - Unique identifier of the output item containing this content part - output_index: - type: integer - description: >- - Index position of the output item in the response - part: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseContentPartOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' - - $ref: '#/components/schemas/OpenAIResponseContentPartReasoningText' - discriminator: - propertyName: type - mapping: - output_text: '#/components/schemas/OpenAIResponseContentPartOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' - reasoning_text: '#/components/schemas/OpenAIResponseContentPartReasoningText' - description: The completed content part - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.content_part.done - default: response.content_part.done - description: >- - Event type identifier, always "response.content_part.done" - additionalProperties: false - required: - - content_index - - response_id - - item_id - - output_index - - part - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseContentPartDone - description: >- - Streaming event for when a content part is completed. - "OpenAIResponseObjectStreamResponseCreated": - type: object - properties: - response: - $ref: '#/components/schemas/OpenAIResponseObject' - description: The response object that was created - type: + id: type: string - const: response.created - default: response.created - description: >- - Event type identifier, always "response.created" - additionalProperties: false - required: - - response - - type - title: >- - OpenAIResponseObjectStreamResponseCreated - description: >- - Streaming event indicating a new response has been created. - OpenAIResponseObjectStreamResponseFailed: - type: object - properties: - response: - $ref: '#/components/schemas/OpenAIResponseObject' - description: Response object describing the failure - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: + title: Id + description: Unique identifier of the deleted response + object: type: string - const: response.failed - default: response.failed - description: >- - Event type identifier, always "response.failed" - additionalProperties: false - required: - - response - - sequence_number - - type - title: OpenAIResponseObjectStreamResponseFailed - description: >- - Streaming event emitted when a response fails. - "OpenAIResponseObjectStreamResponseFileSearchCallCompleted": + const: response + title: Object + description: Object type identifier, always "response" + default: response + deleted: + type: boolean + title: Deleted + description: Deletion confirmation flag, always True + default: true type: object - properties: - item_id: - type: string - description: >- - Unique identifier of the completed file search call - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.file_search_call.completed - default: response.file_search_call.completed - description: >- - Event type identifier, always "response.file_search_call.completed" - additionalProperties: false required: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseFileSearchCallCompleted - description: >- - Streaming event for completed file search calls. - "OpenAIResponseObjectStreamResponseFileSearchCallInProgress": - type: object + - id + title: OpenAIDeleteResponseObject + description: "Response object confirming deletion of an OpenAI response.\n\n:param id: Unique identifier of the deleted response\n:param object: Object type identifier, always \"response\"\n:param deleted: Deletion confirmation flag, always True" + OpenAIDeveloperMessageParam: properties: - item_id: - type: string - description: >- - Unique identifier of the file search call - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: + role: type: string - const: response.file_search_call.in_progress - default: response.file_search_call.in_progress - description: >- - Event type identifier, always "response.file_search_call.in_progress" - additionalProperties: false - required: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseFileSearchCallInProgress - description: >- - Streaming event for file search calls in progress. - "OpenAIResponseObjectStreamResponseFileSearchCallSearching": + const: developer + title: Role + default: developer + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name type: object + required: + - content + title: OpenAIDeveloperMessageParam + description: A message from the developer in an OpenAI-compatible chat completion request. + OpenAIEmbeddingData: properties: - item_id: + object: type: string - description: >- - Unique identifier of the file search call - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: + const: embedding + title: Object + default: embedding + embedding: + anyOf: + - items: + type: number + type: array + - type: string + title: Embedding + index: type: integer - description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.file_search_call.searching - default: response.file_search_call.searching - description: >- - Event type identifier, always "response.file_search_call.searching" - additionalProperties: false - required: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseFileSearchCallSearching - description: >- - Streaming event for file search currently searching. - "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": + title: Index type: object + required: + - embedding + - index + title: OpenAIEmbeddingData + description: A single embedding data object from an OpenAI-compatible embeddings response. + OpenAIEmbeddingUsage: properties: - delta: - type: string - description: >- - Incremental function call arguments being added - item_id: - type: string - description: >- - Unique identifier of the function call being updated - output_index: + prompt_tokens: type: integer - description: >- - Index position of the item in the output list - sequence_number: + title: Prompt Tokens + total_tokens: type: integer - description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.function_call_arguments.delta - default: response.function_call_arguments.delta - description: >- - Event type identifier, always "response.function_call_arguments.delta" - additionalProperties: false - required: - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta - description: >- - Streaming event for incremental function call argument updates. - "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone": + title: Total Tokens type: object + required: + - prompt_tokens + - total_tokens + title: OpenAIEmbeddingUsage + description: Usage information for an OpenAI-compatible embeddings response. + OpenAIEmbeddingsRequestWithExtraBody: properties: - arguments: - type: string - description: >- - Final complete arguments JSON string for the function call - item_id: - type: string - description: >- - Unique identifier of the completed function call - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.function_call_arguments.done - default: response.function_call_arguments.done - description: >- - Event type identifier, always "response.function_call_arguments.done" - additionalProperties: false - required: - - arguments - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone - description: >- - Streaming event for when function call arguments are completed. - "OpenAIResponseObjectStreamResponseInProgress": - type: object - properties: - response: - $ref: '#/components/schemas/OpenAIResponseObject' - description: Current response state while in progress - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: + model: type: string - const: response.in_progress - default: response.in_progress - description: >- - Event type identifier, always "response.in_progress" - additionalProperties: false - required: - - response - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseInProgress - description: >- - Streaming event indicating the response remains in progress. - "OpenAIResponseObjectStreamResponseIncomplete": - type: object - properties: - response: - $ref: '#/components/schemas/OpenAIResponseObject' - description: >- - Response object describing the incomplete state - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.incomplete - default: response.incomplete - description: >- - Event type identifier, always "response.incomplete" - additionalProperties: false - required: - - response - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseIncomplete - description: >- - Streaming event emitted when a response ends in an incomplete state. - "OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta": + title: Model + input: + anyOf: + - type: string + - items: + type: string + type: array + title: Input + encoding_format: + anyOf: + - type: string + - type: 'null' + title: Encoding Format + default: float + dimensions: + anyOf: + - type: integer + - type: 'null' + title: Dimensions + user: + anyOf: + - type: string + - type: 'null' + title: User + additionalProperties: true type: object + required: + - model + - input + title: OpenAIEmbeddingsRequestWithExtraBody + description: Request parameters for OpenAI-compatible embeddings endpoint. + OpenAIEmbeddingsResponse: properties: - delta: + object: type: string - item_id: + const: list + title: Object + default: list + data: + items: + $ref: '#/components/schemas/OpenAIEmbeddingData' + type: array + title: Data + model: type: string - output_index: - type: integer - sequence_number: - type: integer + title: Model + usage: + $ref: '#/components/schemas/OpenAIEmbeddingUsage' + type: object + required: + - data + - model + - usage + title: OpenAIEmbeddingsResponse + description: Response from an OpenAI-compatible embeddings request. + OpenAIFile: + properties: type: type: string - const: response.mcp_call.arguments.delta - default: response.mcp_call.arguments.delta - additionalProperties: false + const: file + title: Type + default: file + file: + $ref: '#/components/schemas/OpenAIFileFile' + type: object + required: + - file + title: OpenAIFile + OpenAIFileDeleteResponse: + properties: + id: + type: string + title: Id + description: The file identifier that was deleted. + object: + type: string + const: file + title: Object + description: The object type, which is always 'file'. + default: file + deleted: + type: boolean + title: Deleted + description: Whether the file was successfully deleted. + type: object required: - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta - "OpenAIResponseObjectStreamResponseMcpCallArgumentsDone": + - id + - deleted + title: OpenAIFileDeleteResponse + description: Response for deleting a file in OpenAI Files API. + OpenAIFileFile: + properties: + file_id: + anyOf: + - type: string + - type: 'null' + title: File Id + filename: + anyOf: + - type: string + - type: 'null' + title: Filename type: object + title: OpenAIFileFile + OpenAIFileObject: properties: - arguments: + object: type: string - item_id: + const: file + title: Object + description: The object type, which is always 'file'. + default: file + id: type: string - output_index: + title: Id + description: The file identifier, which can be referenced in the API endpoints. + bytes: + type: integer + title: Bytes + description: The size of the file, in bytes. + created_at: type: integer - sequence_number: + title: Created At + description: The Unix timestamp (in seconds) for when the file was created. + expires_at: type: integer - type: + title: Expires At + description: The Unix timestamp (in seconds) for when the file expires. + filename: type: string - const: response.mcp_call.arguments.done - default: response.mcp_call.arguments.done - additionalProperties: false - required: - - arguments - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallArgumentsDone - "OpenAIResponseObjectStreamResponseMcpCallCompleted": + title: Filename + description: The name of the file. + purpose: + $ref: '#/components/schemas/OpenAIFilePurpose' + description: The intended purpose of the file. type: object + required: + - id + - bytes + - created_at + - expires_at + - filename + - purpose + title: OpenAIFileObject + description: OpenAI File object as defined in the OpenAI Files API. + OpenAIFilePurpose: + type: string + enum: + - assistants + - batch + title: OpenAIFilePurpose + description: Valid purpose values for OpenAI Files API. + OpenAIImageURL: properties: - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: + url: type: string - const: response.mcp_call.completed - default: response.mcp_call.completed - description: >- - Event type identifier, always "response.mcp_call.completed" - additionalProperties: false - required: - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallCompleted - description: Streaming event for completed MCP calls. - "OpenAIResponseObjectStreamResponseMcpCallFailed": + title: Url + detail: + anyOf: + - type: string + - type: 'null' + title: Detail type: object + required: + - url + title: OpenAIImageURL + description: Image URL specification for OpenAI-compatible chat completion messages. + OpenAIJSONSchema: properties: - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: + name: type: string - const: response.mcp_call.failed - default: response.mcp_call.failed - description: >- - Event type identifier, always "response.mcp_call.failed" - additionalProperties: false - required: - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallFailed - description: Streaming event for failed MCP calls. - "OpenAIResponseObjectStreamResponseMcpCallInProgress": + title: Name + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema type: object + title: OpenAIJSONSchema + description: JSON schema specification for OpenAI-compatible structured response format. + OpenAIResponseAnnotationCitation: properties: - item_id: + type: type: string - description: Unique identifier of the MCP call - output_index: + const: url_citation + title: Type + description: Annotation type identifier, always "url_citation" + default: url_citation + end_index: type: integer - description: >- - Index position of the item in the output list - sequence_number: + title: End Index + description: End position of the citation span in the content + start_index: type: integer - description: >- - Sequential number for ordering streaming events - type: + title: Start Index + description: Start position of the citation span in the content + title: type: string - const: response.mcp_call.in_progress - default: response.mcp_call.in_progress - description: >- - Event type identifier, always "response.mcp_call.in_progress" - additionalProperties: false - required: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallInProgress - description: >- - Streaming event for MCP calls in progress. - "OpenAIResponseObjectStreamResponseMcpListToolsCompleted": + title: Title + description: Title of the referenced web resource + url: + type: string + title: Url + description: URL of the referenced web resource type: object + required: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + OpenAIResponseAnnotationContainerFileCitation: properties: - sequence_number: - type: integer type: type: string - const: response.mcp_list_tools.completed - default: response.mcp_list_tools.completed - additionalProperties: false - required: - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpListToolsCompleted - "OpenAIResponseObjectStreamResponseMcpListToolsFailed": + const: container_file_citation + title: Type + default: container_file_citation + container_id: + type: string + title: Container Id + end_index: + type: integer + title: End Index + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + start_index: + type: integer + title: Start Index type: object + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + OpenAIResponseAnnotationFileCitation: properties: - sequence_number: - type: integer type: type: string - const: response.mcp_list_tools.failed - default: response.mcp_list_tools.failed - additionalProperties: false - required: - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpListToolsFailed - "OpenAIResponseObjectStreamResponseMcpListToolsInProgress": + const: file_citation + title: Type + description: Annotation type identifier, always "file_citation" + default: file_citation + file_id: + type: string + title: File Id + description: Unique identifier of the referenced file + filename: + type: string + title: Filename + description: Name of the referenced file + index: + type: integer + title: Index + description: Position index of the citation within the content type: object + required: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + OpenAIResponseAnnotationFilePath: properties: - sequence_number: - type: integer type: type: string - const: response.mcp_list_tools.in_progress - default: response.mcp_list_tools.in_progress - additionalProperties: false - required: - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpListToolsInProgress - "OpenAIResponseObjectStreamResponseOutputItemAdded": + const: file_path + title: Type + default: file_path + file_id: + type: string + title: File Id + index: + type: integer + title: Index type: object + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + OpenAIResponseContentPartRefusal: properties: - response_id: + type: type: string - description: >- - Unique identifier of the response containing this output - item: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - description: >- - The output item that was added (message, tool call, etc.) - output_index: - type: integer - description: >- - Index position of this item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.output_item.added - default: response.output_item.added - description: >- - Event type identifier, always "response.output_item.added" - additionalProperties: false - required: - - response_id - - item - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseOutputItemAdded - description: >- - Streaming event for when a new output item is added to the response. - "OpenAIResponseObjectStreamResponseOutputItemDone": - type: object - properties: - response_id: - type: string - description: >- - Unique identifier of the response containing this output - item: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAIResponseMessage' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - description: >- - The completed output item (message, tool call, etc.) - output_index: - type: integer - description: >- - Index position of this item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.output_item.done - default: response.output_item.done - description: >- - Event type identifier, always "response.output_item.done" - additionalProperties: false - required: - - response_id - - item - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseOutputItemDone - description: >- - Streaming event for when an output item is completed. - "OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded": - type: object - properties: - item_id: - type: string - description: >- - Unique identifier of the item to which the annotation is being added - output_index: - type: integer - description: >- - Index position of the output item in the response's output array - content_index: - type: integer - description: >- - Index position of the content part within the output item - annotation_index: - type: integer - description: >- - Index of the annotation within the content part - annotation: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' - discriminator: - propertyName: type - mapping: - file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' - container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' - description: The annotation object being added - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.output_text.annotation.added - default: response.output_text.annotation.added - description: >- - Event type identifier, always "response.output_text.annotation.added" - additionalProperties: false - required: - - item_id - - output_index - - content_index - - annotation_index - - annotation - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded - description: >- - Streaming event for when an annotation is added to output text. - "OpenAIResponseObjectStreamResponseOutputTextDelta": - type: object - properties: - content_index: - type: integer - description: Index position within the text content - delta: - type: string - description: Incremental text content being added - item_id: - type: string - description: >- - Unique identifier of the output item being updated - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: + const: refusal + title: Type + description: Content part type identifier, always "refusal" + default: refusal + refusal: type: string - const: response.output_text.delta - default: response.output_text.delta - description: >- - Event type identifier, always "response.output_text.delta" - additionalProperties: false - required: - - content_index - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseOutputTextDelta - description: >- - Streaming event for incremental text content updates. - "OpenAIResponseObjectStreamResponseOutputTextDone": - type: object - properties: - content_index: - type: integer - description: Index position within the text content - text: + title: Refusal + description: Refusal text supplied by the model + type: object + required: + - refusal + title: OpenAIResponseContentPartRefusal + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + OpenAIResponseError: + properties: + code: type: string - description: >- - Final complete text content of the output item - item_id: + title: Code + description: Error code identifying the type of failure + message: type: string - description: >- - Unique identifier of the completed output item - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events + title: Message + description: Human-readable error message describing the failure + type: object + required: + - code + - message + title: OpenAIResponseError + description: "Error details for failed OpenAI response requests.\n\n:param code: Error code identifying the type of failure\n:param message: Human-readable error message describing the failure" + OpenAIResponseFormatJSONObject: + properties: type: type: string - const: response.output_text.done - default: response.output_text.done - description: >- - Event type identifier, always "response.output_text.done" - additionalProperties: false - required: - - content_index - - text - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseOutputTextDone - description: >- - Streaming event for when text output is completed. - "OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded": - type: object - properties: - item_id: - type: string - description: Unique identifier of the output item - output_index: - type: integer - description: Index position of the output item - part: - $ref: '#/components/schemas/OpenAIResponseContentPartReasoningSummary' - description: The summary part that was added - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - summary_index: - type: integer - description: >- - Index of the summary part within the reasoning summary + const: json_object + title: Type + default: json_object + type: object + title: OpenAIResponseFormatJSONObject + description: JSON object response format for OpenAI-compatible chat completion requests. + OpenAIResponseFormatJSONSchema: + properties: type: type: string - const: response.reasoning_summary_part.added - default: response.reasoning_summary_part.added - description: >- - Event type identifier, always "response.reasoning_summary_part.added" - additionalProperties: false - required: - - item_id - - output_index - - part - - sequence_number - - summary_index - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded - description: >- - Streaming event for when a new reasoning summary part is added. - "OpenAIResponseObjectStreamResponseReasoningSummaryPartDone": - type: object - properties: - item_id: - type: string - description: Unique identifier of the output item - output_index: - type: integer - description: Index position of the output item - part: - $ref: '#/components/schemas/OpenAIResponseContentPartReasoningSummary' - description: The completed summary part - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - summary_index: - type: integer - description: >- - Index of the summary part within the reasoning summary + const: json_schema + title: Type + default: json_schema + json_schema: + $ref: '#/components/schemas/OpenAIJSONSchema' + type: object + required: + - json_schema + title: OpenAIResponseFormatJSONSchema + description: JSON schema response format for OpenAI-compatible chat completion requests. + OpenAIResponseFormatText: + properties: type: type: string - const: response.reasoning_summary_part.done - default: response.reasoning_summary_part.done - description: >- - Event type identifier, always "response.reasoning_summary_part.done" - additionalProperties: false - required: - - item_id - - output_index - - part - - sequence_number - - summary_index - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningSummaryPartDone - description: >- - Streaming event for when a reasoning summary part is completed. - "OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta": + const: text + title: Type + default: text type: object + title: OpenAIResponseFormatText + description: Text response format for OpenAI-compatible chat completion requests. + OpenAIResponseInputFunctionToolCallOutput: properties: - delta: + call_id: type: string - description: Incremental summary text being added - item_id: + title: Call Id + output: type: string - description: Unique identifier of the output item - output_index: - type: integer - description: Index position of the output item - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - summary_index: - type: integer - description: >- - Index of the summary part within the reasoning summary + title: Output type: type: string - const: response.reasoning_summary_text.delta - default: response.reasoning_summary_text.delta - description: >- - Event type identifier, always "response.reasoning_summary_text.delta" - additionalProperties: false - required: - - delta - - item_id - - output_index - - sequence_number - - summary_index - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta - description: >- - Streaming event for incremental reasoning summary text updates. - "OpenAIResponseObjectStreamResponseReasoningSummaryTextDone": + const: function_call_output + title: Type + default: function_call_output + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status type: object + required: + - call_id + - output + title: OpenAIResponseInputFunctionToolCallOutput + description: This represents the output of a function call that gets passed back to the model. + OpenAIResponseInputMessageContentFile: properties: - text: - type: string - description: Final complete summary text - item_id: - type: string - description: Unique identifier of the output item - output_index: - type: integer - description: Index position of the output item - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - summary_index: - type: integer - description: >- - Index of the summary part within the reasoning summary type: type: string - const: response.reasoning_summary_text.done - default: response.reasoning_summary_text.done - description: >- - Event type identifier, always "response.reasoning_summary_text.done" - additionalProperties: false - required: - - text - - item_id - - output_index - - sequence_number - - summary_index - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningSummaryTextDone - description: >- - Streaming event for when reasoning summary text is completed. - "OpenAIResponseObjectStreamResponseReasoningTextDelta": - type: object - properties: - content_index: - type: integer - description: >- - Index position of the reasoning content part - delta: - type: string - description: Incremental reasoning text being added - item_id: - type: string - description: >- - Unique identifier of the output item being updated - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events + const: input_file + title: Type + description: The type of the input item. Always `input_file`. + default: input_file + file_data: + anyOf: + - type: string + - type: 'null' + title: File Data + description: The data of the file to be sent to the model. + file_id: + anyOf: + - type: string + - type: 'null' + title: File Id + description: The ID of the file to be sent to the model. + file_url: + anyOf: + - type: string + - type: 'null' + title: File Url + description: The URL of the file to be sent to the model. + filename: + anyOf: + - type: string + - type: 'null' + title: Filename + description: The name of the file to be sent to the model. + type: object + title: OpenAIResponseInputMessageContentFile + description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + OpenAIResponseInputMessageContentImage: + properties: + detail: + anyOf: + - type: string + const: low + - type: string + const: high + - type: string + const: auto + title: Detail + description: Level of detail for image processing, can be "low", "high", or "auto" + default: auto type: type: string - const: response.reasoning_text.delta - default: response.reasoning_text.delta - description: >- - Event type identifier, always "response.reasoning_text.delta" - additionalProperties: false - required: - - content_index - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningTextDelta - description: >- - Streaming event for incremental reasoning text updates. - "OpenAIResponseObjectStreamResponseReasoningTextDone": - type: object - properties: - content_index: - type: integer - description: >- - Index position of the reasoning content part + const: input_image + title: Type + description: Content type identifier, always "input_image" + default: input_image + file_id: + anyOf: + - type: string + - type: 'null' + title: File Id + description: The ID of the file to be sent to the model. + image_url: + anyOf: + - type: string + - type: 'null' + title: Image Url + description: URL of the image content + type: object + title: OpenAIResponseInputMessageContentImage + description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + OpenAIResponseInputMessageContentText: + properties: text: type: string - description: Final complete reasoning text - item_id: - type: string - description: >- - Unique identifier of the completed output item - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.reasoning_text.done - default: response.reasoning_text.done - description: >- - Event type identifier, always "response.reasoning_text.done" - additionalProperties: false - required: - - content_index - - text - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningTextDone - description: >- - Streaming event for when reasoning text is completed. - "OpenAIResponseObjectStreamResponseRefusalDelta": - type: object - properties: - content_index: - type: integer - description: Index position of the content part - delta: - type: string - description: Incremental refusal text being added - item_id: - type: string - description: Unique identifier of the output item - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.refusal.delta - default: response.refusal.delta - description: >- - Event type identifier, always "response.refusal.delta" - additionalProperties: false - required: - - content_index - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseRefusalDelta - description: >- - Streaming event for incremental refusal text updates. - "OpenAIResponseObjectStreamResponseRefusalDone": - type: object - properties: - content_index: - type: integer - description: Index position of the content part - refusal: - type: string - description: Final complete refusal text - item_id: - type: string - description: Unique identifier of the output item - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events - type: - type: string - const: response.refusal.done - default: response.refusal.done - description: >- - Event type identifier, always "response.refusal.done" - additionalProperties: false - required: - - content_index - - refusal - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseRefusalDone - description: >- - Streaming event for when refusal text is completed. - "OpenAIResponseObjectStreamResponseWebSearchCallCompleted": - type: object - properties: - item_id: - type: string - description: >- - Unique identifier of the completed web search call - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events + title: Text + description: The text content of the input message type: type: string - const: response.web_search_call.completed - default: response.web_search_call.completed - description: >- - Event type identifier, always "response.web_search_call.completed" - additionalProperties: false - required: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseWebSearchCallCompleted - description: >- - Streaming event for completed web search calls. - "OpenAIResponseObjectStreamResponseWebSearchCallInProgress": + const: input_text + title: Type + description: Content type identifier, always "input_text" + default: input_text type: object + required: + - text + title: OpenAIResponseInputMessageContentText + description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + OpenAIResponseInputToolFileSearch: properties: - item_id: - type: string - description: Unique identifier of the web search call - output_index: - type: integer - description: >- - Index position of the item in the output list - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events type: type: string - const: response.web_search_call.in_progress - default: response.web_search_call.in_progress - description: >- - Event type identifier, always "response.web_search_call.in_progress" - additionalProperties: false - required: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseWebSearchCallInProgress - description: >- - Streaming event for web search calls in progress. - "OpenAIResponseObjectStreamResponseWebSearchCallSearching": + const: file_search + title: Type + description: Tool type identifier, always "file_search" + default: file_search + vector_store_ids: + items: + type: string + type: array + title: Vector Store Ids + description: List of vector store identifiers to search within + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Filters + description: Additional filters to apply to the search + max_num_results: + anyOf: + - type: integer + maximum: 50.0 + minimum: 1.0 + - type: 'null' + title: Max Num Results + description: Maximum number of search results to return (1-50) + default: 10 + ranking_options: + anyOf: + - $ref: '#/components/schemas/SearchRankingOptions' + - type: 'null' + description: Options for ranking and scoring search results type: object + required: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + description: "File search tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"file_search\"\n:param vector_store_ids: List of vector store identifiers to search within\n:param filters: (Optional) Additional filters to apply to the search\n:param max_num_results: (Optional) Maximum number of search results to return (1-50)\n:param ranking_options: (Optional) Options for ranking and scoring search results" + OpenAIResponseInputToolFunction: properties: - item_id: - type: string - output_index: - type: integer - sequence_number: - type: integer type: type: string - const: response.web_search_call.searching - default: response.web_search_call.searching - additionalProperties: false - required: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseWebSearchCallSearching - OpenAIDeleteResponseObject: - type: object - properties: - id: - type: string - description: >- - Unique identifier of the deleted response - object: - type: string - const: response - default: response - description: >- - Object type identifier, always "response" - deleted: - type: boolean - default: true - description: Deletion confirmation flag, always True - additionalProperties: false - required: - - id - - object - - deleted - title: OpenAIDeleteResponseObject - description: >- - Response object confirming deletion of an OpenAI response. - ListOpenAIResponseInputItem: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInput' - description: List of input items - object: + const: function + title: Type + description: Tool type identifier, always "function" + default: function + name: type: string - const: list - default: list - description: Object type identifier, always "list" - additionalProperties: false - required: - - data - - object - title: ListOpenAIResponseInputItem - description: >- - List container for OpenAI response input items. - RunShieldRequest: + title: Name + description: Name of the function that can be called + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Description of what the function does + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Parameters + description: JSON schema defining the function's parameters + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + description: Whether to enforce strict parameter validation type: object - properties: - shield_id: - type: string - description: The identifier of the shield to run. - messages: - type: array - items: - $ref: '#/components/schemas/OpenAIMessageParam' - description: The messages to run the shield on. - params: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The parameters of the shield. - additionalProperties: false required: - - shield_id - - messages - - params - title: RunShieldRequest - RunShieldResponse: - type: object - properties: - violation: - $ref: '#/components/schemas/SafetyViolation' - description: >- - (Optional) Safety violation detected by the shield, if any - additionalProperties: false - title: RunShieldResponse - description: Response from running a safety shield. - SafetyViolation: - type: object - properties: - violation_level: - $ref: '#/components/schemas/ViolationLevel' - description: Severity level of the violation - user_message: - type: string - description: >- - (Optional) Message to convey to the user about the violation - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Additional metadata including specific violation codes for debugging and - telemetry - additionalProperties: false - required: - - violation_level - - metadata - title: SafetyViolation - description: >- - Details of a safety violation detected by content moderation. - ViolationLevel: - type: string - enum: - - info - - warn - - error - title: ViolationLevel - description: Severity level of a safety violation. - AgentTurnInputType: + - name + title: OpenAIResponseInputToolFunction + description: "Function tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"function\"\n:param name: Name of the function that can be called\n:param description: (Optional) Description of what the function does\n:param parameters: (Optional) JSON schema defining the function's parameters\n:param strict: (Optional) Whether to enforce strict parameter validation" + OpenAIResponseInputToolMCP: properties: type: type: string - const: agent_turn_input + const: mcp title: Type - default: agent_turn_input - type: object - title: AgentTurnInputType - description: Parameter type for agent turn input. - AggregationFunctionType: - type: string - enum: - - average - - weighted_average - - median - - categorical_count - - accuracy - title: AggregationFunctionType - description: Types of aggregation functions for scoring results. - AllowedToolsFilter: - properties: - tool_names: - title: Tool Names - items: - type: string - type: array - type: object - title: AllowedToolsFilter - description: Filter configuration for restricting which MCP tools can be used. - ApprovalFilter: - properties: - always: - title: Always - items: - type: string - type: array - never: - title: Never - items: - type: string - type: array - type: object - title: ApprovalFilter - description: Filter configuration for MCP tool approval requirements. - ArrayType: - properties: - type: + description: Tool type identifier, always "mcp" + default: mcp + server_label: type: string - const: array - title: Type - default: array + title: Server Label + description: Label to identify this MCP server + server_url: + type: string + title: Server Url + description: URL endpoint of the MCP server + headers: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Headers + description: HTTP headers to include when connecting to the server + require_approval: + anyOf: + - type: string + const: always + - type: string + const: never + - $ref: '#/components/schemas/ApprovalFilter' + title: Require Approval + description: Approval requirement for tool calls ("always", "never", or filter) + default: never + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + title: Allowed Tools + description: Restriction on which tools can be used from this server type: object - title: ArrayType - description: Parameter type for array values. - BasicScoringFnParams: + required: + - server_label + - server_url + title: OpenAIResponseInputToolMCP + description: "Model Context Protocol (MCP) tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param server_url: URL endpoint of the MCP server\n:param headers: (Optional) HTTP headers to include when connecting to the server\n:param require_approval: Approval requirement for tool calls (\"always\", \"never\", or filter)\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + OpenAIResponseInputToolWebSearch: properties: type: - type: string - const: basic + anyOf: + - type: string + const: web_search + - type: string + const: web_search_preview + - type: string + const: web_search_preview_2025_03_11 title: Type - default: basic - aggregation_functions: - items: - $ref: '#/components/schemas/AggregationFunctionType' - type: array - title: Aggregation Functions - description: Aggregation functions to apply to the scores of each row + description: Web search tool type variant to use + default: web_search + search_context_size: + anyOf: + - type: string + pattern: ^low|medium|high$ + - type: 'null' + title: Search Context Size + description: Size of search context, must be "low", "medium", or "high" + default: medium type: object - title: BasicScoringFnParams - description: Parameters for basic scoring function configuration. - Batch: + title: OpenAIResponseInputToolWebSearch + description: "Web search tool configuration for OpenAI response inputs.\n\n:param type: Web search tool type variant to use\n:param search_context_size: (Optional) Size of search context, must be \"low\", \"medium\", or \"high\"" + OpenAIResponseMCPApprovalRequest: properties: + arguments: + type: string + title: Arguments id: type: string title: Id - completion_window: + name: type: string - title: Completion Window - created_at: - type: integer - title: Created At - endpoint: + title: Name + server_label: type: string - title: Endpoint - input_file_id: + title: Server Label + type: type: string - title: Input File Id - object: + const: mcp_approval_request + title: Type + default: mcp_approval_request + type: object + required: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + description: A request for human approval of a tool invocation. + OpenAIResponseMCPApprovalResponse: + properties: + approval_request_id: type: string - const: batch - title: Object - status: + title: Approval Request Id + approve: + type: boolean + title: Approve + type: type: string - enum: - - validating - - failed - - in_progress - - finalizing - - completed - - expired - - cancelling - - cancelled - title: Status - cancelled_at: - title: Cancelled At - type: integer - cancelling_at: - title: Cancelling At - type: integer - completed_at: - title: Completed At - type: integer - error_file_id: - title: Error File Id - type: string - errors: - $ref: '#/components/schemas/Errors' - expired_at: - title: Expired At - type: integer - expires_at: - title: Expires At - type: integer - failed_at: - title: Failed At - type: integer - finalizing_at: - title: Finalizing At - type: integer - in_progress_at: - title: In Progress At - type: integer - metadata: - title: Metadata - additionalProperties: - type: string - type: object - model: - title: Model - type: string - output_file_id: - title: Output File Id - type: string - request_counts: - $ref: '#/components/schemas/BatchRequestCounts' - usage: - $ref: '#/components/schemas/BatchUsage' - additionalProperties: true - type: object - required: - - id - - completion_window - - created_at - - endpoint - - input_file_id - - object - - status - title: Batch - BatchError: - properties: - code: - title: Code - type: string - line: - title: Line - type: integer - message: - title: Message - type: string - param: - title: Param - type: string - additionalProperties: true - type: object - title: BatchError - BatchRequestCounts: - properties: - completed: - type: integer - title: Completed - failed: - type: integer - title: Failed - total: - type: integer - title: Total - additionalProperties: true - type: object - required: - - completed - - failed - - total - title: BatchRequestCounts - BatchUsage: - properties: - input_tokens: - type: integer - title: Input Tokens - input_tokens_details: - $ref: '#/components/schemas/InputTokensDetails' - output_tokens: - type: integer - title: Output Tokens - output_tokens_details: - $ref: '#/components/schemas/OutputTokensDetails' - total_tokens: - type: integer - title: Total Tokens - additionalProperties: true - type: object - required: - - input_tokens - - input_tokens_details - - output_tokens - - output_tokens_details - - total_tokens - title: BatchUsage - BooleanType: - properties: - type: - type: string - const: boolean + const: mcp_approval_response title: Type - default: boolean + default: mcp_approval_response + id: + anyOf: + - type: string + - type: 'null' + title: Id + reason: + anyOf: + - type: string + - type: 'null' + title: Reason type: object - title: BooleanType - description: Parameter type for boolean values. - ChatCompletionInputType: + required: + - approval_request_id + - approve + title: OpenAIResponseMCPApprovalResponse + description: A response to an MCP approval request. + OpenAIResponseMessage-Input: properties: + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - type: string + const: system + - type: string + const: developer + - type: string + const: user + - type: string + const: assistant + title: Role type: type: string - const: chat_completion_input + const: message title: Type - default: chat_completion_input + default: message + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status type: object - title: ChatCompletionInputType - description: Parameter type for chat completion input. - Chunk-Output: + required: + - content + - role + title: OpenAIResponseMessage + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + OpenAIResponseMessage-Output: properties: content: anyOf: - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - items: oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' type: array title: Content - chunk_id: + role: + anyOf: + - type: string + const: system + - type: string + const: developer + - type: string + const: user + - type: string + const: assistant + title: Role + type: type: string - title: Chunk Id - metadata: - additionalProperties: true - type: object - title: Metadata - embedding: - title: Embedding - items: - type: number - type: array - chunk_metadata: - $ref: '#/components/schemas/ChunkMetadata' + const: message + title: Type + default: message + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status type: object required: - content - - chunk_id - title: Chunk - description: A chunk of content that can be inserted into a vector database. - ChunkMetadata: - properties: - chunk_id: - title: Chunk Id - type: string - document_id: - title: Document Id - type: string - source: - title: Source - type: string - created_timestamp: - title: Created Timestamp - type: integer - updated_timestamp: - title: Updated Timestamp - type: integer - chunk_window: - title: Chunk Window - type: string - chunk_tokenizer: - title: Chunk Tokenizer - type: string - chunk_embedding_model: - title: Chunk Embedding Model - type: string - chunk_embedding_dimension: - title: Chunk Embedding Dimension - type: integer - content_token_count: - title: Content Token Count - type: integer - metadata_token_count: - title: Metadata Token Count - type: integer - type: object - title: ChunkMetadata - description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." - CompletionInputType: - properties: - type: - type: string - const: completion_input - title: Type - default: completion_input - type: object - title: CompletionInputType - description: Parameter type for completion input. - Conversation: + - role + title: OpenAIResponseMessage + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + OpenAIResponseObject: properties: + created_at: + type: integer + title: Created At + description: Unix timestamp when the response was created + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + description: Error details if the response generation failed id: type: string title: Id - description: The unique ID of the conversation. + description: Unique identifier for this response + model: + type: string + title: Model + description: Model identifier used for generation object: type: string - const: conversation + const: response title: Object - description: The object type, which is always conversation. - default: conversation - created_at: - type: integer - title: Created At - description: The time at which the conversation was created, measured in seconds since the Unix epoch. - metadata: - title: Metadata - description: Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. - additionalProperties: - type: string - type: object - items: - title: Items - description: Initial items to include in the conversation context. You may add up to 20 items at a time. + description: Object type identifier, always "response" + default: response + output: items: - additionalProperties: true - type: object + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' type: array - type: object - required: - - id - - created_at - title: Conversation - description: OpenAI-compatible conversation object. - ConversationItemInclude: - type: string - enum: - - llm_as_judge - - regex_parser - - basic - title: ScoringFnParamsType - description: >- - Types of scoring function parameter configurations. - StringType: - type: object - properties: - type: - type: string - const: string - default: string - description: Discriminator type. Always "string" - additionalProperties: false - required: - - type - title: StringType - description: Parameter type for string values. - UnionType: - type: object - properties: - type: + title: Output + description: List of generated output items (messages, tool calls, etc.) + parallel_tool_calls: + type: boolean + title: Parallel Tool Calls + description: Whether tool calls can be executed in parallel + default: false + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + description: ID of the previous response in a conversation + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + description: Reference to a prompt template and its variables. + status: type: string - const: union - default: union - description: Discriminator type. Always "union" - additionalProperties: false - required: - - type - title: UnionType - description: Parameter type for union values. - ListScoringFunctionsResponse: + title: Status + description: Current status of the response generation + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Sampling temperature used for generation + text: + $ref: '#/components/schemas/OpenAIResponseText' + description: Text formatting configuration for the response + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + description: Nucleus sampling parameter used for generation + tools: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + type: array + - type: 'null' + title: Tools + description: An array of tools the model may call while generating a response. + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + description: Truncation strategy applied to the response + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + description: Token usage information for the response + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + description: System message inserted into the model's context type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/ScoringFn' - additionalProperties: false required: - - data - title: ListScoringFunctionsResponse - ParamType: - oneOf: - - $ref: '#/components/schemas/StringType' - - $ref: '#/components/schemas/NumberType' - - $ref: '#/components/schemas/BooleanType' - - $ref: '#/components/schemas/ArrayType' - - $ref: '#/components/schemas/ObjectType' - - $ref: '#/components/schemas/JsonType' - - $ref: '#/components/schemas/UnionType' - - $ref: '#/components/schemas/ChatCompletionInputType' - - $ref: '#/components/schemas/CompletionInputType' - - $ref: '#/components/schemas/AgentTurnInputType' - discriminator: - propertyName: type - mapping: - string: '#/components/schemas/StringType' - number: '#/components/schemas/NumberType' - boolean: '#/components/schemas/BooleanType' - array: '#/components/schemas/ArrayType' - object: '#/components/schemas/ObjectType' - json: '#/components/schemas/JsonType' - union: '#/components/schemas/UnionType' - chat_completion_input: '#/components/schemas/ChatCompletionInputType' - completion_input: '#/components/schemas/CompletionInputType' - agent_turn_input: '#/components/schemas/AgentTurnInputType' - RegisterScoringFunctionRequest: - type: object + - created_at + - id + - model + - output + - status + title: OpenAIResponseObject + description: "Complete OpenAI response object containing generation results and metadata.\n\n:param created_at: Unix timestamp when the response was created\n:param error: (Optional) Error details if the response generation failed\n:param id: Unique identifier for this response\n:param model: Model identifier used for generation\n:param object: Object type identifier, always \"response\"\n:param output: List of generated output items (messages, tool calls, etc.)\n:param parallel_tool_calls: Whether tool calls can be executed in parallel\n:param previous_response_id: (Optional) ID of the previous response in a conversation\n:param prompt: (Optional) Reference to a prompt template and its variables.\n:param status: Current status of the response generation\n:param temperature: (Optional) Sampling temperature used for generation\n:param text: Text formatting configuration for the response\n:param top_p: (Optional) Nucleus sampling parameter used for generation\n:param tools: (Optional) An array of tools the model may call while generating a response.\n:param truncation: (Optional) Truncation strategy applied to the response\n:param usage: (Optional) Token usage information for the response\n:param instructions: (Optional) System message inserted into the model's context" + OpenAIResponseObjectWithInput-Output: properties: - scoring_fn_id: - type: string - description: >- - The ID of the scoring function to register. - description: + created_at: + type: integer + title: Created At + description: Unix timestamp when the response was created + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + description: Error details if the response generation failed + id: type: string - description: The description of the scoring function. - return_type: - $ref: '#/components/schemas/ParamType' - description: The return type of the scoring function. - provider_scoring_fn_id: + title: Id + description: Unique identifier for this response + model: type: string - description: >- - The ID of the provider scoring function to use for the scoring function. - provider_id: + title: Model + description: Model identifier used for generation + object: type: string - description: >- - The ID of the provider to use for the scoring function. - params: - $ref: '#/components/schemas/ScoringFnParams' - description: >- - The parameters for the scoring function for benchmark eval, these can - be overridden for app eval. - additionalProperties: false - required: - - scoring_fn_id - - description - - return_type - title: RegisterScoringFunctionRequest - ScoreRequest: - type: object - properties: - input_rows: - type: array + const: response + title: Object + description: Object type identifier, always "response" + default: response + output: items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The rows to score. - scoring_functions: - type: object - additionalProperties: oneOf: - - $ref: '#/components/schemas/ScoringFnParams' - - type: 'null' - description: >- - The scoring functions to use for the scoring. - additionalProperties: false - required: - - input_rows - - scoring_functions - title: ScoreRequest - ScoreResponse: - type: object - properties: - results: - type: object - additionalProperties: - $ref: '#/components/schemas/ScoringResult' - description: >- - A map of scoring function name to ScoringResult. - additionalProperties: false - required: - - results - title: ScoreResponse - description: The response from scoring. - ScoringResult: - type: object - properties: - score_rows: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - The scoring result for each row. Each row is a map of column name to value. - aggregated_results: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Map of metric name to aggregated value - additionalProperties: false - required: - - score_rows - - aggregated_results - title: ScoringResult - description: A scoring result for a single row. - ScoreBatchRequest: - type: object - properties: - dataset_id: - type: string - description: The ID of the dataset to score. - scoring_functions: - type: object - additionalProperties: - oneOf: - - $ref: '#/components/schemas/ScoringFnParams' - - type: 'null' - description: >- - The scoring functions to use for the scoring. - save_results_dataset: - type: boolean - description: >- - Whether to save the results to a dataset. - additionalProperties: false - required: - - dataset_id - - scoring_functions - - save_results_dataset - title: ScoreBatchRequest - ScoreBatchResponse: - type: object - properties: - dataset_id: - type: string - description: >- - (Optional) The identifier of the dataset that was scored - results: - type: object - additionalProperties: - $ref: '#/components/schemas/ScoringResult' - description: >- - A map of scoring function name to ScoringResult - additionalProperties: false - required: - - results - title: ScoreBatchResponse - description: >- - Response from batch scoring operations on datasets. - Shield: - type: object - properties: - identifier: - type: string - provider_resource_id: - type: string - provider_id: - type: string - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: shield - default: shield - description: The resource type, always shield - params: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Configuration parameters for the shield - additionalProperties: false - required: - - identifier - - provider_id - - type - title: Shield - description: >- - A safety shield resource that can be used to check content. - ListShieldsResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/Shield' - additionalProperties: false - required: - - data - title: ListShieldsResponse - RegisterShieldRequest: - type: object - properties: - shield_id: - type: string - description: >- - The identifier of the shield to register. - provider_shield_id: - type: string - description: >- - The identifier of the shield in the provider. - provider_id: - type: string - description: The identifier of the provider. - params: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The parameters of the shield. - additionalProperties: false - required: - - shield_id - title: RegisterShieldRequest - InvokeToolRequest: - type: object - properties: - tool_name: - type: string - description: The name of the tool to invoke. - kwargs: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - A dictionary of arguments to pass to the tool. - additionalProperties: false - required: - - tool_name - - kwargs - title: InvokeToolRequest - ImageContentItem: - type: object - properties: - type: - type: string - const: image - default: image - description: >- - Discriminator type of the content item. Always "image" - image: - type: object - properties: - url: - $ref: '#/components/schemas/URL' - description: >- - A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - data: - type: string - contentEncoding: base64 - description: base64 encoded image data as string - additionalProperties: false - description: >- - Image as a base64 encoded string or an URL - additionalProperties: false - required: - - type - - image - title: ImageContentItem - description: A image content item - InterleavedContent: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - InterleavedContentItem: - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem' - text: '#/components/schemas/TextContentItem' - TextContentItem: - type: object - properties: - type: - type: string - const: text - default: text - description: >- - Discriminator type of the content item. Always "text" - text: - type: string - description: Text content - additionalProperties: false - required: - - type - - text - title: TextContentItem - description: A text content item - ToolInvocationResult: - type: object - properties: - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - (Optional) The output content from the tool execution - error_message: - type: string - description: >- - (Optional) Error message if the tool execution failed - error_code: - type: integer - description: >- - (Optional) Numeric error code if the tool execution failed - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool execution - additionalProperties: false - title: ToolInvocationResult - description: Result of a tool invocation. - URL: - type: object - properties: - uri: - type: string - description: The URL string pointing to the resource - additionalProperties: false - required: - - uri - title: URL - description: A URL reference to external content. - ToolDef: - type: object - properties: - toolgroup_id: - type: string - description: >- - (Optional) ID of the tool group this tool belongs to - name: - type: string - description: Name of the tool - description: - type: string - description: >- - (Optional) Human-readable description of what the tool does - input_schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON Schema for tool inputs (MCP inputSchema) - output_schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON Schema for tool outputs (MCP outputSchema) - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool - additionalProperties: false - required: - - name - title: ToolDef - description: >- - Tool definition used in runtime contexts. - ListToolDefsResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/ToolDef' - description: List of tool definitions - additionalProperties: false - required: - - data - title: ListToolDefsResponse - description: >- - Response containing a list of tool definitions. - RAGDocument: - type: object - properties: - document_id: - type: string - description: The unique identifier for the document. - content: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - - $ref: '#/components/schemas/URL' - description: The content of the document. - mime_type: - type: string - description: The MIME type of the document. - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Additional metadata for the document. - additionalProperties: false - required: - - document_id - - content - - metadata - title: RAGDocument - description: >- - A document to be used for document ingestion in the RAG Tool. - InsertRequest: - type: object - properties: - documents: - type: array - items: - $ref: '#/components/schemas/RAGDocument' - description: >- - List of documents to index in the RAG system - vector_store_id: - type: string - description: >- - ID of the vector database to store the document embeddings - chunk_size_in_tokens: - type: integer - description: >- - (Optional) Size in tokens for document chunking during indexing - additionalProperties: false - required: - - documents - - vector_store_id - - chunk_size_in_tokens - title: InsertRequest - DefaultRAGQueryGeneratorConfig: - properties: - type: - type: string - const: default - title: Type - default: default - separator: - type: string - title: Separator - default: ' ' - type: object - title: DefaultRAGQueryGeneratorConfig - description: Configuration for the default RAG query generator. - Errors: - properties: - data: - title: Data - items: - $ref: '#/components/schemas/BatchError' - type: array - object: - title: Object - type: string - additionalProperties: true - type: object - title: Errors - HealthInfo: - properties: - status: - $ref: '#/components/schemas/HealthStatus' - type: object - required: - - status - title: HealthInfo - description: Health status information for the service. - HealthStatus: - type: string - enum: - - OK - - Error - - Not Implemented - title: HealthStatus - ImageContentItem-Output: - properties: - type: - type: string - const: image - title: Type - default: image - image: - $ref: '#/components/schemas/_URLOrData' - type: object - required: - - image - title: ImageContentItem - description: A image content item - InputTokensDetails: - properties: - cached_tokens: - type: integer - title: Cached Tokens - additionalProperties: true - type: object - required: - - cached_tokens - title: InputTokensDetails - JsonType: - properties: - type: - type: string - const: json - title: Type - default: json - type: object - title: JsonType - description: Parameter type for JSON values. - LLMAsJudgeScoringFnParams: - properties: - type: - type: string - const: llm_as_judge - title: Type - default: llm_as_judge - judge_model: - type: string - title: Judge Model - prompt_template: - title: Prompt Template - type: string - judge_score_regexes: - items: - type: string - type: array - title: Judge Score Regexes - description: Regexes to extract the answer from generated response - aggregation_functions: - items: - $ref: '#/components/schemas/AggregationFunctionType' - type: array - title: Aggregation Functions - description: Aggregation functions to apply to the scores of each row - type: object - required: - - judge_model - title: LLMAsJudgeScoringFnParams - description: Parameters for LLM-as-judge scoring function configuration. - LLMRAGQueryGeneratorConfig: - properties: - type: - type: string - const: llm - title: Type - default: llm - model: - type: string - title: Model - template: - type: string - title: Template - type: object - required: - - model - - template - title: LLMRAGQueryGeneratorConfig - description: Configuration for the LLM-based RAG query generator. - ListModelsResponse: - properties: - data: - items: - $ref: '#/components/schemas/Model' - type: array - title: Data - type: object - required: - - data - title: ListModelsResponse - ListPromptsResponse: - properties: - data: - items: - $ref: '#/components/schemas/Prompt' - type: array - title: Data - type: object - required: - - data - title: ListPromptsResponse - description: Response model to list prompts. - ListProvidersResponse: - properties: - data: - items: - $ref: '#/components/schemas/ProviderInfo' - type: array - title: Data - type: object - required: - - data - title: ListProvidersResponse - description: Response containing a list of all available providers. - ListRoutesResponse: - properties: - data: - items: - $ref: '#/components/schemas/RouteInfo' - type: array - title: Data - type: object - required: - - data - title: ListRoutesResponse - description: Response containing a list of all available API routes. - ListScoringFunctionsResponse: - properties: - data: - items: - $ref: '#/components/schemas/ScoringFn-Output' - type: array - title: Data - type: object - required: - - data - title: ListScoringFunctionsResponse - ListShieldsResponse: - properties: - data: - items: - $ref: '#/components/schemas/Shield' - type: array - title: Data - type: object - required: - - data - title: ListShieldsResponse - ListToolGroupsResponse: - properties: - data: - items: - $ref: '#/components/schemas/ToolGroup' - type: array - title: Data - type: object - required: - - data - title: ListToolGroupsResponse - description: Response containing a list of tool groups. - MCPListToolsTool: - properties: - input_schema: - additionalProperties: true - type: object - title: Input Schema - name: - type: string - title: Name - description: - title: Description - type: string - type: object - required: - - input_schema - - name - title: MCPListToolsTool - description: Tool definition returned by MCP list tools operation. - Model: - properties: - identifier: - type: string - title: Identifier - description: Unique identifier for this resource in llama stack - provider_resource_id: - title: Provider Resource Id - description: Unique identifier for this resource in the provider - type: string - provider_id: - type: string - title: Provider Id - description: ID of the provider that owns this resource - type: - type: string - const: model - title: Type - default: model - metadata: - additionalProperties: true - type: object - title: Metadata - description: Any additional metadata for this model - model_type: - $ref: '#/components/schemas/ModelType' - default: llm - type: object - required: - - identifier - - provider_id - title: Model - description: A model resource representing an AI model registered in Llama Stack. - ModelType: - type: string - enum: - - llm - - embedding - - rerank - title: ModelType - description: Enumeration of supported model types in Llama Stack. - ModerationObject: - properties: - id: - type: string - title: Id - model: - type: string - title: Model - results: - items: - $ref: '#/components/schemas/ModerationObjectResults' - type: array - title: Results - type: object - required: - - id - - model - - results - title: ModerationObject - description: A moderation object. - ModerationObjectResults: - properties: - flagged: - type: boolean - title: Flagged - categories: - title: Categories - additionalProperties: - type: boolean - type: object - category_applied_input_types: - title: Category Applied Input Types - additionalProperties: - items: - type: string - type: array - type: object - category_scores: - title: Category Scores - additionalProperties: - type: number - type: object - user_message: - title: User Message - type: string - metadata: - additionalProperties: true - type: object - title: Metadata - type: object - required: - - flagged - title: ModerationObjectResults - description: A moderation object. - NumberType: - properties: - type: - type: string - const: number - title: Type - default: number - type: object - title: NumberType - description: Parameter type for numeric values. - ObjectType: - properties: - type: - type: string - const: object - title: Type - default: object - type: object - title: ObjectType - description: Parameter type for object values. - OpenAIAssistantMessageParam-Input: - properties: - role: - type: string - const: assistant - title: Role - default: assistant - content: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - name: - title: Name - type: string - tool_calls: - title: Tool Calls - items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' - type: array - type: object - title: OpenAIAssistantMessageParam - description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. - OpenAIAssistantMessageParam-Output: - properties: - role: - type: string - const: assistant - title: Role - default: assistant - content: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - name: - title: Name - type: string - tool_calls: - title: Tool Calls - items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' - type: array - type: object - title: OpenAIAssistantMessageParam - description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. - OpenAIChatCompletion: - properties: - id: - type: string - title: Id - choices: - items: - $ref: '#/components/schemas/OpenAIChoice-Output' - type: array - title: Choices - object: - type: string - const: chat.completion - title: Object - default: chat.completion - created: - type: integer - title: Created - model: - type: string - title: Model - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - type: object - required: - - id - - choices - - created - - model - title: OpenAIChatCompletion - description: Response from an OpenAI-compatible chat completion request. - OpenAIChatCompletionContentPartImageParam: - properties: - type: - type: string - const: image_url - title: Type - default: image_url - image_url: - $ref: '#/components/schemas/OpenAIImageURL' - type: object - required: - - image_url - title: OpenAIChatCompletionContentPartImageParam - description: Image content part for OpenAI-compatible chat completion messages. - OpenAIChatCompletionContentPartTextParam: - properties: - type: - type: string - const: text - title: Type - default: text - text: - type: string - title: Text - type: object - required: - - text - title: OpenAIChatCompletionContentPartTextParam - description: Text content part for OpenAI-compatible chat completion messages. - OpenAIChatCompletionRequestWithExtraBody: - properties: - model: - type: string - title: Model - messages: - items: - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - discriminator: - propertyName: role - mapping: - assistant: '#/components/schemas/OpenAIAssistantMessageParam-Input' - developer: '#/components/schemas/OpenAIDeveloperMessageParam' - system: '#/components/schemas/OpenAISystemMessageParam' - tool: '#/components/schemas/OpenAIToolMessageParam' - user: '#/components/schemas/OpenAIUserMessageParam-Input' - type: array - minItems: 1 - title: Messages - frequency_penalty: - title: Frequency Penalty - type: number - function_call: - anyOf: - - type: string - - additionalProperties: true - type: object - title: Function Call - functions: - title: Functions - items: - additionalProperties: true - type: object - type: array - logit_bias: - title: Logit Bias - additionalProperties: - type: number - type: object - logprobs: - title: Logprobs - type: boolean - max_completion_tokens: - title: Max Completion Tokens - type: integer - max_tokens: - title: Max Tokens - type: integer - n: - title: N - type: integer - parallel_tool_calls: - title: Parallel Tool Calls - type: boolean - presence_penalty: - title: Presence Penalty - type: number - response_format: - title: Response Format - oneOf: - - $ref: '#/components/schemas/OpenAIResponseFormatText' - - $ref: '#/components/schemas/OpenAIResponseFormatJSONSchema' - - $ref: '#/components/schemas/OpenAIResponseFormatJSONObject' - discriminator: - propertyName: type - mapping: - json_object: '#/components/schemas/OpenAIResponseFormatJSONObject' - json_schema: '#/components/schemas/OpenAIResponseFormatJSONSchema' - text: '#/components/schemas/OpenAIResponseFormatText' - seed: - title: Seed - type: integer - stop: - anyOf: - - type: string - - items: - type: string - type: array - title: Stop - stream: - title: Stream - type: boolean - stream_options: - title: Stream Options - additionalProperties: true - type: object - temperature: - title: Temperature - type: number - tool_choice: - anyOf: - - type: string - - additionalProperties: true - type: object - title: Tool Choice - tools: - title: Tools - items: - additionalProperties: true - type: object - type: array - top_logprobs: - title: Top Logprobs - type: integer - top_p: - title: Top P - type: number - user: - title: User - type: string - additionalProperties: true - type: object - required: - - model - - messages - title: OpenAIChatCompletionRequestWithExtraBody - description: Request parameters for OpenAI-compatible chat completion endpoint. - OpenAIChatCompletionToolCall: - properties: - index: - title: Index - type: integer - id: - title: Id - type: string - type: - type: string - const: function - title: Type - default: function - function: - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' - type: object - title: OpenAIChatCompletionToolCall - description: Tool call specification for OpenAI-compatible chat completion responses. - OpenAIChatCompletionToolCallFunction: - properties: - name: - title: Name - type: string - arguments: - title: Arguments - type: string - type: object - title: OpenAIChatCompletionToolCallFunction - description: Function call details for OpenAI-compatible tool calls. - OpenAIChatCompletionUsage: - properties: - prompt_tokens: - type: integer - title: Prompt Tokens - completion_tokens: - type: integer - title: Completion Tokens - total_tokens: - type: integer - title: Total Tokens - prompt_tokens_details: - $ref: '#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails' - completion_tokens_details: - $ref: '#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails' - type: object - required: - - prompt_tokens - - completion_tokens - - total_tokens - title: OpenAIChatCompletionUsage - description: Usage information for OpenAI chat completion. - OpenAIChatCompletionUsageCompletionTokensDetails: - properties: - reasoning_tokens: - title: Reasoning Tokens - type: integer - type: object - title: OpenAIChatCompletionUsageCompletionTokensDetails - description: Token details for output tokens in OpenAI chat completion usage. - OpenAIChatCompletionUsagePromptTokensDetails: - properties: - cached_tokens: - title: Cached Tokens - type: integer - type: object - title: OpenAIChatCompletionUsagePromptTokensDetails - description: Token details for prompt tokens in OpenAI chat completion usage. - OpenAIChoice-Output: - properties: - message: - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam-Output' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Output' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - title: Message - discriminator: - propertyName: role - mapping: - assistant: '#/components/schemas/OpenAIAssistantMessageParam-Output' - developer: '#/components/schemas/OpenAIDeveloperMessageParam' - system: '#/components/schemas/OpenAISystemMessageParam' - tool: '#/components/schemas/OpenAIToolMessageParam' - user: '#/components/schemas/OpenAIUserMessageParam-Output' - finish_reason: - type: string - title: Finish Reason - index: - type: integer - title: Index - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' - type: object - required: - - message - - finish_reason - - index - title: OpenAIChoice - description: A choice from an OpenAI-compatible chat completion response. - OpenAIChoiceLogprobs-Output: - properties: - content: - title: Content - items: - $ref: '#/components/schemas/OpenAITokenLogProb' - type: array - refusal: - title: Refusal - items: - $ref: '#/components/schemas/OpenAITokenLogProb' - type: array - type: object - title: OpenAIChoiceLogprobs - description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. - OpenAICompletion: - properties: - id: - type: string - title: Id - choices: - items: - $ref: '#/components/schemas/OpenAICompletionChoice-Output' - type: array - title: Choices - created: - type: integer - title: Created - model: - type: string - title: Model - object: - type: string - const: text_completion - title: Object - default: text_completion - type: object - required: - - id - - choices - - created - - model - title: OpenAICompletion - description: Response from an OpenAI-compatible completion request. - OpenAICompletionChoice-Output: - properties: - finish_reason: - type: string - title: Finish Reason - text: - type: string - title: Text - index: - type: integer - title: Index - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' - type: object - required: - - finish_reason - - text - - index - title: OpenAICompletionChoice - description: A choice from an OpenAI-compatible completion response. - OpenAICompletionRequestWithExtraBody: - properties: - model: - type: string - title: Model - prompt: - anyOf: - - type: string - - items: - type: string - type: array - - items: - type: integer - type: array - - items: - items: - type: integer - type: array - type: array - title: Prompt - best_of: - title: Best Of - type: integer - echo: - title: Echo - type: boolean - frequency_penalty: - title: Frequency Penalty - type: number - logit_bias: - title: Logit Bias - additionalProperties: - type: number - type: object - logprobs: - title: Logprobs - type: boolean - max_tokens: - title: Max Tokens - type: integer - n: - title: N - type: integer - presence_penalty: - title: Presence Penalty - type: number - seed: - title: Seed - type: integer - stop: - anyOf: - - type: string - - items: - type: string - type: array - title: Stop - stream: - title: Stream - type: boolean - stream_options: - title: Stream Options - additionalProperties: true - type: object - temperature: - title: Temperature - type: number - top_p: - title: Top P - type: number - user: - title: User - type: string - suffix: - title: Suffix - type: string - additionalProperties: true - type: object - required: - - model - - prompt - title: OpenAICompletionRequestWithExtraBody - description: Request parameters for OpenAI-compatible completion endpoint. - OpenAICreateVectorStoreFileBatchRequestWithExtraBody: - properties: - file_ids: - items: - type: string - type: array - title: File Ids - attributes: - title: Attributes - additionalProperties: true - type: object - chunking_strategy: - title: Chunking Strategy - oneOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' - discriminator: - propertyName: type - mapping: - auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' - static: '#/components/schemas/VectorStoreChunkingStrategyStatic' - additionalProperties: true - type: object - required: - - file_ids - title: OpenAICreateVectorStoreFileBatchRequestWithExtraBody - description: Request to create a vector store file batch with extra_body support. - OpenAICreateVectorStoreRequestWithExtraBody: - properties: - name: - title: Name - type: string - file_ids: - title: File Ids - items: - type: string - type: array - expires_after: - title: Expires After - additionalProperties: true - type: object - chunking_strategy: - title: Chunking Strategy - additionalProperties: true - type: object - metadata: - title: Metadata - additionalProperties: true - type: object - additionalProperties: true - type: object - title: OpenAICreateVectorStoreRequestWithExtraBody - description: Request to create a vector store with extra_body support. - OpenAIDeveloperMessageParam: - properties: - role: - type: string - const: developer - title: Role - default: developer - content: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - name: - title: Name - type: string - type: object - required: - - content - title: OpenAIDeveloperMessageParam - description: A message from the developer in an OpenAI-compatible chat completion request. - OpenAIEmbeddingData: - properties: - object: - type: string - const: embedding - title: Object - default: embedding - embedding: - anyOf: - - items: - type: number - type: array - - type: string - title: Embedding - index: - type: integer - title: Index - type: object - required: - - embedding - - index - title: OpenAIEmbeddingData - description: A single embedding data object from an OpenAI-compatible embeddings response. - OpenAIEmbeddingUsage: - properties: - prompt_tokens: - type: integer - title: Prompt Tokens - total_tokens: - type: integer - title: Total Tokens - type: object - required: - - prompt_tokens - - total_tokens - title: OpenAIEmbeddingUsage - description: Usage information for an OpenAI-compatible embeddings response. - OpenAIEmbeddingsRequestWithExtraBody: - properties: - model: - type: string - title: Model - input: - anyOf: - - type: string - - items: - type: string - type: array - title: Input - encoding_format: - title: Encoding Format - default: float - type: string - dimensions: - title: Dimensions - type: integer - user: - title: User - type: string - additionalProperties: true - type: object - required: - - model - - input - title: OpenAIEmbeddingsRequestWithExtraBody - description: Request parameters for OpenAI-compatible embeddings endpoint. - OpenAIEmbeddingsResponse: - properties: - object: - type: string - const: list - title: Object - default: list - data: - items: - $ref: '#/components/schemas/OpenAIEmbeddingData' - type: array - title: Data - model: - type: string - title: Model - usage: - $ref: '#/components/schemas/OpenAIEmbeddingUsage' - type: object - required: - - data - - model - - usage - title: OpenAIEmbeddingsResponse - description: Response from an OpenAI-compatible embeddings request. - OpenAIFile: - properties: - type: - type: string - const: file - title: Type - default: file - file: - $ref: '#/components/schemas/OpenAIFileFile' - type: object - required: - - file - title: OpenAIFile - OpenAIFileFile: - properties: - file_data: - title: File Data - type: string - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - type: object - title: OpenAIFileFile - OpenAIFileObject: - properties: - object: - type: string - const: file - title: Object - default: file - id: - type: string - title: Id - bytes: - type: integer - title: Bytes - created_at: - type: integer - title: Created At - expires_at: - type: integer - title: Expires At - filename: - type: string - title: Filename - purpose: - $ref: '#/components/schemas/OpenAIFilePurpose' - type: object - required: - - id - - bytes - - created_at - - expires_at - - filename - - purpose - title: OpenAIFileObject - description: OpenAI File object as defined in the OpenAI Files API. - OpenAIFilePurpose: - type: string - enum: - - assistants - - batch - title: OpenAIFilePurpose - description: Valid purpose values for OpenAI Files API. - OpenAIImageURL: - properties: - url: - type: string - title: Url - detail: - title: Detail - type: string - type: object - required: - - url - title: OpenAIImageURL - description: Image URL specification for OpenAI-compatible chat completion messages. - OpenAIJSONSchema: - properties: - name: - type: string - title: Name - description: - title: Description - type: string - strict: - title: Strict - type: boolean - schema: - title: Schema - additionalProperties: true - type: object - type: object - title: OpenAIJSONSchema - description: JSON schema specification for OpenAI-compatible structured response format. - OpenAIResponseAnnotationCitation: - properties: - type: - type: string - const: url_citation - title: Type - default: url_citation - end_index: - type: integer - title: End Index - start_index: - type: integer - title: Start Index - title: - type: string - title: Title - url: - type: string - title: Url - type: object - required: - - end_index - - start_index - - title - - url - title: OpenAIResponseAnnotationCitation - description: URL citation annotation for referencing external web resources. - OpenAIResponseAnnotationContainerFileCitation: - properties: - type: - type: string - const: container_file_citation - title: Type - default: container_file_citation - container_id: - type: string - title: Container Id - end_index: - type: integer - title: End Index - file_id: - type: string - title: File Id - filename: - type: string - title: Filename - start_index: - type: integer - title: Start Index - type: object - required: - - container_id - - end_index - - file_id - - filename - - start_index - title: OpenAIResponseAnnotationContainerFileCitation - OpenAIResponseAnnotationFileCitation: - properties: - type: - type: string - const: file_citation - title: Type - default: file_citation - file_id: - type: string - title: File Id - filename: - type: string - title: Filename - index: - type: integer - title: Index - type: object - required: - - file_id - - filename - - index - title: OpenAIResponseAnnotationFileCitation - description: File citation annotation for referencing specific files in response content. - OpenAIResponseAnnotationFilePath: - properties: - type: - type: string - const: file_path - title: Type - default: file_path - file_id: - type: string - title: File Id - index: - type: integer - title: Index - type: object - required: - - file_id - - index - title: OpenAIResponseAnnotationFilePath - OpenAIResponseContentPartRefusal: - properties: - type: - type: string - const: refusal - title: Type - default: refusal - refusal: - type: string - title: Refusal - type: object - required: - - refusal - title: OpenAIResponseContentPartRefusal - description: Refusal content within a streamed response part. - OpenAIResponseError: - properties: - code: - type: string - title: Code - message: - type: string - title: Message - type: object - required: - - code - - message - title: OpenAIResponseError - description: Error details for failed OpenAI response requests. - OpenAIResponseFormatJSONObject: - properties: - type: - type: string - const: json_object - title: Type - default: json_object - type: object - title: OpenAIResponseFormatJSONObject - description: JSON object response format for OpenAI-compatible chat completion requests. - OpenAIResponseFormatJSONSchema: - properties: - type: - type: string - const: json_schema - title: Type - default: json_schema - json_schema: - $ref: '#/components/schemas/OpenAIJSONSchema' - type: object - required: - - json_schema - title: OpenAIResponseFormatJSONSchema - description: JSON schema response format for OpenAI-compatible chat completion requests. - OpenAIResponseFormatText: - properties: - type: - type: string - const: text - title: Type - default: text - type: object - title: OpenAIResponseFormatText - description: Text response format for OpenAI-compatible chat completion requests. - OpenAIResponseInputFunctionToolCallOutput: - properties: - call_id: - type: string - title: Call Id - output: - type: string - title: Output - type: - type: string - const: function_call_output - title: Type - default: function_call_output - id: - title: Id - type: string - status: - title: Status - type: string - type: object - required: - - call_id - - output - title: OpenAIResponseInputFunctionToolCallOutput - description: This represents the output of a function call that gets passed back to the model. - OpenAIResponseInputMessageContentFile: - properties: - type: - type: string - const: input_file - title: Type - default: input_file - file_data: - title: File Data - type: string - file_id: - title: File Id - type: string - file_url: - title: File Url - type: string - filename: - title: Filename - type: string - type: object - title: OpenAIResponseInputMessageContentFile - description: File content for input messages in OpenAI response format. - OpenAIResponseInputMessageContentImage: - properties: - detail: - anyOf: - - type: string - const: low - - type: string - const: high - - type: string - const: auto - title: Detail - default: auto - type: - type: string - const: input_image - title: Type - default: input_image - file_id: - title: File Id - type: string - image_url: - title: Image Url - type: string - type: object - title: OpenAIResponseInputMessageContentImage - description: Image content for input messages in OpenAI response format. - OpenAIResponseInputMessageContentText: - properties: - text: - type: string - title: Text - type: - type: string - const: input_text - title: Type - default: input_text - type: object - required: - - text - title: OpenAIResponseInputMessageContentText - description: Text content for input messages in OpenAI response format. - OpenAIResponseInputToolFileSearch: - properties: - type: - type: string - const: file_search - title: Type - default: file_search - vector_store_ids: - items: - type: string - type: array - title: Vector Store Ids - filters: - title: Filters - additionalProperties: true - type: object - max_num_results: - title: Max Num Results - default: 10 - type: integer - maximum: 50.0 - minimum: 1.0 - ranking_options: - $ref: '#/components/schemas/SearchRankingOptions' - type: object - required: - - vector_store_ids - title: OpenAIResponseInputToolFileSearch - description: File search tool configuration for OpenAI response inputs. - OpenAIResponseInputToolFunction: - properties: - type: - type: string - const: function - title: Type - default: function - name: - type: string - title: Name - description: - title: Description - type: string - parameters: - title: Parameters - additionalProperties: true - type: object - strict: - title: Strict - type: boolean - type: object - required: - - name - - parameters - title: OpenAIResponseInputToolFunction - description: Function tool configuration for OpenAI response inputs. - OpenAIResponseInputToolMCP: - properties: - type: - type: string - const: mcp - title: Type - default: mcp - server_label: - type: string - title: Server Label - server_url: - type: string - title: Server Url - headers: - title: Headers - additionalProperties: true - type: object - require_approval: - anyOf: - - type: string - const: always - - type: string - const: never - - $ref: '#/components/schemas/ApprovalFilter' - title: Require Approval - default: never - allowed_tools: - anyOf: - - items: - type: string - type: array - - $ref: '#/components/schemas/AllowedToolsFilter' - title: Allowed Tools - type: object - required: - - server_label - - server_url - title: OpenAIResponseInputToolMCP - description: Model Context Protocol (MCP) tool configuration for OpenAI response inputs. - OpenAIResponseInputToolWebSearch: - properties: - type: - anyOf: - - type: string - const: web_search - - type: string - const: web_search_preview - - type: string - const: web_search_preview_2025_03_11 - title: Type - default: web_search - search_context_size: - title: Search Context Size - default: medium - type: string - pattern: ^low|medium|high$ - type: object - title: OpenAIResponseInputToolWebSearch - description: Web search tool configuration for OpenAI response inputs. - OpenAIResponseMCPApprovalRequest: - properties: - arguments: - type: string - title: Arguments - id: - type: string - title: Id - name: - type: string - title: Name - server_label: - type: string - title: Server Label - type: - type: string - const: mcp_approval_request - title: Type - default: mcp_approval_request - type: object - required: - - arguments - - id - - name - - server_label - title: OpenAIResponseMCPApprovalRequest - description: A request for human approval of a tool invocation. - OpenAIResponseMCPApprovalResponse: - properties: - approval_request_id: - type: string - title: Approval Request Id - approve: - type: boolean - title: Approve - type: - type: string - const: mcp_approval_response - title: Type - default: mcp_approval_response - id: - title: Id - type: string - reason: - title: Reason - type: string - type: object - required: - - approval_request_id - - approve - title: OpenAIResponseMCPApprovalResponse - description: A response to an MCP approval request. - OpenAIResponseMessage-Input: - properties: - content: - anyOf: - - type: string - - items: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' - discriminator: - propertyName: type - mapping: - input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' - input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' - input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' - discriminator: - propertyName: type - mapping: - output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' - type: array - title: Content - role: - anyOf: - - type: string - const: system - - type: string - const: developer - - type: string - const: user - - type: string - const: assistant - title: Role - type: - type: string - const: message - title: Type - default: message - id: - title: Id - type: string - status: - title: Status - type: string - type: object - required: - - content - - role - title: OpenAIResponseMessage - description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." - OpenAIResponseMessage-Output: - properties: - content: - anyOf: - - type: string - - items: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' - discriminator: - propertyName: type - mapping: - input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' - input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' - input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' - type: array - - items: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' - discriminator: - propertyName: type - mapping: - output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' - type: array - title: Content - role: - anyOf: - - type: string - const: system - - type: string - const: developer - - type: string - const: user - - type: string - const: assistant - title: Role - type: - type: string - const: message - title: Type - default: message - id: - title: Id - type: string - status: - title: Status - type: string - type: object - required: - - content - - role - title: OpenAIResponseMessage - description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." - OpenAIResponseObject: - properties: - created_at: - type: integer - title: Created At - error: - $ref: '#/components/schemas/OpenAIResponseError' - id: - type: string - title: Id - model: - type: string - title: Model - object: - type: string - const: response - title: Object - default: response - output: - items: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage-Output' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - discriminator: - propertyName: type - mapping: - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - message: '#/components/schemas/OpenAIResponseMessage-Output' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - type: array - title: Output - parallel_tool_calls: - type: boolean - title: Parallel Tool Calls - default: false - previous_response_id: - title: Previous Response Id - type: string - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - status: - type: string - title: Status - temperature: - title: Temperature - type: number - text: - $ref: '#/components/schemas/OpenAIResponseText' - default: - format: - type: text - top_p: - title: Top P - type: number - tools: - title: Tools - items: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseToolMCP' - discriminator: - propertyName: type - mapping: - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseToolMCP' - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' - web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' - type: array - truncation: - title: Truncation - type: string - usage: - $ref: '#/components/schemas/OpenAIResponseUsage' - instructions: - title: Instructions - type: string - type: object - required: - - created_at - - id - - model - - output - - status - title: OpenAIResponseObject - description: Complete OpenAI response object containing generation results and metadata. - OpenAIResponseOutputMessageContentOutputText: - properties: - text: - type: string - title: Text - type: - type: string - const: output_text - title: Type - default: output_text - annotations: - items: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' - discriminator: - propertyName: type - mapping: - container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' - url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' - type: array - title: Annotations - type: object - required: - - text - title: OpenAIResponseOutputMessageContentOutputText - OpenAIResponseOutputMessageFileSearchToolCall: - properties: - id: - type: string - title: Id - queries: - items: - type: string - type: array - title: Queries - status: - type: string - title: Status - type: - type: string - const: file_search_call - title: Type - default: file_search_call - results: - title: Results - items: - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' - type: array - type: object - required: - - id - - queries - - status - title: OpenAIResponseOutputMessageFileSearchToolCall - description: File search tool call output message for OpenAI responses. - OpenAIResponseOutputMessageFileSearchToolCallResults: - properties: - attributes: - additionalProperties: true - type: object - title: Attributes - file_id: - type: string - title: File Id - filename: - type: string - title: Filename - score: - type: number - title: Score - text: - type: string - title: Text - type: object - required: - - attributes - - file_id - - filename - - score - - text - title: OpenAIResponseOutputMessageFileSearchToolCallResults - description: Search results returned by the file search operation. - OpenAIResponseOutputMessageFunctionToolCall: - properties: - call_id: - type: string - title: Call Id - name: - type: string - title: Name - arguments: - type: string - title: Arguments - type: - type: string - const: function_call - title: Type - default: function_call - id: - title: Id - type: string - status: - title: Status - type: string - type: object - required: - - call_id - - name - - arguments - title: OpenAIResponseOutputMessageFunctionToolCall - description: Function tool call output message for OpenAI responses. - OpenAIResponseOutputMessageMCPCall: - properties: - id: - type: string - title: Id - type: - type: string - const: mcp_call - title: Type - default: mcp_call - arguments: - type: string - title: Arguments - name: - type: string - title: Name - server_label: - type: string - title: Server Label - error: - title: Error - type: string - output: - title: Output - type: string - type: object - required: - - id - - arguments - - name - - server_label - title: OpenAIResponseOutputMessageMCPCall - description: Model Context Protocol (MCP) call output message for OpenAI responses. - OpenAIResponseOutputMessageMCPListTools: - properties: - id: - type: string - title: Id - type: - type: string - const: mcp_list_tools - title: Type - default: mcp_list_tools - server_label: - type: string - title: Server Label - tools: - items: - $ref: '#/components/schemas/MCPListToolsTool' - type: array - title: Tools - type: object - required: - - id - - server_label - - tools - title: OpenAIResponseOutputMessageMCPListTools - description: MCP list tools output message containing available tools from an MCP server. - OpenAIResponseOutputMessageWebSearchToolCall: - properties: - id: - type: string - title: Id - status: - type: string - title: Status - type: - type: string - const: web_search_call - title: Type - default: web_search_call - type: object - required: - - id - - status - title: OpenAIResponseOutputMessageWebSearchToolCall - description: Web search tool call output message for OpenAI responses. - OpenAIResponsePrompt: - properties: - id: - type: string - title: Id - variables: - title: Variables - additionalProperties: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' - discriminator: - propertyName: type - mapping: - input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' - input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' - input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' - type: object - version: - title: Version - type: string - type: object - required: - - id - title: OpenAIResponsePrompt - description: OpenAI compatible Prompt object that is used in OpenAI responses. - OpenAIResponseText: - properties: - format: - $ref: '#/components/schemas/OpenAIResponseTextFormat' - type: object - title: OpenAIResponseText - description: Text response configuration for OpenAI responses. - OpenAIResponseTextFormat: - properties: - type: - anyOf: - - type: string - const: text - - type: string - const: json_schema - - type: string - const: json_object - title: Type - name: - title: Name - type: string - schema: - title: Schema - additionalProperties: true - type: object - description: - title: Description - type: string - strict: - title: Strict - type: boolean - type: object - title: OpenAIResponseTextFormat - description: Configuration for Responses API text format. - OpenAIResponseToolMCP: - properties: - type: - type: string - const: mcp - title: Type - default: mcp - server_label: - type: string - title: Server Label - allowed_tools: - anyOf: - - items: - type: string - type: array - - $ref: '#/components/schemas/AllowedToolsFilter' - title: Allowed Tools - type: object - required: - - server_label - title: OpenAIResponseToolMCP - description: Model Context Protocol (MCP) tool configuration for OpenAI response object. - OpenAIResponseUsage: - properties: - input_tokens: - type: integer - title: Input Tokens - output_tokens: - type: integer - title: Output Tokens - total_tokens: - type: integer - title: Total Tokens - input_tokens_details: - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' - output_tokens_details: - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' - type: object - required: - - input_tokens - - output_tokens - - total_tokens - title: OpenAIResponseUsage - description: Usage information for OpenAI response. - OpenAIResponseUsageInputTokensDetails: - properties: - cached_tokens: - title: Cached Tokens - type: integer - type: object - title: OpenAIResponseUsageInputTokensDetails - description: Token details for input tokens in OpenAI response usage. - OpenAIResponseUsageOutputTokensDetails: - properties: - reasoning_tokens: - title: Reasoning Tokens - type: integer - type: object - title: OpenAIResponseUsageOutputTokensDetails - description: Token details for output tokens in OpenAI response usage. - OpenAISystemMessageParam: - properties: - role: - type: string - const: system - title: Role - default: system - content: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - name: - title: Name - type: string - type: object - required: - - content - title: OpenAISystemMessageParam - description: A system message providing instructions or context to the model. - OpenAITokenLogProb: - properties: - token: - type: string - title: Token - bytes: - title: Bytes - items: - type: integer - type: array - logprob: - type: number - title: Logprob - top_logprobs: - items: - $ref: '#/components/schemas/OpenAITopLogProb' - type: array - title: Top Logprobs - type: object - required: - - token - - logprob - - top_logprobs - title: OpenAITokenLogProb - description: The log probability for a token from an OpenAI-compatible chat completion response. - OpenAIToolMessageParam: - properties: - role: - type: string - const: tool - title: Role - default: tool - tool_call_id: - type: string - title: Tool Call Id - content: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - type: object - required: - - tool_call_id - - content - title: OpenAIToolMessageParam - description: A message representing the result of a tool invocation in an OpenAI-compatible chat completion request. - OpenAITopLogProb: - properties: - token: - type: string - title: Token - bytes: - title: Bytes - items: - type: integer - type: array - logprob: - type: number - title: Logprob - type: object - required: - - token - - logprob - title: OpenAITopLogProb - description: The top log probability for a token from an OpenAI-compatible chat completion response. - OpenAIUserMessageParam-Input: - properties: - role: - type: string - const: user - title: Role - default: user - content: - anyOf: - - type: string - - items: - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - - $ref: '#/components/schemas/OpenAIFile' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/OpenAIFile' - image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - name: - title: Name - type: string - type: object - required: - - content - title: OpenAIUserMessageParam - description: A message from the user in an OpenAI-compatible chat completion request. - OpenAIUserMessageParam-Output: - properties: - role: - type: string - const: user - title: Role - default: user - content: - anyOf: - - type: string - - items: - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - - $ref: '#/components/schemas/OpenAIFile' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/OpenAIFile' - image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - name: - title: Name - type: string - type: object - required: - - content - title: OpenAIUserMessageParam - description: A message from the user in an OpenAI-compatible chat completion request. - Order: - type: string - enum: - - asc - - desc - title: Order - description: Sort order for paginated responses. - OutputTokensDetails: - properties: - reasoning_tokens: - type: integer - title: Reasoning Tokens - additionalProperties: true - type: object - required: - - reasoning_tokens - title: OutputTokensDetails - Prompt: - properties: - prompt: - title: Prompt - description: The system prompt with variable placeholders - type: string - version: - type: integer - minimum: 1.0 - title: Version - description: Version (integer starting at 1, incremented on save) - prompt_id: - type: string - title: Prompt Id - description: Unique identifier in format 'pmpt_<48-digit-hash>' - variables: - items: - type: string - type: array - title: Variables - description: List of variable names that can be used in the prompt template - is_default: - type: boolean - title: Is Default - description: Boolean indicating whether this version is the default version - default: false - type: object - required: - - version - - prompt_id - title: Prompt - description: A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack. - ProviderInfo: - properties: - api: - type: string - title: Api - provider_id: - type: string - title: Provider Id - provider_type: - type: string - title: Provider Type - config: - additionalProperties: true - type: object - title: Config - health: - additionalProperties: true - type: object - title: Health - type: object - required: - - api - - provider_id - - provider_type - - config - - health - title: ProviderInfo - description: Information about a registered provider including its configuration and health status. - QueryChunksResponse: - properties: - chunks: - items: - $ref: '#/components/schemas/Chunk-Output' - type: array - title: Chunks - scores: - items: - type: number - type: array - title: Scores - type: object - required: - - chunks - - scores - title: QueryChunksResponse - description: Response from querying chunks in a vector database. - RAGQueryConfig: - properties: - query_generator_config: - oneOf: - - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' - - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' - title: Query Generator Config - default: - type: default - separator: ' ' - discriminator: - propertyName: type - mapping: - default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' - llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' - max_tokens_in_context: - type: integer - title: Max Tokens In Context - default: 4096 - max_chunks: - type: integer - title: Max Chunks - default: 5 - chunk_template: - type: string - title: Chunk Template - default: "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n" - mode: - default: vector - $ref: '#/components/schemas/RAGSearchMode' - ranker: - title: Ranker - oneOf: - - $ref: '#/components/schemas/RRFRanker' - - $ref: '#/components/schemas/WeightedRanker' - discriminator: - propertyName: type - mapping: - rrf: '#/components/schemas/RRFRanker' - weighted: '#/components/schemas/WeightedRanker' - type: object - title: RAGQueryConfig - description: Configuration for the RAG query generation. - RAGQueryResult: - properties: - content: + title: Output + description: List of generated output items (messages, tool calls, etc.) + parallel_tool_calls: + type: boolean + title: Parallel Tool Calls + description: Whether tool calls can be executed in parallel + default: false + previous_response_id: anyOf: - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' + - type: 'null' + title: Previous Response Id + description: ID of the previous response in a conversation + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + description: Reference to a prompt template and its variables. + status: + type: string + title: Status + description: Current status of the response generation + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Sampling temperature used for generation + text: + $ref: '#/components/schemas/OpenAIResponseText' + description: Text formatting configuration for the response + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + description: Nucleus sampling parameter used for generation + tools: + anyOf: - items: oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' type: array - title: Content - metadata: - additionalProperties: true - type: object - title: Metadata - type: object - title: RAGQueryResult - description: Result of a RAG query containing retrieved content and metadata. - RAGSearchMode: - type: string - enum: - - vector - - keyword - - hybrid - title: RAGSearchMode - description: "Search modes for RAG query retrieval:\n- VECTOR: Uses vector similarity search for semantic matching\n- KEYWORD: Uses keyword-based search for exact matching\n- HYBRID: Combines both vector and keyword search for better results" - RRFRanker: - properties: - type: - type: string - const: rrf - title: Type - default: rrf - impact_factor: - type: number - title: Impact Factor - default: 60.0 - minimum: 0.0 - type: object - title: RRFRanker - description: Reciprocal Rank Fusion (RRF) ranker configuration. - RegexParserScoringFnParams: - properties: - type: - type: string - const: regex_parser - title: Type - default: regex_parser - parsing_regexes: - items: - type: string - type: array - title: Parsing Regexes - description: Regex to extract the answer from generated response - aggregation_functions: - items: - $ref: '#/components/schemas/AggregationFunctionType' - type: array - title: Aggregation Functions - description: Aggregation functions to apply to the scores of each row - type: object - title: RegexParserScoringFnParams - description: Parameters for regex parser scoring function configuration. - RouteInfo: - properties: - route: - type: string - title: Route - method: - type: string - title: Method - provider_types: + - type: 'null' + title: Tools + description: An array of tools the model may call while generating a response. + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + description: Truncation strategy applied to the response + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + description: Token usage information for the response + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + description: System message inserted into the model's context + input: items: - type: string - type: array - title: Provider Types - type: object - required: - - route - - method - - provider_types - title: RouteInfo - description: Information about an API route including its path, method, and implementing providers. - RunShieldResponse: - properties: - violation: - $ref: '#/components/schemas/SafetyViolation' - type: object - title: RunShieldResponse - description: Response from running a safety shield. - SafetyViolation: - properties: - violation_level: - $ref: '#/components/schemas/ViolationLevel' - user_message: - title: User Message - type: string - metadata: - additionalProperties: true - type: object - title: Metadata - type: object - required: - - violation_level - title: SafetyViolation - description: Details of a safety violation detected by content moderation. - ScoreBatchResponse: - properties: - dataset_id: - title: Dataset Id - type: string - results: - additionalProperties: - $ref: '#/components/schemas/ScoringResult' - type: object - title: Results - type: object - required: - - results - title: ScoreBatchResponse - description: Response from batch scoring operations on datasets. - ScoreResponse: - properties: - results: - additionalProperties: - $ref: '#/components/schemas/ScoringResult' - type: object - title: Results - type: object - required: - - results - title: ScoreResponse - description: The response from scoring. - ScoringFn-Output: - properties: - identifier: - type: string - title: Identifier - description: Unique identifier for this resource in llama stack - provider_resource_id: - title: Provider Resource Id - description: Unique identifier for this resource in the provider - type: string - provider_id: - type: string - title: Provider Id - description: ID of the provider that owns this resource - type: - type: string - const: scoring_function - title: Type - default: scoring_function - description: - title: Description - type: string - metadata: - additionalProperties: true - type: object - title: Metadata - description: Any additional metadata for this definition - return_type: - oneOf: - - $ref: '#/components/schemas/StringType' - - $ref: '#/components/schemas/NumberType' - - $ref: '#/components/schemas/BooleanType' - - $ref: '#/components/schemas/ArrayType' - - $ref: '#/components/schemas/ObjectType' - - $ref: '#/components/schemas/JsonType' - - $ref: '#/components/schemas/UnionType' - - $ref: '#/components/schemas/ChatCompletionInputType' - - $ref: '#/components/schemas/CompletionInputType' - - $ref: '#/components/schemas/AgentTurnInputType' - title: Return Type - description: The return type of the deterministic function - discriminator: - propertyName: type - mapping: - agent_turn_input: '#/components/schemas/AgentTurnInputType' - array: '#/components/schemas/ArrayType' - boolean: '#/components/schemas/BooleanType' - chat_completion_input: '#/components/schemas/ChatCompletionInputType' - completion_input: '#/components/schemas/CompletionInputType' - json: '#/components/schemas/JsonType' - number: '#/components/schemas/NumberType' - object: '#/components/schemas/ObjectType' - string: '#/components/schemas/StringType' - union: '#/components/schemas/UnionType' - params: - title: Params - description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval - oneOf: - - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - - $ref: '#/components/schemas/RegexParserScoringFnParams' - - $ref: '#/components/schemas/BasicScoringFnParams' - discriminator: - propertyName: type - mapping: - basic: '#/components/schemas/BasicScoringFnParams' - llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' - regex_parser: '#/components/schemas/RegexParserScoringFnParams' + anyOf: + - oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + type: array + title: Input + description: List of input items that led to this response type: object required: - - identifier - - provider_id - - return_type - title: ScoringFn - description: A scoring function resource for evaluating model outputs. - ScoringResult: + - created_at + - id + - model + - output + - status + - input + title: OpenAIResponseObjectWithInput + description: "OpenAI response object extended with input context information.\n\n:param input: List of input items that led to this response" + OpenAIResponseOutputMessageContentOutputText: properties: - score_rows: + text: + type: string + title: Text + type: + type: string + const: output_text + title: Type + default: output_text + annotations: items: - additionalProperties: true - type: object + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + discriminator: + propertyName: type + mapping: + container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' + url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' type: array - title: Score Rows - aggregated_results: - additionalProperties: true - type: object - title: Aggregated Results + title: Annotations type: object required: - - score_rows - - aggregated_results - title: ScoringResult - description: A scoring result for a single row. - SearchRankingOptions: - properties: - ranker: - title: Ranker - type: string - score_threshold: - title: Score Threshold - default: 0.0 - type: number - type: object - title: SearchRankingOptions - description: Options for ranking and filtering search results. - Shield: + - text + title: OpenAIResponseOutputMessageContentOutputText + OpenAIResponseOutputMessageFileSearchToolCall: properties: - identifier: - type: string - title: Identifier - description: Unique identifier for this resource in llama stack - provider_resource_id: - title: Provider Resource Id - description: Unique identifier for this resource in the provider + id: type: string - provider_id: + title: Id + description: Unique identifier for this tool call + queries: + items: + type: string + type: array + title: Queries + description: List of search queries executed + status: type: string - title: Provider Id - description: ID of the provider that owns this resource + title: Status + description: Current status of the file search operation type: type: string - const: shield + const: file_search_call title: Type - default: shield - params: - title: Params - additionalProperties: true - type: object + description: Tool call type identifier, always "file_search_call" + default: file_search_call + results: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' + type: array + - type: 'null' + title: Results + description: Search results returned by the file search operation type: object required: - - identifier - - provider_id - title: Shield - description: A safety shield resource that can be used to check content. - StringType: + - id + - queries + - status + title: OpenAIResponseOutputMessageFileSearchToolCall + description: "File search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param queries: List of search queries executed\n:param status: Current status of the file search operation\n:param type: Tool call type identifier, always \"file_search_call\"\n:param results: (Optional) Search results returned by the file search operation" + OpenAIResponseOutputMessageFileSearchToolCallResults: properties: - type: + attributes: + additionalProperties: true + type: object + title: Attributes + description: Key-value attributes associated with the file + file_id: type: string - const: string - title: Type - default: string - type: object - title: StringType - description: Parameter type for string values. - TextContentItem: - properties: - type: + title: File Id + description: Unique identifier of the file containing the result + filename: type: string - const: text - title: Type - default: text + title: Filename + description: Name of the file containing the result + score: + type: number + title: Score + description: Relevance score for this search result (between 0 and 1) text: type: string title: Text + description: Text content of the search result type: object required: + - attributes + - file_id + - filename + - score - text - title: TextContentItem - description: A text content item - ToolDef: + title: OpenAIResponseOutputMessageFileSearchToolCallResults + description: "Search results returned by the file search operation.\n\n:param attributes: (Optional) Key-value attributes associated with the file\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result (between 0 and 1)\n:param text: Text content of the search result" + OpenAIResponseOutputMessageFunctionToolCall: properties: - toolgroup_id: - title: Toolgroup Id + call_id: type: string + title: Call Id + description: Unique identifier for the function call name: type: string title: Name - description: - title: Description + description: Name of the function being called + arguments: type: string - input_schema: - title: Input Schema - additionalProperties: true - type: object - output_schema: - title: Output Schema - additionalProperties: true - type: object - metadata: - title: Metadata - additionalProperties: true - type: object + title: Arguments + description: JSON string containing the function arguments + type: + type: string + const: function_call + title: Type + description: Tool call type identifier, always "function_call" + default: function_call + id: + anyOf: + - type: string + - type: 'null' + title: Id + description: Additional identifier for the tool call + status: + anyOf: + - type: string + - type: 'null' + title: Status + description: Current status of the function call execution type: object required: + - call_id - name - title: ToolDef - description: Tool definition used in runtime contexts. - ToolGroup: + - arguments + title: OpenAIResponseOutputMessageFunctionToolCall + description: "Function tool call output message for OpenAI responses.\n\n:param call_id: Unique identifier for the function call\n:param name: Name of the function being called\n:param arguments: JSON string containing the function arguments\n:param type: Tool call type identifier, always \"function_call\"\n:param id: (Optional) Additional identifier for the tool call\n:param status: (Optional) Current status of the function call execution" + OpenAIResponseOutputMessageMCPCall: properties: - identifier: - type: string - title: Identifier - description: Unique identifier for this resource in llama stack - provider_resource_id: - title: Provider Resource Id - description: Unique identifier for this resource in the provider - type: string - provider_id: + id: type: string - title: Provider Id - description: ID of the provider that owns this resource + title: Id + description: Unique identifier for this MCP call type: type: string - const: tool_group + const: mcp_call title: Type - default: tool_group - mcp_endpoint: - $ref: '#/components/schemas/URL' - args: - title: Args - additionalProperties: true - type: object - type: object - required: - - identifier - - provider_id - title: ToolGroup - description: A group of related tools managed together. - ToolInvocationResult: - properties: - content: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - title: Content - error_message: - title: Error Message + description: Tool call type identifier, always "mcp_call" + default: mcp_call + arguments: type: string - error_code: - title: Error Code - type: integer - metadata: - title: Metadata - additionalProperties: true - type: object - type: object - title: ToolInvocationResult - description: Result of a tool invocation. - URL: - properties: - uri: + title: Arguments + description: JSON string containing the MCP call arguments + name: + type: string + title: Name + description: Name of the MCP method being called + server_label: type: string - title: Uri + title: Server Label + description: Label identifying the MCP server handling the call + error: + anyOf: + - type: string + - type: 'null' + title: Error + description: Error message if the MCP call failed + output: + anyOf: + - type: string + - type: 'null' + title: Output + description: Output result from the successful MCP call type: object required: - - uri - title: URL - description: A URL reference to external content. - UnionType: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + description: "Model Context Protocol (MCP) call output message for OpenAI responses.\n\n:param id: Unique identifier for this MCP call\n:param type: Tool call type identifier, always \"mcp_call\"\n:param arguments: JSON string containing the MCP call arguments\n:param name: Name of the MCP method being called\n:param server_label: Label identifying the MCP server handling the call\n:param error: (Optional) Error message if the MCP call failed\n:param output: (Optional) Output result from the successful MCP call" + OpenAIResponseOutputMessageMCPListTools: properties: + id: + type: string + title: Id + description: Unique identifier for this MCP list tools operation type: type: string - const: union + const: mcp_list_tools title: Type - default: union + description: Tool call type identifier, always "mcp_list_tools" + default: mcp_list_tools + server_label: + type: string + title: Server Label + description: Label identifying the MCP server providing the tools + tools: + items: + $ref: '#/components/schemas/MCPListToolsTool' + type: array + title: Tools + description: List of available tools provided by the MCP server type: object - title: UnionType - description: Parameter type for union values. - VectorStoreChunkingStrategyAuto: + required: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + description: "MCP list tools output message containing available tools from an MCP server.\n\n:param id: Unique identifier for this MCP list tools operation\n:param type: Tool call type identifier, always \"mcp_list_tools\"\n:param server_label: Label identifying the MCP server providing the tools\n:param tools: List of available tools provided by the MCP server" + OpenAIResponseOutputMessageWebSearchToolCall: properties: + id: + type: string + title: Id + description: Unique identifier for this tool call + status: + type: string + title: Status + description: Current status of the web search operation type: type: string - const: auto + const: web_search_call title: Type - default: auto + description: Tool call type identifier, always "web_search_call" + default: web_search_call type: object - title: VectorStoreChunkingStrategyAuto - description: Automatic chunking strategy for vector store files. - VectorStoreChunkingStrategyStatic: + required: + - id + - status + title: OpenAIResponseOutputMessageWebSearchToolCall + description: "Web search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param status: Current status of the web search operation\n:param type: Tool call type identifier, always \"web_search_call\"" + OpenAIResponsePrompt: properties: - type: + id: type: string - const: static - title: Type - default: static - static: - $ref: '#/components/schemas/VectorStoreChunkingStrategyStaticConfig' + title: Id + description: Unique identifier of the prompt template + variables: + anyOf: + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: object + - type: 'null' + title: Variables + description: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files. + version: + anyOf: + - type: string + - type: 'null' + title: Version + description: Version number of the prompt to use (defaults to latest if not specified) type: object required: - - static - title: VectorStoreChunkingStrategyStatic - description: Static chunking strategy with configurable parameters. - VectorStoreChunkingStrategyStaticConfig: + - id + title: OpenAIResponsePrompt + description: "OpenAI compatible Prompt object that is used in OpenAI responses.\n\n:param id: Unique identifier of the prompt template\n:param variables: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types\nlike images or files.\n:param version: Version number of the prompt to use (defaults to latest if not specified)" + OpenAIResponseText: properties: - chunk_overlap_tokens: - type: integer - title: Chunk Overlap Tokens - default: 400 - max_chunk_size_tokens: - type: integer - maximum: 4096.0 - minimum: 100.0 - title: Max Chunk Size Tokens - default: 800 + format: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseTextFormat' + - type: 'null' + description: Text format configuration specifying output format requirements type: object - title: VectorStoreChunkingStrategyStaticConfig - description: Configuration for static chunking strategy. - VectorStoreContent: + title: OpenAIResponseText + description: "Text response configuration for OpenAI responses.\n\n:param format: (Optional) Text format configuration specifying output format requirements" + OpenAIResponseTextFormat: properties: type: - type: string - const: text + anyOf: + - type: string + const: text + - type: string + const: json_schema + - type: string + const: json_object title: Type - text: - type: string - title: Text + name: + anyOf: + - type: string + - type: 'null' + title: Name + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict type: object - required: - - type - - text - title: VectorStoreContent - description: Content item from a vector store file or search result. - VectorStoreFileBatchObject: + title: OpenAIResponseTextFormat + description: "Configuration for Responses API text format.\n\n:param type: Must be \"text\", \"json_schema\", or \"json_object\" to identify the format type\n:param name: The name of the response format. Only used for json_schema.\n:param schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model. Only used for json_schema.\n:param description: (Optional) A description of the response format. Only used for json_schema.\n:param strict: (Optional) Whether to strictly enforce the JSON schema. If true, the response must match the schema exactly. Only used for json_schema." + OpenAIResponseToolMCP: properties: - id: - type: string - title: Id - object: + type: type: string - title: Object - default: vector_store.file_batch - created_at: - type: integer - title: Created At - vector_store_id: + const: mcp + title: Type + description: Tool type identifier, always "mcp" + default: mcp + server_label: type: string - title: Vector Store Id - status: + title: Server Label + description: Label to identify this MCP server + allowed_tools: anyOf: - - type: string - const: completed - - type: string - const: in_progress - - type: string - const: cancelled - - type: string - const: failed - title: Status - file_counts: - $ref: '#/components/schemas/VectorStoreFileCounts' + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + title: Allowed Tools + description: Restriction on which tools can be used from this server type: object required: - - id - - created_at - - vector_store_id - - status - - file_counts - title: VectorStoreFileBatchObject - description: OpenAI Vector Store File Batch object. - VectorStoreFileCounts: + - server_label + title: OpenAIResponseToolMCP + description: "Model Context Protocol (MCP) tool configuration for OpenAI response object.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + OpenAIResponseUsage: properties: - completed: - type: integer - title: Completed - cancelled: - type: integer - title: Cancelled - failed: + input_tokens: type: integer - title: Failed - in_progress: + title: Input Tokens + description: Number of tokens in the input + output_tokens: type: integer - title: In Progress - total: + title: Output Tokens + description: Number of tokens in the output + total_tokens: type: integer - title: Total + title: Total Tokens + description: Total tokens used (input + output) + input_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' + - type: 'null' + description: Detailed breakdown of input token usage + output_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + - type: 'null' + description: Detailed breakdown of output token usage type: object required: - - completed - - cancelled - - failed - - in_progress - - total - title: VectorStoreFileCounts - description: File processing status counts for a vector store. - VectorStoreFileLastError: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + description: "Usage information for OpenAI response.\n\n:param input_tokens: Number of tokens in the input\n:param output_tokens: Number of tokens in the output\n:param total_tokens: Total tokens used (input + output)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + OpenAIResponseUsageInputTokensDetails: properties: - code: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens + description: Number of tokens retrieved from cache + type: object + title: OpenAIResponseUsageInputTokensDetails + description: "Token details for input tokens in OpenAI response usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + OpenAIResponseUsageOutputTokensDetails: + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens + description: Number of tokens used for reasoning (o1/o3 models) + type: object + title: OpenAIResponseUsageOutputTokensDetails + description: "Token details for output tokens in OpenAI response usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + OpenAISystemMessageParam: + properties: + role: + type: string + const: system + title: Role + default: system + content: anyOf: - type: string - const: server_error + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + anyOf: - type: string - const: rate_limit_exceeded - title: Code - message: + - type: 'null' + title: Name + type: object + required: + - content + title: OpenAISystemMessageParam + description: A system message providing instructions or context to the model. + OpenAITokenLogProb: + properties: + token: type: string - title: Message + title: Token + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + type: number + title: Logprob + top_logprobs: + items: + $ref: '#/components/schemas/OpenAITopLogProb' + type: array + title: Top Logprobs type: object required: - - code - - message - title: VectorStoreFileLastError - description: Error information for failed vector store file processing. - VectorStoreFileObject: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + description: "The log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token\n:top_logprobs: The top log probabilities for the token" + OpenAIToolMessageParam: properties: - id: + role: type: string - title: Id - object: + const: tool + title: Role + default: tool + tool_call_id: type: string - title: Object - default: vector_store.file - attributes: - additionalProperties: true - type: object - title: Attributes - chunking_strategy: - oneOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' - title: Chunking Strategy - discriminator: - propertyName: type - mapping: - auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' - static: '#/components/schemas/VectorStoreChunkingStrategyStatic' - created_at: - type: integer - title: Created At - last_error: - $ref: '#/components/schemas/VectorStoreFileLastError' - status: + title: Tool Call Id + content: anyOf: - type: string - const: completed - - type: string - const: in_progress - - type: string - const: cancelled - - type: string - const: failed - title: Status - usage_bytes: - type: integer - title: Usage Bytes - default: 0 - vector_store_id: - type: string - title: Vector Store Id + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content type: object required: - - id - - chunking_strategy - - created_at - - status - - vector_store_id - title: VectorStoreFileObject - description: OpenAI Vector Store File object. - VectorStoreObject: + - tool_call_id + - content + title: OpenAIToolMessageParam + description: A message representing the result of a tool invocation in an OpenAI-compatible chat completion request. + OpenAITopLogProb: properties: - id: + token: type: string - title: Id - object: + title: Token + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + type: number + title: Logprob + type: object + required: + - token + - logprob + title: OpenAITopLogProb + description: "The top log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token" + OpenAIUserMessageParam-Input: + properties: + role: type: string - title: Object - default: vector_store - created_at: - type: integer - title: Created At + const: user + title: Role + default: user + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/OpenAIFile' + image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content name: + anyOf: + - type: string + - type: 'null' title: Name - type: string - usage_bytes: - type: integer - title: Usage Bytes - default: 0 - file_counts: - $ref: '#/components/schemas/VectorStoreFileCounts' - status: - type: string - title: Status - default: completed - expires_after: - title: Expires After - additionalProperties: true - type: object - expires_at: - title: Expires At - type: integer - last_active_at: - title: Last Active At - type: integer - metadata: - additionalProperties: true - type: object - title: Metadata type: object required: - - id - - created_at - - file_counts - title: VectorStoreObject - description: OpenAI Vector Store object. - VectorStoreSearchResponse: + - content + title: OpenAIUserMessageParam + description: A message from the user in an OpenAI-compatible chat completion request. + OpenAIUserMessageParam-Output: properties: - file_id: - type: string - title: File Id - filename: + role: type: string - title: Filename - score: - type: number - title: Score - attributes: - title: Attributes - additionalProperties: - anyOf: - - type: string - - type: number - - type: boolean - type: object + const: user + title: Role + default: user content: - items: - $ref: '#/components/schemas/VectorStoreContent' - type: array + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' + discriminator: + propertyName: type + mapping: + file: '#/components/schemas/OpenAIFile' + image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name type: object required: - - file_id - - filename - - score - content - title: VectorStoreSearchResponse - description: Response from searching a vector store. - VectorStoreSearchResponsePage: + title: OpenAIUserMessageParam + description: A message from the user in an OpenAI-compatible chat completion request. + Order: + type: string + enum: + - asc + - desc + title: Order + description: Sort order for paginated responses. + OutputTokensDetails: + properties: + reasoning_tokens: + type: integer + title: Reasoning Tokens + additionalProperties: true + type: object + required: + - reasoning_tokens + title: OutputTokensDetails + Prompt: properties: - object: - type: string - title: Object - default: vector_store.search_results.page - search_query: + prompt: + anyOf: + - type: string + - type: 'null' + title: Prompt + description: The system prompt text with variable placeholders. Variables are only supported when using the Responses API. + version: + type: integer + minimum: 1.0 + title: Version + description: Version (integer starting at 1, incremented on save). + prompt_id: type: string - title: Search Query - data: + title: Prompt Id + description: Unique identifier formatted as 'pmpt_<48-digit-hash>'. + variables: items: - $ref: '#/components/schemas/VectorStoreSearchResponse' + type: string type: array - title: Data - has_more: + title: Variables + description: List of prompt variable names that can be used in the prompt template. + is_default: type: boolean - title: Has More + title: Is Default + description: Boolean indicating whether this version is the default version for this prompt. default: false - next_page: - title: Next Page - type: string type: object required: - - search_query - - data - title: VectorStoreSearchResponsePage - description: Paginated response from searching a vector store. - VersionInfo: + - version + - prompt_id + title: Prompt + description: A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack. + ProviderInfo: properties: - version: + api: type: string - title: Version + title: Api + description: The API name this provider implements + provider_id: + type: string + title: Provider Id + description: Unique identifier for the provider + provider_type: + type: string + title: Provider Type + description: The type of provider implementation + config: + additionalProperties: true + type: object + title: Config + description: Configuration parameters for the provider + health: + additionalProperties: true + type: object + title: Health + description: Current health status of the provider type: object required: - - version - title: VersionInfo - description: Version information for the service. - ViolationLevel: - type: string - enum: - - info - - warn - - error - title: ViolationLevel - description: Severity level of a safety violation. - WeightedRanker: + - api + - provider_id + - provider_type + - config + - health + title: ProviderInfo + description: Information about a registered provider including its configuration and health status. + QueryChunksRequest: properties: - type: + vector_store_id: type: string - const: weighted - title: Type - default: weighted - alpha: - type: number - maximum: 1.0 - minimum: 0.0 - title: Alpha - description: Weight factor between 0 and 1. 0 means only keyword scores, 1 means only vector scores. - default: 0.5 + title: Vector Store Id + description: The identifier of the vector database to query. + query: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Query + description: The query to search for. + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + description: The parameters of the query. type: object - title: WeightedRanker - description: Weighted ranker configuration that combines vector and keyword scores. - _URLOrData: + required: + - vector_store_id + - query + title: QueryChunksRequest + description: Request to query chunks from a vector database. + QueryChunksResponse: properties: - url: - $ref: '#/components/schemas/URL' - data: - contentEncoding: base64 - title: Data - type: string + chunks: + items: + $ref: '#/components/schemas/Chunk-Output' + type: array + title: Chunks + scores: + items: + type: number + type: array + title: Scores type: object - title: _URLOrData - description: A URL or a base64 encoded string - _batches_Request: + required: + - chunks + - scores + title: QueryChunksResponse + description: Response from querying chunks in a vector database. + RAGDocument: properties: - input_file_id: - type: string - title: Input File Id - endpoint: - type: string - title: Endpoint - completion_window: + document_id: type: string - title: Completion Window + title: Document Id + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + title: Content + mime_type: + anyOf: + - type: string + - type: 'null' + title: Mime Type metadata: - type: string + additionalProperties: true + type: object title: Metadata - idempotency_key: - type: string - title: Idempotency Key - type: object - required: - - input_file_id - - endpoint - - completion_window - - metadata - - idempotency_key - title: _batches_Request - _batches_batch_id_cancel_Request: - properties: - batch_id: - type: string - title: Batch Id type: object required: - - batch_id - title: _batches_batch_id_cancel_Request - _conversations_Request: + - document_id + - content + title: RAGDocument + description: "A document to be used for document ingestion in the RAG Tool.\n\n:param document_id: The unique identifier for the document.\n:param content: The content of the document.\n:param mime_type: The MIME type of the document.\n:param metadata: Additional metadata for the document." + RAGQueryConfig: properties: - items: + query_generator_config: oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage-Input' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - title: Items + - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' + title: Query Generator Config + default: + type: default + separator: ' ' discriminator: propertyName: type mapping: - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - message: '#/components/schemas/OpenAIResponseMessage-Input' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - metadata: + default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' + max_tokens_in_context: + type: integer + title: Max Tokens In Context + default: 4096 + max_chunks: + type: integer + title: Max Chunks + default: 5 + chunk_template: type: string + title: Chunk Template + default: "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n" + mode: + anyOf: + - $ref: '#/components/schemas/RAGSearchMode' + - type: 'null' + default: vector + ranker: + anyOf: + - oneOf: + - $ref: '#/components/schemas/RRFRanker' + - $ref: '#/components/schemas/WeightedRanker' + discriminator: + propertyName: type + mapping: + rrf: '#/components/schemas/RRFRanker' + weighted: '#/components/schemas/WeightedRanker' + - type: 'null' + title: Ranker + type: object + title: RAGQueryConfig + description: "Configuration for the RAG query generation.\n\n:param query_generator_config: Configuration for the query generator.\n:param max_tokens_in_context: Maximum number of tokens in the context.\n:param max_chunks: Maximum number of chunks to retrieve.\n:param chunk_template: Template for formatting each retrieved chunk in the context.\n Available placeholders: {index} (1-based chunk ordinal), {chunk.content} (chunk content string), {metadata} (chunk metadata dict).\n Default: \"Result {index}\\nContent: {chunk.content}\\nMetadata: {metadata}\\n\"\n:param mode: Search mode for retrieval—either \"vector\", \"keyword\", or \"hybrid\". Default \"vector\".\n:param ranker: Configuration for the ranker to use in hybrid search. Defaults to RRF ranker." + RAGQueryResult: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + title: Content + metadata: + additionalProperties: true + type: object title: Metadata type: object - required: - - items - - metadata - title: _conversations_Request - _conversations_conversation_id_Request: + title: RAGQueryResult + description: "Result of a RAG query containing retrieved content and metadata.\n\n:param content: (Optional) The retrieved content from the query\n:param metadata: Additional metadata about the query result" + RAGSearchMode: + type: string + enum: + - vector + - keyword + - hybrid + title: RAGSearchMode + description: "Search modes for RAG query retrieval:\n- VECTOR: Uses vector similarity search for semantic matching\n- KEYWORD: Uses keyword-based search for exact matching\n- HYBRID: Combines both vector and keyword search for better results" + RRFRanker: properties: - conversation_id: - type: string - title: Conversation Id - metadata: + type: type: string - title: Metadata + const: rrf + title: Type + default: rrf + impact_factor: + type: number + title: Impact Factor + default: 60.0 + minimum: 0.0 type: object - required: - - conversation_id - - metadata - title: _conversations_conversation_id_Request - _conversations_conversation_id_items_Request: + title: RRFRanker + description: "Reciprocal Rank Fusion (RRF) ranker configuration.\n\n:param type: The type of ranker, always \"rrf\"\n:param impact_factor: The impact factor for RRF scoring. Higher values give more weight to higher-ranked results.\n Must be greater than 0" + RegexParserScoringFnParams: properties: - conversation_id: + type: type: string - title: Conversation Id - items: - anyOf: - - $ref: '#/components/schemas/OpenAIResponseMessage-Input' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - title: Items + const: regex_parser + title: Type + default: regex_parser + parsing_regexes: + items: + type: string + type: array + title: Parsing Regexes + description: Regex to extract the answer from generated response + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row type: object - required: - - conversation_id - - items - title: _conversations_conversation_id_items_Request - _models_Request: + title: RegexParserScoringFnParams + description: Parameters for regex parser scoring function configuration. + RegisterModelRequest: properties: model_id: type: string title: Model Id + description: The identifier of the model to register. provider_model_id: - type: string + anyOf: + - type: string + - type: 'null' title: Provider Model Id + description: The identifier of the model in the provider. provider_id: - type: string + anyOf: + - type: string + - type: 'null' title: Provider Id + description: The identifier of the provider. metadata: - type: string + anyOf: + - additionalProperties: true + type: object + - type: 'null' title: Metadata + description: Any additional metadata for this model. model_type: - $ref: '#/components/schemas/ModelType' + anyOf: + - $ref: '#/components/schemas/ModelType' + - type: 'null' + description: The type of model to register. type: object required: - model_id - - provider_model_id - - provider_id - - metadata - - model_type - title: _models_Request - _moderations_Request: - properties: - input: - type: string - title: Input - model: - type: string - title: Model - type: object - required: - - input - - model - title: _moderations_Request - _prompts_Request: - properties: - prompt: - type: string - title: Prompt - variables: - type: string - title: Variables - type: object - required: - - prompt - - variables - title: _prompts_Request - _prompts_prompt_id_Request: - properties: - prompt_id: - type: string - title: Prompt Id - prompt: - type: string - title: Prompt - version: - type: integer - title: Version - variables: - type: string - title: Variables - set_as_default: - type: boolean - title: Set As Default - default: true - type: object - required: - - prompt_id - - prompt - - version - - variables - title: _prompts_prompt_id_Request - _prompts_prompt_id_set_default_version_Request: - properties: - prompt_id: - type: string - title: Prompt Id - version: - type: integer - title: Version - type: object - required: - - prompt_id - - version - title: _prompts_prompt_id_set_default_version_Request - _responses_Request: + title: RegisterModelRequest + description: Request model for registering a new model. + RegisterScoringFunctionRequest: properties: - input: - type: string - title: Input - model: - type: string - title: Model - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - instructions: - type: string - title: Instructions - previous_response_id: + scoring_fn_id: type: string - title: Previous Response Id - conversation: + title: Scoring Fn Id + description: The ID of the scoring function to register + description: type: string - title: Conversation - store: - type: boolean - title: Store - default: true - stream: - type: boolean - title: Stream - default: false - temperature: - type: number - title: Temperature - text: - $ref: '#/components/schemas/OpenAIResponseText' - tools: + title: Description + description: The description of the scoring function + return_type: oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' - title: Tools + - $ref: '#/components/schemas/StringType' + - $ref: '#/components/schemas/NumberType' + - $ref: '#/components/schemas/BooleanType' + - $ref: '#/components/schemas/ArrayType' + - $ref: '#/components/schemas/ObjectType' + - $ref: '#/components/schemas/JsonType' + - $ref: '#/components/schemas/UnionType' + - $ref: '#/components/schemas/ChatCompletionInputType' + - $ref: '#/components/schemas/CompletionInputType' + - $ref: '#/components/schemas/AgentTurnInputType' + title: Return Type + description: The return type of the scoring function discriminator: propertyName: type mapping: - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseInputToolMCP' - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' - web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' - include: - type: string - title: Include - max_infer_iters: - type: integer - title: Max Infer Iters - default: 10 - type: object - required: - - input - - model - - prompt - - instructions - - previous_response_id - - conversation - - temperature - - text - - tools - - include - title: _responses_Request - _scoring_score_Request: - properties: - input_rows: - type: string - title: Input Rows - scoring_functions: - type: string - title: Scoring Functions - type: object - required: - - input_rows - - scoring_functions - title: _scoring_score_Request - _scoring_score_batch_Request: - properties: - dataset_id: - type: string - title: Dataset Id - scoring_functions: - type: string - title: Scoring Functions - save_results_dataset: - type: boolean - title: Save Results Dataset - default: false + agent_turn_input: '#/components/schemas/AgentTurnInputType' + array: '#/components/schemas/ArrayType' + boolean: '#/components/schemas/BooleanType' + chat_completion_input: '#/components/schemas/ChatCompletionInputType' + completion_input: '#/components/schemas/CompletionInputType' + json: '#/components/schemas/JsonType' + number: '#/components/schemas/NumberType' + object: '#/components/schemas/ObjectType' + string: '#/components/schemas/StringType' + union: '#/components/schemas/UnionType' + provider_scoring_fn_id: + anyOf: + - type: string + - type: 'null' + title: Provider Scoring Fn Id + description: The ID of the provider scoring function to use for the scoring function + provider_id: + anyOf: + - type: string + - type: 'null' + title: Provider Id + description: The ID of the provider to use for the scoring function + params: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' + title: Params + description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval type: object required: - - dataset_id - - scoring_functions - title: _scoring_score_batch_Request - _shields_Request: + - scoring_fn_id + - description + - return_type + title: RegisterScoringFunctionRequest + description: Request model for registering a scoring function. + RegisterShieldRequest: properties: shield_id: type: string title: Shield Id + description: The identifier of the shield to register provider_shield_id: + anyOf: + - type: string + - type: 'null' + title: Provider Shield Id + description: The identifier of the shield in the provider + provider_id: + anyOf: + - type: string + - type: 'null' + title: Provider Id + description: The identifier of the provider + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + description: The parameters of the shield + type: object + required: + - shield_id + title: RegisterShieldRequest + description: Request model for registering a shield. + RegisterToolGroupRequest: + properties: + toolgroup_id: type: string - title: Provider Shield Id + title: Toolgroup Id + description: The ID of the tool group to register provider_id: type: string title: Provider Id - params: - type: string - title: Params + description: The ID of the provider to use for the tool group + mcp_endpoint: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + description: The MCP endpoint to use for the tool group + args: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Args + description: A dictionary of arguments to pass to the tool group type: object required: - - shield_id - - provider_shield_id + - toolgroup_id - provider_id - - params - title: _shields_Request - _tool_runtime_invoke_Request: + title: RegisterToolGroupRequest + description: Request model for registering a tool group. + ResponseGuardrailSpec: properties: - tool_name: - type: string - title: Tool Name - kwargs: + type: type: string - title: Kwargs + title: Type + description: The type/identifier of the guardrail. type: object required: - - tool_name - - kwargs - title: _tool_runtime_invoke_Request - _tool_runtime_rag_tool_query_Request: + - type + title: ResponseGuardrailSpec + description: Specification for a guardrail to apply during response generation. + RouteInfo: properties: - content: + route: type: string - title: Content - vector_store_ids: + title: Route + description: The API endpoint path + method: type: string - title: Vector Store Ids - query_config: - $ref: '#/components/schemas/RAGQueryConfig' + title: Method + description: HTTP method for the route + provider_types: + items: + type: string + type: array + title: Provider Types + description: List of provider types that implement this route type: object required: - - content - - vector_store_ids - - query_config - title: _tool_runtime_rag_tool_query_Request - _vector_io_query_Request: + - route + - method + - provider_types + title: RouteInfo + description: Information about an API route including its path, method, and implementing providers. + RunModerationRequest: properties: - vector_store_id: - type: string - title: Vector Store Id - query: + input: + anyOf: + - type: string + - items: + type: string + type: array + title: Input + description: Input (or inputs) to classify. Can be a single string, an array of strings, or an array of multi-modal input objects similar to other models. + model: + anyOf: + - type: string + - type: 'null' + title: Model + description: The content moderation model you would like to use. + type: object + required: + - input + title: RunModerationRequest + description: Request model for running moderation. + RunShieldRequest: + properties: + shield_id: type: string - title: Query + title: Shield Id + description: The identifier of the shield to run. + messages: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Input' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Input' + type: array + title: Messages + description: The messages to run the shield on. params: - type: string + additionalProperties: true + type: object title: Params + description: The parameters of the shield. type: object required: - - vector_store_id - - query + - shield_id + - messages - params - title: _vector_io_query_Request - _vector_stores_vector_store_id_Request: + title: RunShieldRequest + description: Request model for running a shield. + RunShieldResponse: properties: - vector_store_id: - type: string - title: Vector Store Id - name: - type: string - title: Name - expires_after: - type: string - title: Expires After + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + description: Safety violation detected by the shield, if any. + type: object + title: RunShieldResponse + description: Response from running a safety shield. + SafetyViolation: + properties: + violation_level: + $ref: '#/components/schemas/ViolationLevel' + description: Severity level of the violation. + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + description: Message to convey to the user about the violation. metadata: - type: string + additionalProperties: true + type: object title: Metadata + description: Additional metadata including specific violation codes for debugging and telemetry. type: object required: - - vector_store_id - - name - - expires_after - - metadata - title: _vector_stores_vector_store_id_Request - _vector_stores_vector_store_id_file_batches_batch_id_cancel_Request: + - violation_level + title: SafetyViolation + description: Details of a safety violation detected by content moderation. + ScoreBatchRequest: properties: - batch_id: - type: string - title: Batch Id - vector_store_id: + dataset_id: type: string - title: Vector Store Id + title: Dataset Id + description: The ID of the dataset to score + scoring_functions: + additionalProperties: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' + type: object + title: Scoring Functions + description: The scoring functions to use for the scoring + save_results_dataset: + type: boolean + title: Save Results Dataset + description: Whether to save the results to a dataset + default: false type: object required: - - batch_id - - vector_store_id - title: _vector_stores_vector_store_id_file_batches_batch_id_cancel_Request - _vector_stores_vector_store_id_files_Request: + - dataset_id + - scoring_functions + title: ScoreBatchRequest + description: Request for batch scoring operations. + ScoreBatchResponse: properties: - vector_store_id: - type: string - title: Vector Store Id - file_id: - type: string - title: File Id - attributes: - type: string - title: Attributes - chunking_strategy: + dataset_id: anyOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' - title: Chunking Strategy + - type: string + - type: 'null' + title: Dataset Id + description: The identifier of the dataset that was scored + results: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' + type: object + title: Results + description: A map of scoring function name to ScoringResult type: object required: - - vector_store_id - - file_id - - attributes - - chunking_strategy - title: _vector_stores_vector_store_id_files_Request - _vector_stores_vector_store_id_files_file_id_Request: + - results + title: ScoreBatchResponse + description: Response from batch scoring operations on datasets. + ScoreRequest: properties: - vector_store_id: - type: string - title: Vector Store Id - file_id: - type: string - title: File Id - attributes: - type: string - title: Attributes + input_rows: + items: + additionalProperties: true + type: object + type: array + title: Input Rows + description: The rows to score + scoring_functions: + additionalProperties: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' + type: object + title: Scoring Functions + description: The scoring functions to use for the scoring type: object required: - - vector_store_id - - file_id - - attributes - title: _vector_stores_vector_store_id_files_file_id_Request - _vector_stores_vector_store_id_search_Request: + - input_rows + - scoring_functions + title: ScoreRequest + description: Request for scoring a list of rows. + ScoreResponse: properties: - vector_store_id: - type: string - title: Vector Store Id - query: - type: string - title: Query - filters: - type: string - title: Filters - max_num_results: - type: integer - title: Max Num Results - default: 10 - ranking_options: - $ref: '#/components/schemas/SearchRankingOptions' - rewrite_query: - type: boolean - title: Rewrite Query - default: false - search_mode: - type: string - title: Search Mode - default: vector + results: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' + type: object + title: Results + description: A map of scoring function name to ScoringResult type: object required: - - vector_store_id - - query - - filters - - ranking_options - title: _vector_stores_vector_store_id_search_Request - Error: - description: Error response from the API. Roughly follows RFC 7807. + - results + title: ScoreResponse + description: The response from scoring. + ScoringFn: properties: - status: - title: Status - type: integer - title: - title: Title + identifier: type: string - detail: - title: Detail + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: type: string - instance: - title: Instance + title: Provider Id + description: ID of the provider that owns this resource + type: type: string - nullable: true - required: - - status - - title - - detail - title: Error + const: scoring_function + title: Type + default: scoring_function + description: + anyOf: + - type: string + - type: 'null' + title: Description + metadata: + additionalProperties: true + type: object + title: Metadata + description: Any additional metadata for this definition + return_type: + oneOf: + - $ref: '#/components/schemas/StringType' + - $ref: '#/components/schemas/NumberType' + - $ref: '#/components/schemas/BooleanType' + - $ref: '#/components/schemas/ArrayType' + - $ref: '#/components/schemas/ObjectType' + - $ref: '#/components/schemas/JsonType' + - $ref: '#/components/schemas/UnionType' + - $ref: '#/components/schemas/ChatCompletionInputType' + - $ref: '#/components/schemas/CompletionInputType' + - $ref: '#/components/schemas/AgentTurnInputType' + title: Return Type + description: The return type of the deterministic function + discriminator: + propertyName: type + mapping: + agent_turn_input: '#/components/schemas/AgentTurnInputType' + array: '#/components/schemas/ArrayType' + boolean: '#/components/schemas/BooleanType' + chat_completion_input: '#/components/schemas/ChatCompletionInputType' + completion_input: '#/components/schemas/CompletionInputType' + json: '#/components/schemas/JsonType' + number: '#/components/schemas/NumberType' + object: '#/components/schemas/ObjectType' + string: '#/components/schemas/StringType' + union: '#/components/schemas/UnionType' + params: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' + title: Params + description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval type: object - ListOpenAIResponseInputItem: - description: List container for OpenAI response input items. - properties: - data: - items: - anyOf: - - discriminator: - mapping: - file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' - message: '#/$defs/OpenAIResponseMessage' - web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseMessage' - title: Data - type: array - object: - const: list - default: list - title: Object - type: string required: - - data - title: ListOpenAIResponseInputItem - type: object - ListOpenAIResponseObject: - description: Paginated list of OpenAI response objects with navigation metadata. + - identifier + - provider_id + - return_type + title: ScoringFn + description: A scoring function resource for evaluating model outputs. + ScoringResult: properties: - data: + score_rows: items: - $ref: '#/components/schemas/OpenAIResponseObjectWithInput' - title: Data + additionalProperties: true + type: object type: array - has_more: - title: Has More - type: boolean - first_id: - title: First Id - type: string - last_id: - title: Last Id - type: string - object: - const: list - default: list - title: Object - type: string + title: Score Rows + description: The scoring result for each row. Each row is a map of column name to value + aggregated_results: + additionalProperties: true + type: object + title: Aggregated Results + description: Map of metric name to aggregated value + type: object required: - - data - - has_more - - first_id - - last_id - title: ListOpenAIResponseObject + - score_rows + - aggregated_results + title: ScoringResult + description: A scoring result for a single row. + SearchRankingOptions: + properties: + ranker: + anyOf: + - type: string + - type: 'null' + title: Ranker + score_threshold: + anyOf: + - type: number + - type: 'null' + title: Score Threshold + default: 0.0 type: object - OpenAIDeleteResponseObject: - description: Response object confirming deletion of an OpenAI response. + title: SearchRankingOptions + description: Options for ranking and filtering search results. + SetDefaultVersionRequest: properties: - id: - title: Id - type: string - object: - const: response - default: response - title: Object - type: string - deleted: - default: true - title: Deleted - type: boolean - required: - - id - title: OpenAIDeleteResponseObject + version: + type: integer + title: Version + description: The version to set as default. type: object - ListBatchesResponse: - description: Response containing a list of batch objects. + required: + - version + title: SetDefaultVersionRequest + description: Request model for setting a prompt version as default. + Shield: properties: - object: - const: list - default: list - title: Object + identifier: type: string - data: - description: List of batch objects - items: - $ref: '#/components/schemas/Batch' - title: Data - type: array - first_id: - description: ID of the first batch in the list - title: First Id + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: type: string - nullable: true - last_id: - description: ID of the last batch in the list - title: Last Id + title: Provider Id + description: ID of the provider that owns this resource + type: type: string - nullable: true - has_more: - default: false - description: Whether there are more batches available - title: Has More - type: boolean - required: - - data - title: ListBatchesResponse + const: shield + title: Type + description: The resource type, always shield + default: shield + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + description: Configuration parameters for the shield type: object - ConversationDeletedResource: - description: Response for deleted conversation. + required: + - identifier + - provider_id + title: Shield + description: A safety shield resource that can be used to check content. + StringType: properties: - id: - description: The deleted conversation identifier - title: Id - type: string - object: - default: conversation.deleted - description: Object type - title: Object + type: type: string - deleted: - default: true - description: Whether the object was deleted - title: Deleted - type: boolean - required: - - id - title: ConversationDeletedResource + const: string + title: Type + default: string type: object - ConversationItemDeletedResource: - description: Response for deleted conversation item. + title: StringType + description: "Parameter type for string values.\n\n:param type: Discriminator type. Always \"string\"" + TextContentItem: properties: - id: - description: The deleted item identifier - title: Id + type: type: string - object: - default: conversation.item.deleted - description: Object type - title: Object + const: text + title: Type + default: text + text: type: string - deleted: - default: true - description: Whether the object was deleted - title: Deleted - type: boolean + title: Text + type: object required: - - id - title: ConversationItemDeletedResource + - text + title: TextContentItem + description: A text content item. + ToolDef: + properties: + toolgroup_id: + anyOf: + - type: string + - type: 'null' + title: Toolgroup Id + description: ID of the tool group this tool belongs to + name: + type: string + title: Name + description: Name of the tool + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Human-readable description of what the tool does + input_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Input Schema + description: JSON Schema for tool inputs (MCP inputSchema) + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Output Schema + description: JSON Schema for tool outputs (MCP outputSchema) + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Additional metadata about the tool type: object - ListOpenAIFileResponse: - description: Response for listing files in OpenAI Files API. + required: + - name + title: ToolDef + description: Tool definition used in runtime contexts. + ToolGroup: properties: - data: - items: - $ref: '#/components/schemas/OpenAIFileObject' - title: Data - type: array - has_more: - title: Has More - type: boolean - first_id: - title: First Id + identifier: type: string - last_id: - title: Last Id + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: type: string - object: - const: list - default: list - title: Object + title: Provider Id + description: ID of the provider that owns this resource + type: type: string + const: tool_group + title: Type + description: Type of resource, always 'tool_group' + default: tool_group + mcp_endpoint: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + description: Model Context Protocol endpoint for remote tools + args: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Args + description: Additional arguments for the tool group + type: object required: - - data - - has_more - - first_id - - last_id - title: ListOpenAIFileResponse + - identifier + - provider_id + title: ToolGroup + description: A group of related tools managed together. + ToolInvocationResult: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + title: Content + description: The output content from the tool execution + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + description: Error message if the tool execution failed + error_code: + anyOf: + - type: integer + - type: 'null' + title: Error Code + description: Numeric error code if the tool execution failed + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Additional metadata about the tool execution type: object - OpenAIFileDeleteResponse: - description: Response for deleting a file in OpenAI Files API. + title: ToolInvocationResult + description: Result of a tool invocation. + URL: properties: - id: - title: Id - type: string - object: - const: file - default: file - title: Object + uri: type: string - deleted: - title: Deleted - type: boolean - required: - - id - - deleted - title: OpenAIFileDeleteResponse + title: Uri type: object - ListOpenAIChatCompletionResponse: - description: Response from listing OpenAI-compatible chat completions. + required: + - uri + title: URL + description: A URL reference to external content. + UnionType: properties: - data: - items: - $ref: '#/components/schemas/OpenAICompletionWithInputMessages' - title: Data - type: array - has_more: - title: Has More - type: boolean - first_id: - title: First Id - type: string - last_id: - title: Last Id - type: string - object: - const: list - default: list - title: Object + type: type: string - required: - - data - - has_more - - first_id - - last_id - title: ListOpenAIChatCompletionResponse + const: union + title: Type + default: union type: object - OpenAIAssistantMessageParam: - description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. + title: UnionType + description: "Parameter type for union values.\n\n:param type: Discriminator type. Always \"union\"" + UpdatePromptRequest: properties: - role: - const: assistant - default: assistant - title: Role + prompt: type: string - content: + title: Prompt + description: The updated prompt text content. + version: + type: integer + title: Version + description: The current version of the prompt being updated. + variables: anyOf: - - type: string - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: string type: array - title: Content - nullable: true - name: - title: Name + - type: 'null' + title: Variables + description: Updated list of variable names that can be used in the prompt template. + set_as_default: + type: boolean + title: Set As Default + description: Set the new version as the default (default=True). + default: true + type: object + required: + - prompt + - version + title: UpdatePromptRequest + description: Request model for updating an existing prompt. + VectorStoreChunkingStrategyAuto: + properties: + type: type: string - nullable: true - tool_calls: - title: Tool Calls - items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' - type: array - nullable: true - title: OpenAIAssistantMessageParam + const: auto + title: Type + default: auto type: object - OpenAIChoice: - description: A choice from an OpenAI-compatible chat completion response. + title: VectorStoreChunkingStrategyAuto + description: Automatic chunking strategy for vector store files. + VectorStoreChunkingStrategyStatic: properties: - message: - discriminator: - mapping: - assistant: '#/$defs/OpenAIAssistantMessageParam' - developer: '#/$defs/OpenAIDeveloperMessageParam' - system: '#/$defs/OpenAISystemMessageParam' - tool: '#/$defs/OpenAIToolMessageParam' - user: '#/$defs/OpenAIUserMessageParam' - propertyName: role - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - title: Message - finish_reason: - title: Finish Reason + type: type: string - index: - title: Index - type: integer - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - nullable: true + const: static + title: Type + default: static + static: + $ref: '#/components/schemas/VectorStoreChunkingStrategyStaticConfig' + type: object required: - - message - - finish_reason - - index - title: OpenAIChoice + - static + title: VectorStoreChunkingStrategyStatic + description: Static chunking strategy with configurable parameters. + VectorStoreChunkingStrategyStaticConfig: + properties: + chunk_overlap_tokens: + type: integer + title: Chunk Overlap Tokens + default: 400 + max_chunk_size_tokens: + type: integer + maximum: 4096.0 + minimum: 100.0 + title: Max Chunk Size Tokens + default: 800 type: object - OpenAIChoiceLogprobs: - description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. + title: VectorStoreChunkingStrategyStaticConfig + description: Configuration for static chunking strategy. + VectorStoreContent: properties: - content: - title: Content - items: - $ref: '#/components/schemas/OpenAITokenLogProb' - type: array - nullable: true - refusal: - title: Refusal - items: - $ref: '#/components/schemas/OpenAITokenLogProb' - type: array - nullable: true - title: OpenAIChoiceLogprobs + type: + type: string + const: text + title: Type + text: + type: string + title: Text type: object - OpenAICompletionWithInputMessages: + required: + - type + - text + title: VectorStoreContent + description: Content item from a vector store file or search result. + VectorStoreDeleteResponse: properties: id: - title: Id type: string - choices: - items: - $ref: '#/components/schemas/OpenAIChoice' - title: Choices - type: array + title: Id object: - const: chat.completion - default: chat.completion - title: Object - type: string - created: - title: Created - type: integer - model: - title: Model type: string - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - nullable: true - input_messages: - items: - discriminator: - mapping: - assistant: '#/$defs/OpenAIAssistantMessageParam' - developer: '#/$defs/OpenAIDeveloperMessageParam' - system: '#/$defs/OpenAISystemMessageParam' - tool: '#/$defs/OpenAIToolMessageParam' - user: '#/$defs/OpenAIUserMessageParam' - propertyName: role - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - title: Input Messages - type: array + title: Object + default: vector_store.deleted + deleted: + type: boolean + title: Deleted + default: true + type: object required: - id - - choices - - created - - model - - input_messages - title: OpenAICompletionWithInputMessages - type: object - OpenAIUserMessageParam: - description: A message from the user in an OpenAI-compatible chat completion request. + title: VectorStoreDeleteResponse + description: Response from deleting a vector store. + VectorStoreFileBatchObject: properties: - role: - const: user - default: user - title: Role + id: type: string - content: + title: Id + object: + type: string + title: Object + default: vector_store.file_batch + created_at: + type: integer + title: Created At + vector_store_id: + type: string + title: Vector Store Id + status: anyOf: - type: string - - items: - discriminator: - mapping: - file: '#/$defs/OpenAIFile' - image_url: '#/$defs/OpenAIChatCompletionContentPartImageParam' - text: '#/$defs/OpenAIChatCompletionContentPartTextParam' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - - $ref: '#/components/schemas/OpenAIFile' - type: array - title: Content - name: - title: Name - type: string - nullable: true - required: - - content - title: OpenAIUserMessageParam + const: completed + - type: string + const: in_progress + - type: string + const: cancelled + - type: string + const: failed + title: Status + file_counts: + $ref: '#/components/schemas/VectorStoreFileCounts' type: object - ScoringFn: - description: A scoring function resource for evaluating model outputs. + required: + - id + - created_at + - vector_store_id + - status + - file_counts + title: VectorStoreFileBatchObject + description: OpenAI Vector Store File Batch object. + VectorStoreFileContentsResponse: properties: - identifier: - description: Unique identifier for this resource in llama stack - title: Identifier - type: string - provider_resource_id: - description: Unique identifier for this resource in the provider - title: Provider Resource Id - type: string - nullable: true - provider_id: - description: ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: scoring_function - default: scoring_function - title: Type + file_id: type: string - description: - title: Description + title: File Id + filename: type: string - nullable: true - metadata: + title: Filename + attributes: additionalProperties: true - description: Any additional metadata for this definition - title: Metadata type: object - return_type: - description: The return type of the deterministic function - discriminator: - mapping: - agent_turn_input: '#/$defs/AgentTurnInputType' - array: '#/$defs/ArrayType' - boolean: '#/$defs/BooleanType' - chat_completion_input: '#/$defs/ChatCompletionInputType' - completion_input: '#/$defs/CompletionInputType' - json: '#/$defs/JsonType' - number: '#/$defs/NumberType' - object: '#/$defs/ObjectType' - string: '#/$defs/StringType' - union: '#/$defs/UnionType' - propertyName: type - oneOf: - - $ref: '#/components/schemas/StringType' - - $ref: '#/components/schemas/NumberType' - - $ref: '#/components/schemas/BooleanType' - - $ref: '#/components/schemas/ArrayType' - - $ref: '#/components/schemas/ObjectType' - - $ref: '#/components/schemas/JsonType' - - $ref: '#/components/schemas/UnionType' - - $ref: '#/components/schemas/ChatCompletionInputType' - - $ref: '#/components/schemas/CompletionInputType' - - $ref: '#/components/schemas/AgentTurnInputType' - title: Return Type - params: - description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval - title: Params - discriminator: - mapping: - basic: '#/$defs/BasicScoringFnParams' - llm_as_judge: '#/$defs/LLMAsJudgeScoringFnParams' - regex_parser: '#/$defs/RegexParserScoringFnParams' - propertyName: type - oneOf: - - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - - $ref: '#/components/schemas/RegexParserScoringFnParams' - - $ref: '#/components/schemas/BasicScoringFnParams' - nullable: true - required: - - identifier - - provider_id - - return_type - title: ScoringFn - type: object - ListToolDefsResponse: - description: Response containing a list of tool definitions. - properties: - data: + title: Attributes + content: items: - $ref: '#/components/schemas/ToolDef' - title: Data + $ref: '#/components/schemas/VectorStoreContent' type: array + title: Content + type: object required: - - data - title: ListToolDefsResponse + - file_id + - filename + - attributes + - content + title: VectorStoreFileContentsResponse + description: Response from retrieving the contents of a vector store file. + VectorStoreFileCounts: + properties: + completed: + type: integer + title: Completed + cancelled: + type: integer + title: Cancelled + failed: + type: integer + title: Failed + in_progress: + type: integer + title: In Progress + total: + type: integer + title: Total type: object - VectorStoreDeleteResponse: - description: Response from deleting a vector store. + required: + - completed + - cancelled + - failed + - in_progress + - total + title: VectorStoreFileCounts + description: File processing status counts for a vector store. + VectorStoreFileDeleteResponse: properties: id: - title: Id type: string + title: Id object: - default: vector_store.deleted - title: Object type: string + title: Object + default: vector_store.file.deleted deleted: - default: true - title: Deleted type: boolean + title: Deleted + default: true + type: object required: - id - title: VectorStoreDeleteResponse - type: object - VectorStoreFileContentsResponse: - description: Response from retrieving the contents of a vector store file. + title: VectorStoreFileDeleteResponse + description: Response from deleting a vector store file. + VectorStoreFileLastError: properties: - file_id: - title: File Id - type: string - filename: - title: Filename + code: + anyOf: + - type: string + const: server_error + - type: string + const: rate_limit_exceeded + title: Code + message: type: string - attributes: - additionalProperties: true - title: Attributes - type: object - content: - items: - $ref: '#/components/schemas/VectorStoreContent' - title: Content - type: array - required: - - file_id - - filename - - attributes - - content - title: VectorStoreFileContentsResponse + title: Message type: object - VectorStoreFileDeleteResponse: - description: Response from deleting a vector store file. + required: + - code + - message + title: VectorStoreFileLastError + description: Error information for failed vector store file processing. + VectorStoreFileObject: properties: id: - title: Id type: string + title: Id object: - default: vector_store.file.deleted + type: string title: Object + default: vector_store.file + attributes: + additionalProperties: true + type: object + title: Attributes + chunking_strategy: + oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + title: Chunking Strategy + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + created_at: + type: integer + title: Created At + last_error: + anyOf: + - $ref: '#/components/schemas/VectorStoreFileLastError' + - type: 'null' + status: + anyOf: + - type: string + const: completed + - type: string + const: in_progress + - type: string + const: cancelled + - type: string + const: failed + title: Status + usage_bytes: + type: integer + title: Usage Bytes + default: 0 + vector_store_id: type: string - deleted: - default: true - title: Deleted - type: boolean + title: Vector Store Id + type: object required: - id - title: VectorStoreFileDeleteResponse - type: object + - chunking_strategy + - created_at + - status + - vector_store_id + title: VectorStoreFileObject + description: OpenAI Vector Store File object. VectorStoreFilesListInBatchResponse: - description: Response from listing files in a vector store file batch. properties: object: - default: list - title: Object type: string + title: Object + default: list data: items: $ref: '#/components/schemas/VectorStoreFileObject' - title: Data type: array + title: Data first_id: + anyOf: + - type: string + - type: 'null' title: First Id - type: string - nullable: true last_id: + anyOf: + - type: string + - type: 'null' title: Last Id - type: string - nullable: true has_more: - default: false - title: Has More type: boolean + title: Has More + default: false + type: object required: - data title: VectorStoreFilesListInBatchResponse - type: object + description: Response from listing files in a vector store file batch. VectorStoreListFilesResponse: + properties: + object: + type: string + title: Object + default: list + data: + items: + $ref: '#/components/schemas/VectorStoreFileObject' + type: array + title: Data + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + has_more: + type: boolean + title: Has More + default: false + type: object + required: + - data + title: VectorStoreListFilesResponse description: Response from listing files in a vector store. + VectorStoreListResponse: properties: object: + type: string + title: Object default: list + data: + items: + $ref: '#/components/schemas/VectorStoreObject' + type: array + title: Data + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + has_more: + type: boolean + title: Has More + default: false + type: object + required: + - data + title: VectorStoreListResponse + description: Response from listing vector stores. + VectorStoreModifyRequest: + properties: + name: + anyOf: + - type: string + - type: 'null' + title: Name + expires_after: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + type: object + title: VectorStoreModifyRequest + description: Request to modify a vector store. + VectorStoreObject: + properties: + id: + type: string + title: Id + object: + type: string title: Object + default: vector_store + created_at: + type: integer + title: Created At + name: + anyOf: + - type: string + - type: 'null' + title: Name + usage_bytes: + type: integer + title: Usage Bytes + default: 0 + file_counts: + $ref: '#/components/schemas/VectorStoreFileCounts' + status: type: string - data: + title: Status + default: completed + expires_after: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After + expires_at: + anyOf: + - type: integer + - type: 'null' + title: Expires At + last_active_at: + anyOf: + - type: integer + - type: 'null' + title: Last Active At + metadata: + additionalProperties: true + type: object + title: Metadata + type: object + required: + - id + - created_at + - file_counts + title: VectorStoreObject + description: OpenAI Vector Store object. + VectorStoreSearchResponse: + properties: + file_id: + type: string + title: File Id + filename: + type: string + title: Filename + score: + type: number + title: Score + attributes: + anyOf: + - additionalProperties: + anyOf: + - type: string + - type: number + - type: boolean + type: object + - type: 'null' + title: Attributes + content: items: - $ref: '#/components/schemas/VectorStoreFileObject' - title: Data + $ref: '#/components/schemas/VectorStoreContent' type: array - first_id: - title: First Id - type: string - nullable: true - last_id: - title: Last Id - type: string - nullable: true - has_more: - default: false - title: Has More - type: boolean - required: - - data - title: VectorStoreListFilesResponse + title: Content type: object - VectorStoreListResponse: - description: Response from listing vector stores. + required: + - file_id + - filename + - score + - content + title: VectorStoreSearchResponse + description: Response from searching a vector store. + VectorStoreSearchResponsePage: properties: object: - default: list + type: string title: Object + default: vector_store.search_results.page + search_query: type: string + title: Search Query data: items: - $ref: '#/components/schemas/VectorStoreObject' - title: Data + $ref: '#/components/schemas/VectorStoreSearchResponse' type: array - first_id: - title: First Id - type: string - nullable: true - last_id: - title: Last Id - type: string - nullable: true + title: Data has_more: - default: false - title: Has More type: boolean + title: Has More + default: false + next_page: + anyOf: + - type: string + - type: 'null' + title: Next Page + type: object required: + - search_query - data - title: VectorStoreListResponse - type: object - OpenAIResponseMessage: - description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + title: VectorStoreSearchResponsePage + description: Paginated response from searching a vector store. + VersionInfo: properties: - content: - anyOf: - - type: string - - items: - discriminator: - mapping: - input_file: '#/$defs/OpenAIResponseInputMessageContentFile' - input_image: '#/$defs/OpenAIResponseInputMessageContentImage' - input_text: '#/$defs/OpenAIResponseInputMessageContentText' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' - type: array - - items: - discriminator: - mapping: - output_text: '#/$defs/OpenAIResponseOutputMessageContentOutputText' - refusal: '#/$defs/OpenAIResponseContentPartRefusal' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' - type: array - title: Content - role: - anyOf: - - const: system - type: string - - const: developer - type: string - - const: user - type: string - - const: assistant - type: string - title: Role - type: - const: message - default: message - title: Type - type: string - id: - title: Id - type: string - nullable: true - status: - title: Status + version: type: string - nullable: true - required: - - content - - role - title: OpenAIResponseMessage + title: Version + description: Version number of the service type: object - OpenAIResponseObjectWithInput: - description: OpenAI response object extended with input context information. + required: + - version + title: VersionInfo + description: Version information for the service. + ViolationLevel: + type: string + enum: + - info + - warn + - error + title: ViolationLevel + description: "Severity level of a safety violation.\n\n:cvar INFO: Informational level violation that does not require action\n:cvar WARN: Warning level violation that suggests caution but allows continuation\n:cvar ERROR: Error level violation that requires blocking or intervention" + WeightedRanker: properties: - created_at: - title: Created At - type: integer - error: - $ref: '#/components/schemas/OpenAIResponseError' - nullable: true - id: - title: Id - type: string - model: - title: Model - type: string - object: - const: response - default: response - title: Object - type: string - output: - items: - discriminator: - mapping: - file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' - message: '#/$defs/OpenAIResponseMessage' - web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - title: Output - type: array - parallel_tool_calls: - default: false - title: Parallel Tool Calls - type: boolean - previous_response_id: - title: Previous Response Id - type: string - nullable: true - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - nullable: true - status: - title: Status + type: type: string - temperature: - title: Temperature - type: number - nullable: true - text: - $ref: '#/components/schemas/OpenAIResponseText' - default: - format: - type: text - top_p: - title: Top P + const: weighted + title: Type + default: weighted + alpha: type: number - nullable: true - tools: - title: Tools - items: - discriminator: - mapping: - file_search: '#/$defs/OpenAIResponseInputToolFileSearch' - function: '#/$defs/OpenAIResponseInputToolFunction' - mcp: '#/$defs/OpenAIResponseToolMCP' - web_search: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseToolMCP' - type: array - nullable: true - truncation: - title: Truncation - type: string - nullable: true - usage: - $ref: '#/components/schemas/OpenAIResponseUsage' - nullable: true - instructions: - title: Instructions - type: string - nullable: true - input: - items: - anyOf: - - discriminator: - mapping: - file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' - message: '#/$defs/OpenAIResponseMessage' - web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseMessage' - title: Input - type: array - required: - - created_at - - id - - model - - output - - status - - input - title: OpenAIResponseObjectWithInput + maximum: 1.0 + minimum: 0.0 + title: Alpha + description: Weight factor between 0 and 1. 0 means only keyword scores, 1 means only vector scores. + default: 0.5 type: object - _safety_run_shield_Request: + title: WeightedRanker + description: "Weighted ranker configuration that combines vector and keyword scores.\n\n:param type: The type of ranker, always \"weighted\"\n:param alpha: Weight factor between 0 and 1.\n 0 means only use keyword scores,\n 1 means only use vector scores,\n values in between blend both scores." + _URLOrData: properties: - shield_id: - title: Shield Id - type: string - messages: + url: anyOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - title: Messages - params: - title: Params - type: string - required: - - shield_id - - messages - - params - title: _safety_run_shield_Request - type: object - responses: - BadRequest400: - description: The request was invalid or malformed - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 400 - title: Bad Request - detail: The request was invalid or malformed - TooManyRequests429: - description: The client has sent too many requests in a given amount of time - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 429 - title: Too Many Requests - detail: You have exceeded the rate limit. Please try again later. - InternalServerError500: - description: The server encountered an unexpected error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 500 - title: Internal Server Error - detail: An unexpected error occurred. Our team has been notified. - DefaultError: - description: An unexpected error occurred - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 0 - title: Error - detail: An unexpected error occurred -security: - - Default: [] -tags: - - name: Agents - description: >- - APIs for creating and interacting with agentic systems. - - - ## Responses API - - - The Responses API provides OpenAI-compatible functionality with enhanced capabilities - for dynamic, stateful interactions. - - - > **✅ STABLE**: This API is production-ready with backward compatibility guarantees. - Recommended for production applications. - - - ### ✅ Supported Tools - - - The Responses API supports the following tool types: - - - - **`web_search`**: Search the web for current information and real-time data - - - **`file_search`**: Search through uploaded files and vector stores - - Supports dynamic `vector_store_ids` per call - - Compatible with OpenAI file search patterns - - **`function`**: Call custom functions with JSON schema validation - - - **`mcp_tool`**: Model Context Protocol integration - - - ### ✅ Supported Fields & Features - - - **Core Capabilities:** - - - **Dynamic Configuration**: Switch models, vector stores, and tools per request - without pre-configuration - - - **Conversation Branching**: Use `previous_response_id` to branch conversations - and explore different paths - - - **Rich Annotations**: Automatic file citations, URL citations, and container - file citations - - - **Status Tracking**: Monitor tool call execution status and handle failures - gracefully - - - ### 🚧 Work in Progress - - - - Full real-time response streaming support - - - `tool_choice` parameter - - - `max_tool_calls` parameter - - - Built-in tools (code interpreter, containers API) - - - Safety & guardrails - - - `reasoning` capabilities - - - `service_tier` - - - `logprobs` - - - `max_output_tokens` - - - `metadata` handling - - - `instructions` - - - `incomplete_details` - - - `background` - x-displayName: Agents - - name: Batches - description: >- - The API is designed to allow use of openai client libraries for seamless integration. - - - This API provides the following extensions: - - idempotent batch creation - - Note: This API is currently under active development and may undergo changes. - x-displayName: >- - The Batches API enables efficient processing of multiple requests in a single - operation, particularly useful for processing large datasets, batch evaluation - workflows, and cost-effective inference at scale. - - name: Conversations - description: >- - Protocol for conversation management operations. - x-displayName: Conversations - - name: Files - description: >- - This API is used to upload documents that can be used with other Llama Stack - APIs. - x-displayName: Files - - name: Inference - description: >- - Llama Stack Inference API for generating completions, chat completions, and - embeddings. - - - This API provides the raw interface to the underlying models. Three kinds of - models are supported: - - - LLM models: these models generate "raw" and "chat" (conversational) completions. - - - Embedding models: these models generate embeddings to be used for semantic - search. - - - Rerank models: these models reorder the documents based on their relevance - to a query. - x-displayName: Inference - - name: Inspect - description: >- - APIs for inspecting the Llama Stack service, including health status, available - API routes with methods and implementing providers. - x-displayName: Inspect - - name: Models - description: '' - - name: Prompts - description: >- - Protocol for prompt management operations. - x-displayName: Prompts - - name: Providers - description: >- - Providers API for inspecting, listing, and modifying providers and their configurations. - x-displayName: Providers - - name: Safety - description: OpenAI-compatible Moderations API. - x-displayName: Safety - - name: Scoring - description: '' - - name: ScoringFunctions - description: '' - - name: Shields - description: '' - - name: ToolGroups - description: '' - - name: ToolRuntime - description: '' - - name: VectorIO - description: '' -x-tagGroups: - - name: Operations - tags: - - Agents - - Batches - - Conversations - - Files - - Inference - - Inspect - - Models - - Prompts - - Providers - - Safety - - Scoring - - ScoringFunctions - - Shields - - ToolGroups - - ToolRuntime - - VectorIO + - $ref: '#/components/schemas/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data + type: object + title: _URLOrData + description: A URL or a base64 encoded string. diff --git a/docs/static/stainless-llama-stack-spec.json b/docs/static/stainless-llama-stack-spec.json deleted file mode 100644 index 07e051f530..0000000000 --- a/docs/static/stainless-llama-stack-spec.json +++ /dev/null @@ -1,16303 +0,0 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "Llama Stack API - Stable & Experimental APIs", - "description": "A comprehensive API for building and deploying AI applications\n\n**\ud83d\udd17 COMBINED**: This specification includes both stable production-ready APIs and experimental pre-release APIs. Use stable APIs for production deployments and experimental APIs for testing new features.", - "version": "1.0.0" - }, - "servers": [ - { - "url": "https://api.llamastack.com", - "description": "Production server" - }, - { - "url": "https://staging-api.llamastack.com", - "description": "Staging server" - } - ], - "paths": { - "/v1beta/datasetio/append-rows/{dataset_id}": { - "post": { - "tags": [ - "V1Beta" - ], - "summary": "Append rows to a dataset.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "append_rows_v1beta_datasetio_append_rows__dataset_id__post", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "dataset_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Path parameter: dataset_id" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1beta/datasetio/iterrows/{dataset_id}": { - "get": { - "tags": [ - "V1Beta" - ], - "summary": "Get a paginated list of rows from a dataset.", - "description": "Query endpoint for proper schema generation.", - "operationId": "iterrows_v1beta_datasetio_iterrows__dataset_id__get", - "parameters": [ - { - "name": "limit", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Limit" - } - }, - { - "name": "start_index", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Start Index" - } - }, - { - "name": "dataset_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Dataset Id" - } - } - ], - "responses": { - "200": { - "description": "A PaginatedResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaginatedResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1beta/datasets": { - "get": { - "tags": [ - "V1Beta" - ], - "summary": "List all datasets.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_datasets_v1beta_datasets_get", - "responses": { - "200": { - "description": "A ListDatasetsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListDatasetsResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - }, - "post": { - "tags": [ - "V1Beta" - ], - "summary": "Register a new dataset.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "register_dataset_v1beta_datasets_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/__main_____datasets_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A Dataset.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Dataset" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1beta/datasets/{dataset_id}": { - "delete": { - "tags": [ - "V1Beta" - ], - "summary": "Unregister a dataset by its ID.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "unregister_dataset_v1beta_datasets__dataset_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "dataset_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Path parameter: dataset_id" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1Beta" - ], - "summary": "Get a dataset by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_dataset_v1beta_datasets__dataset_id__get", - "parameters": [ - { - "name": "dataset_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Dataset Id" - } - } - ], - "responses": { - "200": { - "description": "A Dataset.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Dataset" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/agents": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "List all agents.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_agents_v1alpha_agents_get", - "parameters": [ - { - "name": "limit", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Limit" - } - }, - { - "name": "start_index", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Start Index" - } - } - ], - "responses": { - "200": { - "description": "A PaginatedResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaginatedResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Create an agent with the given configuration.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_agent_v1alpha_agents_post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentConfig" - } - } - } - }, - "responses": { - "200": { - "description": "An AgentCreateResponse with the agent ID.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentCreateResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/agents/{agent_id}": { - "delete": { - "tags": [ - "V1Alpha" - ], - "summary": "Delete an agent by its ID and its associated sessions and turns.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "delete_agent_v1alpha_agents__agent_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the agent to delete." - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Describe an agent by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_agent_v1alpha_agents__agent_id__get", - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Agent Id" - }, - "description": "ID of the agent." - } - ], - "responses": { - "200": { - "description": "An Agent of the agent.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Agent" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/agents/{agent_id}/session": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Create a new session for an agent.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_agent_session_v1alpha_agents__agent_id__session_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/__main_____agents_agent_id_session_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "An AgentSessionCreateResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentSessionCreateResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the agent to create the session for." - } - ] - } - }, - "/v1alpha/agents/{agent_id}/session/{session_id}": { - "delete": { - "tags": [ - "V1Alpha" - ], - "summary": "Delete an agent session by its ID and its associated turns.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "delete_agents_session_v1alpha_agents__agent_id__session__session_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the session to delete." - }, - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the agent to delete the session for." - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Retrieve an agent session by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_agents_session_v1alpha_agents__agent_id__session__session_id__get", - "parameters": [ - { - "name": "turn_ids", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Turn Ids" - } - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Session Id" - }, - "description": "The ID of the session to get." - }, - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Agent Id" - }, - "description": "The ID of the agent to get the session for." - } - ], - "responses": { - "200": { - "description": "A Session.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Session" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/agents/{agent_id}/session/{session_id}/turn": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Create a new turn for an agent.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/__main_____agents_agent_id_session_session_id_turn_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "If stream=False, returns a Turn object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Turn" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the agent to create the turn for." - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the session to create the turn for." - } - ] - } - }, - "/v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Retrieve an agent turn by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_agents_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__get", - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Agent Id" - }, - "description": "The ID of the agent to get the turn for." - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Session Id" - }, - "description": "The ID of the session to get the turn for." - }, - { - "name": "turn_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Turn Id" - }, - "description": "The ID of the turn to get." - } - ], - "responses": { - "200": { - "description": "A Turn.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Turn" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Resume an agent turn with executed tool call responses.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "resume_agent_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__resume_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A Turn object if stream is False, otherwise an AsyncIterator of AgentTurnResponseStreamChunk objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Turn" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the agent to resume." - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the session to resume." - }, - { - "name": "turn_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the turn to resume." - } - ] - } - }, - "/v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Retrieve an agent step by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_agents_step_v1alpha_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get", - "parameters": [ - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Agent Id" - }, - "description": "The ID of the agent to get the step for." - }, - { - "name": "session_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Session Id" - }, - "description": "The ID of the session to get the step for." - }, - { - "name": "turn_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Turn Id" - }, - "description": "The ID of the turn to get the step for." - }, - { - "name": "step_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Step Id" - }, - "description": "The ID of the step to get." - } - ], - "responses": { - "200": { - "description": "An AgentStepResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AgentStepResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/agents/{agent_id}/sessions": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "List all session(s) of a given agent.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_agent_sessions_v1alpha_agents__agent_id__sessions_get", - "parameters": [ - { - "name": "limit", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Limit" - } - }, - { - "name": "start_index", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Start Index" - } - }, - { - "name": "agent_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Agent Id" - }, - "description": "The ID of the agent to list sessions for." - } - ], - "responses": { - "200": { - "description": "A PaginatedResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PaginatedResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/eval/benchmarks": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "List all benchmarks.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_benchmarks_v1alpha_eval_benchmarks_get", - "responses": { - "200": { - "description": "A ListBenchmarksResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListBenchmarksResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Register a benchmark.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "register_benchmark_v1alpha_eval_benchmarks_post", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/eval/benchmarks/{benchmark_id}": { - "delete": { - "tags": [ - "V1Alpha" - ], - "summary": "Unregister a benchmark.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "unregister_benchmark_v1alpha_eval_benchmarks__benchmark_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the benchmark to unregister." - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Get a benchmark by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_benchmark_v1alpha_eval_benchmarks__benchmark_id__get", - "parameters": [ - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Benchmark Id" - }, - "description": "The ID of the benchmark to get." - } - ], - "responses": { - "200": { - "description": "A Benchmark.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Benchmark" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/eval/benchmarks/{benchmark_id}/evaluations": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Evaluate a list of rows on a benchmark.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "evaluate_rows_v1alpha_eval_benchmarks__benchmark_id__evaluations_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BenchmarkConfig" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "EvaluateResponse object containing generations and scores.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluateResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the benchmark to run the evaluation on." - } - ] - } - }, - "/v1alpha/eval/benchmarks/{benchmark_id}/jobs": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Run an evaluation on a benchmark.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "run_eval_v1alpha_eval_benchmarks__benchmark_id__jobs_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BenchmarkConfig" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "The job that was created to run the evaluation.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Job" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the benchmark to run the evaluation on." - } - ] - } - }, - "/v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}": { - "delete": { - "tags": [ - "V1Alpha" - ], - "summary": "Cancel a job.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "job_cancel_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the benchmark to run the evaluation on." - }, - { - "name": "job_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the job to cancel." - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Get the status of a job.", - "description": "Query endpoint for proper schema generation.", - "operationId": "job_status_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__get", - "parameters": [ - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Benchmark Id" - }, - "description": "The ID of the benchmark to run the evaluation on." - }, - { - "name": "job_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Job Id" - }, - "description": "The ID of the job to get the status of." - } - ], - "responses": { - "200": { - "description": "The status of the evaluation job.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Job" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Get the result of a job.", - "description": "Query endpoint for proper schema generation.", - "operationId": "job_result_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__result_get", - "parameters": [ - { - "name": "benchmark_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Benchmark Id" - }, - "description": "The ID of the benchmark to run the evaluation on." - }, - { - "name": "job_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Job Id" - }, - "description": "The ID of the job to get the result of." - } - ], - "responses": { - "200": { - "description": "The result of the job.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EvaluateResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/inference/rerank": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Rerank a list of documents based on their relevance to a query.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "rerank_v1alpha_inference_rerank_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_inference_rerank_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "RerankResponse with indices sorted by relevance score (descending).", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RerankResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1alpha/post-training/job/artifacts": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Get the artifacts of a training job.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_training_job_artifacts_v1alpha_post_training_job_artifacts_get", - "parameters": [ - { - "name": "job_uuid", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Job Uuid" - } - } - ], - "responses": { - "200": { - "description": "A PostTrainingJobArtifactsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostTrainingJobArtifactsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/post-training/job/cancel": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Cancel a training job.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "cancel_training_job_v1alpha_post_training_job_cancel_post", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/post-training/job/status": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Get the status of a training job.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_training_job_status_v1alpha_post_training_job_status_get", - "parameters": [ - { - "name": "job_uuid", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Job Uuid" - } - } - ], - "responses": { - "200": { - "description": "A PostTrainingJobStatusResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostTrainingJobStatusResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1alpha/post-training/jobs": { - "get": { - "tags": [ - "V1Alpha" - ], - "summary": "Get all training jobs.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "get_training_jobs_v1alpha_post_training_jobs_get", - "responses": { - "200": { - "description": "A ListPostTrainingJobsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListPostTrainingJobsResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1alpha/post-training/preference-optimize": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Run preference optimization of a model.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "preference_optimize_v1alpha_post_training_preference_optimize_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DPOAlignmentConfig" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A PostTrainingJob.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostTrainingJob" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1alpha/post-training/supervised-fine-tune": { - "post": { - "tags": [ - "V1Alpha" - ], - "summary": "Run supervised fine-tuning of a model.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "supervised_fine_tune_v1alpha_post_training_supervised_fine_tune_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TrainingConfig" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A PostTrainingJob.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostTrainingJob" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/batches": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all batches for the current user.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_batches_v1_batches_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - } - ], - "responses": { - "200": { - "description": "A list of batch objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListBatchesResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Create a new batch for processing multiple API requests.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_batch_v1_batches_post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_batches_Request" - } - } - } - }, - "responses": { - "200": { - "description": "The created batch object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Batch" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/batches/{batch_id}": { - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve information about a specific batch.", - "description": "Query endpoint for proper schema generation.", - "operationId": "retrieve_batch_v1_batches__batch_id__get", - "parameters": [ - { - "name": "batch_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Batch Id" - }, - "description": "The ID of the batch to retrieve." - } - ], - "responses": { - "200": { - "description": "The batch object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Batch" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/batches/{batch_id}/cancel": { - "post": { - "tags": [ - "V1" - ], - "summary": "Cancel a batch that is in progress.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "cancel_batch_v1_batches__batch_id__cancel_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_batches_batch_id_cancel_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "The updated batch object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Batch" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "batch_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the batch to cancel." - } - ] - } - }, - "/v1/chat/completions": { - "get": { - "tags": [ - "V1" - ], - "summary": "List chat completions.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_chat_completions_v1_chat_completions_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "model", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Model" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "$ref": "#/components/schemas/Order", - "default": "desc" - } - } - ], - "responses": { - "200": { - "description": "A ListOpenAIChatCompletionResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListOpenAIChatCompletionResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Create chat completions.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_chat_completion_v1_chat_completions_post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIChatCompletionRequestWithExtraBody" - } - } - } - }, - "responses": { - "200": { - "description": "An OpenAIChatCompletion.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIChatCompletion" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/chat/completions/{completion_id}": { - "get": { - "tags": [ - "V1" - ], - "summary": "Get chat completion.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_chat_completion_v1_chat_completions__completion_id__get", - "parameters": [ - { - "name": "completion_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Completion Id" - }, - "description": "ID of the chat completion." - } - ], - "responses": { - "200": { - "description": "A OpenAICompletionWithInputMessages.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAICompletionWithInputMessages" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/completions": { - "post": { - "tags": [ - "V1" - ], - "summary": "Create completion.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_completion_v1_completions_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAICompletionRequestWithExtraBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "An OpenAICompletion.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAICompletion" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/conversations": { - "post": { - "tags": [ - "V1" - ], - "summary": "Create a conversation.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_conversation_v1_conversations_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_conversations_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "The created conversation object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Conversation" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/conversations/{conversation_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete a conversation.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_delete_conversation_v1_conversations__conversation_id__delete", - "parameters": [ - { - "name": "conversation_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Conversation Id" - }, - "description": "The conversation identifier." - } - ], - "responses": { - "200": { - "description": "The deleted conversation resource.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConversationDeletedResource" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve a conversation.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_conversation_v1_conversations__conversation_id__get", - "parameters": [ - { - "name": "conversation_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Conversation Id" - }, - "description": "The conversation identifier." - } - ], - "responses": { - "200": { - "description": "The conversation object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Conversation" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Update a conversation.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "update_conversation_v1_conversations__conversation_id__post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_conversations_conversation_id_Request" - } - } - } - }, - "responses": { - "200": { - "description": "The updated conversation object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Conversation" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - }, - "parameters": [ - { - "name": "conversation_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The conversation identifier." - } - ] - } - }, - "/v1/conversations/{conversation_id}/items": { - "get": { - "tags": [ - "V1" - ], - "summary": "List items.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_items_v1_conversations__conversation_id__items_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "include", - "in": "query", - "required": true, - "schema": { - "$ref": "#/components/schemas/ConversationItemInclude" - } - }, - { - "name": "limit", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Order" - } - }, - { - "name": "conversation_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Conversation Id" - }, - "description": "The conversation identifier." - } - ], - "responses": { - "200": { - "description": "List of conversation items.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConversationItemList" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Create items.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "add_items_v1_conversations__conversation_id__items_post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_conversations_conversation_id_items_Request" - } - } - } - }, - "responses": { - "200": { - "description": "List of created items.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConversationItemList" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - }, - "parameters": [ - { - "name": "conversation_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The conversation identifier." - } - ] - } - }, - "/v1/conversations/{conversation_id}/items/{item_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete an item.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_delete_conversation_item_v1_conversations__conversation_id__items__item_id__delete", - "parameters": [ - { - "name": "conversation_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Conversation Id" - }, - "description": "The conversation identifier." - }, - { - "name": "item_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Item Id" - }, - "description": "The item identifier." - } - ], - "responses": { - "200": { - "description": "The deleted item resource.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConversationItemDeletedResource" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve an item.", - "description": "Query endpoint for proper schema generation.", - "operationId": "retrieve_v1_conversations__conversation_id__items__item_id__get", - "parameters": [ - { - "name": "conversation_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Conversation Id" - }, - "description": "The conversation identifier." - }, - { - "name": "item_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Item Id" - }, - "description": "The item identifier." - } - ], - "responses": { - "200": { - "description": "The conversation item.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIResponseMessage" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/embeddings": { - "post": { - "tags": [ - "V1" - ], - "summary": "Create embeddings.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_embeddings_v1_embeddings_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "An OpenAIEmbeddingsResponse containing the embeddings.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIEmbeddingsResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/files": { - "get": { - "tags": [ - "V1" - ], - "summary": "List files.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_list_files_v1_files_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "purpose", - "in": "query", - "required": true, - "schema": { - "$ref": "#/components/schemas/OpenAIFilePurpose" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 10000, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "$ref": "#/components/schemas/Order", - "default": "desc" - } - } - ], - "responses": { - "200": { - "description": "An ListOpenAIFileResponse containing the list of files.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListOpenAIFileResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Upload file.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "openai_upload_file_v1_files_post", - "responses": { - "200": { - "description": "An OpenAIFileObject representing the uploaded file.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIFileObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/files/{file_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete file.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_delete_file_v1_files__file_id__delete", - "parameters": [ - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "File Id" - }, - "description": "The ID of the file to use for this request." - } - ], - "responses": { - "200": { - "description": "An OpenAIFileDeleteResponse indicating successful deletion.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIFileDeleteResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve file.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_retrieve_file_v1_files__file_id__get", - "parameters": [ - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "File Id" - }, - "description": "The ID of the file to use for this request." - } - ], - "responses": { - "200": { - "description": "An OpenAIFileObject containing file information.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIFileObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/files/{file_id}/content": { - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve file content.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "openai_retrieve_file_content_v1_files__file_id__content_get", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the file to use for this request." - } - ], - "responses": { - "200": { - "description": "The raw file content as a binary response.", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/health": { - "get": { - "tags": [ - "V1" - ], - "summary": "Get health status.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "health_v1_health_get", - "responses": { - "200": { - "description": "Health information indicating if the service is operational.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HealthInfo" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/inspect/routes": { - "get": { - "tags": [ - "V1" - ], - "summary": "List routes.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_routes_v1_inspect_routes_get", - "responses": { - "200": { - "description": "Response containing information about all available routes.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListRoutesResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/models": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all models.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_models_v1_models_get", - "responses": { - "200": { - "description": "A ListModelsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListModelsResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Register model.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "register_model_v1_models_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_models_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A Model.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Model" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/models/{model_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Unregister model.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "unregister_model_v1_models__model_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "model_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Path parameter: model_id" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Get model.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_model_v1_models__model_id__get", - "parameters": [ - { - "name": "model_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Model Id" - } - } - ], - "responses": { - "200": { - "description": "A Model.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Model" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/moderations": { - "post": { - "tags": [ - "V1" - ], - "summary": "Create moderation.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "run_moderation_v1_moderations_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_moderations_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A moderation object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModerationObject" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/prompts": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all prompts.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_prompts_v1_prompts_get", - "responses": { - "200": { - "description": "A ListPromptsResponse containing all prompts.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListPromptsResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Create prompt.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_prompt_v1_prompts_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_prompts_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "The created Prompt resource.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Prompt" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/prompts/{prompt_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete prompt.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "delete_prompt_v1_prompts__prompt_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "prompt_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The identifier of the prompt to delete." - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Get prompt.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_prompt_v1_prompts__prompt_id__get", - "parameters": [ - { - "name": "version", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "title": "Version" - } - }, - { - "name": "prompt_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Prompt Id" - }, - "description": "The identifier of the prompt to get." - } - ], - "responses": { - "200": { - "description": "A Prompt resource.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Prompt" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Update prompt.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "update_prompt_v1_prompts__prompt_id__post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_prompts_prompt_id_Request" - } - } - } - }, - "responses": { - "200": { - "description": "The updated Prompt resource with incremented version.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Prompt" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - }, - "parameters": [ - { - "name": "prompt_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The identifier of the prompt to update." - } - ] - } - }, - "/v1/prompts/{prompt_id}/set-default-version": { - "post": { - "tags": [ - "V1" - ], - "summary": "Set prompt version.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "set_default_version_v1_prompts__prompt_id__set_default_version_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_prompts_prompt_id_set_default_version_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "The prompt with the specified version now set as default.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Prompt" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "prompt_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The identifier of the prompt." - } - ] - } - }, - "/v1/prompts/{prompt_id}/versions": { - "get": { - "tags": [ - "V1" - ], - "summary": "List prompt versions.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_prompt_versions_v1_prompts__prompt_id__versions_get", - "parameters": [ - { - "name": "prompt_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Prompt Id" - }, - "description": "The identifier of the prompt to list versions for." - } - ], - "responses": { - "200": { - "description": "A ListPromptsResponse containing all versions of the prompt.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListPromptsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/providers": { - "get": { - "tags": [ - "V1" - ], - "summary": "List providers.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_providers_v1_providers_get", - "responses": { - "200": { - "description": "A ListProvidersResponse containing information about all providers.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListProvidersResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/providers/{provider_id}": { - "get": { - "tags": [ - "V1" - ], - "summary": "Get provider.", - "description": "Query endpoint for proper schema generation.", - "operationId": "inspect_provider_v1_providers__provider_id__get", - "parameters": [ - { - "name": "provider_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Provider Id" - }, - "description": "The ID of the provider to inspect." - } - ], - "responses": { - "200": { - "description": "A ProviderInfo object containing the provider's details.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProviderInfo" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/responses": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all responses.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_openai_responses_v1_responses_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "model", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Model" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 50, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "$ref": "#/components/schemas/Order", - "default": "desc" - } - } - ], - "responses": { - "200": { - "description": "A ListOpenAIResponseObject.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListOpenAIResponseObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Create a model response.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "create_openai_response_v1_responses_post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_responses_Request" - } - } - } - }, - "responses": { - "200": { - "description": "An OpenAIResponseObject.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIResponseObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/responses/{response_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete a response.", - "description": "Query endpoint for proper schema generation.", - "operationId": "delete_openai_response_v1_responses__response_id__delete", - "parameters": [ - { - "name": "response_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Response Id" - }, - "description": "The ID of the OpenAI response to delete." - } - ], - "responses": { - "200": { - "description": "An OpenAIDeleteResponseObject", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIDeleteResponseObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Get a model response.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_openai_response_v1_responses__response_id__get", - "parameters": [ - { - "name": "response_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Response Id" - }, - "description": "The ID of the OpenAI response to retrieve." - } - ], - "responses": { - "200": { - "description": "An OpenAIResponseObject.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAIResponseObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/responses/{response_id}/input_items": { - "get": { - "tags": [ - "V1" - ], - "summary": "List input items.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_openai_response_input_items_v1_responses__response_id__input_items_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "before", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Before" - } - }, - { - "name": "include", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Include" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "$ref": "#/components/schemas/Order", - "default": "desc" - } - }, - { - "name": "response_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Response Id" - }, - "description": "The ID of the response to retrieve input items for." - } - ], - "responses": { - "200": { - "description": "An ListOpenAIResponseInputItem.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListOpenAIResponseInputItem" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/safety/run-shield": { - "post": { - "tags": [ - "V1" - ], - "summary": "Run shield.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "run_shield_v1_safety_run_shield_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_safety_run_shield_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A RunShieldResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RunShieldResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/scoring-functions": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all scoring functions.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_scoring_functions_v1_scoring_functions_get", - "responses": { - "200": { - "description": "A ListScoringFunctionsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListScoringFunctionsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Register a scoring function.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "register_scoring_function_v1_scoring_functions_post", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/scoring-functions/{scoring_fn_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Unregister a scoring function.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "unregister_scoring_function_v1_scoring_functions__scoring_fn_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "scoring_fn_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Path parameter: scoring_fn_id" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Get a scoring function by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_scoring_function_v1_scoring_functions__scoring_fn_id__get", - "parameters": [ - { - "name": "scoring_fn_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Scoring Fn Id" - } - } - ], - "responses": { - "200": { - "description": "A ScoringFn.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScoringFn" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/scoring/score": { - "post": { - "tags": [ - "V1" - ], - "summary": "Score a list of rows.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "score_v1_scoring_score_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_scoring_score_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A ScoreResponse object containing rows and aggregated results.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScoreResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/scoring/score-batch": { - "post": { - "tags": [ - "V1" - ], - "summary": "Score a batch of rows.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "score_batch_v1_scoring_score_batch_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_scoring_score_batch_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A ScoreBatchResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScoreBatchResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/shields": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all shields.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_shields_v1_shields_get", - "responses": { - "200": { - "description": "A ListShieldsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListShieldsResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Register a shield.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "register_shield_v1_shields_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_shields_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A Shield.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Shield" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/shields/{identifier}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Unregister a shield.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "unregister_shield_v1_shields__identifier__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "identifier", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Path parameter: identifier" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Get a shield by its identifier.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_shield_v1_shields__identifier__get", - "parameters": [ - { - "name": "identifier", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Identifier" - } - } - ], - "responses": { - "200": { - "description": "A Shield.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Shield" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/tool-runtime/invoke": { - "post": { - "tags": [ - "V1" - ], - "summary": "Run a tool with the given arguments.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "invoke_tool_v1_tool_runtime_invoke_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_tool_runtime_invoke_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A ToolInvocationResult.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ToolInvocationResult" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/tool-runtime/list-tools": { - "get": { - "tags": [ - "V1" - ], - "summary": "List all tools in the runtime.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_runtime_tools_v1_tool_runtime_list_tools_get", - "parameters": [ - { - "name": "tool_group_id", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Tool Group Id" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/URL" - } - } - } - }, - "responses": { - "200": { - "description": "A ListToolDefsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListToolDefsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/tool-runtime/rag-tool/insert": { - "post": { - "tags": [ - "V1" - ], - "summary": "Index documents so they can be used by the RAG system.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "rag_tool_insert_v1_tool_runtime_rag_tool_insert_post", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/tool-runtime/rag-tool/query": { - "post": { - "tags": [ - "V1" - ], - "summary": "Query the RAG system for context; typically invoked by the agent.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "rag_tool_query_v1_tool_runtime_rag_tool_query_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_tool_runtime_rag_tool_query_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "RAGQueryResult containing the retrieved content and metadata", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RAGQueryResult" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/toolgroups": { - "get": { - "tags": [ - "V1" - ], - "summary": "List tool groups with optional provider.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "list_tool_groups_v1_toolgroups_get", - "responses": { - "200": { - "description": "A ListToolGroupsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListToolGroupsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Register a tool group.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "register_tool_group_v1_toolgroups_post", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/toolgroups/{toolgroup_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Unregister a tool group.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "unregister_toolgroup_v1_toolgroups__toolgroup_id__delete", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - }, - { - "name": "toolgroup_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Path parameter: toolgroup_id" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Get a tool group by its ID.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_tool_group_v1_toolgroups__toolgroup_id__get", - "parameters": [ - { - "name": "toolgroup_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Toolgroup Id" - } - } - ], - "responses": { - "200": { - "description": "A ToolGroup.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ToolGroup" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/tools": { - "get": { - "tags": [ - "V1" - ], - "summary": "List tools with optional tool group.", - "description": "Query endpoint for proper schema generation.", - "operationId": "list_tools_v1_tools_get", - "parameters": [ - { - "name": "toolgroup_id", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Toolgroup Id" - } - } - ], - "responses": { - "200": { - "description": "A ListToolDefsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListToolDefsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/tools/{tool_name}": { - "get": { - "tags": [ - "V1" - ], - "summary": "Get a tool by its name.", - "description": "Query endpoint for proper schema generation.", - "operationId": "get_tool_v1_tools__tool_name__get", - "parameters": [ - { - "name": "tool_name", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Tool Name" - } - } - ], - "responses": { - "200": { - "description": "A ToolDef.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ToolDef" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/vector-io/insert": { - "post": { - "tags": [ - "V1" - ], - "summary": "Insert chunks into a vector database.", - "description": "Generic endpoint - this would be replaced with actual implementation.", - "operationId": "insert_chunks_v1_vector_io_insert_post", - "parameters": [ - { - "name": "args", - "in": "query", - "required": true, - "schema": { - "title": "Args" - } - }, - { - "name": "kwargs", - "in": "query", - "required": true, - "schema": { - "title": "Kwargs" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/vector-io/query": { - "post": { - "tags": [ - "V1" - ], - "summary": "Query chunks from a vector database.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "query_chunks_v1_vector_io_query_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_vector_io_query_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A QueryChunksResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryChunksResponse" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - }, - "/v1/vector_stores": { - "get": { - "tags": [ - "V1" - ], - "summary": "Returns a list of vector stores.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_list_vector_stores_v1_vector_stores_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "before", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Before" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "desc", - "title": "Order" - } - } - ], - "responses": { - "200": { - "description": "A VectorStoreListResponse containing the list of vector stores.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreListResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Creates a vector store.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_create_vector_store_v1_vector_stores_post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody" - } - } - } - }, - "responses": { - "200": { - "description": "A VectorStoreObject representing the created vector store.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/vector_stores/{vector_store_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete a vector store.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_delete_vector_store_v1_vector_stores__vector_store_id__delete", - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store to delete." - } - ], - "responses": { - "200": { - "description": "A VectorStoreDeleteResponse indicating the deletion status.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreDeleteResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieves a vector store.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_retrieve_vector_store_v1_vector_stores__vector_store_id__get", - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store to retrieve." - } - ], - "responses": { - "200": { - "description": "A VectorStoreObject representing the vector store.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Updates a vector store.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_update_vector_store_v1_vector_stores__vector_store_id__post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_vector_stores_vector_store_id_Request" - } - } - } - }, - "responses": { - "200": { - "description": "A VectorStoreObject representing the updated vector store.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - }, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store to update." - } - ] - } - }, - "/v1/vector_stores/{vector_store_id}/file_batches": { - "post": { - "tags": [ - "V1" - ], - "summary": "Create a vector store file batch.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_create_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A VectorStoreFileBatchObject representing the created file batch.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileBatchObject" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store to create the file batch for." - } - ] - } - }, - "/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}": { - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieve a vector store file batch.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_retrieve_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__get", - "parameters": [ - { - "name": "batch_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Batch Id" - }, - "description": "The ID of the file batch to retrieve." - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store containing the file batch." - } - ], - "responses": { - "200": { - "description": "A VectorStoreFileBatchObject representing the file batch.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileBatchObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel": { - "post": { - "tags": [ - "V1" - ], - "summary": "Cancels a vector store file batch.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A VectorStoreFileBatchObject representing the cancelled file batch.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileBatchObject" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "batch_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the file batch to cancel." - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store containing the file batch." - } - ] - } - }, - "/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files": { - "get": { - "tags": [ - "V1" - ], - "summary": "Returns a list of vector store files in a batch.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_list_files_in_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "before", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Before" - } - }, - { - "name": "filter", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Filter" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "desc", - "title": "Order" - } - }, - { - "name": "batch_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Batch Id" - }, - "description": "The ID of the file batch to list files from." - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store containing the file batch." - } - ], - "responses": { - "200": { - "description": "A VectorStoreFilesListInBatchResponse containing the list of files in the batch.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFilesListInBatchResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/vector_stores/{vector_store_id}/files": { - "get": { - "tags": [ - "V1" - ], - "summary": "List files in a vector store.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_list_files_in_vector_store_v1_vector_stores__vector_store_id__files_get", - "parameters": [ - { - "name": "after", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "After" - } - }, - { - "name": "before", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Before" - } - }, - { - "name": "filter", - "in": "query", - "required": true, - "schema": { - "type": "string", - "title": "Filter" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20, - "title": "Limit" - } - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "desc", - "title": "Order" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store to list files from." - } - ], - "responses": { - "200": { - "description": "A VectorStoreListFilesResponse containing the list of files.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreListFilesResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Attach a file to a vector store.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_vector_stores_vector_store_id_files_Request" - } - } - } - }, - "responses": { - "200": { - "description": "A VectorStoreFileObject representing the attached file.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - }, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store to attach the file to." - } - ] - } - }, - "/v1/vector_stores/{vector_store_id}/files/{file_id}": { - "delete": { - "tags": [ - "V1" - ], - "summary": "Delete a vector store file.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete", - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store containing the file to delete." - }, - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "File Id" - }, - "description": "The ID of the file to delete." - } - ], - "responses": { - "200": { - "description": "A VectorStoreFileDeleteResponse indicating the deletion status.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileDeleteResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieves a vector store file.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get", - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store containing the file to retrieve." - }, - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "File Id" - }, - "description": "The ID of the file to retrieve." - } - ], - "responses": { - "200": { - "description": "A VectorStoreFileObject representing the file.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - }, - "post": { - "tags": [ - "V1" - ], - "summary": "Updates a vector store file.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_vector_stores_vector_store_id_files_file_id_Request" - } - } - } - }, - "responses": { - "200": { - "description": "A VectorStoreFileObject representing the updated file.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileObject" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - }, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store containing the file to update." - }, - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the file to update." - } - ] - } - }, - "/v1/vector_stores/{vector_store_id}/files/{file_id}/content": { - "get": { - "tags": [ - "V1" - ], - "summary": "Retrieves the contents of a vector store file.", - "description": "Query endpoint for proper schema generation.", - "operationId": "openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get", - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Vector Store Id" - }, - "description": "The ID of the vector store containing the file to retrieve." - }, - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "File Id" - }, - "description": "The ID of the file to retrieve." - } - ], - "responses": { - "200": { - "description": "A list of InterleavedContent representing the file contents.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreFileContentsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400", - "description": "Bad Request" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429", - "description": "Too Many Requests" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500", - "description": "Internal Server Error" - }, - "default": { - "$ref": "#/components/responses/DefaultError", - "description": "Default Response" - } - } - } - }, - "/v1/vector_stores/{vector_store_id}/search": { - "post": { - "tags": [ - "V1" - ], - "summary": "Search for chunks in a vector store.", - "description": "Typed endpoint for proper schema generation.", - "operationId": "openai_search_vector_store_v1_vector_stores__vector_store_id__search_post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_vector_stores_vector_store_id_search_Request" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "A VectorStoreSearchResponse containing the search results.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VectorStoreSearchResponsePage" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - }, - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "The ID of the vector store to search." - } - ] - } - }, - "/v1/version": { - "get": { - "tags": [ - "V1" - ], - "summary": "Get version.", - "description": "Response-only endpoint for proper schema generation.", - "operationId": "version_v1_version_get", - "responses": { - "200": { - "description": "Version information containing the service version number.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VersionInfo" - } - } - } - }, - "400": { - "description": "Bad Request", - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "description": "Too Many Requests", - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "description": "Internal Server Error", - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "description": "Default Response", - "$ref": "#/components/responses/DefaultError" - } - } - } - } - }, - "components": { - "schemas": { - "AgentCandidate": { - "properties": { - "type": { - "type": "string", - "const": "agent", - "title": "Type", - "default": "agent" - }, - "config": { - "$ref": "#/components/schemas/AgentConfig" - } - }, - "type": "object", - "required": [ - "config" - ], - "title": "AgentCandidate", - "description": "An agent candidate for evaluation." - }, - "AgentConfig": { - "properties": { - "sampling_params": { - "$ref": "#/components/schemas/SamplingParams" - }, - "input_shields": { - "title": "Input Shields", - "items": { - "type": "string" - }, - "type": "array" - }, - "output_shields": { - "title": "Output Shields", - "items": { - "type": "string" - }, - "type": "array" - }, - "toolgroups": { - "title": "Toolgroups", - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/AgentToolGroupWithArgs" - } - ] - }, - "type": "array" - }, - "client_tools": { - "title": "Client Tools", - "items": { - "$ref": "#/components/schemas/ToolDef" - }, - "type": "array" - }, - "tool_choice": { - "deprecated": true, - "$ref": "#/components/schemas/ToolChoice" - }, - "tool_prompt_format": { - "deprecated": true, - "$ref": "#/components/schemas/ToolPromptFormat" - }, - "tool_config": { - "$ref": "#/components/schemas/ToolConfig" - }, - "max_infer_iters": { - "title": "Max Infer Iters", - "default": 10, - "type": "integer" - }, - "model": { - "type": "string", - "title": "Model" - }, - "instructions": { - "type": "string", - "title": "Instructions" - }, - "name": { - "title": "Name", - "type": "string" - }, - "enable_session_persistence": { - "title": "Enable Session Persistence", - "default": false, - "type": "boolean" - }, - "response_format": { - "title": "Response Format", - "oneOf": [ - { - "$ref": "#/components/schemas/JsonSchemaResponseFormat" - }, - { - "$ref": "#/components/schemas/GrammarResponseFormat" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "grammar": "#/components/schemas/GrammarResponseFormat", - "json_schema": "#/components/schemas/JsonSchemaResponseFormat" - } - } - } - }, - "type": "object", - "required": [ - "model", - "instructions" - ], - "title": "AgentConfig", - "description": "Configuration for an agent." - }, - "AgentCreateResponse": { - "properties": { - "agent_id": { - "type": "string", - "title": "Agent Id" - } - }, - "type": "object", - "required": [ - "agent_id" - ], - "title": "AgentCreateResponse", - "description": "Response returned when creating a new agent." - }, - "AgentSessionCreateResponse": { - "properties": { - "session_id": { - "type": "string", - "title": "Session Id" - } - }, - "type": "object", - "required": [ - "session_id" - ], - "title": "AgentSessionCreateResponse", - "description": "Response returned when creating a new agent session." - }, - "AgentToolGroupWithArgs": { - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "args": { - "additionalProperties": true, - "type": "object", - "title": "Args" - } - }, - "type": "object", - "required": [ - "name", - "args" - ], - "title": "AgentToolGroupWithArgs" - }, - "AgentTurnInputType": { - "properties": { - "type": { - "type": "string", - "const": "agent_turn_input", - "title": "Type", - "default": "agent_turn_input" - } - }, - "type": "object", - "title": "AgentTurnInputType", - "description": "Parameter type for agent turn input." - }, - "AggregationFunctionType": { - "type": "string", - "enum": [ - "average", - "weighted_average", - "median", - "categorical_count", - "accuracy" - ], - "title": "AggregationFunctionType", - "description": "Types of aggregation functions for scoring results." - }, - "AllowedToolsFilter": { - "properties": { - "tool_names": { - "title": "Tool Names", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object", - "title": "AllowedToolsFilter", - "description": "Filter configuration for restricting which MCP tools can be used." - }, - "ApprovalFilter": { - "properties": { - "always": { - "title": "Always", - "items": { - "type": "string" - }, - "type": "array" - }, - "never": { - "title": "Never", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object", - "title": "ApprovalFilter", - "description": "Filter configuration for MCP tool approval requirements." - }, - "ArrayType": { - "properties": { - "type": { - "type": "string", - "const": "array", - "title": "Type", - "default": "array" - } - }, - "type": "object", - "title": "ArrayType", - "description": "Parameter type for array values." - }, - "Attachment-Output": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - }, - { - "$ref": "#/components/schemas/URL" - } - ], - "title": "Content" - }, - "mime_type": { - "type": "string", - "title": "Mime Type" - } - }, - "type": "object", - "required": [ - "content", - "mime_type" - ], - "title": "Attachment", - "description": "An attachment to an agent turn." - }, - "BasicScoringFnParams": { - "properties": { - "type": { - "type": "string", - "const": "basic", - "title": "Type", - "default": "basic" - }, - "aggregation_functions": { - "items": { - "$ref": "#/components/schemas/AggregationFunctionType" - }, - "type": "array", - "title": "Aggregation Functions", - "description": "Aggregation functions to apply to the scores of each row" - } - }, - "type": "object", - "title": "BasicScoringFnParams", - "description": "Parameters for basic scoring function configuration." - }, - "Batch": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "completion_window": { - "type": "string", - "title": "Completion Window" - }, - "created_at": { - "type": "integer", - "title": "Created At" - }, - "endpoint": { - "type": "string", - "title": "Endpoint" - }, - "input_file_id": { - "type": "string", - "title": "Input File Id" - }, - "object": { - "type": "string", - "const": "batch", - "title": "Object" - }, - "status": { - "type": "string", - "enum": [ - "validating", - "failed", - "in_progress", - "finalizing", - "completed", - "expired", - "cancelling", - "cancelled" - ], - "title": "Status" - }, - "cancelled_at": { - "title": "Cancelled At", - "type": "integer" - }, - "cancelling_at": { - "title": "Cancelling At", - "type": "integer" - }, - "completed_at": { - "title": "Completed At", - "type": "integer" - }, - "error_file_id": { - "title": "Error File Id", - "type": "string" - }, - "errors": { - "$ref": "#/components/schemas/Errors" - }, - "expired_at": { - "title": "Expired At", - "type": "integer" - }, - "expires_at": { - "title": "Expires At", - "type": "integer" - }, - "failed_at": { - "title": "Failed At", - "type": "integer" - }, - "finalizing_at": { - "title": "Finalizing At", - "type": "integer" - }, - "in_progress_at": { - "title": "In Progress At", - "type": "integer" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "model": { - "title": "Model", - "type": "string" - }, - "output_file_id": { - "title": "Output File Id", - "type": "string" - }, - "request_counts": { - "$ref": "#/components/schemas/BatchRequestCounts" - }, - "usage": { - "$ref": "#/components/schemas/BatchUsage" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "completion_window", - "created_at", - "endpoint", - "input_file_id", - "object", - "status" - ], - "title": "Batch" - }, - "BatchError": { - "properties": { - "code": { - "title": "Code", - "type": "string" - }, - "line": { - "title": "Line", - "type": "integer" - }, - "message": { - "title": "Message", - "type": "string" - }, - "param": { - "title": "Param", - "type": "string" - } - }, - "additionalProperties": true, - "type": "object", - "title": "BatchError" - }, - "BatchRequestCounts": { - "properties": { - "completed": { - "type": "integer", - "title": "Completed" - }, - "failed": { - "type": "integer", - "title": "Failed" - }, - "total": { - "type": "integer", - "title": "Total" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "completed", - "failed", - "total" - ], - "title": "BatchRequestCounts" - }, - "BatchUsage": { - "properties": { - "input_tokens": { - "type": "integer", - "title": "Input Tokens" - }, - "input_tokens_details": { - "$ref": "#/components/schemas/InputTokensDetails" - }, - "output_tokens": { - "type": "integer", - "title": "Output Tokens" - }, - "output_tokens_details": { - "$ref": "#/components/schemas/OutputTokensDetails" - }, - "total_tokens": { - "type": "integer", - "title": "Total Tokens" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "input_tokens", - "input_tokens_details", - "output_tokens", - "output_tokens_details", - "total_tokens" - ], - "title": "BatchUsage" - }, - "Benchmark": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "benchmark", - "title": "Type", - "default": "benchmark" - }, - "dataset_id": { - "type": "string", - "title": "Dataset Id" - }, - "scoring_functions": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Scoring Functions" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata", - "description": "Metadata for this evaluation task" - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id", - "dataset_id", - "scoring_functions" - ], - "title": "Benchmark", - "description": "A benchmark resource for evaluating model performance." - }, - "BenchmarkConfig": { - "properties": { - "eval_candidate": { - "oneOf": [ - { - "$ref": "#/components/schemas/ModelCandidate" - }, - { - "$ref": "#/components/schemas/AgentCandidate" - } - ], - "title": "Eval Candidate", - "discriminator": { - "propertyName": "type", - "mapping": { - "agent": "#/components/schemas/AgentCandidate", - "model": "#/components/schemas/ModelCandidate" - } - } - }, - "scoring_params": { - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" - }, - { - "$ref": "#/components/schemas/RegexParserScoringFnParams" - }, - { - "$ref": "#/components/schemas/BasicScoringFnParams" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "basic": "#/components/schemas/BasicScoringFnParams", - "llm_as_judge": "#/components/schemas/LLMAsJudgeScoringFnParams", - "regex_parser": "#/components/schemas/RegexParserScoringFnParams" - } - } - }, - "type": "object", - "title": "Scoring Params", - "description": "Map between scoring function id and parameters for each scoring function you want to run" - }, - "num_examples": { - "title": "Num Examples", - "description": "Number of examples to evaluate (useful for testing), if not provided, all examples in the dataset will be evaluated", - "type": "integer" - } - }, - "type": "object", - "required": [ - "eval_candidate" - ], - "title": "BenchmarkConfig", - "description": "A benchmark configuration for evaluation." - }, - "BooleanType": { - "properties": { - "type": { - "type": "string", - "const": "boolean", - "title": "Type", - "default": "boolean" - } - }, - "type": "object", - "title": "BooleanType", - "description": "Parameter type for boolean values." - }, - "BuiltinTool": { - "type": "string", - "enum": [ - "brave_search", - "wolfram_alpha", - "photogen", - "code_interpreter" - ], - "title": "BuiltinTool" - }, - "ChatCompletionInputType": { - "properties": { - "type": { - "type": "string", - "const": "chat_completion_input", - "title": "Type", - "default": "chat_completion_input" - } - }, - "type": "object", - "title": "ChatCompletionInputType", - "description": "Parameter type for chat completion input." - }, - "Chunk-Output": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "chunk_id": { - "type": "string", - "title": "Chunk Id" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - }, - "embedding": { - "title": "Embedding", - "items": { - "type": "number" - }, - "type": "array" - }, - "chunk_metadata": { - "$ref": "#/components/schemas/ChunkMetadata" - } - }, - "type": "object", - "required": [ - "content", - "chunk_id" - ], - "title": "Chunk", - "description": "A chunk of content that can be inserted into a vector database." - }, - "ChunkMetadata": { - "properties": { - "chunk_id": { - "title": "Chunk Id", - "type": "string" - }, - "document_id": { - "title": "Document Id", - "type": "string" - }, - "source": { - "title": "Source", - "type": "string" - }, - "created_timestamp": { - "title": "Created Timestamp", - "type": "integer" - }, - "updated_timestamp": { - "title": "Updated Timestamp", - "type": "integer" - }, - "chunk_window": { - "title": "Chunk Window", - "type": "string" - }, - "chunk_tokenizer": { - "title": "Chunk Tokenizer", - "type": "string" - }, - "chunk_embedding_model": { - "title": "Chunk Embedding Model", - "type": "string" - }, - "chunk_embedding_dimension": { - "title": "Chunk Embedding Dimension", - "type": "integer" - }, - "content_token_count": { - "title": "Content Token Count", - "type": "integer" - }, - "metadata_token_count": { - "title": "Metadata Token Count", - "type": "integer" - } - }, - "type": "object", - "title": "ChunkMetadata", - "description": "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." - }, - "CompletionInputType": { - "properties": { - "type": { - "type": "string", - "const": "completion_input", - "title": "Type", - "default": "completion_input" - } - }, - "type": "object", - "title": "CompletionInputType", - "description": "Parameter type for completion input." - }, - "CompletionMessage-Output": { - "properties": { - "role": { - "type": "string", - "const": "assistant", - "title": "Role", - "default": "assistant" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "stop_reason": { - "$ref": "#/components/schemas/StopReason" - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/ToolCall" - }, - "type": "array" - } - }, - "type": "object", - "required": [ - "content", - "stop_reason" - ], - "title": "CompletionMessage", - "description": "A message containing the model's (assistant) response in a chat conversation." - }, - "Conversation": { - "properties": { - "id": { - "type": "string", - "title": "Id", - "description": "The unique ID of the conversation." - }, - "object": { - "type": "string", - "const": "conversation", - "title": "Object", - "description": "The object type, which is always conversation.", - "default": "conversation" - }, - "created_at": { - "type": "integer", - "title": "Created At", - "description": "The time at which the conversation was created, measured in seconds since the Unix epoch." - }, - "metadata": { - "title": "Metadata", - "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.", - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - "items": { - "title": "Items", - "description": "Initial items to include in the conversation context. You may add up to 20 items at a time.", - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - } - }, - "type": "object", - "required": [ - "id", - "created_at" - ], - "title": "Conversation", - "description": "OpenAI-compatible conversation object." - }, - "ConversationItemInclude": { - "type": "string", - "enum": [ - "web_search_call.action.sources", - "code_interpreter_call.outputs", - "computer_call_output.output.image_url", - "file_search_call.results", - "message.input_image.image_url", - "message.output_text.logprobs", - "reasoning.encrypted_content" - ], - "title": "ConversationItemInclude", - "description": "Specify additional output data to include in the model response." - }, - "ConversationItemList": { - "properties": { - "object": { - "type": "string", - "title": "Object", - "description": "Object type", - "default": "list" - }, - "data": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage-Output" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", - "function_call_output": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput", - "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", - "mcp_approval_response": "#/components/schemas/OpenAIResponseMCPApprovalResponse", - "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", - "message": "#/components/schemas/OpenAIResponseMessage-Output", - "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - } - } - }, - "type": "array", - "title": "Data", - "description": "List of conversation items" - }, - "first_id": { - "title": "First Id", - "description": "The ID of the first item in the list", - "type": "string" - }, - "last_id": { - "title": "Last Id", - "description": "The ID of the last item in the list", - "type": "string" - }, - "has_more": { - "type": "boolean", - "title": "Has More", - "description": "Whether there are more items available", - "default": false - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ConversationItemList", - "description": "List of conversation items with pagination." - }, - "DPOAlignmentConfig": { - "properties": { - "beta": { - "type": "number", - "title": "Beta" - }, - "loss_type": { - "$ref": "#/components/schemas/DPOLossType", - "default": "sigmoid" - } - }, - "type": "object", - "required": [ - "beta" - ], - "title": "DPOAlignmentConfig", - "description": "Configuration for Direct Preference Optimization (DPO) alignment." - }, - "DPOLossType": { - "type": "string", - "enum": [ - "sigmoid", - "hinge", - "ipo", - "kto_pair" - ], - "title": "DPOLossType" - }, - "DataConfig": { - "properties": { - "dataset_id": { - "type": "string", - "title": "Dataset Id" - }, - "batch_size": { - "type": "integer", - "title": "Batch Size" - }, - "shuffle": { - "type": "boolean", - "title": "Shuffle" - }, - "data_format": { - "$ref": "#/components/schemas/DatasetFormat" - }, - "validation_dataset_id": { - "title": "Validation Dataset Id", - "type": "string" - }, - "packed": { - "title": "Packed", - "default": false, - "type": "boolean" - }, - "train_on_input": { - "title": "Train On Input", - "default": false, - "type": "boolean" - } - }, - "type": "object", - "required": [ - "dataset_id", - "batch_size", - "shuffle", - "data_format" - ], - "title": "DataConfig", - "description": "Configuration for training data and data loading." - }, - "Dataset": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "dataset", - "title": "Type", - "default": "dataset" - }, - "purpose": { - "$ref": "#/components/schemas/DatasetPurpose" - }, - "source": { - "oneOf": [ - { - "$ref": "#/components/schemas/URIDataSource" - }, - { - "$ref": "#/components/schemas/RowsDataSource" - } - ], - "title": "Source", - "discriminator": { - "propertyName": "type", - "mapping": { - "rows": "#/components/schemas/RowsDataSource", - "uri": "#/components/schemas/URIDataSource" - } - } - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata", - "description": "Any additional metadata for this dataset" - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id", - "purpose", - "source" - ], - "title": "Dataset", - "description": "Dataset resource for storing and accessing training or evaluation data." - }, - "DatasetFormat": { - "type": "string", - "enum": [ - "instruct", - "dialog" - ], - "title": "DatasetFormat", - "description": "Format of the training dataset." - }, - "DatasetPurpose": { - "type": "string", - "enum": [ - "post-training/messages", - "eval/question-answer", - "eval/messages-answer" - ], - "title": "DatasetPurpose", - "description": "Purpose of the dataset. Each purpose has a required input data schema." - }, - "DefaultRAGQueryGeneratorConfig": { - "properties": { - "type": { - "type": "string", - "const": "default", - "title": "Type", - "default": "default" - }, - "separator": { - "type": "string", - "title": "Separator", - "default": " " - } - }, - "type": "object", - "title": "DefaultRAGQueryGeneratorConfig", - "description": "Configuration for the default RAG query generator." - }, - "Document": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - }, - { - "$ref": "#/components/schemas/URL" - } - ], - "title": "Content" - }, - "mime_type": { - "type": "string", - "title": "Mime Type" - } - }, - "type": "object", - "required": [ - "content", - "mime_type" - ], - "title": "Document", - "description": "A document to be used by an agent." - }, - "EfficiencyConfig": { - "properties": { - "enable_activation_checkpointing": { - "title": "Enable Activation Checkpointing", - "default": false, - "type": "boolean" - }, - "enable_activation_offloading": { - "title": "Enable Activation Offloading", - "default": false, - "type": "boolean" - }, - "memory_efficient_fsdp_wrap": { - "title": "Memory Efficient Fsdp Wrap", - "default": false, - "type": "boolean" - }, - "fsdp_cpu_offload": { - "title": "Fsdp Cpu Offload", - "default": false, - "type": "boolean" - } - }, - "type": "object", - "title": "EfficiencyConfig", - "description": "Configuration for memory and compute efficiency optimizations." - }, - "Errors": { - "properties": { - "data": { - "title": "Data", - "items": { - "$ref": "#/components/schemas/BatchError" - }, - "type": "array" - }, - "object": { - "title": "Object", - "type": "string" - } - }, - "additionalProperties": true, - "type": "object", - "title": "Errors" - }, - "EvaluateResponse": { - "properties": { - "generations": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Generations" - }, - "scores": { - "additionalProperties": { - "$ref": "#/components/schemas/ScoringResult" - }, - "type": "object", - "title": "Scores" - } - }, - "type": "object", - "required": [ - "generations", - "scores" - ], - "title": "EvaluateResponse", - "description": "The response from an evaluation." - }, - "GrammarResponseFormat": { - "properties": { - "type": { - "type": "string", - "const": "grammar", - "title": "Type", - "default": "grammar" - }, - "bnf": { - "additionalProperties": true, - "type": "object", - "title": "Bnf" - } - }, - "type": "object", - "required": [ - "bnf" - ], - "title": "GrammarResponseFormat", - "description": "Configuration for grammar-guided response generation." - }, - "GreedySamplingStrategy": { - "properties": { - "type": { - "type": "string", - "const": "greedy", - "title": "Type", - "default": "greedy" - } - }, - "type": "object", - "title": "GreedySamplingStrategy", - "description": "Greedy sampling strategy that selects the highest probability token at each step." - }, - "HealthInfo": { - "properties": { - "status": { - "$ref": "#/components/schemas/HealthStatus" - } - }, - "type": "object", - "required": [ - "status" - ], - "title": "HealthInfo", - "description": "Health status information for the service." - }, - "HealthStatus": { - "type": "string", - "enum": [ - "OK", - "Error", - "Not Implemented" - ], - "title": "HealthStatus" - }, - "ImageContentItem-Input": { - "properties": { - "type": { - "type": "string", - "const": "image", - "title": "Type", - "default": "image" - }, - "image": { - "$ref": "#/components/schemas/_URLOrData" - } - }, - "type": "object", - "required": [ - "image" - ], - "title": "ImageContentItem", - "description": "A image content item" - }, - "ImageContentItem-Output": { - "properties": { - "type": { - "type": "string", - "const": "image", - "title": "Type", - "default": "image" - }, - "image": { - "$ref": "#/components/schemas/_URLOrData" - } - }, - "type": "object", - "required": [ - "image" - ], - "title": "ImageContentItem", - "description": "A image content item" - }, - "InferenceStep-Output": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "step_id": { - "type": "string", - "title": "Step Id" - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - }, - "step_type": { - "type": "string", - "const": "inference", - "title": "Step Type", - "default": "inference" - }, - "model_response": { - "$ref": "#/components/schemas/CompletionMessage-Output" - } - }, - "type": "object", - "required": [ - "turn_id", - "step_id", - "model_response" - ], - "title": "InferenceStep", - "description": "An inference step in an agent turn." - }, - "InputTokensDetails": { - "properties": { - "cached_tokens": { - "type": "integer", - "title": "Cached Tokens" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "cached_tokens" - ], - "title": "InputTokensDetails" - }, - "Job": { - "properties": { - "job_id": { - "type": "string", - "title": "Job Id" - }, - "status": { - "$ref": "#/components/schemas/JobStatus" - } - }, - "type": "object", - "required": [ - "job_id", - "status" - ], - "title": "Job", - "description": "A job execution instance with status tracking." - }, - "JobStatus": { - "type": "string", - "enum": [ - "completed", - "in_progress", - "failed", - "scheduled", - "cancelled" - ], - "title": "JobStatus", - "description": "Status of a job execution." - }, - "JsonSchemaResponseFormat": { - "properties": { - "type": { - "type": "string", - "const": "json_schema", - "title": "Type", - "default": "json_schema" - }, - "json_schema": { - "additionalProperties": true, - "type": "object", - "title": "Json Schema" - } - }, - "type": "object", - "required": [ - "json_schema" - ], - "title": "JsonSchemaResponseFormat", - "description": "Configuration for JSON schema-guided response generation." - }, - "JsonType": { - "properties": { - "type": { - "type": "string", - "const": "json", - "title": "Type", - "default": "json" - } - }, - "type": "object", - "title": "JsonType", - "description": "Parameter type for JSON values." - }, - "LLMAsJudgeScoringFnParams": { - "properties": { - "type": { - "type": "string", - "const": "llm_as_judge", - "title": "Type", - "default": "llm_as_judge" - }, - "judge_model": { - "type": "string", - "title": "Judge Model" - }, - "prompt_template": { - "title": "Prompt Template", - "type": "string" - }, - "judge_score_regexes": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Judge Score Regexes", - "description": "Regexes to extract the answer from generated response" - }, - "aggregation_functions": { - "items": { - "$ref": "#/components/schemas/AggregationFunctionType" - }, - "type": "array", - "title": "Aggregation Functions", - "description": "Aggregation functions to apply to the scores of each row" - } - }, - "type": "object", - "required": [ - "judge_model" - ], - "title": "LLMAsJudgeScoringFnParams", - "description": "Parameters for LLM-as-judge scoring function configuration." - }, - "LLMRAGQueryGeneratorConfig": { - "properties": { - "type": { - "type": "string", - "const": "llm", - "title": "Type", - "default": "llm" - }, - "model": { - "type": "string", - "title": "Model" - }, - "template": { - "type": "string", - "title": "Template" - } - }, - "type": "object", - "required": [ - "model", - "template" - ], - "title": "LLMRAGQueryGeneratorConfig", - "description": "Configuration for the LLM-based RAG query generator." - }, - "ListBenchmarksResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Benchmark" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListBenchmarksResponse" - }, - "ListDatasetsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Dataset" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListDatasetsResponse", - "description": "Response from listing datasets." - }, - "ListModelsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Model" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListModelsResponse" - }, - "ListPostTrainingJobsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/PostTrainingJob" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListPostTrainingJobsResponse" - }, - "ListPromptsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Prompt" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListPromptsResponse", - "description": "Response model to list prompts." - }, - "ListProvidersResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ProviderInfo" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListProvidersResponse", - "description": "Response containing a list of all available providers." - }, - "ListRoutesResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/RouteInfo" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListRoutesResponse", - "description": "Response containing a list of all available API routes." - }, - "ListScoringFunctionsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ScoringFn-Output" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListScoringFunctionsResponse" - }, - "ListShieldsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Shield" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListShieldsResponse" - }, - "ListToolGroupsResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ToolGroup" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "ListToolGroupsResponse", - "description": "Response containing a list of tool groups." - }, - "MCPListToolsTool": { - "properties": { - "input_schema": { - "additionalProperties": true, - "type": "object", - "title": "Input Schema" - }, - "name": { - "type": "string", - "title": "Name" - }, - "description": { - "title": "Description", - "type": "string" - } - }, - "type": "object", - "required": [ - "input_schema", - "name" - ], - "title": "MCPListToolsTool", - "description": "Tool definition returned by MCP list tools operation." - }, - "MemoryRetrievalStep-Output": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "step_id": { - "type": "string", - "title": "Step Id" - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - }, - "step_type": { - "type": "string", - "const": "memory_retrieval", - "title": "Step Type", - "default": "memory_retrieval" - }, - "vector_store_ids": { - "type": "string", - "title": "Vector Store Ids" - }, - "inserted_context": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Inserted Context" - } - }, - "type": "object", - "required": [ - "turn_id", - "step_id", - "vector_store_ids", - "inserted_context" - ], - "title": "MemoryRetrievalStep", - "description": "A memory retrieval step in an agent turn." - }, - "Model": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "model", - "title": "Type", - "default": "model" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata", - "description": "Any additional metadata for this model" - }, - "model_type": { - "$ref": "#/components/schemas/ModelType", - "default": "llm" - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id" - ], - "title": "Model", - "description": "A model resource representing an AI model registered in Llama Stack." - }, - "ModelCandidate": { - "properties": { - "type": { - "type": "string", - "const": "model", - "title": "Type", - "default": "model" - }, - "model": { - "type": "string", - "title": "Model" - }, - "sampling_params": { - "$ref": "#/components/schemas/SamplingParams" - }, - "system_message": { - "$ref": "#/components/schemas/SystemMessage" - } - }, - "type": "object", - "required": [ - "model", - "sampling_params" - ], - "title": "ModelCandidate", - "description": "A model candidate for evaluation." - }, - "ModelType": { - "type": "string", - "enum": [ - "llm", - "embedding", - "rerank" - ], - "title": "ModelType", - "description": "Enumeration of supported model types in Llama Stack." - }, - "ModerationObject": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "model": { - "type": "string", - "title": "Model" - }, - "results": { - "items": { - "$ref": "#/components/schemas/ModerationObjectResults" - }, - "type": "array", - "title": "Results" - } - }, - "type": "object", - "required": [ - "id", - "model", - "results" - ], - "title": "ModerationObject", - "description": "A moderation object." - }, - "ModerationObjectResults": { - "properties": { - "flagged": { - "type": "boolean", - "title": "Flagged" - }, - "categories": { - "title": "Categories", - "additionalProperties": { - "type": "boolean" - }, - "type": "object" - }, - "category_applied_input_types": { - "title": "Category Applied Input Types", - "additionalProperties": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": "object" - }, - "category_scores": { - "title": "Category Scores", - "additionalProperties": { - "type": "number" - }, - "type": "object" - }, - "user_message": { - "title": "User Message", - "type": "string" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "flagged" - ], - "title": "ModerationObjectResults", - "description": "A moderation object." - }, - "NumberType": { - "properties": { - "type": { - "type": "string", - "const": "number", - "title": "Type", - "default": "number" - } - }, - "type": "object", - "title": "NumberType", - "description": "Parameter type for numeric values." - }, - "ObjectType": { - "properties": { - "type": { - "type": "string", - "const": "object", - "title": "Type", - "default": "object" - } - }, - "type": "object", - "title": "ObjectType", - "description": "Parameter type for object values." - }, - "OpenAIAssistantMessageParam-Input": { - "properties": { - "role": { - "type": "string", - "const": "assistant", - "title": "Role", - "default": "assistant" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" - }, - "type": "array" - } - }, - "type": "object", - "title": "OpenAIAssistantMessageParam", - "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request." - }, - "OpenAIAssistantMessageParam-Output": { - "properties": { - "role": { - "type": "string", - "const": "assistant", - "title": "Role", - "default": "assistant" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" - }, - "type": "array" - } - }, - "type": "object", - "title": "OpenAIAssistantMessageParam", - "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request." - }, - "OpenAIChatCompletion": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "choices": { - "items": { - "$ref": "#/components/schemas/OpenAIChoice-Output" - }, - "type": "array", - "title": "Choices" - }, - "object": { - "type": "string", - "const": "chat.completion", - "title": "Object", - "default": "chat.completion" - }, - "created": { - "type": "integer", - "title": "Created" - }, - "model": { - "type": "string", - "title": "Model" - }, - "usage": { - "$ref": "#/components/schemas/OpenAIChatCompletionUsage" - } - }, - "type": "object", - "required": [ - "id", - "choices", - "created", - "model" - ], - "title": "OpenAIChatCompletion", - "description": "Response from an OpenAI-compatible chat completion request." - }, - "OpenAIChatCompletionContentPartImageParam": { - "properties": { - "type": { - "type": "string", - "const": "image_url", - "title": "Type", - "default": "image_url" - }, - "image_url": { - "$ref": "#/components/schemas/OpenAIImageURL" - } - }, - "type": "object", - "required": [ - "image_url" - ], - "title": "OpenAIChatCompletionContentPartImageParam", - "description": "Image content part for OpenAI-compatible chat completion messages." - }, - "OpenAIChatCompletionContentPartTextParam": { - "properties": { - "type": { - "type": "string", - "const": "text", - "title": "Type", - "default": "text" - }, - "text": { - "type": "string", - "title": "Text" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "OpenAIChatCompletionContentPartTextParam", - "description": "Text content part for OpenAI-compatible chat completion messages." - }, - "OpenAIChatCompletionRequestWithExtraBody": { - "properties": { - "model": { - "type": "string", - "title": "Model" - }, - "messages": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIUserMessageParam-Input" - }, - { - "$ref": "#/components/schemas/OpenAISystemMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIAssistantMessageParam-Input" - }, - { - "$ref": "#/components/schemas/OpenAIToolMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" - } - ], - "discriminator": { - "propertyName": "role", - "mapping": { - "assistant": "#/components/schemas/OpenAIAssistantMessageParam-Input", - "developer": "#/components/schemas/OpenAIDeveloperMessageParam", - "system": "#/components/schemas/OpenAISystemMessageParam", - "tool": "#/components/schemas/OpenAIToolMessageParam", - "user": "#/components/schemas/OpenAIUserMessageParam-Input" - } - } - }, - "type": "array", - "minItems": 1, - "title": "Messages" - }, - "frequency_penalty": { - "title": "Frequency Penalty", - "type": "number" - }, - "function_call": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": true, - "type": "object" - } - ], - "title": "Function Call" - }, - "functions": { - "title": "Functions", - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - "logit_bias": { - "title": "Logit Bias", - "additionalProperties": { - "type": "number" - }, - "type": "object" - }, - "logprobs": { - "title": "Logprobs", - "type": "boolean" - }, - "max_completion_tokens": { - "title": "Max Completion Tokens", - "type": "integer" - }, - "max_tokens": { - "title": "Max Tokens", - "type": "integer" - }, - "n": { - "title": "N", - "type": "integer" - }, - "parallel_tool_calls": { - "title": "Parallel Tool Calls", - "type": "boolean" - }, - "presence_penalty": { - "title": "Presence Penalty", - "type": "number" - }, - "response_format": { - "title": "Response Format", - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseFormatText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseFormatJSONSchema" - }, - { - "$ref": "#/components/schemas/OpenAIResponseFormatJSONObject" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "json_object": "#/components/schemas/OpenAIResponseFormatJSONObject", - "json_schema": "#/components/schemas/OpenAIResponseFormatJSONSchema", - "text": "#/components/schemas/OpenAIResponseFormatText" - } - } - }, - "seed": { - "title": "Seed", - "type": "integer" - }, - "stop": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ], - "title": "Stop" - }, - "stream": { - "title": "Stream", - "type": "boolean" - }, - "stream_options": { - "title": "Stream Options", - "additionalProperties": true, - "type": "object" - }, - "temperature": { - "title": "Temperature", - "type": "number" - }, - "tool_choice": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": true, - "type": "object" - } - ], - "title": "Tool Choice" - }, - "tools": { - "title": "Tools", - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - "top_logprobs": { - "title": "Top Logprobs", - "type": "integer" - }, - "top_p": { - "title": "Top P", - "type": "number" - }, - "user": { - "title": "User", - "type": "string" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "model", - "messages" - ], - "title": "OpenAIChatCompletionRequestWithExtraBody", - "description": "Request parameters for OpenAI-compatible chat completion endpoint." - }, - "OpenAIChatCompletionToolCall": { - "properties": { - "index": { - "title": "Index", - "type": "integer" - }, - "id": { - "title": "Id", - "type": "string" - }, - "type": { - "type": "string", - "const": "function", - "title": "Type", - "default": "function" - }, - "function": { - "$ref": "#/components/schemas/OpenAIChatCompletionToolCallFunction" - } - }, - "type": "object", - "title": "OpenAIChatCompletionToolCall", - "description": "Tool call specification for OpenAI-compatible chat completion responses." - }, - "OpenAIChatCompletionToolCallFunction": { - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "arguments": { - "title": "Arguments", - "type": "string" - } - }, - "type": "object", - "title": "OpenAIChatCompletionToolCallFunction", - "description": "Function call details for OpenAI-compatible tool calls." - }, - "OpenAIChatCompletionUsage": { - "properties": { - "prompt_tokens": { - "type": "integer", - "title": "Prompt Tokens" - }, - "completion_tokens": { - "type": "integer", - "title": "Completion Tokens" - }, - "total_tokens": { - "type": "integer", - "title": "Total Tokens" - }, - "prompt_tokens_details": { - "$ref": "#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails" - }, - "completion_tokens_details": { - "$ref": "#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails" - } - }, - "type": "object", - "required": [ - "prompt_tokens", - "completion_tokens", - "total_tokens" - ], - "title": "OpenAIChatCompletionUsage", - "description": "Usage information for OpenAI chat completion." - }, - "OpenAIChatCompletionUsageCompletionTokensDetails": { - "properties": { - "reasoning_tokens": { - "title": "Reasoning Tokens", - "type": "integer" - } - }, - "type": "object", - "title": "OpenAIChatCompletionUsageCompletionTokensDetails", - "description": "Token details for output tokens in OpenAI chat completion usage." - }, - "OpenAIChatCompletionUsagePromptTokensDetails": { - "properties": { - "cached_tokens": { - "title": "Cached Tokens", - "type": "integer" - } - }, - "type": "object", - "title": "OpenAIChatCompletionUsagePromptTokensDetails", - "description": "Token details for prompt tokens in OpenAI chat completion usage." - }, - "OpenAIChoice-Output": { - "properties": { - "message": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIUserMessageParam-Output" - }, - { - "$ref": "#/components/schemas/OpenAISystemMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIAssistantMessageParam-Output" - }, - { - "$ref": "#/components/schemas/OpenAIToolMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" - } - ], - "title": "Message", - "discriminator": { - "propertyName": "role", - "mapping": { - "assistant": "#/components/schemas/OpenAIAssistantMessageParam-Output", - "developer": "#/components/schemas/OpenAIDeveloperMessageParam", - "system": "#/components/schemas/OpenAISystemMessageParam", - "tool": "#/components/schemas/OpenAIToolMessageParam", - "user": "#/components/schemas/OpenAIUserMessageParam-Output" - } - } - }, - "finish_reason": { - "type": "string", - "title": "Finish Reason" - }, - "index": { - "type": "integer", - "title": "Index" - }, - "logprobs": { - "$ref": "#/components/schemas/OpenAIChoiceLogprobs-Output" - } - }, - "type": "object", - "required": [ - "message", - "finish_reason", - "index" - ], - "title": "OpenAIChoice", - "description": "A choice from an OpenAI-compatible chat completion response." - }, - "OpenAIChoiceLogprobs-Output": { - "properties": { - "content": { - "title": "Content", - "items": { - "$ref": "#/components/schemas/OpenAITokenLogProb" - }, - "type": "array" - }, - "refusal": { - "title": "Refusal", - "items": { - "$ref": "#/components/schemas/OpenAITokenLogProb" - }, - "type": "array" - } - }, - "type": "object", - "title": "OpenAIChoiceLogprobs", - "description": "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response." - }, - "OpenAICompletion": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "choices": { - "items": { - "$ref": "#/components/schemas/OpenAICompletionChoice-Output" - }, - "type": "array", - "title": "Choices" - }, - "created": { - "type": "integer", - "title": "Created" - }, - "model": { - "type": "string", - "title": "Model" - }, - "object": { - "type": "string", - "const": "text_completion", - "title": "Object", - "default": "text_completion" - } - }, - "type": "object", - "required": [ - "id", - "choices", - "created", - "model" - ], - "title": "OpenAICompletion", - "description": "Response from an OpenAI-compatible completion request." - }, - "OpenAICompletionChoice-Output": { - "properties": { - "finish_reason": { - "type": "string", - "title": "Finish Reason" - }, - "text": { - "type": "string", - "title": "Text" - }, - "index": { - "type": "integer", - "title": "Index" - }, - "logprobs": { - "$ref": "#/components/schemas/OpenAIChoiceLogprobs-Output" - } - }, - "type": "object", - "required": [ - "finish_reason", - "text", - "index" - ], - "title": "OpenAICompletionChoice", - "description": "A choice from an OpenAI-compatible completion response." - }, - "OpenAICompletionRequestWithExtraBody": { - "properties": { - "model": { - "type": "string", - "title": "Model" - }, - "prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "items": { - "type": "integer" - }, - "type": "array" - }, - { - "items": { - "items": { - "type": "integer" - }, - "type": "array" - }, - "type": "array" - } - ], - "title": "Prompt" - }, - "best_of": { - "title": "Best Of", - "type": "integer" - }, - "echo": { - "title": "Echo", - "type": "boolean" - }, - "frequency_penalty": { - "title": "Frequency Penalty", - "type": "number" - }, - "logit_bias": { - "title": "Logit Bias", - "additionalProperties": { - "type": "number" - }, - "type": "object" - }, - "logprobs": { - "title": "Logprobs", - "type": "boolean" - }, - "max_tokens": { - "title": "Max Tokens", - "type": "integer" - }, - "n": { - "title": "N", - "type": "integer" - }, - "presence_penalty": { - "title": "Presence Penalty", - "type": "number" - }, - "seed": { - "title": "Seed", - "type": "integer" - }, - "stop": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ], - "title": "Stop" - }, - "stream": { - "title": "Stream", - "type": "boolean" - }, - "stream_options": { - "title": "Stream Options", - "additionalProperties": true, - "type": "object" - }, - "temperature": { - "title": "Temperature", - "type": "number" - }, - "top_p": { - "title": "Top P", - "type": "number" - }, - "user": { - "title": "User", - "type": "string" - }, - "suffix": { - "title": "Suffix", - "type": "string" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "model", - "prompt" - ], - "title": "OpenAICompletionRequestWithExtraBody", - "description": "Request parameters for OpenAI-compatible completion endpoint." - }, - "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": { - "properties": { - "file_ids": { - "items": { - "type": "string" - }, - "type": "array", - "title": "File Ids" - }, - "attributes": { - "title": "Attributes", - "additionalProperties": true, - "type": "object" - }, - "chunking_strategy": { - "title": "Chunking Strategy", - "oneOf": [ - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" - }, - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "auto": "#/components/schemas/VectorStoreChunkingStrategyAuto", - "static": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - } - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "file_ids" - ], - "title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody", - "description": "Request to create a vector store file batch with extra_body support." - }, - "OpenAICreateVectorStoreRequestWithExtraBody": { - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "file_ids": { - "title": "File Ids", - "items": { - "type": "string" - }, - "type": "array" - }, - "expires_after": { - "title": "Expires After", - "additionalProperties": true, - "type": "object" - }, - "chunking_strategy": { - "title": "Chunking Strategy", - "additionalProperties": true, - "type": "object" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "additionalProperties": true, - "type": "object", - "title": "OpenAICreateVectorStoreRequestWithExtraBody", - "description": "Request to create a vector store with extra_body support." - }, - "OpenAIDeveloperMessageParam": { - "properties": { - "role": { - "type": "string", - "const": "developer", - "title": "Role", - "default": "developer" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "OpenAIDeveloperMessageParam", - "description": "A message from the developer in an OpenAI-compatible chat completion request." - }, - "OpenAIEmbeddingData": { - "properties": { - "object": { - "type": "string", - "const": "embedding", - "title": "Object", - "default": "embedding" - }, - "embedding": { - "anyOf": [ - { - "items": { - "type": "number" - }, - "type": "array" - }, - { - "type": "string" - } - ], - "title": "Embedding" - }, - "index": { - "type": "integer", - "title": "Index" - } - }, - "type": "object", - "required": [ - "embedding", - "index" - ], - "title": "OpenAIEmbeddingData", - "description": "A single embedding data object from an OpenAI-compatible embeddings response." - }, - "OpenAIEmbeddingUsage": { - "properties": { - "prompt_tokens": { - "type": "integer", - "title": "Prompt Tokens" - }, - "total_tokens": { - "type": "integer", - "title": "Total Tokens" - } - }, - "type": "object", - "required": [ - "prompt_tokens", - "total_tokens" - ], - "title": "OpenAIEmbeddingUsage", - "description": "Usage information for an OpenAI-compatible embeddings response." - }, - "OpenAIEmbeddingsRequestWithExtraBody": { - "properties": { - "model": { - "type": "string", - "title": "Model" - }, - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ], - "title": "Input" - }, - "encoding_format": { - "title": "Encoding Format", - "default": "float", - "type": "string" - }, - "dimensions": { - "title": "Dimensions", - "type": "integer" - }, - "user": { - "title": "User", - "type": "string" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "model", - "input" - ], - "title": "OpenAIEmbeddingsRequestWithExtraBody", - "description": "Request parameters for OpenAI-compatible embeddings endpoint." - }, - "OpenAIEmbeddingsResponse": { - "properties": { - "object": { - "type": "string", - "const": "list", - "title": "Object", - "default": "list" - }, - "data": { - "items": { - "$ref": "#/components/schemas/OpenAIEmbeddingData" - }, - "type": "array", - "title": "Data" - }, - "model": { - "type": "string", - "title": "Model" - }, - "usage": { - "$ref": "#/components/schemas/OpenAIEmbeddingUsage" - } - }, - "type": "object", - "required": [ - "data", - "model", - "usage" - ], - "title": "OpenAIEmbeddingsResponse", - "description": "Response from an OpenAI-compatible embeddings request." - }, - "OpenAIFile": { - "properties": { - "type": { - "type": "string", - "const": "file", - "title": "Type", - "default": "file" - }, - "file": { - "$ref": "#/components/schemas/OpenAIFileFile" - } - }, - "type": "object", - "required": [ - "file" - ], - "title": "OpenAIFile" - }, - "OpenAIFileFile": { - "properties": { - "file_data": { - "title": "File Data", - "type": "string" - }, - "file_id": { - "title": "File Id", - "type": "string" - }, - "filename": { - "title": "Filename", - "type": "string" - } - }, - "type": "object", - "title": "OpenAIFileFile" - }, - "OpenAIFileObject": { - "properties": { - "object": { - "type": "string", - "const": "file", - "title": "Object", - "default": "file" - }, - "id": { - "type": "string", - "title": "Id" - }, - "bytes": { - "type": "integer", - "title": "Bytes" - }, - "created_at": { - "type": "integer", - "title": "Created At" - }, - "expires_at": { - "type": "integer", - "title": "Expires At" - }, - "filename": { - "type": "string", - "title": "Filename" - }, - "purpose": { - "$ref": "#/components/schemas/OpenAIFilePurpose" - } - }, - "type": "object", - "required": [ - "id", - "bytes", - "created_at", - "expires_at", - "filename", - "purpose" - ], - "title": "OpenAIFileObject", - "description": "OpenAI File object as defined in the OpenAI Files API." - }, - "OpenAIFilePurpose": { - "type": "string", - "enum": [ - "assistants", - "batch" - ], - "title": "OpenAIFilePurpose", - "description": "Valid purpose values for OpenAI Files API." - }, - "OpenAIImageURL": { - "properties": { - "url": { - "type": "string", - "title": "Url" - }, - "detail": { - "title": "Detail", - "type": "string" - } - }, - "type": "object", - "required": [ - "url" - ], - "title": "OpenAIImageURL", - "description": "Image URL specification for OpenAI-compatible chat completion messages." - }, - "OpenAIJSONSchema": { - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "description": { - "title": "Description", - "type": "string" - }, - "strict": { - "title": "Strict", - "type": "boolean" - }, - "schema": { - "title": "Schema", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "title": "OpenAIJSONSchema", - "description": "JSON schema specification for OpenAI-compatible structured response format." - }, - "OpenAIResponseAnnotationCitation": { - "properties": { - "type": { - "type": "string", - "const": "url_citation", - "title": "Type", - "default": "url_citation" - }, - "end_index": { - "type": "integer", - "title": "End Index" - }, - "start_index": { - "type": "integer", - "title": "Start Index" - }, - "title": { - "type": "string", - "title": "Title" - }, - "url": { - "type": "string", - "title": "Url" - } - }, - "type": "object", - "required": [ - "end_index", - "start_index", - "title", - "url" - ], - "title": "OpenAIResponseAnnotationCitation", - "description": "URL citation annotation for referencing external web resources." - }, - "OpenAIResponseAnnotationContainerFileCitation": { - "properties": { - "type": { - "type": "string", - "const": "container_file_citation", - "title": "Type", - "default": "container_file_citation" - }, - "container_id": { - "type": "string", - "title": "Container Id" - }, - "end_index": { - "type": "integer", - "title": "End Index" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "filename": { - "type": "string", - "title": "Filename" - }, - "start_index": { - "type": "integer", - "title": "Start Index" - } - }, - "type": "object", - "required": [ - "container_id", - "end_index", - "file_id", - "filename", - "start_index" - ], - "title": "OpenAIResponseAnnotationContainerFileCitation" - }, - "OpenAIResponseAnnotationFileCitation": { - "properties": { - "type": { - "type": "string", - "const": "file_citation", - "title": "Type", - "default": "file_citation" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "filename": { - "type": "string", - "title": "Filename" - }, - "index": { - "type": "integer", - "title": "Index" - } - }, - "type": "object", - "required": [ - "file_id", - "filename", - "index" - ], - "title": "OpenAIResponseAnnotationFileCitation", - "description": "File citation annotation for referencing specific files in response content." - }, - "OpenAIResponseAnnotationFilePath": { - "properties": { - "type": { - "type": "string", - "const": "file_path", - "title": "Type", - "default": "file_path" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "index": { - "type": "integer", - "title": "Index" - } - }, - "type": "object", - "required": [ - "file_id", - "index" - ], - "title": "OpenAIResponseAnnotationFilePath" - }, - "OpenAIResponseContentPartRefusal": { - "properties": { - "type": { - "type": "string", - "const": "refusal", - "title": "Type", - "default": "refusal" - }, - "refusal": { - "type": "string", - "title": "Refusal" - } - }, - "type": "object", - "required": [ - "refusal" - ], - "title": "OpenAIResponseContentPartRefusal", - "description": "Refusal content within a streamed response part." - }, - "OpenAIResponseError": { - "properties": { - "code": { - "type": "string", - "title": "Code" - }, - "message": { - "type": "string", - "title": "Message" - } - }, - "type": "object", - "required": [ - "code", - "message" - ], - "title": "OpenAIResponseError", - "description": "Error details for failed OpenAI response requests." - }, - "OpenAIResponseFormatJSONObject": { - "properties": { - "type": { - "type": "string", - "const": "json_object", - "title": "Type", - "default": "json_object" - } - }, - "type": "object", - "title": "OpenAIResponseFormatJSONObject", - "description": "JSON object response format for OpenAI-compatible chat completion requests." - }, - "OpenAIResponseFormatJSONSchema": { - "properties": { - "type": { - "type": "string", - "const": "json_schema", - "title": "Type", - "default": "json_schema" - }, - "json_schema": { - "$ref": "#/components/schemas/OpenAIJSONSchema" - } - }, - "type": "object", - "required": [ - "json_schema" - ], - "title": "OpenAIResponseFormatJSONSchema", - "description": "JSON schema response format for OpenAI-compatible chat completion requests." - }, - "OpenAIResponseFormatText": { - "properties": { - "type": { - "type": "string", - "const": "text", - "title": "Type", - "default": "text" - } - }, - "type": "object", - "title": "OpenAIResponseFormatText", - "description": "Text response format for OpenAI-compatible chat completion requests." - }, - "OpenAIResponseInputFunctionToolCallOutput": { - "properties": { - "call_id": { - "type": "string", - "title": "Call Id" - }, - "output": { - "type": "string", - "title": "Output" - }, - "type": { - "type": "string", - "const": "function_call_output", - "title": "Type", - "default": "function_call_output" - }, - "id": { - "title": "Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "type": "object", - "required": [ - "call_id", - "output" - ], - "title": "OpenAIResponseInputFunctionToolCallOutput", - "description": "This represents the output of a function call that gets passed back to the model." - }, - "OpenAIResponseInputMessageContentFile": { - "properties": { - "type": { - "type": "string", - "const": "input_file", - "title": "Type", - "default": "input_file" - }, - "file_data": { - "title": "File Data", - "type": "string" - }, - "file_id": { - "title": "File Id", - "type": "string" - }, - "file_url": { - "title": "File Url", - "type": "string" - }, - "filename": { - "title": "Filename", - "type": "string" - } - }, - "type": "object", - "title": "OpenAIResponseInputMessageContentFile", - "description": "File content for input messages in OpenAI response format." - }, - "OpenAIResponseInputMessageContentImage": { - "properties": { - "detail": { - "anyOf": [ - { - "type": "string", - "const": "low" - }, - { - "type": "string", - "const": "high" - }, - { - "type": "string", - "const": "auto" - } - ], - "title": "Detail", - "default": "auto" - }, - "type": { - "type": "string", - "const": "input_image", - "title": "Type", - "default": "input_image" - }, - "file_id": { - "title": "File Id", - "type": "string" - }, - "image_url": { - "title": "Image Url", - "type": "string" - } - }, - "type": "object", - "title": "OpenAIResponseInputMessageContentImage", - "description": "Image content for input messages in OpenAI response format." - }, - "OpenAIResponseInputMessageContentText": { - "properties": { - "text": { - "type": "string", - "title": "Text" - }, - "type": { - "type": "string", - "const": "input_text", - "title": "Type", - "default": "input_text" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "OpenAIResponseInputMessageContentText", - "description": "Text content for input messages in OpenAI response format." - }, - "OpenAIResponseInputToolFileSearch": { - "properties": { - "type": { - "type": "string", - "const": "file_search", - "title": "Type", - "default": "file_search" - }, - "vector_store_ids": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Vector Store Ids" - }, - "filters": { - "title": "Filters", - "additionalProperties": true, - "type": "object" - }, - "max_num_results": { - "title": "Max Num Results", - "default": 10, - "type": "integer", - "maximum": 50.0, - "minimum": 1.0 - }, - "ranking_options": { - "$ref": "#/components/schemas/SearchRankingOptions" - } - }, - "type": "object", - "required": [ - "vector_store_ids" - ], - "title": "OpenAIResponseInputToolFileSearch", - "description": "File search tool configuration for OpenAI response inputs." - }, - "OpenAIResponseInputToolFunction": { - "properties": { - "type": { - "type": "string", - "const": "function", - "title": "Type", - "default": "function" - }, - "name": { - "type": "string", - "title": "Name" - }, - "description": { - "title": "Description", - "type": "string" - }, - "parameters": { - "title": "Parameters", - "additionalProperties": true, - "type": "object" - }, - "strict": { - "title": "Strict", - "type": "boolean" - } - }, - "type": "object", - "required": [ - "name", - "parameters" - ], - "title": "OpenAIResponseInputToolFunction", - "description": "Function tool configuration for OpenAI response inputs." - }, - "OpenAIResponseInputToolMCP": { - "properties": { - "type": { - "type": "string", - "const": "mcp", - "title": "Type", - "default": "mcp" - }, - "server_label": { - "type": "string", - "title": "Server Label" - }, - "server_url": { - "type": "string", - "title": "Server Url" - }, - "headers": { - "title": "Headers", - "additionalProperties": true, - "type": "object" - }, - "require_approval": { - "anyOf": [ - { - "type": "string", - "const": "always" - }, - { - "type": "string", - "const": "never" - }, - { - "$ref": "#/components/schemas/ApprovalFilter" - } - ], - "title": "Require Approval", - "default": "never" - }, - "allowed_tools": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "$ref": "#/components/schemas/AllowedToolsFilter" - } - ], - "title": "Allowed Tools" - } - }, - "type": "object", - "required": [ - "server_label", - "server_url" - ], - "title": "OpenAIResponseInputToolMCP", - "description": "Model Context Protocol (MCP) tool configuration for OpenAI response inputs." - }, - "OpenAIResponseInputToolWebSearch": { - "properties": { - "type": { - "anyOf": [ - { - "type": "string", - "const": "web_search" - }, - { - "type": "string", - "const": "web_search_preview" - }, - { - "type": "string", - "const": "web_search_preview_2025_03_11" - } - ], - "title": "Type", - "default": "web_search" - }, - "search_context_size": { - "title": "Search Context Size", - "default": "medium", - "type": "string", - "pattern": "^low|medium|high$" - } - }, - "type": "object", - "title": "OpenAIResponseInputToolWebSearch", - "description": "Web search tool configuration for OpenAI response inputs." - }, - "OpenAIResponseMCPApprovalRequest": { - "properties": { - "arguments": { - "type": "string", - "title": "Arguments" - }, - "id": { - "type": "string", - "title": "Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "server_label": { - "type": "string", - "title": "Server Label" - }, - "type": { - "type": "string", - "const": "mcp_approval_request", - "title": "Type", - "default": "mcp_approval_request" - } - }, - "type": "object", - "required": [ - "arguments", - "id", - "name", - "server_label" - ], - "title": "OpenAIResponseMCPApprovalRequest", - "description": "A request for human approval of a tool invocation." - }, - "OpenAIResponseMCPApprovalResponse": { - "properties": { - "approval_request_id": { - "type": "string", - "title": "Approval Request Id" - }, - "approve": { - "type": "boolean", - "title": "Approve" - }, - "type": { - "type": "string", - "const": "mcp_approval_response", - "title": "Type", - "default": "mcp_approval_response" - }, - "id": { - "title": "Id", - "type": "string" - }, - "reason": { - "title": "Reason", - "type": "string" - } - }, - "type": "object", - "required": [ - "approval_request_id", - "approve" - ], - "title": "OpenAIResponseMCPApprovalResponse", - "description": "A response to an MCP approval request." - }, - "OpenAIResponseMessage-Input": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", - "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", - "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" - } - } - }, - "type": "array" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "output_text": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText", - "refusal": "#/components/schemas/OpenAIResponseContentPartRefusal" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "role": { - "anyOf": [ - { - "type": "string", - "const": "system" - }, - { - "type": "string", - "const": "developer" - }, - { - "type": "string", - "const": "user" - }, - { - "type": "string", - "const": "assistant" - } - ], - "title": "Role" - }, - "type": { - "type": "string", - "const": "message", - "title": "Type", - "default": "message" - }, - "id": { - "title": "Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "type": "object", - "required": [ - "content", - "role" - ], - "title": "OpenAIResponseMessage", - "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." - }, - "OpenAIResponseMessage-Output": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", - "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", - "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" - } - } - }, - "type": "array" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "output_text": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText", - "refusal": "#/components/schemas/OpenAIResponseContentPartRefusal" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "role": { - "anyOf": [ - { - "type": "string", - "const": "system" - }, - { - "type": "string", - "const": "developer" - }, - { - "type": "string", - "const": "user" - }, - { - "type": "string", - "const": "assistant" - } - ], - "title": "Role" - }, - "type": { - "type": "string", - "const": "message", - "title": "Type", - "default": "message" - }, - "id": { - "title": "Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "type": "object", - "required": [ - "content", - "role" - ], - "title": "OpenAIResponseMessage", - "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." - }, - "OpenAIResponseObject": { - "properties": { - "created_at": { - "type": "integer", - "title": "Created At" - }, - "error": { - "$ref": "#/components/schemas/OpenAIResponseError" - }, - "id": { - "type": "string", - "title": "Id" - }, - "model": { - "type": "string", - "title": "Model" - }, - "object": { - "type": "string", - "const": "response", - "title": "Object", - "default": "response" - }, - "output": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage-Output" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", - "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", - "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", - "message": "#/components/schemas/OpenAIResponseMessage-Output", - "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - } - } - }, - "type": "array", - "title": "Output" - }, - "parallel_tool_calls": { - "type": "boolean", - "title": "Parallel Tool Calls", - "default": false - }, - "previous_response_id": { - "title": "Previous Response Id", - "type": "string" - }, - "prompt": { - "$ref": "#/components/schemas/OpenAIResponsePrompt" - }, - "status": { - "type": "string", - "title": "Status" - }, - "temperature": { - "title": "Temperature", - "type": "number" - }, - "text": { - "$ref": "#/components/schemas/OpenAIResponseText", - "default": { - "format": { - "type": "text" - } - } - }, - "top_p": { - "title": "Top P", - "type": "number" - }, - "tools": { - "title": "Tools", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" - }, - { - "$ref": "#/components/schemas/OpenAIResponseToolMCP" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "file_search": "#/components/schemas/OpenAIResponseInputToolFileSearch", - "function": "#/components/schemas/OpenAIResponseInputToolFunction", - "mcp": "#/components/schemas/OpenAIResponseToolMCP", - "web_search": "#/components/schemas/OpenAIResponseInputToolWebSearch", - "web_search_preview": "#/components/schemas/OpenAIResponseInputToolWebSearch", - "web_search_preview_2025_03_11": "#/components/schemas/OpenAIResponseInputToolWebSearch" - } - } - }, - "type": "array" - }, - "truncation": { - "title": "Truncation", - "type": "string" - }, - "usage": { - "$ref": "#/components/schemas/OpenAIResponseUsage" - }, - "instructions": { - "title": "Instructions", - "type": "string" - } - }, - "type": "object", - "required": [ - "created_at", - "id", - "model", - "output", - "status" - ], - "title": "OpenAIResponseObject", - "description": "Complete OpenAI response object containing generation results and metadata." - }, - "OpenAIResponseOutputMessageContentOutputText": { - "properties": { - "text": { - "type": "string", - "title": "Text" - }, - "type": { - "type": "string", - "const": "output_text", - "title": "Type", - "default": "output_text" - }, - "annotations": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationFileCitation" - }, - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationCitation" - }, - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation" - }, - { - "$ref": "#/components/schemas/OpenAIResponseAnnotationFilePath" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "container_file_citation": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation", - "file_citation": "#/components/schemas/OpenAIResponseAnnotationFileCitation", - "file_path": "#/components/schemas/OpenAIResponseAnnotationFilePath", - "url_citation": "#/components/schemas/OpenAIResponseAnnotationCitation" - } - } - }, - "type": "array", - "title": "Annotations" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "OpenAIResponseOutputMessageContentOutputText" - }, - "OpenAIResponseOutputMessageFileSearchToolCall": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "queries": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Queries" - }, - "status": { - "type": "string", - "title": "Status" - }, - "type": { - "type": "string", - "const": "file_search_call", - "title": "Type", - "default": "file_search_call" - }, - "results": { - "title": "Results", - "items": { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults" - }, - "type": "array" - } - }, - "type": "object", - "required": [ - "id", - "queries", - "status" - ], - "title": "OpenAIResponseOutputMessageFileSearchToolCall", - "description": "File search tool call output message for OpenAI responses." - }, - "OpenAIResponseOutputMessageFileSearchToolCallResults": { - "properties": { - "attributes": { - "additionalProperties": true, - "type": "object", - "title": "Attributes" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "filename": { - "type": "string", - "title": "Filename" - }, - "score": { - "type": "number", - "title": "Score" - }, - "text": { - "type": "string", - "title": "Text" - } - }, - "type": "object", - "required": [ - "attributes", - "file_id", - "filename", - "score", - "text" - ], - "title": "OpenAIResponseOutputMessageFileSearchToolCallResults", - "description": "Search results returned by the file search operation." - }, - "OpenAIResponseOutputMessageFunctionToolCall": { - "properties": { - "call_id": { - "type": "string", - "title": "Call Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "arguments": { - "type": "string", - "title": "Arguments" - }, - "type": { - "type": "string", - "const": "function_call", - "title": "Type", - "default": "function_call" - }, - "id": { - "title": "Id", - "type": "string" - }, - "status": { - "title": "Status", - "type": "string" - } - }, - "type": "object", - "required": [ - "call_id", - "name", - "arguments" - ], - "title": "OpenAIResponseOutputMessageFunctionToolCall", - "description": "Function tool call output message for OpenAI responses." - }, - "OpenAIResponseOutputMessageMCPCall": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "type": { - "type": "string", - "const": "mcp_call", - "title": "Type", - "default": "mcp_call" - }, - "arguments": { - "type": "string", - "title": "Arguments" - }, - "name": { - "type": "string", - "title": "Name" - }, - "server_label": { - "type": "string", - "title": "Server Label" - }, - "error": { - "title": "Error", - "type": "string" - }, - "output": { - "title": "Output", - "type": "string" - } - }, - "type": "object", - "required": [ - "id", - "arguments", - "name", - "server_label" - ], - "title": "OpenAIResponseOutputMessageMCPCall", - "description": "Model Context Protocol (MCP) call output message for OpenAI responses." - }, - "OpenAIResponseOutputMessageMCPListTools": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "type": { - "type": "string", - "const": "mcp_list_tools", - "title": "Type", - "default": "mcp_list_tools" - }, - "server_label": { - "type": "string", - "title": "Server Label" - }, - "tools": { - "items": { - "$ref": "#/components/schemas/MCPListToolsTool" - }, - "type": "array", - "title": "Tools" - } - }, - "type": "object", - "required": [ - "id", - "server_label", - "tools" - ], - "title": "OpenAIResponseOutputMessageMCPListTools", - "description": "MCP list tools output message containing available tools from an MCP server." - }, - "OpenAIResponseOutputMessageWebSearchToolCall": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "status": { - "type": "string", - "title": "Status" - }, - "type": { - "type": "string", - "const": "web_search_call", - "title": "Type", - "default": "web_search_call" - } - }, - "type": "object", - "required": [ - "id", - "status" - ], - "title": "OpenAIResponseOutputMessageWebSearchToolCall", - "description": "Web search tool call output message for OpenAI responses." - }, - "OpenAIResponsePrompt": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "variables": { - "title": "Variables", - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "input_file": "#/components/schemas/OpenAIResponseInputMessageContentFile", - "input_image": "#/components/schemas/OpenAIResponseInputMessageContentImage", - "input_text": "#/components/schemas/OpenAIResponseInputMessageContentText" - } - } - }, - "type": "object" - }, - "version": { - "title": "Version", - "type": "string" - } - }, - "type": "object", - "required": [ - "id" - ], - "title": "OpenAIResponsePrompt", - "description": "OpenAI compatible Prompt object that is used in OpenAI responses." - }, - "OpenAIResponseText": { - "properties": { - "format": { - "$ref": "#/components/schemas/OpenAIResponseTextFormat" - } - }, - "type": "object", - "title": "OpenAIResponseText", - "description": "Text response configuration for OpenAI responses." - }, - "OpenAIResponseTextFormat": { - "properties": { - "type": { - "anyOf": [ - { - "type": "string", - "const": "text" - }, - { - "type": "string", - "const": "json_schema" - }, - { - "type": "string", - "const": "json_object" - } - ], - "title": "Type" - }, - "name": { - "title": "Name", - "type": "string" - }, - "schema": { - "title": "Schema", - "additionalProperties": true, - "type": "object" - }, - "description": { - "title": "Description", - "type": "string" - }, - "strict": { - "title": "Strict", - "type": "boolean" - } - }, - "type": "object", - "title": "OpenAIResponseTextFormat", - "description": "Configuration for Responses API text format." - }, - "OpenAIResponseToolMCP": { - "properties": { - "type": { - "type": "string", - "const": "mcp", - "title": "Type", - "default": "mcp" - }, - "server_label": { - "type": "string", - "title": "Server Label" - }, - "allowed_tools": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "$ref": "#/components/schemas/AllowedToolsFilter" - } - ], - "title": "Allowed Tools" - } - }, - "type": "object", - "required": [ - "server_label" - ], - "title": "OpenAIResponseToolMCP", - "description": "Model Context Protocol (MCP) tool configuration for OpenAI response object." - }, - "OpenAIResponseUsage": { - "properties": { - "input_tokens": { - "type": "integer", - "title": "Input Tokens" - }, - "output_tokens": { - "type": "integer", - "title": "Output Tokens" - }, - "total_tokens": { - "type": "integer", - "title": "Total Tokens" - }, - "input_tokens_details": { - "$ref": "#/components/schemas/OpenAIResponseUsageInputTokensDetails" - }, - "output_tokens_details": { - "$ref": "#/components/schemas/OpenAIResponseUsageOutputTokensDetails" - } - }, - "type": "object", - "required": [ - "input_tokens", - "output_tokens", - "total_tokens" - ], - "title": "OpenAIResponseUsage", - "description": "Usage information for OpenAI response." - }, - "OpenAIResponseUsageInputTokensDetails": { - "properties": { - "cached_tokens": { - "title": "Cached Tokens", - "type": "integer" - } - }, - "type": "object", - "title": "OpenAIResponseUsageInputTokensDetails", - "description": "Token details for input tokens in OpenAI response usage." - }, - "OpenAIResponseUsageOutputTokensDetails": { - "properties": { - "reasoning_tokens": { - "title": "Reasoning Tokens", - "type": "integer" - } - }, - "type": "object", - "title": "OpenAIResponseUsageOutputTokensDetails", - "description": "Token details for output tokens in OpenAI response usage." - }, - "OpenAISystemMessageParam": { - "properties": { - "role": { - "type": "string", - "const": "system", - "title": "Role", - "default": "system" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "OpenAISystemMessageParam", - "description": "A system message providing instructions or context to the model." - }, - "OpenAITokenLogProb": { - "properties": { - "token": { - "type": "string", - "title": "Token" - }, - "bytes": { - "title": "Bytes", - "items": { - "type": "integer" - }, - "type": "array" - }, - "logprob": { - "type": "number", - "title": "Logprob" - }, - "top_logprobs": { - "items": { - "$ref": "#/components/schemas/OpenAITopLogProb" - }, - "type": "array", - "title": "Top Logprobs" - } - }, - "type": "object", - "required": [ - "token", - "logprob", - "top_logprobs" - ], - "title": "OpenAITokenLogProb", - "description": "The log probability for a token from an OpenAI-compatible chat completion response." - }, - "OpenAIToolMessageParam": { - "properties": { - "role": { - "type": "string", - "const": "tool", - "title": "Role", - "default": "tool" - }, - "tool_call_id": { - "type": "string", - "title": "Tool Call Id" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content" - } - }, - "type": "object", - "required": [ - "tool_call_id", - "content" - ], - "title": "OpenAIToolMessageParam", - "description": "A message representing the result of a tool invocation in an OpenAI-compatible chat completion request." - }, - "OpenAITopLogProb": { - "properties": { - "token": { - "type": "string", - "title": "Token" - }, - "bytes": { - "title": "Bytes", - "items": { - "type": "integer" - }, - "type": "array" - }, - "logprob": { - "type": "number", - "title": "Logprob" - } - }, - "type": "object", - "required": [ - "token", - "logprob" - ], - "title": "OpenAITopLogProb", - "description": "The top log probability for a token from an OpenAI-compatible chat completion response." - }, - "OpenAIUserMessageParam-Input": { - "properties": { - "role": { - "type": "string", - "const": "user", - "title": "Role", - "default": "user" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" - }, - { - "$ref": "#/components/schemas/OpenAIFile" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "file": "#/components/schemas/OpenAIFile", - "image_url": "#/components/schemas/OpenAIChatCompletionContentPartImageParam", - "text": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "OpenAIUserMessageParam", - "description": "A message from the user in an OpenAI-compatible chat completion request." - }, - "OpenAIUserMessageParam-Output": { - "properties": { - "role": { - "type": "string", - "const": "user", - "title": "Role", - "default": "user" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" - }, - { - "$ref": "#/components/schemas/OpenAIFile" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "file": "#/components/schemas/OpenAIFile", - "image_url": "#/components/schemas/OpenAIChatCompletionContentPartImageParam", - "text": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "OpenAIUserMessageParam", - "description": "A message from the user in an OpenAI-compatible chat completion request." - }, - "OptimizerConfig": { - "properties": { - "optimizer_type": { - "$ref": "#/components/schemas/OptimizerType" - }, - "lr": { - "type": "number", - "title": "Lr" - }, - "weight_decay": { - "type": "number", - "title": "Weight Decay" - }, - "num_warmup_steps": { - "type": "integer", - "title": "Num Warmup Steps" - } - }, - "type": "object", - "required": [ - "optimizer_type", - "lr", - "weight_decay", - "num_warmup_steps" - ], - "title": "OptimizerConfig", - "description": "Configuration parameters for the optimization algorithm." - }, - "OptimizerType": { - "type": "string", - "enum": [ - "adam", - "adamw", - "sgd" - ], - "title": "OptimizerType", - "description": "Available optimizer algorithms for training." - }, - "Order": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "title": "Order", - "description": "Sort order for paginated responses." - }, - "OutputTokensDetails": { - "properties": { - "reasoning_tokens": { - "type": "integer", - "title": "Reasoning Tokens" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "reasoning_tokens" - ], - "title": "OutputTokensDetails" - }, - "PostTrainingJob": { - "properties": { - "job_uuid": { - "type": "string", - "title": "Job Uuid" - } - }, - "type": "object", - "required": [ - "job_uuid" - ], - "title": "PostTrainingJob" - }, - "Prompt": { - "properties": { - "prompt": { - "title": "Prompt", - "description": "The system prompt with variable placeholders", - "type": "string" - }, - "version": { - "type": "integer", - "minimum": 1.0, - "title": "Version", - "description": "Version (integer starting at 1, incremented on save)" - }, - "prompt_id": { - "type": "string", - "title": "Prompt Id", - "description": "Unique identifier in format 'pmpt_<48-digit-hash>'" - }, - "variables": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Variables", - "description": "List of variable names that can be used in the prompt template" - }, - "is_default": { - "type": "boolean", - "title": "Is Default", - "description": "Boolean indicating whether this version is the default version", - "default": false - } - }, - "type": "object", - "required": [ - "version", - "prompt_id" - ], - "title": "Prompt", - "description": "A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack." - }, - "ProviderInfo": { - "properties": { - "api": { - "type": "string", - "title": "Api" - }, - "provider_id": { - "type": "string", - "title": "Provider Id" - }, - "provider_type": { - "type": "string", - "title": "Provider Type" - }, - "config": { - "additionalProperties": true, - "type": "object", - "title": "Config" - }, - "health": { - "additionalProperties": true, - "type": "object", - "title": "Health" - } - }, - "type": "object", - "required": [ - "api", - "provider_id", - "provider_type", - "config", - "health" - ], - "title": "ProviderInfo", - "description": "Information about a registered provider including its configuration and health status." - }, - "QueryChunksResponse": { - "properties": { - "chunks": { - "items": { - "$ref": "#/components/schemas/Chunk-Output" - }, - "type": "array", - "title": "Chunks" - }, - "scores": { - "items": { - "type": "number" - }, - "type": "array", - "title": "Scores" - } - }, - "type": "object", - "required": [ - "chunks", - "scores" - ], - "title": "QueryChunksResponse", - "description": "Response from querying chunks in a vector database." - }, - "RAGQueryConfig": { - "properties": { - "query_generator_config": { - "oneOf": [ - { - "$ref": "#/components/schemas/DefaultRAGQueryGeneratorConfig" - }, - { - "$ref": "#/components/schemas/LLMRAGQueryGeneratorConfig" - } - ], - "title": "Query Generator Config", - "default": { - "type": "default", - "separator": " " - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "default": "#/components/schemas/DefaultRAGQueryGeneratorConfig", - "llm": "#/components/schemas/LLMRAGQueryGeneratorConfig" - } - } - }, - "max_tokens_in_context": { - "type": "integer", - "title": "Max Tokens In Context", - "default": 4096 - }, - "max_chunks": { - "type": "integer", - "title": "Max Chunks", - "default": 5 - }, - "chunk_template": { - "type": "string", - "title": "Chunk Template", - "default": "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n" - }, - "mode": { - "default": "vector", - "$ref": "#/components/schemas/RAGSearchMode" - }, - "ranker": { - "title": "Ranker", - "oneOf": [ - { - "$ref": "#/components/schemas/RRFRanker" - }, - { - "$ref": "#/components/schemas/WeightedRanker" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "rrf": "#/components/schemas/RRFRanker", - "weighted": "#/components/schemas/WeightedRanker" - } - } - } - }, - "type": "object", - "title": "RAGQueryConfig", - "description": "Configuration for the RAG query generation." - }, - "RAGQueryResult": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - } - }, - "type": "object", - "title": "RAGQueryResult", - "description": "Result of a RAG query containing retrieved content and metadata." - }, - "RAGSearchMode": { - "type": "string", - "enum": [ - "vector", - "keyword", - "hybrid" - ], - "title": "RAGSearchMode", - "description": "Search modes for RAG query retrieval:\n- VECTOR: Uses vector similarity search for semantic matching\n- KEYWORD: Uses keyword-based search for exact matching\n- HYBRID: Combines both vector and keyword search for better results" - }, - "RRFRanker": { - "properties": { - "type": { - "type": "string", - "const": "rrf", - "title": "Type", - "default": "rrf" - }, - "impact_factor": { - "type": "number", - "title": "Impact Factor", - "default": 60.0, - "minimum": 0.0 - } - }, - "type": "object", - "title": "RRFRanker", - "description": "Reciprocal Rank Fusion (RRF) ranker configuration." - }, - "RegexParserScoringFnParams": { - "properties": { - "type": { - "type": "string", - "const": "regex_parser", - "title": "Type", - "default": "regex_parser" - }, - "parsing_regexes": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Parsing Regexes", - "description": "Regex to extract the answer from generated response" - }, - "aggregation_functions": { - "items": { - "$ref": "#/components/schemas/AggregationFunctionType" - }, - "type": "array", - "title": "Aggregation Functions", - "description": "Aggregation functions to apply to the scores of each row" - } - }, - "type": "object", - "title": "RegexParserScoringFnParams", - "description": "Parameters for regex parser scoring function configuration." - }, - "RerankData": { - "properties": { - "index": { - "type": "integer", - "title": "Index" - }, - "relevance_score": { - "type": "number", - "title": "Relevance Score" - } - }, - "type": "object", - "required": [ - "index", - "relevance_score" - ], - "title": "RerankData", - "description": "A single rerank result from a reranking response." - }, - "RerankResponse": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/RerankData" - }, - "type": "array", - "title": "Data" - } - }, - "type": "object", - "required": [ - "data" - ], - "title": "RerankResponse", - "description": "Response from a reranking request." - }, - "RouteInfo": { - "properties": { - "route": { - "type": "string", - "title": "Route" - }, - "method": { - "type": "string", - "title": "Method" - }, - "provider_types": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Provider Types" - } - }, - "type": "object", - "required": [ - "route", - "method", - "provider_types" - ], - "title": "RouteInfo", - "description": "Information about an API route including its path, method, and implementing providers." - }, - "RowsDataSource": { - "properties": { - "type": { - "type": "string", - "const": "rows", - "title": "Type", - "default": "rows" - }, - "rows": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Rows" - } - }, - "type": "object", - "required": [ - "rows" - ], - "title": "RowsDataSource", - "description": "A dataset stored in rows." - }, - "RunShieldResponse": { - "properties": { - "violation": { - "$ref": "#/components/schemas/SafetyViolation" - } - }, - "type": "object", - "title": "RunShieldResponse", - "description": "Response from running a safety shield." - }, - "SafetyViolation": { - "properties": { - "violation_level": { - "$ref": "#/components/schemas/ViolationLevel" - }, - "user_message": { - "title": "User Message", - "type": "string" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "violation_level" - ], - "title": "SafetyViolation", - "description": "Details of a safety violation detected by content moderation." - }, - "SamplingParams": { - "properties": { - "strategy": { - "oneOf": [ - { - "$ref": "#/components/schemas/GreedySamplingStrategy" - }, - { - "$ref": "#/components/schemas/TopPSamplingStrategy" - }, - { - "$ref": "#/components/schemas/TopKSamplingStrategy" - } - ], - "title": "Strategy", - "discriminator": { - "propertyName": "type", - "mapping": { - "greedy": "#/components/schemas/GreedySamplingStrategy", - "top_k": "#/components/schemas/TopKSamplingStrategy", - "top_p": "#/components/schemas/TopPSamplingStrategy" - } - } - }, - "max_tokens": { - "title": "Max Tokens", - "type": "integer" - }, - "repetition_penalty": { - "title": "Repetition Penalty", - "default": 1.0, - "type": "number" - }, - "stop": { - "title": "Stop", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object", - "title": "SamplingParams", - "description": "Sampling parameters." - }, - "ScoreBatchResponse": { - "properties": { - "dataset_id": { - "title": "Dataset Id", - "type": "string" - }, - "results": { - "additionalProperties": { - "$ref": "#/components/schemas/ScoringResult" - }, - "type": "object", - "title": "Results" - } - }, - "type": "object", - "required": [ - "results" - ], - "title": "ScoreBatchResponse", - "description": "Response from batch scoring operations on datasets." - }, - "ScoreResponse": { - "properties": { - "results": { - "additionalProperties": { - "$ref": "#/components/schemas/ScoringResult" - }, - "type": "object", - "title": "Results" - } - }, - "type": "object", - "required": [ - "results" - ], - "title": "ScoreResponse", - "description": "The response from scoring." - }, - "ScoringFn-Output": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "scoring_function", - "title": "Type", - "default": "scoring_function" - }, - "description": { - "title": "Description", - "type": "string" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata", - "description": "Any additional metadata for this definition" - }, - "return_type": { - "oneOf": [ - { - "$ref": "#/components/schemas/StringType" - }, - { - "$ref": "#/components/schemas/NumberType" - }, - { - "$ref": "#/components/schemas/BooleanType" - }, - { - "$ref": "#/components/schemas/ArrayType" - }, - { - "$ref": "#/components/schemas/ObjectType" - }, - { - "$ref": "#/components/schemas/JsonType" - }, - { - "$ref": "#/components/schemas/UnionType" - }, - { - "$ref": "#/components/schemas/ChatCompletionInputType" - }, - { - "$ref": "#/components/schemas/CompletionInputType" - }, - { - "$ref": "#/components/schemas/AgentTurnInputType" - } - ], - "title": "Return Type", - "description": "The return type of the deterministic function", - "discriminator": { - "propertyName": "type", - "mapping": { - "agent_turn_input": "#/components/schemas/AgentTurnInputType", - "array": "#/components/schemas/ArrayType", - "boolean": "#/components/schemas/BooleanType", - "chat_completion_input": "#/components/schemas/ChatCompletionInputType", - "completion_input": "#/components/schemas/CompletionInputType", - "json": "#/components/schemas/JsonType", - "number": "#/components/schemas/NumberType", - "object": "#/components/schemas/ObjectType", - "string": "#/components/schemas/StringType", - "union": "#/components/schemas/UnionType" - } - } - }, - "params": { - "title": "Params", - "description": "The parameters for the scoring function for benchmark eval, these can be overridden for app eval", - "oneOf": [ - { - "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" - }, - { - "$ref": "#/components/schemas/RegexParserScoringFnParams" - }, - { - "$ref": "#/components/schemas/BasicScoringFnParams" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "basic": "#/components/schemas/BasicScoringFnParams", - "llm_as_judge": "#/components/schemas/LLMAsJudgeScoringFnParams", - "regex_parser": "#/components/schemas/RegexParserScoringFnParams" - } - } - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id", - "return_type" - ], - "title": "ScoringFn", - "description": "A scoring function resource for evaluating model outputs." - }, - "ScoringResult": { - "properties": { - "score_rows": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Score Rows" - }, - "aggregated_results": { - "additionalProperties": true, - "type": "object", - "title": "Aggregated Results" - } - }, - "type": "object", - "required": [ - "score_rows", - "aggregated_results" - ], - "title": "ScoringResult", - "description": "A scoring result for a single row." - }, - "SearchRankingOptions": { - "properties": { - "ranker": { - "title": "Ranker", - "type": "string" - }, - "score_threshold": { - "title": "Score Threshold", - "default": 0.0, - "type": "number" - } - }, - "type": "object", - "title": "SearchRankingOptions", - "description": "Options for ranking and filtering search results." - }, - "Shield": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "shield", - "title": "Type", - "default": "shield" - }, - "params": { - "title": "Params", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id" - ], - "title": "Shield", - "description": "A safety shield resource that can be used to check content." - }, - "ShieldCallStep-Output": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "step_id": { - "type": "string", - "title": "Step Id" - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - }, - "step_type": { - "type": "string", - "const": "shield_call", - "title": "Step Type", - "default": "shield_call" - }, - "violation": { - "$ref": "#/components/schemas/SafetyViolation" - } - }, - "type": "object", - "required": [ - "turn_id", - "step_id", - "violation" - ], - "title": "ShieldCallStep", - "description": "A shield call step in an agent turn." - }, - "StopReason": { - "type": "string", - "enum": [ - "end_of_turn", - "end_of_message", - "out_of_tokens" - ], - "title": "StopReason" - }, - "StringType": { - "properties": { - "type": { - "type": "string", - "const": "string", - "title": "Type", - "default": "string" - } - }, - "type": "object", - "title": "StringType", - "description": "Parameter type for string values." - }, - "SystemMessage": { - "properties": { - "role": { - "type": "string", - "const": "system", - "title": "Role", - "default": "system" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "SystemMessage", - "description": "A system message providing instructions or context to the model." - }, - "SystemMessageBehavior": { - "type": "string", - "enum": [ - "append", - "replace" - ], - "title": "SystemMessageBehavior", - "description": "Config for how to override the default system prompt." - }, - "TextContentItem": { - "properties": { - "type": { - "type": "string", - "const": "text", - "title": "Type", - "default": "text" - }, - "text": { - "type": "string", - "title": "Text" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "TextContentItem", - "description": "A text content item" - }, - "ToolCall": { - "properties": { - "call_id": { - "type": "string", - "title": "Call Id" - }, - "tool_name": { - "anyOf": [ - { - "$ref": "#/components/schemas/BuiltinTool" - }, - { - "type": "string" - } - ], - "title": "Tool Name" - }, - "arguments": { - "type": "string", - "title": "Arguments" - } - }, - "type": "object", - "required": [ - "call_id", - "tool_name", - "arguments" - ], - "title": "ToolCall" - }, - "ToolChoice": { - "type": "string", - "enum": [ - "auto", - "required", - "none" - ], - "title": "ToolChoice", - "description": "Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model." - }, - "ToolConfig": { - "properties": { - "tool_choice": { - "anyOf": [ - { - "$ref": "#/components/schemas/ToolChoice" - }, - { - "type": "string" - } - ], - "title": "Tool Choice", - "default": "auto" - }, - "tool_prompt_format": { - "$ref": "#/components/schemas/ToolPromptFormat" - }, - "system_message_behavior": { - "default": "append", - "$ref": "#/components/schemas/SystemMessageBehavior" - } - }, - "type": "object", - "title": "ToolConfig", - "description": "Configuration for tool use." - }, - "ToolDef": { - "properties": { - "toolgroup_id": { - "title": "Toolgroup Id", - "type": "string" - }, - "name": { - "type": "string", - "title": "Name" - }, - "description": { - "title": "Description", - "type": "string" - }, - "input_schema": { - "title": "Input Schema", - "additionalProperties": true, - "type": "object" - }, - "output_schema": { - "title": "Output Schema", - "additionalProperties": true, - "type": "object" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "required": [ - "name" - ], - "title": "ToolDef", - "description": "Tool definition used in runtime contexts." - }, - "ToolExecutionStep-Output": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "step_id": { - "type": "string", - "title": "Step Id" - }, - "started_at": { - "title": "Started At", - "type": "string", - "format": "date-time" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - }, - "step_type": { - "type": "string", - "const": "tool_execution", - "title": "Step Type", - "default": "tool_execution" - }, - "tool_calls": { - "items": { - "$ref": "#/components/schemas/ToolCall" - }, - "type": "array", - "title": "Tool Calls" - }, - "tool_responses": { - "items": { - "$ref": "#/components/schemas/ToolResponse-Output" - }, - "type": "array", - "title": "Tool Responses" - } - }, - "type": "object", - "required": [ - "turn_id", - "step_id", - "tool_calls", - "tool_responses" - ], - "title": "ToolExecutionStep", - "description": "A tool execution step in an agent turn." - }, - "ToolGroup": { - "properties": { - "identifier": { - "type": "string", - "title": "Identifier", - "description": "Unique identifier for this resource in llama stack" - }, - "provider_resource_id": { - "title": "Provider Resource Id", - "description": "Unique identifier for this resource in the provider", - "type": "string" - }, - "provider_id": { - "type": "string", - "title": "Provider Id", - "description": "ID of the provider that owns this resource" - }, - "type": { - "type": "string", - "const": "tool_group", - "title": "Type", - "default": "tool_group" - }, - "mcp_endpoint": { - "$ref": "#/components/schemas/URL" - }, - "args": { - "title": "Args", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "required": [ - "identifier", - "provider_id" - ], - "title": "ToolGroup", - "description": "A group of related tools managed together." - }, - "ToolInvocationResult": { - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "error_message": { - "title": "Error Message", - "type": "string" - }, - "error_code": { - "title": "Error Code", - "type": "integer" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "title": "ToolInvocationResult", - "description": "Result of a tool invocation." - }, - "ToolPromptFormat": { - "type": "string", - "enum": [ - "json", - "function_tag", - "python_list" - ], - "title": "ToolPromptFormat", - "description": "Prompt format for calling custom / zero shot tools." - }, - "ToolResponse-Input": { - "properties": { - "call_id": { - "type": "string", - "title": "Call Id" - }, - "tool_name": { - "anyOf": [ - { - "$ref": "#/components/schemas/BuiltinTool" - }, - { - "type": "string" - } - ], - "title": "Tool Name" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "required": [ - "call_id", - "tool_name", - "content" - ], - "title": "ToolResponse", - "description": "Response from a tool invocation." - }, - "ToolResponse-Output": { - "properties": { - "call_id": { - "type": "string", - "title": "Call Id" - }, - "tool_name": { - "anyOf": [ - { - "$ref": "#/components/schemas/BuiltinTool" - }, - { - "type": "string" - } - ], - "title": "Tool Name" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object" - } - }, - "type": "object", - "required": [ - "call_id", - "tool_name", - "content" - ], - "title": "ToolResponse", - "description": "Response from a tool invocation." - }, - "ToolResponseMessage-Output": { - "properties": { - "role": { - "type": "string", - "const": "tool", - "title": "Role", - "default": "tool" - }, - "call_id": { - "type": "string", - "title": "Call Id" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - } - }, - "type": "object", - "required": [ - "call_id", - "content" - ], - "title": "ToolResponseMessage", - "description": "A message representing the result of a tool invocation." - }, - "TopKSamplingStrategy": { - "properties": { - "type": { - "type": "string", - "const": "top_k", - "title": "Type", - "default": "top_k" - }, - "top_k": { - "type": "integer", - "minimum": 1.0, - "title": "Top K" - } - }, - "type": "object", - "required": [ - "top_k" - ], - "title": "TopKSamplingStrategy", - "description": "Top-k sampling strategy that restricts sampling to the k most likely tokens." - }, - "TopPSamplingStrategy": { - "properties": { - "type": { - "type": "string", - "const": "top_p", - "title": "Type", - "default": "top_p" - }, - "temperature": { - "title": "Temperature", - "type": "number", - "minimum": 0.0 - }, - "top_p": { - "title": "Top P", - "default": 0.95, - "type": "number" - } - }, - "type": "object", - "required": [ - "temperature" - ], - "title": "TopPSamplingStrategy", - "description": "Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p." - }, - "TrainingConfig": { - "properties": { - "n_epochs": { - "type": "integer", - "title": "N Epochs" - }, - "max_steps_per_epoch": { - "type": "integer", - "title": "Max Steps Per Epoch", - "default": 1 - }, - "gradient_accumulation_steps": { - "type": "integer", - "title": "Gradient Accumulation Steps", - "default": 1 - }, - "max_validation_steps": { - "title": "Max Validation Steps", - "default": 1, - "type": "integer" - }, - "data_config": { - "$ref": "#/components/schemas/DataConfig" - }, - "optimizer_config": { - "$ref": "#/components/schemas/OptimizerConfig" - }, - "efficiency_config": { - "$ref": "#/components/schemas/EfficiencyConfig" - }, - "dtype": { - "title": "Dtype", - "default": "bf16", - "type": "string" - } - }, - "type": "object", - "required": [ - "n_epochs" - ], - "title": "TrainingConfig", - "description": "Comprehensive configuration for the training process." - }, - "Turn": { - "properties": { - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "session_id": { - "type": "string", - "title": "Session Id" - }, - "input_messages": { - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/UserMessage-Output" - }, - { - "$ref": "#/components/schemas/ToolResponseMessage-Output" - } - ] - }, - "type": "array", - "title": "Input Messages" - }, - "steps": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/InferenceStep-Output" - }, - { - "$ref": "#/components/schemas/ToolExecutionStep-Output" - }, - { - "$ref": "#/components/schemas/ShieldCallStep-Output" - }, - { - "$ref": "#/components/schemas/MemoryRetrievalStep-Output" - } - ], - "discriminator": { - "propertyName": "step_type", - "mapping": { - "inference": "#/components/schemas/InferenceStep-Output", - "memory_retrieval": "#/components/schemas/MemoryRetrievalStep-Output", - "shield_call": "#/components/schemas/ShieldCallStep-Output", - "tool_execution": "#/components/schemas/ToolExecutionStep-Output" - } - } - }, - "type": "array", - "title": "Steps" - }, - "output_message": { - "$ref": "#/components/schemas/CompletionMessage-Output" - }, - "output_attachments": { - "title": "Output Attachments", - "items": { - "$ref": "#/components/schemas/Attachment-Output" - }, - "type": "array" - }, - "started_at": { - "type": "string", - "format": "date-time", - "title": "Started At" - }, - "completed_at": { - "title": "Completed At", - "type": "string", - "format": "date-time" - } - }, - "type": "object", - "required": [ - "turn_id", - "session_id", - "input_messages", - "steps", - "output_message", - "started_at" - ], - "title": "Turn", - "description": "A single turn in an interaction with an Agentic System." - }, - "URIDataSource": { - "properties": { - "type": { - "type": "string", - "const": "uri", - "title": "Type", - "default": "uri" - }, - "uri": { - "type": "string", - "title": "Uri" - } - }, - "type": "object", - "required": [ - "uri" - ], - "title": "URIDataSource", - "description": "A dataset that can be obtained from a URI." - }, - "URL": { - "properties": { - "uri": { - "type": "string", - "title": "Uri" - } - }, - "type": "object", - "required": [ - "uri" - ], - "title": "URL", - "description": "A URL reference to external content." - }, - "UnionType": { - "properties": { - "type": { - "type": "string", - "const": "union", - "title": "Type", - "default": "union" - } - }, - "type": "object", - "title": "UnionType", - "description": "Parameter type for union values." - }, - "UserMessage-Input": { - "properties": { - "role": { - "type": "string", - "const": "user", - "title": "Role", - "default": "user" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "context": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Input" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Input", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Context" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "UserMessage", - "description": "A message from the user in a chat conversation." - }, - "UserMessage-Output": { - "properties": { - "role": { - "type": "string", - "const": "user", - "title": "Role", - "default": "user" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Content" - }, - "context": { - "anyOf": [ - { - "type": "string" - }, - { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem-Output" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "image": "#/components/schemas/ImageContentItem-Output", - "text": "#/components/schemas/TextContentItem" - } - } - }, - "type": "array" - } - ], - "title": "Context" - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "UserMessage", - "description": "A message from the user in a chat conversation." - }, - "VectorStoreChunkingStrategyAuto": { - "properties": { - "type": { - "type": "string", - "const": "auto", - "title": "Type", - "default": "auto" - } - }, - "type": "object", - "title": "VectorStoreChunkingStrategyAuto", - "description": "Automatic chunking strategy for vector store files." - }, - "VectorStoreChunkingStrategyStatic": { - "properties": { - "type": { - "type": "string", - "const": "static", - "title": "Type", - "default": "static" - }, - "static": { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyStaticConfig" - } - }, - "type": "object", - "required": [ - "static" - ], - "title": "VectorStoreChunkingStrategyStatic", - "description": "Static chunking strategy with configurable parameters." - }, - "VectorStoreChunkingStrategyStaticConfig": { - "properties": { - "chunk_overlap_tokens": { - "type": "integer", - "title": "Chunk Overlap Tokens", - "default": 400 - }, - "max_chunk_size_tokens": { - "type": "integer", - "maximum": 4096.0, - "minimum": 100.0, - "title": "Max Chunk Size Tokens", - "default": 800 - } - }, - "type": "object", - "title": "VectorStoreChunkingStrategyStaticConfig", - "description": "Configuration for static chunking strategy." - }, - "VectorStoreContent": { - "properties": { - "type": { - "type": "string", - "const": "text", - "title": "Type" - }, - "text": { - "type": "string", - "title": "Text" - } - }, - "type": "object", - "required": [ - "type", - "text" - ], - "title": "VectorStoreContent", - "description": "Content item from a vector store file or search result." - }, - "VectorStoreFileBatchObject": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "object": { - "type": "string", - "title": "Object", - "default": "vector_store.file_batch" - }, - "created_at": { - "type": "integer", - "title": "Created At" - }, - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "status": { - "anyOf": [ - { - "type": "string", - "const": "completed" - }, - { - "type": "string", - "const": "in_progress" - }, - { - "type": "string", - "const": "cancelled" - }, - { - "type": "string", - "const": "failed" - } - ], - "title": "Status" - }, - "file_counts": { - "$ref": "#/components/schemas/VectorStoreFileCounts" - } - }, - "type": "object", - "required": [ - "id", - "created_at", - "vector_store_id", - "status", - "file_counts" - ], - "title": "VectorStoreFileBatchObject", - "description": "OpenAI Vector Store File Batch object." - }, - "VectorStoreFileCounts": { - "properties": { - "completed": { - "type": "integer", - "title": "Completed" - }, - "cancelled": { - "type": "integer", - "title": "Cancelled" - }, - "failed": { - "type": "integer", - "title": "Failed" - }, - "in_progress": { - "type": "integer", - "title": "In Progress" - }, - "total": { - "type": "integer", - "title": "Total" - } - }, - "type": "object", - "required": [ - "completed", - "cancelled", - "failed", - "in_progress", - "total" - ], - "title": "VectorStoreFileCounts", - "description": "File processing status counts for a vector store." - }, - "VectorStoreFileLastError": { - "properties": { - "code": { - "anyOf": [ - { - "type": "string", - "const": "server_error" - }, - { - "type": "string", - "const": "rate_limit_exceeded" - } - ], - "title": "Code" - }, - "message": { - "type": "string", - "title": "Message" - } - }, - "type": "object", - "required": [ - "code", - "message" - ], - "title": "VectorStoreFileLastError", - "description": "Error information for failed vector store file processing." - }, - "VectorStoreFileObject": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "object": { - "type": "string", - "title": "Object", - "default": "vector_store.file" - }, - "attributes": { - "additionalProperties": true, - "type": "object", - "title": "Attributes" - }, - "chunking_strategy": { - "oneOf": [ - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" - }, - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - ], - "title": "Chunking Strategy", - "discriminator": { - "propertyName": "type", - "mapping": { - "auto": "#/components/schemas/VectorStoreChunkingStrategyAuto", - "static": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - } - }, - "created_at": { - "type": "integer", - "title": "Created At" - }, - "last_error": { - "$ref": "#/components/schemas/VectorStoreFileLastError" - }, - "status": { - "anyOf": [ - { - "type": "string", - "const": "completed" - }, - { - "type": "string", - "const": "in_progress" - }, - { - "type": "string", - "const": "cancelled" - }, - { - "type": "string", - "const": "failed" - } - ], - "title": "Status" - }, - "usage_bytes": { - "type": "integer", - "title": "Usage Bytes", - "default": 0 - }, - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - } - }, - "type": "object", - "required": [ - "id", - "chunking_strategy", - "created_at", - "status", - "vector_store_id" - ], - "title": "VectorStoreFileObject", - "description": "OpenAI Vector Store File object." - }, - "VectorStoreObject": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "object": { - "type": "string", - "title": "Object", - "default": "vector_store" - }, - "created_at": { - "type": "integer", - "title": "Created At" - }, - "name": { - "title": "Name", - "type": "string" - }, - "usage_bytes": { - "type": "integer", - "title": "Usage Bytes", - "default": 0 - }, - "file_counts": { - "$ref": "#/components/schemas/VectorStoreFileCounts" - }, - "status": { - "type": "string", - "title": "Status", - "default": "completed" - }, - "expires_after": { - "title": "Expires After", - "additionalProperties": true, - "type": "object" - }, - "expires_at": { - "title": "Expires At", - "type": "integer" - }, - "last_active_at": { - "title": "Last Active At", - "type": "integer" - }, - "metadata": { - "additionalProperties": true, - "type": "object", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "id", - "created_at", - "file_counts" - ], - "title": "VectorStoreObject", - "description": "OpenAI Vector Store object." - }, - "VectorStoreSearchResponse": { - "properties": { - "file_id": { - "type": "string", - "title": "File Id" - }, - "filename": { - "type": "string", - "title": "Filename" - }, - "score": { - "type": "number", - "title": "Score" - }, - "attributes": { - "title": "Attributes", - "additionalProperties": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - } - ] - }, - "type": "object" - }, - "content": { - "items": { - "$ref": "#/components/schemas/VectorStoreContent" - }, - "type": "array", - "title": "Content" - } - }, - "type": "object", - "required": [ - "file_id", - "filename", - "score", - "content" - ], - "title": "VectorStoreSearchResponse", - "description": "Response from searching a vector store." - }, - "VectorStoreSearchResponsePage": { - "properties": { - "object": { - "type": "string", - "title": "Object", - "default": "vector_store.search_results.page" - }, - "search_query": { - "type": "string", - "title": "Search Query" - }, - "data": { - "items": { - "$ref": "#/components/schemas/VectorStoreSearchResponse" - }, - "type": "array", - "title": "Data" - }, - "has_more": { - "type": "boolean", - "title": "Has More", - "default": false - }, - "next_page": { - "title": "Next Page", - "type": "string" - } - }, - "type": "object", - "required": [ - "search_query", - "data" - ], - "title": "VectorStoreSearchResponsePage", - "description": "Paginated response from searching a vector store." - }, - "VersionInfo": { - "properties": { - "version": { - "type": "string", - "title": "Version" - } - }, - "type": "object", - "required": [ - "version" - ], - "title": "VersionInfo", - "description": "Version information for the service." - }, - "ViolationLevel": { - "type": "string", - "enum": [ - "info", - "warn", - "error" - ], - "title": "ViolationLevel", - "description": "Severity level of a safety violation." - }, - "WeightedRanker": { - "properties": { - "type": { - "type": "string", - "const": "weighted", - "title": "Type", - "default": "weighted" - }, - "alpha": { - "type": "number", - "maximum": 1.0, - "minimum": 0.0, - "title": "Alpha", - "description": "Weight factor between 0 and 1. 0 means only keyword scores, 1 means only vector scores.", - "default": 0.5 - } - }, - "type": "object", - "title": "WeightedRanker", - "description": "Weighted ranker configuration that combines vector and keyword scores." - }, - "_URLOrData": { - "properties": { - "url": { - "$ref": "#/components/schemas/URL" - }, - "data": { - "contentEncoding": "base64", - "title": "Data", - "type": "string" - } - }, - "type": "object", - "title": "_URLOrData", - "description": "A URL or a base64 encoded string" - }, - "__main_____agents_agent_id_session_Request": { - "properties": { - "agent_id": { - "type": "string", - "title": "Agent Id" - }, - "session_name": { - "type": "string", - "title": "Session Name" - } - }, - "type": "object", - "required": [ - "agent_id", - "session_name" - ], - "title": "_agents_agent_id_session_Request" - }, - "__main_____agents_agent_id_session_session_id_turn_Request": { - "properties": { - "agent_id": { - "type": "string", - "title": "Agent Id" - }, - "session_id": { - "type": "string", - "title": "Session Id" - }, - "messages": { - "$ref": "#/components/schemas/UserMessage-Input" - }, - "stream": { - "type": "boolean", - "title": "Stream", - "default": false - }, - "documents": { - "$ref": "#/components/schemas/Document" - }, - "toolgroups": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/AgentToolGroupWithArgs" - } - ], - "title": "Toolgroups" - }, - "tool_config": { - "$ref": "#/components/schemas/ToolConfig" - } - }, - "type": "object", - "required": [ - "agent_id", - "session_id", - "messages", - "documents", - "toolgroups", - "tool_config" - ], - "title": "_agents_agent_id_session_session_id_turn_Request" - }, - "__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request": { - "properties": { - "agent_id": { - "type": "string", - "title": "Agent Id" - }, - "session_id": { - "type": "string", - "title": "Session Id" - }, - "turn_id": { - "type": "string", - "title": "Turn Id" - }, - "tool_responses": { - "$ref": "#/components/schemas/ToolResponse-Input" - }, - "stream": { - "type": "boolean", - "title": "Stream", - "default": false - } - }, - "type": "object", - "required": [ - "agent_id", - "session_id", - "turn_id", - "tool_responses" - ], - "title": "_agents_agent_id_session_session_id_turn_turn_id_resume_Request" - }, - "__main_____datasets_Request": { - "properties": { - "purpose": { - "$ref": "#/components/schemas/DatasetPurpose" - }, - "metadata": { - "type": "string", - "title": "Metadata" - }, - "dataset_id": { - "type": "string", - "title": "Dataset Id" - } - }, - "type": "object", - "required": [ - "purpose", - "metadata", - "dataset_id" - ], - "title": "_datasets_Request" - }, - "_batches_Request": { - "properties": { - "input_file_id": { - "type": "string", - "title": "Input File Id" - }, - "endpoint": { - "type": "string", - "title": "Endpoint" - }, - "completion_window": { - "type": "string", - "title": "Completion Window" - }, - "metadata": { - "type": "string", - "title": "Metadata" - }, - "idempotency_key": { - "type": "string", - "title": "Idempotency Key" - } - }, - "type": "object", - "required": [ - "input_file_id", - "endpoint", - "completion_window", - "metadata", - "idempotency_key" - ], - "title": "_batches_Request" - }, - "_batches_batch_id_cancel_Request": { - "properties": { - "batch_id": { - "type": "string", - "title": "Batch Id" - } - }, - "type": "object", - "required": [ - "batch_id" - ], - "title": "_batches_batch_id_cancel_Request" - }, - "_conversations_Request": { - "properties": { - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage-Input" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - } - ], - "title": "Items", - "discriminator": { - "propertyName": "type", - "mapping": { - "file_search_call": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall", - "function_call_output": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput", - "mcp_approval_request": "#/components/schemas/OpenAIResponseMCPApprovalRequest", - "mcp_approval_response": "#/components/schemas/OpenAIResponseMCPApprovalResponse", - "mcp_call": "#/components/schemas/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools", - "message": "#/components/schemas/OpenAIResponseMessage-Input", - "web_search_call": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - } - } - }, - "metadata": { - "type": "string", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "items", - "metadata" - ], - "title": "_conversations_Request" - }, - "_conversations_conversation_id_Request": { - "properties": { - "conversation_id": { - "type": "string", - "title": "Conversation Id" - }, - "metadata": { - "type": "string", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "conversation_id", - "metadata" - ], - "title": "_conversations_conversation_id_Request" - }, - "_conversations_conversation_id_items_Request": { - "properties": { - "conversation_id": { - "type": "string", - "title": "Conversation Id" - }, - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage-Input" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - } - ], - "title": "Items" - } - }, - "type": "object", - "required": [ - "conversation_id", - "items" - ], - "title": "_conversations_conversation_id_items_Request" - }, - "_inference_rerank_Request": { - "properties": { - "model": { - "type": "string", - "title": "Model" - }, - "query": { - "type": "string", - "title": "Query" - }, - "items": { - "type": "string", - "title": "Items" - }, - "max_num_results": { - "type": "integer", - "title": "Max Num Results" - } - }, - "type": "object", - "required": [ - "model", - "query", - "items", - "max_num_results" - ], - "title": "_inference_rerank_Request" - }, - "_models_Request": { - "properties": { - "model_id": { - "type": "string", - "title": "Model Id" - }, - "provider_model_id": { - "type": "string", - "title": "Provider Model Id" - }, - "provider_id": { - "type": "string", - "title": "Provider Id" - }, - "metadata": { - "type": "string", - "title": "Metadata" - }, - "model_type": { - "$ref": "#/components/schemas/ModelType" - } - }, - "type": "object", - "required": [ - "model_id", - "provider_model_id", - "provider_id", - "metadata", - "model_type" - ], - "title": "_models_Request" - }, - "_moderations_Request": { - "properties": { - "input": { - "type": "string", - "title": "Input" - }, - "model": { - "type": "string", - "title": "Model" - } - }, - "type": "object", - "required": [ - "input", - "model" - ], - "title": "_moderations_Request" - }, - "_prompts_Request": { - "properties": { - "prompt": { - "type": "string", - "title": "Prompt" - }, - "variables": { - "type": "string", - "title": "Variables" - } - }, - "type": "object", - "required": [ - "prompt", - "variables" - ], - "title": "_prompts_Request" - }, - "_prompts_prompt_id_Request": { - "properties": { - "prompt_id": { - "type": "string", - "title": "Prompt Id" - }, - "prompt": { - "type": "string", - "title": "Prompt" - }, - "version": { - "type": "integer", - "title": "Version" - }, - "variables": { - "type": "string", - "title": "Variables" - }, - "set_as_default": { - "type": "boolean", - "title": "Set As Default", - "default": true - } - }, - "type": "object", - "required": [ - "prompt_id", - "prompt", - "version", - "variables" - ], - "title": "_prompts_prompt_id_Request" - }, - "_prompts_prompt_id_set_default_version_Request": { - "properties": { - "prompt_id": { - "type": "string", - "title": "Prompt Id" - }, - "version": { - "type": "integer", - "title": "Version" - } - }, - "type": "object", - "required": [ - "prompt_id", - "version" - ], - "title": "_prompts_prompt_id_set_default_version_Request" - }, - "_responses_Request": { - "properties": { - "input": { - "type": "string", - "title": "Input" - }, - "model": { - "type": "string", - "title": "Model" - }, - "prompt": { - "$ref": "#/components/schemas/OpenAIResponsePrompt" - }, - "instructions": { - "type": "string", - "title": "Instructions" - }, - "previous_response_id": { - "type": "string", - "title": "Previous Response Id" - }, - "conversation": { - "type": "string", - "title": "Conversation" - }, - "store": { - "type": "boolean", - "title": "Store", - "default": true - }, - "stream": { - "type": "boolean", - "title": "Stream", - "default": false - }, - "temperature": { - "type": "number", - "title": "Temperature" - }, - "text": { - "$ref": "#/components/schemas/OpenAIResponseText" - }, - "tools": { - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolMCP" - } - ], - "title": "Tools", - "discriminator": { - "propertyName": "type", - "mapping": { - "file_search": "#/components/schemas/OpenAIResponseInputToolFileSearch", - "function": "#/components/schemas/OpenAIResponseInputToolFunction", - "mcp": "#/components/schemas/OpenAIResponseInputToolMCP", - "web_search": "#/components/schemas/OpenAIResponseInputToolWebSearch", - "web_search_preview": "#/components/schemas/OpenAIResponseInputToolWebSearch", - "web_search_preview_2025_03_11": "#/components/schemas/OpenAIResponseInputToolWebSearch" - } - } - }, - "include": { - "type": "string", - "title": "Include" - }, - "max_infer_iters": { - "type": "integer", - "title": "Max Infer Iters", - "default": 10 - } - }, - "type": "object", - "required": [ - "input", - "model", - "prompt", - "instructions", - "previous_response_id", - "conversation", - "temperature", - "text", - "tools", - "include" - ], - "title": "_responses_Request" - }, - "_scoring_score_Request": { - "properties": { - "input_rows": { - "type": "string", - "title": "Input Rows" - }, - "scoring_functions": { - "type": "string", - "title": "Scoring Functions" - } - }, - "type": "object", - "required": [ - "input_rows", - "scoring_functions" - ], - "title": "_scoring_score_Request" - }, - "_scoring_score_batch_Request": { - "properties": { - "dataset_id": { - "type": "string", - "title": "Dataset Id" - }, - "scoring_functions": { - "type": "string", - "title": "Scoring Functions" - }, - "save_results_dataset": { - "type": "boolean", - "title": "Save Results Dataset", - "default": false - } - }, - "type": "object", - "required": [ - "dataset_id", - "scoring_functions" - ], - "title": "_scoring_score_batch_Request" - }, - "_shields_Request": { - "properties": { - "shield_id": { - "type": "string", - "title": "Shield Id" - }, - "provider_shield_id": { - "type": "string", - "title": "Provider Shield Id" - }, - "provider_id": { - "type": "string", - "title": "Provider Id" - }, - "params": { - "type": "string", - "title": "Params" - } - }, - "type": "object", - "required": [ - "shield_id", - "provider_shield_id", - "provider_id", - "params" - ], - "title": "_shields_Request" - }, - "_tool_runtime_invoke_Request": { - "properties": { - "tool_name": { - "type": "string", - "title": "Tool Name" - }, - "kwargs": { - "type": "string", - "title": "Kwargs" - } - }, - "type": "object", - "required": [ - "tool_name", - "kwargs" - ], - "title": "_tool_runtime_invoke_Request" - }, - "_tool_runtime_rag_tool_query_Request": { - "properties": { - "content": { - "type": "string", - "title": "Content" - }, - "vector_store_ids": { - "type": "string", - "title": "Vector Store Ids" - }, - "query_config": { - "$ref": "#/components/schemas/RAGQueryConfig" - } - }, - "type": "object", - "required": [ - "content", - "vector_store_ids", - "query_config" - ], - "title": "_tool_runtime_rag_tool_query_Request" - }, - "_vector_io_query_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "query": { - "type": "string", - "title": "Query" - }, - "params": { - "type": "string", - "title": "Params" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "query", - "params" - ], - "title": "_vector_io_query_Request" - }, - "_vector_stores_vector_store_id_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "expires_after": { - "type": "string", - "title": "Expires After" - }, - "metadata": { - "type": "string", - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "name", - "expires_after", - "metadata" - ], - "title": "_vector_stores_vector_store_id_Request" - }, - "_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request": { - "properties": { - "batch_id": { - "type": "string", - "title": "Batch Id" - }, - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - } - }, - "type": "object", - "required": [ - "batch_id", - "vector_store_id" - ], - "title": "_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request" - }, - "_vector_stores_vector_store_id_files_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "attributes": { - "type": "string", - "title": "Attributes" - }, - "chunking_strategy": { - "anyOf": [ - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" - }, - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - ], - "title": "Chunking Strategy" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "file_id", - "attributes", - "chunking_strategy" - ], - "title": "_vector_stores_vector_store_id_files_Request" - }, - "_vector_stores_vector_store_id_files_file_id_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "file_id": { - "type": "string", - "title": "File Id" - }, - "attributes": { - "type": "string", - "title": "Attributes" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "file_id", - "attributes" - ], - "title": "_vector_stores_vector_store_id_files_file_id_Request" - }, - "_vector_stores_vector_store_id_search_Request": { - "properties": { - "vector_store_id": { - "type": "string", - "title": "Vector Store Id" - }, - "query": { - "type": "string", - "title": "Query" - }, - "filters": { - "type": "string", - "title": "Filters" - }, - "max_num_results": { - "type": "integer", - "title": "Max Num Results", - "default": 10 - }, - "ranking_options": { - "$ref": "#/components/schemas/SearchRankingOptions" - }, - "rewrite_query": { - "type": "boolean", - "title": "Rewrite Query", - "default": false - }, - "search_mode": { - "type": "string", - "title": "Search Mode", - "default": "vector" - } - }, - "type": "object", - "required": [ - "vector_store_id", - "query", - "filters", - "ranking_options" - ], - "title": "_vector_stores_vector_store_id_search_Request" - }, - "Error": { - "description": "Error response from the API. Roughly follows RFC 7807.", - "properties": { - "status": { - "title": "Status", - "type": "integer" - }, - "title": { - "title": "Title", - "type": "string" - }, - "detail": { - "title": "Detail", - "type": "string" - }, - "instance": { - "title": "Instance", - "type": "string", - "nullable": true - } - }, - "required": [ - "status", - "title", - "detail" - ], - "title": "Error", - "type": "object" - }, - "Agent": { - "description": "An agent instance with configuration and metadata.", - "properties": { - "agent_id": { - "title": "Agent Id", - "type": "string" - }, - "agent_config": { - "$ref": "#/components/schemas/AgentConfig" - }, - "created_at": { - "format": "date-time", - "title": "Created At", - "type": "string" - } - }, - "required": [ - "agent_id", - "agent_config", - "created_at" - ], - "title": "Agent", - "type": "object" - }, - "AgentStepResponse": { - "description": "Response containing details of a specific agent step.", - "properties": { - "step": { - "discriminator": { - "mapping": { - "inference": "#/$defs/InferenceStep", - "memory_retrieval": "#/$defs/MemoryRetrievalStep", - "shield_call": "#/$defs/ShieldCallStep", - "tool_execution": "#/$defs/ToolExecutionStep" - }, - "propertyName": "step_type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/InferenceStep" - }, - { - "$ref": "#/components/schemas/ToolExecutionStep" - }, - { - "$ref": "#/components/schemas/ShieldCallStep" - }, - { - "$ref": "#/components/schemas/MemoryRetrievalStep" - } - ], - "title": "Step" - } - }, - "required": [ - "step" - ], - "title": "AgentStepResponse", - "type": "object" - }, - "CompletionMessage": { - "description": "A message containing the model's (assistant) response in a chat conversation.", - "properties": { - "role": { - "const": "assistant", - "default": "assistant", - "title": "Role", - "type": "string" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - { - "items": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - "type": "array" - } - ], - "title": "Content" - }, - "stop_reason": { - "$ref": "#/components/schemas/StopReason" - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/ToolCall" - }, - "type": "array" - } - }, - "required": [ - "content", - "stop_reason" - ], - "title": "CompletionMessage", - "type": "object" - }, - "InferenceStep": { - "description": "An inference step in an agent turn.", - "properties": { - "turn_id": { - "title": "Turn Id", - "type": "string" - }, - "step_id": { - "title": "Step Id", - "type": "string" - }, - "started_at": { - "title": "Started At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "completed_at": { - "title": "Completed At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "step_type": { - "const": "inference", - "default": "inference", - "title": "Step Type", - "type": "string" - }, - "model_response": { - "$ref": "#/components/schemas/CompletionMessage" - } - }, - "required": [ - "turn_id", - "step_id", - "model_response" - ], - "title": "InferenceStep", - "type": "object" - }, - "ListOpenAIResponseInputItem": { - "description": "List container for OpenAI response input items.", - "properties": { - "data": { - "items": { - "anyOf": [ - { - "discriminator": { - "mapping": { - "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", - "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", - "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", - "message": "#/$defs/OpenAIResponseMessage", - "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - } - ] - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - } - ] - }, - "title": "Data", - "type": "array" - }, - "object": { - "const": "list", - "default": "list", - "title": "Object", - "type": "string" - } - }, - "required": [ - "data" - ], - "title": "ListOpenAIResponseInputItem", - "type": "object" - }, - "ListOpenAIResponseObject": { - "description": "Paginated list of OpenAI response objects with navigation metadata.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/OpenAIResponseObjectWithInput" - }, - "title": "Data", - "type": "array" - }, - "has_more": { - "title": "Has More", - "type": "boolean" - }, - "first_id": { - "title": "First Id", - "type": "string" - }, - "last_id": { - "title": "Last Id", - "type": "string" - }, - "object": { - "const": "list", - "default": "list", - "title": "Object", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "first_id", - "last_id" - ], - "title": "ListOpenAIResponseObject", - "type": "object" - }, - "MemoryRetrievalStep": { - "description": "A memory retrieval step in an agent turn.", - "properties": { - "turn_id": { - "title": "Turn Id", - "type": "string" - }, - "step_id": { - "title": "Step Id", - "type": "string" - }, - "started_at": { - "title": "Started At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "completed_at": { - "title": "Completed At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "step_type": { - "const": "memory_retrieval", - "default": "memory_retrieval", - "title": "Step Type", - "type": "string" - }, - "vector_store_ids": { - "title": "Vector Store Ids", - "type": "string" - }, - "inserted_context": { - "anyOf": [ - { - "type": "string" - }, - { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - { - "items": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - "type": "array" - } - ], - "title": "Inserted Context" - } - }, - "required": [ - "turn_id", - "step_id", - "vector_store_ids", - "inserted_context" - ], - "title": "MemoryRetrievalStep", - "type": "object" - }, - "OpenAIDeleteResponseObject": { - "description": "Response object confirming deletion of an OpenAI response.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "object": { - "const": "response", - "default": "response", - "title": "Object", - "type": "string" - }, - "deleted": { - "default": true, - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id" - ], - "title": "OpenAIDeleteResponseObject", - "type": "object" - }, - "PaginatedResponse": { - "description": "A generic paginated response that follows a simple format.", - "properties": { - "data": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "title": "Data", - "type": "array" - }, - "has_more": { - "title": "Has More", - "type": "boolean" - }, - "url": { - "title": "Url", - "type": "string", - "nullable": true - } - }, - "required": [ - "data", - "has_more" - ], - "title": "PaginatedResponse", - "type": "object" - }, - "Session": { - "description": "A single session of an interaction with an Agentic System.", - "properties": { - "session_id": { - "title": "Session Id", - "type": "string" - }, - "session_name": { - "title": "Session Name", - "type": "string" - }, - "turns": { - "items": { - "$ref": "#/components/schemas/Turn" - }, - "title": "Turns", - "type": "array" - }, - "started_at": { - "format": "date-time", - "title": "Started At", - "type": "string" - } - }, - "required": [ - "session_id", - "session_name", - "turns", - "started_at" - ], - "title": "Session", - "type": "object" - }, - "ShieldCallStep": { - "description": "A shield call step in an agent turn.", - "properties": { - "turn_id": { - "title": "Turn Id", - "type": "string" - }, - "step_id": { - "title": "Step Id", - "type": "string" - }, - "started_at": { - "title": "Started At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "completed_at": { - "title": "Completed At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "step_type": { - "const": "shield_call", - "default": "shield_call", - "title": "Step Type", - "type": "string" - }, - "violation": { - "$ref": "#/components/schemas/SafetyViolation" - } - }, - "required": [ - "turn_id", - "step_id", - "violation" - ], - "title": "ShieldCallStep", - "type": "object" - }, - "ToolExecutionStep": { - "description": "A tool execution step in an agent turn.", - "properties": { - "turn_id": { - "title": "Turn Id", - "type": "string" - }, - "step_id": { - "title": "Step Id", - "type": "string" - }, - "started_at": { - "title": "Started At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "completed_at": { - "title": "Completed At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "step_type": { - "const": "tool_execution", - "default": "tool_execution", - "title": "Step Type", - "type": "string" - }, - "tool_calls": { - "items": { - "$ref": "#/components/schemas/ToolCall" - }, - "title": "Tool Calls", - "type": "array" - }, - "tool_responses": { - "items": { - "$ref": "#/components/schemas/ToolResponse" - }, - "title": "Tool Responses", - "type": "array" - } - }, - "required": [ - "turn_id", - "step_id", - "tool_calls", - "tool_responses" - ], - "title": "ToolExecutionStep", - "type": "object" - }, - "ToolResponse": { - "description": "Response from a tool invocation.", - "properties": { - "call_id": { - "title": "Call Id", - "type": "string" - }, - "tool_name": { - "anyOf": [ - { - "$ref": "#/components/schemas/BuiltinTool" - }, - { - "type": "string" - } - ], - "title": "Tool Name" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - { - "items": { - "discriminator": { - "mapping": { - "image": "#/$defs/ImageContentItem", - "text": "#/$defs/TextContentItem" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/ImageContentItem" - }, - { - "$ref": "#/components/schemas/TextContentItem" - } - ] - }, - "type": "array" - } - ], - "title": "Content" - }, - "metadata": { - "title": "Metadata", - "additionalProperties": true, - "type": "object", - "nullable": true - } - }, - "required": [ - "call_id", - "tool_name", - "content" - ], - "title": "ToolResponse", - "type": "object" - }, - "ListBatchesResponse": { - "description": "Response containing a list of batch objects.", - "properties": { - "object": { - "const": "list", - "default": "list", - "title": "Object", - "type": "string" - }, - "data": { - "description": "List of batch objects", - "items": { - "$ref": "#/components/schemas/Batch" - }, - "title": "Data", - "type": "array" - }, - "first_id": { - "description": "ID of the first batch in the list", - "title": "First Id", - "type": "string", - "nullable": true - }, - "last_id": { - "description": "ID of the last batch in the list", - "title": "Last Id", - "type": "string", - "nullable": true - }, - "has_more": { - "default": false, - "description": "Whether there are more batches available", - "title": "Has More", - "type": "boolean" - } - }, - "required": [ - "data" - ], - "title": "ListBatchesResponse", - "type": "object" - }, - "ConversationDeletedResource": { - "description": "Response for deleted conversation.", - "properties": { - "id": { - "description": "The deleted conversation identifier", - "title": "Id", - "type": "string" - }, - "object": { - "default": "conversation.deleted", - "description": "Object type", - "title": "Object", - "type": "string" - }, - "deleted": { - "default": true, - "description": "Whether the object was deleted", - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id" - ], - "title": "ConversationDeletedResource", - "type": "object" - }, - "ConversationItemDeletedResource": { - "description": "Response for deleted conversation item.", - "properties": { - "id": { - "description": "The deleted item identifier", - "title": "Id", - "type": "string" - }, - "object": { - "default": "conversation.item.deleted", - "description": "Object type", - "title": "Object", - "type": "string" - }, - "deleted": { - "default": true, - "description": "Whether the object was deleted", - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id" - ], - "title": "ConversationItemDeletedResource", - "type": "object" - }, - "ListOpenAIFileResponse": { - "description": "Response for listing files in OpenAI Files API.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/OpenAIFileObject" - }, - "title": "Data", - "type": "array" - }, - "has_more": { - "title": "Has More", - "type": "boolean" - }, - "first_id": { - "title": "First Id", - "type": "string" - }, - "last_id": { - "title": "Last Id", - "type": "string" - }, - "object": { - "const": "list", - "default": "list", - "title": "Object", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "first_id", - "last_id" - ], - "title": "ListOpenAIFileResponse", - "type": "object" - }, - "OpenAIFileDeleteResponse": { - "description": "Response for deleting a file in OpenAI Files API.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "object": { - "const": "file", - "default": "file", - "title": "Object", - "type": "string" - }, - "deleted": { - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id", - "deleted" - ], - "title": "OpenAIFileDeleteResponse", - "type": "object" - }, - "ListOpenAIChatCompletionResponse": { - "description": "Response from listing OpenAI-compatible chat completions.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/OpenAICompletionWithInputMessages" - }, - "title": "Data", - "type": "array" - }, - "has_more": { - "title": "Has More", - "type": "boolean" - }, - "first_id": { - "title": "First Id", - "type": "string" - }, - "last_id": { - "title": "Last Id", - "type": "string" - }, - "object": { - "const": "list", - "default": "list", - "title": "Object", - "type": "string" - } - }, - "required": [ - "data", - "has_more", - "first_id", - "last_id" - ], - "title": "ListOpenAIChatCompletionResponse", - "type": "object" - }, - "OpenAIAssistantMessageParam": { - "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.", - "properties": { - "role": { - "const": "assistant", - "default": "assistant", - "title": "Role", - "type": "string" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - "type": "array" - } - ], - "title": "Content", - "nullable": true - }, - "name": { - "title": "Name", - "type": "string", - "nullable": true - }, - "tool_calls": { - "title": "Tool Calls", - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" - }, - "type": "array", - "nullable": true - } - }, - "title": "OpenAIAssistantMessageParam", - "type": "object" - }, - "OpenAIChoice": { - "description": "A choice from an OpenAI-compatible chat completion response.", - "properties": { - "message": { - "discriminator": { - "mapping": { - "assistant": "#/$defs/OpenAIAssistantMessageParam", - "developer": "#/$defs/OpenAIDeveloperMessageParam", - "system": "#/$defs/OpenAISystemMessageParam", - "tool": "#/$defs/OpenAIToolMessageParam", - "user": "#/$defs/OpenAIUserMessageParam" - }, - "propertyName": "role" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIUserMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAISystemMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIAssistantMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIToolMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" - } - ], - "title": "Message" - }, - "finish_reason": { - "title": "Finish Reason", - "type": "string" - }, - "index": { - "title": "Index", - "type": "integer" - }, - "logprobs": { - "$ref": "#/components/schemas/OpenAIChoiceLogprobs", - "nullable": true - } - }, - "required": [ - "message", - "finish_reason", - "index" - ], - "title": "OpenAIChoice", - "type": "object" - }, - "OpenAIChoiceLogprobs": { - "description": "The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response.", - "properties": { - "content": { - "title": "Content", - "items": { - "$ref": "#/components/schemas/OpenAITokenLogProb" - }, - "type": "array", - "nullable": true - }, - "refusal": { - "title": "Refusal", - "items": { - "$ref": "#/components/schemas/OpenAITokenLogProb" - }, - "type": "array", - "nullable": true - } - }, - "title": "OpenAIChoiceLogprobs", - "type": "object" - }, - "OpenAICompletionWithInputMessages": { - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "choices": { - "items": { - "$ref": "#/components/schemas/OpenAIChoice" - }, - "title": "Choices", - "type": "array" - }, - "object": { - "const": "chat.completion", - "default": "chat.completion", - "title": "Object", - "type": "string" - }, - "created": { - "title": "Created", - "type": "integer" - }, - "model": { - "title": "Model", - "type": "string" - }, - "usage": { - "$ref": "#/components/schemas/OpenAIChatCompletionUsage", - "nullable": true - }, - "input_messages": { - "items": { - "discriminator": { - "mapping": { - "assistant": "#/$defs/OpenAIAssistantMessageParam", - "developer": "#/$defs/OpenAIDeveloperMessageParam", - "system": "#/$defs/OpenAISystemMessageParam", - "tool": "#/$defs/OpenAIToolMessageParam", - "user": "#/$defs/OpenAIUserMessageParam" - }, - "propertyName": "role" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIUserMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAISystemMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIAssistantMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIToolMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" - } - ] - }, - "title": "Input Messages", - "type": "array" - } - }, - "required": [ - "id", - "choices", - "created", - "model", - "input_messages" - ], - "title": "OpenAICompletionWithInputMessages", - "type": "object" - }, - "OpenAIUserMessageParam": { - "description": "A message from the user in an OpenAI-compatible chat completion request.", - "properties": { - "role": { - "const": "user", - "default": "user", - "title": "Role", - "type": "string" - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "discriminator": { - "mapping": { - "file": "#/$defs/OpenAIFile", - "image_url": "#/$defs/OpenAIChatCompletionContentPartImageParam", - "text": "#/$defs/OpenAIChatCompletionContentPartTextParam" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" - }, - { - "$ref": "#/components/schemas/OpenAIFile" - } - ] - }, - "type": "array" - } - ], - "title": "Content" - }, - "name": { - "title": "Name", - "type": "string", - "nullable": true - } - }, - "required": [ - "content" - ], - "title": "OpenAIUserMessageParam", - "type": "object" - }, - "Checkpoint": { - "description": "Checkpoint created during training runs.", - "properties": { - "identifier": { - "title": "Identifier", - "type": "string" - }, - "created_at": { - "format": "date-time", - "title": "Created At", - "type": "string" - }, - "epoch": { - "title": "Epoch", - "type": "integer" - }, - "post_training_job_id": { - "title": "Post Training Job Id", - "type": "string" - }, - "path": { - "title": "Path", - "type": "string" - }, - "training_metrics": { - "$ref": "#/components/schemas/PostTrainingMetric", - "nullable": true - } - }, - "required": [ - "identifier", - "created_at", - "epoch", - "post_training_job_id", - "path" - ], - "title": "Checkpoint", - "type": "object" - }, - "PostTrainingJobArtifactsResponse": { - "description": "Artifacts of a finetuning job.", - "properties": { - "job_uuid": { - "title": "Job Uuid", - "type": "string" - }, - "checkpoints": { - "items": { - "$ref": "#/components/schemas/Checkpoint" - }, - "title": "Checkpoints", - "type": "array" - } - }, - "required": [ - "job_uuid" - ], - "title": "PostTrainingJobArtifactsResponse", - "type": "object" - }, - "PostTrainingJobStatusResponse": { - "description": "Status of a finetuning job.", - "properties": { - "job_uuid": { - "title": "Job Uuid", - "type": "string" - }, - "status": { - "$ref": "#/components/schemas/JobStatus" - }, - "scheduled_at": { - "title": "Scheduled At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "started_at": { - "title": "Started At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "completed_at": { - "title": "Completed At", - "format": "date-time", - "type": "string", - "nullable": true - }, - "resources_allocated": { - "title": "Resources Allocated", - "additionalProperties": true, - "type": "object", - "nullable": true - }, - "checkpoints": { - "items": { - "$ref": "#/components/schemas/Checkpoint" - }, - "title": "Checkpoints", - "type": "array" - } - }, - "required": [ - "job_uuid", - "status" - ], - "title": "PostTrainingJobStatusResponse", - "type": "object" - }, - "ScoringFn": { - "description": "A scoring function resource for evaluating model outputs.", - "properties": { - "identifier": { - "description": "Unique identifier for this resource in llama stack", - "title": "Identifier", - "type": "string" - }, - "provider_resource_id": { - "description": "Unique identifier for this resource in the provider", - "title": "Provider Resource Id", - "type": "string", - "nullable": true - }, - "provider_id": { - "description": "ID of the provider that owns this resource", - "title": "Provider Id", - "type": "string" - }, - "type": { - "const": "scoring_function", - "default": "scoring_function", - "title": "Type", - "type": "string" - }, - "description": { - "title": "Description", - "type": "string", - "nullable": true - }, - "metadata": { - "additionalProperties": true, - "description": "Any additional metadata for this definition", - "title": "Metadata", - "type": "object" - }, - "return_type": { - "description": "The return type of the deterministic function", - "discriminator": { - "mapping": { - "agent_turn_input": "#/$defs/AgentTurnInputType", - "array": "#/$defs/ArrayType", - "boolean": "#/$defs/BooleanType", - "chat_completion_input": "#/$defs/ChatCompletionInputType", - "completion_input": "#/$defs/CompletionInputType", - "json": "#/$defs/JsonType", - "number": "#/$defs/NumberType", - "object": "#/$defs/ObjectType", - "string": "#/$defs/StringType", - "union": "#/$defs/UnionType" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/StringType" - }, - { - "$ref": "#/components/schemas/NumberType" - }, - { - "$ref": "#/components/schemas/BooleanType" - }, - { - "$ref": "#/components/schemas/ArrayType" - }, - { - "$ref": "#/components/schemas/ObjectType" - }, - { - "$ref": "#/components/schemas/JsonType" - }, - { - "$ref": "#/components/schemas/UnionType" - }, - { - "$ref": "#/components/schemas/ChatCompletionInputType" - }, - { - "$ref": "#/components/schemas/CompletionInputType" - }, - { - "$ref": "#/components/schemas/AgentTurnInputType" - } - ], - "title": "Return Type" - }, - "params": { - "description": "The parameters for the scoring function for benchmark eval, these can be overridden for app eval", - "title": "Params", - "discriminator": { - "mapping": { - "basic": "#/$defs/BasicScoringFnParams", - "llm_as_judge": "#/$defs/LLMAsJudgeScoringFnParams", - "regex_parser": "#/$defs/RegexParserScoringFnParams" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" - }, - { - "$ref": "#/components/schemas/RegexParserScoringFnParams" - }, - { - "$ref": "#/components/schemas/BasicScoringFnParams" - } - ], - "nullable": true - } - }, - "required": [ - "identifier", - "provider_id", - "return_type" - ], - "title": "ScoringFn", - "type": "object" - }, - "ListToolDefsResponse": { - "description": "Response containing a list of tool definitions.", - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/ToolDef" - }, - "title": "Data", - "type": "array" - } - }, - "required": [ - "data" - ], - "title": "ListToolDefsResponse", - "type": "object" - }, - "VectorStoreDeleteResponse": { - "description": "Response from deleting a vector store.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "object": { - "default": "vector_store.deleted", - "title": "Object", - "type": "string" - }, - "deleted": { - "default": true, - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id" - ], - "title": "VectorStoreDeleteResponse", - "type": "object" - }, - "VectorStoreFileContentsResponse": { - "description": "Response from retrieving the contents of a vector store file.", - "properties": { - "file_id": { - "title": "File Id", - "type": "string" - }, - "filename": { - "title": "Filename", - "type": "string" - }, - "attributes": { - "additionalProperties": true, - "title": "Attributes", - "type": "object" - }, - "content": { - "items": { - "$ref": "#/components/schemas/VectorStoreContent" - }, - "title": "Content", - "type": "array" - } - }, - "required": [ - "file_id", - "filename", - "attributes", - "content" - ], - "title": "VectorStoreFileContentsResponse", - "type": "object" - }, - "VectorStoreFileDeleteResponse": { - "description": "Response from deleting a vector store file.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "object": { - "default": "vector_store.file.deleted", - "title": "Object", - "type": "string" - }, - "deleted": { - "default": true, - "title": "Deleted", - "type": "boolean" - } - }, - "required": [ - "id" - ], - "title": "VectorStoreFileDeleteResponse", - "type": "object" - }, - "VectorStoreFilesListInBatchResponse": { - "description": "Response from listing files in a vector store file batch.", - "properties": { - "object": { - "default": "list", - "title": "Object", - "type": "string" - }, - "data": { - "items": { - "$ref": "#/components/schemas/VectorStoreFileObject" - }, - "title": "Data", - "type": "array" - }, - "first_id": { - "title": "First Id", - "type": "string", - "nullable": true - }, - "last_id": { - "title": "Last Id", - "type": "string", - "nullable": true - }, - "has_more": { - "default": false, - "title": "Has More", - "type": "boolean" - } - }, - "required": [ - "data" - ], - "title": "VectorStoreFilesListInBatchResponse", - "type": "object" - }, - "VectorStoreListFilesResponse": { - "description": "Response from listing files in a vector store.", - "properties": { - "object": { - "default": "list", - "title": "Object", - "type": "string" - }, - "data": { - "items": { - "$ref": "#/components/schemas/VectorStoreFileObject" - }, - "title": "Data", - "type": "array" - }, - "first_id": { - "title": "First Id", - "type": "string", - "nullable": true - }, - "last_id": { - "title": "Last Id", - "type": "string", - "nullable": true - }, - "has_more": { - "default": false, - "title": "Has More", - "type": "boolean" - } - }, - "required": [ - "data" - ], - "title": "VectorStoreListFilesResponse", - "type": "object" - }, - "VectorStoreListResponse": { - "description": "Response from listing vector stores.", - "properties": { - "object": { - "default": "list", - "title": "Object", - "type": "string" - }, - "data": { - "items": { - "$ref": "#/components/schemas/VectorStoreObject" - }, - "title": "Data", - "type": "array" - }, - "first_id": { - "title": "First Id", - "type": "string", - "nullable": true - }, - "last_id": { - "title": "Last Id", - "type": "string", - "nullable": true - }, - "has_more": { - "default": false, - "title": "Has More", - "type": "boolean" - } - }, - "required": [ - "data" - ], - "title": "VectorStoreListResponse", - "type": "object" - }, - "OpenAIResponseMessage": { - "description": "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios.", - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "discriminator": { - "mapping": { - "input_file": "#/$defs/OpenAIResponseInputMessageContentFile", - "input_image": "#/$defs/OpenAIResponseInputMessageContentImage", - "input_text": "#/$defs/OpenAIResponseInputMessageContentText" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentImage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputMessageContentFile" - } - ] - }, - "type": "array" - }, - { - "items": { - "discriminator": { - "mapping": { - "output_text": "#/$defs/OpenAIResponseOutputMessageContentOutputText", - "refusal": "#/$defs/OpenAIResponseContentPartRefusal" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageContentOutputText" - }, - { - "$ref": "#/components/schemas/OpenAIResponseContentPartRefusal" - } - ] - }, - "type": "array" - } - ], - "title": "Content" - }, - "role": { - "anyOf": [ - { - "const": "system", - "type": "string" - }, - { - "const": "developer", - "type": "string" - }, - { - "const": "user", - "type": "string" - }, - { - "const": "assistant", - "type": "string" - } - ], - "title": "Role" - }, - "type": { - "const": "message", - "default": "message", - "title": "Type", - "type": "string" - }, - "id": { - "title": "Id", - "type": "string", - "nullable": true - }, - "status": { - "title": "Status", - "type": "string", - "nullable": true - } - }, - "required": [ - "content", - "role" - ], - "title": "OpenAIResponseMessage", - "type": "object" - }, - "OpenAIResponseObjectWithInput": { - "description": "OpenAI response object extended with input context information.", - "properties": { - "created_at": { - "title": "Created At", - "type": "integer" - }, - "error": { - "$ref": "#/components/schemas/OpenAIResponseError", - "nullable": true - }, - "id": { - "title": "Id", - "type": "string" - }, - "model": { - "title": "Model", - "type": "string" - }, - "object": { - "const": "response", - "default": "response", - "title": "Object", - "type": "string" - }, - "output": { - "items": { - "discriminator": { - "mapping": { - "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", - "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", - "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", - "message": "#/$defs/OpenAIResponseMessage", - "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - } - ] - }, - "title": "Output", - "type": "array" - }, - "parallel_tool_calls": { - "default": false, - "title": "Parallel Tool Calls", - "type": "boolean" - }, - "previous_response_id": { - "title": "Previous Response Id", - "type": "string", - "nullable": true - }, - "prompt": { - "$ref": "#/components/schemas/OpenAIResponsePrompt", - "nullable": true - }, - "status": { - "title": "Status", - "type": "string" - }, - "temperature": { - "title": "Temperature", - "type": "number", - "nullable": true - }, - "text": { - "$ref": "#/components/schemas/OpenAIResponseText", - "default": { - "format": { - "type": "text" - } - } - }, - "top_p": { - "title": "Top P", - "type": "number", - "nullable": true - }, - "tools": { - "title": "Tools", - "items": { - "discriminator": { - "mapping": { - "file_search": "#/$defs/OpenAIResponseInputToolFileSearch", - "function": "#/$defs/OpenAIResponseInputToolFunction", - "mcp": "#/$defs/OpenAIResponseToolMCP", - "web_search": "#/$defs/OpenAIResponseInputToolWebSearch", - "web_search_preview": "#/$defs/OpenAIResponseInputToolWebSearch", - "web_search_preview_2025_03_11": "#/$defs/OpenAIResponseInputToolWebSearch" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseInputToolWebSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFileSearch" - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputToolFunction" - }, - { - "$ref": "#/components/schemas/OpenAIResponseToolMCP" - } - ] - }, - "type": "array", - "nullable": true - }, - "truncation": { - "title": "Truncation", - "type": "string", - "nullable": true - }, - "usage": { - "$ref": "#/components/schemas/OpenAIResponseUsage", - "nullable": true - }, - "instructions": { - "title": "Instructions", - "type": "string", - "nullable": true - }, - "input": { - "items": { - "anyOf": [ - { - "discriminator": { - "mapping": { - "file_search_call": "#/$defs/OpenAIResponseOutputMessageFileSearchToolCall", - "function_call": "#/$defs/OpenAIResponseOutputMessageFunctionToolCall", - "mcp_approval_request": "#/$defs/OpenAIResponseMCPApprovalRequest", - "mcp_call": "#/$defs/OpenAIResponseOutputMessageMCPCall", - "mcp_list_tools": "#/$defs/OpenAIResponseOutputMessageMCPListTools", - "message": "#/$defs/OpenAIResponseMessage", - "web_search_call": "#/$defs/OpenAIResponseOutputMessageWebSearchToolCall" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPCall" - }, - { - "$ref": "#/components/schemas/OpenAIResponseOutputMessageMCPListTools" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalRequest" - } - ] - }, - { - "$ref": "#/components/schemas/OpenAIResponseInputFunctionToolCallOutput" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMCPApprovalResponse" - }, - { - "$ref": "#/components/schemas/OpenAIResponseMessage" - } - ] - }, - "title": "Input", - "type": "array" - } - }, - "required": [ - "created_at", - "id", - "model", - "output", - "status", - "input" - ], - "title": "OpenAIResponseObjectWithInput", - "type": "object" - }, - "ImageContentItem": { - "description": "A image content item", - "properties": { - "type": { - "const": "image", - "default": "image", - "title": "Type", - "type": "string" - }, - "image": { - "$ref": "#/components/schemas/_URLOrData" - } - }, - "required": [ - "image" - ], - "title": "ImageContentItem", - "type": "object" - }, - "PostTrainingMetric": { - "description": "Training metrics captured during post-training jobs.", - "properties": { - "epoch": { - "title": "Epoch", - "type": "integer" - }, - "train_loss": { - "title": "Train Loss", - "type": "number" - }, - "validation_loss": { - "title": "Validation Loss", - "type": "number" - }, - "perplexity": { - "title": "Perplexity", - "type": "number" - } - }, - "required": [ - "epoch", - "train_loss", - "validation_loss", - "perplexity" - ], - "title": "PostTrainingMetric", - "type": "object" - }, - "_safety_run_shield_Request": { - "properties": { - "shield_id": { - "title": "Shield Id", - "type": "string" - }, - "messages": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAIUserMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAISystemMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIAssistantMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIToolMessageParam" - }, - { - "$ref": "#/components/schemas/OpenAIDeveloperMessageParam" - } - ], - "title": "Messages" - }, - "params": { - "title": "Params", - "type": "string" - } - }, - "required": [ - "shield_id", - "messages", - "params" - ], - "title": "_safety_run_shield_Request", - "type": "object" - } - }, - "responses": { - "BadRequest400": { - "description": "The request was invalid or malformed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - }, - "example": { - "status": 400, - "title": "Bad Request", - "detail": "The request was invalid or malformed" - } - } - } - }, - "TooManyRequests429": { - "description": "The client has sent too many requests in a given amount of time", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - }, - "example": { - "status": 429, - "title": "Too Many Requests", - "detail": "You have exceeded the rate limit. Please try again later." - } - } - } - }, - "InternalServerError500": { - "description": "The server encountered an unexpected error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - }, - "example": { - "status": 500, - "title": "Internal Server Error", - "detail": "An unexpected error occurred. Our team has been notified." - } - } - } - }, - "DefaultError": { - "description": "An unexpected error occurred", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - } - } -} \ No newline at end of file diff --git a/docs/static/stainless-llama-stack-spec.yaml b/docs/static/stainless-llama-stack-spec.yaml index 22f8d3d5d9..31f653afea 100644 --- a/docs/static/stainless-llama-stack-spec.yaml +++ b/docs/static/stainless-llama-stack-spec.yaml @@ -9,18851 +9,13934 @@ servers: - url: https://staging-api.llamastack.com description: Staging server paths: - /v1/batches: - get: - responses: - '200': - description: A list of batch objects. - content: - application/json: - schema: - $ref: '#/components/schemas/ListBatchesResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Batches - summary: List all batches for the current user. - description: List all batches for the current user. - parameters: - - name: after - in: query - description: >- - A cursor for pagination; returns batches after this batch ID. - required: false - schema: - type: string - - name: limit - in: query - description: >- - Number of batches to return (default 20, max 100). - required: true - schema: - type: integer - deprecated: false + /v1beta/datasetio/append-rows/{dataset_id}: post: - responses: - '200': - description: The created batch object. - content: - application/json: - schema: - $ref: '#/components/schemas/Batch' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' tags: - - Batches - summary: >- - Create a new batch for processing multiple API requests. - description: >- - Create a new batch for processing multiple API requests. - parameters: [] + - DatasetIO + summary: Append rows to a dataset. + description: Append rows to a dataset. + operationId: append_rows_v1beta_datasetio_append_rows__dataset_id__post + parameters: + - name: dataset_id + in: path + required: true + schema: + type: string + description: The ID of the dataset to append the rows to + title: Dataset Id + description: The ID of the dataset to append the rows to requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/CreateBatchRequest' - required: true - deprecated: false - /v1/batches/{batch_id}: - get: + type: array + items: + type: object + additionalProperties: true + description: The rows to append to the dataset. + title: Body responses: - '200': - description: The batch object. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Batch' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Batches - summary: >- - Retrieve information about a specific batch. - description: >- - Retrieve information about a specific batch. - parameters: - - name: batch_id - in: path - description: The ID of the batch to retrieve. - required: true - schema: - type: string - deprecated: false - /v1/batches/{batch_id}/cancel: - post: - responses: - '200': - description: The updated batch object. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/Batch' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Batches - summary: Cancel a batch that is in progress. - description: Cancel a batch that is in progress. - parameters: - - name: batch_id - in: path - description: The ID of the batch to cancel. - required: true - schema: - type: string - deprecated: false - /v1/chat/completions: - get: - responses: - '200': - description: A ListOpenAIChatCompletionResponse. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIChatCompletionResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - Inference - summary: List chat completions. - description: >- - List chat completions. - - :param after: The ID of the last chat completion to return. - :param limit: The maximum number of chat completions to return. - :param model: The model to filter by. - :param order: The order to sort the chat completions by: "asc" or - "desc". Defaults to "desc". - :returns: A ListOpenAIChatCompletionResponse. - parameters: - - name: after - description: >- - The ID of the last chat completion to return. - required: false - schema: - type: string - in: query - - name: limit - description: >- - The maximum number of chat completions to return. - required: false - schema: - type: integer - in: query - - name: model - description: The model to filter by. - required: false - schema: - type: string - in: query - - name: order - description: >- - The order to sort the chat completions by: "asc" or "desc". Defaults to - "desc". - required: false - schema: - $ref: '#/components/schemas/Order' - in: query - deprecated: false - post: - responses: - '200': - description: An OpenAIChatCompletion. + description: An unexpected error occurred. content: application/json: schema: - $ref: '#/components/schemas/llama_stack.apis.inference.inference.OpenAIChatCompletion - | collections.abc.AsyncIterator[llama_stack.apis.inference.inference.OpenAIChatCompletionChunk]' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' + $ref: '#/components/schemas/Error' + /v1beta/datasetio/iterrows/{dataset_id}: + get: tags: - - Inference - summary: Create chat completions. - description: >- - Create chat completions. - - Generate an OpenAI-compatible chat completion for the given messages using - the specified model. - :returns: An OpenAIChatCompletion. - parameters: [] - requestBody: - content: - application/json: - schema: - id: Annotated + - DatasetIO + summary: Get a paginated list of rows from a dataset. + description: Get a paginated list of rows from a dataset using offset-based pagination. + operationId: iterrows_v1beta_datasetio_iterrows__dataset_id__get + parameters: + - name: dataset_id + in: path required: true - deprecated: false - /v1/chat/completions/{completion_id}: - get: + schema: + type: string + description: The ID of the dataset to get the rows from + title: Dataset Id + description: The ID of the dataset to get the rows from + - name: start_index + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: Index into dataset for the first row to get. Get all rows if None. + title: Start Index + description: Index into dataset for the first row to get. Get all rows if None. + - name: limit + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The number of rows to get. + title: Limit + description: The number of rows to get. responses: '200': - description: A OpenAICompletionWithInputMessages. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAICompletionWithInputMessages' + $ref: '#/components/schemas/PaginatedResponse' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Inference - summary: Get chat completion. - description: >- - Get chat completion. - - Describe a chat completion by its ID. - - :param completion_id: ID of the chat completion. - :returns: A OpenAICompletionWithInputMessages. - parameters: - - name: completion_id - description: ID of the chat completion. - required: true - schema: - type: string - in: path - deprecated: false - /v1/completions: - post: - responses: - '200': - description: An OpenAICompletion. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/OpenAICompletion' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1beta/datasets: + get: tags: - - Inference - summary: Create completion. - description: >- - Create completion. - - Generate an OpenAI-compatible completion for the given prompt using the specified - model. - :returns: An OpenAICompletion. - parameters: [] - requestBody: - content: - application/json: - schema: - id: Annotated - required: true - deprecated: false - /v1/conversations: - post: + - Datasets + summary: List all datasets + description: List all datasets + operationId: list_datasets_v1beta_datasets_get responses: '200': - description: The created conversation object. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Conversation' + $ref: '#/components/schemas/ListDatasetsResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - Conversations - summary: Create a conversation. - description: >- - Create a conversation. - - Create a conversation. - - :param items: Initial items to include in the conversation context. - :param metadata: Set of key-value pairs that can be attached to an - object. - :returns: The created conversation object. - parameters: [] + - Datasets + summary: Register a new dataset + description: Register a new dataset + operationId: register_dataset_v1beta_datasets_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/CreateConversationRequest' + $ref: '#/components/schemas/RegisterDatasetRequest' required: true - deprecated: false - /v1/conversations/{conversation_id}: - get: responses: '200': - description: The conversation object. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Conversation' + $ref: '#/components/schemas/Dataset' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Conversations - summary: Retrieve a conversation. - description: >- - Retrieve a conversation. - - Get a conversation with the given ID. - - :param conversation_id: The conversation identifier. - :returns: The conversation object. - parameters: - - name: conversation_id - description: The conversation identifier. - required: true - schema: - type: string - in: path - deprecated: false - post: - responses: - '200': - description: The updated conversation object. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Conversation' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1beta/datasets/{{dataset_id}}: + delete: tags: - - Conversations - summary: Update a conversation. - description: >- - Update a conversation. - - Update a conversation's metadata with the given ID. - - :param conversation_id: The conversation identifier. - :param metadata: Set of key-value pairs that can be attached to an - object. - :returns: The updated conversation object. + - Datasets + summary: Unregister a dataset by its ID + description: Unregister a dataset by its ID + operationId: unregister_dataset_v1beta_datasets___dataset_id___delete parameters: - - name: conversation_id - description: The conversation identifier. - required: true - schema: - type: string - in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateConversationRequest' + - name: dataset_id + in: path required: true - deprecated: false - delete: + schema: + type: string + description: The ID of the dataset to unregister + title: Dataset Id + description: The ID of the dataset to unregister responses: - '200': - description: The deleted conversation resource. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ConversationDeletedResource' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Conversations - summary: Delete a conversation. - description: >- - Delete a conversation. - - Delete a conversation with the given ID. - - :param conversation_id: The conversation identifier. - :returns: The deleted conversation resource. - parameters: - - name: conversation_id - description: The conversation identifier. - required: true - schema: - type: string - in: path - deprecated: false - /v1/conversations/{conversation_id}/items: - get: - responses: - '200': - description: List of conversation items. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/ConversationItemList' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: tags: - - Conversations - summary: List items. - description: >- - List items. - - List items in the conversation. - - :param conversation_id: The conversation identifier. - :param after: An item ID to list items after, used in pagination. - :param include: Specify additional output data to include in the response. - :param limit: A limit on the number of objects to be returned (1-100, - default 20). - :param order: The order to return items in (asc or desc, default desc). - :returns: List of conversation items. + - Datasets + summary: Get a dataset by its ID + description: Get a dataset by its ID + operationId: get_dataset_v1beta_datasets___dataset_id___get parameters: - - name: conversation_id - description: The conversation identifier. - required: true - schema: - type: string - in: path - - name: after - description: >- - An item ID to list items after, used in pagination. - required: false - schema: - type: string - in: query - - name: include - description: >- - Specify additional output data to include in the response. - required: false - schema: - $ref: '#/components/schemas/list' - in: query - - name: limit - description: >- - A limit on the number of objects to be returned (1-100, default 20). - required: false - schema: - type: integer - in: query - - name: order - description: >- - The order to return items in (asc or desc, default desc). - required: false - schema: - $ref: '#/components/schemas/Literal' - in: query - deprecated: false - post: + - name: dataset_id + in: path + required: true + schema: + type: string + description: The ID of the dataset to get + title: Dataset Id + description: The ID of the dataset to get responses: '200': - description: List of created items. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ConversationItemList' + $ref: '#/components/schemas/Dataset' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Conversations - summary: Create items. - description: >- - Create items. - - Create items in the conversation. - - :param conversation_id: The conversation identifier. - :param items: Items to include in the conversation context. - :returns: List of created items. - parameters: - - name: conversation_id - description: The conversation identifier. - required: true - schema: - type: string - in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AddItemsRequest' - required: true - deprecated: false - /v1/conversations/{conversation_id}/items/{item_id}: - get: - responses: - '200': - description: The conversation item. + description: The request was invalid or malformed. content: application/json: schema: - id: Annotated - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Conversations - summary: Retrieve an item. - description: >- - Retrieve an item. - - Retrieve a conversation item. - - :param conversation_id: The conversation identifier. - :param item_id: The item identifier. - :returns: The conversation item. - parameters: - - name: conversation_id - description: The conversation identifier. - required: true - schema: - type: string - in: path - - name: item_id - description: The item identifier. - required: true - schema: - type: string - in: path - deprecated: false - delete: - responses: - '200': - description: The deleted item resource. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/ConversationItemDeletedResource' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents: + get: tags: - - Conversations - summary: Delete an item. - description: >- - Delete an item. - - Delete a conversation item. - - :param conversation_id: The conversation identifier. - :param item_id: The item identifier. - :returns: The deleted item resource. + - Agents + summary: List all agents. + description: List all agents. + operationId: list_agents_v1alpha_agents_get parameters: - - name: conversation_id - description: The conversation identifier. - required: true - schema: - type: string - in: path - - name: item_id - description: The item identifier. - required: true - schema: - type: string - in: path - deprecated: false - /v1/embeddings: - post: + - name: start_index + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The index to start the pagination from. + title: Start Index + description: The index to start the pagination from. + - name: limit + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The number of agents to return. + title: Limit + description: The number of agents to return. responses: '200': - description: >- - An OpenAIEmbeddingsResponse containing the embeddings. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/OpenAIEmbeddingsResponse' + schema: {} '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - Inference - summary: Create embeddings. - description: >- - Create embeddings. - - Generate OpenAI-compatible embeddings for the given input using the specified - model. - :returns: An OpenAIEmbeddingsResponse containing the embeddings. - parameters: [] + - Agents + summary: Create an agent. + description: Create an agent with the given configuration. + operationId: create_agent_v1alpha_agents_post requestBody: + required: true content: application/json: schema: - id: Annotated - required: true - deprecated: false - /v1/files: - get: + $ref: '#/components/schemas/AgentConfig-Input' responses: '200': - description: >- - An ListOpenAIFileResponse containing the list of files. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIFileResponse' + $ref: '#/components/schemas/AgentCreateResponse' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Files - summary: List files. - description: >- - List files. - - Returns a list of files that belong to the user's organization. - - :param after: A cursor for use in pagination. `after` is an object - ID that defines your place in the list. For instance, if you make a list request - and receive 100 objects, ending with obj_foo, your subsequent call can include - after=obj_foo in order to fetch the next page of the list. - :param limit: A limit on the number of objects to be returned. Limit - can range between 1 and 10,000, and the default is 10,000. - :param order: Sort order by the `created_at` timestamp of the objects. - `asc` for ascending order and `desc` for descending order. - :param purpose: Only return files with the given purpose. - :returns: An ListOpenAIFileResponse containing the list of files. - parameters: - - name: after - description: >- - A cursor for use in pagination. `after` is an object ID that defines your - place in the list. For instance, if you make a list request and receive - 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo - in order to fetch the next page of the list. - required: false - schema: - type: string - in: query - - name: limit - description: >- - A limit on the number of objects to be returned. Limit can range between - 1 and 10,000, and the default is 10,000. - required: false - schema: - type: integer - in: query - - name: order - description: >- - Sort order by the `created_at` timestamp of the objects. `asc` for ascending - order and `desc` for descending order. - required: false - schema: - $ref: '#/components/schemas/Order' - in: query - - name: purpose - description: >- - Only return files with the given purpose. - required: false - schema: - $ref: '#/components/schemas/OpenAIFilePurpose' - in: query - deprecated: false - post: - responses: - '200': - description: >- - An OpenAIFileObject representing the uploaded file. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileObject' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Files - summary: Upload file. - description: >- - Upload file. - - Upload a file that can be used across various endpoints. - - The file upload should be a multipart form request with: - - file: The File object (not file name) to be uploaded. - - purpose: The intended purpose of the uploaded file. - - expires_after: Optional form values describing expiration for the - file. - - :param file: The uploaded file object containing content and metadata - (filename, content_type, etc.). - :param purpose: The intended purpose of the uploaded file (e.g., "assistants", - "fine-tune"). - :param expires_after: Optional form values describing expiration for - the file. - :returns: An OpenAIFileObject representing the uploaded file. - parameters: [] - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - file: - type: string - format: binary - purpose: - $ref: '#/components/schemas/OpenAIFilePurpose' - expires_after: - $ref: '#/components/schemas/ExpiresAfter' - required: - - file - - purpose - required: true - deprecated: false - /v1/files/{file_id}: - get: - responses: - '200': - description: >- - An OpenAIFileObject containing file information. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileObject' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Files - summary: Retrieve file. - description: >- - Retrieve file. - - Returns information about a specific file. - - :param file_id: The ID of the file to use for this request. - :returns: An OpenAIFileObject containing file information. - parameters: - - name: file_id - description: >- - The ID of the file to use for this request. - required: true - schema: - type: string - in: path - deprecated: false - delete: - responses: - '200': - description: >- - An OpenAIFileDeleteResponse indicating successful deletion. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileDeleteResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - Files - summary: Delete file. - description: >- - Delete file. - - :param file_id: The ID of the file to use for this request. - :returns: An OpenAIFileDeleteResponse indicating successful deletion. - parameters: - - name: file_id - description: >- - The ID of the file to use for this request. - required: true - schema: - type: string - in: path - deprecated: false - /v1/files/{file_id}/content: - get: - responses: - '200': - description: >- - The raw file content as a binary response. + description: An unexpected error occurred. content: application/json: schema: - $ref: '#/components/schemas/Response' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}: + delete: tags: - - Files - summary: Retrieve file content. - description: >- - Retrieve file content. - - Returns the contents of the specified file. - - :param file_id: The ID of the file to use for this request. - :returns: The raw file content as a binary response. + - Agents + summary: Delete an agent. + description: Delete an agent by its ID. + operationId: delete_agent_v1alpha_agents___agent_id___delete parameters: - - name: file_id - description: >- - The ID of the file to use for this request. - required: true - schema: - type: string - in: path - deprecated: false - /v1/health: - get: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to delete. + title: Agent Id + description: The ID of the agent to delete. responses: - '200': - description: >- - Health information indicating if the service is operational. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/HealthInfo' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Inspect - summary: Get health status. - description: >- - Get health status. - - Get the current health status of the service. - - :returns: Health information indicating if the service is operational. - parameters: [] - deprecated: false - /v1/inspect/routes: - get: - responses: - '200': - description: >- - Response containing information about all available routes. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/ListRoutesResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: tags: - - Inspect - summary: List routes. - description: >- - List routes. - - List all available API routes with their methods and implementing providers. + - Agents + summary: Describe an agent. + description: Describe an agent by its ID. + operationId: get_agent_v1alpha_agents___agent_id___get parameters: - - name: api_filter - in: query - description: >- - Optional filter to control which routes are returned. Can be an API level - ('v1', 'v1alpha', 'v1beta') to show non-deprecated routes at that level, - or 'deprecated' to show deprecated routes across all levels. If not specified, - returns only non-deprecated v1 routes. - required: false - schema: - type: string - enum: - - v1 - - v1alpha - - v1beta - - deprecated - deprecated: false - /v1/models: - get: + - name: agent_id + in: path + required: true + schema: + type: string + description: ID of the agent. + title: Agent Id + description: ID of the agent. responses: '200': - description: A OpenAIListModelsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAIListModelsResponse' + $ref: '#/components/schemas/Agent' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Models - summary: List models using the OpenAI API. - description: List models using the OpenAI API. - parameters: [] - deprecated: false - post: - responses: - '200': - description: A Model. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Model' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session: + post: tags: - - Models - summary: Register model. - description: >- - Register model. - - Register a model. - - :param model_id: The identifier of the model to register. - :param provider_model_id: The identifier of the model in the provider. - :param provider_id: The identifier of the provider. - :param metadata: Any additional metadata for this model. - :param model_type: The type of model to register. - :returns: A Model. - parameters: [] + - Agents + summary: Create a new session for an agent. + description: Create a new session for an agent. + operationId: create_agent_session_v1alpha_agents___agent_id___session_post + parameters: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to create the session for. + title: Agent Id + description: The ID of the agent to create the session for. requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/RegisterModelRequest' - required: true - deprecated: false - /v1/models/{model_id}: - get: + $ref: '#/components/schemas/CreateAgentSessionRequest' responses: '200': - description: A Model. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Model' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Models - summary: Get model. - description: >- - Get model. - - Get a model by its identifier. - - :param model_id: The identifier of the model to get. - :returns: A Model. - parameters: - - name: model_id - description: The identifier of the model to get. - required: true - schema: - type: string - in: path - deprecated: false - delete: - responses: - '200': - description: OK + $ref: '#/components/schemas/AgentSessionCreateResponse' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Models - summary: Unregister model. - description: >- - Unregister model. - - Unregister a model. - - :param model_id: The identifier of the model to unregister. - parameters: - - name: model_id - description: >- - The identifier of the model to unregister. - required: true - schema: - type: string - in: path - deprecated: false - /v1/moderations: - post: - responses: - '200': - description: A moderation object. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ModerationObject' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session/{{session_id}}: + delete: tags: - - Safety - summary: Create moderation. - description: >- - Create moderation. - - Classifies if text and/or image inputs are potentially harmful. - :param input: Input (or inputs) to classify. - Can be a single string, an array of strings, or an array of multi-modal - input objects similar to other models. - :param model: (Optional) The content moderation model you would like - to use. - :returns: A moderation object. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RunModerationRequest' + - Agents + summary: Delete an agent session. + description: Delete an agent session by its ID. + operationId: delete_agents_session_v1alpha_agents___agent_id___session___session_id___delete + parameters: + - name: agent_id + in: path required: true - deprecated: false - /v1/prompts: - get: + schema: + type: string + description: The ID of the agent to delete the session for. + title: Agent Id + description: The ID of the agent to delete the session for. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to delete. + title: Session Id + description: The ID of the session to delete. responses: - '200': - description: >- - A ListPromptsResponse containing all prompts. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ListPromptsResponse' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Prompts - summary: List all prompts. - description: >- - List all prompts. - - :returns: A ListPromptsResponse containing all prompts. - parameters: [] - deprecated: false - post: - responses: - '200': - description: The created Prompt resource. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/Prompt' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Prompts - summary: Create prompt. - description: >- - Create prompt. - - Create a new prompt. - - :param prompt: The prompt text content with variable placeholders. - :param variables: List of variable names that can be used in the prompt - template. - :returns: The created Prompt resource. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreatePromptRequest' - required: true - deprecated: false - /v1/prompts/{prompt_id}: - get: - responses: - '200': - description: A Prompt resource. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/Prompt' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: tags: - - Prompts - summary: Get prompt. - description: >- - Get prompt. - - Get a prompt by its identifier and optional version. - - :param prompt_id: The identifier of the prompt to get. - :param version: The version of the prompt to get (defaults to latest). - :returns: A Prompt resource. + - Agents + summary: Retrieve an agent session. + description: Retrieve an agent session by its ID. + operationId: get_agents_session_v1alpha_agents___agent_id___session___session_id___get parameters: - - name: prompt_id - description: The identifier of the prompt to get. - required: true - schema: - type: string - in: path - - name: version - description: >- - The version of the prompt to get (defaults to latest). - required: false - schema: - type: integer - in: query - deprecated: false - post: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to get the session for. + title: Agent Id + description: The ID of the agent to get the session for. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to get. + title: Session Id + description: The ID of the session to get. + - name: turn_ids + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + - type: 'null' + description: List of turn IDs to filter the session by. + title: Turn Ids + description: List of turn IDs to filter the session by. responses: '200': - description: >- - The updated Prompt resource with incremented version. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Prompt' + $ref: '#/components/schemas/Session' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session/{{session_id}}/turn: + post: tags: - - Prompts - summary: Update prompt. - description: >- - Update prompt. - - Update an existing prompt (increments version). - - :param prompt_id: The identifier of the prompt to update. - :param prompt: The updated prompt text content. - :param version: The current version of the prompt being updated. - :param variables: Updated list of variable names that can be used - in the prompt template. - :param set_as_default: Set the new version as the default (default=True). - :returns: The updated Prompt resource with incremented version. + - Agents + summary: Create a new turn for an agent. + description: Create a new turn for an agent. + operationId: create_agent_turn_v1alpha_agents___agent_id___session___session_id___turn_post parameters: - - name: prompt_id - description: The identifier of the prompt to update. - required: true - schema: - type: string - in: path + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to create the turn for. + title: Agent Id + description: The ID of the agent to create the turn for. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to create the turn for. + title: Session Id + description: The ID of the session to create the turn for. requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/UpdatePromptRequest' - required: true - deprecated: false - delete: + $ref: '#/components/schemas/AgentTurnCreateRequest' responses: '200': - description: OK + description: Successful Response + content: + application/json: + schema: {} '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session/{{session_id}}/turn/{{turn_id}}: + get: tags: - - Prompts - summary: Delete prompt. - description: >- - Delete prompt. - - Delete a prompt. - - :param prompt_id: The identifier of the prompt to delete. + - Agents + summary: Retrieve an agent turn. + description: Retrieve an agent turn by its ID. + operationId: get_agents_turn_v1alpha_agents___agent_id___session___session_id___turn___turn_id___get parameters: - - name: prompt_id - description: The identifier of the prompt to delete. - required: true - schema: - type: string - in: path - deprecated: false - /v1/prompts/{prompt_id}/set-default-version: - post: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to get the turn for. + title: Agent Id + description: The ID of the agent to get the turn for. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to get the turn for. + title: Session Id + description: The ID of the session to get the turn for. + - name: turn_id + in: path + required: true + schema: + type: string + description: The ID of the turn to get. + title: Turn Id + description: The ID of the turn to get. responses: '200': - description: >- - The prompt with the specified version now set as default. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Prompt' + $ref: '#/components/schemas/Turn' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session/{{session_id}}/turn/{{turn_id}}/resume: + post: tags: - - Prompts - summary: Set prompt version. - description: >- - Set prompt version. - - Set which version of a prompt should be the default in get_prompt (latest). - - :param prompt_id: The identifier of the prompt. - :param version: The version to set as default. - :returns: The prompt with the specified version now set as default. + - Agents + summary: Resume an agent turn. + description: Resume an agent turn with executed tool call responses. + operationId: resume_agent_turn_v1alpha_agents___agent_id___session___session_id___turn___turn_id___resume_post parameters: - - name: prompt_id - description: The identifier of the prompt. - required: true - schema: - type: string - in: path + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to resume. + title: Agent Id + description: The ID of the agent to resume. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to resume. + title: Session Id + description: The ID of the session to resume. + - name: turn_id + in: path + required: true + schema: + type: string + description: The ID of the turn to resume. + title: Turn Id + description: The ID of the turn to resume. requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/SetDefaultVersionRequest' - required: true - deprecated: false - /v1/prompts/{prompt_id}/versions: - get: + $ref: '#/components/schemas/AgentTurnResumeRequest' responses: '200': - description: >- - A ListPromptsResponse containing all versions of the prompt. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/ListPromptsResponse' + schema: {} '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Prompts - summary: List prompt versions. - description: >- - List prompt versions. - - List all versions of a specific prompt. - - :param prompt_id: The identifier of the prompt to list versions for. - :returns: A ListPromptsResponse containing all versions of the prompt. - parameters: - - name: prompt_id - description: >- - The identifier of the prompt to list versions for. - required: true - schema: - type: string - in: path - deprecated: false - /v1/providers: - get: - responses: - '200': - description: >- - A ListProvidersResponse containing information about all providers. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ListProvidersResponse' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: List providers. - description: >- - List providers. - - List all available providers. - - :returns: A ListProvidersResponse containing information about all - providers. - parameters: [] - deprecated: false - /v1/providers/{provider_id}: - get: - responses: - '200': - description: >- - A ProviderInfo object containing the provider's details. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/ProviderInfo' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Providers - summary: Get provider. - description: >- - Get provider. - - Get detailed information about a specific provider. - - :param provider_id: The ID of the provider to inspect. - :returns: A ProviderInfo object containing the provider's details. - parameters: - - name: provider_id - description: The ID of the provider to inspect. - required: true - schema: - type: string - in: path - deprecated: false - /v1/responses: - get: - responses: - '200': - description: A ListOpenAIResponseObject. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIResponseObject' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: List all responses. - description: >- - List all responses. - - :param after: The ID of the last response to return. - :param limit: The number of responses to return. - :param model: The model to filter responses by. - :param order: The order to sort responses by when sorted by created_at - ('asc' or 'desc'). - :returns: A ListOpenAIResponseObject. - parameters: - - name: after - description: The ID of the last response to return. - required: false - schema: - type: string - in: query - - name: limit - description: The number of responses to return. - required: false - schema: - type: integer - in: query - - name: model - description: The model to filter responses by. - required: false - schema: - type: string - in: query - - name: order - description: >- - The order to sort responses by when sorted by created_at ('asc' or 'desc'). - required: false - schema: - $ref: '#/components/schemas/Order' - in: query - deprecated: false - post: - responses: - '200': - description: An OpenAIResponseObject. + description: An unexpected error occurred. content: application/json: schema: - $ref: '#/components/schemas/OpenAIResponseObject' - text/event-stream: - schema: - $ref: '#/components/schemas/AsyncIterator' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/session/{{session_id}}/turn/{{turn_id}}/step/{{step_id}}: + get: tags: - - Agents - summary: Create a model response. - description: >- - Create a model response. - - :param input: Input message(s) to create the response. - :param model: The underlying LLM used for completions. - :param previous_response_id: (Optional) if specified, the new response - will be a continuation of the previous response. This can be used to easily - fork-off new responses from existing responses. - :param conversation: (Optional) The ID of a conversation to add the - response to. Must begin with 'conv_'. Input and output messages will be automatically - added to the conversation. - :param include: (Optional) Additional fields to include in the response. - :param guardrails: (Optional) List of guardrails to apply during response - generation. Can be guardrail IDs (strings) or guardrail specifications. - :returns: An OpenAIResponseObject. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateOpenaiResponseRequest' + - Agents + summary: Retrieve an agent step. + description: Retrieve an agent step by its ID. + operationId: get_agents_step_v1alpha_agents___agent_id___session___session_id___turn___turn_id___step___step_id___get + parameters: + - name: agent_id + in: path required: true - deprecated: false - x-llama-stack-extra-body-params: - - name: guardrails - schema: - id: Annotated - description: >- - List of guardrails to apply during response generation. Guardrails provide - safety and content moderation. - required: true - /v1/responses/{response_id}: - get: + schema: + type: string + description: The ID of the agent to get the step for. + title: Agent Id + description: The ID of the agent to get the step for. + - name: session_id + in: path + required: true + schema: + type: string + description: The ID of the session to get the step for. + title: Session Id + description: The ID of the session to get the step for. + - name: turn_id + in: path + required: true + schema: + type: string + description: The ID of the turn to get the step for. + title: Turn Id + description: The ID of the turn to get the step for. + - name: step_id + in: path + required: true + schema: + type: string + description: The ID of the step to get. + title: Step Id + description: The ID of the step to get. responses: '200': - description: An OpenAIResponseObject. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAIResponseObject' + $ref: '#/components/schemas/AgentStepResponse' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: Get a model response. - description: >- - Get a model response. - - :param response_id: The ID of the OpenAI response to retrieve. - :returns: An OpenAIResponseObject. - parameters: - - name: response_id - description: >- - The ID of the OpenAI response to retrieve. - required: true - schema: - type: string - in: path - deprecated: false - delete: - responses: - '200': - description: An OpenAIDeleteResponseObject + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/OpenAIDeleteResponseObject' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Agents - summary: Delete a response. - description: >- - Delete a response. - - :param response_id: The ID of the OpenAI response to delete. - :returns: An OpenAIDeleteResponseObject - parameters: - - name: response_id - description: The ID of the OpenAI response to delete. - required: true - schema: - type: string - in: path - deprecated: false - /v1/responses/{response_id}/input_items: - get: - responses: - '200': - description: An ListOpenAIResponseInputItem. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIResponseInputItem' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/agents/{{agent_id}}/sessions: + get: tags: - - Agents - summary: List input items. - description: >- - List input items. - - :param response_id: The ID of the response to retrieve input items for. - :param after: An item ID to list items after, used for pagination. - :param before: An item ID to list items before, used for pagination. - :param include: Additional fields to include in the response. - :param limit: A limit on the number of objects to be returned. Limit - can range between 1 and 100, and the default is 20. - :param order: The order to return the input items in. Default is desc. - :returns: An ListOpenAIResponseInputItem. + - Agents + summary: List all sessions of an agent. + description: List all session(s) of a given agent. + operationId: list_agent_sessions_v1alpha_agents___agent_id___sessions_get parameters: - - name: response_id - description: >- - The ID of the response to retrieve input items for. - required: true - schema: - type: string - in: path - - name: after - description: >- - An item ID to list items after, used for pagination. - required: false - schema: - type: string - in: query - - name: before - description: >- - An item ID to list items before, used for pagination. - required: false - schema: - type: string - in: query - - name: include - description: >- - Additional fields to include in the response. - required: false - schema: - $ref: '#/components/schemas/list' - in: query - - name: limit - description: >- - A limit on the number of objects to be returned. Limit can range between - 1 and 100, and the default is 20. - required: false - schema: - type: integer - in: query - - name: order - description: >- - The order to return the input items in. Default is desc. - required: false - schema: - $ref: '#/components/schemas/Order' - in: query - deprecated: false - /v1/safety/run-shield: - post: + - name: agent_id + in: path + required: true + schema: + type: string + description: The ID of the agent to list sessions for. + title: Agent Id + description: The ID of the agent to list sessions for. + - name: start_index + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The index to start the pagination from. + title: Start Index + description: The index to start the pagination from. + - name: limit + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The number of sessions to return. + title: Limit + description: The number of sessions to return. responses: '200': - description: A RunShieldResponse. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/RunShieldResponse' + schema: {} '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - Safety - summary: Run shield. - description: >- - Run shield. - - Run a shield. - - :param shield_id: The identifier of the shield to run. - :param messages: The messages to run the shield on. - :param params: The parameters of the shield. - :returns: A RunShieldResponse. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RunShieldRequest' - required: true - deprecated: false - /v1/scoring-functions: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks: get: + tags: + - Benchmarks + summary: List all benchmarks + description: List all benchmarks + operationId: list_benchmarks_v1alpha_eval_benchmarks_get responses: '200': - description: A ListScoringFunctionsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListScoringFunctionsResponse' + $ref: '#/components/schemas/ListBenchmarksResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - ScoringFunctions - summary: List all scoring functions. - description: >- - List all scoring functions. - - :returns: A ListScoringFunctionsResponse. - parameters: [] - deprecated: false + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: - responses: - '200': - description: OK - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' tags: - - ScoringFunctions - summary: Register a scoring function. - description: >- - Register a scoring function. - - :param scoring_fn_id: The ID of the scoring function to register. - :param description: The description of the scoring function. - :param return_type: The return type of the scoring function. - :param provider_scoring_fn_id: The ID of the provider scoring function - to use for the scoring function. - :param provider_id: The ID of the provider to use for the scoring - function. - :param params: The parameters for the scoring function for benchmark - eval, these can be overridden for app eval. - parameters: [] + - Benchmarks + summary: Register a benchmark + description: Register a benchmark + operationId: register_benchmark_v1alpha_eval_benchmarks_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/RegisterScoringFunctionRequest' + $ref: '#/components/schemas/RegisterBenchmarkRequest' required: true - deprecated: false - /v1/scoring-functions/{scoring_fn_id}: - get: responses: - '200': - description: A ScoringFn. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ScoringFn' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - ScoringFunctions - summary: Get a scoring function by its ID. - description: >- - Get a scoring function by its ID. - - :param scoring_fn_id: The ID of the scoring function to get. - :returns: A ScoringFn. - parameters: - - name: scoring_fn_id - description: The ID of the scoring function to get. - required: true - schema: - type: string - in: path - deprecated: false + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks/{{benchmark_id}}: delete: - responses: - '200': - description: OK - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' tags: - - ScoringFunctions - summary: Unregister a scoring function. - description: >- - Unregister a scoring function. - - :param scoring_fn_id: The ID of the scoring function to unregister. + - Benchmarks + summary: Unregister a benchmark + description: Unregister a benchmark + operationId: unregister_benchmark_v1alpha_eval_benchmarks___benchmark_id___delete parameters: - - name: scoring_fn_id - description: >- - The ID of the scoring function to unregister. - required: true - schema: - type: string - in: path - deprecated: false - /v1/scoring/score: - post: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to unregister + title: Benchmark Id + description: The ID of the benchmark to unregister responses: - '200': - description: >- - A ScoreResponse object containing rows and aggregated results. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ScoreResponse' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: tags: - - Scoring - summary: Score a list of rows. - description: >- - Score a list of rows. - - :param input_rows: The rows to score. - :param scoring_functions: The scoring functions to use for the scoring. - :returns: A ScoreResponse object containing rows and aggregated results. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ScoreRequest' + - Benchmarks + summary: Get a benchmark by its ID + description: Get a benchmark by its ID + operationId: get_benchmark_v1alpha_eval_benchmarks___benchmark_id___get + parameters: + - name: benchmark_id + in: path required: true - deprecated: false - /v1/scoring/score-batch: - post: + schema: + type: string + description: The ID of the benchmark to get + title: Benchmark Id + description: The ID of the benchmark to get responses: '200': - description: A ScoreBatchResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ScoreBatchResponse' + $ref: '#/components/schemas/Benchmark' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks/{{benchmark_id}}/evaluations: + post: tags: - - Scoring - summary: Score a batch of rows. - description: >- - Score a batch of rows. - - :param dataset_id: The ID of the dataset to score. - :param scoring_functions: The scoring functions to use for the scoring. - :param save_results_dataset: Whether to save the results to a dataset. - :returns: A ScoreBatchResponse. - parameters: [] + - Eval + summary: Evaluate a list of rows on a benchmark + description: Evaluate a list of rows on a benchmark + operationId: evaluate_rows_v1alpha_eval_benchmarks___benchmark_id___evaluations_post + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/ScoreBatchRequest' - required: true - deprecated: false - /v1/shields: - get: + $ref: '#/components/schemas/EvaluateRowsRequest' responses: '200': - description: A ListShieldsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListShieldsResponse' + $ref: '#/components/schemas/EvaluateResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Shields - summary: List all shields. - description: >- - List all shields. - - :returns: A ListShieldsResponse. - parameters: [] - deprecated: false - post: - responses: - '200': - description: A Shield. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/Shield' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks/{{benchmark_id}}/jobs: + post: tags: - - Shields - summary: Register a shield. - description: >- - Register a shield. - - :param shield_id: The identifier of the shield to register. - :param provider_shield_id: The identifier of the shield in the provider. - :param provider_id: The identifier of the provider. - :param params: The parameters of the shield. - :returns: A Shield. - parameters: [] + - Eval + summary: Run an evaluation on a benchmark + description: Run an evaluation on a benchmark + operationId: run_eval_v1alpha_eval_benchmarks___benchmark_id___jobs_post + parameters: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/RegisterShieldRequest' - required: true - deprecated: false - /v1/shields/{identifier}: - get: + $ref: '#/components/schemas/BenchmarkConfig' responses: '200': - description: A Shield. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Shield' + $ref: '#/components/schemas/Job' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks/{{benchmark_id}}/jobs/{{job_id}}: + delete: tags: - - Shields - summary: Get a shield by its identifier. - description: >- - Get a shield by its identifier. - - :param identifier: The identifier of the shield to get. - :returns: A Shield. + - Eval + summary: Cancel a job + description: Cancel a job + operationId: job_cancel_v1alpha_eval_benchmarks___benchmark_id___jobs___job_id___delete parameters: - - name: identifier - description: The identifier of the shield to get. - required: true - schema: - type: string - in: path - deprecated: false - delete: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on + - name: job_id + in: path + required: true + schema: + type: string + description: The ID of the job to cancel + title: Job Id + description: The ID of the job to cancel responses: - '200': - description: OK + '204': + description: Successful Response '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: tags: - - Shields - summary: Unregister a shield. - description: >- - Unregister a shield. - - :param identifier: The identifier of the shield to unregister. + - Eval + summary: Get the status of a job + description: Get the status of a job + operationId: job_status_v1alpha_eval_benchmarks___benchmark_id___jobs___job_id___get parameters: - - name: identifier - description: >- - The identifier of the shield to unregister. - required: true - schema: - type: string - in: path - deprecated: false - /v1/tool-runtime/invoke: - post: + - name: benchmark_id + in: path + required: true + schema: + type: string + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on + - name: job_id + in: path + required: true + schema: + type: string + description: The ID of the job to get the status of + title: Job Id + description: The ID of the job to get the status of responses: '200': - description: A ToolInvocationResult. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ToolInvocationResult' + $ref: '#/components/schemas/Job' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/eval/benchmarks/{{benchmark_id}}/jobs/{{job_id}}/result: + get: tags: - - ToolRuntime - summary: Run a tool with the given arguments. - description: >- - Run a tool with the given arguments. - - :param tool_name: The name of the tool to invoke. - :param kwargs: A dictionary of arguments to pass to the tool. - :returns: A ToolInvocationResult. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/InvokeToolRequest' + - Eval + summary: Get the result of a job + description: Get the result of a job + operationId: job_result_v1alpha_eval_benchmarks___benchmark_id___jobs___job_id___result_get + parameters: + - name: benchmark_id + in: path required: true - deprecated: false - /v1/tool-runtime/list-tools: - get: + schema: + type: string + description: The ID of the benchmark to run the evaluation on + title: Benchmark Id + description: The ID of the benchmark to run the evaluation on + - name: job_id + in: path + required: true + schema: + type: string + description: The ID of the job to get the result of + title: Job Id + description: The ID of the job to get the result of responses: '200': - description: A ListToolDefsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListToolDefsResponse' + $ref: '#/components/schemas/EvaluateResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - ToolRuntime - summary: List all tools in the runtime. - description: >- - List all tools in the runtime. - - :param tool_group_id: The ID of the tool group to list tools for. - :param mcp_endpoint: The MCP endpoint to use for the tool group. - :returns: A ListToolDefsResponse. - parameters: - - name: tool_group_id - description: >- - The ID of the tool group to list tools for. - required: false - schema: - type: string - in: query - - name: mcp_endpoint - description: >- - The MCP endpoint to use for the tool group. - required: false - schema: - $ref: '#/components/schemas/URL' - in: query - deprecated: false - /v1/tool-runtime/rag-tool/insert: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/inference/rerank: post: - responses: - '200': - description: OK - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' tags: - - ToolRuntime - summary: >- - Index documents so they can be used by the RAG system. - description: >- - Index documents so they can be used by the RAG system. - - :param documents: List of documents to index in the RAG system - :param vector_store_id: ID of the vector database to store the document - embeddings - :param chunk_size_in_tokens: (Optional) Size in tokens for document - chunking during indexing - parameters: [] + - Inference + summary: Rerank a list of documents. + description: Rerank a list of documents based on their relevance to a query. + operationId: rerank_v1alpha_inference_rerank_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/InsertRequest' + $ref: '#/components/schemas/Body_rerank_v1alpha_inference_rerank_post' required: true - deprecated: false - /v1/tool-runtime/rag-tool/query: - post: responses: '200': - description: >- - RAGQueryResult containing the retrieved content and metadata + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/RAGQueryResult' + $ref: '#/components/schemas/RerankResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/post-training/job/artifacts: + get: tags: - - ToolRuntime - summary: >- - Query the RAG system for context; typically invoked by the agent. - description: >- - Query the RAG system for context; typically invoked by the agent. - - :param content: The query content to search for in the indexed documents - :param vector_store_ids: List of vector database IDs to search within - :param query_config: (Optional) Configuration parameters for the query - operation - :returns: RAGQueryResult containing the retrieved content and metadata - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QueryRequest' + - Post Training + summary: Get the artifacts of a training job + description: Get the artifacts of a training job + operationId: get_training_job_artifacts_v1alpha_post_training_job_artifacts_get + parameters: + - name: job_uuid + in: query required: true - deprecated: false - /v1/toolgroups: - get: + schema: + type: string + description: The UUID of the job to get the artifacts of + title: Job Uuid + description: The UUID of the job to get the artifacts of responses: '200': - description: A ListToolGroupsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListToolGroupsResponse' + $ref: '#/components/schemas/PostTrainingJobArtifactsResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - ToolGroups - summary: List tool groups with optional provider. - description: >- - List tool groups with optional provider. - - :returns: A ListToolGroupsResponse. - parameters: [] - deprecated: false + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/post-training/job/cancel: post: + tags: + - Post Training + summary: Cancel a training job + description: Cancel a training job + operationId: cancel_training_job_v1alpha_post_training_job_cancel_post + parameters: + - name: job_uuid + in: query + required: true + schema: + type: string + description: The UUID of the job to cancel + title: Job Uuid + description: The UUID of the job to cancel responses: - '200': - description: OK + '204': + description: Successful Response '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/post-training/job/status: + get: tags: - - ToolGroups - summary: Register a tool group. - description: >- - Register a tool group. - - :param toolgroup_id: The ID of the tool group to register. - :param provider_id: The ID of the provider to use for the tool group. - :param mcp_endpoint: The MCP endpoint to use for the tool group. - :param args: A dictionary of arguments to pass to the tool group. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterToolGroupRequest' + - Post Training + summary: Get the status of a training job + description: Get the status of a training job + operationId: get_training_job_status_v1alpha_post_training_job_status_get + parameters: + - name: job_uuid + in: query required: true - deprecated: false - /v1/toolgroups/{toolgroup_id}: - get: + schema: + type: string + description: The UUID of the job to get the status of + title: Job Uuid + description: The UUID of the job to get the status of responses: '200': - description: A ToolGroup. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ToolGroup' + $ref: '#/components/schemas/PostTrainingJobStatusResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - ToolGroups - summary: Get a tool group by its ID. - description: >- - Get a tool group by its ID. - - :param toolgroup_id: The ID of the tool group to get. - :returns: A ToolGroup. - parameters: - - name: toolgroup_id - description: The ID of the tool group to get. - required: true - schema: - type: string - in: path - deprecated: false - delete: - responses: - '200': - description: OK - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - ToolGroups - summary: Unregister a tool group. - description: >- - Unregister a tool group. - - :param toolgroup_id: The ID of the tool group to unregister. - parameters: - - name: toolgroup_id - description: The ID of the tool group to unregister. - required: true - schema: - type: string - in: path - deprecated: false - /v1/tools: - get: - responses: - '200': - description: A ListToolDefsResponse. + description: An unexpected error occurred. content: application/json: schema: - $ref: '#/components/schemas/ListToolDefsResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - ToolGroups - summary: List tools with optional tool group. - description: >- - List tools with optional tool group. - - :param toolgroup_id: The ID of the tool group to list tools for. - :returns: A ListToolDefsResponse. - parameters: - - name: toolgroup_id - description: >- - The ID of the tool group to list tools for. - required: false - schema: - type: string - in: query - deprecated: false - /v1/tools/{tool_name}: + $ref: '#/components/schemas/Error' + /v1alpha/post-training/jobs: get: + tags: + - Post Training + summary: Get all training jobs + description: Get all training jobs + operationId: get_training_jobs_v1alpha_post_training_jobs_get responses: '200': - description: A ToolDef. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ToolDef' + $ref: '#/components/schemas/ListPostTrainingJobsResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - ToolGroups - summary: Get a tool by its name. - description: >- - Get a tool by its name. - - :param tool_name: The name of the tool to get. - :returns: A ToolDef. - parameters: - - name: tool_name - description: The name of the tool to get. - required: true - schema: - type: string - in: path - deprecated: false - /v1/vector-io/insert: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/post-training/preference-optimize: post: - responses: - '200': - description: OK - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' tags: - - VectorIO - summary: Insert chunks into a vector database. - description: >- - Insert chunks into a vector database. - - :param vector_store_id: The identifier of the vector database to insert the - chunks into. - :param chunks: The chunks to insert. Each `Chunk` should contain content - which can be interleaved text, images, or other types. - `metadata`: `dict[str, Any]` and `embedding`: `List[float]` are - optional. - If `metadata` is provided, you configure how Llama Stack formats - the chunk during generation. - If `embedding` is not provided, it will be computed later. - :param ttl_seconds: The time to live of the chunks. - parameters: [] + - Post Training + summary: Run preference optimization of a model + description: Run preference optimization of a model + operationId: preference_optimize_v1alpha_post_training_preference_optimize_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/InsertChunksRequest' + $ref: '#/components/schemas/PreferenceOptimizeRequest' required: true - deprecated: false - /v1/vector-io/query: - post: responses: '200': - description: A QueryChunksResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/QueryChunksResponse' + $ref: '#/components/schemas/PostTrainingJob' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1alpha/post-training/supervised-fine-tune: + post: tags: - - VectorIO - summary: Query chunks from a vector database. - description: >- - Query chunks from a vector database. - - :param vector_store_id: The identifier of the vector database to query. - :param query: The query to search for. - :param params: The parameters of the query. - :returns: A QueryChunksResponse. - parameters: [] + - Post Training + summary: Run supervised fine-tuning of a model + description: Run supervised fine-tuning of a model + operationId: supervised_fine_tune_v1alpha_post_training_supervised_fine_tune_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/QueryChunksRequest' + $ref: '#/components/schemas/SupervisedFineTuneRequest' required: true - deprecated: false - /v1/vector_stores: - get: responses: '200': - description: >- - A VectorStoreListResponse containing the list of vector stores. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VectorStoreListResponse' + $ref: '#/components/schemas/PostTrainingJob' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/batches: + get: tags: - - VectorIO - summary: Returns a list of vector stores. - description: >- - Returns a list of vector stores. - - :param limit: A limit on the number of objects to be returned. Limit can range - between 1 and 100, and the default is 20. - :param order: Sort order by the `created_at` timestamp of the objects. - `asc` for ascending order and `desc` for descending order. - :param after: A cursor for use in pagination. `after` is an object - ID that defines your place in the list. - :param before: A cursor for use in pagination. `before` is an object - ID that defines your place in the list. - :returns: A VectorStoreListResponse containing the list of vector - stores. + - Batches + summary: List all batches for the current user. + description: List all batches for the current user. + operationId: list_batches_v1_batches_get parameters: - - name: limit - description: >- - A limit on the number of objects to be returned. Limit can range between - 1 and 100, and the default is 20. - required: false - schema: - type: integer - in: query - - name: order - description: >- - Sort order by the `created_at` timestamp of the objects. `asc` for ascending - order and `desc` for descending order. - required: false - schema: - type: string - in: query - - name: after - description: >- - A cursor for use in pagination. `after` is an object ID that defines your - place in the list. - required: false - schema: - type: string - in: query - - name: before - description: >- - A cursor for use in pagination. `before` is an object ID that defines - your place in the list. - required: false - schema: - type: string - in: query - deprecated: false - post: + - name: after + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: A cursor for pagination; returns batches after this batch ID. + title: After + description: A cursor for pagination; returns batches after this batch ID. + - name: limit + in: query + required: false + schema: + type: integer + maximum: 100 + minimum: 1 + description: Number of batches to return (default 20, max 100). + default: 20 + title: Limit + description: Number of batches to return (default 20, max 100). responses: '200': - description: >- - A VectorStoreObject representing the created vector store. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VectorStoreObject' + $ref: '#/components/schemas/ListBatchesResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - VectorIO - summary: Creates a vector store. - description: >- - Creates a vector store. - - Generate an OpenAI-compatible vector store with the given parameters. - :returns: A VectorStoreObject representing the created vector store. - parameters: [] + - Batches + summary: Create a new batch for processing multiple API requests. + description: Create a new batch for processing multiple API requests. + operationId: create_batch_v1_batches_post requestBody: + required: true content: application/json: schema: - id: Annotated - required: true - deprecated: false - /v1/vector_stores/{vector_store_id}: - get: + $ref: '#/components/schemas/CreateBatchRequest' responses: '200': - description: >- - A VectorStoreObject representing the vector store. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VectorStoreObject' + $ref: '#/components/schemas/Batch' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: Retrieves a vector store. - description: >- - Retrieves a vector store. - - :param vector_store_id: The ID of the vector store to retrieve. - :returns: A VectorStoreObject representing the vector store. - parameters: - - name: vector_store_id - description: The ID of the vector store to retrieve. - required: true - schema: - type: string - in: path - deprecated: false - post: - responses: - '200': - description: >- - A VectorStoreObject representing the updated vector store. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreObject' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/batches/{batch_id}: + get: tags: - - VectorIO - summary: Updates a vector store. - description: >- - Updates a vector store. - - :param vector_store_id: The ID of the vector store to update. - :param name: The name of the vector store. - :param expires_after: The expiration policy for a vector store. - :param metadata: Set of 16 key-value pairs that can be attached to - an object. - :returns: A VectorStoreObject representing the updated vector store. + - Batches + summary: Retrieve information about a specific batch. + description: Retrieve information about a specific batch. + operationId: retrieve_batch_v1_batches__batch_id__get parameters: - - name: vector_store_id - description: The ID of the vector store to update. - required: true - schema: - type: string - in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenaiUpdateVectorStoreRequest' + - name: batch_id + in: path required: true - deprecated: false - delete: + schema: + type: string + description: The ID of the batch to retrieve. + title: Batch Id + description: The ID of the batch to retrieve. responses: '200': - description: >- - A VectorStoreDeleteResponse indicating the deletion status. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VectorStoreDeleteResponse' + $ref: '#/components/schemas/Batch' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: Delete a vector store. - description: >- - Delete a vector store. - - :param vector_store_id: The ID of the vector store to delete. - :returns: A VectorStoreDeleteResponse indicating the deletion status. - parameters: - - name: vector_store_id - description: The ID of the vector store to delete. - required: true - schema: - type: string - in: path - deprecated: false - /v1/vector_stores/{vector_store_id}/file_batches: - post: - responses: - '200': - description: >- - A VectorStoreFileBatchObject representing the created file batch. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileBatchObject' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/batches/{batch_id}/cancel: + post: tags: - - VectorIO - summary: Create a vector store file batch. - description: >- - Create a vector store file batch. - - Generate an OpenAI-compatible vector store file batch for the given vector - store. - :param vector_store_id: The ID of the vector store to create the file - batch for. - :returns: A VectorStoreFileBatchObject representing the created file - batch. + - Batches + summary: Cancel a batch that is in progress. + description: Cancel a batch that is in progress. + operationId: cancel_batch_v1_batches__batch_id__cancel_post parameters: - - name: vector_store_id - description: >- - The ID of the vector store to create the file batch for. - required: true - schema: - type: string - in: path - requestBody: - content: - application/json: - schema: - id: Annotated + - name: batch_id + in: path required: true - deprecated: false - /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: - get: + schema: + type: string + description: The ID of the batch to cancel. + title: Batch Id + description: The ID of the batch to cancel. responses: '200': - description: >- - A VectorStoreFileBatchObject representing the file batch. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileBatchObject' + $ref: '#/components/schemas/Batch' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: Retrieve a vector store file batch. - description: >- - Retrieve a vector store file batch. - - :param batch_id: The ID of the file batch to retrieve. - :param vector_store_id: The ID of the vector store containing the - file batch. - :returns: A VectorStoreFileBatchObject representing the file batch. - parameters: - - name: batch_id - description: The ID of the file batch to retrieve. - required: true - schema: - type: string - in: path - - name: vector_store_id - description: >- - The ID of the vector store containing the file batch. - required: true - schema: - type: string - in: path - deprecated: false - /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: - post: - responses: - '200': - description: >- - A VectorStoreFileBatchObject representing the cancelled file batch. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileBatchObject' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: Cancels a vector store file batch. - description: >- - Cancels a vector store file batch. - - :param batch_id: The ID of the file batch to cancel. - :param vector_store_id: The ID of the vector store containing the - file batch. - :returns: A VectorStoreFileBatchObject representing the cancelled - file batch. - parameters: - - name: batch_id - description: The ID of the file batch to cancel. - required: true - schema: - type: string - in: path - - name: vector_store_id - description: >- - The ID of the vector store containing the file batch. - required: true - schema: - type: string - in: path - deprecated: false - /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: - get: - responses: - '200': - description: >- - A VectorStoreFilesListInBatchResponse containing the list of files in - the batch. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFilesListInBatchResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: >- - Returns a list of vector store files in a batch. - description: >- - Returns a list of vector store files in a batch. - - :param batch_id: The ID of the file batch to list files from. - :param vector_store_id: The ID of the vector store containing the - file batch. - :param after: A cursor for use in pagination. `after` is an object - ID that defines your place in the list. - :param before: A cursor for use in pagination. `before` is an object - ID that defines your place in the list. - :param filter: Filter by file status. One of in_progress, completed, - failed, cancelled. - :param limit: A limit on the number of objects to be returned. Limit - can range between 1 and 100, and the default is 20. - :param order: Sort order by the `created_at` timestamp of the objects. - `asc` for ascending order and `desc` for descending order. - :returns: A VectorStoreFilesListInBatchResponse containing the list - of files in the batch. - parameters: - - name: batch_id - description: >- - The ID of the file batch to list files from. - required: true - schema: - type: string - in: path - - name: vector_store_id - description: >- - The ID of the vector store containing the file batch. - required: true - schema: - type: string - in: path - - name: after - description: >- - A cursor for use in pagination. `after` is an object ID that defines your - place in the list. - required: false - schema: - type: string - in: query - - name: before - description: >- - A cursor for use in pagination. `before` is an object ID that defines - your place in the list. - required: false - schema: - type: string - in: query - - name: filter - description: >- - Filter by file status. One of in_progress, completed, failed, cancelled. - required: false - schema: - type: string - in: query - - name: limit - description: >- - A limit on the number of objects to be returned. Limit can range between - 1 and 100, and the default is 20. - required: false - schema: - type: integer - in: query - - name: order - description: >- - Sort order by the `created_at` timestamp of the objects. `asc` for ascending - order and `desc` for descending order. - required: false - schema: - type: string - in: query - deprecated: false - /v1/vector_stores/{vector_store_id}/files: - get: - responses: - '200': - description: >- - A VectorStoreListFilesResponse containing the list of files. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreListFilesResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/chat/completions: + get: tags: - - VectorIO - summary: List files in a vector store. - description: >- - List files in a vector store. - - :param vector_store_id: The ID of the vector store to list files from. - :param limit: (Optional) A limit on the number of objects to be returned. - Limit can range between 1 and 100, and the default is 20. - :param order: (Optional) Sort order by the `created_at` timestamp - of the objects. `asc` for ascending order and `desc` for descending order. - :param after: (Optional) A cursor for use in pagination. `after` is - an object ID that defines your place in the list. - :param before: (Optional) A cursor for use in pagination. `before` - is an object ID that defines your place in the list. - :param filter: (Optional) Filter by file status to only return files - with the specified status. - :returns: A VectorStoreListFilesResponse containing the list of files. + - Inference + summary: List chat completions. + description: List chat completions. + operationId: list_chat_completions_v1_chat_completions_get parameters: - - name: vector_store_id - description: >- - The ID of the vector store to list files from. - required: true - schema: - type: string - in: path - - name: limit - description: >- - (Optional) A limit on the number of objects to be returned. Limit can - range between 1 and 100, and the default is 20. - required: false - schema: - type: integer - in: query - - name: order - description: >- - (Optional) Sort order by the `created_at` timestamp of the objects. `asc` - for ascending order and `desc` for descending order. - required: false - schema: - type: string - in: query - - name: after - description: >- - (Optional) A cursor for use in pagination. `after` is an object ID that - defines your place in the list. - required: false - schema: - type: string - in: query - - name: before - description: >- - (Optional) A cursor for use in pagination. `before` is an object ID that - defines your place in the list. - required: false - schema: - type: string - in: query - - name: filter - description: >- - (Optional) Filter by file status to only return files with the specified - status. - required: false - schema: - id: Union - in: query - deprecated: false - post: + - name: after + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: The ID of the last chat completion to return. + title: After + description: The ID of the last chat completion to return. + - name: limit + in: query + required: false + schema: + anyOf: + - type: integer + - type: 'null' + description: The maximum number of chat completions to return. + default: 20 + title: Limit + description: The maximum number of chat completions to return. + - name: model + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: The model to filter by. + title: Model + description: The model to filter by. + - name: order + in: query + required: false + schema: + anyOf: + - $ref: '#/components/schemas/Order' + - type: 'null' + description: "The order to sort the chat completions by: 'asc' or 'desc'. Defaults to 'desc'." + default: desc + title: Order + description: "The order to sort the chat completions by: 'asc' or 'desc'. Defaults to 'desc'." responses: '200': - description: >- - A VectorStoreFileObject representing the attached file. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileObject' + $ref: '#/components/schemas/ListOpenAIChatCompletionResponse' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - VectorIO - summary: Attach a file to a vector store. - description: >- - Attach a file to a vector store. - - :param vector_store_id: The ID of the vector store to attach the file to. - :param file_id: The ID of the file to attach to the vector store. - :param attributes: The key-value attributes stored with the file, - which can be used for filtering. - :param chunking_strategy: The chunking strategy to use for the file. - :returns: A VectorStoreFileObject representing the attached file. - parameters: - - name: vector_store_id - description: >- - The ID of the vector store to attach the file to. - required: true - schema: - type: string - in: path + - Inference + summary: Create chat completions. + description: Create chat completions. + operationId: openai_chat_completion_v1_chat_completions_post requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/OpenaiAttachFileToVectorStoreRequest' - required: true - deprecated: false - /v1/vector_stores/{vector_store_id}/files/{file_id}: - get: + $ref: '#/components/schemas/OpenAIChatCompletionRequestWithExtraBody' responses: '200': - description: >- - A VectorStoreFileObject representing the file. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileObject' + schema: {} '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/chat/completions/{completion_id}: + get: tags: - - VectorIO - summary: Retrieves a vector store file. - description: >- - Retrieves a vector store file. - - :param vector_store_id: The ID of the vector store containing the file to - retrieve. - :param file_id: The ID of the file to retrieve. - :returns: A VectorStoreFileObject representing the file. + - Inference + summary: Get chat completion. + description: Get chat completion. + operationId: get_chat_completion_v1_chat_completions__completion_id__get parameters: - - name: vector_store_id - description: >- - The ID of the vector store containing the file to retrieve. - required: true - schema: - type: string - in: path - - name: file_id - description: The ID of the file to retrieve. - required: true - schema: - type: string - in: path - deprecated: false - post: + - name: completion_id + in: path + required: true + schema: + type: string + description: ID of the chat completion. + title: Completion Id + description: ID of the chat completion. responses: '200': - description: >- - A VectorStoreFileObject representing the updated file. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileObject' + $ref: '#/components/schemas/OpenAICompletionWithInputMessages' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/completions: + post: tags: - - VectorIO - summary: Updates a vector store file. - description: >- - Updates a vector store file. - - :param vector_store_id: The ID of the vector store containing the file to - update. - :param file_id: The ID of the file to update. - :param attributes: The updated key-value attributes to store with - the file. - :returns: A VectorStoreFileObject representing the updated file. - parameters: - - name: vector_store_id - description: >- - The ID of the vector store containing the file to update. - required: true - schema: - type: string - in: path - - name: file_id - description: The ID of the file to update. - required: true - schema: - type: string - in: path + - Inference + summary: Create completion. + description: Create completion. + operationId: openai_completion_v1_completions_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenaiUpdateVectorStoreFileRequest' + $ref: '#/components/schemas/OpenAICompletionRequestWithExtraBody' required: true - deprecated: false - delete: responses: '200': - description: >- - A VectorStoreFileDeleteResponse indicating the deletion status. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileDeleteResponse' + $ref: '#/components/schemas/OpenAICompletion' '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: Delete a vector store file. - description: >- - Delete a vector store file. - - :param vector_store_id: The ID of the vector store containing the file to - delete. - :param file_id: The ID of the file to delete. - :returns: A VectorStoreFileDeleteResponse indicating the deletion - status. - parameters: - - name: vector_store_id - description: >- - The ID of the vector store containing the file to delete. - required: true - schema: - type: string - in: path - - name: file_id - description: The ID of the file to delete. - required: true - schema: - type: string - in: path - deprecated: false - /v1/vector_stores/{vector_store_id}/files/{file_id}/content: - get: - responses: - '200': - description: >- - A list of InterleavedContent representing the file contents. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileContentsResponse' - '400': - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - VectorIO - summary: >- - Retrieves the contents of a vector store file. - description: >- - Retrieves the contents of a vector store file. - - :param vector_store_id: The ID of the vector store containing the file to - retrieve. - :param file_id: The ID of the file to retrieve. - :returns: A list of InterleavedContent representing the file contents. - parameters: - - name: vector_store_id - description: >- - The ID of the vector store containing the file to retrieve. - required: true - schema: - type: string - in: path - - name: file_id - description: The ID of the file to retrieve. - required: true - schema: - type: string - in: path - deprecated: false - /v1/vector_stores/{vector_store_id}/search: - post: - responses: - '200': - description: >- - A VectorStoreSearchResponse containing the search results. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreSearchResponsePage' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/conversations: + post: tags: - - VectorIO - summary: Search for chunks in a vector store. - description: >- - Search for chunks in a vector store. - - Searches a vector store for relevant chunks based on a query and optional - file attribute filters. - - :param vector_store_id: The ID of the vector store to search. - :param query: The query string or array for performing the search. - :param filters: Filters based on file attributes to narrow the search - results. - :param max_num_results: Maximum number of results to return (1 to - 50 inclusive, default 10). - :param ranking_options: Ranking options for fine-tuning the search - results. - :param rewrite_query: Whether to rewrite the natural language query - for vector search (default false) - :param search_mode: The search mode to use - "keyword", "vector", - or "hybrid" (default "vector") - :returns: A VectorStoreSearchResponse containing the search results. - parameters: - - name: vector_store_id - description: The ID of the vector store to search. - required: true - schema: - type: string - in: path + - Conversations + summary: Create a conversation + description: Create a conversation + operationId: create_conversation_v1_conversations_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenaiSearchVectorStoreRequest' + $ref: '#/components/schemas/ConversationCreateRequest' required: true - deprecated: false - /v1/version: - get: responses: '200': - description: >- - Version information containing the service version number. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/VersionInfo' + $ref: '#/components/schemas/Conversation' '400': - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: >- - #/components/responses/TooManyRequests429 + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: >- - #/components/responses/InternalServerError500 + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - tags: - - Inspect - summary: Get version. - description: >- - Get version. - - Get the version of the service. - - :returns: Version information containing the service version number. - parameters: [] - deprecated: false - /v1beta/datasetio/append-rows/{dataset_id}: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/conversations/{conversation_id}: + delete: tags: - - V1Beta - summary: Append rows to a dataset. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: append_rows_v1beta_datasetio_append_rows__dataset_id__post + - Conversations + summary: Delete a conversation + description: Delete a conversation with the given ID + operationId: openai_delete_conversation_v1_conversations__conversation_id__delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - - name: dataset_id + - name: conversation_id in: path required: true schema: type: string - description: 'Path parameter: dataset_id' + description: The conversation identifier + title: Conversation Id + description: The conversation identifier responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/ConversationDeletedResource' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1beta/datasetio/iterrows/{dataset_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1Beta - summary: Get a paginated list of rows from a dataset. - description: Query endpoint for proper schema generation. - operationId: iterrows_v1beta_datasetio_iterrows__dataset_id__get + - Conversations + summary: Retrieve a conversation + description: Get a conversation with the given ID + operationId: get_conversation_v1_conversations__conversation_id__get parameters: - - name: limit - in: query - required: true - schema: - type: integer - title: Limit - - name: start_index - in: query - required: true - schema: - type: integer - title: Start Index - - name: dataset_id + - name: conversation_id in: path required: true schema: type: string - title: Dataset Id + description: The conversation identifier + title: Conversation Id + description: The conversation identifier responses: '200': - description: A PaginatedResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/PaginatedResponse' + $ref: '#/components/schemas/Conversation' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1beta/datasets: - get: - tags: - - V1Beta - summary: List all datasets. - description: Response-only endpoint for proper schema generation. - operationId: list_datasets_v1beta_datasets_get - responses: - '200': - description: A ListDatasetsResponse. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ListDatasetsResponse' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - post: - tags: - - V1Beta - summary: Register a new dataset. - description: Typed endpoint for proper schema generation. - operationId: register_dataset_v1beta_datasets_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/__main_____datasets_Request' - required: true - responses: - '200': - description: A Dataset. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/Dataset' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1beta/datasets/{dataset_id}: - delete: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - V1Beta - summary: Unregister a dataset by its ID. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: unregister_dataset_v1beta_datasets__dataset_id__delete + - Conversations + summary: Update a conversation + description: Update a conversation's metadata with the given ID + operationId: update_conversation_v1_conversations__conversation_id__post parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - - name: dataset_id + - name: conversation_id in: path required: true schema: type: string - description: 'Path parameter: dataset_id' + description: The conversation identifier + title: Conversation Id + description: The conversation identifier + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ConversationUpdateRequest' responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/Conversation' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/conversations/{conversation_id}/items: get: tags: - - V1Beta - summary: Get a dataset by its ID. - description: Query endpoint for proper schema generation. - operationId: get_dataset_v1beta_datasets__dataset_id__get + - Conversations + summary: List items + description: List items in the conversation + operationId: list_items_v1_conversations__conversation_id__items_get parameters: - - name: dataset_id + - name: conversation_id in: path required: true schema: type: string - title: Dataset Id - responses: - '200': - description: A Dataset. - content: - application/json: - schema: - $ref: '#/components/schemas/Dataset' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents: - get: - tags: - - V1Alpha - summary: List all agents. - description: Query endpoint for proper schema generation. - operationId: list_agents_v1alpha_agents_get - parameters: + description: The conversation identifier + title: Conversation Id + description: The conversation identifier + - name: after + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: An item ID to list items after, used in pagination + title: After + description: An item ID to list items after, used in pagination + - name: include + in: query + required: false + schema: + anyOf: + - type: array + items: + $ref: '#/components/schemas/ConversationItemInclude' + - type: 'null' + description: Specify additional output data to include in the response + title: Include + description: Specify additional output data to include in the response - name: limit in: query - required: true + required: false schema: - type: integer + anyOf: + - type: integer + - type: 'null' + description: A limit on the number of objects to be returned (1-100, default 20) title: Limit - - name: start_index + description: A limit on the number of objects to be returned (1-100, default 20) + - name: order in: query - required: true + required: false schema: - type: integer - title: Start Index + anyOf: + - enum: + - asc + - desc + type: string + - type: 'null' + description: The order to return items in (asc or desc, default desc) + title: Order + description: The order to return items in (asc or desc, default desc) responses: '200': - description: A PaginatedResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/PaginatedResponse' + $ref: '#/components/schemas/ConversationItemList' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1Alpha - summary: Create an agent with the given configuration. - description: Typed endpoint for proper schema generation. - operationId: create_agent_v1alpha_agents_post + - Conversations + summary: Create items + description: Create items in the conversation + operationId: add_items_v1_conversations__conversation_id__items_post + parameters: + - name: conversation_id + in: path + required: true + schema: + type: string + description: The conversation identifier + title: Conversation Id + description: The conversation identifier requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/AgentConfig' + $ref: '#/components/schemas/ConversationItemCreateRequest' responses: '200': - description: An AgentCreateResponse with the agent ID. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/AgentCreateResponse' + $ref: '#/components/schemas/ConversationItemList' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents/{agent_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/conversations/{conversation_id}/items/{item_id}: delete: tags: - - V1Alpha - summary: Delete an agent by its ID and its associated sessions and turns. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: delete_agent_v1alpha_agents__agent_id__delete + - Conversations + summary: Delete an item + description: Delete a conversation item + operationId: openai_delete_conversation_item_v1_conversations__conversation_id__items__item_id__delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query + - name: conversation_id + in: path required: true schema: - title: Kwargs - - name: agent_id + type: string + description: The conversation identifier + title: Conversation Id + description: The conversation identifier + - name: item_id in: path required: true schema: type: string - description: The ID of the agent to delete. + description: The item identifier + title: Item Id + description: The item identifier responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/ConversationItemDeletedResource' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1Alpha - summary: Describe an agent by its ID. - description: Query endpoint for proper schema generation. - operationId: get_agent_v1alpha_agents__agent_id__get + - Conversations + summary: Retrieve an item + description: Retrieve a conversation item + operationId: retrieve_v1_conversations__conversation_id__items__item_id__get parameters: - - name: agent_id + - name: conversation_id in: path required: true schema: type: string - title: Agent Id - description: ID of the agent. + description: The conversation identifier + title: Conversation Id + description: The conversation identifier + - name: item_id + in: path + required: true + schema: + type: string + description: The item identifier + title: Item Id + description: The item identifier responses: '200': - description: An Agent of the agent. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Agent' + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + discriminator: + propertyName: type + mapping: + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + title: Response Retrieve V1 Conversations Conversation Id Items Item Id Get '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents/{agent_id}/session: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/embeddings: post: tags: - - V1Alpha - summary: Create a new session for an agent. - description: Typed endpoint for proper schema generation. - operationId: create_agent_session_v1alpha_agents__agent_id__session_post + - Inference + summary: Create embeddings. + description: Create embeddings. + operationId: openai_embeddings_v1_embeddings_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/__main_____agents_agent_id_session_Request' + $ref: '#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody' required: true responses: '200': - description: An AgentSessionCreateResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/AgentSessionCreateResponse' + $ref: '#/components/schemas/OpenAIEmbeddingsResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: agent_id - in: path - required: true - schema: - type: string - description: The ID of the agent to create the session for. - /v1alpha/agents/{agent_id}/session/{session_id}: - delete: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/files: + get: tags: - - V1Alpha - summary: Delete an agent session by its ID and its associated turns. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: delete_agents_session_v1alpha_agents__agent_id__session__session_id__delete + - Files + summary: List files. + description: Returns a list of files that belong to the user's organization. + operationId: openai_list_files_v1_files_get parameters: - - name: args + - name: after in: query - required: true + required: false schema: - title: Args - - name: kwargs + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + title: After + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + - name: limit in: query - required: true + required: false schema: - title: Kwargs - - name: session_id - in: path - required: true + anyOf: + - type: integer + - type: 'null' + description: A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000. + default: 10000 + title: Limit + description: A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000. + - name: order + in: query + required: false schema: - type: string - description: The ID of the session to delete. - - name: agent_id - in: path - required: true + anyOf: + - $ref: '#/components/schemas/Order' + - type: 'null' + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + default: desc + title: Order + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + - name: purpose + in: query + required: false schema: - type: string - description: The ID of the agent to delete the session for. + anyOf: + - $ref: '#/components/schemas/OpenAIFilePurpose' + - type: 'null' + description: Only return files with the given purpose. + title: Purpose + description: Only return files with the given purpose. responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/ListOpenAIFileResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - get: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - V1Alpha - summary: Retrieve an agent session by its ID. - description: Query endpoint for proper schema generation. - operationId: get_agents_session_v1alpha_agents__agent_id__session__session_id__get - parameters: - - name: turn_ids - in: query - required: true - schema: - type: string - title: Turn Ids - - name: session_id - in: path - required: true - schema: - type: string - title: Session Id - description: The ID of the session to get. - - name: agent_id - in: path + - Files + summary: Upload file. + description: Upload a file that can be used across various endpoints. + operationId: openai_upload_file_v1_files_post + requestBody: required: true - schema: - type: string - title: Agent Id - description: The ID of the agent to get the session for. + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/Body_openai_upload_file_v1_files_post' responses: '200': - description: A Session. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Session' + $ref: '#/components/schemas/OpenAIFileObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents/{agent_id}/session/{session_id}/turn: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/files/{file_id}: + delete: tags: - - V1Alpha - summary: Create a new turn for an agent. - description: Typed endpoint for proper schema generation. - operationId: create_agent_turn_v1alpha_agents__agent_id__session__session_id__turn_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/__main_____agents_agent_id_session_session_id_turn_Request' + - Files + summary: Delete file. + description: Delete a file. + operationId: openai_delete_file_v1_files__file_id__delete + parameters: + - name: file_id + in: path required: true + schema: + type: string + description: The ID of the file to use for this request. + title: File Id + description: The ID of the file to use for this request. responses: '200': - description: If stream=False, returns a Turn object. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Turn' + $ref: '#/components/schemas/OpenAIFileDeleteResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: + tags: + - Files + summary: Retrieve file. + description: Returns information about a specific file. + operationId: openai_retrieve_file_v1_files__file_id__get parameters: - - name: agent_id - in: path - required: true - schema: - type: string - description: The ID of the agent to create the turn for. - - name: session_id + - name: file_id in: path required: true schema: type: string - description: The ID of the session to create the turn for. - /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}: + description: The ID of the file to use for this request. + title: File Id + description: The ID of the file to use for this request. + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIFileObject' + '400': + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '429': + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + default: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/files/{file_id}/content: get: tags: - - V1Alpha - summary: Retrieve an agent turn by its ID. - description: Query endpoint for proper schema generation. - operationId: get_agents_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__get + - Files + summary: Retrieve file content. + description: Returns the contents of the specified file. + operationId: openai_retrieve_file_content_v1_files__file_id__content_get parameters: - - name: agent_id - in: path - required: true - schema: - type: string - title: Agent Id - description: The ID of the agent to get the turn for. - - name: session_id - in: path - required: true - schema: - type: string - title: Session Id - description: The ID of the session to get the turn for. - - name: turn_id + - name: file_id in: path required: true schema: type: string - title: Turn Id - description: The ID of the turn to get. + description: The ID of the file to use for this request. + title: File Id + description: The ID of the file to use for this request. responses: '200': - description: A Turn. + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Turn' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/health: + get: tags: - - V1Alpha - summary: Resume an agent turn with executed tool call responses. - description: Typed endpoint for proper schema generation. - operationId: resume_agent_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__resume_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/__main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request' - required: true + - Inspect + summary: Get health status. + description: Get the current health status of the service. + operationId: health_v1_health_get responses: '200': - description: A Turn object if stream is False, otherwise an AsyncIterator of AgentTurnResponseStreamChunk objects. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Turn' + $ref: '#/components/schemas/HealthInfo' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: agent_id - in: path - required: true - schema: - type: string - description: The ID of the agent to resume. - - name: session_id - in: path - required: true - schema: - type: string - description: The ID of the session to resume. - - name: turn_id - in: path - required: true - schema: - type: string - description: The ID of the turn to resume. - /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}: - get: - tags: - - V1Alpha - summary: Retrieve an agent step by its ID. - description: Query endpoint for proper schema generation. - operationId: get_agents_step_v1alpha_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get - parameters: - - name: agent_id - in: path - required: true - schema: - type: string - title: Agent Id - description: The ID of the agent to get the step for. - - name: session_id - in: path - required: true - schema: - type: string - title: Session Id - description: The ID of the session to get the step for. - - name: turn_id - in: path - required: true - schema: - type: string - title: Turn Id - description: The ID of the turn to get the step for. - - name: step_id - in: path - required: true - schema: - type: string - title: Step Id - description: The ID of the step to get. - responses: - '200': - description: An AgentStepResponse. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/AgentStepResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/agents/{agent_id}/sessions: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/inspect/routes: get: tags: - - V1Alpha - summary: List all session(s) of a given agent. - description: Query endpoint for proper schema generation. - operationId: list_agent_sessions_v1alpha_agents__agent_id__sessions_get - parameters: - - name: limit - in: query - required: true - schema: - type: integer - title: Limit - - name: start_index - in: query - required: true - schema: - type: integer - title: Start Index - - name: agent_id - in: path - required: true - schema: - type: string - title: Agent Id - description: The ID of the agent to list sessions for. + - Inspect + summary: List routes. + description: List all available API routes with their methods and implementing providers. + operationId: list_routes_v1_inspect_routes_get responses: '200': - description: A PaginatedResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/PaginatedResponse' + $ref: '#/components/schemas/ListRoutesResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/eval/benchmarks: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/models: get: tags: - - V1Alpha - summary: List all benchmarks. - description: Response-only endpoint for proper schema generation. - operationId: list_benchmarks_v1alpha_eval_benchmarks_get + - Models + summary: List all models. + description: List all models registered in Llama Stack. + operationId: list_models_v1_models_get responses: '200': - description: A ListBenchmarksResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListBenchmarksResponse' + $ref: '#/components/schemas/ListModelsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1Alpha - summary: Register a benchmark. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: register_benchmark_v1alpha_eval_benchmarks_post - parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query + - Models + summary: Register model. + description: Register a new model in Llama Stack. + operationId: register_model_v1_models_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterModelRequest' required: true - schema: - title: Kwargs responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/Model' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/eval/benchmarks/{benchmark_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/models/{model_id}: delete: tags: - - V1Alpha - summary: Unregister a benchmark. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: unregister_benchmark_v1alpha_eval_benchmarks__benchmark_id__delete + - Models + summary: Unregister model. + description: Unregister a model from Llama Stack. + operationId: unregister_model_v1_models__model_id__delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - - name: benchmark_id + - name: model_id in: path required: true schema: type: string - description: The ID of the benchmark to unregister. + description: The identifier of the model to unregister. + title: Model Id + description: The identifier of the model to unregister. responses: - '200': + '204': description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1Alpha - summary: Get a benchmark by its ID. - description: Query endpoint for proper schema generation. - operationId: get_benchmark_v1alpha_eval_benchmarks__benchmark_id__get + - Models + summary: Get model. + description: Get a model by its identifier. + operationId: get_model_v1_models__model_id__get parameters: - - name: benchmark_id + - name: model_id in: path required: true schema: type: string - title: Benchmark Id - description: The ID of the benchmark to get. + description: The identifier of the model to get. + title: Model Id + description: The identifier of the model to get. responses: '200': - description: A Benchmark. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Benchmark' + $ref: '#/components/schemas/Model' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/eval/benchmarks/{benchmark_id}/evaluations: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/moderations: post: tags: - - V1Alpha - summary: Evaluate a list of rows on a benchmark. - description: Typed endpoint for proper schema generation. - operationId: evaluate_rows_v1alpha_eval_benchmarks__benchmark_id__evaluations_post + - Safety + summary: Create moderation. + description: Classifies if text and/or image inputs are potentially harmful. + operationId: run_moderation_v1_moderations_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/BenchmarkConfig' + $ref: '#/components/schemas/RunModerationRequest' required: true responses: '200': - description: EvaluateResponse object containing generations and scores. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/EvaluateResponse' + $ref: '#/components/schemas/ModerationObject' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: benchmark_id - in: path - required: true - schema: - type: string - description: The ID of the benchmark to run the evaluation on. - /v1alpha/eval/benchmarks/{benchmark_id}/jobs: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/prompts: + get: tags: - - V1Alpha - summary: Run an evaluation on a benchmark. - description: Typed endpoint for proper schema generation. - operationId: run_eval_v1alpha_eval_benchmarks__benchmark_id__jobs_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/BenchmarkConfig' - required: true + - Prompts + summary: List all prompts + description: List all prompts registered in Llama Stack + operationId: list_prompts_v1_prompts_get responses: '200': - description: The job that was created to run the evaluation. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Job' + $ref: '#/components/schemas/ListPromptsResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: benchmark_id - in: path - required: true - schema: - type: string - description: The ID of the benchmark to run the evaluation on. - /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}: - delete: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - V1Alpha - summary: Cancel a job. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: job_cancel_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__delete - parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - - name: benchmark_id - in: path - required: true - schema: - type: string - description: The ID of the benchmark to run the evaluation on. - - name: job_id - in: path + - Prompts + summary: Create prompt + description: Create a new prompt + operationId: create_prompt_v1_prompts_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePromptRequest' required: true - schema: - type: string - description: The ID of the job to cancel. responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/Prompt' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - get: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/prompts/{prompt_id}: + delete: tags: - - V1Alpha - summary: Get the status of a job. - description: Query endpoint for proper schema generation. - operationId: job_status_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__get + - Prompts + summary: Delete prompt + description: Delete a prompt + operationId: delete_prompt_v1_prompts__prompt_id__delete parameters: - - name: benchmark_id - in: path - required: true - schema: - type: string - title: Benchmark Id - description: The ID of the benchmark to run the evaluation on. - - name: job_id + - name: prompt_id in: path required: true schema: type: string - title: Job Id - description: The ID of the job to get the status of. + description: The identifier of the prompt to delete + title: Prompt Id + description: The identifier of the prompt to delete responses: - '200': - description: The status of the evaluation job. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Job' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1Alpha - summary: Get the result of a job. - description: Query endpoint for proper schema generation. - operationId: job_result_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__result_get + - Prompts + summary: Get prompt + description: Get a prompt by its identifier and optional version + operationId: get_prompt_v1_prompts__prompt_id__get parameters: - - name: benchmark_id + - name: prompt_id in: path required: true schema: type: string - title: Benchmark Id - description: The ID of the benchmark to run the evaluation on. - - name: job_id - in: path - required: true + description: The identifier of the prompt to get + title: Prompt Id + description: The identifier of the prompt to get + - name: version + in: query + required: false schema: - type: string - title: Job Id - description: The ID of the job to get the result of. + anyOf: + - type: integer + - type: 'null' + description: The version of the prompt to get (defaults to latest) + title: Version + description: The version of the prompt to get (defaults to latest) responses: '200': - description: The result of the job. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/EvaluateResponse' + $ref: '#/components/schemas/Prompt' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/inference/rerank: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1Alpha - summary: Rerank a list of documents based on their relevance to a query. - description: Typed endpoint for proper schema generation. - operationId: rerank_v1alpha_inference_rerank_post + - Prompts + summary: Update prompt + description: Update an existing prompt (increments version) + operationId: update_prompt_v1_prompts__prompt_id__post + parameters: + - name: prompt_id + in: path + required: true + schema: + type: string + description: The identifier of the prompt to update + title: Prompt Id + description: The identifier of the prompt to update requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/_inference_rerank_Request' - required: true + $ref: '#/components/schemas/UpdatePromptRequest' responses: '200': - description: RerankResponse with indices sorted by relevance score (descending). + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/RerankResponse' + $ref: '#/components/schemas/Prompt' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1alpha/post-training/job/artifacts: - get: - tags: - - V1Alpha - summary: Get the artifacts of a training job. - description: Query endpoint for proper schema generation. - operationId: get_training_job_artifacts_v1alpha_post_training_job_artifacts_get - parameters: - - name: job_uuid - in: query - required: true - schema: - type: string - title: Job Uuid - responses: - '200': - description: A PostTrainingJobArtifactsResponse. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/PostTrainingJobArtifactsResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/post-training/job/cancel: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/prompts/{prompt_id}/set-default-version: post: tags: - - V1Alpha - summary: Cancel a training job. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: cancel_training_job_v1alpha_post_training_job_cancel_post + - Prompts + summary: Set prompt version + description: Set which version of a prompt should be the default in get_prompt (latest) + operationId: set_default_version_v1_prompts__prompt_id__set_default_version_post parameters: - - name: args - in: query + - name: prompt_id + in: path required: true schema: - title: Args - - name: kwargs - in: query + type: string + description: The identifier of the prompt + title: Prompt Id + description: The identifier of the prompt + requestBody: required: true - schema: - title: Kwargs + content: + application/json: + schema: + $ref: '#/components/schemas/SetDefaultVersionRequest' responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/Prompt' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/post-training/job/status: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/prompts/{prompt_id}/versions: get: tags: - - V1Alpha - summary: Get the status of a training job. - description: Query endpoint for proper schema generation. - operationId: get_training_job_status_v1alpha_post_training_job_status_get + - Prompts + summary: List prompt versions + description: List all versions of a specific prompt + operationId: list_prompt_versions_v1_prompts__prompt_id__versions_get parameters: - - name: job_uuid - in: query + - name: prompt_id + in: path required: true schema: type: string - title: Job Uuid + description: The identifier of the prompt to list versions for + title: Prompt Id + description: The identifier of the prompt to list versions for responses: '200': - description: A PostTrainingJobStatusResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/PostTrainingJobStatusResponse' + $ref: '#/components/schemas/ListPromptsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1alpha/post-training/jobs: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/providers: get: tags: - - V1Alpha - summary: Get all training jobs. - description: Response-only endpoint for proper schema generation. - operationId: get_training_jobs_v1alpha_post_training_jobs_get + - Providers + summary: List providers + description: List all available providers + operationId: list_providers_v1_providers_get responses: '200': - description: A ListPostTrainingJobsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListPostTrainingJobsResponse' + $ref: '#/components/schemas/ListProvidersResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1alpha/post-training/preference-optimize: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/providers/{provider_id}: + get: tags: - - V1Alpha - summary: Run preference optimization of a model. - description: Typed endpoint for proper schema generation. - operationId: preference_optimize_v1alpha_post_training_preference_optimize_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DPOAlignmentConfig' + - Providers + summary: Get provider + description: Get detailed information about a specific provider + operationId: inspect_provider_v1_providers__provider_id__get + parameters: + - name: provider_id + in: path required: true + schema: + type: string + description: The ID of the provider to inspect + title: Provider Id + description: The ID of the provider to inspect responses: '200': - description: A PostTrainingJob. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/PostTrainingJob' + $ref: '#/components/schemas/ProviderInfo' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1alpha/post-training/supervised-fine-tune: - post: - tags: - - V1Alpha - summary: Run supervised fine-tuning of a model. - description: Typed endpoint for proper schema generation. - operationId: supervised_fine_tune_v1alpha_post_training_supervised_fine_tune_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TrainingConfig' - required: true - responses: - '200': - description: A PostTrainingJob. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/PostTrainingJob' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/batches: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/responses: get: tags: - - V1 - summary: List all batches for the current user. - description: Query endpoint for proper schema generation. - operationId: list_batches_v1_batches_get + - Agents + summary: List all responses. + description: List all responses. + operationId: list_openai_responses_v1_responses_get parameters: - name: after in: query - required: true + required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: The ID of the last response to return. title: After + description: The ID of the last response to return. - name: limit in: query required: false schema: - type: integer - default: 20 + anyOf: + - type: integer + - type: 'null' + description: The number of responses to return. + default: 50 title: Limit + description: The number of responses to return. + - name: model + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: The model to filter responses by. + title: Model + description: The model to filter responses by. + - name: order + in: query + required: false + schema: + anyOf: + - $ref: '#/components/schemas/Order' + - type: 'null' + description: The order to sort responses by when sorted by created_at ('asc' or 'desc'). + default: desc + title: Order + description: The order to sort responses by when sorted by created_at ('asc' or 'desc'). responses: '200': - description: A list of batch objects. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListBatchesResponse' + $ref: '#/components/schemas/ListOpenAIResponseObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Create a new batch for processing multiple API requests. - description: Typed endpoint for proper schema generation. - operationId: create_batch_v1_batches_post + - Agents + summary: Create a model response. + description: Create a model response. + operationId: create_openai_response_v1_responses_post requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/_batches_Request' + $ref: '#/components/schemas/CreateOpenAIResponseRequest' responses: '200': - description: The created batch object. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/Batch' + schema: {} '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/batches/{batch_id}: - get: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/responses/{response_id}: + delete: tags: - - V1 - summary: Retrieve information about a specific batch. - description: Query endpoint for proper schema generation. - operationId: retrieve_batch_v1_batches__batch_id__get + - Agents + summary: Delete a response. + description: Delete a response. + operationId: delete_openai_response_v1_responses__response_id__delete parameters: - - name: batch_id + - name: response_id in: path required: true schema: type: string - title: Batch Id - description: The ID of the batch to retrieve. + description: The ID of the OpenAI response to delete. + title: Response Id + description: The ID of the OpenAI response to delete. responses: '200': - description: The batch object. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Batch' + $ref: '#/components/schemas/OpenAIDeleteResponseObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/batches/{batch_id}/cancel: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: tags: - - V1 - summary: Cancel a batch that is in progress. - description: Typed endpoint for proper schema generation. - operationId: cancel_batch_v1_batches__batch_id__cancel_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_batches_batch_id_cancel_Request' + - Agents + summary: Get a model response. + description: Get a model response. + operationId: get_openai_response_v1_responses__response_id__get + parameters: + - name: response_id + in: path required: true + schema: + type: string + description: The ID of the OpenAI response to retrieve. + title: Response Id + description: The ID of the OpenAI response to retrieve. responses: '200': - description: The updated batch object. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Batch' + $ref: '#/components/schemas/OpenAIResponseObject' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/responses/{response_id}/input_items: + get: + tags: + - Agents + summary: List input items. + description: List input items. + operationId: list_openai_response_input_items_v1_responses__response_id__input_items_get parameters: - - name: batch_id + - name: response_id in: path required: true schema: type: string - description: The ID of the batch to cancel. - /v1/chat/completions: - get: - tags: - - V1 - summary: List chat completions. - description: Query endpoint for proper schema generation. - operationId: list_chat_completions_v1_chat_completions_get - parameters: + description: The ID of the response to retrieve input items for. + title: Response Id + description: The ID of the response to retrieve input items for. - name: after in: query - required: true + required: false schema: - type: string + anyOf: + - type: string + - type: 'null' + description: An item ID to list items after, used for pagination. title: After - - name: model + description: An item ID to list items after, used for pagination. + - name: before in: query - required: true + required: false schema: - type: string - title: Model + anyOf: + - type: string + - type: 'null' + description: An item ID to list items before, used for pagination. + title: Before + description: An item ID to list items before, used for pagination. + - name: include + in: query + required: false + schema: + anyOf: + - type: array + items: + type: string + - type: 'null' + description: Additional fields to include in the response. + title: Include + description: Additional fields to include in the response. - name: limit in: query required: false schema: - type: integer + anyOf: + - type: integer + maximum: 100 + minimum: 1 + - type: 'null' + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. default: 20 title: Limit + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - name: order in: query required: false schema: - $ref: '#/components/schemas/Order' + anyOf: + - $ref: '#/components/schemas/Order' + - type: 'null' + description: The order to return the input items in. Default is desc. default: desc + title: Order + description: The order to return the input items in. Default is desc. responses: '200': - description: A ListOpenAIChatCompletionResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIChatCompletionResponse' + $ref: '#/components/schemas/ListOpenAIResponseInputItem' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/safety/run-shield: post: tags: - - V1 - summary: Create chat completions. - description: Typed endpoint for proper schema generation. - operationId: openai_chat_completion_v1_chat_completions_post + - Safety + summary: Run shield. + description: Run a shield. + operationId: run_shield_v1_safety_run_shield_post requestBody: - required: true content: application/json: schema: - $ref: '#/components/schemas/OpenAIChatCompletionRequestWithExtraBody' + $ref: '#/components/schemas/RunShieldRequest' + required: true responses: '200': - description: An OpenAIChatCompletion. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAIChatCompletion' + $ref: '#/components/schemas/RunShieldResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/chat/completions/{completion_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/scoring-functions: get: tags: - - V1 - summary: Get chat completion. - description: Query endpoint for proper schema generation. - operationId: get_chat_completion_v1_chat_completions__completion_id__get - parameters: - - name: completion_id - in: path - required: true - schema: - type: string - title: Completion Id - description: ID of the chat completion. + - Scoring Functions + summary: List all scoring functions + description: List all scoring functions + operationId: list_scoring_functions_v1_scoring_functions_get responses: '200': - description: A OpenAICompletionWithInputMessages. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAICompletionWithInputMessages' + $ref: '#/components/schemas/ListScoringFunctionsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/completions: - post: - tags: - - V1 - summary: Create completion. - description: Typed endpoint for proper schema generation. - operationId: openai_completion_v1_completions_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAICompletionRequestWithExtraBody' - required: true - responses: - '200': - description: An OpenAICompletion. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/OpenAICompletion' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/conversations: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Create a conversation. - description: Typed endpoint for proper schema generation. - operationId: create_conversation_v1_conversations_post + - Scoring Functions + summary: Register a scoring function + description: Register a scoring function + operationId: register_scoring_function_v1_scoring_functions_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_conversations_Request' + $ref: '#/components/schemas/RegisterScoringFunctionRequest' required: true responses: - '200': - description: The created conversation object. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Conversation' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/conversations/{conversation_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/scoring-functions/{scoring_fn_id}: delete: tags: - - V1 - summary: Delete a conversation. - description: Query endpoint for proper schema generation. - operationId: openai_delete_conversation_v1_conversations__conversation_id__delete + - Scoring Functions + summary: Unregister a scoring function + description: Unregister a scoring function + operationId: unregister_scoring_function_v1_scoring_functions__scoring_fn_id__delete parameters: - - name: conversation_id + - name: scoring_fn_id in: path required: true schema: type: string - title: Conversation Id - description: The conversation identifier. + description: The ID of the scoring function to unregister + title: Scoring Fn Id + description: The ID of the scoring function to unregister responses: - '200': - description: The deleted conversation resource. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ConversationDeletedResource' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 - summary: Retrieve a conversation. - description: Query endpoint for proper schema generation. - operationId: get_conversation_v1_conversations__conversation_id__get + - Scoring Functions + summary: Get a scoring function by its ID + description: Get a scoring function by its ID + operationId: get_scoring_function_v1_scoring_functions__scoring_fn_id__get parameters: - - name: conversation_id + - name: scoring_fn_id in: path required: true schema: type: string - title: Conversation Id - description: The conversation identifier. + description: The ID of the scoring function to get + title: Scoring Fn Id + description: The ID of the scoring function to get responses: '200': - description: The conversation object. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Conversation' + $ref: '#/components/schemas/ScoringFn' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/scoring/score: post: tags: - - V1 - summary: Update a conversation. - description: Typed endpoint for proper schema generation. - operationId: update_conversation_v1_conversations__conversation_id__post + - Scoring + summary: Score a list of rows + description: Score a list of rows + operationId: score_v1_scoring_score_post requestBody: - required: true content: application/json: schema: - $ref: '#/components/schemas/_conversations_conversation_id_Request' + $ref: '#/components/schemas/ScoreRequest' + required: true responses: '200': - description: The updated conversation object. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Conversation' + $ref: '#/components/schemas/ScoreResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - parameters: - - name: conversation_id - in: path - required: true - schema: - type: string - description: The conversation identifier. - /v1/conversations/{conversation_id}/items: - get: - tags: - - V1 - summary: List items. - description: Query endpoint for proper schema generation. - operationId: list_items_v1_conversations__conversation_id__items_get - parameters: - - name: after - in: query - required: true - schema: - type: string - title: After - - name: include - in: query - required: true - schema: - $ref: '#/components/schemas/ConversationItemInclude' - - name: limit - in: query - required: true - schema: - type: integer - title: Limit - - name: order - in: query - required: true - schema: - type: string - title: Order - - name: conversation_id - in: path - required: true - schema: - type: string - title: Conversation Id - description: The conversation identifier. - responses: - '200': - description: List of conversation items. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ConversationItemList' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/scoring/score-batch: post: tags: - - V1 - summary: Create items. - description: Typed endpoint for proper schema generation. - operationId: add_items_v1_conversations__conversation_id__items_post + - Scoring + summary: Score a batch of rows + description: Score a batch of rows from a dataset + operationId: score_batch_v1_scoring_score_batch_post requestBody: - required: true content: application/json: schema: - $ref: '#/components/schemas/_conversations_conversation_id_items_Request' + $ref: '#/components/schemas/ScoreBatchRequest' + required: true responses: '200': - description: List of created items. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ConversationItemList' + $ref: '#/components/schemas/ScoreBatchResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - parameters: - - name: conversation_id - in: path - required: true - schema: - type: string - description: The conversation identifier. - /v1/conversations/{conversation_id}/items/{item_id}: - delete: - tags: - - V1 - summary: Delete an item. - description: Query endpoint for proper schema generation. - operationId: openai_delete_conversation_item_v1_conversations__conversation_id__items__item_id__delete - parameters: - - name: conversation_id - in: path - required: true - schema: - type: string - title: Conversation Id - description: The conversation identifier. - - name: item_id - in: path - required: true - schema: - type: string - title: Item Id - description: The item identifier. - responses: - '200': - description: The deleted item resource. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ConversationItemDeletedResource' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/shields: get: tags: - - V1 - summary: Retrieve an item. - description: Query endpoint for proper schema generation. - operationId: retrieve_v1_conversations__conversation_id__items__item_id__get - parameters: - - name: conversation_id - in: path - required: true - schema: - type: string - title: Conversation Id - description: The conversation identifier. - - name: item_id - in: path - required: true - schema: - type: string - title: Item Id - description: The item identifier. + - Shields + summary: List all shields + description: List all shields + operationId: list_shields_v1_shields_get responses: '200': - description: The conversation item. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAIResponseMessage' + $ref: '#/components/schemas/ListShieldsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/embeddings: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Create embeddings. - description: Typed endpoint for proper schema generation. - operationId: openai_embeddings_v1_embeddings_post + - Shields + summary: Register a shield + description: Register a shield + operationId: register_shield_v1_shields_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody' + $ref: '#/components/schemas/RegisterShieldRequest' required: true responses: '200': - description: An OpenAIEmbeddingsResponse containing the embeddings. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAIEmbeddingsResponse' + $ref: '#/components/schemas/Shield' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/files: - get: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/shields/{identifier}: + delete: tags: - - V1 - summary: List files. - description: Query endpoint for proper schema generation. - operationId: openai_list_files_v1_files_get + - Shields + summary: Unregister a shield + description: Unregister a shield + operationId: unregister_shield_v1_shields__identifier__delete parameters: - - name: after - in: query + - name: identifier + in: path required: true schema: type: string - title: After - - name: purpose - in: query - required: true - schema: - $ref: '#/components/schemas/OpenAIFilePurpose' - - name: limit - in: query - required: false - schema: - type: integer - default: 10000 - title: Limit - - name: order - in: query - required: false - schema: - $ref: '#/components/schemas/Order' - default: desc + description: The identifier of the shield to unregister + title: Identifier + description: The identifier of the shield to unregister responses: - '200': - description: An ListOpenAIFileResponse containing the list of files. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIFileResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - post: - tags: - - V1 - summary: Upload file. - description: Response-only endpoint for proper schema generation. - operationId: openai_upload_file_v1_files_post - responses: - '200': - description: An OpenAIFileObject representing the uploaded file. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/files/{file_id}: - delete: - tags: - - V1 - summary: Delete file. - description: Query endpoint for proper schema generation. - operationId: openai_delete_file_v1_files__file_id__delete - parameters: - - name: file_id - in: path - required: true - schema: - type: string - title: File Id - description: The ID of the file to use for this request. - responses: - '200': - description: An OpenAIFileDeleteResponse indicating successful deletion. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileDeleteResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - get: - tags: - - V1 - summary: Retrieve file. - description: Query endpoint for proper schema generation. - operationId: openai_retrieve_file_v1_files__file_id__get - parameters: - - name: file_id - in: path - required: true - schema: - type: string - title: File Id - description: The ID of the file to use for this request. - responses: - '200': - description: An OpenAIFileObject containing file information. + description: An unexpected error occurred. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/files/{file_id}/content: + $ref: '#/components/schemas/Error' get: tags: - - V1 - summary: Retrieve file content. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: openai_retrieve_file_content_v1_files__file_id__content_get + - Shields + summary: Get a shield by its identifier + description: Get a shield by its identifier + operationId: get_shield_v1_shields__identifier__get parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - - name: file_id + - name: identifier in: path required: true schema: type: string - description: The ID of the file to use for this request. + description: The identifier of the shield to get + title: Identifier + description: The identifier of the shield to get responses: '200': - description: The raw file content as a binary response. + description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/Shield' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/health: - get: - tags: - - V1 - summary: Get health status. - description: Response-only endpoint for proper schema generation. - operationId: health_v1_health_get - responses: - '200': - description: Health information indicating if the service is operational. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/HealthInfo' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/inspect/routes: - get: - tags: - - V1 - summary: List routes. - description: Response-only endpoint for proper schema generation. - operationId: list_routes_v1_inspect_routes_get - responses: - '200': - description: Response containing information about all available routes. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/ListRoutesResponse' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/models: - get: - tags: - - V1 - summary: List all models. - description: Response-only endpoint for proper schema generation. - operationId: list_models_v1_models_get - responses: - '200': - description: A ListModelsResponse. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/ListModelsResponse' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/tool-runtime/invoke: post: tags: - - V1 - summary: Register model. - description: Typed endpoint for proper schema generation. - operationId: register_model_v1_models_post + - Tool Runtime + summary: Run a tool with the given arguments + description: Run a tool with the given arguments + operationId: invoke_tool_v1_tool_runtime_invoke_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_models_Request' + $ref: '#/components/schemas/InvokeToolRequest' required: true responses: '200': - description: A Model. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Model' + $ref: '#/components/schemas/ToolInvocationResult' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/models/{model_id}: - delete: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/tool-runtime/list-tools: + get: tags: - - V1 - summary: Unregister model. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: unregister_model_v1_models__model_id__delete + - Tool Runtime + summary: List all tools in the runtime + description: List all tools in the runtime + operationId: list_runtime_tools_v1_tool_runtime_list_tools_get parameters: - - name: args + - name: tool_group_id in: query - required: true + required: false schema: - title: Args - - name: kwargs + anyOf: + - type: string + - type: 'null' + description: The ID of the tool group to list tools for + title: Tool Group Id + description: The ID of the tool group to list tools for + - name: mcp_endpoint in: query - required: true - schema: - title: Kwargs - - name: model_id - in: path - required: true + required: false schema: - type: string - description: 'Path parameter: model_id' + anyOf: + - type: string + - type: 'null' + description: The MCP endpoint URL to use for the tool group + title: Mcp Endpoint + description: The MCP endpoint URL to use for the tool group responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/ListToolDefsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - get: - tags: - - V1 - summary: Get model. - description: Query endpoint for proper schema generation. - operationId: get_model_v1_models__model_id__get - parameters: - - name: model_id - in: path - required: true - schema: - type: string - title: Model Id - responses: - '200': - description: A Model. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Model' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/moderations: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/tool-runtime/rag-tool/insert: post: tags: - - V1 - summary: Create moderation. - description: Typed endpoint for proper schema generation. - operationId: run_moderation_v1_moderations_post + - Tool Runtime + summary: Insert documents into the RAG system. + description: Index documents so they can be used by the RAG system. + operationId: rag_tool_insert_v1_tool_runtime_rag_tool_insert_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_moderations_Request' + $ref: '#/components/schemas/Body_rag_tool_insert_v1_tool_runtime_rag_tool_insert_post' required: true responses: - '200': - description: A moderation object. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ModerationObject' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/prompts: - get: - tags: - - V1 - summary: List all prompts. - description: Response-only endpoint for proper schema generation. - operationId: list_prompts_v1_prompts_get - responses: - '200': - description: A ListPromptsResponse containing all prompts. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/ListPromptsResponse' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/tool-runtime/rag-tool/query: post: tags: - - V1 - summary: Create prompt. - description: Typed endpoint for proper schema generation. - operationId: create_prompt_v1_prompts_post + - Tool Runtime + summary: Query the RAG system for context. + description: Query the RAG system for context; typically invoked by the agent. + operationId: rag_tool_query_v1_tool_runtime_rag_tool_query_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/_prompts_Request' + $ref: '#/components/schemas/Body_rag_tool_query_v1_tool_runtime_rag_tool_query_post' required: true responses: '200': - description: The created Prompt resource. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Prompt' + $ref: '#/components/schemas/RAGQueryResult' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/prompts/{prompt_id}: - delete: - tags: - - V1 - summary: Delete prompt. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: delete_prompt_v1_prompts__prompt_id__delete - parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - - name: prompt_id - in: path - required: true - schema: - type: string - description: The identifier of the prompt to delete. - responses: - '200': - description: Successful Response + description: The server encountered an unexpected error. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/toolgroups: get: tags: - - V1 - summary: Get prompt. - description: Query endpoint for proper schema generation. - operationId: get_prompt_v1_prompts__prompt_id__get - parameters: - - name: version - in: query - required: true - schema: - type: integer - title: Version - - name: prompt_id - in: path - required: true - schema: - type: string - title: Prompt Id - description: The identifier of the prompt to get. + - Tool Groups + summary: List tool groups + description: List tool groups with optional provider + operationId: list_tool_groups_v1_toolgroups_get responses: '200': - description: A Prompt resource. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Prompt' + $ref: '#/components/schemas/ListToolGroupsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Update prompt. - description: Typed endpoint for proper schema generation. - operationId: update_prompt_v1_prompts__prompt_id__post + - Tool Groups + summary: Register a tool group + description: Register a tool group + operationId: register_tool_group_v1_toolgroups_post requestBody: - required: true content: application/json: schema: - $ref: '#/components/schemas/_prompts_prompt_id_Request' + $ref: '#/components/schemas/RegisterToolGroupRequest' + required: true responses: - '200': - description: The updated Prompt resource with incremented version. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Prompt' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/toolgroups/{toolgroup_id}: + delete: + tags: + - Tool Groups + summary: Unregister a tool group + description: Unregister a tool group + operationId: unregister_toolgroup_v1_toolgroups__toolgroup_id__delete parameters: - - name: prompt_id + - name: toolgroup_id in: path required: true schema: type: string - description: The identifier of the prompt to update. - /v1/prompts/{prompt_id}/set-default-version: - post: - tags: - - V1 - summary: Set prompt version. - description: Typed endpoint for proper schema generation. - operationId: set_default_version_v1_prompts__prompt_id__set_default_version_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_prompts_prompt_id_set_default_version_Request' - required: true + description: The ID of the tool group to unregister + title: Toolgroup Id + description: The ID of the tool group to unregister responses: - '200': - description: The prompt with the specified version now set as default. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/Prompt' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: prompt_id - in: path - required: true - schema: - type: string - description: The identifier of the prompt. - /v1/prompts/{prompt_id}/versions: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 - summary: List prompt versions. - description: Query endpoint for proper schema generation. - operationId: list_prompt_versions_v1_prompts__prompt_id__versions_get + - Tool Groups + summary: Get a tool group by its ID + description: Get a tool group by its ID + operationId: get_tool_group_v1_toolgroups__toolgroup_id__get parameters: - - name: prompt_id + - name: toolgroup_id in: path required: true schema: type: string - title: Prompt Id - description: The identifier of the prompt to list versions for. + description: The ID of the tool group to get + title: Toolgroup Id + description: The ID of the tool group to get responses: '200': - description: A ListPromptsResponse containing all versions of the prompt. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListPromptsResponse' + $ref: '#/components/schemas/ToolGroup' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/providers: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/tools: get: tags: - - V1 - summary: List providers. - description: Response-only endpoint for proper schema generation. - operationId: list_providers_v1_providers_get + - Tool Groups + summary: List tools + description: List tools with optional tool group + operationId: list_tools_v1_tools_get + parameters: + - name: toolgroup_id + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: The ID of the tool group to list tools for + title: Toolgroup Id + description: The ID of the tool group to list tools for responses: '200': - description: A ListProvidersResponse containing information about all providers. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListProvidersResponse' + $ref: '#/components/schemas/ListToolDefsResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/providers/{provider_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/tools/{tool_name}: get: tags: - - V1 - summary: Get provider. - description: Query endpoint for proper schema generation. - operationId: inspect_provider_v1_providers__provider_id__get + - Tool Groups + summary: Get a tool by its name + description: Get a tool by its name + operationId: get_tool_v1_tools__tool_name__get parameters: - - name: provider_id + - name: tool_name in: path required: true schema: type: string - title: Provider Id - description: The ID of the provider to inspect. + description: The name of the tool to get + title: Tool Name + description: The name of the tool to get responses: '200': - description: A ProviderInfo object containing the provider's details. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ProviderInfo' + $ref: '#/components/schemas/ToolDef' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/responses: - get: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector-io/insert: + post: tags: - - V1 - summary: List all responses. - description: Query endpoint for proper schema generation. - operationId: list_openai_responses_v1_responses_get - parameters: - - name: after - in: query - required: true - schema: - type: string - title: After - - name: model - in: query + - Vector IO + summary: Insert chunks into a vector database. + description: Insert chunks into a vector database. + operationId: insert_chunks_v1_vector_io_insert_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InsertChunksRequest' required: true - schema: - type: string - title: Model - - name: limit - in: query - required: false - schema: - type: integer - default: 50 - title: Limit - - name: order - in: query - required: false - schema: - $ref: '#/components/schemas/Order' - default: desc responses: - '200': - description: A ListOpenAIResponseObject. + '204': + description: Successful Response + '400': + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIResponseObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector-io/query: post: tags: - - V1 - summary: Create a model response. - description: Typed endpoint for proper schema generation. - operationId: create_openai_response_v1_responses_post + - Vector IO + summary: Query chunks from a vector database. + description: Query chunks from a vector database. + operationId: query_chunks_v1_vector_io_query_post requestBody: - required: true content: application/json: schema: - $ref: '#/components/schemas/_responses_Request' + $ref: '#/components/schemas/QueryChunksRequest' + required: true responses: '200': - description: An OpenAIResponseObject. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/OpenAIResponseObject' + $ref: '#/components/schemas/QueryChunksResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/responses/{response_id}: - delete: - tags: - - V1 - summary: Delete a response. - description: Query endpoint for proper schema generation. - operationId: delete_openai_response_v1_responses__response_id__delete - parameters: - - name: response_id - in: path - required: true - schema: - type: string - title: Response Id - description: The ID of the OpenAI response to delete. - responses: - '200': - description: An OpenAIDeleteResponseObject + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/OpenAIDeleteResponseObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - get: - tags: - - V1 - summary: Get a model response. - description: Query endpoint for proper schema generation. - operationId: get_openai_response_v1_responses__response_id__get - parameters: - - name: response_id - in: path - required: true - schema: - type: string - title: Response Id - description: The ID of the OpenAI response to retrieve. - responses: - '200': - description: An OpenAIResponseObject. + description: An unexpected error occurred. content: application/json: schema: - $ref: '#/components/schemas/OpenAIResponseObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/responses/{response_id}/input_items: + $ref: '#/components/schemas/Error' + /v1/vector_stores: get: tags: - - V1 - summary: List input items. - description: Query endpoint for proper schema generation. - operationId: list_openai_response_input_items_v1_responses__response_id__input_items_get + - Vector IO + summary: Returns a list of vector stores. + description: Returns a list of vector stores. + operationId: openai_list_vector_stores_v1_vector_stores_get parameters: - - name: after - in: query - required: true - schema: - type: string - title: After - - name: before - in: query - required: true - schema: - type: string - title: Before - - name: include - in: query - required: true - schema: - type: string - title: Include - name: limit in: query required: false schema: - type: integer + anyOf: + - type: integer + maximum: 100 + minimum: 1 + - type: 'null' + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. default: 20 title: Limit + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - name: order in: query required: false schema: - $ref: '#/components/schemas/Order' + anyOf: + - type: string + - type: 'null' + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. default: desc - - name: response_id - in: path - required: true + title: Order + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + - name: after + in: query + required: false schema: - type: string - title: Response Id - description: The ID of the response to retrieve input items for. + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + title: After + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + - name: before + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. + title: Before + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. responses: '200': - description: An ListOpenAIResponseInputItem. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIResponseInputItem' + $ref: '#/components/schemas/VectorStoreListResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/safety/run-shield: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Run shield. - description: Typed endpoint for proper schema generation. - operationId: run_shield_v1_safety_run_shield_post + - Vector IO + summary: Creates a vector store. + description: Creates a vector store. + operationId: openai_create_vector_store_v1_vector_stores_post requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/_safety_run_shield_Request' - required: true + $ref: '#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody' responses: '200': - description: A RunShieldResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/RunShieldResponse' + $ref: '#/components/schemas/VectorStoreObject' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/scoring-functions: - get: - tags: - - V1 - summary: List all scoring functions. - description: Response-only endpoint for proper schema generation. - operationId: list_scoring_functions_v1_scoring_functions_get - responses: - '200': - description: A ListScoringFunctionsResponse. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ListScoringFunctionsResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - post: - tags: - - V1 - summary: Register a scoring function. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: register_scoring_function_v1_scoring_functions_post - parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - responses: - '200': - description: Successful Response + description: The client has sent too many requests in a given amount of time. content: application/json: - schema: {} - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/scoring-functions/{scoring_fn_id}: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}: delete: tags: - - V1 - summary: Unregister a scoring function. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: unregister_scoring_function_v1_scoring_functions__scoring_fn_id__delete + - Vector IO + summary: Delete a vector store. + description: Delete a vector store. + operationId: openai_delete_vector_store_v1_vector_stores__vector_store_id__delete parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs - - name: scoring_fn_id + - name: vector_store_id in: path required: true schema: type: string - description: 'Path parameter: scoring_fn_id' + description: The ID of the vector store to delete. + title: Vector Store Id + description: The ID of the vector store to delete. responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/VectorStoreDeleteResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' get: tags: - - V1 - summary: Get a scoring function by its ID. - description: Query endpoint for proper schema generation. - operationId: get_scoring_function_v1_scoring_functions__scoring_fn_id__get + - Vector IO + summary: Retrieves a vector store. + description: Retrieves a vector store. + operationId: openai_retrieve_vector_store_v1_vector_stores__vector_store_id__get parameters: - - name: scoring_fn_id + - name: vector_store_id in: path required: true schema: type: string - title: Scoring Fn Id + description: The ID of the vector store to retrieve. + title: Vector Store Id + description: The ID of the vector store to retrieve. responses: '200': - description: A ScoringFn. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ScoringFn' + $ref: '#/components/schemas/VectorStoreObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/scoring/score: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' post: tags: - - V1 - summary: Score a list of rows. - description: Typed endpoint for proper schema generation. - operationId: score_v1_scoring_score_post + - Vector IO + summary: Updates a vector store. + description: Updates a vector store. + operationId: openai_update_vector_store_v1_vector_stores__vector_store_id__post + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: The ID of the vector store to update. + title: Vector Store Id + description: The ID of the vector store to update. requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/_scoring_score_Request' - required: true + $ref: '#/components/schemas/VectorStoreModifyRequest' responses: '200': - description: A ScoreResponse object containing rows and aggregated results. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ScoreResponse' + $ref: '#/components/schemas/VectorStoreObject' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/scoring/score-batch: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/file_batches: post: tags: - - V1 - summary: Score a batch of rows. - description: Typed endpoint for proper schema generation. - operationId: score_batch_v1_scoring_score_batch_post + - Vector IO + summary: Create a vector store file batch. + description: Create a vector store file batch. + operationId: openai_create_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches_post + parameters: + - name: vector_store_id + in: path + required: true + schema: + type: string + description: The ID of the vector store to create the file batch for. + title: Vector Store Id + description: The ID of the vector store to create the file batch for. requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/_scoring_score_batch_Request' - required: true + $ref: '#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody' responses: '200': - description: A ScoreBatchResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ScoreBatchResponse' + $ref: '#/components/schemas/VectorStoreFileBatchObject' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/shields: - get: - tags: - - V1 - summary: List all shields. - description: Response-only endpoint for proper schema generation. - operationId: list_shields_v1_shields_get - responses: - '200': - description: A ListShieldsResponse. + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/ListShieldsResponse' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: + get: tags: - - V1 - summary: Register a shield. - description: Typed endpoint for proper schema generation. - operationId: register_shield_v1_shields_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_shields_Request' + - Vector IO + summary: Retrieve a vector store file batch. + description: Retrieve a vector store file batch. + operationId: openai_retrieve_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__get + parameters: + - name: vector_store_id + in: path required: true + schema: + type: string + description: The ID of the vector store containing the file batch. + title: Vector Store Id + description: The ID of the vector store containing the file batch. + - name: batch_id + in: path + required: true + schema: + type: string + description: The ID of the file batch to retrieve. + title: Batch Id + description: The ID of the file batch to retrieve. responses: '200': - description: A Shield. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Shield' + $ref: '#/components/schemas/VectorStoreFileBatchObject' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/shields/{identifier}: - delete: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: + post: tags: - - V1 - summary: Unregister a shield. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: unregister_shield_v1_shields__identifier__delete + - Vector IO + summary: Cancels a vector store file batch. + description: Cancels a vector store file batch. + operationId: openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query + - name: vector_store_id + in: path required: true schema: - title: Kwargs - - name: identifier + type: string + description: The ID of the vector store containing the file batch. + title: Vector Store Id + description: The ID of the vector store containing the file batch. + - name: batch_id in: path required: true schema: type: string - description: 'Path parameter: identifier' + description: The ID of the file batch to cancel. + title: Batch Id + description: The ID of the file batch to cancel. responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/VectorStoreFileBatchObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: get: tags: - - V1 - summary: Get a shield by its identifier. - description: Query endpoint for proper schema generation. - operationId: get_shield_v1_shields__identifier__get + - Vector IO + summary: Returns a list of vector store files in a batch. + description: Returns a list of vector store files in a batch. + operationId: openai_list_files_in_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get parameters: - - name: identifier + - name: vector_store_id in: path required: true schema: type: string - title: Identifier + description: The ID of the vector store containing the file batch. + title: Vector Store Id + description: The ID of the vector store containing the file batch. + - name: batch_id + in: path + required: true + schema: + type: string + description: The ID of the file batch to list files from. + title: Batch Id + description: The ID of the file batch to list files from. + - name: after + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + title: After + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + - name: before + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. + title: Before + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. + - name: filter + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Filter by file status. One of in_progress, completed, failed, cancelled. + title: Filter + description: Filter by file status. One of in_progress, completed, failed, cancelled. + - name: limit + in: query + required: false + schema: + anyOf: + - type: integer + maximum: 100 + minimum: 1 + - type: 'null' + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + default: 20 + title: Limit + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + - name: order + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + default: desc + title: Order + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. responses: '200': - description: A Shield. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Shield' + $ref: '#/components/schemas/VectorStoreFilesListInBatchResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/tool-runtime/invoke: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/files: + get: tags: - - V1 - summary: Run a tool with the given arguments. - description: Typed endpoint for proper schema generation. - operationId: invoke_tool_v1_tool_runtime_invoke_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_tool_runtime_invoke_Request' + - Vector IO + summary: List files in a vector store. + description: List files in a vector store. + operationId: openai_list_files_in_vector_store_v1_vector_stores__vector_store_id__files_get + parameters: + - name: vector_store_id + in: path required: true + schema: + type: string + description: The ID of the vector store to list files from. + title: Vector Store Id + description: The ID of the vector store to list files from. + - name: limit + in: query + required: false + schema: + anyOf: + - type: integer + maximum: 100 + minimum: 1 + - type: 'null' + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + default: 20 + title: Limit + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + - name: order + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + default: desc + title: Order + description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + - name: after + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + title: After + description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + - name: before + in: query + required: false + schema: + anyOf: + - type: string + - type: 'null' + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. + title: Before + description: A cursor for use in pagination. `before` is an object ID that defines your place in the list. + - name: filter + in: query + required: false + schema: + anyOf: + - const: completed + type: string + - const: in_progress + type: string + - const: cancelled + type: string + - const: failed + type: string + - type: 'null' + description: Filter by file status to only return files with the specified status. + title: Filter + description: Filter by file status to only return files with the specified status. responses: '200': - description: A ToolInvocationResult. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ToolInvocationResult' + $ref: '#/components/schemas/VectorStoreListFilesResponse' '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/tool-runtime/list-tools: - get: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - V1 - summary: List all tools in the runtime. - description: Query endpoint for proper schema generation. - operationId: list_runtime_tools_v1_tool_runtime_list_tools_get + - Vector IO + summary: Attach a file to a vector store. + description: Attach a file to a vector store. + operationId: openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post parameters: - - name: tool_group_id - in: query + - name: vector_store_id + in: path required: true schema: type: string - title: Tool Group Id + description: The ID of the vector store to attach the file to. + title: Vector Store Id + description: The ID of the vector store to attach the file to. requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/URL' + $ref: '#/components/schemas/Body_openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post' responses: '200': - description: A ListToolDefsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListToolDefsResponse' + $ref: '#/components/schemas/VectorStoreFileObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/tool-runtime/rag-tool/insert: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/files/{file_id}: + delete: tags: - - V1 - summary: Index documents so they can be used by the RAG system. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: rag_tool_insert_v1_tool_runtime_rag_tool_insert_post + - Vector IO + summary: Delete a vector store file. + description: Delete a vector store file. + operationId: openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete parameters: - - name: args - in: query + - name: vector_store_id + in: path required: true schema: - title: Args - - name: kwargs - in: query + type: string + description: The ID of the vector store containing the file to delete. + title: Vector Store Id + description: The ID of the vector store containing the file to delete. + - name: file_id + in: path required: true schema: - title: Kwargs + type: string + description: The ID of the file to delete. + title: File Id + description: The ID of the file to delete. responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/VectorStoreFileDeleteResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/tool-runtime/rag-tool/query: - post: - tags: - - V1 - summary: Query the RAG system for context; typically invoked by the agent. - description: Typed endpoint for proper schema generation. - operationId: rag_tool_query_v1_tool_runtime_rag_tool_query_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_tool_runtime_rag_tool_query_Request' - required: true - responses: - '200': - description: RAGQueryResult containing the retrieved content and metadata + description: The request was invalid or malformed. content: application/json: schema: - $ref: '#/components/schemas/RAGQueryResult' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' + $ref: '#/components/schemas/Error' '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/toolgroups: - get: - tags: - - V1 - summary: List tool groups with optional provider. - description: Response-only endpoint for proper schema generation. - operationId: list_tool_groups_v1_toolgroups_get - responses: - '200': - description: A ListToolGroupsResponse. + description: The client has sent too many requests in a given amount of time. content: application/json: schema: - $ref: '#/components/schemas/ListToolGroupsResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + get: tags: - - V1 - summary: Register a tool group. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: register_tool_group_v1_toolgroups_post + - Vector IO + summary: Retrieves a vector store file. + description: Retrieves a vector store file. + operationId: openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get parameters: - - name: args - in: query + - name: vector_store_id + in: path required: true schema: - title: Args - - name: kwargs - in: query + type: string + description: The ID of the vector store containing the file to retrieve. + title: Vector Store Id + description: The ID of the vector store containing the file to retrieve. + - name: file_id + in: path required: true schema: - title: Kwargs + type: string + description: The ID of the file to retrieve. + title: File Id + description: The ID of the file to retrieve. responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/VectorStoreFileObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/toolgroups/{toolgroup_id}: - delete: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - V1 - summary: Unregister a tool group. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: unregister_toolgroup_v1_toolgroups__toolgroup_id__delete + - Vector IO + summary: Updates a vector store file. + description: Updates a vector store file. + operationId: openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query + - name: vector_store_id + in: path required: true schema: - title: Kwargs - - name: toolgroup_id + type: string + description: The ID of the vector store containing the file to update. + title: Vector Store Id + description: The ID of the vector store containing the file to update. + - name: file_id in: path required: true schema: type: string - description: 'Path parameter: toolgroup_id' + description: The ID of the file to update. + title: File Id + description: The ID of the file to update. + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: true + description: The updated key-value attributes to store with the file. + title: Attributes responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/VectorStoreFileObject' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/files/{file_id}/content: get: tags: - - V1 - summary: Get a tool group by its ID. - description: Query endpoint for proper schema generation. - operationId: get_tool_group_v1_toolgroups__toolgroup_id__get + - Vector IO + summary: Retrieves the contents of a vector store file. + description: Retrieves the contents of a vector store file. + operationId: openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get parameters: - - name: toolgroup_id + - name: vector_store_id in: path required: true schema: type: string - title: Toolgroup Id - responses: - '200': - description: A ToolGroup. - content: - application/json: - schema: - $ref: '#/components/schemas/ToolGroup' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/tools: - get: - tags: - - V1 - summary: List tools with optional tool group. - description: Query endpoint for proper schema generation. - operationId: list_tools_v1_tools_get - parameters: - - name: toolgroup_id - in: query + description: The ID of the vector store containing the file to retrieve. + title: Vector Store Id + description: The ID of the vector store containing the file to retrieve. + - name: file_id + in: path required: true schema: type: string - title: Toolgroup Id + description: The ID of the file to retrieve. + title: File Id + description: The ID of the file to retrieve. responses: '200': - description: A ListToolDefsResponse. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ListToolDefsResponse' + $ref: '#/components/schemas/VectorStoreFileContentsResponse' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/tools/{tool_name}: - get: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/vector_stores/{vector_store_id}/search: + post: tags: - - V1 - summary: Get a tool by its name. - description: Query endpoint for proper schema generation. - operationId: get_tool_v1_tools__tool_name__get + - Vector IO + summary: Search for chunks in a vector store. + description: Search for chunks in a vector store. + operationId: openai_search_vector_store_v1_vector_stores__vector_store_id__search_post parameters: - - name: tool_name + - name: vector_store_id in: path required: true schema: type: string - title: Tool Name + description: The ID of the vector store to search. + title: Vector Store Id + description: The ID of the vector store to search. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Body_openai_search_vector_store_v1_vector_stores__vector_store_id__search_post' responses: '200': - description: A ToolDef. + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/ToolDef' + $ref: '#/components/schemas/VectorStoreSearchResponsePage' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + description: The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/vector-io/insert: - post: + description: An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /v1/version: + get: tags: - - V1 - summary: Insert chunks into a vector database. - description: Generic endpoint - this would be replaced with actual implementation. - operationId: insert_chunks_v1_vector_io_insert_post - parameters: - - name: args - in: query - required: true - schema: - title: Args - - name: kwargs - in: query - required: true - schema: - title: Kwargs + - Inspect + summary: Get version. + description: Get the version of the service. + operationId: version_v1_version_get responses: '200': description: Successful Response content: application/json: - schema: {} + schema: + $ref: '#/components/schemas/VersionInfo' '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request + description: The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests + description: The client has sent too many requests in a given amount of time. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/vector-io/query: - post: - tags: - - V1 - summary: Query chunks from a vector database. - description: Typed endpoint for proper schema generation. - operationId: query_chunks_v1_vector_io_query_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_vector_io_query_Request' - required: true - responses: - '200': - description: A QueryChunksResponse. - content: - application/json: - schema: - $ref: '#/components/schemas/QueryChunksResponse' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - /v1/vector_stores: - get: - tags: - - V1 - summary: Returns a list of vector stores. - description: Query endpoint for proper schema generation. - operationId: openai_list_vector_stores_v1_vector_stores_get - parameters: - - name: after - in: query - required: true - schema: - type: string - title: After - - name: before - in: query - required: true - schema: - type: string - title: Before - - name: limit - in: query - required: false - schema: - type: integer - default: 20 - title: Limit - - name: order - in: query - required: false - schema: - type: string - default: desc - title: Order - responses: - '200': - description: A VectorStoreListResponse containing the list of vector stores. + description: The server encountered an unexpected error. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreListResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error + $ref: '#/components/schemas/Error' default: - $ref: '#/components/responses/DefaultError' - description: Default Response - post: - tags: - - V1 - summary: Creates a vector store. - description: Typed endpoint for proper schema generation. - operationId: openai_create_vector_store_v1_vector_stores_post - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody' - responses: - '200': - description: A VectorStoreObject representing the created vector store. + description: An unexpected error occurred. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/vector_stores/{vector_store_id}: - delete: - tags: - - V1 - summary: Delete a vector store. - description: Query endpoint for proper schema generation. - operationId: openai_delete_vector_store_v1_vector_stores__vector_store_id__delete - parameters: - - name: vector_store_id - in: path - required: true - schema: + $ref: '#/components/schemas/Error' +components: + schemas: + Agent: + properties: + agent_id: type: string - title: Vector Store Id - description: The ID of the vector store to delete. - responses: - '200': - description: A VectorStoreDeleteResponse indicating the deletion status. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreDeleteResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - get: - tags: - - V1 - summary: Retrieves a vector store. - description: Query endpoint for proper schema generation. - operationId: openai_retrieve_vector_store_v1_vector_stores__vector_store_id__get - parameters: - - name: vector_store_id - in: path - required: true - schema: + title: Agent Id + description: Unique identifier for the agent + agent_config: + $ref: '#/components/schemas/AgentConfig-Output' + description: Configuration settings for the agent + created_at: type: string - title: Vector Store Id - description: The ID of the vector store to retrieve. - responses: - '200': - description: A VectorStoreObject representing the vector store. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - post: - tags: - - V1 - summary: Updates a vector store. - description: Typed endpoint for proper schema generation. - operationId: openai_update_vector_store_v1_vector_stores__vector_store_id__post - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/_vector_stores_vector_store_id_Request' - responses: - '200': - description: A VectorStoreObject representing the updated vector store. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - parameters: - - name: vector_store_id - in: path - required: true - schema: + format: date-time + title: Created At + description: Timestamp when the agent was created + type: object + required: + - agent_id + - agent_config + - created_at + title: Agent + description: An agent instance with configuration and metadata. + AgentCandidate: + properties: + type: type: string - description: The ID of the vector store to update. - /v1/vector_stores/{vector_store_id}/file_batches: - post: - tags: - - V1 - summary: Create a vector store file batch. - description: Typed endpoint for proper schema generation. - operationId: openai_create_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAICreateVectorStoreFileBatchRequestWithExtraBody' - required: true - responses: - '200': - description: A VectorStoreFileBatchObject representing the created file batch. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileBatchObject' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: vector_store_id - in: path - required: true - schema: + const: agent + title: Type + description: The type of candidate. + default: agent + config: + $ref: '#/components/schemas/AgentConfig-Input' + description: The configuration for the agent candidate. + type: object + required: + - config + title: AgentCandidate + description: An agent candidate for evaluation. + AgentConfig-Input: + properties: + sampling_params: + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' + input_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Input Shields + output_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields + toolgroups: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups + client_tools: + anyOf: + - items: + $ref: '#/components/schemas/ToolDef' + type: array + - type: 'null' + title: Client Tools + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: 'null' + deprecated: true + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + deprecated: true + tool_config: + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' + max_infer_iters: + anyOf: + - type: integer + - type: 'null' + title: Max Infer Iters + default: 10 + model: type: string - description: The ID of the vector store to create the file batch for. - /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: - get: - tags: - - V1 - summary: Retrieve a vector store file batch. - description: Query endpoint for proper schema generation. - operationId: openai_retrieve_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__get - parameters: - - name: batch_id - in: path - required: true - schema: + title: Model + description: The model identifier to use for the agent + instructions: type: string - title: Batch Id - description: The ID of the file batch to retrieve. - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - description: The ID of the vector store containing the file batch. - responses: - '200': - description: A VectorStoreFileBatchObject representing the file batch. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileBatchObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: - post: - tags: - - V1 - summary: Cancels a vector store file batch. - description: Typed endpoint for proper schema generation. - operationId: openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_vector_stores_vector_store_id_file_batches_batch_id_cancel_Request' - required: true - responses: - '200': - description: A VectorStoreFileBatchObject representing the cancelled file batch. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileBatchObject' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: batch_id - in: path - required: true - schema: - type: string - description: The ID of the file batch to cancel. - - name: vector_store_id - in: path - required: true - schema: - type: string - description: The ID of the vector store containing the file batch. - /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: - get: - tags: - - V1 - summary: Returns a list of vector store files in a batch. - description: Query endpoint for proper schema generation. - operationId: openai_list_files_in_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__files_get - parameters: - - name: after - in: query - required: true - schema: - type: string - title: After - - name: before - in: query - required: true - schema: - type: string - title: Before - - name: filter - in: query - required: true - schema: - type: string - title: Filter - - name: limit - in: query - required: false - schema: - type: integer - default: 20 - title: Limit - - name: order - in: query - required: false - schema: - type: string - default: desc - title: Order - - name: batch_id - in: path - required: true - schema: - type: string - title: Batch Id - description: The ID of the file batch to list files from. - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - description: The ID of the vector store containing the file batch. - responses: - '200': - description: A VectorStoreFilesListInBatchResponse containing the list of files in the batch. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFilesListInBatchResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/vector_stores/{vector_store_id}/files: - get: - tags: - - V1 - summary: List files in a vector store. - description: Query endpoint for proper schema generation. - operationId: openai_list_files_in_vector_store_v1_vector_stores__vector_store_id__files_get - parameters: - - name: after - in: query - required: true - schema: - type: string - title: After - - name: before - in: query - required: true - schema: - type: string - title: Before - - name: filter - in: query - required: true - schema: - type: string - title: Filter - - name: limit - in: query - required: false - schema: - type: integer - default: 20 - title: Limit - - name: order - in: query - required: false - schema: - type: string - default: desc - title: Order - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - description: The ID of the vector store to list files from. - responses: - '200': - description: A VectorStoreListFilesResponse containing the list of files. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreListFilesResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - post: - tags: - - V1 - summary: Attach a file to a vector store. - description: Typed endpoint for proper schema generation. - operationId: openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/_vector_stores_vector_store_id_files_Request' - responses: - '200': - description: A VectorStoreFileObject representing the attached file. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - description: The ID of the vector store to attach the file to. - /v1/vector_stores/{vector_store_id}/files/{file_id}: - delete: - tags: - - V1 - summary: Delete a vector store file. - description: Query endpoint for proper schema generation. - operationId: openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - description: The ID of the vector store containing the file to delete. - - name: file_id - in: path - required: true - schema: - type: string - title: File Id - description: The ID of the file to delete. - responses: - '200': - description: A VectorStoreFileDeleteResponse indicating the deletion status. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileDeleteResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - get: - tags: - - V1 - summary: Retrieves a vector store file. - description: Query endpoint for proper schema generation. - operationId: openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - description: The ID of the vector store containing the file to retrieve. - - name: file_id - in: path - required: true - schema: - type: string - title: File Id - description: The ID of the file to retrieve. - responses: - '200': - description: A VectorStoreFileObject representing the file. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - post: - tags: - - V1 - summary: Updates a vector store file. - description: Typed endpoint for proper schema generation. - operationId: openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/_vector_stores_vector_store_id_files_file_id_Request' - responses: - '200': - description: A VectorStoreFileObject representing the updated file. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileObject' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - description: The ID of the vector store containing the file to update. - - name: file_id - in: path - required: true - schema: - type: string - description: The ID of the file to update. - /v1/vector_stores/{vector_store_id}/files/{file_id}/content: - get: - tags: - - V1 - summary: Retrieves the contents of a vector store file. - description: Query endpoint for proper schema generation. - operationId: openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - title: Vector Store Id - description: The ID of the vector store containing the file to retrieve. - - name: file_id - in: path - required: true - schema: - type: string - title: File Id - description: The ID of the file to retrieve. - responses: - '200': - description: A list of InterleavedContent representing the file contents. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreFileContentsResponse' - '400': - $ref: '#/components/responses/BadRequest400' - description: Bad Request - '429': - $ref: '#/components/responses/TooManyRequests429' - description: Too Many Requests - '500': - $ref: '#/components/responses/InternalServerError500' - description: Internal Server Error - default: - $ref: '#/components/responses/DefaultError' - description: Default Response - /v1/vector_stores/{vector_store_id}/search: - post: - tags: - - V1 - summary: Search for chunks in a vector store. - description: Typed endpoint for proper schema generation. - operationId: openai_search_vector_store_v1_vector_stores__vector_store_id__search_post - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_vector_stores_vector_store_id_search_Request' - required: true - responses: - '200': - description: A VectorStoreSearchResponse containing the search results. - content: - application/json: - schema: - $ref: '#/components/schemas/VectorStoreSearchResponsePage' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' - parameters: - - name: vector_store_id - in: path - required: true - schema: - type: string - description: The ID of the vector store to search. - /v1/version: - get: - tags: - - V1 - summary: Get version. - description: Response-only endpoint for proper schema generation. - operationId: version_v1_version_get - responses: - '200': - description: Version information containing the service version number. - content: - application/json: - schema: - $ref: '#/components/schemas/VersionInfo' - '400': - description: Bad Request - $ref: '#/components/responses/BadRequest400' - '429': - description: Too Many Requests - $ref: '#/components/responses/TooManyRequests429' - '500': - description: Internal Server Error - $ref: '#/components/responses/InternalServerError500' - default: - description: Default Response - $ref: '#/components/responses/DefaultError' -components: - schemas: - AgentCandidate: - properties: - type: - type: string - const: agent - title: Type - default: agent - config: - $ref: '#/components/schemas/AgentConfig' - type: object - required: - - config - title: AgentCandidate - description: An agent candidate for evaluation. - AgentConfig: - properties: - sampling_params: - $ref: '#/components/schemas/SamplingParams' - input_shields: - title: Input Shields - items: - type: string - type: array - output_shields: - title: Output Shields - items: - type: string - type: array - toolgroups: - title: Toolgroups - items: - anyOf: - - type: string - - $ref: '#/components/schemas/AgentToolGroupWithArgs' - type: array - client_tools: - title: Client Tools - items: - $ref: '#/components/schemas/ToolDef' - type: array - tool_choice: - deprecated: true - $ref: '#/components/schemas/ToolChoice' - tool_prompt_format: - deprecated: true - $ref: '#/components/schemas/ToolPromptFormat' - tool_config: - $ref: '#/components/schemas/ToolConfig' - max_infer_iters: - title: Max Infer Iters - default: 10 - type: integer - model: - type: string - title: Model - instructions: - type: string - title: Instructions - name: - title: Name - type: string - enable_session_persistence: - title: Enable Session Persistence - default: false - type: boolean - response_format: - title: Response Format - oneOf: - - $ref: '#/components/schemas/JsonSchemaResponseFormat' - - $ref: '#/components/schemas/GrammarResponseFormat' - discriminator: - propertyName: type - mapping: - grammar: '#/components/schemas/GrammarResponseFormat' - json_schema: '#/components/schemas/JsonSchemaResponseFormat' - type: object - required: - - model - - instructions - title: AgentConfig - description: Configuration for an agent. - AgentCreateResponse: - properties: - agent_id: - type: string - title: Agent Id - type: object - required: - - agent_id - title: AgentCreateResponse - description: Response returned when creating a new agent. - AgentSessionCreateResponse: - properties: - session_id: - type: string - title: Session Id - type: object - required: - - session_id - title: AgentSessionCreateResponse - description: Response returned when creating a new agent session. - AgentToolGroupWithArgs: - properties: - name: - type: string - title: Name - args: - additionalProperties: true - type: object - title: Args - type: object - required: - - name - - args - title: AgentToolGroupWithArgs - AgentTurnInputType: - properties: - type: - type: string - const: agent_turn_input - title: Type - default: agent_turn_input - type: object - title: AgentTurnInputType - description: Parameter type for agent turn input. - AggregationFunctionType: - type: string - enum: - - average - - weighted_average - - median - - categorical_count - - accuracy - title: AggregationFunctionType - description: Types of aggregation functions for scoring results. - AllowedToolsFilter: - properties: - tool_names: - title: Tool Names - items: - type: string - type: array - type: object - title: AllowedToolsFilter - description: Filter configuration for restricting which MCP tools can be used. - ApprovalFilter: - properties: - always: - title: Always - items: - type: string - type: array - never: - title: Never - items: - type: string - type: array - type: object - title: ApprovalFilter - description: Filter configuration for MCP tool approval requirements. - ArrayType: - properties: - type: - type: string - const: array - title: Type - default: array - type: object - title: ArrayType - description: Parameter type for array values. - Attachment-Output: - properties: - content: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - - $ref: '#/components/schemas/URL' - title: Content - mime_type: - type: string - title: Mime Type - type: object - required: - - content - - mime_type - title: Attachment - description: An attachment to an agent turn. - BasicScoringFnParams: - properties: - type: - type: string - const: basic - title: Type - default: basic - aggregation_functions: - items: - $ref: '#/components/schemas/AggregationFunctionType' - type: array - title: Aggregation Functions - description: Aggregation functions to apply to the scores of each row - type: object - title: BasicScoringFnParams - description: Parameters for basic scoring function configuration. - Batch: - properties: - id: - type: string - title: Id - completion_window: - type: string - title: Completion Window - created_at: - type: integer - title: Created At - endpoint: - type: string - title: Endpoint - input_file_id: - type: string - title: Input File Id - object: - type: string - const: batch - title: Object - status: - type: string - enum: - - validating - - failed - - in_progress - - finalizing - - completed - - expired - - cancelling - - cancelled - title: Status - cancelled_at: - title: Cancelled At - type: integer - cancelling_at: - title: Cancelling At - type: integer - completed_at: - title: Completed At - type: integer - error_file_id: - title: Error File Id - type: string - errors: - $ref: '#/components/schemas/Errors' - expired_at: - title: Expired At - type: integer - expires_at: - title: Expires At - type: integer - failed_at: - title: Failed At - type: integer - finalizing_at: - title: Finalizing At - type: integer - in_progress_at: - title: In Progress At - type: integer - metadata: - title: Metadata - additionalProperties: - type: string - type: object - model: - title: Model - type: string - output_file_id: - title: Output File Id - type: string - request_counts: - $ref: '#/components/schemas/BatchRequestCounts' - usage: - $ref: '#/components/schemas/BatchUsage' - additionalProperties: true - type: object - required: - - id - - completion_window - - created_at - - endpoint - - input_file_id - - object - - status - title: Batch - BatchError: - properties: - code: - title: Code - type: string - line: - title: Line - type: integer - message: - title: Message - type: string - param: - title: Param - type: string - additionalProperties: true - type: object - title: BatchError - BatchRequestCounts: - properties: - completed: - type: integer - title: Completed - failed: - type: integer - title: Failed - total: - type: integer - title: Total - additionalProperties: true - type: object - required: - - completed - - failed - - total - title: BatchRequestCounts - BatchUsage: - properties: - input_tokens: - type: integer - title: Input Tokens - input_tokens_details: - $ref: '#/components/schemas/InputTokensDetails' - output_tokens: - type: integer - title: Output Tokens - output_tokens_details: - $ref: '#/components/schemas/OutputTokensDetails' - total_tokens: - type: integer - title: Total Tokens - additionalProperties: true - type: object - required: - - input_tokens - - input_tokens_details - - output_tokens - - output_tokens_details - - total_tokens - title: BatchUsage - Benchmark: - properties: - identifier: - type: string - title: Identifier - description: Unique identifier for this resource in llama stack - provider_resource_id: - title: Provider Resource Id - description: Unique identifier for this resource in the provider - type: string - provider_id: - type: string - title: Provider Id - description: ID of the provider that owns this resource - type: - type: string - const: benchmark - title: Type - default: benchmark - dataset_id: - type: string - title: Dataset Id - scoring_functions: - items: - type: string - type: array - title: Scoring Functions - metadata: - additionalProperties: true - type: object - title: Metadata - description: Metadata for this evaluation task - type: object - required: - - identifier - - provider_id - - dataset_id - - scoring_functions - title: Benchmark - description: A benchmark resource for evaluating model performance. - BenchmarkConfig: - properties: - eval_candidate: - oneOf: - - $ref: '#/components/schemas/ModelCandidate' - - $ref: '#/components/schemas/AgentCandidate' - title: Eval Candidate - discriminator: - propertyName: type - mapping: - agent: '#/components/schemas/AgentCandidate' - model: '#/components/schemas/ModelCandidate' - scoring_params: - additionalProperties: - oneOf: - - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - - $ref: '#/components/schemas/RegexParserScoringFnParams' - - $ref: '#/components/schemas/BasicScoringFnParams' - discriminator: - propertyName: type - mapping: - basic: '#/components/schemas/BasicScoringFnParams' - llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' - regex_parser: '#/components/schemas/RegexParserScoringFnParams' - type: object - title: Scoring Params - description: Map between scoring function id and parameters for each scoring function you want to run - num_examples: - title: Num Examples - description: Number of examples to evaluate (useful for testing), if not provided, all examples in the dataset will be evaluated - type: integer - type: object - required: - - eval_candidate - title: BenchmarkConfig - description: A benchmark configuration for evaluation. - BooleanType: - properties: - type: - type: string - const: boolean - title: Type - default: boolean - type: object - title: BooleanType - description: Parameter type for boolean values. - BuiltinTool: - type: string - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - ChatCompletionInputType: - properties: - type: - type: string - const: chat_completion_input - title: Type - default: chat_completion_input - type: object - title: ChatCompletionInputType - description: Parameter type for chat completion input. - Chunk-Output: - properties: - content: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - title: Content - chunk_id: - type: string - title: Chunk Id - metadata: - additionalProperties: true - type: object - title: Metadata - embedding: - title: Embedding - items: - type: number - type: array - chunk_metadata: - $ref: '#/components/schemas/ChunkMetadata' - type: object - required: - - content - - chunk_id - title: Chunk - description: A chunk of content that can be inserted into a vector database. - ChunkMetadata: - properties: - chunk_id: - title: Chunk Id - type: string - document_id: - title: Document Id - type: string - source: - title: Source - type: string - created_timestamp: - title: Created Timestamp - type: integer - updated_timestamp: - title: Updated Timestamp - type: integer - chunk_window: - title: Chunk Window - type: string - chunk_tokenizer: - title: Chunk Tokenizer - type: string - chunk_embedding_model: - title: Chunk Embedding Model - type: string - chunk_embedding_dimension: - title: Chunk Embedding Dimension - type: integer - content_token_count: - title: Content Token Count - type: integer - metadata_token_count: - title: Metadata Token Count - type: integer - type: object - title: ChunkMetadata - description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." - CompletionInputType: - properties: - type: - type: string - const: completion_input - title: Type - default: completion_input - type: object - title: CompletionInputType - description: Parameter type for completion input. - CompletionMessage-Output: - properties: - role: - type: string - const: assistant - title: Role - default: assistant - content: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - title: Content - stop_reason: - $ref: '#/components/schemas/StopReason' - tool_calls: - title: Tool Calls - items: - $ref: '#/components/schemas/ToolCall' - type: array - type: object - required: - - content - - stop_reason - title: CompletionMessage - description: A message containing the model's (assistant) response in a chat conversation. - Conversation: - properties: - id: - type: string - title: Id - description: The unique ID of the conversation. - object: - type: string - const: conversation - title: Object - description: The object type, which is always conversation. - default: conversation - created_at: - type: integer - title: Created At - description: The time at which the conversation was created, measured in seconds since the Unix epoch. - metadata: - title: Metadata - description: Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. - additionalProperties: - type: string - type: object - items: - title: Items - description: Initial items to include in the conversation context. You may add up to 20 items at a time. - items: - additionalProperties: true - type: object - type: array - type: object - required: - - id - - created_at - title: Conversation - description: OpenAI-compatible conversation object. - ConversationItemInclude: - type: string - enum: - - web_search_call.action.sources - - code_interpreter_call.outputs - - computer_call_output.output.image_url - - file_search_call.results - - message.input_image.image_url - - message.output_text.logprobs - - reasoning.encrypted_content - title: ConversationItemInclude - description: Specify additional output data to include in the model response. - ConversationItemList: - properties: - object: - type: string - title: Object - description: Object type - default: list - data: - items: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage-Output' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - discriminator: - propertyName: type - mapping: - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - message: '#/components/schemas/OpenAIResponseMessage-Output' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - type: array - title: Data - description: List of conversation items - first_id: - title: First Id - description: The ID of the first item in the list - type: string - last_id: - title: Last Id - description: The ID of the last item in the list - type: string - has_more: - type: boolean - title: Has More - description: Whether there are more items available - default: false - type: object - required: - - data - title: ConversationItemList - description: List of conversation items with pagination. - DPOAlignmentConfig: - properties: - beta: - type: number - title: Beta - loss_type: - $ref: '#/components/schemas/DPOLossType' - default: sigmoid - type: object - required: - - beta - title: DPOAlignmentConfig - description: Configuration for Direct Preference Optimization (DPO) alignment. - DPOLossType: - type: string - enum: - - sigmoid - - hinge - - ipo - - kto_pair - title: DPOLossType - DataConfig: - properties: - dataset_id: - type: string - title: Dataset Id - batch_size: - type: integer - title: Batch Size - shuffle: - type: boolean - title: Shuffle - data_format: - $ref: '#/components/schemas/DatasetFormat' - validation_dataset_id: - title: Validation Dataset Id - type: string - packed: - title: Packed - default: false - type: boolean - train_on_input: - title: Train On Input - default: false - type: boolean - type: object - required: - - dataset_id - - batch_size - - shuffle - - data_format - title: DataConfig - description: Configuration for training data and data loading. - Dataset: - properties: - identifier: - type: string - title: Identifier - description: Unique identifier for this resource in llama stack - provider_resource_id: - title: Provider Resource Id - description: Unique identifier for this resource in the provider - type: string - provider_id: - type: string - title: Provider Id - description: ID of the provider that owns this resource - type: - type: string - const: dataset - title: Type - default: dataset - purpose: - $ref: '#/components/schemas/DatasetPurpose' - source: - oneOf: - - $ref: '#/components/schemas/URIDataSource' - - $ref: '#/components/schemas/RowsDataSource' - title: Source - discriminator: - propertyName: type - mapping: - rows: '#/components/schemas/RowsDataSource' - uri: '#/components/schemas/URIDataSource' - metadata: - additionalProperties: true - type: object - title: Metadata - description: Any additional metadata for this dataset - type: object - required: - - identifier - - provider_id - - purpose - - source - title: Dataset - description: Dataset resource for storing and accessing training or evaluation data. - DatasetFormat: - type: string - enum: - - instruct - - dialog - title: DatasetFormat - description: Format of the training dataset. - DatasetPurpose: - type: string - enum: - - post-training/messages - - eval/question-answer - - eval/messages-answer - title: DatasetPurpose - description: Purpose of the dataset. Each purpose has a required input data schema. - DefaultRAGQueryGeneratorConfig: - properties: - type: - type: string - const: default - title: Type - default: default - separator: - type: string - title: Separator - default: ' ' - type: object - title: DefaultRAGQueryGeneratorConfig - description: Configuration for the default RAG query generator. - Document: - properties: - content: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' - type: array - - $ref: '#/components/schemas/URL' - title: Content - mime_type: - type: string - title: Mime Type - type: object - required: - - content - - mime_type - title: Document - description: A document to be used by an agent. - EfficiencyConfig: - properties: - enable_activation_checkpointing: - title: Enable Activation Checkpointing - default: false - type: boolean - enable_activation_offloading: - title: Enable Activation Offloading - default: false - type: boolean - memory_efficient_fsdp_wrap: - title: Memory Efficient Fsdp Wrap - default: false - type: boolean - fsdp_cpu_offload: - title: Fsdp Cpu Offload - default: false - type: boolean - type: object - title: EfficiencyConfig - description: Configuration for memory and compute efficiency optimizations. - Errors: - properties: - data: - title: Data - items: - $ref: '#/components/schemas/BatchError' - type: array - object: - title: Object - type: string - additionalProperties: true - type: object - title: Errors - EvaluateResponse: - properties: - generations: - items: - additionalProperties: true - type: object - type: array - title: Generations - scores: - additionalProperties: - $ref: '#/components/schemas/ScoringResult' - type: object - title: Scores - type: object - required: - - generations - - scores - title: EvaluateResponse - description: The response from an evaluation. - GrammarResponseFormat: - properties: - type: - type: string - const: grammar - title: Type - default: grammar - bnf: - additionalProperties: true - type: object - title: Bnf - type: object - required: - - bnf - title: GrammarResponseFormat - description: Configuration for grammar-guided response generation. - GreedySamplingStrategy: - properties: - type: - type: string - const: greedy - title: Type - default: greedy - type: object - title: GreedySamplingStrategy - description: Greedy sampling strategy that selects the highest probability token at each step. - HealthInfo: - properties: - status: - $ref: '#/components/schemas/HealthStatus' - type: object - required: - - status - title: HealthInfo - description: Health status information for the service. - HealthStatus: - type: string - enum: - - OK - - Error - - Not Implemented - title: HealthStatus - ImageContentItem-Input: - properties: - type: - type: string - const: image - title: Type - default: image - image: - $ref: '#/components/schemas/_URLOrData' - type: object - required: - - image - title: ImageContentItem - description: A image content item - ImageContentItem-Output: - properties: - type: - type: string - const: image - title: Type - default: image - image: - $ref: '#/components/schemas/_URLOrData' - type: object - required: - - image - title: ImageContentItem - description: A image content item - InferenceStep-Output: - properties: - turn_id: - type: string - title: Turn Id - step_id: - type: string - title: Step Id - started_at: - title: Started At - type: string - format: date-time - completed_at: - title: Completed At - type: string - format: date-time - step_type: - type: string - const: inference - title: Step Type - default: inference - model_response: - $ref: '#/components/schemas/CompletionMessage-Output' - type: object - required: - - turn_id - - step_id - - model_response - title: InferenceStep - description: An inference step in an agent turn. - InputTokensDetails: - properties: - cached_tokens: - type: integer - title: Cached Tokens - additionalProperties: true - type: object - required: - - cached_tokens - title: InputTokensDetails - Job: - properties: - job_id: - type: string - title: Job Id - status: - $ref: '#/components/schemas/JobStatus' - type: object - required: - - job_id - - status - title: Job - description: A job execution instance with status tracking. - JobStatus: - type: string - enum: - - completed - - in_progress - - failed - - scheduled - - cancelled - title: JobStatus - description: Status of a job execution. - JsonSchemaResponseFormat: - properties: - type: - type: string - const: json_schema - title: Type - default: json_schema - json_schema: - additionalProperties: true - type: object - title: Json Schema - type: object - required: - - json_schema - title: JsonSchemaResponseFormat - description: Configuration for JSON schema-guided response generation. - JsonType: - properties: - type: - type: string - const: json - title: Type - default: json - type: object - title: JsonType - description: Parameter type for JSON values. - LLMAsJudgeScoringFnParams: - properties: - type: - type: string - const: llm_as_judge - title: Type - default: llm_as_judge - judge_model: - type: string - title: Judge Model - prompt_template: - title: Prompt Template - type: string - judge_score_regexes: - items: - type: string - type: array - title: Judge Score Regexes - description: Regexes to extract the answer from generated response - aggregation_functions: - items: - $ref: '#/components/schemas/AggregationFunctionType' - type: array - title: Aggregation Functions - description: Aggregation functions to apply to the scores of each row - type: object - required: - - judge_model - title: LLMAsJudgeScoringFnParams - description: Parameters for LLM-as-judge scoring function configuration. - LLMRAGQueryGeneratorConfig: - properties: - type: - type: string - const: llm - title: Type - default: llm - model: - type: string - title: Model - template: - type: string - title: Template - type: object - required: - - model - - template - title: LLMRAGQueryGeneratorConfig - description: Configuration for the LLM-based RAG query generator. - ListBenchmarksResponse: - properties: - data: - items: - $ref: '#/components/schemas/Benchmark' - type: array - title: Data - type: object - required: - - data - title: ListBenchmarksResponse - ListDatasetsResponse: - properties: - data: - items: - $ref: '#/components/schemas/Dataset' - type: array - title: Data - type: object - required: - - data - title: ListDatasetsResponse - description: Response from listing datasets. - ListModelsResponse: - properties: - data: - items: - $ref: '#/components/schemas/Model' - type: array - title: Data - type: object - required: - - data - title: ListModelsResponse - ListPostTrainingJobsResponse: - properties: - data: - items: - $ref: '#/components/schemas/PostTrainingJob' - type: array - title: Data - type: object - required: - - data - title: ListPostTrainingJobsResponse - ListPromptsResponse: - properties: - data: - items: - $ref: '#/components/schemas/Prompt' - type: array - title: Data - type: object - required: - - data - title: ListPromptsResponse - description: Response model to list prompts. - ListProvidersResponse: - properties: - data: - items: - $ref: '#/components/schemas/ProviderInfo' - type: array - title: Data - type: object - required: - - data - title: ListProvidersResponse - description: Response containing a list of all available providers. - ListRoutesResponse: - properties: - data: - items: - $ref: '#/components/schemas/RouteInfo' - type: array - title: Data - type: object - required: - - data - title: ListRoutesResponse - description: Response containing a list of all available API routes. - ListScoringFunctionsResponse: - properties: - data: - items: - $ref: '#/components/schemas/ScoringFn-Output' - type: array - title: Data - type: object - required: - - data - title: ListScoringFunctionsResponse - ListShieldsResponse: - properties: - data: - items: - $ref: '#/components/schemas/Shield' - type: array - title: Data - type: object - required: - - data - title: ListShieldsResponse - ListToolGroupsResponse: - properties: - data: - items: - $ref: '#/components/schemas/ToolGroup' - type: array - title: Data - type: object - required: - - data - title: ListToolGroupsResponse - description: Response containing a list of tool groups. - MCPListToolsTool: - properties: - input_schema: - additionalProperties: true - type: object - title: Input Schema - name: - type: string - title: Name - description: - title: Description - type: string - type: object - required: - - input_schema - - name - title: MCPListToolsTool - description: Tool definition returned by MCP list tools operation. - MemoryRetrievalStep-Output: - properties: - turn_id: - type: string - title: Turn Id - step_id: - type: string - title: Step Id - started_at: - title: Started At - type: string - format: date-time - completed_at: - title: Completed At - type: string - format: date-time - step_type: - type: string - const: memory_retrieval - title: Step Type - default: memory_retrieval - vector_store_ids: - type: string - title: Vector Store Ids - inserted_context: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - title: Inserted Context - type: object - required: - - turn_id - - step_id - - vector_store_ids - - inserted_context - title: MemoryRetrievalStep - description: A memory retrieval step in an agent turn. - Model: - properties: - identifier: - type: string - title: Identifier - description: Unique identifier for this resource in llama stack - provider_resource_id: - title: Provider Resource Id - description: Unique identifier for this resource in the provider - type: string - provider_id: - type: string - title: Provider Id - description: ID of the provider that owns this resource - type: - type: string - const: model - title: Type - default: model - metadata: - additionalProperties: true - type: object - title: Metadata - description: Any additional metadata for this model - model_type: - $ref: '#/components/schemas/ModelType' - default: llm - type: object - required: - - identifier - - provider_id - title: Model - description: A model resource representing an AI model registered in Llama Stack. - ModelCandidate: - properties: - type: - type: string - const: model - title: Type - default: model - model: - type: string - title: Model - sampling_params: - $ref: '#/components/schemas/SamplingParams' - system_message: - $ref: '#/components/schemas/SystemMessage' - type: object - required: - - model - - sampling_params - title: ModelCandidate - description: A model candidate for evaluation. - ModelType: - type: string - enum: - - llm - - embedding - - rerank - title: ModelType - description: Enumeration of supported model types in Llama Stack. - ModerationObject: - properties: - id: - type: string - title: Id - model: - type: string - title: Model - results: - items: - $ref: '#/components/schemas/ModerationObjectResults' - type: array - title: Results - type: object - required: - - id - - model - - results - title: ModerationObject - description: A moderation object. - ModerationObjectResults: - properties: - flagged: - type: boolean - title: Flagged - categories: - title: Categories - additionalProperties: - type: boolean - type: object - category_applied_input_types: - title: Category Applied Input Types - additionalProperties: - items: - type: string - type: array - type: object - category_scores: - title: Category Scores - additionalProperties: - type: number - type: object - user_message: - title: User Message - type: string - metadata: - additionalProperties: true - type: object - title: Metadata - type: object - required: - - flagged - title: ModerationObjectResults - description: A moderation object. - NumberType: - properties: - type: - type: string - const: number - title: Type - default: number - type: object - title: NumberType - description: Parameter type for numeric values. - ObjectType: - properties: - type: - type: string - const: object - title: Type - default: object - type: object - title: ObjectType - description: Parameter type for object values. - OpenAIAssistantMessageParam-Input: - properties: - role: - type: string - const: assistant - title: Role - default: assistant - content: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - name: - title: Name - type: string - tool_calls: - title: Tool Calls - items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' - type: array - type: object - title: OpenAIAssistantMessageParam - description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. - OpenAIAssistantMessageParam-Output: - properties: - role: - type: string - const: assistant - title: Role - default: assistant - content: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - name: - title: Name - type: string - tool_calls: - title: Tool Calls - items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' - type: array - type: object - title: OpenAIAssistantMessageParam - description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. - OpenAIChatCompletion: - properties: - id: - type: string - title: Id - choices: - items: - $ref: '#/components/schemas/OpenAIChoice-Output' - type: array - title: Choices - object: - type: string - const: chat.completion - title: Object - default: chat.completion - created: - type: integer - title: Created - model: - type: string - title: Model - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - type: object - required: - - id - - choices - - created - - model - title: OpenAIChatCompletion - description: Response from an OpenAI-compatible chat completion request. - OpenAIChatCompletionContentPartImageParam: - properties: - type: - type: string - const: image_url - title: Type - default: image_url - image_url: - $ref: '#/components/schemas/OpenAIImageURL' - type: object - required: - - image_url - title: OpenAIChatCompletionContentPartImageParam - description: Image content part for OpenAI-compatible chat completion messages. - OpenAIChatCompletionContentPartTextParam: - properties: - type: - type: string - const: text - title: Type - default: text - text: - type: string - title: Text - type: object - required: - - text - title: OpenAIChatCompletionContentPartTextParam - description: Text content part for OpenAI-compatible chat completion messages. - OpenAIChatCompletionRequestWithExtraBody: - properties: - model: - type: string - title: Model - messages: - items: - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - discriminator: - propertyName: role - mapping: - assistant: '#/components/schemas/OpenAIAssistantMessageParam-Input' - developer: '#/components/schemas/OpenAIDeveloperMessageParam' - system: '#/components/schemas/OpenAISystemMessageParam' - tool: '#/components/schemas/OpenAIToolMessageParam' - user: '#/components/schemas/OpenAIUserMessageParam-Input' - type: array - minItems: 1 - title: Messages - frequency_penalty: - title: Frequency Penalty - type: number - function_call: - anyOf: - - type: string - - additionalProperties: true - type: object - title: Function Call - functions: - title: Functions - items: - additionalProperties: true - type: object - type: array - logit_bias: - title: Logit Bias - additionalProperties: - type: number - type: object - logprobs: - title: Logprobs - type: boolean - max_completion_tokens: - title: Max Completion Tokens - type: integer - max_tokens: - title: Max Tokens - type: integer - n: - title: N - type: integer - parallel_tool_calls: - title: Parallel Tool Calls - type: boolean - presence_penalty: - title: Presence Penalty - type: number - response_format: - title: Response Format - oneOf: - - $ref: '#/components/schemas/OpenAIResponseFormatText' - - $ref: '#/components/schemas/OpenAIResponseFormatJSONSchema' - - $ref: '#/components/schemas/OpenAIResponseFormatJSONObject' - discriminator: - propertyName: type - mapping: - json_object: '#/components/schemas/OpenAIResponseFormatJSONObject' - json_schema: '#/components/schemas/OpenAIResponseFormatJSONSchema' - text: '#/components/schemas/OpenAIResponseFormatText' - seed: - title: Seed - type: integer - stop: - anyOf: - - type: string - - items: - type: string - type: array - title: Stop - stream: - title: Stream - type: boolean - stream_options: - title: Stream Options - additionalProperties: true - type: object - temperature: - title: Temperature - type: number - tool_choice: - anyOf: - - type: string - - additionalProperties: true - type: object - title: Tool Choice - tools: - title: Tools - items: - additionalProperties: true - type: object - type: array - top_logprobs: - title: Top Logprobs - type: integer - top_p: - title: Top P - type: number - user: - title: User - type: string - additionalProperties: true - type: object - required: - - model - - messages - title: OpenAIChatCompletionRequestWithExtraBody - description: Request parameters for OpenAI-compatible chat completion endpoint. - OpenAIChatCompletionToolCall: - properties: - index: - title: Index - type: integer - id: - title: Id - type: string - type: - type: string - const: function - title: Type - default: function - function: - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' - type: object - title: OpenAIChatCompletionToolCall - description: Tool call specification for OpenAI-compatible chat completion responses. - OpenAIChatCompletionToolCallFunction: - properties: - name: - title: Name - type: string - arguments: - title: Arguments - type: string - type: object - title: OpenAIChatCompletionToolCallFunction - description: Function call details for OpenAI-compatible tool calls. - OpenAIChatCompletionUsage: - properties: - prompt_tokens: - type: integer - title: Prompt Tokens - completion_tokens: - type: integer - title: Completion Tokens - total_tokens: - type: integer - title: Total Tokens - prompt_tokens_details: - $ref: '#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails' - completion_tokens_details: - $ref: '#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails' - type: object - required: - - prompt_tokens - - completion_tokens - - total_tokens - title: OpenAIChatCompletionUsage - description: Usage information for OpenAI chat completion. - OpenAIChatCompletionUsageCompletionTokensDetails: - properties: - reasoning_tokens: - title: Reasoning Tokens - type: integer - type: object - title: OpenAIChatCompletionUsageCompletionTokensDetails - description: Token details for output tokens in OpenAI chat completion usage. - OpenAIChatCompletionUsagePromptTokensDetails: - properties: - cached_tokens: - title: Cached Tokens - type: integer - type: object - title: OpenAIChatCompletionUsagePromptTokensDetails - description: Token details for prompt tokens in OpenAI chat completion usage. - OpenAIChoice-Output: - properties: - message: - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam-Output' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Output' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - title: Message - discriminator: - propertyName: role - mapping: - assistant: '#/components/schemas/OpenAIAssistantMessageParam-Output' - developer: '#/components/schemas/OpenAIDeveloperMessageParam' - system: '#/components/schemas/OpenAISystemMessageParam' - tool: '#/components/schemas/OpenAIToolMessageParam' - user: '#/components/schemas/OpenAIUserMessageParam-Output' - finish_reason: - type: string - title: Finish Reason - index: - type: integer - title: Index - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' - type: object - required: - - message - - finish_reason - - index - title: OpenAIChoice - description: A choice from an OpenAI-compatible chat completion response. - OpenAIChoiceLogprobs-Output: - properties: - content: - title: Content - items: - $ref: '#/components/schemas/OpenAITokenLogProb' - type: array - refusal: - title: Refusal - items: - $ref: '#/components/schemas/OpenAITokenLogProb' - type: array - type: object - title: OpenAIChoiceLogprobs - description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. - OpenAICompletion: - properties: - id: - type: string - title: Id - choices: - items: - $ref: '#/components/schemas/OpenAICompletionChoice-Output' - type: array - title: Choices - created: - type: integer - title: Created - model: - type: string - title: Model - object: - type: string - const: text_completion - title: Object - default: text_completion - type: object - required: - - id - - choices - - created - - model - title: OpenAICompletion - description: Response from an OpenAI-compatible completion request. - OpenAICompletionChoice-Output: - properties: - finish_reason: - type: string - title: Finish Reason - text: - type: string - title: Text - index: - type: integer - title: Index - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' - type: object - required: - - finish_reason - - text - - index - title: OpenAICompletionChoice - description: A choice from an OpenAI-compatible completion response. - OpenAICompletionRequestWithExtraBody: - properties: - model: - type: string - title: Model - prompt: - anyOf: - - type: string - - items: - type: string - type: array - - items: - type: integer - type: array - - items: - items: - type: integer - type: array - type: array - title: Prompt - best_of: - title: Best Of - type: integer - echo: - title: Echo - type: boolean - frequency_penalty: - title: Frequency Penalty - type: number - logit_bias: - title: Logit Bias - additionalProperties: - type: number - type: object - logprobs: - title: Logprobs - type: boolean - max_tokens: - title: Max Tokens - type: integer - n: - title: N - type: integer - presence_penalty: - title: Presence Penalty - type: number - seed: - title: Seed - type: integer - stop: - anyOf: - - type: string - - items: - type: string - type: array - title: Stop - stream: - title: Stream - type: boolean - stream_options: - title: Stream Options - additionalProperties: true - type: object - temperature: - title: Temperature - type: number - top_p: - title: Top P - type: number - user: - title: User - type: string - suffix: - title: Suffix - type: string - additionalProperties: true - type: object - required: - - model - - prompt - title: OpenAICompletionRequestWithExtraBody - description: Request parameters for OpenAI-compatible completion endpoint. - OpenAICreateVectorStoreFileBatchRequestWithExtraBody: - properties: - file_ids: - items: - type: string - type: array - title: File Ids - attributes: - title: Attributes - additionalProperties: true - type: object - chunking_strategy: - title: Chunking Strategy - oneOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' - discriminator: - propertyName: type - mapping: - auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' - static: '#/components/schemas/VectorStoreChunkingStrategyStatic' - additionalProperties: true - type: object - required: - - file_ids - title: OpenAICreateVectorStoreFileBatchRequestWithExtraBody - description: Request to create a vector store file batch with extra_body support. - OpenAICreateVectorStoreRequestWithExtraBody: - properties: - name: - title: Name - type: string - file_ids: - title: File Ids - items: - type: string - type: array - expires_after: - title: Expires After - additionalProperties: true - type: object - chunking_strategy: - title: Chunking Strategy - additionalProperties: true - type: object - metadata: - title: Metadata - additionalProperties: true - type: object - additionalProperties: true - type: object - title: OpenAICreateVectorStoreRequestWithExtraBody - description: Request to create a vector store with extra_body support. - OpenAIDeveloperMessageParam: - properties: - role: - type: string - const: developer - title: Role - default: developer - content: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content + title: Instructions + description: The system instructions for the agent name: - title: Name - type: string - type: object - required: - - content - title: OpenAIDeveloperMessageParam - description: A message from the developer in an OpenAI-compatible chat completion request. - OpenAIEmbeddingData: - properties: - object: - type: string - const: embedding - title: Object - default: embedding - embedding: anyOf: - - items: - type: number - type: array - type: string - title: Embedding - index: - type: integer - title: Index - type: object - required: - - embedding - - index - title: OpenAIEmbeddingData - description: A single embedding data object from an OpenAI-compatible embeddings response. - OpenAIEmbeddingUsage: - properties: - prompt_tokens: - type: integer - title: Prompt Tokens - total_tokens: - type: integer - title: Total Tokens + - type: 'null' + title: Name + description: Optional name for the agent, used in telemetry and identification + enable_session_persistence: + anyOf: + - type: boolean + - type: 'null' + title: Enable Session Persistence + description: Optional flag indicating whether session data has to be persisted + default: false + response_format: + anyOf: + - oneOf: + - $ref: '#/components/schemas/JsonSchemaResponseFormat' + - $ref: '#/components/schemas/GrammarResponseFormat' + discriminator: + propertyName: type + mapping: + grammar: '#/components/schemas/GrammarResponseFormat' + json_schema: '#/components/schemas/JsonSchemaResponseFormat' + - type: 'null' + title: Response Format + description: Optional response format configuration type: object required: - - prompt_tokens - - total_tokens - title: OpenAIEmbeddingUsage - description: Usage information for an OpenAI-compatible embeddings response. - OpenAIEmbeddingsRequestWithExtraBody: + - model + - instructions + title: AgentConfig + description: Configuration for an agent. + AgentConfig-Output: properties: - model: - type: string - title: Model - input: + sampling_params: + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' + input_shields: anyOf: - - type: string - items: type: string type: array - title: Input - encoding_format: - title: Encoding Format - default: float + - type: 'null' + title: Input Shields + output_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields + toolgroups: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups + client_tools: + anyOf: + - items: + $ref: '#/components/schemas/ToolDef' + type: array + - type: 'null' + title: Client Tools + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: 'null' + deprecated: true + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + deprecated: true + tool_config: + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' + max_infer_iters: + anyOf: + - type: integer + - type: 'null' + title: Max Infer Iters + default: 10 + model: type: string - dimensions: - title: Dimensions - type: integer - user: - title: User + title: Model + description: The model identifier to use for the agent + instructions: type: string - additionalProperties: true + title: Instructions + description: The system instructions for the agent + name: + anyOf: + - type: string + - type: 'null' + title: Name + description: Optional name for the agent, used in telemetry and identification + enable_session_persistence: + anyOf: + - type: boolean + - type: 'null' + title: Enable Session Persistence + description: Optional flag indicating whether session data has to be persisted + default: false + response_format: + anyOf: + - oneOf: + - $ref: '#/components/schemas/JsonSchemaResponseFormat' + - $ref: '#/components/schemas/GrammarResponseFormat' + discriminator: + propertyName: type + mapping: + grammar: '#/components/schemas/GrammarResponseFormat' + json_schema: '#/components/schemas/JsonSchemaResponseFormat' + - type: 'null' + title: Response Format + description: Optional response format configuration type: object required: - model - - input - title: OpenAIEmbeddingsRequestWithExtraBody - description: Request parameters for OpenAI-compatible embeddings endpoint. - OpenAIEmbeddingsResponse: + - instructions + title: AgentConfig + description: Configuration for an agent. + AgentCreateResponse: properties: - object: - type: string - const: list - title: Object - default: list - data: - items: - $ref: '#/components/schemas/OpenAIEmbeddingData' - type: array - title: Data - model: + agent_id: type: string - title: Model - usage: - $ref: '#/components/schemas/OpenAIEmbeddingUsage' + title: Agent Id + description: Unique identifier for the created agent type: object required: - - data - - model - - usage - title: OpenAIEmbeddingsResponse - description: Response from an OpenAI-compatible embeddings request. - OpenAIFile: + - agent_id + title: AgentCreateResponse + description: Response returned when creating a new agent. + AgentSessionCreateResponse: properties: - type: + session_id: type: string - const: file - title: Type - default: file - file: - $ref: '#/components/schemas/OpenAIFileFile' + title: Session Id + description: Unique identifier for the created session type: object required: - - file - title: OpenAIFile - OpenAIFileFile: + - session_id + title: AgentSessionCreateResponse + description: Response returned when creating a new agent session. + AgentStepResponse: properties: - file_data: - title: File Data - type: string - file_id: - title: File Id - type: string - filename: - title: Filename - type: string + step: + oneOf: + - $ref: '#/components/schemas/InferenceStep-Output' + - $ref: '#/components/schemas/ToolExecutionStep-Output' + - $ref: '#/components/schemas/ShieldCallStep-Output' + - $ref: '#/components/schemas/MemoryRetrievalStep-Output' + title: Step + description: The complete step data and execution details + discriminator: + propertyName: step_type + mapping: + inference: '#/components/schemas/InferenceStep-Output' + memory_retrieval: '#/components/schemas/MemoryRetrievalStep-Output' + shield_call: '#/components/schemas/ShieldCallStep-Output' + tool_execution: '#/components/schemas/ToolExecutionStep-Output' type: object - title: OpenAIFileFile - OpenAIFileObject: + required: + - step + title: AgentStepResponse + description: Response containing details of a specific agent step. + AgentToolGroupWithArgs: properties: - object: - type: string - const: file - title: Object - default: file - id: - type: string - title: Id - bytes: - type: integer - title: Bytes - created_at: - type: integer - title: Created At - expires_at: - type: integer - title: Expires At - filename: + name: type: string - title: Filename - purpose: - $ref: '#/components/schemas/OpenAIFilePurpose' + title: Name + args: + additionalProperties: true + type: object + title: Args type: object required: - - id - - bytes - - created_at - - expires_at - - filename - - purpose - title: OpenAIFileObject - description: OpenAI File object as defined in the OpenAI Files API. - OpenAIFilePurpose: - type: string - enum: - - assistants - - batch - title: OpenAIFilePurpose - description: Valid purpose values for OpenAI Files API. - OpenAIImageURL: + - name + - args + title: AgentToolGroupWithArgs + AgentTurnCreateRequest: properties: - url: - type: string - title: Url - detail: - title: Detail + sampling_params: + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' + input_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Input Shields + output_shields: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields + toolgroups: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups + description: List of tool groups to make available for this turn + client_tools: + anyOf: + - items: + $ref: '#/components/schemas/ToolDef' + type: array + - type: 'null' + title: Client Tools + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: 'null' + deprecated: true + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + deprecated: true + tool_config: + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' + description: Tool configuration to override agent defaults + max_infer_iters: + anyOf: + - type: integer + - type: 'null' + title: Max Infer Iters + default: 10 + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + agent_id: type: string + title: Agent Id + description: Unique identifier for the agent + session_id: + type: string + title: Session Id + description: Unique identifier for the conversation session + messages: + items: + anyOf: + - $ref: '#/components/schemas/UserMessage-Input' + - $ref: '#/components/schemas/ToolResponseMessage-Input' + type: array + title: Messages + description: List of messages to start the turn with + documents: + anyOf: + - items: + $ref: '#/components/schemas/Document' + type: array + - type: 'null' + title: Documents + description: List of documents to provide to the agent + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + description: Whether to stream the response + default: false type: object required: - - url - title: OpenAIImageURL - description: Image URL specification for OpenAI-compatible chat completion messages. - OpenAIJSONSchema: + - agent_id + - session_id + - messages + title: AgentTurnCreateRequest + description: Request to create a new turn for an agent. + AgentTurnInputType: properties: - name: - type: string - title: Name - description: - title: Description + type: type: string - strict: - title: Strict - type: boolean - schema: - title: Schema - additionalProperties: true - type: object + const: agent_turn_input + title: Type + default: agent_turn_input type: object - title: OpenAIJSONSchema - description: JSON schema specification for OpenAI-compatible structured response format. - OpenAIResponseAnnotationCitation: + title: AgentTurnInputType + description: "Parameter type for agent turn input.\n\n:param type: Discriminator type. Always \"agent_turn_input\"" + AgentTurnResumeRequest: properties: - type: + agent_id: type: string - const: url_citation - title: Type - default: url_citation - end_index: - type: integer - title: End Index - start_index: - type: integer - title: Start Index - title: + title: Agent Id + description: Unique identifier for the agent + session_id: type: string - title: Title - url: + title: Session Id + description: Unique identifier for the conversation session + turn_id: type: string - title: Url + title: Turn Id + description: Unique identifier for the turn within a session + tool_responses: + items: + $ref: '#/components/schemas/ToolResponse-Input' + type: array + title: Tool Responses + description: List of tool responses to submit to continue the turn + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + description: Whether to stream the response + default: false type: object required: - - end_index - - start_index - - title - - url - title: OpenAIResponseAnnotationCitation - description: URL citation annotation for referencing external web resources. - OpenAIResponseAnnotationContainerFileCitation: + - agent_id + - session_id + - turn_id + - tool_responses + title: AgentTurnResumeRequest + description: Request to resume an agent turn with tool responses. + AggregationFunctionType: + type: string + enum: + - average + - weighted_average + - median + - categorical_count + - accuracy + title: AggregationFunctionType + description: Types of aggregation functions for scoring results. + AllowedToolsFilter: + properties: + tool_names: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Tool Names + description: List of specific tool names that are allowed + type: object + title: AllowedToolsFilter + description: "Filter configuration for restricting which MCP tools can be used.\n\n:param tool_names: (Optional) List of specific tool names that are allowed" + ApprovalFilter: + properties: + always: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Always + description: List of tool names that always require approval + never: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Never + description: List of tool names that never require approval + type: object + title: ApprovalFilter + description: "Filter configuration for MCP tool approval requirements.\n\n:param always: (Optional) List of tool names that always require approval\n:param never: (Optional) List of tool names that never require approval" + ArrayType: properties: type: type: string - const: container_file_citation + const: array title: Type - default: container_file_citation - container_id: - type: string - title: Container Id - end_index: - type: integer - title: End Index - file_id: - type: string - title: File Id - filename: + default: array + type: object + title: ArrayType + description: "Parameter type for array values.\n\n:param type: Discriminator type. Always \"array\"" + Attachment-Output: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + title: Content + description: The content of the attachment. + mime_type: type: string - title: Filename - start_index: - type: integer - title: Start Index + title: Mime Type + description: The MIME type of the attachment. type: object required: - - container_id - - end_index - - file_id - - filename - - start_index - title: OpenAIResponseAnnotationContainerFileCitation - OpenAIResponseAnnotationFileCitation: + - content + - mime_type + title: Attachment + description: An attachment to an agent turn. + BasicScoringFnParams: properties: type: type: string - const: file_citation + const: basic title: Type - default: file_citation - file_id: - type: string - title: File Id - filename: - type: string - title: Filename - index: - type: integer - title: Index + default: basic + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row type: object - required: - - file_id - - filename - - index - title: OpenAIResponseAnnotationFileCitation - description: File citation annotation for referencing specific files in response content. - OpenAIResponseAnnotationFilePath: + title: BasicScoringFnParams + description: Parameters for basic scoring function configuration. + Batch: properties: - type: + id: type: string - const: file_path - title: Type - default: file_path - file_id: + title: Id + completion_window: type: string - title: File Id - index: + title: Completion Window + created_at: type: integer - title: Index - type: object - required: - - file_id - - index - title: OpenAIResponseAnnotationFilePath - OpenAIResponseContentPartRefusal: - properties: - type: + title: Created At + endpoint: type: string - const: refusal - title: Type - default: refusal - refusal: + title: Endpoint + input_file_id: type: string - title: Refusal + title: Input File Id + object: + type: string + const: batch + title: Object + status: + type: string + enum: + - validating + - failed + - in_progress + - finalizing + - completed + - expired + - cancelling + - cancelled + title: Status + cancelled_at: + anyOf: + - type: integer + - type: 'null' + title: Cancelled At + cancelling_at: + anyOf: + - type: integer + - type: 'null' + title: Cancelling At + completed_at: + anyOf: + - type: integer + - type: 'null' + title: Completed At + error_file_id: + anyOf: + - type: string + - type: 'null' + title: Error File Id + errors: + anyOf: + - $ref: '#/components/schemas/Errors' + - type: 'null' + expired_at: + anyOf: + - type: integer + - type: 'null' + title: Expired At + expires_at: + anyOf: + - type: integer + - type: 'null' + title: Expires At + failed_at: + anyOf: + - type: integer + - type: 'null' + title: Failed At + finalizing_at: + anyOf: + - type: integer + - type: 'null' + title: Finalizing At + in_progress_at: + anyOf: + - type: integer + - type: 'null' + title: In Progress At + metadata: + anyOf: + - additionalProperties: + type: string + type: object + - type: 'null' + title: Metadata + model: + anyOf: + - type: string + - type: 'null' + title: Model + output_file_id: + anyOf: + - type: string + - type: 'null' + title: Output File Id + request_counts: + anyOf: + - $ref: '#/components/schemas/BatchRequestCounts' + - type: 'null' + usage: + anyOf: + - $ref: '#/components/schemas/BatchUsage' + - type: 'null' + additionalProperties: true type: object required: - - refusal - title: OpenAIResponseContentPartRefusal - description: Refusal content within a streamed response part. - OpenAIResponseError: + - id + - completion_window + - created_at + - endpoint + - input_file_id + - object + - status + title: Batch + BatchError: properties: code: - type: string + anyOf: + - type: string + - type: 'null' title: Code + line: + anyOf: + - type: integer + - type: 'null' + title: Line message: - type: string + anyOf: + - type: string + - type: 'null' title: Message + param: + anyOf: + - type: string + - type: 'null' + title: Param + additionalProperties: true type: object - required: - - code - - message - title: OpenAIResponseError - description: Error details for failed OpenAI response requests. - OpenAIResponseFormatJSONObject: - properties: - type: - type: string - const: json_object - title: Type - default: json_object - type: object - title: OpenAIResponseFormatJSONObject - description: JSON object response format for OpenAI-compatible chat completion requests. - OpenAIResponseFormatJSONSchema: + title: BatchError + BatchRequestCounts: properties: - type: - type: string - const: json_schema - title: Type - default: json_schema - json_schema: - $ref: '#/components/schemas/OpenAIJSONSchema' + completed: + type: integer + title: Completed + failed: + type: integer + title: Failed + total: + type: integer + title: Total + additionalProperties: true type: object required: - - json_schema - title: OpenAIResponseFormatJSONSchema - description: JSON schema response format for OpenAI-compatible chat completion requests. - OpenAIResponseFormatText: + - completed + - failed + - total + title: BatchRequestCounts + BatchUsage: properties: - type: - type: string - const: text - title: Type - default: text + input_tokens: + type: integer + title: Input Tokens + input_tokens_details: + $ref: '#/components/schemas/InputTokensDetails' + output_tokens: + type: integer + title: Output Tokens + output_tokens_details: + $ref: '#/components/schemas/OutputTokensDetails' + total_tokens: + type: integer + title: Total Tokens + additionalProperties: true type: object - title: OpenAIResponseFormatText - description: Text response format for OpenAI-compatible chat completion requests. - OpenAIResponseInputFunctionToolCallOutput: + required: + - input_tokens + - input_tokens_details + - output_tokens + - output_tokens_details + - total_tokens + title: BatchUsage + Benchmark: properties: - call_id: + identifier: type: string - title: Call Id - output: + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: type: string - title: Output + title: Provider Id + description: ID of the provider that owns this resource type: type: string - const: function_call_output + const: benchmark title: Type - default: function_call_output - id: - title: Id - type: string - status: - title: Status + description: The resource type, always benchmark + default: benchmark + dataset_id: type: string + title: Dataset Id + description: The ID of the dataset to use for the benchmark + scoring_functions: + items: + type: string + type: array + title: Scoring Functions + description: The scoring functions to use for the benchmark + metadata: + additionalProperties: true + type: object + title: Metadata + description: Metadata for this evaluation task type: object required: - - call_id - - output - title: OpenAIResponseInputFunctionToolCallOutput - description: This represents the output of a function call that gets passed back to the model. - OpenAIResponseInputMessageContentFile: - properties: - type: - type: string - const: input_file - title: Type - default: input_file - file_data: - title: File Data - type: string - file_id: - title: File Id - type: string - file_url: - title: File Url - type: string - filename: - title: Filename - type: string - type: object - title: OpenAIResponseInputMessageContentFile - description: File content for input messages in OpenAI response format. - OpenAIResponseInputMessageContentImage: + - identifier + - provider_id + - dataset_id + - scoring_functions + title: Benchmark + description: A benchmark resource for evaluating model performance. + BenchmarkConfig: properties: - detail: - anyOf: - - type: string - const: low - - type: string - const: high - - type: string - const: auto - title: Detail - default: auto - type: - type: string - const: input_image - title: Type - default: input_image - file_id: - title: File Id - type: string - image_url: - title: Image Url - type: string + eval_candidate: + oneOf: + - $ref: '#/components/schemas/ModelCandidate' + - $ref: '#/components/schemas/AgentCandidate' + title: Eval Candidate + description: The candidate to evaluate. + discriminator: + propertyName: type + mapping: + agent: '#/components/schemas/AgentCandidate' + model: '#/components/schemas/ModelCandidate' + scoring_params: + additionalProperties: + oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + type: object + title: Scoring Params + description: Map between scoring function id and parameters for each scoring function you want to run. + num_examples: + anyOf: + - type: integer + - type: 'null' + title: Num Examples + description: The number of examples to evaluate. If not provided, all examples in the dataset will be evaluated. type: object - title: OpenAIResponseInputMessageContentImage - description: Image content for input messages in OpenAI response format. - OpenAIResponseInputMessageContentText: + required: + - eval_candidate + title: BenchmarkConfig + description: A benchmark configuration for evaluation. + Body_openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post: properties: - text: - type: string - title: Text - type: + file_id: type: string - const: input_text - title: Type - default: input_text + title: File Id + description: The ID of the file to attach to the vector store. + attributes: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Attributes + description: The key-value attributes stored with the file, which can be used for filtering. + chunking_strategy: + anyOf: + - oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + - type: 'null' + title: Chunking Strategy + description: The chunking strategy to use for the file. type: object required: - - text - title: OpenAIResponseInputMessageContentText - description: Text content for input messages in OpenAI response format. - OpenAIResponseInputToolFileSearch: + - file_id + title: Body_openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post + Body_openai_search_vector_store_v1_vector_stores__vector_store_id__search_post: properties: - type: - type: string - const: file_search - title: Type - default: file_search - vector_store_ids: - items: - type: string - type: array - title: Vector Store Ids + query: + anyOf: + - type: string + - items: + type: string + type: array + title: Query + description: The query string or array for performing the search. filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' title: Filters - additionalProperties: true - type: object + description: Filters based on file attributes to narrow the search results. max_num_results: + anyOf: + - type: integer + maximum: 50.0 + minimum: 1.0 + - type: 'null' title: Max Num Results + description: Maximum number of results to return (1 to 50 inclusive, default 10). default: 10 - type: integer - maximum: 50.0 - minimum: 1.0 ranking_options: - $ref: '#/components/schemas/SearchRankingOptions' + anyOf: + - $ref: '#/components/schemas/SearchRankingOptions' + - type: 'null' + description: Ranking options for fine-tuning the search results. + rewrite_query: + type: boolean + title: Rewrite Query + description: Whether to rewrite the natural language query for vector search (default false). + default: false + search_mode: + anyOf: + - type: string + - type: 'null' + title: Search Mode + description: The search mode to use - 'keyword', 'vector', or 'hybrid' (default 'vector'). + default: vector type: object required: - - vector_store_ids - title: OpenAIResponseInputToolFileSearch - description: File search tool configuration for OpenAI response inputs. - OpenAIResponseInputToolFunction: + - query + title: Body_openai_search_vector_store_v1_vector_stores__vector_store_id__search_post + Body_openai_upload_file_v1_files_post: properties: - type: - type: string - const: function - title: Type - default: function - name: - type: string - title: Name - description: - title: Description + file: type: string - parameters: - title: Parameters - additionalProperties: true - type: object - strict: - title: Strict - type: boolean + format: binary + title: File + description: The File object to be uploaded. + purpose: + $ref: '#/components/schemas/OpenAIFilePurpose' + description: The intended purpose of the uploaded file. + expires_after: + anyOf: + - $ref: '#/components/schemas/ExpiresAfter' + - type: 'null' + description: Optional form values describing expiration for the file. type: object required: - - name - - parameters - title: OpenAIResponseInputToolFunction - description: Function tool configuration for OpenAI response inputs. - OpenAIResponseInputToolMCP: + - file + - purpose + title: Body_openai_upload_file_v1_files_post + Body_rag_tool_insert_v1_tool_runtime_rag_tool_insert_post: properties: - type: - type: string - const: mcp - title: Type - default: mcp - server_label: - type: string - title: Server Label - server_url: + documents: + items: + $ref: '#/components/schemas/RAGDocument' + type: array + title: Documents + description: List of documents to index in the RAG system. + vector_store_id: type: string - title: Server Url - headers: - title: Headers - additionalProperties: true - type: object - require_approval: + title: Vector Store Id + description: ID of the vector database to store the document embeddings. + chunk_size_in_tokens: + type: integer + title: Chunk Size In Tokens + description: Size in tokens for document chunking during indexing. + default: 512 + type: object + required: + - documents + - vector_store_id + title: Body_rag_tool_insert_v1_tool_runtime_rag_tool_insert_post + Body_rag_tool_query_v1_tool_runtime_rag_tool_query_post: + properties: + content: anyOf: - type: string - const: always - - type: string - const: never - - $ref: '#/components/schemas/ApprovalFilter' - title: Require Approval - default: never - allowed_tools: - anyOf: + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' - items: - type: string + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' type: array - - $ref: '#/components/schemas/AllowedToolsFilter' - title: Allowed Tools + title: Content + description: The query content to search for in the indexed documents. + vector_store_ids: + items: + type: string + type: array + title: Vector Store Ids + description: List of vector database IDs to search within. + query_config: + anyOf: + - $ref: '#/components/schemas/RAGQueryConfig' + - type: 'null' + description: Configuration parameters for the query operation. type: object required: - - server_label - - server_url - title: OpenAIResponseInputToolMCP - description: Model Context Protocol (MCP) tool configuration for OpenAI response inputs. - OpenAIResponseInputToolWebSearch: + - content + - vector_store_ids + title: Body_rag_tool_query_v1_tool_runtime_rag_tool_query_post + Body_rerank_v1alpha_inference_rerank_post: properties: - type: + model: + type: string + title: Model + description: The identifier of the reranking model to use. + query: anyOf: - type: string - const: web_search - - type: string - const: web_search_preview - - type: string - const: web_search_preview_2025_03_11 - title: Type - default: web_search - search_context_size: - title: Search Context Size - default: medium - type: string - pattern: ^low|medium|high$ + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + title: Query + description: The search query to rank items against. + items: + items: + anyOf: + - type: string + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + type: array + title: Items + description: List of items to rerank. + max_num_results: + anyOf: + - type: integer + - type: 'null' + title: Max Num Results + description: 'Maximum number of results to return. Default: returns all.' type: object - title: OpenAIResponseInputToolWebSearch - description: Web search tool configuration for OpenAI response inputs. - OpenAIResponseMCPApprovalRequest: + required: + - model + - query + - items + title: Body_rerank_v1alpha_inference_rerank_post + BooleanType: properties: - arguments: - type: string - title: Arguments - id: - type: string - title: Id - name: - type: string - title: Name - server_label: + type: type: string - title: Server Label + const: boolean + title: Type + default: boolean + type: object + title: BooleanType + description: "Parameter type for boolean values.\n\n:param type: Discriminator type. Always \"boolean\"" + BuiltinTool: + type: string + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + ChatCompletionInputType: + properties: type: type: string - const: mcp_approval_request + const: chat_completion_input title: Type - default: mcp_approval_request + default: chat_completion_input type: object - required: - - arguments - - id - - name - - server_label - title: OpenAIResponseMCPApprovalRequest - description: A request for human approval of a tool invocation. - OpenAIResponseMCPApprovalResponse: + title: ChatCompletionInputType + description: "Parameter type for chat completion input.\n\n:param type: Discriminator type. Always \"chat_completion_input\"" + Checkpoint: properties: - approval_request_id: + identifier: type: string - title: Approval Request Id - approve: - type: boolean - title: Approve - type: + title: Identifier + description: Unique identifier for the checkpoint. + created_at: type: string - const: mcp_approval_response - title: Type - default: mcp_approval_response - id: - title: Id + format: date-time + title: Created At + description: Timestamp when the checkpoint was created. + epoch: + type: integer + title: Epoch + description: Training epoch when the checkpoint was saved. + post_training_job_id: type: string - reason: - title: Reason + title: Post Training Job Id + description: Identifier of the training job that created this checkpoint. + path: type: string + title: Path + description: File system path where the checkpoint is stored. + training_metrics: + anyOf: + - $ref: '#/components/schemas/PostTrainingMetric' + - type: 'null' + description: Training metrics associated with this checkpoint. type: object required: - - approval_request_id - - approve - title: OpenAIResponseMCPApprovalResponse - description: A response to an MCP approval request. - OpenAIResponseMessage-Input: + - identifier + - created_at + - epoch + - post_training_job_id + - path + - training_metrics + title: Checkpoint + description: Checkpoint created during training runs. + Chunk-Input: properties: content: anyOf: - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' - items: oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' - input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' - input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + chunk_id: + type: string + title: Chunk Id + metadata: + additionalProperties: true + type: object + title: Metadata + embedding: + anyOf: + - items: + type: number type: array + - type: 'null' + title: Embedding + chunk_metadata: + anyOf: + - $ref: '#/components/schemas/ChunkMetadata' + - type: 'null' + type: object + required: + - content + - chunk_id + title: Chunk + description: A chunk of content that can be inserted into a vector database. + Chunk-Output: + properties: + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' - items: oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' type: array title: Content - role: + chunk_id: + type: string + title: Chunk Id + metadata: + additionalProperties: true + type: object + title: Metadata + embedding: + anyOf: + - items: + type: number + type: array + - type: 'null' + title: Embedding + chunk_metadata: + anyOf: + - $ref: '#/components/schemas/ChunkMetadata' + - type: 'null' + type: object + required: + - content + - chunk_id + title: Chunk + description: A chunk of content that can be inserted into a vector database. + ChunkMetadata: + properties: + chunk_id: anyOf: - type: string - const: system + - type: 'null' + title: Chunk Id + document_id: + anyOf: - type: string - const: developer + - type: 'null' + title: Document Id + source: + anyOf: - type: string - const: user + - type: 'null' + title: Source + created_timestamp: + anyOf: + - type: integer + - type: 'null' + title: Created Timestamp + updated_timestamp: + anyOf: + - type: integer + - type: 'null' + title: Updated Timestamp + chunk_window: + anyOf: - type: string - const: assistant - title: Role + - type: 'null' + title: Chunk Window + chunk_tokenizer: + anyOf: + - type: string + - type: 'null' + title: Chunk Tokenizer + chunk_embedding_model: + anyOf: + - type: string + - type: 'null' + title: Chunk Embedding Model + chunk_embedding_dimension: + anyOf: + - type: integer + - type: 'null' + title: Chunk Embedding Dimension + content_token_count: + anyOf: + - type: integer + - type: 'null' + title: Content Token Count + metadata_token_count: + anyOf: + - type: integer + - type: 'null' + title: Metadata Token Count + type: object + title: ChunkMetadata + description: "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that\n will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata`\n is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after.\n Use `Chunk.metadata` for metadata that will be used in the context during inference." + CompletionInputType: + properties: type: type: string - const: message + const: completion_input title: Type - default: message - id: - title: Id - type: string - status: - title: Status - type: string + default: completion_input type: object - required: - - content - - role - title: OpenAIResponseMessage - description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." - OpenAIResponseMessage-Output: + title: CompletionInputType + description: "Parameter type for completion input.\n\n:param type: Discriminator type. Always \"completion_input\"" + CompletionMessage-Output: properties: + role: + type: string + const: assistant + title: Role + default: assistant content: anyOf: - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' - items: oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' - input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' - input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + stop_reason: + $ref: '#/components/schemas/StopReason' + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' + title: Tool Calls + type: object + required: + - content + - stop_reason + title: CompletionMessage + description: "A message containing the model's (assistant) response in a chat conversation.\n\n- `StopReason.end_of_turn`: The model finished generating the entire response.\n- `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response.\n- `StopReason.out_of_tokens`: The model ran out of token budget." + Conversation: + properties: + id: + type: string + title: Id + description: The unique ID of the conversation. + object: + type: string + const: conversation + title: Object + description: The object type, which is always conversation. + default: conversation + created_at: + type: integer + title: Created At + description: The time at which the conversation was created, measured in seconds since the Unix epoch. + metadata: + anyOf: + - additionalProperties: + type: string + type: object + - type: 'null' + title: Metadata + description: Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. + items: + anyOf: + - items: + additionalProperties: true + type: object type: array + - type: 'null' + title: Items + description: Initial items to include in the conversation context. You may add up to 20 items at a time. + type: object + required: + - id + - created_at + title: Conversation + description: OpenAI-compatible conversation object. + ConversationCreateRequest: + properties: + items: + anyOf: - items: oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' discriminator: propertyName: type mapping: - output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Input' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' type: array - title: Content - role: + maxItems: 20 + - type: 'null' + title: Items + description: Initial items to include in the conversation context. You may add up to 20 items at a time. + default: [] + metadata: anyOf: - - type: string - const: system - - type: string - const: developer - - type: string - const: user - - type: string - const: assistant - title: Role - type: - type: string - const: message - title: Type - default: message - id: - title: Id - type: string - status: - title: Status - type: string + - additionalProperties: + type: string + type: object + maxProperties: 16 + - type: 'null' + title: Metadata + description: Set of 16 key-value pairs that can be attached to an object. Useful for storing additional information + default: {} type: object - required: - - content - - role - title: OpenAIResponseMessage - description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." - OpenAIResponseObject: + title: ConversationCreateRequest + description: Request body for creating a conversation. + ConversationDeletedResource: properties: - created_at: - type: integer - title: Created At - error: - $ref: '#/components/schemas/OpenAIResponseError' id: type: string title: Id - model: - type: string - title: Model + description: The deleted conversation identifier object: type: string - const: response title: Object - default: response - output: + description: Object type + default: conversation.deleted + deleted: + type: boolean + title: Deleted + description: Whether the object was deleted + default: true + type: object + required: + - id + title: ConversationDeletedResource + description: Response for deleted conversation. + ConversationItemCreateRequest: + properties: + items: items: oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' discriminator: propertyName: type mapping: file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - message: '#/components/schemas/OpenAIResponseMessage-Output' + message: '#/components/schemas/OpenAIResponseMessage-Input' web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' type: array - title: Output - parallel_tool_calls: - type: boolean - title: Parallel Tool Calls - default: false - previous_response_id: - title: Previous Response Id - type: string - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - status: - type: string - title: Status - temperature: - title: Temperature - type: number - text: - $ref: '#/components/schemas/OpenAIResponseText' - default: - format: - type: text - top_p: - title: Top P - type: number - tools: - title: Tools - items: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseToolMCP' - discriminator: - propertyName: type - mapping: - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseToolMCP' - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' - web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' - type: array - truncation: - title: Truncation + maxItems: 20 + title: Items + description: Items to include in the conversation context. You may add up to 20 items at a time. + type: object + required: + - items + title: ConversationItemCreateRequest + description: Request body for creating conversation items. + ConversationItemDeletedResource: + properties: + id: type: string - usage: - $ref: '#/components/schemas/OpenAIResponseUsage' - instructions: - title: Instructions + title: Id + description: The deleted item identifier + object: type: string + title: Object + description: Object type + default: conversation.item.deleted + deleted: + type: boolean + title: Deleted + description: Whether the object was deleted + default: true type: object required: - - created_at - id - - model - - output - - status - title: OpenAIResponseObject - description: Complete OpenAI response object containing generation results and metadata. - OpenAIResponseOutputMessageContentOutputText: + title: ConversationItemDeletedResource + description: Response for deleted conversation item. + ConversationItemInclude: + type: string + enum: + - web_search_call.action.sources + - code_interpreter_call.outputs + - computer_call_output.output.image_url + - file_search_call.results + - message.input_image.image_url + - message.output_text.logprobs + - reasoning.encrypted_content + title: ConversationItemInclude + description: Specify additional output data to include in the model response. + ConversationItemList: properties: - text: - type: string - title: Text - type: + object: type: string - const: output_text - title: Type - default: output_text - annotations: + title: Object + description: Object type + default: list + data: items: oneOf: - - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' discriminator: propertyName: type mapping: - container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' - file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' - url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' type: array - title: Annotations + title: Data + description: List of conversation items + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + description: The ID of the first item in the list + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + description: The ID of the last item in the list + has_more: + type: boolean + title: Has More + description: Whether there are more items available + default: false type: object required: - - text - title: OpenAIResponseOutputMessageContentOutputText - OpenAIResponseOutputMessageFileSearchToolCall: + - data + title: ConversationItemList + description: List of conversation items with pagination. + ConversationUpdateRequest: properties: - id: - type: string - title: Id - queries: - items: + metadata: + additionalProperties: type: string - type: array - title: Queries - status: - type: string - title: Status - type: - type: string - const: file_search_call - title: Type - default: file_search_call - results: - title: Results - items: - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' - type: array - type: object - required: - - id - - queries - - status - title: OpenAIResponseOutputMessageFileSearchToolCall - description: File search tool call output message for OpenAI responses. - OpenAIResponseOutputMessageFileSearchToolCallResults: - properties: - attributes: - additionalProperties: true - type: object - title: Attributes - file_id: - type: string - title: File Id - filename: - type: string - title: Filename - score: - type: number - title: Score - text: - type: string - title: Text + type: object + title: Metadata + description: Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. type: object required: - - attributes - - file_id - - filename - - score - - text - title: OpenAIResponseOutputMessageFileSearchToolCallResults - description: Search results returned by the file search operation. - OpenAIResponseOutputMessageFunctionToolCall: + - metadata + title: ConversationUpdateRequest + description: Request body for updating a conversation. + CreateAgentSessionRequest: properties: - call_id: - type: string - title: Call Id - name: - type: string - title: Name - arguments: - type: string - title: Arguments - type: - type: string - const: function_call - title: Type - default: function_call - id: - title: Id + agent_id: type: string - status: - title: Status + title: Agent Id + description: The ID of the agent to create the session for + session_name: type: string + title: Session Name + description: The name of the session to create type: object required: - - call_id - - name - - arguments - title: OpenAIResponseOutputMessageFunctionToolCall - description: Function tool call output message for OpenAI responses. - OpenAIResponseOutputMessageMCPCall: + - agent_id + - session_name + title: CreateAgentSessionRequest + description: Request to create a new session for an agent. + CreateBatchRequest: properties: - id: - type: string - title: Id - type: + input_file_id: type: string - const: mcp_call - title: Type - default: mcp_call - arguments: + title: Input File Id + description: The ID of an uploaded file containing requests for the batch. + endpoint: type: string - title: Arguments - name: + title: Endpoint + description: The endpoint to be used for all requests in the batch. + completion_window: type: string - title: Name - server_label: + const: 24h + title: Completion Window + description: The time window within which the batch should be processed. + metadata: + anyOf: + - additionalProperties: + type: string + type: object + - type: 'null' + title: Metadata + description: Optional metadata for the batch. + idempotency_key: + anyOf: + - type: string + - type: 'null' + title: Idempotency Key + description: Optional idempotency key. When provided, enables idempotent behavior. + type: object + required: + - input_file_id + - endpoint + - completion_window + title: CreateBatchRequest + description: Request model for creating a batch. + CreateOpenAIResponseRequest: + properties: + input: + anyOf: + - type: string + - items: + anyOf: + - oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Input' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage-Input' + type: array + title: Input + description: Input message(s) to create the response + model: type: string - title: Server Label - error: - title: Error + title: Model + description: The underlying LLM used for completions + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + description: Prompt object with ID, version, and variables + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + description: System instructions + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + description: If specified, the new response will be a continuation of the previous response + conversation: + anyOf: + - type: string + - type: 'null' + title: Conversation + description: The ID of a conversation to add the response to. Must begin with 'conv_' + store: + type: boolean + title: Store + description: Whether to store the response + default: true + stream: + type: boolean + title: Stream + description: Whether to stream the response + default: false + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Sampling temperature + text: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseText' + - type: 'null' + description: Text generation parameters + tools: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseInputToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + type: array + - type: 'null' + title: Tools + description: Tools to make available + include: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Include + description: Additional fields to include in the response + max_infer_iters: + type: integer + title: Max Infer Iters + description: Maximum number of inference iterations (extension to the OpenAI API) + default: 10 + guardrails: + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/ResponseGuardrailSpec' + type: array + - type: 'null' + title: Guardrails + description: List of guardrails to apply during response generation + type: object + required: + - input + - model + title: CreateOpenAIResponseRequest + description: Request to create a model response. + CreatePromptRequest: + properties: + prompt: type: string - output: - title: Output + title: Prompt + description: The prompt text content with variable placeholders. + variables: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Variables + description: List of variable names that can be used in the prompt template. + type: object + required: + - prompt + title: CreatePromptRequest + description: Request model for creating a new prompt. + DPOAlignmentConfig: + properties: + beta: + type: number + title: Beta + loss_type: + $ref: '#/components/schemas/DPOLossType' + default: sigmoid + type: object + required: + - beta + title: DPOAlignmentConfig + description: Configuration for Direct Preference Optimization (DPO) alignment. + DPOLossType: + type: string + enum: + - sigmoid + - hinge + - ipo + - kto_pair + title: DPOLossType + DataConfig: + properties: + dataset_id: type: string + title: Dataset Id + batch_size: + type: integer + title: Batch Size + shuffle: + type: boolean + title: Shuffle + data_format: + $ref: '#/components/schemas/DatasetFormat' + validation_dataset_id: + anyOf: + - type: string + - type: 'null' + title: Validation Dataset Id + packed: + anyOf: + - type: boolean + - type: 'null' + title: Packed + default: false + train_on_input: + anyOf: + - type: boolean + - type: 'null' + title: Train On Input + default: false type: object required: - - id - - arguments - - name - - server_label - title: OpenAIResponseOutputMessageMCPCall - description: Model Context Protocol (MCP) call output message for OpenAI responses. - OpenAIResponseOutputMessageMCPListTools: + - dataset_id + - batch_size + - shuffle + - data_format + title: DataConfig + description: Configuration for training data and data loading. + Dataset: properties: - id: + identifier: type: string - title: Id + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource type: type: string - const: mcp_list_tools + const: dataset title: Type - default: mcp_list_tools - server_label: - type: string - title: Server Label - tools: - items: - $ref: '#/components/schemas/MCPListToolsTool' - type: array - title: Tools + description: Type of resource, always 'dataset' for datasets + default: dataset + purpose: + $ref: '#/components/schemas/DatasetPurpose' + source: + oneOf: + - $ref: '#/components/schemas/URIDataSource' + - $ref: '#/components/schemas/RowsDataSource' + title: Source + discriminator: + propertyName: type + mapping: + rows: '#/components/schemas/RowsDataSource' + uri: '#/components/schemas/URIDataSource' + metadata: + additionalProperties: true + type: object + title: Metadata + description: Any additional metadata for this dataset type: object required: - - id - - server_label - - tools - title: OpenAIResponseOutputMessageMCPListTools - description: MCP list tools output message containing available tools from an MCP server. - OpenAIResponseOutputMessageWebSearchToolCall: + - identifier + - provider_id + - purpose + - source + title: Dataset + description: Dataset resource for storing and accessing training or evaluation data. + DatasetFormat: + type: string + enum: + - instruct + - dialog + title: DatasetFormat + description: Format of the training dataset. + DatasetPurpose: + type: string + enum: + - post-training/messages + - eval/question-answer + - eval/messages-answer + title: DatasetPurpose + description: "Purpose of the dataset. Each purpose has a required input data schema.\n\n {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello, world!\"},\n {\"role\": \"assistant\", \"content\": \"Hello, world!\"},\n ]\n }\n {\n \"question\": \"What is the capital of France?\",\n \"answer\": \"Paris\"\n }\n {\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Hello, my name is John Doe.\"},\n {\"role\": \"assistant\", \"content\": \"Hello, John Doe. How can I help you today?\"},\n {\"role\": \"user\", \"content\": \"What's my name?\"},\n ],\n \"answer\": \"John Doe\"\n }" + DefaultRAGQueryGeneratorConfig: properties: - id: - type: string - title: Id - status: - type: string - title: Status type: type: string - const: web_search_call + const: default title: Type - default: web_search_call + default: default + separator: + type: string + title: Separator + default: ' ' type: object - required: - - id - - status - title: OpenAIResponseOutputMessageWebSearchToolCall - description: Web search tool call output message for OpenAI responses. - OpenAIResponsePrompt: + title: DefaultRAGQueryGeneratorConfig + description: "Configuration for the default RAG query generator.\n\n:param type: Type of query generator, always 'default'\n:param separator: String separator used to join query terms" + Document: properties: - id: - type: string - title: Id - variables: - title: Variables - additionalProperties: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' discriminator: propertyName: type mapping: - input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' - input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' - input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' - type: object - version: - title: Version + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + - $ref: '#/components/schemas/URL' + title: Content + description: The content of the document. + mime_type: type: string + title: Mime Type + description: The MIME type of the document. type: object required: - - id - title: OpenAIResponsePrompt - description: OpenAI compatible Prompt object that is used in OpenAI responses. - OpenAIResponseText: + - content + - mime_type + title: Document + description: A document to be used by an agent. + EfficiencyConfig: properties: - format: - $ref: '#/components/schemas/OpenAIResponseTextFormat' + enable_activation_checkpointing: + anyOf: + - type: boolean + - type: 'null' + title: Enable Activation Checkpointing + default: false + enable_activation_offloading: + anyOf: + - type: boolean + - type: 'null' + title: Enable Activation Offloading + default: false + memory_efficient_fsdp_wrap: + anyOf: + - type: boolean + - type: 'null' + title: Memory Efficient Fsdp Wrap + default: false + fsdp_cpu_offload: + anyOf: + - type: boolean + - type: 'null' + title: Fsdp Cpu Offload + default: false type: object - title: OpenAIResponseText - description: Text response configuration for OpenAI responses. - OpenAIResponseTextFormat: + title: EfficiencyConfig + description: Configuration for memory and compute efficiency optimizations. + Error: properties: - type: - anyOf: - - type: string - const: text - - type: string - const: json_schema - - type: string - const: json_object - title: Type - name: - title: Name + status: + type: integer + title: Status + description: HTTP status code + title: type: string - schema: - title: Schema - additionalProperties: true - type: object - description: - title: Description + title: Title + description: Error title, a short summary of the error which is invariant for an error type + detail: type: string - strict: - title: Strict - type: boolean + title: Detail + description: Error detail, a longer human-readable description of the error + instance: + anyOf: + - type: string + - type: 'null' + title: Instance + description: (Optional) A URL which can be used to retrieve more information about the specific occurrence of the error type: object - title: OpenAIResponseTextFormat - description: Configuration for Responses API text format. - OpenAIResponseToolMCP: + required: + - status + - title + - detail + title: Error + description: Error response from the API. Roughly follows RFC 7807. + Errors: properties: - type: - type: string - const: mcp - title: Type - default: mcp - server_label: - type: string - title: Server Label - allowed_tools: + data: anyOf: - items: - type: string + $ref: '#/components/schemas/BatchError' type: array - - $ref: '#/components/schemas/AllowedToolsFilter' - title: Allowed Tools + - type: 'null' + title: Data + object: + anyOf: + - type: string + - type: 'null' + title: Object + additionalProperties: true + type: object + title: Errors + EvaluateResponse: + properties: + generations: + items: + additionalProperties: true + type: object + type: array + title: Generations + description: The generations from the evaluation. + scores: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' + type: object + title: Scores + description: The scores from the evaluation. Each key in the dict is a scoring function name. type: object required: - - server_label - title: OpenAIResponseToolMCP - description: Model Context Protocol (MCP) tool configuration for OpenAI response object. - OpenAIResponseUsage: + - generations + - scores + title: EvaluateResponse + description: The response from an evaluation. + EvaluateRowsRequest: properties: - input_tokens: - type: integer - title: Input Tokens - output_tokens: - type: integer - title: Output Tokens - total_tokens: - type: integer - title: Total Tokens - input_tokens_details: - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' - output_tokens_details: - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + input_rows: + items: + additionalProperties: true + type: object + type: array + title: Input Rows + description: The rows to evaluate. + scoring_functions: + items: + type: string + type: array + title: Scoring Functions + description: The scoring functions to use for the evaluation. + benchmark_config: + $ref: '#/components/schemas/BenchmarkConfig' + description: The configuration for the benchmark. type: object required: - - input_tokens - - output_tokens - - total_tokens - title: OpenAIResponseUsage - description: Usage information for OpenAI response. - OpenAIResponseUsageInputTokensDetails: + - input_rows + - scoring_functions + - benchmark_config + title: EvaluateRowsRequest + description: Request model for evaluating rows. + ExpiresAfter: properties: - cached_tokens: - title: Cached Tokens + anchor: + type: string + const: created_at + title: Anchor + description: Anchor must be 'created_at'. + seconds: type: integer + maximum: 2592000.0 + minimum: 3600.0 + title: Seconds + description: Seconds between 3600 and 2592000 (1 hour to 30 days). type: object - title: OpenAIResponseUsageInputTokensDetails - description: Token details for input tokens in OpenAI response usage. - OpenAIResponseUsageOutputTokensDetails: + required: + - anchor + - seconds + title: ExpiresAfter + description: Control expiration of uploaded files. + GrammarResponseFormat: + properties: + type: + type: string + const: grammar + title: Type + default: grammar + bnf: + additionalProperties: true + type: object + title: Bnf + type: object + required: + - bnf + title: GrammarResponseFormat + description: Configuration for grammar-guided response generation. + GreedySamplingStrategy: + properties: + type: + type: string + const: greedy + title: Type + default: greedy + type: object + title: GreedySamplingStrategy + description: Greedy sampling strategy that selects the highest probability token at each step. + HealthInfo: properties: - reasoning_tokens: - title: Reasoning Tokens - type: integer + status: + $ref: '#/components/schemas/HealthStatus' + description: Current health status of the service type: object - title: OpenAIResponseUsageOutputTokensDetails - description: Token details for output tokens in OpenAI response usage. - OpenAISystemMessageParam: + required: + - status + title: HealthInfo + description: Health status information for the service. + HealthStatus: + type: string + enum: + - OK + - Error + - Not Implemented + title: HealthStatus + ImageContentItem-Input: properties: - role: - type: string - const: system - title: Role - default: system - content: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - name: - title: Name + type: type: string + const: image + title: Type + default: image + image: + $ref: '#/components/schemas/_URLOrData' type: object required: - - content - title: OpenAISystemMessageParam - description: A system message providing instructions or context to the model. - OpenAITokenLogProb: + - image + title: ImageContentItem + description: A image content item. + ImageContentItem-Output: properties: - token: + type: type: string - title: Token - bytes: - title: Bytes - items: - type: integer - type: array - logprob: - type: number - title: Logprob - top_logprobs: - items: - $ref: '#/components/schemas/OpenAITopLogProb' - type: array - title: Top Logprobs + const: image + title: Type + default: image + image: + $ref: '#/components/schemas/_URLOrData' type: object required: - - token - - logprob - - top_logprobs - title: OpenAITokenLogProb - description: The log probability for a token from an OpenAI-compatible chat completion response. - OpenAIToolMessageParam: + - image + title: ImageContentItem + description: A image content item. + InferenceStep-Output: properties: - role: + turn_id: type: string - const: tool - title: Role - default: tool - tool_call_id: + title: Turn Id + description: The ID of the turn. + step_id: type: string - title: Tool Call Id - content: + title: Step Id + description: The ID of the step. + started_at: anyOf: - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content + format: date-time + - type: 'null' + title: Started At + description: The time the step started. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: The time the step completed. + step_type: + type: string + const: inference + title: Step Type + default: inference + model_response: + $ref: '#/components/schemas/CompletionMessage-Output' + description: The response from the LLM. type: object required: - - tool_call_id - - content - title: OpenAIToolMessageParam - description: A message representing the result of a tool invocation in an OpenAI-compatible chat completion request. - OpenAITopLogProb: + - turn_id + - step_id + - model_response + title: InferenceStep + description: An inference step in an agent turn. + InputTokensDetails: properties: - token: - type: string - title: Token - bytes: - title: Bytes - items: - type: integer - type: array - logprob: - type: number - title: Logprob + cached_tokens: + type: integer + title: Cached Tokens + additionalProperties: true type: object required: - - token - - logprob - title: OpenAITopLogProb - description: The top log probability for a token from an OpenAI-compatible chat completion response. - OpenAIUserMessageParam-Input: + - cached_tokens + title: InputTokensDetails + InsertChunksRequest: properties: - role: + vector_store_id: type: string - const: user - title: Role - default: user - content: + title: Vector Store Id + description: The identifier of the vector database to insert the chunks into. + chunks: + items: + $ref: '#/components/schemas/Chunk-Input' + type: array + title: Chunks + description: The chunks to insert. + ttl_seconds: anyOf: - - type: string - - items: - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - - $ref: '#/components/schemas/OpenAIFile' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/OpenAIFile' - image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - name: - title: Name - type: string + - type: integer + - type: 'null' + title: Ttl Seconds + description: The time to live of the chunks. type: object required: - - content - title: OpenAIUserMessageParam - description: A message from the user in an OpenAI-compatible chat completion request. - OpenAIUserMessageParam-Output: + - vector_store_id + - chunks + title: InsertChunksRequest + description: Request to insert chunks into a vector database. + InvokeToolRequest: properties: - role: - type: string - const: user - title: Role - default: user - content: - anyOf: - - type: string - - items: - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - - $ref: '#/components/schemas/OpenAIFile' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/OpenAIFile' - image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - name: - title: Name + tool_name: type: string + title: Tool Name + description: The name of the tool to invoke + kwargs: + additionalProperties: true + type: object + title: Kwargs + description: A dictionary of arguments to pass to the tool type: object required: - - content - title: OpenAIUserMessageParam - description: A message from the user in an OpenAI-compatible chat completion request. - OptimizerConfig: + - tool_name + - kwargs + title: InvokeToolRequest + description: Request model for invoking a tool. + Job: properties: - optimizer_type: - $ref: '#/components/schemas/OptimizerType' - lr: - type: number - title: Lr - weight_decay: - type: number - title: Weight Decay - num_warmup_steps: - type: integer - title: Num Warmup Steps + job_id: + type: string + title: Job Id + status: + $ref: '#/components/schemas/JobStatus' type: object required: - - optimizer_type - - lr - - weight_decay - - num_warmup_steps - title: OptimizerConfig - description: Configuration parameters for the optimization algorithm. - OptimizerType: - type: string - enum: - - adam - - adamw - - sgd - title: OptimizerType - description: Available optimizer algorithms for training. - Order: + - job_id + - status + title: Job + description: A job execution instance with status tracking. + JobStatus: type: string enum: - - asc - - desc - title: Order - description: Sort order for paginated responses. - OutputTokensDetails: + - completed + - in_progress + - failed + - scheduled + - cancelled + title: JobStatus + description: "Status of a job execution.\n:cvar completed: Job has finished successfully\n:cvar in_progress: Job is currently running\n:cvar failed: Job has failed during execution\n:cvar scheduled: Job is scheduled but not yet started\n:cvar cancelled: Job was cancelled before completion" + JsonSchemaResponseFormat: properties: - reasoning_tokens: - type: integer - title: Reasoning Tokens - additionalProperties: true + type: + type: string + const: json_schema + title: Type + default: json_schema + json_schema: + additionalProperties: true + type: object + title: Json Schema type: object required: - - reasoning_tokens - title: OutputTokensDetails - PostTrainingJob: + - json_schema + title: JsonSchemaResponseFormat + description: Configuration for JSON schema-guided response generation. + JsonType: properties: - job_uuid: + type: type: string - title: Job Uuid + const: json + title: Type + default: json type: object - required: - - job_uuid - title: PostTrainingJob - Prompt: + title: JsonType + description: "Parameter type for JSON values.\n\n:param type: Discriminator type. Always \"json\"" + LLMAsJudgeScoringFnParams: properties: - prompt: - title: Prompt - description: The system prompt with variable placeholders + type: type: string - version: - type: integer - minimum: 1.0 - title: Version - description: Version (integer starting at 1, incremented on save) - prompt_id: + const: llm_as_judge + title: Type + default: llm_as_judge + judge_model: type: string - title: Prompt Id - description: Unique identifier in format 'pmpt_<48-digit-hash>' - variables: + title: Judge Model + prompt_template: + anyOf: + - type: string + - type: 'null' + title: Prompt Template + judge_score_regexes: items: type: string type: array - title: Variables - description: List of variable names that can be used in the prompt template - is_default: - type: boolean - title: Is Default - description: Boolean indicating whether this version is the default version - default: false + title: Judge Score Regexes + description: Regexes to extract the answer from generated response + aggregation_functions: + items: + $ref: '#/components/schemas/AggregationFunctionType' + type: array + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row type: object required: - - version - - prompt_id - title: Prompt - description: A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack. - ProviderInfo: + - judge_model + title: LLMAsJudgeScoringFnParams + description: Parameters for LLM-as-judge scoring function configuration. + LLMRAGQueryGeneratorConfig: properties: - api: + type: type: string - title: Api - provider_id: + const: llm + title: Type + default: llm + model: type: string - title: Provider Id - provider_type: + title: Model + template: type: string - title: Provider Type - config: - additionalProperties: true - type: object - title: Config - health: - additionalProperties: true - type: object - title: Health + title: Template type: object required: - - api - - provider_id - - provider_type - - config - - health - title: ProviderInfo - description: Information about a registered provider including its configuration and health status. - QueryChunksResponse: + - model + - template + title: LLMRAGQueryGeneratorConfig + description: "Configuration for the LLM-based RAG query generator.\n\n:param type: Type of query generator, always 'llm'\n:param model: Name of the language model to use for query generation\n:param template: Template string for formatting the query generation prompt" + ListBatchesResponse: properties: - chunks: + object: + type: string + const: list + title: Object + description: The object type, which is always 'list'. + default: list + data: items: - $ref: '#/components/schemas/Chunk-Output' + $ref: '#/components/schemas/Batch' type: array - title: Chunks - scores: + title: Data + description: List of batch objects. + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + description: ID of the first batch in the list. + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + description: ID of the last batch in the list. + has_more: + type: boolean + title: Has More + description: Whether there are more batches available. + default: false + type: object + required: + - data + title: ListBatchesResponse + description: Response containing a list of batch objects. + ListBenchmarksResponse: + properties: + data: items: - type: number + $ref: '#/components/schemas/Benchmark' type: array - title: Scores + title: Data + description: List of benchmark resources type: object required: - - chunks - - scores - title: QueryChunksResponse - description: Response from querying chunks in a vector database. - RAGQueryConfig: + - data + title: ListBenchmarksResponse + description: Response model for listing benchmarks. + ListDatasetsResponse: properties: - query_generator_config: - oneOf: - - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' - - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' - title: Query Generator Config - default: - type: default - separator: ' ' - discriminator: - propertyName: type - mapping: - default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' - llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' - max_tokens_in_context: - type: integer - title: Max Tokens In Context - default: 4096 - max_chunks: - type: integer - title: Max Chunks - default: 5 - chunk_template: + data: + items: + $ref: '#/components/schemas/Dataset' + type: array + title: Data + description: List of datasets + type: object + required: + - data + title: ListDatasetsResponse + description: Response from listing datasets. + ListModelsResponse: + properties: + data: + items: + $ref: '#/components/schemas/Model' + type: array + title: Data + description: List of model resources. + type: object + required: + - data + title: ListModelsResponse + description: Response model for listing models. + ListOpenAIChatCompletionResponse: + properties: + data: + items: + $ref: '#/components/schemas/OpenAICompletionWithInputMessages' + type: array + title: Data + has_more: + type: boolean + title: Has More + first_id: type: string - title: Chunk Template - default: "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n" - mode: - default: vector - $ref: '#/components/schemas/RAGSearchMode' - ranker: - title: Ranker - oneOf: - - $ref: '#/components/schemas/RRFRanker' - - $ref: '#/components/schemas/WeightedRanker' - discriminator: - propertyName: type - mapping: - rrf: '#/components/schemas/RRFRanker' - weighted: '#/components/schemas/WeightedRanker' + title: First Id + last_id: + type: string + title: Last Id + object: + type: string + const: list + title: Object + default: list type: object - title: RAGQueryConfig - description: Configuration for the RAG query generation. - RAGQueryResult: + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIChatCompletionResponse + description: Response from listing OpenAI-compatible chat completions. + ListOpenAIFileResponse: + properties: + data: + items: + $ref: '#/components/schemas/OpenAIFileObject' + type: array + title: Data + description: List of file objects. + has_more: + type: boolean + title: Has More + description: Whether there are more files available beyond this page. + first_id: + type: string + title: First Id + description: ID of the first file in the list for pagination. + last_id: + type: string + title: Last Id + description: ID of the last file in the list for pagination. + object: + type: string + const: list + title: Object + description: The object type, which is always 'list'. + default: list + type: object + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIFileResponse + description: Response for listing files in OpenAI Files API. + ListOpenAIResponseInputItem: properties: - content: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' + data: + items: + anyOf: + - oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - title: Content - metadata: - additionalProperties: true - type: object - title: Metadata - type: object - title: RAGQueryResult - description: Result of a RAG query containing retrieved content and metadata. - RAGSearchMode: - type: string - enum: - - vector - - keyword - - hybrid - title: RAGSearchMode - description: "Search modes for RAG query retrieval:\n- VECTOR: Uses vector similarity search for semantic matching\n- KEYWORD: Uses keyword-based search for exact matching\n- HYBRID: Combines both vector and keyword search for better results" - RRFRanker: - properties: - type: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + type: array + title: Data + description: List of input items + object: type: string - const: rrf - title: Type - default: rrf - impact_factor: - type: number - title: Impact Factor - default: 60.0 - minimum: 0.0 + const: list + title: Object + description: Object type identifier, always "list" + default: list type: object - title: RRFRanker - description: Reciprocal Rank Fusion (RRF) ranker configuration. - RegexParserScoringFnParams: + required: + - data + title: ListOpenAIResponseInputItem + description: "List container for OpenAI response input items.\n\n:param data: List of input items\n:param object: Object type identifier, always \"list\"" + ListOpenAIResponseObject: properties: - type: - type: string - const: regex_parser - title: Type - default: regex_parser - parsing_regexes: + data: items: - type: string + $ref: '#/components/schemas/OpenAIResponseObjectWithInput-Output' type: array - title: Parsing Regexes - description: Regex to extract the answer from generated response - aggregation_functions: + title: Data + description: List of response objects with their input context + has_more: + type: boolean + title: Has More + description: Whether there are more results available beyond this page + first_id: + type: string + title: First Id + description: Identifier of the first item in this page + last_id: + type: string + title: Last Id + description: Identifier of the last item in this page + object: + type: string + const: list + title: Object + description: Object type identifier, always "list" + default: list + type: object + required: + - data + - has_more + - first_id + - last_id + title: ListOpenAIResponseObject + description: "Paginated list of OpenAI response objects with navigation metadata.\n\n:param data: List of response objects with their input context\n:param has_more: Whether there are more results available beyond this page\n:param first_id: Identifier of the first item in this page\n:param last_id: Identifier of the last item in this page\n:param object: Object type identifier, always \"list\"" + ListPostTrainingJobsResponse: + properties: + data: items: - $ref: '#/components/schemas/AggregationFunctionType' + $ref: '#/components/schemas/PostTrainingJob' type: array - title: Aggregation Functions - description: Aggregation functions to apply to the scores of each row + title: Data + description: The list of training jobs type: object - title: RegexParserScoringFnParams - description: Parameters for regex parser scoring function configuration. - RerankData: + required: + - data + title: ListPostTrainingJobsResponse + ListPromptsResponse: properties: - index: - type: integer - title: Index - relevance_score: - type: number - title: Relevance Score + data: + items: + $ref: '#/components/schemas/Prompt' + type: array + title: Data + description: List of prompt resources. type: object required: - - index - - relevance_score - title: RerankData - description: A single rerank result from a reranking response. - RerankResponse: + - data + title: ListPromptsResponse + description: Response model to list prompts. + ListProvidersResponse: properties: data: items: - $ref: '#/components/schemas/RerankData' + $ref: '#/components/schemas/ProviderInfo' type: array title: Data + description: List of provider information objects type: object required: - data - title: RerankResponse - description: Response from a reranking request. - RouteInfo: + title: ListProvidersResponse + description: Response containing a list of all available providers. + ListRoutesResponse: properties: - route: - type: string - title: Route - method: - type: string - title: Method - provider_types: + data: items: - type: string + $ref: '#/components/schemas/RouteInfo' type: array - title: Provider Types + title: Data + description: List of available route information objects type: object required: - - route - - method - - provider_types - title: RouteInfo - description: Information about an API route including its path, method, and implementing providers. - RowsDataSource: + - data + title: ListRoutesResponse + description: Response containing a list of all available API routes. + ListScoringFunctionsResponse: properties: - type: - type: string - const: rows - title: Type - default: rows - rows: + data: items: - additionalProperties: true - type: object + $ref: '#/components/schemas/ScoringFn' type: array - title: Rows + title: Data + description: List of scoring function resources type: object required: - - rows - title: RowsDataSource - description: A dataset stored in rows. - RunShieldResponse: + - data + title: ListScoringFunctionsResponse + description: Response model for listing scoring functions. + ListShieldsResponse: properties: - violation: - $ref: '#/components/schemas/SafetyViolation' + data: + items: + $ref: '#/components/schemas/Shield' + type: array + title: Data + description: List of shield resources type: object - title: RunShieldResponse - description: Response from running a safety shield. - SafetyViolation: + required: + - data + title: ListShieldsResponse + description: Response model for listing shields. + ListToolDefsResponse: properties: - violation_level: - $ref: '#/components/schemas/ViolationLevel' - user_message: - title: User Message - type: string - metadata: - additionalProperties: true - type: object - title: Metadata + data: + items: + $ref: '#/components/schemas/ToolDef' + type: array + title: Data + description: List of tool definitions type: object required: - - violation_level - title: SafetyViolation - description: Details of a safety violation detected by content moderation. - SamplingParams: + - data + title: ListToolDefsResponse + description: Response containing a list of tool definitions. + ListToolGroupsResponse: properties: - strategy: - oneOf: - - $ref: '#/components/schemas/GreedySamplingStrategy' - - $ref: '#/components/schemas/TopPSamplingStrategy' - - $ref: '#/components/schemas/TopKSamplingStrategy' - title: Strategy - discriminator: - propertyName: type - mapping: - greedy: '#/components/schemas/GreedySamplingStrategy' - top_k: '#/components/schemas/TopKSamplingStrategy' - top_p: '#/components/schemas/TopPSamplingStrategy' - max_tokens: - title: Max Tokens - type: integer - repetition_penalty: - title: Repetition Penalty - default: 1.0 - type: number - stop: - title: Stop + data: + items: + $ref: '#/components/schemas/ToolGroup' + type: array + title: Data + description: List of tool groups + type: object + required: + - data + title: ListToolGroupsResponse + description: Response containing a list of tool groups. + LoraFinetuningConfig: + properties: + type: + type: string + const: LoRA + title: Type + default: LoRA + lora_attn_modules: items: type: string type: array + title: Lora Attn Modules + apply_lora_to_mlp: + type: boolean + title: Apply Lora To Mlp + apply_lora_to_output: + type: boolean + title: Apply Lora To Output + rank: + type: integer + title: Rank + alpha: + type: integer + title: Alpha + use_dora: + anyOf: + - type: boolean + - type: 'null' + title: Use Dora + default: false + quantize_base: + anyOf: + - type: boolean + - type: 'null' + title: Quantize Base + default: false type: object - title: SamplingParams - description: Sampling parameters. - ScoreBatchResponse: + required: + - lora_attn_modules + - apply_lora_to_mlp + - apply_lora_to_output + - rank + - alpha + title: LoraFinetuningConfig + description: Configuration for Low-Rank Adaptation (LoRA) fine-tuning. + MCPListToolsTool: properties: - dataset_id: - title: Dataset Id - type: string - results: - additionalProperties: - $ref: '#/components/schemas/ScoringResult' + input_schema: + additionalProperties: true type: object - title: Results + title: Input Schema + description: JSON schema defining the tool's input parameters + name: + type: string + title: Name + description: Name of the tool + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Description of what the tool does type: object required: - - results - title: ScoreBatchResponse - description: Response from batch scoring operations on datasets. - ScoreResponse: + - input_schema + - name + title: MCPListToolsTool + description: "Tool definition returned by MCP list tools operation.\n\n:param input_schema: JSON schema defining the tool's input parameters\n:param name: Name of the tool\n:param description: (Optional) Description of what the tool does" + MemoryRetrievalStep-Output: properties: - results: - additionalProperties: - $ref: '#/components/schemas/ScoringResult' - type: object - title: Results + turn_id: + type: string + title: Turn Id + description: The ID of the turn. + step_id: + type: string + title: Step Id + description: The ID of the step. + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At + description: The time the step started. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: The time the step completed. + step_type: + type: string + const: memory_retrieval + title: Step Type + default: memory_retrieval + vector_store_ids: + type: string + title: Vector Store Ids + description: The IDs of the vector databases to retrieve context from. + inserted_context: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Inserted Context + description: The context retrieved from the vector databases. type: object required: - - results - title: ScoreResponse - description: The response from scoring. - ScoringFn-Output: + - turn_id + - step_id + - vector_store_ids + - inserted_context + title: MemoryRetrievalStep + description: A memory retrieval step in an agent turn. + Model: properties: identifier: type: string title: Identifier description: Unique identifier for this resource in llama stack provider_resource_id: + anyOf: + - type: string + - type: 'null' title: Provider Resource Id description: Unique identifier for this resource in the provider - type: string provider_id: type: string title: Provider Id description: ID of the provider that owns this resource type: type: string - const: scoring_function + const: model title: Type - default: scoring_function - description: - title: Description - type: string + description: The resource type, always 'model' for model resources. + default: model metadata: additionalProperties: true type: object title: Metadata - description: Any additional metadata for this definition - return_type: - oneOf: - - $ref: '#/components/schemas/StringType' - - $ref: '#/components/schemas/NumberType' - - $ref: '#/components/schemas/BooleanType' - - $ref: '#/components/schemas/ArrayType' - - $ref: '#/components/schemas/ObjectType' - - $ref: '#/components/schemas/JsonType' - - $ref: '#/components/schemas/UnionType' - - $ref: '#/components/schemas/ChatCompletionInputType' - - $ref: '#/components/schemas/CompletionInputType' - - $ref: '#/components/schemas/AgentTurnInputType' - title: Return Type - description: The return type of the deterministic function - discriminator: - propertyName: type - mapping: - agent_turn_input: '#/components/schemas/AgentTurnInputType' - array: '#/components/schemas/ArrayType' - boolean: '#/components/schemas/BooleanType' - chat_completion_input: '#/components/schemas/ChatCompletionInputType' - completion_input: '#/components/schemas/CompletionInputType' - json: '#/components/schemas/JsonType' - number: '#/components/schemas/NumberType' - object: '#/components/schemas/ObjectType' - string: '#/components/schemas/StringType' - union: '#/components/schemas/UnionType' - params: - title: Params - description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval - oneOf: - - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - - $ref: '#/components/schemas/RegexParserScoringFnParams' - - $ref: '#/components/schemas/BasicScoringFnParams' - discriminator: - propertyName: type - mapping: - basic: '#/components/schemas/BasicScoringFnParams' - llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' - regex_parser: '#/components/schemas/RegexParserScoringFnParams' + description: Any additional metadata for this model. + model_type: + $ref: '#/components/schemas/ModelType' + description: The type of model (LLM or embedding model). + default: llm type: object required: - identifier - provider_id - - return_type - title: ScoringFn - description: A scoring function resource for evaluating model outputs. - ScoringResult: + title: Model + description: A model resource representing an AI model registered in Llama Stack. + ModelCandidate: properties: - score_rows: + type: + type: string + const: model + title: Type + description: The type of candidate. + default: model + model: + type: string + title: Model + description: The model ID to evaluate. + sampling_params: + $ref: '#/components/schemas/SamplingParams' + description: The sampling parameters for the model. + system_message: + anyOf: + - $ref: '#/components/schemas/SystemMessage' + - type: 'null' + description: The system message providing instructions or context to the model. + type: object + required: + - model + - sampling_params + title: ModelCandidate + description: A model candidate for evaluation. + ModelType: + type: string + enum: + - llm + - embedding + - rerank + title: ModelType + description: Enumeration of supported model types in Llama Stack. + ModerationObject: + properties: + id: + type: string + title: Id + description: The unique identifier for the moderation request. + model: + type: string + title: Model + description: The model used to generate the moderation results. + results: items: - additionalProperties: true - type: object + $ref: '#/components/schemas/ModerationObjectResults' type: array - title: Score Rows - aggregated_results: + title: Results + description: A list of moderation objects. + type: object + required: + - id + - model + - results + title: ModerationObject + description: A moderation object. + ModerationObjectResults: + properties: + flagged: + type: boolean + title: Flagged + description: Whether any of the below categories are flagged. + categories: + anyOf: + - additionalProperties: + type: boolean + type: object + - type: 'null' + title: Categories + description: A list of the categories, and whether they are flagged or not. + category_applied_input_types: + anyOf: + - additionalProperties: + items: + type: string + type: array + type: object + - type: 'null' + title: Category Applied Input Types + description: A list of the categories along with the input type(s) that the score applies to. + category_scores: + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Category Scores + description: A list of the categories along with their scores as predicted by model. + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + description: User message. + metadata: additionalProperties: true type: object - title: Aggregated Results + title: Metadata + description: Additional metadata. type: object required: - - score_rows - - aggregated_results - title: ScoringResult - description: A scoring result for a single row. - SearchRankingOptions: + - flagged + title: ModerationObjectResults + description: A moderation object. + NumberType: properties: - ranker: - title: Ranker + type: type: string - score_threshold: - title: Score Threshold - default: 0.0 - type: number + const: number + title: Type + default: number type: object - title: SearchRankingOptions - description: Options for ranking and filtering search results. - Shield: + title: NumberType + description: "Parameter type for numeric values.\n\n:param type: Discriminator type. Always \"number\"" + ObjectType: properties: - identifier: - type: string - title: Identifier - description: Unique identifier for this resource in llama stack - provider_resource_id: - title: Provider Resource Id - description: Unique identifier for this resource in the provider - type: string - provider_id: - type: string - title: Provider Id - description: ID of the provider that owns this resource type: type: string - const: shield + const: object title: Type - default: shield - params: - title: Params - additionalProperties: true - type: object + default: object type: object - required: - - identifier - - provider_id - title: Shield - description: A safety shield resource that can be used to check content. - ShieldCallStep-Output: + title: ObjectType + description: "Parameter type for object values.\n\n:param type: Discriminator type. Always \"object\"" + OpenAIAssistantMessageParam-Input: properties: - turn_id: - type: string - title: Turn Id - step_id: - type: string - title: Step Id - started_at: - title: Started At + role: type: string - format: date-time - completed_at: - title: Completed At + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + - type: 'null' + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + title: Tool Calls + type: object + title: OpenAIAssistantMessageParam + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. + OpenAIAssistantMessageParam-Output: + properties: + role: type: string - format: date-time - step_type: + const: assistant + title: Role + default: assistant + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + - type: 'null' + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + title: Tool Calls + type: object + title: OpenAIAssistantMessageParam + description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. + OpenAIChatCompletionContentPartImageParam: + properties: + type: type: string - const: shield_call - title: Step Type - default: shield_call - violation: - $ref: '#/components/schemas/SafetyViolation' + const: image_url + title: Type + default: image_url + image_url: + $ref: '#/components/schemas/OpenAIImageURL' type: object required: - - turn_id - - step_id - - violation - title: ShieldCallStep - description: A shield call step in an agent turn. - StopReason: - type: string - enum: - - end_of_turn - - end_of_message - - out_of_tokens - title: StopReason - StringType: + - image_url + title: OpenAIChatCompletionContentPartImageParam + description: Image content part for OpenAI-compatible chat completion messages. + OpenAIChatCompletionContentPartTextParam: properties: type: type: string - const: string + const: text title: Type - default: string + default: text + text: + type: string + title: Text type: object - title: StringType - description: Parameter type for string values. - SystemMessage: + required: + - text + title: OpenAIChatCompletionContentPartTextParam + description: Text content part for OpenAI-compatible chat completion messages. + OpenAIChatCompletionRequestWithExtraBody: properties: - role: + model: type: string - const: system - title: Role - default: system - content: + title: Model + messages: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Input' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Input' + type: array + minItems: 1 + title: Messages + frequency_penalty: + anyOf: + - type: number + - type: 'null' + title: Frequency Penalty + function_call: anyOf: - type: string + - additionalProperties: true + type: object + - type: 'null' + title: Function Call + functions: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Functions + logit_bias: + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Logit Bias + logprobs: + anyOf: + - type: boolean + - type: 'null' + title: Logprobs + max_completion_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Completion Tokens + max_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Tokens + n: + anyOf: + - type: integer + - type: 'null' + title: N + parallel_tool_calls: + anyOf: + - type: boolean + - type: 'null' + title: Parallel Tool Calls + presence_penalty: + anyOf: + - type: number + - type: 'null' + title: Presence Penalty + response_format: + anyOf: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' + - $ref: '#/components/schemas/OpenAIResponseFormatText' + - $ref: '#/components/schemas/OpenAIResponseFormatJSONSchema' + - $ref: '#/components/schemas/OpenAIResponseFormatJSONObject' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' + json_object: '#/components/schemas/OpenAIResponseFormatJSONObject' + json_schema: '#/components/schemas/OpenAIResponseFormatJSONSchema' + text: '#/components/schemas/OpenAIResponseFormatText' + - type: 'null' + title: Response Format + seed: + anyOf: + - type: integer + - type: 'null' + title: Seed + stop: + anyOf: + - type: string - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' + type: string + type: array + - type: 'null' + title: Stop + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + stream_options: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Stream Options + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + tool_choice: + anyOf: + - type: string + - additionalProperties: true + type: object + - type: 'null' + title: Tool Choice + tools: + anyOf: + - items: + additionalProperties: true + type: object type: array - title: Content + - type: 'null' + title: Tools + top_logprobs: + anyOf: + - type: integer + - type: 'null' + title: Top Logprobs + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + user: + anyOf: + - type: string + - type: 'null' + title: User + additionalProperties: true type: object required: - - content - title: SystemMessage - description: A system message providing instructions or context to the model. - SystemMessageBehavior: - type: string - enum: - - append - - replace - title: SystemMessageBehavior - description: Config for how to override the default system prompt. - TextContentItem: + - model + - messages + title: OpenAIChatCompletionRequestWithExtraBody + description: Request parameters for OpenAI-compatible chat completion endpoint. + OpenAIChatCompletionToolCall: properties: + index: + anyOf: + - type: integer + - type: 'null' + title: Index + id: + anyOf: + - type: string + - type: 'null' + title: Id type: type: string - const: text + const: function title: Type - default: text - text: - type: string - title: Text + default: function + function: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' + - type: 'null' type: object - required: - - text - title: TextContentItem - description: A text content item - ToolCall: + title: OpenAIChatCompletionToolCall + description: Tool call specification for OpenAI-compatible chat completion responses. + OpenAIChatCompletionToolCallFunction: properties: - call_id: - type: string - title: Call Id - tool_name: + name: anyOf: - - $ref: '#/components/schemas/BuiltinTool' - type: string - title: Tool Name + - type: 'null' + title: Name arguments: - type: string + anyOf: + - type: string + - type: 'null' title: Arguments type: object + title: OpenAIChatCompletionToolCallFunction + description: Function call details for OpenAI-compatible tool calls. + OpenAIChatCompletionUsage: + properties: + prompt_tokens: + type: integer + title: Prompt Tokens + completion_tokens: + type: integer + title: Completion Tokens + total_tokens: + type: integer + title: Total Tokens + prompt_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails' + - type: 'null' + completion_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails' + - type: 'null' + type: object required: - - call_id - - tool_name - - arguments - title: ToolCall - ToolChoice: - type: string - enum: - - auto - - required - - none - title: ToolChoice - description: Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model. - ToolConfig: + - prompt_tokens + - completion_tokens + - total_tokens + title: OpenAIChatCompletionUsage + description: Usage information for OpenAI chat completion. + OpenAIChatCompletionUsageCompletionTokensDetails: properties: - tool_choice: + reasoning_tokens: anyOf: - - $ref: '#/components/schemas/ToolChoice' - - type: string - title: Tool Choice - default: auto - tool_prompt_format: - $ref: '#/components/schemas/ToolPromptFormat' - system_message_behavior: - default: append - $ref: '#/components/schemas/SystemMessageBehavior' + - type: integer + - type: 'null' + title: Reasoning Tokens type: object - title: ToolConfig - description: Configuration for tool use. - ToolDef: + title: OpenAIChatCompletionUsageCompletionTokensDetails + description: Token details for output tokens in OpenAI chat completion usage. + OpenAIChatCompletionUsagePromptTokensDetails: properties: - toolgroup_id: - title: Toolgroup Id - type: string - name: - type: string - title: Name - description: - title: Description - type: string - input_schema: - title: Input Schema - additionalProperties: true - type: object - output_schema: - title: Output Schema - additionalProperties: true - type: object - metadata: - title: Metadata - additionalProperties: true - type: object + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens type: object - required: - - name - title: ToolDef - description: Tool definition used in runtime contexts. - ToolExecutionStep-Output: + title: OpenAIChatCompletionUsagePromptTokensDetails + description: Token details for prompt tokens in OpenAI chat completion usage. + OpenAIChoice-Output: properties: - turn_id: - type: string - title: Turn Id - step_id: - type: string - title: Step Id - started_at: - title: Started At - type: string - format: date-time - completed_at: - title: Completed At - type: string - format: date-time - step_type: + message: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Output' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Output' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + title: Message + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Output' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Output' + finish_reason: type: string - const: tool_execution - title: Step Type - default: tool_execution - tool_calls: - items: - $ref: '#/components/schemas/ToolCall' - type: array - title: Tool Calls - tool_responses: - items: - $ref: '#/components/schemas/ToolResponse-Output' - type: array - title: Tool Responses + title: Finish Reason + index: + type: integer + title: Index + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + - type: 'null' type: object required: - - turn_id - - step_id - - tool_calls - - tool_responses - title: ToolExecutionStep - description: A tool execution step in an agent turn. - ToolGroup: + - message + - finish_reason + - index + title: OpenAIChoice + description: A choice from an OpenAI-compatible chat completion response. + OpenAIChoiceLogprobs-Output: properties: - identifier: - type: string - title: Identifier - description: Unique identifier for this resource in llama stack - provider_resource_id: - title: Provider Resource Id - description: Unique identifier for this resource in the provider - type: string - provider_id: - type: string - title: Provider Id - description: ID of the provider that owns this resource - type: + content: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + title: Content + refusal: + anyOf: + - items: + $ref: '#/components/schemas/OpenAITokenLogProb' + type: array + - type: 'null' + title: Refusal + type: object + title: OpenAIChoiceLogprobs + description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. + OpenAICompletion: + properties: + id: type: string - const: tool_group - title: Type - default: tool_group - mcp_endpoint: - $ref: '#/components/schemas/URL' - args: - title: Args - additionalProperties: true - type: object + title: Id + choices: + items: + $ref: '#/components/schemas/OpenAICompletionChoice-Output' + type: array + title: Choices + created: + type: integer + title: Created + model: + type: string + title: Model + object: + type: string + const: text_completion + title: Object + default: text_completion type: object required: - - identifier - - provider_id - title: ToolGroup - description: A group of related tools managed together. - ToolInvocationResult: + - id + - choices + - created + - model + title: OpenAICompletion + description: "Response from an OpenAI-compatible completion request.\n\n:id: The ID of the completion\n:choices: List of choices\n:created: The Unix timestamp in seconds when the completion was created\n:model: The model that was used to generate the completion\n:object: The object type, which will be \"text_completion\"" + OpenAICompletionChoice-Output: properties: - content: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - title: Content - error_message: - title: Error Message + finish_reason: type: string - error_code: - title: Error Code + title: Finish Reason + text: + type: string + title: Text + index: type: integer - metadata: - title: Metadata - additionalProperties: true - type: object + title: Index + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + - type: 'null' type: object - title: ToolInvocationResult - description: Result of a tool invocation. - ToolPromptFormat: - type: string - enum: - - json - - function_tag - - python_list - title: ToolPromptFormat - description: Prompt format for calling custom / zero shot tools. - ToolResponse-Input: + required: + - finish_reason + - text + - index + title: OpenAICompletionChoice + description: "A choice from an OpenAI-compatible completion response.\n\n:finish_reason: The reason the model stopped generating\n:text: The text of the choice\n:index: The index of the choice\n:logprobs: (Optional) The log probabilities for the tokens in the choice" + OpenAICompletionRequestWithExtraBody: properties: - call_id: + model: type: string - title: Call Id - tool_name: + title: Model + prompt: anyOf: - - $ref: '#/components/schemas/BuiltinTool' - type: string - title: Tool Name - content: + - items: + type: string + type: array + - items: + type: integer + type: array + - items: + items: + type: integer + type: array + type: array + title: Prompt + best_of: + anyOf: + - type: integer + - type: 'null' + title: Best Of + echo: + anyOf: + - type: boolean + - type: 'null' + title: Echo + frequency_penalty: + anyOf: + - type: number + - type: 'null' + title: Frequency Penalty + logit_bias: + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Logit Bias + logprobs: + anyOf: + - type: integer + maximum: 5.0 + minimum: 0.0 + - type: 'null' + title: Logprobs + max_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Tokens + n: + anyOf: + - type: integer + - type: 'null' + title: N + presence_penalty: + anyOf: + - type: number + - type: 'null' + title: Presence Penalty + seed: + anyOf: + - type: integer + - type: 'null' + title: Seed + stop: anyOf: - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' + type: string type: array - title: Content - metadata: - title: Metadata - additionalProperties: true - type: object + - type: 'null' + title: Stop + stream: + anyOf: + - type: boolean + - type: 'null' + title: Stream + stream_options: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Stream Options + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + user: + anyOf: + - type: string + - type: 'null' + title: User + suffix: + anyOf: + - type: string + - type: 'null' + title: Suffix + additionalProperties: true type: object required: - - call_id - - tool_name - - content - title: ToolResponse - description: Response from a tool invocation. - ToolResponse-Output: + - model + - prompt + title: OpenAICompletionRequestWithExtraBody + description: Request parameters for OpenAI-compatible completion endpoint. + OpenAICompletionWithInputMessages: properties: - call_id: + id: type: string - title: Call Id - tool_name: + title: Id + choices: + items: + $ref: '#/components/schemas/OpenAIChoice-Output' + type: array + title: Choices + object: + type: string + const: chat.completion + title: Object + default: chat.completion + created: + type: integer + title: Created + model: + type: string + title: Model + usage: anyOf: - - $ref: '#/components/schemas/BuiltinTool' - - type: string - title: Tool Name - content: + - $ref: '#/components/schemas/OpenAIChatCompletionUsage' + - type: 'null' + input_messages: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Output' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Output' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Output' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Output' + type: array + title: Input Messages + type: object + required: + - id + - choices + - created + - model + - input_messages + title: OpenAICompletionWithInputMessages + OpenAICreateVectorStoreFileBatchRequestWithExtraBody: + properties: + file_ids: + items: + type: string + type: array + title: File Ids + attributes: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Attributes + chunking_strategy: anyOf: - - type: string - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' discriminator: propertyName: type mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + - type: 'null' + title: Chunking Strategy + additionalProperties: true + type: object + required: + - file_ids + title: OpenAICreateVectorStoreFileBatchRequestWithExtraBody + description: Request to create a vector store file batch with extra_body support. + OpenAICreateVectorStoreRequestWithExtraBody: + properties: + name: + anyOf: + - type: string + - type: 'null' + title: Name + file_ids: + anyOf: - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' + type: string type: array - title: Content + - type: 'null' + title: File Ids + expires_after: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After + chunking_strategy: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Chunking Strategy metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' title: Metadata - additionalProperties: true - type: object + additionalProperties: true + type: object + title: OpenAICreateVectorStoreRequestWithExtraBody + description: Request to create a vector store with extra_body support. + OpenAIDeleteResponseObject: + properties: + id: + type: string + title: Id + description: Unique identifier of the deleted response + object: + type: string + const: response + title: Object + description: Object type identifier, always "response" + default: response + deleted: + type: boolean + title: Deleted + description: Deletion confirmation flag, always True + default: true type: object required: - - call_id - - tool_name - - content - title: ToolResponse - description: Response from a tool invocation. - ToolResponseMessage-Output: + - id + title: OpenAIDeleteResponseObject + description: "Response object confirming deletion of an OpenAI response.\n\n:param id: Unique identifier of the deleted response\n:param object: Object type identifier, always \"response\"\n:param deleted: Deletion confirmation flag, always True" + OpenAIDeveloperMessageParam: properties: role: type: string - const: tool + const: developer title: Role - default: tool - call_id: - type: string - title: Call Id + default: developer content: anyOf: - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' type: array title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name type: object required: - - call_id - content - title: ToolResponseMessage - description: A message representing the result of a tool invocation. - TopKSamplingStrategy: + title: OpenAIDeveloperMessageParam + description: A message from the developer in an OpenAI-compatible chat completion request. + OpenAIEmbeddingData: properties: - type: + object: type: string - const: top_k - title: Type - default: top_k - top_k: + const: embedding + title: Object + default: embedding + embedding: + anyOf: + - items: + type: number + type: array + - type: string + title: Embedding + index: type: integer - minimum: 1.0 - title: Top K - type: object - required: - - top_k - title: TopKSamplingStrategy - description: Top-k sampling strategy that restricts sampling to the k most likely tokens. - TopPSamplingStrategy: - properties: - type: - type: string - const: top_p - title: Type - default: top_p - temperature: - title: Temperature - type: number - minimum: 0.0 - top_p: - title: Top P - default: 0.95 - type: number + title: Index type: object required: - - temperature - title: TopPSamplingStrategy - description: Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p. - TrainingConfig: + - embedding + - index + title: OpenAIEmbeddingData + description: A single embedding data object from an OpenAI-compatible embeddings response. + OpenAIEmbeddingUsage: properties: - n_epochs: - type: integer - title: N Epochs - max_steps_per_epoch: - type: integer - title: Max Steps Per Epoch - default: 1 - gradient_accumulation_steps: + prompt_tokens: type: integer - title: Gradient Accumulation Steps - default: 1 - max_validation_steps: - title: Max Validation Steps - default: 1 + title: Prompt Tokens + total_tokens: type: integer - data_config: - $ref: '#/components/schemas/DataConfig' - optimizer_config: - $ref: '#/components/schemas/OptimizerConfig' - efficiency_config: - $ref: '#/components/schemas/EfficiencyConfig' - dtype: - title: Dtype - default: bf16 - type: string - type: object - required: - - n_epochs - title: TrainingConfig - description: Comprehensive configuration for the training process. - Turn: - properties: - turn_id: - type: string - title: Turn Id - session_id: - type: string - title: Session Id - input_messages: - items: - anyOf: - - $ref: '#/components/schemas/UserMessage-Output' - - $ref: '#/components/schemas/ToolResponseMessage-Output' - type: array - title: Input Messages - steps: - items: - oneOf: - - $ref: '#/components/schemas/InferenceStep-Output' - - $ref: '#/components/schemas/ToolExecutionStep-Output' - - $ref: '#/components/schemas/ShieldCallStep-Output' - - $ref: '#/components/schemas/MemoryRetrievalStep-Output' - discriminator: - propertyName: step_type - mapping: - inference: '#/components/schemas/InferenceStep-Output' - memory_retrieval: '#/components/schemas/MemoryRetrievalStep-Output' - shield_call: '#/components/schemas/ShieldCallStep-Output' - tool_execution: '#/components/schemas/ToolExecutionStep-Output' - type: array - title: Steps - output_message: - $ref: '#/components/schemas/CompletionMessage-Output' - output_attachments: - title: Output Attachments - items: - $ref: '#/components/schemas/Attachment-Output' - type: array - started_at: - type: string - format: date-time - title: Started At - completed_at: - title: Completed At - type: string - format: date-time + title: Total Tokens type: object required: - - turn_id - - session_id - - input_messages - - steps - - output_message - - started_at - title: Turn - description: A single turn in an interaction with an Agentic System. - URIDataSource: + - prompt_tokens + - total_tokens + title: OpenAIEmbeddingUsage + description: Usage information for an OpenAI-compatible embeddings response. + OpenAIEmbeddingsRequestWithExtraBody: properties: - type: - type: string - const: uri - title: Type - default: uri - uri: + model: type: string - title: Uri + title: Model + input: + anyOf: + - type: string + - items: + type: string + type: array + title: Input + encoding_format: + anyOf: + - type: string + - type: 'null' + title: Encoding Format + default: float + dimensions: + anyOf: + - type: integer + - type: 'null' + title: Dimensions + user: + anyOf: + - type: string + - type: 'null' + title: User + additionalProperties: true type: object required: - - uri - title: URIDataSource - description: A dataset that can be obtained from a URI. - URL: + - model + - input + title: OpenAIEmbeddingsRequestWithExtraBody + description: Request parameters for OpenAI-compatible embeddings endpoint. + OpenAIEmbeddingsResponse: properties: - uri: + object: type: string - title: Uri + const: list + title: Object + default: list + data: + items: + $ref: '#/components/schemas/OpenAIEmbeddingData' + type: array + title: Data + model: + type: string + title: Model + usage: + $ref: '#/components/schemas/OpenAIEmbeddingUsage' type: object required: - - uri - title: URL - description: A URL reference to external content. - UnionType: + - data + - model + - usage + title: OpenAIEmbeddingsResponse + description: Response from an OpenAI-compatible embeddings request. + OpenAIFile: properties: type: type: string - const: union + const: file title: Type - default: union + default: file + file: + $ref: '#/components/schemas/OpenAIFileFile' type: object - title: UnionType - description: Parameter type for union values. - UserMessage-Input: + required: + - file + title: OpenAIFile + OpenAIFileDeleteResponse: properties: - role: + id: type: string - const: user - title: Role - default: user - content: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' - type: array - title: Content - context: - anyOf: - - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Input' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Input' - text: '#/components/schemas/TextContentItem' - type: array - title: Context + title: Id + description: The file identifier that was deleted. + object: + type: string + const: file + title: Object + description: The object type, which is always 'file'. + default: file + deleted: + type: boolean + title: Deleted + description: Whether the file was successfully deleted. type: object required: - - content - title: UserMessage - description: A message from the user in a chat conversation. - UserMessage-Output: + - id + - deleted + title: OpenAIFileDeleteResponse + description: Response for deleting a file in OpenAI Files API. + OpenAIFileFile: properties: - role: - type: string - const: user - title: Role - default: user - content: + file_id: anyOf: - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - title: Content - context: + - type: 'null' + title: File Id + filename: anyOf: - type: string - - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - - items: - oneOf: - - $ref: '#/components/schemas/ImageContentItem-Output' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem-Output' - text: '#/components/schemas/TextContentItem' - type: array - title: Context + - type: 'null' + title: Filename type: object - required: - - content - title: UserMessage - description: A message from the user in a chat conversation. - VectorStoreChunkingStrategyAuto: + title: OpenAIFileFile + OpenAIFileObject: properties: - type: + object: type: string - const: auto - title: Type - default: auto + const: file + title: Object + description: The object type, which is always 'file'. + default: file + id: + type: string + title: Id + description: The file identifier, which can be referenced in the API endpoints. + bytes: + type: integer + title: Bytes + description: The size of the file, in bytes. + created_at: + type: integer + title: Created At + description: The Unix timestamp (in seconds) for when the file was created. + expires_at: + type: integer + title: Expires At + description: The Unix timestamp (in seconds) for when the file expires. + filename: + type: string + title: Filename + description: The name of the file. + purpose: + $ref: '#/components/schemas/OpenAIFilePurpose' + description: The intended purpose of the file. type: object - title: VectorStoreChunkingStrategyAuto - description: Automatic chunking strategy for vector store files. - VectorStoreChunkingStrategyStatic: + required: + - id + - bytes + - created_at + - expires_at + - filename + - purpose + title: OpenAIFileObject + description: OpenAI File object as defined in the OpenAI Files API. + OpenAIFilePurpose: + type: string + enum: + - assistants + - batch + title: OpenAIFilePurpose + description: Valid purpose values for OpenAI Files API. + OpenAIImageURL: properties: - type: + url: type: string - const: static - title: Type - default: static - static: - $ref: '#/components/schemas/VectorStoreChunkingStrategyStaticConfig' + title: Url + detail: + anyOf: + - type: string + - type: 'null' + title: Detail type: object required: - - static - title: VectorStoreChunkingStrategyStatic - description: Static chunking strategy with configurable parameters. - VectorStoreChunkingStrategyStaticConfig: + - url + title: OpenAIImageURL + description: Image URL specification for OpenAI-compatible chat completion messages. + OpenAIJSONSchema: properties: - chunk_overlap_tokens: - type: integer - title: Chunk Overlap Tokens - default: 400 - max_chunk_size_tokens: - type: integer - maximum: 4096.0 - minimum: 100.0 - title: Max Chunk Size Tokens - default: 800 + name: + type: string + title: Name + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema type: object - title: VectorStoreChunkingStrategyStaticConfig - description: Configuration for static chunking strategy. - VectorStoreContent: + title: OpenAIJSONSchema + description: JSON schema specification for OpenAI-compatible structured response format. + OpenAIResponseAnnotationCitation: properties: type: type: string - const: text + const: url_citation title: Type - text: + description: Annotation type identifier, always "url_citation" + default: url_citation + end_index: + type: integer + title: End Index + description: End position of the citation span in the content + start_index: + type: integer + title: Start Index + description: Start position of the citation span in the content + title: type: string - title: Text + title: Title + description: Title of the referenced web resource + url: + type: string + title: Url + description: URL of the referenced web resource type: object required: - - type - - text - title: VectorStoreContent - description: Content item from a vector store file or search result. - VectorStoreFileBatchObject: + - end_index + - start_index + - title + - url + title: OpenAIResponseAnnotationCitation + description: "URL citation annotation for referencing external web resources.\n\n:param type: Annotation type identifier, always \"url_citation\"\n:param end_index: End position of the citation span in the content\n:param start_index: Start position of the citation span in the content\n:param title: Title of the referenced web resource\n:param url: URL of the referenced web resource" + OpenAIResponseAnnotationContainerFileCitation: properties: - id: + type: type: string - title: Id - object: + const: container_file_citation + title: Type + default: container_file_citation + container_id: type: string - title: Object - default: vector_store.file_batch - created_at: + title: Container Id + end_index: type: integer - title: Created At - vector_store_id: + title: End Index + file_id: type: string - title: Vector Store Id - status: - anyOf: - - type: string - const: completed - - type: string - const: in_progress - - type: string - const: cancelled - - type: string - const: failed - title: Status - file_counts: - $ref: '#/components/schemas/VectorStoreFileCounts' - type: object - required: - - id - - created_at - - vector_store_id - - status - - file_counts - title: VectorStoreFileBatchObject - description: OpenAI Vector Store File Batch object. - VectorStoreFileCounts: - properties: - completed: - type: integer - title: Completed - cancelled: - type: integer - title: Cancelled - failed: - type: integer - title: Failed - in_progress: - type: integer - title: In Progress - total: + title: File Id + filename: + type: string + title: Filename + start_index: type: integer - title: Total + title: Start Index type: object required: - - completed - - cancelled - - failed - - in_progress - - total - title: VectorStoreFileCounts - description: File processing status counts for a vector store. - VectorStoreFileLastError: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + OpenAIResponseAnnotationFileCitation: properties: - code: - anyOf: - - type: string - const: server_error - - type: string - const: rate_limit_exceeded - title: Code - message: + type: type: string - title: Message - type: object - required: - - code - - message - title: VectorStoreFileLastError - description: Error information for failed vector store file processing. - VectorStoreFileObject: - properties: - id: + const: file_citation + title: Type + description: Annotation type identifier, always "file_citation" + default: file_citation + file_id: type: string - title: Id - object: + title: File Id + description: Unique identifier of the referenced file + filename: type: string - title: Object - default: vector_store.file - attributes: - additionalProperties: true - type: object - title: Attributes - chunking_strategy: - oneOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' - title: Chunking Strategy - discriminator: - propertyName: type - mapping: - auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' - static: '#/components/schemas/VectorStoreChunkingStrategyStatic' - created_at: - type: integer - title: Created At - last_error: - $ref: '#/components/schemas/VectorStoreFileLastError' - status: - anyOf: - - type: string - const: completed - - type: string - const: in_progress - - type: string - const: cancelled - - type: string - const: failed - title: Status - usage_bytes: + title: Filename + description: Name of the referenced file + index: type: integer - title: Usage Bytes - default: 0 - vector_store_id: - type: string - title: Vector Store Id + title: Index + description: Position index of the citation within the content type: object required: - - id - - chunking_strategy - - created_at - - status - - vector_store_id - title: VectorStoreFileObject - description: OpenAI Vector Store File object. - VectorStoreObject: + - file_id + - filename + - index + title: OpenAIResponseAnnotationFileCitation + description: "File citation annotation for referencing specific files in response content.\n\n:param type: Annotation type identifier, always \"file_citation\"\n:param file_id: Unique identifier of the referenced file\n:param filename: Name of the referenced file\n:param index: Position index of the citation within the content" + OpenAIResponseAnnotationFilePath: properties: - id: + type: type: string - title: Id - object: + const: file_path + title: Type + default: file_path + file_id: type: string - title: Object - default: vector_store - created_at: + title: File Id + index: type: integer - title: Created At - name: - title: Name + title: Index + type: object + required: + - file_id + - index + title: OpenAIResponseAnnotationFilePath + OpenAIResponseContentPartRefusal: + properties: + type: type: string - usage_bytes: - type: integer - title: Usage Bytes - default: 0 - file_counts: - $ref: '#/components/schemas/VectorStoreFileCounts' - status: + const: refusal + title: Type + description: Content part type identifier, always "refusal" + default: refusal + refusal: type: string - title: Status - default: completed - expires_after: - title: Expires After - additionalProperties: true - type: object - expires_at: - title: Expires At - type: integer - last_active_at: - title: Last Active At - type: integer - metadata: - additionalProperties: true - type: object - title: Metadata + title: Refusal + description: Refusal text supplied by the model + type: object + required: + - refusal + title: OpenAIResponseContentPartRefusal + description: "Refusal content within a streamed response part.\n\n:param type: Content part type identifier, always \"refusal\"\n:param refusal: Refusal text supplied by the model" + OpenAIResponseError: + properties: + code: + type: string + title: Code + description: Error code identifying the type of failure + message: + type: string + title: Message + description: Human-readable error message describing the failure type: object required: - - id - - created_at - - file_counts - title: VectorStoreObject - description: OpenAI Vector Store object. - VectorStoreSearchResponse: + - code + - message + title: OpenAIResponseError + description: "Error details for failed OpenAI response requests.\n\n:param code: Error code identifying the type of failure\n:param message: Human-readable error message describing the failure" + OpenAIResponseFormatJSONObject: properties: - file_id: + type: type: string - title: File Id - filename: + const: json_object + title: Type + default: json_object + type: object + title: OpenAIResponseFormatJSONObject + description: JSON object response format for OpenAI-compatible chat completion requests. + OpenAIResponseFormatJSONSchema: + properties: + type: type: string - title: Filename - score: - type: number - title: Score - attributes: - title: Attributes - additionalProperties: - anyOf: - - type: string - - type: number - - type: boolean - type: object - content: - items: - $ref: '#/components/schemas/VectorStoreContent' - type: array - title: Content + const: json_schema + title: Type + default: json_schema + json_schema: + $ref: '#/components/schemas/OpenAIJSONSchema' type: object required: - - file_id - - filename - - score - - content - title: VectorStoreSearchResponse - description: Response from searching a vector store. - VectorStoreSearchResponsePage: + - json_schema + title: OpenAIResponseFormatJSONSchema + description: JSON schema response format for OpenAI-compatible chat completion requests. + OpenAIResponseFormatText: properties: - object: + type: type: string - title: Object - default: vector_store.search_results.page - search_query: + const: text + title: Type + default: text + type: object + title: OpenAIResponseFormatText + description: Text response format for OpenAI-compatible chat completion requests. + OpenAIResponseInputFunctionToolCallOutput: + properties: + call_id: type: string - title: Search Query - data: - items: - $ref: '#/components/schemas/VectorStoreSearchResponse' - type: array - title: Data - has_more: - type: boolean - title: Has More - default: false - next_page: - title: Next Page + title: Call Id + output: + type: string + title: Output + type: type: string + const: function_call_output + title: Type + default: function_call_output + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status type: object required: - - search_query - - data - title: VectorStoreSearchResponsePage - description: Paginated response from searching a vector store. - VersionInfo: + - call_id + - output + title: OpenAIResponseInputFunctionToolCallOutput + description: This represents the output of a function call that gets passed back to the model. + OpenAIResponseInputMessageContentFile: properties: - version: + type: type: string - title: Version + const: input_file + title: Type + description: The type of the input item. Always `input_file`. + default: input_file + file_data: + anyOf: + - type: string + - type: 'null' + title: File Data + description: The data of the file to be sent to the model. + file_id: + anyOf: + - type: string + - type: 'null' + title: File Id + description: The ID of the file to be sent to the model. + file_url: + anyOf: + - type: string + - type: 'null' + title: File Url + description: The URL of the file to be sent to the model. + filename: + anyOf: + - type: string + - type: 'null' + title: Filename + description: The name of the file to be sent to the model. type: object - required: - - version - title: VersionInfo - description: Version information for the service. - ViolationLevel: - type: string - enum: - - info - - warn - - error - title: ViolationLevel - description: Severity level of a safety violation. - WeightedRanker: + title: OpenAIResponseInputMessageContentFile + description: "File content for input messages in OpenAI response format.\n\n:param type: The type of the input item. Always `input_file`.\n:param file_data: The data of the file to be sent to the model.\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param file_url: The URL of the file to be sent to the model.\n:param filename: The name of the file to be sent to the model." + OpenAIResponseInputMessageContentImage: properties: + detail: + anyOf: + - type: string + const: low + - type: string + const: high + - type: string + const: auto + title: Detail + description: Level of detail for image processing, can be "low", "high", or "auto" + default: auto type: type: string - const: weighted + const: input_image title: Type - default: weighted - alpha: - type: number - maximum: 1.0 - minimum: 0.0 - title: Alpha - description: Weight factor between 0 and 1. 0 means only keyword scores, 1 means only vector scores. - default: 0.5 + description: Content type identifier, always "input_image" + default: input_image + file_id: + anyOf: + - type: string + - type: 'null' + title: File Id + description: The ID of the file to be sent to the model. + image_url: + anyOf: + - type: string + - type: 'null' + title: Image Url + description: URL of the image content type: object - title: WeightedRanker - description: Weighted ranker configuration that combines vector and keyword scores. - _URLOrData: + title: OpenAIResponseInputMessageContentImage + description: "Image content for input messages in OpenAI response format.\n\n:param detail: Level of detail for image processing, can be \"low\", \"high\", or \"auto\"\n:param type: Content type identifier, always \"input_image\"\n:param file_id: (Optional) The ID of the file to be sent to the model.\n:param image_url: (Optional) URL of the image content" + OpenAIResponseInputMessageContentText: properties: - url: - $ref: '#/components/schemas/URL' - data: - contentEncoding: base64 - title: Data + text: type: string + title: Text + description: The text content of the input message + type: + type: string + const: input_text + title: Type + description: Content type identifier, always "input_text" + default: input_text type: object - title: _URLOrData - description: A URL or a base64 encoded string - __main_____agents_agent_id_session_Request: + required: + - text + title: OpenAIResponseInputMessageContentText + description: "Text content for input messages in OpenAI response format.\n\n:param text: The text content of the input message\n:param type: Content type identifier, always \"input_text\"" + OpenAIResponseInputToolFileSearch: properties: - agent_id: - type: string - title: Agent Id - session_name: + type: type: string - title: Session Name + const: file_search + title: Type + description: Tool type identifier, always "file_search" + default: file_search + vector_store_ids: + items: + type: string + type: array + title: Vector Store Ids + description: List of vector store identifiers to search within + filters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Filters + description: Additional filters to apply to the search + max_num_results: + anyOf: + - type: integer + maximum: 50.0 + minimum: 1.0 + - type: 'null' + title: Max Num Results + description: Maximum number of search results to return (1-50) + default: 10 + ranking_options: + anyOf: + - $ref: '#/components/schemas/SearchRankingOptions' + - type: 'null' + description: Options for ranking and scoring search results type: object required: - - agent_id - - session_name - title: _agents_agent_id_session_Request - __main_____agents_agent_id_session_session_id_turn_Request: + - vector_store_ids + title: OpenAIResponseInputToolFileSearch + description: "File search tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"file_search\"\n:param vector_store_ids: List of vector store identifiers to search within\n:param filters: (Optional) Additional filters to apply to the search\n:param max_num_results: (Optional) Maximum number of search results to return (1-50)\n:param ranking_options: (Optional) Options for ranking and scoring search results" + OpenAIResponseInputToolFunction: properties: - agent_id: + type: type: string - title: Agent Id - session_id: + const: function + title: Type + description: Tool type identifier, always "function" + default: function + name: type: string - title: Session Id - messages: - $ref: '#/components/schemas/UserMessage-Input' - stream: - type: boolean - title: Stream - default: false - documents: - $ref: '#/components/schemas/Document' - toolgroups: + title: Name + description: Name of the function that can be called + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Description of what the function does + parameters: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Parameters + description: JSON schema defining the function's parameters + strict: anyOf: - - type: string - - $ref: '#/components/schemas/AgentToolGroupWithArgs' - title: Toolgroups - tool_config: - $ref: '#/components/schemas/ToolConfig' + - type: boolean + - type: 'null' + title: Strict + description: Whether to enforce strict parameter validation type: object required: - - agent_id - - session_id - - messages - - documents - - toolgroups - - tool_config - title: _agents_agent_id_session_session_id_turn_Request - __main_____agents_agent_id_session_session_id_turn_turn_id_resume_Request: + - name + title: OpenAIResponseInputToolFunction + description: "Function tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"function\"\n:param name: Name of the function that can be called\n:param description: (Optional) Description of what the function does\n:param parameters: (Optional) JSON schema defining the function's parameters\n:param strict: (Optional) Whether to enforce strict parameter validation" + OpenAIResponseInputToolMCP: properties: - agent_id: + type: type: string - title: Agent Id - session_id: + const: mcp + title: Type + description: Tool type identifier, always "mcp" + default: mcp + server_label: type: string - title: Session Id - turn_id: + title: Server Label + description: Label to identify this MCP server + server_url: type: string - title: Turn Id - tool_responses: - $ref: '#/components/schemas/ToolResponse-Input' - stream: - type: boolean - title: Stream - default: false + title: Server Url + description: URL endpoint of the MCP server + headers: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Headers + description: HTTP headers to include when connecting to the server + require_approval: + anyOf: + - type: string + const: always + - type: string + const: never + - $ref: '#/components/schemas/ApprovalFilter' + title: Require Approval + description: Approval requirement for tool calls ("always", "never", or filter) + default: never + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + title: Allowed Tools + description: Restriction on which tools can be used from this server type: object required: - - agent_id - - session_id - - turn_id - - tool_responses - title: _agents_agent_id_session_session_id_turn_turn_id_resume_Request - __main_____datasets_Request: + - server_label + - server_url + title: OpenAIResponseInputToolMCP + description: "Model Context Protocol (MCP) tool configuration for OpenAI response inputs.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param server_url: URL endpoint of the MCP server\n:param headers: (Optional) HTTP headers to include when connecting to the server\n:param require_approval: Approval requirement for tool calls (\"always\", \"never\", or filter)\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + OpenAIResponseInputToolWebSearch: properties: - purpose: - $ref: '#/components/schemas/DatasetPurpose' - metadata: - type: string - title: Metadata - dataset_id: - type: string - title: Dataset Id + type: + anyOf: + - type: string + const: web_search + - type: string + const: web_search_preview + - type: string + const: web_search_preview_2025_03_11 + title: Type + description: Web search tool type variant to use + default: web_search + search_context_size: + anyOf: + - type: string + pattern: ^low|medium|high$ + - type: 'null' + title: Search Context Size + description: Size of search context, must be "low", "medium", or "high" + default: medium type: object - required: - - purpose - - metadata - - dataset_id - title: _datasets_Request - _batches_Request: + title: OpenAIResponseInputToolWebSearch + description: "Web search tool configuration for OpenAI response inputs.\n\n:param type: Web search tool type variant to use\n:param search_context_size: (Optional) Size of search context, must be \"low\", \"medium\", or \"high\"" + OpenAIResponseMCPApprovalRequest: properties: - input_file_id: + arguments: type: string - title: Input File Id - endpoint: + title: Arguments + id: type: string - title: Endpoint - completion_window: + title: Id + name: type: string - title: Completion Window - metadata: + title: Name + server_label: type: string - title: Metadata - idempotency_key: + title: Server Label + type: type: string - title: Idempotency Key + const: mcp_approval_request + title: Type + default: mcp_approval_request type: object required: - - input_file_id - - endpoint - - completion_window - - metadata - - idempotency_key - title: _batches_Request - _batches_batch_id_cancel_Request: + - arguments + - id + - name + - server_label + title: OpenAIResponseMCPApprovalRequest + description: A request for human approval of a tool invocation. + OpenAIResponseMCPApprovalResponse: properties: - batch_id: + approval_request_id: type: string - title: Batch Id - type: object - required: - - batch_id - title: _batches_batch_id_cancel_Request - _conversations_Request: - properties: - items: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage-Input' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - title: Items - discriminator: - propertyName: type - mapping: - file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - function_call_output: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - mcp_approval_response: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - message: '#/components/schemas/OpenAIResponseMessage-Input' - web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - metadata: + title: Approval Request Id + approve: + type: boolean + title: Approve + type: type: string - title: Metadata + const: mcp_approval_response + title: Type + default: mcp_approval_response + id: + anyOf: + - type: string + - type: 'null' + title: Id + reason: + anyOf: + - type: string + - type: 'null' + title: Reason type: object required: - - items - - metadata - title: _conversations_Request - _conversations_conversation_id_Request: + - approval_request_id + - approve + title: OpenAIResponseMCPApprovalResponse + description: A response to an MCP approval request. + OpenAIResponseMessage-Input: properties: - conversation_id: - type: string - title: Conversation Id - metadata: + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - type: string + const: system + - type: string + const: developer + - type: string + const: user + - type: string + const: assistant + title: Role + type: type: string - title: Metadata + const: message + title: Type + default: message + id: + anyOf: + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status type: object required: - - conversation_id - - metadata - title: _conversations_conversation_id_Request - _conversations_conversation_id_items_Request: + - content + - role + title: OpenAIResponseMessage + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + OpenAIResponseMessage-Output: properties: - conversation_id: + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: array + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' + refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' + type: array + title: Content + role: + anyOf: + - type: string + const: system + - type: string + const: developer + - type: string + const: user + - type: string + const: assistant + title: Role + type: type: string - title: Conversation Id - items: + const: message + title: Type + default: message + id: anyOf: - - $ref: '#/components/schemas/OpenAIResponseMessage-Input' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - title: Items + - type: string + - type: 'null' + title: Id + status: + anyOf: + - type: string + - type: 'null' + title: Status type: object required: - - conversation_id - - items - title: _conversations_conversation_id_items_Request - _inference_rerank_Request: + - content + - role + title: OpenAIResponseMessage + description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." + OpenAIResponseObject: properties: + created_at: + type: integer + title: Created At + description: Unix timestamp when the response was created + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + description: Error details if the response generation failed + id: + type: string + title: Id + description: Unique identifier for this response model: type: string title: Model - query: + description: Model identifier used for generation + object: type: string - title: Query - items: + const: response + title: Object + description: Object type identifier, always "response" + default: response + output: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + title: Output + description: List of generated output items (messages, tool calls, etc.) + parallel_tool_calls: + type: boolean + title: Parallel Tool Calls + description: Whether tool calls can be executed in parallel + default: false + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + description: ID of the previous response in a conversation + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + description: Reference to a prompt template and its variables. + status: type: string - title: Items - max_num_results: - type: integer - title: Max Num Results + title: Status + description: Current status of the response generation + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Sampling temperature used for generation + text: + $ref: '#/components/schemas/OpenAIResponseText' + description: Text formatting configuration for the response + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + description: Nucleus sampling parameter used for generation + tools: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + type: array + - type: 'null' + title: Tools + description: An array of tools the model may call while generating a response. + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + description: Truncation strategy applied to the response + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + description: Token usage information for the response + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + description: System message inserted into the model's context type: object required: + - created_at + - id - model - - query - - items - - max_num_results - title: _inference_rerank_Request - _models_Request: + - output + - status + title: OpenAIResponseObject + description: "Complete OpenAI response object containing generation results and metadata.\n\n:param created_at: Unix timestamp when the response was created\n:param error: (Optional) Error details if the response generation failed\n:param id: Unique identifier for this response\n:param model: Model identifier used for generation\n:param object: Object type identifier, always \"response\"\n:param output: List of generated output items (messages, tool calls, etc.)\n:param parallel_tool_calls: Whether tool calls can be executed in parallel\n:param previous_response_id: (Optional) ID of the previous response in a conversation\n:param prompt: (Optional) Reference to a prompt template and its variables.\n:param status: Current status of the response generation\n:param temperature: (Optional) Sampling temperature used for generation\n:param text: Text formatting configuration for the response\n:param top_p: (Optional) Nucleus sampling parameter used for generation\n:param tools: (Optional) An array of tools the model may call while generating a response.\n:param truncation: (Optional) Truncation strategy applied to the response\n:param usage: (Optional) Token usage information for the response\n:param instructions: (Optional) System message inserted into the model's context" + OpenAIResponseObjectWithInput-Output: properties: - model_id: + created_at: + type: integer + title: Created At + description: Unix timestamp when the response was created + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + description: Error details if the response generation failed + id: type: string - title: Model Id - provider_model_id: + title: Id + description: Unique identifier for this response + model: type: string - title: Provider Model Id - provider_id: + title: Model + description: Model identifier used for generation + object: type: string - title: Provider Id - metadata: + const: response + title: Object + description: Object type identifier, always "response" + default: response + output: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + type: array + title: Output + description: List of generated output items (messages, tool calls, etc.) + parallel_tool_calls: + type: boolean + title: Parallel Tool Calls + description: Whether tool calls can be executed in parallel + default: false + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + description: ID of the previous response in a conversation + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + description: Reference to a prompt template and its variables. + status: type: string - title: Metadata - model_type: - $ref: '#/components/schemas/ModelType' - type: object - required: - - model_id - - provider_model_id - - provider_id - - metadata - - model_type - title: _models_Request - _moderations_Request: - properties: + title: Status + description: Current status of the response generation + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + description: Sampling temperature used for generation + text: + $ref: '#/components/schemas/OpenAIResponseText' + description: Text formatting configuration for the response + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + description: Nucleus sampling parameter used for generation + tools: + anyOf: + - items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' + - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' + - $ref: '#/components/schemas/OpenAIResponseToolMCP' + discriminator: + propertyName: type + mapping: + file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' + function: '#/components/schemas/OpenAIResponseInputToolFunction' + mcp: '#/components/schemas/OpenAIResponseToolMCP' + web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' + web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' + type: array + - type: 'null' + title: Tools + description: An array of tools the model may call while generating a response. + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + description: Truncation strategy applied to the response + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + description: Token usage information for the response + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + description: System message inserted into the model's context input: - type: string + items: + anyOf: + - oneOf: + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + discriminator: + propertyName: type + mapping: + file_search_call: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' + function_call: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' + mcp_approval_request: '#/components/schemas/OpenAIResponseMCPApprovalRequest' + mcp_call: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' + mcp_list_tools: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' + message: '#/components/schemas/OpenAIResponseMessage-Output' + web_search_call: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' + - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' + - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' + - $ref: '#/components/schemas/OpenAIResponseMessage-Output' + type: array title: Input - model: - type: string - title: Model + description: List of input items that led to this response type: object required: - - input + - created_at + - id - model - title: _moderations_Request - _prompts_Request: - properties: - prompt: - type: string - title: Prompt - variables: - type: string - title: Variables - type: object - required: - - prompt - - variables - title: _prompts_Request - _prompts_prompt_id_Request: + - output + - status + - input + title: OpenAIResponseObjectWithInput + description: "OpenAI response object extended with input context information.\n\n:param input: List of input items that led to this response" + OpenAIResponseOutputMessageContentOutputText: properties: - prompt_id: - type: string - title: Prompt Id - prompt: - type: string - title: Prompt - version: - type: integer - title: Version - variables: + text: type: string - title: Variables - set_as_default: - type: boolean - title: Set As Default - default: true - type: object - required: - - prompt_id - - prompt - - version - - variables - title: _prompts_prompt_id_Request - _prompts_prompt_id_set_default_version_Request: - properties: - prompt_id: + title: Text + type: type: string - title: Prompt Id - version: - type: integer - title: Version + const: output_text + title: Type + default: output_text + annotations: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + discriminator: + propertyName: type + mapping: + container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' + file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation' + file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath' + url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation' + type: array + title: Annotations type: object required: - - prompt_id - - version - title: _prompts_prompt_id_set_default_version_Request - _responses_Request: + - text + title: OpenAIResponseOutputMessageContentOutputText + OpenAIResponseOutputMessageFileSearchToolCall: properties: - input: + id: type: string - title: Input - model: + title: Id + description: Unique identifier for this tool call + queries: + items: + type: string + type: array + title: Queries + description: List of search queries executed + status: type: string - title: Model - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - instructions: + title: Status + description: Current status of the file search operation + type: type: string - title: Instructions - previous_response_id: + const: file_search_call + title: Type + description: Tool call type identifier, always "file_search_call" + default: file_search_call + results: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' + type: array + - type: 'null' + title: Results + description: Search results returned by the file search operation + type: object + required: + - id + - queries + - status + title: OpenAIResponseOutputMessageFileSearchToolCall + description: "File search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param queries: List of search queries executed\n:param status: Current status of the file search operation\n:param type: Tool call type identifier, always \"file_search_call\"\n:param results: (Optional) Search results returned by the file search operation" + OpenAIResponseOutputMessageFileSearchToolCallResults: + properties: + attributes: + additionalProperties: true + type: object + title: Attributes + description: Key-value attributes associated with the file + file_id: type: string - title: Previous Response Id - conversation: + title: File Id + description: Unique identifier of the file containing the result + filename: type: string - title: Conversation - store: - type: boolean - title: Store - default: true - stream: - type: boolean - title: Stream - default: false - temperature: + title: Filename + description: Name of the file containing the result + score: type: number - title: Temperature + title: Score + description: Relevance score for this search result (between 0 and 1) text: - $ref: '#/components/schemas/OpenAIResponseText' - tools: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseInputToolMCP' - title: Tools - discriminator: - propertyName: type - mapping: - file_search: '#/components/schemas/OpenAIResponseInputToolFileSearch' - function: '#/components/schemas/OpenAIResponseInputToolFunction' - mcp: '#/components/schemas/OpenAIResponseInputToolMCP' - web_search: '#/components/schemas/OpenAIResponseInputToolWebSearch' - web_search_preview: '#/components/schemas/OpenAIResponseInputToolWebSearch' - web_search_preview_2025_03_11: '#/components/schemas/OpenAIResponseInputToolWebSearch' - include: type: string - title: Include - max_infer_iters: - type: integer - title: Max Infer Iters - default: 10 + title: Text + description: Text content of the search result type: object required: - - input - - model - - prompt - - instructions - - previous_response_id - - conversation - - temperature + - attributes + - file_id + - filename + - score - text - - tools - - include - title: _responses_Request - _scoring_score_Request: + title: OpenAIResponseOutputMessageFileSearchToolCallResults + description: "Search results returned by the file search operation.\n\n:param attributes: (Optional) Key-value attributes associated with the file\n:param file_id: Unique identifier of the file containing the result\n:param filename: Name of the file containing the result\n:param score: Relevance score for this search result (between 0 and 1)\n:param text: Text content of the search result" + OpenAIResponseOutputMessageFunctionToolCall: properties: - input_rows: + call_id: type: string - title: Input Rows - scoring_functions: + title: Call Id + description: Unique identifier for the function call + name: type: string - title: Scoring Functions - type: object - required: - - input_rows - - scoring_functions - title: _scoring_score_Request - _scoring_score_batch_Request: - properties: - dataset_id: + title: Name + description: Name of the function being called + arguments: type: string - title: Dataset Id - scoring_functions: + title: Arguments + description: JSON string containing the function arguments + type: type: string - title: Scoring Functions - save_results_dataset: - type: boolean - title: Save Results Dataset - default: false + const: function_call + title: Type + description: Tool call type identifier, always "function_call" + default: function_call + id: + anyOf: + - type: string + - type: 'null' + title: Id + description: Additional identifier for the tool call + status: + anyOf: + - type: string + - type: 'null' + title: Status + description: Current status of the function call execution type: object required: - - dataset_id - - scoring_functions - title: _scoring_score_batch_Request - _shields_Request: + - call_id + - name + - arguments + title: OpenAIResponseOutputMessageFunctionToolCall + description: "Function tool call output message for OpenAI responses.\n\n:param call_id: Unique identifier for the function call\n:param name: Name of the function being called\n:param arguments: JSON string containing the function arguments\n:param type: Tool call type identifier, always \"function_call\"\n:param id: (Optional) Additional identifier for the tool call\n:param status: (Optional) Current status of the function call execution" + OpenAIResponseOutputMessageMCPCall: properties: - shield_id: + id: type: string - title: Shield Id - provider_shield_id: + title: Id + description: Unique identifier for this MCP call + type: type: string - title: Provider Shield Id - provider_id: + const: mcp_call + title: Type + description: Tool call type identifier, always "mcp_call" + default: mcp_call + arguments: type: string - title: Provider Id - params: + title: Arguments + description: JSON string containing the MCP call arguments + name: type: string - title: Params + title: Name + description: Name of the MCP method being called + server_label: + type: string + title: Server Label + description: Label identifying the MCP server handling the call + error: + anyOf: + - type: string + - type: 'null' + title: Error + description: Error message if the MCP call failed + output: + anyOf: + - type: string + - type: 'null' + title: Output + description: Output result from the successful MCP call type: object required: - - shield_id - - provider_shield_id - - provider_id - - params - title: _shields_Request - _tool_runtime_invoke_Request: + - id + - arguments + - name + - server_label + title: OpenAIResponseOutputMessageMCPCall + description: "Model Context Protocol (MCP) call output message for OpenAI responses.\n\n:param id: Unique identifier for this MCP call\n:param type: Tool call type identifier, always \"mcp_call\"\n:param arguments: JSON string containing the MCP call arguments\n:param name: Name of the MCP method being called\n:param server_label: Label identifying the MCP server handling the call\n:param error: (Optional) Error message if the MCP call failed\n:param output: (Optional) Output result from the successful MCP call" + OpenAIResponseOutputMessageMCPListTools: properties: - tool_name: + id: type: string - title: Tool Name - kwargs: + title: Id + description: Unique identifier for this MCP list tools operation + type: type: string - title: Kwargs + const: mcp_list_tools + title: Type + description: Tool call type identifier, always "mcp_list_tools" + default: mcp_list_tools + server_label: + type: string + title: Server Label + description: Label identifying the MCP server providing the tools + tools: + items: + $ref: '#/components/schemas/MCPListToolsTool' + type: array + title: Tools + description: List of available tools provided by the MCP server type: object required: - - tool_name - - kwargs - title: _tool_runtime_invoke_Request - _tool_runtime_rag_tool_query_Request: + - id + - server_label + - tools + title: OpenAIResponseOutputMessageMCPListTools + description: "MCP list tools output message containing available tools from an MCP server.\n\n:param id: Unique identifier for this MCP list tools operation\n:param type: Tool call type identifier, always \"mcp_list_tools\"\n:param server_label: Label identifying the MCP server providing the tools\n:param tools: List of available tools provided by the MCP server" + OpenAIResponseOutputMessageWebSearchToolCall: properties: - content: + id: type: string - title: Content - vector_store_ids: + title: Id + description: Unique identifier for this tool call + status: type: string - title: Vector Store Ids - query_config: - $ref: '#/components/schemas/RAGQueryConfig' + title: Status + description: Current status of the web search operation + type: + type: string + const: web_search_call + title: Type + description: Tool call type identifier, always "web_search_call" + default: web_search_call type: object required: - - content - - vector_store_ids - - query_config - title: _tool_runtime_rag_tool_query_Request - _vector_io_query_Request: + - id + - status + title: OpenAIResponseOutputMessageWebSearchToolCall + description: "Web search tool call output message for OpenAI responses.\n\n:param id: Unique identifier for this tool call\n:param status: Current status of the web search operation\n:param type: Tool call type identifier, always \"web_search_call\"" + OpenAIResponsePrompt: properties: - vector_store_id: - type: string - title: Vector Store Id - query: - type: string - title: Query - params: + id: type: string - title: Params + title: Id + description: Unique identifier of the prompt template + variables: + anyOf: + - additionalProperties: + oneOf: + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' + - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' + discriminator: + propertyName: type + mapping: + input_file: '#/components/schemas/OpenAIResponseInputMessageContentFile' + input_image: '#/components/schemas/OpenAIResponseInputMessageContentImage' + input_text: '#/components/schemas/OpenAIResponseInputMessageContentText' + type: object + - type: 'null' + title: Variables + description: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files. + version: + anyOf: + - type: string + - type: 'null' + title: Version + description: Version number of the prompt to use (defaults to latest if not specified) type: object required: - - vector_store_id - - query - - params - title: _vector_io_query_Request - _vector_stores_vector_store_id_Request: + - id + title: OpenAIResponsePrompt + description: "OpenAI compatible Prompt object that is used in OpenAI responses.\n\n:param id: Unique identifier of the prompt template\n:param variables: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types\nlike images or files.\n:param version: Version number of the prompt to use (defaults to latest if not specified)" + OpenAIResponseText: properties: - vector_store_id: - type: string - title: Vector Store Id + format: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseTextFormat' + - type: 'null' + description: Text format configuration specifying output format requirements + type: object + title: OpenAIResponseText + description: "Text response configuration for OpenAI responses.\n\n:param format: (Optional) Text format configuration specifying output format requirements" + OpenAIResponseTextFormat: + properties: + type: + anyOf: + - type: string + const: text + - type: string + const: json_schema + - type: string + const: json_object + title: Type name: - type: string + anyOf: + - type: string + - type: 'null' title: Name - expires_after: - type: string - title: Expires After - metadata: - type: string - title: Metadata + schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Schema + description: + anyOf: + - type: string + - type: 'null' + title: Description + strict: + anyOf: + - type: boolean + - type: 'null' + title: Strict type: object - required: - - vector_store_id - - name - - expires_after - - metadata - title: _vector_stores_vector_store_id_Request - _vector_stores_vector_store_id_file_batches_batch_id_cancel_Request: + title: OpenAIResponseTextFormat + description: "Configuration for Responses API text format.\n\n:param type: Must be \"text\", \"json_schema\", or \"json_object\" to identify the format type\n:param name: The name of the response format. Only used for json_schema.\n:param schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model. Only used for json_schema.\n:param description: (Optional) A description of the response format. Only used for json_schema.\n:param strict: (Optional) Whether to strictly enforce the JSON schema. If true, the response must match the schema exactly. Only used for json_schema." + OpenAIResponseToolMCP: properties: - batch_id: + type: type: string - title: Batch Id - vector_store_id: + const: mcp + title: Type + description: Tool type identifier, always "mcp" + default: mcp + server_label: type: string - title: Vector Store Id + title: Server Label + description: Label to identify this MCP server + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + title: Allowed Tools + description: Restriction on which tools can be used from this server type: object required: - - batch_id - - vector_store_id - title: _vector_stores_vector_store_id_file_batches_batch_id_cancel_Request - _vector_stores_vector_store_id_files_Request: + - server_label + title: OpenAIResponseToolMCP + description: "Model Context Protocol (MCP) tool configuration for OpenAI response object.\n\n:param type: Tool type identifier, always \"mcp\"\n:param server_label: Label to identify this MCP server\n:param allowed_tools: (Optional) Restriction on which tools can be used from this server" + OpenAIResponseUsage: properties: - vector_store_id: - type: string - title: Vector Store Id - file_id: - type: string - title: File Id - attributes: - type: string - title: Attributes - chunking_strategy: + input_tokens: + type: integer + title: Input Tokens + description: Number of tokens in the input + output_tokens: + type: integer + title: Output Tokens + description: Number of tokens in the output + total_tokens: + type: integer + title: Total Tokens + description: Total tokens used (input + output) + input_tokens_details: anyOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' - title: Chunking Strategy + - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' + - type: 'null' + description: Detailed breakdown of input token usage + output_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + - type: 'null' + description: Detailed breakdown of output token usage type: object required: - - vector_store_id - - file_id - - attributes - - chunking_strategy - title: _vector_stores_vector_store_id_files_Request - _vector_stores_vector_store_id_files_file_id_Request: + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + description: "Usage information for OpenAI response.\n\n:param input_tokens: Number of tokens in the input\n:param output_tokens: Number of tokens in the output\n:param total_tokens: Total tokens used (input + output)\n:param input_tokens_details: Detailed breakdown of input token usage\n:param output_tokens_details: Detailed breakdown of output token usage" + OpenAIResponseUsageInputTokensDetails: properties: - vector_store_id: - type: string - title: Vector Store Id - file_id: - type: string - title: File Id - attributes: + cached_tokens: + anyOf: + - type: integer + - type: 'null' + title: Cached Tokens + description: Number of tokens retrieved from cache + type: object + title: OpenAIResponseUsageInputTokensDetails + description: "Token details for input tokens in OpenAI response usage.\n\n:param cached_tokens: Number of tokens retrieved from cache" + OpenAIResponseUsageOutputTokensDetails: + properties: + reasoning_tokens: + anyOf: + - type: integer + - type: 'null' + title: Reasoning Tokens + description: Number of tokens used for reasoning (o1/o3 models) + type: object + title: OpenAIResponseUsageOutputTokensDetails + description: "Token details for output tokens in OpenAI response usage.\n\n:param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models)" + OpenAISystemMessageParam: + properties: + role: type: string - title: Attributes + const: system + title: Role + default: system + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name type: object required: - - vector_store_id - - file_id - - attributes - title: _vector_stores_vector_store_id_files_file_id_Request - _vector_stores_vector_store_id_search_Request: + - content + title: OpenAISystemMessageParam + description: A system message providing instructions or context to the model. + OpenAITokenLogProb: properties: - vector_store_id: - type: string - title: Vector Store Id - query: - type: string - title: Query - filters: - type: string - title: Filters - max_num_results: - type: integer - title: Max Num Results - default: 10 - ranking_options: - $ref: '#/components/schemas/SearchRankingOptions' - rewrite_query: - type: boolean - title: Rewrite Query - default: false - search_mode: + token: type: string - title: Search Mode - default: vector + title: Token + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + type: number + title: Logprob + top_logprobs: + items: + $ref: '#/components/schemas/OpenAITopLogProb' + type: array + title: Top Logprobs type: object required: - - vector_store_id - - query - - filters - - ranking_options - title: _vector_stores_vector_store_id_search_Request - Error: - description: Error response from the API. Roughly follows RFC 7807. + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb + description: "The log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token\n:top_logprobs: The top log probabilities for the token" + OpenAIToolMessageParam: properties: - status: - title: Status - type: integer - title: - title: Title - type: string - detail: - title: Detail + role: type: string - instance: - title: Instance + const: tool + title: Role + default: tool + tool_call_id: type: string - nullable: true - required: - - status - - title - - detail - title: Error + title: Tool Call Id + content: + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + title: Content type: object - Agent: - description: An agent instance with configuration and metadata. + required: + - tool_call_id + - content + title: OpenAIToolMessageParam + description: A message representing the result of a tool invocation in an OpenAI-compatible chat completion request. + OpenAITopLogProb: properties: - agent_id: - title: Agent Id - type: string - agent_config: - $ref: '#/components/schemas/AgentConfig' - created_at: - format: date-time - title: Created At + token: type: string - required: - - agent_id - - agent_config - - created_at - title: Agent + title: Token + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + type: number + title: Logprob type: object - AgentStepResponse: - description: Response containing details of a specific agent step. - properties: - step: - discriminator: - mapping: - inference: '#/$defs/InferenceStep' - memory_retrieval: '#/$defs/MemoryRetrievalStep' - shield_call: '#/$defs/ShieldCallStep' - tool_execution: '#/$defs/ToolExecutionStep' - propertyName: step_type - oneOf: - - $ref: '#/components/schemas/InferenceStep' - - $ref: '#/components/schemas/ToolExecutionStep' - - $ref: '#/components/schemas/ShieldCallStep' - - $ref: '#/components/schemas/MemoryRetrievalStep' - title: Step required: - - step - title: AgentStepResponse - type: object - CompletionMessage: - description: A message containing the model's (assistant) response in a chat conversation. + - token + - logprob + title: OpenAITopLogProb + description: "The top log probability for a token from an OpenAI-compatible chat completion response.\n\n:token: The token\n:bytes: (Optional) The bytes for the token\n:logprob: The log probability of the token" + OpenAIUserMessageParam-Input: properties: role: - const: assistant - default: assistant - title: Role type: string + const: user + title: Role + default: user content: anyOf: - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' - items: + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' propertyName: type - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' + mapping: + file: '#/components/schemas/OpenAIFile' + image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' type: array title: Content - stop_reason: - $ref: '#/components/schemas/StopReason' - tool_calls: - title: Tool Calls - items: - $ref: '#/components/schemas/ToolCall' - type: array - required: - - content - - stop_reason - title: CompletionMessage - type: object - InferenceStep: - description: An inference step in an agent turn. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - title: Started At - format: date-time - type: string - nullable: true - completed_at: - title: Completed At - format: date-time - type: string - nullable: true - step_type: - const: inference - default: inference - title: Step Type - type: string - model_response: - $ref: '#/components/schemas/CompletionMessage' - required: - - turn_id - - step_id - - model_response - title: InferenceStep - type: object - ListOpenAIResponseInputItem: - description: List container for OpenAI response input items. - properties: - data: - items: - anyOf: - - discriminator: - mapping: - file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' - message: '#/$defs/OpenAIResponseMessage' - web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseMessage' - title: Data - type: array - object: - const: list - default: list - title: Object - type: string - required: - - data - title: ListOpenAIResponseInputItem + name: + anyOf: + - type: string + - type: 'null' + title: Name type: object - ListOpenAIResponseObject: - description: Paginated list of OpenAI response objects with navigation metadata. - properties: - data: - items: - $ref: '#/components/schemas/OpenAIResponseObjectWithInput' - title: Data - type: array - has_more: - title: Has More - type: boolean - first_id: - title: First Id - type: string - last_id: - title: Last Id - type: string - object: - const: list - default: list - title: Object - type: string required: - - data - - has_more - - first_id - - last_id - title: ListOpenAIResponseObject - type: object - MemoryRetrievalStep: - description: A memory retrieval step in an agent turn. + - content + title: OpenAIUserMessageParam + description: A message from the user in an OpenAI-compatible chat completion request. + OpenAIUserMessageParam-Output: properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - title: Started At - format: date-time - type: string - nullable: true - completed_at: - title: Completed At - format: date-time - type: string - nullable: true - step_type: - const: memory_retrieval - default: memory_retrieval - title: Step Type - type: string - vector_store_ids: - title: Vector Store Ids + role: type: string - inserted_context: + const: user + title: Role + default: user + content: anyOf: - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' - items: + oneOf: + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + - $ref: '#/components/schemas/OpenAIFile' discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' propertyName: type - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' + mapping: + file: '#/components/schemas/OpenAIFile' + image_url: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' + text: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' type: array - title: Inserted Context - required: - - turn_id - - step_id - - vector_store_ids - - inserted_context - title: MemoryRetrievalStep + title: Content + name: + anyOf: + - type: string + - type: 'null' + title: Name type: object - OpenAIDeleteResponseObject: - description: Response object confirming deletion of an OpenAI response. + required: + - content + title: OpenAIUserMessageParam + description: A message from the user in an OpenAI-compatible chat completion request. + OptimizerConfig: properties: - id: - title: Id - type: string - object: - const: response - default: response - title: Object - type: string - deleted: - default: true - title: Deleted - type: boolean + optimizer_type: + $ref: '#/components/schemas/OptimizerType' + lr: + type: number + title: Lr + weight_decay: + type: number + title: Weight Decay + num_warmup_steps: + type: integer + title: Num Warmup Steps + type: object required: - - id - title: OpenAIDeleteResponseObject + - optimizer_type + - lr + - weight_decay + - num_warmup_steps + title: OptimizerConfig + description: Configuration parameters for the optimization algorithm. + OptimizerType: + type: string + enum: + - adam + - adamw + - sgd + title: OptimizerType + description: Available optimizer algorithms for training. + Order: + type: string + enum: + - asc + - desc + title: Order + description: Sort order for paginated responses. + OutputTokensDetails: + properties: + reasoning_tokens: + type: integer + title: Reasoning Tokens + additionalProperties: true type: object + required: + - reasoning_tokens + title: OutputTokensDetails PaginatedResponse: - description: A generic paginated response that follows a simple format. properties: data: items: additionalProperties: true type: object - title: Data type: array + title: Data + description: The list of items for the current page. has_more: - title: Has More type: boolean + title: Has More + description: Whether there are more items available after this set. url: + anyOf: + - type: string + - type: 'null' title: Url - type: string - nullable: true + description: The URL for accessing this list. + type: object required: - data - has_more + - url title: PaginatedResponse - type: object - Session: - description: A single session of an interaction with an Agentic System. + description: A generic paginated response that follows a simple format. + PostTrainingJob: properties: - session_id: - title: Session Id + job_uuid: type: string - session_name: - title: Session Name + title: Job Uuid + description: The UUID of the job + type: object + required: + - job_uuid + title: PostTrainingJob + PostTrainingJobArtifactsResponse: + properties: + job_uuid: type: string - turns: + title: Job Uuid + description: The UUID of the job + checkpoints: items: - $ref: '#/components/schemas/Turn' - title: Turns + $ref: '#/components/schemas/Checkpoint' type: array - started_at: - format: date-time - title: Started At - type: string - required: - - session_id - - session_name - - turns - - started_at - title: Session + title: Checkpoints type: object - ShieldCallStep: - description: A shield call step in an agent turn. + required: + - job_uuid + title: PostTrainingJobArtifactsResponse + description: Artifacts of a finetuning job. + PostTrainingJobStatusResponse: properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id + job_uuid: type: string + title: Job Uuid + status: + $ref: '#/components/schemas/JobStatus' + scheduled_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Scheduled At started_at: + anyOf: + - type: string + format: date-time + - type: 'null' title: Started At - format: date-time - type: string - nullable: true completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' title: Completed At - format: date-time - type: string - nullable: true - step_type: - const: shield_call - default: shield_call - title: Step Type + resources_allocated: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Resources Allocated + checkpoints: + items: + $ref: '#/components/schemas/Checkpoint' + type: array + title: Checkpoints + type: object + required: + - job_uuid + - status + title: PostTrainingJobStatusResponse + description: Status of a finetuning job. + PostTrainingMetric: + properties: + epoch: + type: integer + title: Epoch + description: Training epoch number. + train_loss: + type: number + title: Train Loss + description: Loss value on the training dataset. + validation_loss: + type: number + title: Validation Loss + description: Loss value on the validation dataset. + perplexity: + type: number + title: Perplexity + description: Perplexity metric indicating model confidence. + type: object + required: + - epoch + - train_loss + - validation_loss + - perplexity + title: PostTrainingMetric + description: Training metrics captured during post-training jobs. + PreferenceOptimizeRequest: + properties: + job_uuid: type: string - violation: - $ref: '#/components/schemas/SafetyViolation' + title: Job Uuid + description: The UUID of the job to create + finetuned_model: + type: string + title: Finetuned Model + description: The model to fine-tune + algorithm_config: + $ref: '#/components/schemas/DPOAlignmentConfig' + description: The algorithm configuration + training_config: + $ref: '#/components/schemas/TrainingConfig' + description: The training configuration + hyperparam_search_config: + additionalProperties: true + type: object + title: Hyperparam Search Config + description: The hyperparam search configuration + logger_config: + additionalProperties: true + type: object + title: Logger Config + description: The logger configuration + type: object required: - - turn_id - - step_id - - violation - title: ShieldCallStep + - job_uuid + - finetuned_model + - algorithm_config + - training_config + - hyperparam_search_config + - logger_config + title: PreferenceOptimizeRequest + description: Request to run preference optimization of a model. + Prompt: + properties: + prompt: + anyOf: + - type: string + - type: 'null' + title: Prompt + description: The system prompt text with variable placeholders. Variables are only supported when using the Responses API. + version: + type: integer + minimum: 1.0 + title: Version + description: Version (integer starting at 1, incremented on save). + prompt_id: + type: string + title: Prompt Id + description: Unique identifier formatted as 'pmpt_<48-digit-hash>'. + variables: + items: + type: string + type: array + title: Variables + description: List of prompt variable names that can be used in the prompt template. + is_default: + type: boolean + title: Is Default + description: Boolean indicating whether this version is the default version for this prompt. + default: false type: object - ToolExecutionStep: - description: A tool execution step in an agent turn. + required: + - version + - prompt_id + title: Prompt + description: A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack. + ProviderInfo: properties: - turn_id: - title: Turn Id + api: type: string - step_id: - title: Step Id + title: Api + description: The API name this provider implements + provider_id: type: string - started_at: - title: Started At - format: date-time + title: Provider Id + description: Unique identifier for the provider + provider_type: type: string - nullable: true - completed_at: - title: Completed At - format: date-time + title: Provider Type + description: The type of provider implementation + config: + additionalProperties: true + type: object + title: Config + description: Configuration parameters for the provider + health: + additionalProperties: true + type: object + title: Health + description: Current health status of the provider + type: object + required: + - api + - provider_id + - provider_type + - config + - health + title: ProviderInfo + description: Information about a registered provider including its configuration and health status. + QATFinetuningConfig: + properties: + type: type: string - nullable: true - step_type: - const: tool_execution - default: tool_execution - title: Step Type + const: QAT + title: Type + default: QAT + quantizer_name: type: string - tool_calls: + title: Quantizer Name + group_size: + type: integer + title: Group Size + type: object + required: + - quantizer_name + - group_size + title: QATFinetuningConfig + description: Configuration for Quantization-Aware Training (QAT) fine-tuning. + QueryChunksRequest: + properties: + vector_store_id: + type: string + title: Vector Store Id + description: The identifier of the vector database to query. + query: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Query + description: The query to search for. + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + description: The parameters of the query. + type: object + required: + - vector_store_id + - query + title: QueryChunksRequest + description: Request to query chunks from a vector database. + QueryChunksResponse: + properties: + chunks: items: - $ref: '#/components/schemas/ToolCall' - title: Tool Calls + $ref: '#/components/schemas/Chunk-Output' type: array - tool_responses: + title: Chunks + scores: items: - $ref: '#/components/schemas/ToolResponse' - title: Tool Responses + type: number type: array - required: - - turn_id - - step_id - - tool_calls - - tool_responses - title: ToolExecutionStep + title: Scores type: object - ToolResponse: - description: Response from a tool invocation. + required: + - chunks + - scores + title: QueryChunksResponse + description: Response from querying chunks in a vector database. + RAGDocument: properties: - call_id: - title: Call Id + document_id: type: string - tool_name: - anyOf: - - $ref: '#/components/schemas/BuiltinTool' - - type: string - title: Tool Name + title: Document Id content: anyOf: - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/components/schemas/ImageContentItem' + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type oneOf: - - $ref: '#/components/schemas/ImageContentItem' + - $ref: '#/components/schemas/ImageContentItem-Input' - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' type: array + - $ref: '#/components/schemas/URL' title: Content + mime_type: + anyOf: + - type: string + - type: 'null' + title: Mime Type metadata: - title: Metadata additionalProperties: true type: object - nullable: true + title: Metadata + type: object required: - - call_id - - tool_name + - document_id - content - title: ToolResponse - type: object - ListBatchesResponse: - description: Response containing a list of batch objects. + title: RAGDocument + description: "A document to be used for document ingestion in the RAG Tool.\n\n:param document_id: The unique identifier for the document.\n:param content: The content of the document.\n:param mime_type: The MIME type of the document.\n:param metadata: Additional metadata for the document." + RAGQueryConfig: properties: - object: - const: list - default: list - title: Object - type: string - data: - description: List of batch objects - items: - $ref: '#/components/schemas/Batch' - title: Data - type: array - first_id: - description: ID of the first batch in the list - title: First Id - type: string - nullable: true - last_id: - description: ID of the last batch in the list - title: Last Id + query_generator_config: + oneOf: + - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' + title: Query Generator Config + default: + type: default + separator: ' ' + discriminator: + propertyName: type + mapping: + default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' + llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' + max_tokens_in_context: + type: integer + title: Max Tokens In Context + default: 4096 + max_chunks: + type: integer + title: Max Chunks + default: 5 + chunk_template: type: string - nullable: true - has_more: - default: false - description: Whether there are more batches available - title: Has More - type: boolean - required: - - data - title: ListBatchesResponse + title: Chunk Template + default: "Result {index}\nContent: {chunk.content}\nMetadata: {metadata}\n" + mode: + anyOf: + - $ref: '#/components/schemas/RAGSearchMode' + - type: 'null' + default: vector + ranker: + anyOf: + - oneOf: + - $ref: '#/components/schemas/RRFRanker' + - $ref: '#/components/schemas/WeightedRanker' + discriminator: + propertyName: type + mapping: + rrf: '#/components/schemas/RRFRanker' + weighted: '#/components/schemas/WeightedRanker' + - type: 'null' + title: Ranker type: object - ConversationDeletedResource: - description: Response for deleted conversation. + title: RAGQueryConfig + description: "Configuration for the RAG query generation.\n\n:param query_generator_config: Configuration for the query generator.\n:param max_tokens_in_context: Maximum number of tokens in the context.\n:param max_chunks: Maximum number of chunks to retrieve.\n:param chunk_template: Template for formatting each retrieved chunk in the context.\n Available placeholders: {index} (1-based chunk ordinal), {chunk.content} (chunk content string), {metadata} (chunk metadata dict).\n Default: \"Result {index}\\nContent: {chunk.content}\\nMetadata: {metadata}\\n\"\n:param mode: Search mode for retrieval—either \"vector\", \"keyword\", or \"hybrid\". Default \"vector\".\n:param ranker: Configuration for the ranker to use in hybrid search. Defaults to RRF ranker." + RAGQueryResult: properties: - id: - description: The deleted conversation identifier - title: Id - type: string - object: - default: conversation.deleted - description: Object type - title: Object - type: string - deleted: - default: true - description: Whether the object was deleted - title: Deleted - type: boolean - required: - - id - title: ConversationDeletedResource + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + title: Content + metadata: + additionalProperties: true + type: object + title: Metadata type: object - ConversationItemDeletedResource: - description: Response for deleted conversation item. + title: RAGQueryResult + description: "Result of a RAG query containing retrieved content and metadata.\n\n:param content: (Optional) The retrieved content from the query\n:param metadata: Additional metadata about the query result" + RAGSearchMode: + type: string + enum: + - vector + - keyword + - hybrid + title: RAGSearchMode + description: "Search modes for RAG query retrieval:\n- VECTOR: Uses vector similarity search for semantic matching\n- KEYWORD: Uses keyword-based search for exact matching\n- HYBRID: Combines both vector and keyword search for better results" + RRFRanker: properties: - id: - description: The deleted item identifier - title: Id - type: string - object: - default: conversation.item.deleted - description: Object type - title: Object + type: type: string - deleted: - default: true - description: Whether the object was deleted - title: Deleted - type: boolean - required: - - id - title: ConversationItemDeletedResource + const: rrf + title: Type + default: rrf + impact_factor: + type: number + title: Impact Factor + default: 60.0 + minimum: 0.0 type: object - ListOpenAIFileResponse: - description: Response for listing files in OpenAI Files API. + title: RRFRanker + description: "Reciprocal Rank Fusion (RRF) ranker configuration.\n\n:param type: The type of ranker, always \"rrf\"\n:param impact_factor: The impact factor for RRF scoring. Higher values give more weight to higher-ranked results.\n Must be greater than 0" + RegexParserScoringFnParams: properties: - data: + type: + type: string + const: regex_parser + title: Type + default: regex_parser + parsing_regexes: items: - $ref: '#/components/schemas/OpenAIFileObject' - title: Data + type: string type: array - has_more: - title: Has More - type: boolean - first_id: - title: First Id - type: string - last_id: - title: Last Id - type: string - object: - const: list - default: list - title: Object - type: string - required: - - data - - has_more - - first_id - - last_id - title: ListOpenAIFileResponse - type: object - OpenAIFileDeleteResponse: - description: Response for deleting a file in OpenAI Files API. - properties: - id: - title: Id - type: string - object: - const: file - default: file - title: Object - type: string - deleted: - title: Deleted - type: boolean - required: - - id - - deleted - title: OpenAIFileDeleteResponse - type: object - ListOpenAIChatCompletionResponse: - description: Response from listing OpenAI-compatible chat completions. - properties: - data: + title: Parsing Regexes + description: Regex to extract the answer from generated response + aggregation_functions: items: - $ref: '#/$defs/RouteInfo' - title: Data + $ref: '#/components/schemas/AggregationFunctionType' type: array - required: - - data - title: ListRoutesResponse - description: >- - Response containing a list of all available API routes. - OpenAIModel: + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row type: object + title: RegexParserScoringFnParams + description: Parameters for regex parser scoring function configuration. + RegisterBenchmarkRequest: properties: - id: + benchmark_id: type: string - object: - type: string - const: model - default: model - created: - type: integer - owned_by: + title: Benchmark Id + description: The ID of the benchmark to register + dataset_id: type: string - custom_metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - additionalProperties: false - required: - - id - - object - - created - - owned_by - title: OpenAIModel - description: A model from OpenAI. - OpenAIListModelsResponse: + title: Dataset Id + description: The ID of the dataset to use for the benchmark + scoring_functions: + items: + type: string + type: array + title: Scoring Functions + description: The scoring functions to use for the benchmark + provider_benchmark_id: + anyOf: + - type: string + - type: 'null' + title: Provider Benchmark Id + description: The ID of the provider benchmark to use for the benchmark + provider_id: + anyOf: + - type: string + - type: 'null' + title: Provider Id + description: The ID of the provider to use for the benchmark + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: The metadata to use for the benchmark type: object + required: + - benchmark_id + - dataset_id + - scoring_functions + title: RegisterBenchmarkRequest + description: Request model for registering a benchmark. + RegisterDatasetRequest: properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAIModel' - additionalProperties: false + purpose: + $ref: '#/components/schemas/DatasetPurpose' + description: The purpose of the dataset + source: + oneOf: + - $ref: '#/components/schemas/URIDataSource' + - $ref: '#/components/schemas/RowsDataSource' + title: Source + description: The data source of the dataset + discriminator: + propertyName: type + mapping: + rows: '#/components/schemas/RowsDataSource' + uri: '#/components/schemas/URIDataSource' + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: The metadata for the dataset + dataset_id: + anyOf: + - type: string + - type: 'null' + title: Dataset Id + description: The ID of the dataset. If not provided, an ID will be generated + type: object required: - - data - title: OpenAIListModelsResponse - ModelType: - type: string - enum: - - llm - - embedding - - rerank - title: ModelType - description: >- - Enumeration of supported model types in Llama Stack. + - purpose + - source + title: RegisterDatasetRequest + description: Request model for registering a dataset. RegisterModelRequest: - type: object properties: model_id: type: string + title: Model Id description: The identifier of the model to register. provider_model_id: - type: string - description: >- - The identifier of the model in the provider. + anyOf: + - type: string + - type: 'null' + title: Provider Model Id + description: The identifier of the model in the provider. provider_id: - type: string + anyOf: + - type: string + - type: 'null' + title: Provider Id description: The identifier of the provider. metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata description: Any additional metadata for this model. model_type: - $ref: '#/components/schemas/ModelType' + anyOf: + - $ref: '#/components/schemas/ModelType' + - type: 'null' description: The type of model to register. - additionalProperties: false + type: object required: - - model_id + - model_id title: RegisterModelRequest - Model: - type: object + description: Request model for registering a new model. + RegisterScoringFunctionRequest: properties: - identifier: + scoring_fn_id: type: string - description: >- - Unique identifier for this resource in llama stack - provider_resource_id: + title: Scoring Fn Id + description: The ID of the scoring function to register + description: type: string - description: >- - Unique identifier for this resource in the provider + title: Description + description: The description of the scoring function + return_type: + oneOf: + - $ref: '#/components/schemas/StringType' + - $ref: '#/components/schemas/NumberType' + - $ref: '#/components/schemas/BooleanType' + - $ref: '#/components/schemas/ArrayType' + - $ref: '#/components/schemas/ObjectType' + - $ref: '#/components/schemas/JsonType' + - $ref: '#/components/schemas/UnionType' + - $ref: '#/components/schemas/ChatCompletionInputType' + - $ref: '#/components/schemas/CompletionInputType' + - $ref: '#/components/schemas/AgentTurnInputType' + title: Return Type + description: The return type of the scoring function + discriminator: + propertyName: type + mapping: + agent_turn_input: '#/components/schemas/AgentTurnInputType' + array: '#/components/schemas/ArrayType' + boolean: '#/components/schemas/BooleanType' + chat_completion_input: '#/components/schemas/ChatCompletionInputType' + completion_input: '#/components/schemas/CompletionInputType' + json: '#/components/schemas/JsonType' + number: '#/components/schemas/NumberType' + object: '#/components/schemas/ObjectType' + string: '#/components/schemas/StringType' + union: '#/components/schemas/UnionType' + provider_scoring_fn_id: + anyOf: + - type: string + - type: 'null' + title: Provider Scoring Fn Id + description: The ID of the provider scoring function to use for the scoring function provider_id: - type: string - description: >- - ID of the provider that owns this resource - type: - type: string - enum: - - model - - shield - - vector_store - - dataset - - scoring_function - - benchmark - - tool - - tool_group - - prompt - const: model - default: model - description: >- - The resource type, always 'model' for model resources - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Any additional metadata for this model - model_type: - $ref: '#/components/schemas/ModelType' - default: llm - description: >- - The type of model (LLM or embedding model) - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: Provider Id + description: The ID of the provider to use for the scoring function + params: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' + title: Params + description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval + type: object required: - - identifier - - provider_id - - type - - metadata - - model_type - title: Model - description: >- - A model resource representing an AI model registered in Llama Stack. - RunModerationRequest: + - scoring_fn_id + - description + - return_type + title: RegisterScoringFunctionRequest + description: Request model for registering a scoring function. + RegisterShieldRequest: + properties: + shield_id: + type: string + title: Shield Id + description: The identifier of the shield to register + provider_shield_id: + anyOf: + - type: string + - type: 'null' + title: Provider Shield Id + description: The identifier of the shield in the provider + provider_id: + anyOf: + - type: string + - type: 'null' + title: Provider Id + description: The identifier of the provider + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + description: The parameters of the shield type: object - ModerationObject: - $defs: - ModerationObjectResults: - description: >- - A moderation object. - - :param flagged: Whether any of the below categories are flagged. - - :param categories: A list of the categories, and whether they are flagged - or not. - - :param category_applied_input_types: A list of the categories along with - the input type(s) that the score applies to. - - :param category_scores: A list of the categories along with their scores - as predicted by model. - properties: - flagged: - title: Flagged - type: boolean - categories: - anyOf: - - additionalProperties: - type: boolean - type: object - - type: 'null' - title: Categories - category_applied_input_types: - anyOf: - - additionalProperties: - items: - type: string - type: array - type: object - - type: 'null' - title: Category Applied Input Types - category_scores: - anyOf: - - additionalProperties: - type: number - type: object - - type: 'null' - title: Category Scores - user_message: - anyOf: - - type: string - - type: 'null' - title: User Message - metadata: - additionalProperties: true - title: Metadata - type: object - required: - - flagged - title: ModerationObjectResults - type: object - description: >- - A moderation object. - - :param id: The unique identifier for the moderation request. - - :param model: The model used to generate the moderation results. - - :param results: A list of moderation objects + required: + - shield_id + title: RegisterShieldRequest + description: Request model for registering a shield. + RegisterToolGroupRequest: properties: - id: - title: Id + toolgroup_id: type: string - model: - title: Model + title: Toolgroup Id + description: The ID of the tool group to register + provider_id: type: string - results: - items: - $ref: '#/$defs/ModerationObjectResults' - title: Results - type: array + title: Provider Id + description: The ID of the provider to use for the tool group + mcp_endpoint: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + description: The MCP endpoint to use for the tool group + args: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Args + description: A dictionary of arguments to pass to the tool group + type: object required: - - id - - model - - results - title: ModerationObject + - toolgroup_id + - provider_id + title: RegisterToolGroupRequest + description: Request model for registering a tool group. + RerankData: + properties: + index: + type: integer + title: Index + relevance_score: + type: number + title: Relevance Score type: object - ListPromptsResponse: - $defs: - Prompt: - description: >- - A prompt resource representing a stored OpenAI Compatible prompt template - in Llama Stack. - - - :param prompt: The system prompt text with variable placeholders. Variables - are only supported when using the Responses API. - - :param version: Version (integer starting at 1, incremented on save) - - :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' - - :param variables: List of prompt variable names that can be used in the - prompt template - - :param is_default: Boolean indicating whether this version is the default - version for this prompt - properties: - prompt: - anyOf: - - type: string - - type: 'null' - description: >- - The system prompt with variable placeholders - title: Prompt - version: - description: >- - Version (integer starting at 1, incremented on save) - minimum: 1 - title: Version - type: integer - prompt_id: - description: >- - Unique identifier in format 'pmpt_<48-digit-hash>' - title: Prompt Id - type: string - variables: - description: >- - List of variable names that can be used in the prompt template - items: - type: string - title: Variables - type: array - is_default: - default: false - description: >- - Boolean indicating whether this version is the default version - title: Is Default - type: boolean - required: - - version - - prompt_id - title: Prompt - type: object - description: Response model to list prompts. + required: + - index + - relevance_score + title: RerankData + description: A single rerank result from a reranking response. + RerankResponse: properties: data: items: - $ref: '#/$defs/Prompt' - title: Data + $ref: '#/components/schemas/RerankData' type: array - required: - - data - title: ListPromptsResponse + title: Data type: object - CreatePromptRequest: + required: + - data + title: RerankResponse + description: Response from a reranking request. + ResponseGuardrailSpec: + properties: + type: + type: string + title: Type + description: The type/identifier of the guardrail. type: object - Prompt: - description: >- - A prompt resource representing a stored OpenAI Compatible prompt template - in Llama Stack. - - - :param prompt: The system prompt text with variable placeholders. Variables - are only supported when using the Responses API. - - :param version: Version (integer starting at 1, incremented on save) - - :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' - - :param variables: List of prompt variable names that can be used in the prompt - template - - :param is_default: Boolean indicating whether this version is the default - version for this prompt + required: + - type + title: ResponseGuardrailSpec + description: Specification for a guardrail to apply during response generation. + RouteInfo: properties: - prompt: - anyOf: - - type: string - - type: 'null' - description: >- - The system prompt with variable placeholders - title: Prompt - version: - description: >- - Version (integer starting at 1, incremented on save) - minimum: 1 - title: Version - type: integer - prompt_id: - description: >- - Unique identifier in format 'pmpt_<48-digit-hash>' - title: Prompt Id + route: type: string - variables: - description: >- - List of variable names that can be used in the prompt template + title: Route + description: The API endpoint path + method: + type: string + title: Method + description: HTTP method for the route + provider_types: items: type: string - title: Variables type: array - is_default: - default: false - description: >- - Boolean indicating whether this version is the default version - title: Is Default - type: boolean - required: - - version - - prompt_id - title: Prompt - type: object - UpdatePromptRequest: - type: object - SetDefaultVersionRequest: + title: Provider Types + description: List of provider types that implement this route type: object - ListProvidersResponse: - $defs: - ProviderInfo: - description: >- - Information about a registered provider including its configuration and - health status. - - - :param api: The API name this provider implements - - :param provider_id: Unique identifier for the provider - - :param provider_type: The type of provider implementation - - :param config: Configuration parameters for the provider - - :param health: Current health status of the provider - properties: - api: - title: Api - type: string - provider_id: - title: Provider Id - type: string - provider_type: - title: Provider Type - type: string - config: - additionalProperties: true - title: Config - type: object - health: - additionalProperties: true - title: Health - type: object - required: - - api - - provider_id - - provider_type - - config - - health - title: ProviderInfo - type: object - description: >- - Response containing a list of all available providers. - - - :param data: List of provider information objects + required: + - route + - method + - provider_types + title: RouteInfo + description: Information about an API route including its path, method, and implementing providers. + RowsDataSource: properties: - data: + type: + type: string + const: rows + title: Type + description: The type of data source + default: rows + rows: items: - $ref: '#/$defs/ProviderInfo' - title: Data + additionalProperties: true + type: object type: array + title: Rows + description: "The dataset is stored in rows. E.g. [{'messages': [{'role': 'user', 'content': 'Hello, world!'}, {'role': 'assistant', 'content': 'Hello, world!'}]}]" + type: object required: - - data - title: ListProvidersResponse + - rows + title: RowsDataSource + description: A dataset stored in rows. + RunModerationRequest: + properties: + input: + anyOf: + - type: string + - items: + type: string + type: array + title: Input + description: Input (or inputs) to classify. Can be a single string, an array of strings, or an array of multi-modal input objects similar to other models. + model: + anyOf: + - type: string + - type: 'null' + title: Model + description: The content moderation model you would like to use. type: object - ProviderInfo: - description: >- - Information about a registered provider including its configuration and health - status. - - - :param api: The API name this provider implements - - :param provider_id: Unique identifier for the provider - - :param provider_type: The type of provider implementation - - :param config: Configuration parameters for the provider - - :param health: Current health status of the provider + required: + - input + title: RunModerationRequest + description: Request model for running moderation. + RunShieldRequest: properties: - api: - title: Api - type: string - provider_id: - title: Provider Id - type: string - provider_type: - title: Provider Type + shield_id: type: string - config: - additionalProperties: true - title: Config - type: object - health: - additionalProperties: true - title: Health - type: object - required: - - api - - provider_id - - provider_type - - config - - health - title: ProviderInfo - type: object - ListOpenAIResponseObject: - $defs: - AllowedToolsFilter: - description: >- - Filter configuration for restricting which MCP tools can be used. - - - :param tool_names: (Optional) List of specific tool names that are allowed - properties: - tool_names: - anyOf: - - items: - type: string - type: array - - type: 'null' - title: Tool Names - title: AllowedToolsFilter - type: object - MCPListToolsTool: - description: >- - Tool definition returned by MCP list tools operation. - - - :param input_schema: JSON schema defining the tool's input parameters - - :param name: Name of the tool - - :param description: (Optional) Description of what the tool does - properties: - input_schema: - additionalProperties: true - title: Input Schema - type: object - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - required: - - input_schema - - name - title: MCPListToolsTool - type: object - OpenAIResponseAnnotationCitation: - description: >- - URL citation annotation for referencing external web resources. - - - :param type: Annotation type identifier, always "url_citation" - - :param end_index: End position of the citation span in the content - - :param start_index: Start position of the citation span in the content - - :param title: Title of the referenced web resource - - :param url: URL of the referenced web resource - properties: - type: - const: url_citation - default: url_citation - title: Type - type: string - end_index: - title: End Index - type: integer - start_index: - title: Start Index - type: integer - title: - title: Title - type: string - url: - title: Url - type: string - required: - - end_index - - start_index - - title - - url - title: OpenAIResponseAnnotationCitation - type: object - "OpenAIResponseAnnotationContainerFileCitation": - properties: - type: - const: container_file_citation - default: container_file_citation - title: Type - type: string - container_id: - title: Container Id - type: string - end_index: - title: End Index - type: integer - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - start_index: - title: Start Index - type: integer - required: - - container_id - - end_index - - file_id - - filename - - start_index - title: >- - OpenAIResponseAnnotationContainerFileCitation - type: object - OpenAIResponseAnnotationFileCitation: - description: >- - File citation annotation for referencing specific files in response content. - - - :param type: Annotation type identifier, always "file_citation" - - :param file_id: Unique identifier of the referenced file - - :param filename: Name of the referenced file - - :param index: Position index of the citation within the content - properties: - type: - const: file_citation - default: file_citation - title: Type - type: string - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - index: - title: Index - type: integer - required: - - file_id - - filename - - index - title: OpenAIResponseAnnotationFileCitation - type: object - OpenAIResponseAnnotationFilePath: - properties: - type: - const: file_path - default: file_path - title: Type - type: string - file_id: - title: File Id - type: string - index: - title: Index - type: integer - required: - - file_id - - index - title: OpenAIResponseAnnotationFilePath - type: object - OpenAIResponseContentPartRefusal: - description: >- - Refusal content within a streamed response part. - - - :param type: Content part type identifier, always "refusal" - - :param refusal: Refusal text supplied by the model - properties: - type: - const: refusal - default: refusal - title: Type - type: string - refusal: - title: Refusal - type: string - required: - - refusal - title: OpenAIResponseContentPartRefusal - type: object - OpenAIResponseError: - description: >- - Error details for failed OpenAI response requests. - - - :param code: Error code identifying the type of failure - - :param message: Human-readable error message describing the failure - properties: - code: - title: Code - type: string - message: - title: Message - type: string - required: - - code - - message - title: OpenAIResponseError - type: object - "OpenAIResponseInputFunctionToolCallOutput": - description: >- - This represents the output of a function call that gets passed back to - the model. - properties: - call_id: - title: Call Id - type: string - output: - title: Output - type: string - type: - const: function_call_output - default: function_call_output - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - output - title: >- - OpenAIResponseInputFunctionToolCallOutput - type: object - OpenAIResponseInputMessageContentImage: - description: >- - Image content for input messages in OpenAI response format. - - - :param detail: Level of detail for image processing, can be "low", "high", - or "auto" - - :param type: Content type identifier, always "input_image" - - :param image_url: (Optional) URL of the image content - properties: - detail: - anyOf: - - const: low - type: string - - const: high - type: string - - const: auto - type: string - default: auto - title: Detail - type: - const: input_image - default: input_image - title: Type - type: string - image_url: - anyOf: - - type: string - - type: 'null' - title: Image Url - title: OpenAIResponseInputMessageContentImage - type: object - OpenAIResponseInputMessageContentText: - description: >- - Text content for input messages in OpenAI response format. - - - :param text: The text content of the input message - - :param type: Content type identifier, always "input_text" - properties: - text: - title: Text - type: string - type: - const: input_text - default: input_text - title: Type - type: string - required: - - text - title: OpenAIResponseInputMessageContentText - type: object - OpenAIResponseInputToolFileSearch: - description: >- - File search tool configuration for OpenAI response inputs. - - - :param type: Tool type identifier, always "file_search" - - :param vector_store_ids: List of vector store identifiers to search within - - :param filters: (Optional) Additional filters to apply to the search - - :param max_num_results: (Optional) Maximum number of search results to - return (1-50) - - :param ranking_options: (Optional) Options for ranking and scoring search - results - properties: - type: - const: file_search - default: file_search - title: Type - type: string - vector_store_ids: - items: - type: string - title: Vector Store Ids - type: array - filters: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Filters - max_num_results: - anyOf: - - maximum: 50 - minimum: 1 - type: integer - - type: 'null' - default: 10 - title: Max Num Results - ranking_options: - anyOf: - - $ref: '#/$defs/SearchRankingOptions' - - type: 'null' - required: - - vector_store_ids - title: OpenAIResponseInputToolFileSearch - type: object - OpenAIResponseInputToolFunction: - description: >- - Function tool configuration for OpenAI response inputs. - - - :param type: Tool type identifier, always "function" - - :param name: Name of the function that can be called - - :param description: (Optional) Description of what the function does - - :param parameters: (Optional) JSON schema defining the function's parameters - - :param strict: (Optional) Whether to enforce strict parameter validation - properties: - type: - const: function - default: function - title: Type - type: string - name: - title: Name - type: string - description: - anyOf: - - type: string - - type: 'null' - title: Description - parameters: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Parameters - strict: - anyOf: - - type: boolean - - type: 'null' - title: Strict - required: - - name - - parameters - title: OpenAIResponseInputToolFunction - type: object - OpenAIResponseInputToolWebSearch: - description: >- - Web search tool configuration for OpenAI response inputs. - - - :param type: Web search tool type variant to use - - :param search_context_size: (Optional) Size of search context, must be - "low", "medium", or "high" - properties: - type: - anyOf: - - const: web_search - type: string - - const: web_search_preview - type: string - - const: web_search_preview_2025_03_11 - type: string - default: web_search - title: Type - search_context_size: - anyOf: - - pattern: ^low|medium|high$ - type: string - - type: 'null' - default: medium - title: Search Context Size - title: OpenAIResponseInputToolWebSearch - type: object - OpenAIResponseMCPApprovalRequest: - description: >- - A request for human approval of a tool invocation. - properties: - arguments: - title: Arguments - type: string - id: - title: Id - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - type: - const: mcp_approval_request - default: mcp_approval_request - title: Type - type: string - required: - - arguments - - id - - name - - server_label - title: OpenAIResponseMCPApprovalRequest - type: object - OpenAIResponseMCPApprovalResponse: - description: A response to an MCP approval request. - properties: - approval_request_id: - title: Approval Request Id - type: string - approve: - title: Approve - type: boolean - type: - const: mcp_approval_response - default: mcp_approval_response - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - reason: - anyOf: - - type: string - - type: 'null' - title: Reason - required: - - approval_request_id - - approve - title: OpenAIResponseMCPApprovalResponse - type: object - OpenAIResponseMessage: - description: >- - Corresponds to the various Message types in the Responses API. - - They are all under one type because the Responses API gives them all - - the same "type" value, and there is no way to tell them apart in certain - - scenarios. - properties: - content: - anyOf: - - type: string - - items: - discriminator: - mapping: - input_image: >- - #/$defs/OpenAIResponseInputMessageContentImage - input_text: >- - #/$defs/OpenAIResponseInputMessageContentText - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentText - - $ref: >- - #/$defs/OpenAIResponseInputMessageContentImage - type: array - - items: - discriminator: - mapping: - output_text: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - refusal: '#/$defs/OpenAIResponseContentPartRefusal' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseOutputMessageContentOutputText - - $ref: '#/$defs/OpenAIResponseContentPartRefusal' - type: array - title: Content - role: - anyOf: - - const: system - type: string - - const: developer - type: string - - const: user - type: string - - const: assistant - type: string - title: Role - type: - const: message - default: message - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - content - - role - title: OpenAIResponseMessage - type: object - OpenAIResponseObjectWithInput: - description: >- - OpenAI response object extended with input context information. - - - :param input: List of input items that led to this response - properties: - created_at: - title: Created At - type: integer - error: - anyOf: - - $ref: '#/$defs/OpenAIResponseError' - - type: 'null' - id: - title: Id - type: string - model: - title: Model - type: string - object: - const: response - default: response - title: Object - type: string - output: - items: - discriminator: - mapping: - file_search_call: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - function_call: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - mcp_list_tools: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - message: '#/$defs/OpenAIResponseMessage' - web_search_call: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseMessage' - - $ref: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' - title: Output - type: array - parallel_tool_calls: - default: false - title: Parallel Tool Calls - type: boolean - previous_response_id: - anyOf: - - type: string - - type: 'null' - title: Previous Response Id - status: - title: Status - type: string - temperature: - anyOf: - - type: number - - type: 'null' - title: Temperature - text: - $ref: '#/$defs/OpenAIResponseText' - default: - format: - type: text - top_p: - anyOf: - - type: number - - type: 'null' - title: Top P - tools: - anyOf: - - items: - discriminator: - mapping: - file_search: >- - #/$defs/OpenAIResponseInputToolFileSearch - function: '#/$defs/OpenAIResponseInputToolFunction' - mcp: '#/$defs/OpenAIResponseToolMCP' - web_search: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseInputToolWebSearch' - - $ref: >- - #/$defs/OpenAIResponseInputToolFileSearch - - $ref: '#/$defs/OpenAIResponseInputToolFunction' - - $ref: '#/$defs/OpenAIResponseToolMCP' - type: array - - type: 'null' - title: Tools - truncation: - anyOf: - - type: string - - type: 'null' - title: Truncation - usage: - anyOf: - - $ref: '#/$defs/OpenAIResponseUsage' - - type: 'null' - instructions: - anyOf: - - type: string - - type: 'null' - title: Instructions - input: - items: - anyOf: - - discriminator: - mapping: - file_search_call: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - function_call: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - mcp_list_tools: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - message: '#/$defs/OpenAIResponseMessage' - web_search_call: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - propertyName: type - oneOf: - - $ref: '#/$defs/OpenAIResponseMessage' - - $ref: >- - #/$defs/OpenAIResponseOutputMessageWebSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageFunctionToolCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPCall - - $ref: >- - #/$defs/OpenAIResponseOutputMessageMCPListTools - - $ref: '#/$defs/OpenAIResponseMCPApprovalRequest' - - $ref: >- - #/$defs/OpenAIResponseInputFunctionToolCallOutput - - $ref: >- - #/$defs/OpenAIResponseMCPApprovalResponse - - $ref: '#/$defs/OpenAIResponseMessage' - title: Input - type: array - required: - - created_at - - id - - model - - output - - status - - input - title: OpenAIResponseObjectWithInput - type: object - "OpenAIResponseOutputMessageContentOutputText": - properties: - text: - title: Text - type: string - type: - const: output_text - default: output_text - title: Type - type: string - annotations: - items: - discriminator: - mapping: - container_file_citation: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - file_citation: >- - #/$defs/OpenAIResponseAnnotationFileCitation - file_path: '#/$defs/OpenAIResponseAnnotationFilePath' - url_citation: '#/$defs/OpenAIResponseAnnotationCitation' - propertyName: type - oneOf: - - $ref: >- - #/$defs/OpenAIResponseAnnotationFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationCitation' - - $ref: >- - #/$defs/OpenAIResponseAnnotationContainerFileCitation - - $ref: '#/$defs/OpenAIResponseAnnotationFilePath' - title: Annotations - type: array - required: - - text - title: >- - OpenAIResponseOutputMessageContentOutputText - type: object - "OpenAIResponseOutputMessageFileSearchToolCall": - description: >- - File search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param queries: List of search queries executed - - :param status: Current status of the file search operation - - :param type: Tool call type identifier, always "file_search_call" - - :param results: (Optional) Search results returned by the file search - operation - properties: - id: - title: Id - type: string - queries: - items: - type: string - title: Queries - type: array - status: - title: Status - type: string - type: - const: file_search_call - default: file_search_call - title: Type - type: string - results: - anyOf: - - items: - $ref: >- - #/$defs/OpenAIResponseOutputMessageFileSearchToolCallResults - type: array - - type: 'null' - title: Results - required: - - id - - queries - - status - title: >- - OpenAIResponseOutputMessageFileSearchToolCall - type: object - "OpenAIResponseOutputMessageFileSearchToolCallResults": - description: >- - Search results returned by the file search operation. - - - :param attributes: (Optional) Key-value attributes associated with the - file - - :param file_id: Unique identifier of the file containing the result - - :param filename: Name of the file containing the result - - :param score: Relevance score for this search result (between 0 and 1) - - :param text: Text content of the search result - properties: - attributes: - additionalProperties: true - title: Attributes - type: object - file_id: - title: File Id - type: string - filename: - title: Filename - type: string - score: - title: Score - type: number - text: - title: Text - type: string - required: - - attributes - - file_id - - filename - - score - - text - title: >- - OpenAIResponseOutputMessageFileSearchToolCallResults - type: object - "OpenAIResponseOutputMessageFunctionToolCall": - description: >- - Function tool call output message for OpenAI responses. - - - :param call_id: Unique identifier for the function call - - :param name: Name of the function being called - - :param arguments: JSON string containing the function arguments - - :param type: Tool call type identifier, always "function_call" - - :param id: (Optional) Additional identifier for the tool call - - :param status: (Optional) Current status of the function call execution - properties: - call_id: - title: Call Id - type: string - name: - title: Name - type: string - arguments: - title: Arguments - type: string - type: - const: function_call - default: function_call - title: Type - type: string - id: - anyOf: - - type: string - - type: 'null' - title: Id - status: - anyOf: - - type: string - - type: 'null' - title: Status - required: - - call_id - - name - - arguments - title: >- - OpenAIResponseOutputMessageFunctionToolCall - type: object - OpenAIResponseOutputMessageMCPCall: - description: >- - Model Context Protocol (MCP) call output message for OpenAI responses. - - - :param id: Unique identifier for this MCP call - - :param type: Tool call type identifier, always "mcp_call" - - :param arguments: JSON string containing the MCP call arguments - - :param name: Name of the MCP method being called - - :param server_label: Label identifying the MCP server handling the call - - :param error: (Optional) Error message if the MCP call failed - - :param output: (Optional) Output result from the successful MCP call - properties: - id: - title: Id - type: string - type: - const: mcp_call - default: mcp_call - title: Type - type: string - arguments: - title: Arguments - type: string - name: - title: Name - type: string - server_label: - title: Server Label - type: string - error: - anyOf: - - type: string - - type: 'null' - title: Error - output: - anyOf: - - type: string - - type: 'null' - title: Output - required: - - id - - arguments - - name - - server_label - title: OpenAIResponseOutputMessageMCPCall + title: Shield Id + description: The identifier of the shield to run. + messages: + items: + oneOf: + - $ref: '#/components/schemas/OpenAIUserMessageParam-Input' + - $ref: '#/components/schemas/OpenAISystemMessageParam' + - $ref: '#/components/schemas/OpenAIAssistantMessageParam-Input' + - $ref: '#/components/schemas/OpenAIToolMessageParam' + - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAIAssistantMessageParam-Input' + developer: '#/components/schemas/OpenAIDeveloperMessageParam' + system: '#/components/schemas/OpenAISystemMessageParam' + tool: '#/components/schemas/OpenAIToolMessageParam' + user: '#/components/schemas/OpenAIUserMessageParam-Input' + type: array + title: Messages + description: The messages to run the shield on. + params: + additionalProperties: true type: object - OpenAIResponseOutputMessageMCPListTools: - description: >- - MCP list tools output message containing available tools from an MCP server. - - - :param id: Unique identifier for this MCP list tools operation - - :param type: Tool call type identifier, always "mcp_list_tools" - - :param server_label: Label identifying the MCP server providing the tools - - :param tools: List of available tools provided by the MCP server - properties: - id: - title: Id - type: string - type: - const: mcp_list_tools - default: mcp_list_tools - title: Type - type: string - server_label: - title: Server Label - type: string - tools: - items: - $ref: '#/$defs/MCPListToolsTool' - title: Tools - type: array - required: - - id - - server_label - - tools - title: OpenAIResponseOutputMessageMCPListTools + title: Params + description: The parameters of the shield. + type: object + required: + - shield_id + - messages + - params + title: RunShieldRequest + description: Request model for running a shield. + RunShieldResponse: + properties: + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + description: Safety violation detected by the shield, if any. + type: object + title: RunShieldResponse + description: Response from running a safety shield. + SafetyViolation: + properties: + violation_level: + $ref: '#/components/schemas/ViolationLevel' + description: Severity level of the violation. + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + description: Message to convey to the user about the violation. + metadata: + additionalProperties: true type: object - "OpenAIResponseOutputMessageWebSearchToolCall": - description: >- - Web search tool call output message for OpenAI responses. - - - :param id: Unique identifier for this tool call - - :param status: Current status of the web search operation - - :param type: Tool call type identifier, always "web_search_call" - properties: - id: - title: Id - type: string - status: - title: Status - type: string - type: - const: web_search_call - default: web_search_call - title: Type + title: Metadata + description: Additional metadata including specific violation codes for debugging and telemetry. + type: object + required: + - violation_level + title: SafetyViolation + description: Details of a safety violation detected by content moderation. + SamplingParams: + properties: + strategy: + oneOf: + - $ref: '#/components/schemas/GreedySamplingStrategy' + - $ref: '#/components/schemas/TopPSamplingStrategy' + - $ref: '#/components/schemas/TopKSamplingStrategy' + title: Strategy + discriminator: + propertyName: type + mapping: + greedy: '#/components/schemas/GreedySamplingStrategy' + top_k: '#/components/schemas/TopKSamplingStrategy' + top_p: '#/components/schemas/TopPSamplingStrategy' + max_tokens: + anyOf: + - type: integer + - type: 'null' + title: Max Tokens + repetition_penalty: + anyOf: + - type: number + - type: 'null' + title: Repetition Penalty + default: 1.0 + stop: + anyOf: + - items: type: string - required: - - id - - status - title: >- - OpenAIResponseOutputMessageWebSearchToolCall - type: object - OpenAIResponseText: - description: >- - Text response configuration for OpenAI responses. - - - :param format: (Optional) Text format configuration specifying output - format requirements - properties: - format: - anyOf: - - $ref: '#/$defs/OpenAIResponseTextFormat' - - type: 'null' - title: OpenAIResponseText - type: object - OpenAIResponseTextFormat: - description: >- - Configuration for Responses API text format. - - - :param type: Must be "text", "json_schema", or "json_object" to identify - the format type - - :param name: The name of the response format. Only used for json_schema. - - :param schema: The JSON schema the response should conform to. In a Python - SDK, this is often a `pydantic` model. Only used for json_schema. - - :param description: (Optional) A description of the response format. Only - used for json_schema. - - :param strict: (Optional) Whether to strictly enforce the JSON schema. - If true, the response must match the schema exactly. Only used for json_schema. - properties: - type: - anyOf: - - const: text - type: string - - const: json_schema - type: string - - const: json_object - type: string - title: Type - name: - anyOf: - - type: string - - type: 'null' - title: Name - schema: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Schema - description: - anyOf: - - type: string - - type: 'null' - title: Description - strict: - anyOf: - - type: boolean - - type: 'null' - title: Strict - title: OpenAIResponseTextFormat + type: array + - type: 'null' + title: Stop + type: object + title: SamplingParams + description: Sampling parameters. + ScoreBatchRequest: + properties: + dataset_id: + type: string + title: Dataset Id + description: The ID of the dataset to score + scoring_functions: + additionalProperties: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' type: object - OpenAIResponseToolMCP: - description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response object. - - - :param type: Tool type identifier, always "mcp" - - :param server_label: Label to identify this MCP server - - :param allowed_tools: (Optional) Restriction on which tools can be used - from this server - properties: - type: - const: mcp - default: mcp - title: Type - type: string - server_label: - title: Server Label - type: string - allowed_tools: - anyOf: - - items: - type: string - type: array - - $ref: '#/$defs/AllowedToolsFilter' - - type: 'null' - title: Allowed Tools - required: - - server_label - title: OpenAIResponseToolMCP + title: Scoring Functions + description: The scoring functions to use for the scoring + save_results_dataset: + type: boolean + title: Save Results Dataset + description: Whether to save the results to a dataset + default: false + type: object + required: + - dataset_id + - scoring_functions + title: ScoreBatchRequest + description: Request for batch scoring operations. + ScoreBatchResponse: + properties: + dataset_id: + anyOf: + - type: string + - type: 'null' + title: Dataset Id + description: The identifier of the dataset that was scored + results: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' type: object - OpenAIResponseUsage: - description: >- - Usage information for OpenAI response. - - - :param input_tokens: Number of tokens in the input - - :param output_tokens: Number of tokens in the output - - :param total_tokens: Total tokens used (input + output) - - :param input_tokens_details: Detailed breakdown of input token usage - - :param output_tokens_details: Detailed breakdown of output token usage - properties: - input_tokens: - title: Input Tokens - type: integer - output_tokens: - title: Output Tokens - type: integer - total_tokens: - title: Total Tokens - type: integer - input_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIResponseUsageInputTokensDetails - - type: 'null' - output_tokens_details: - anyOf: - - $ref: >- - #/$defs/OpenAIResponseUsageOutputTokensDetails - - type: 'null' - required: - - input_tokens - - output_tokens - - total_tokens - title: OpenAIResponseUsage + title: Results + description: A map of scoring function name to ScoringResult + type: object + required: + - results + title: ScoreBatchResponse + description: Response from batch scoring operations on datasets. + ScoreRequest: + properties: + input_rows: + items: + additionalProperties: true + type: object + type: array + title: Input Rows + description: The rows to score + scoring_functions: + additionalProperties: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' type: object - OpenAIResponseUsageInputTokensDetails: - description: >- - Token details for input tokens in OpenAI response usage. - - - :param cached_tokens: Number of tokens retrieved from cache - properties: - cached_tokens: - anyOf: - - type: integer - - type: 'null' - title: Cached Tokens - title: OpenAIResponseUsageInputTokensDetails + title: Scoring Functions + description: The scoring functions to use for the scoring + type: object + required: + - input_rows + - scoring_functions + title: ScoreRequest + description: Request for scoring a list of rows. + ScoreResponse: + properties: + results: + additionalProperties: + $ref: '#/components/schemas/ScoringResult' type: object - OpenAIResponseUsageOutputTokensDetails: - description: >- - Token details for output tokens in OpenAI response usage. - - - :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) - properties: - reasoning_tokens: - anyOf: - - type: integer - - type: 'null' - title: Reasoning Tokens - title: OpenAIResponseUsageOutputTokensDetails + title: Results + description: A map of scoring function name to ScoringResult + type: object + required: + - results + title: ScoreResponse + description: The response from scoring. + ScoringFn: + properties: + identifier: + type: string + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: scoring_function + title: Type + default: scoring_function + description: + anyOf: + - type: string + - type: 'null' + title: Description + metadata: + additionalProperties: true type: object - SearchRankingOptions: - description: >- - Options for ranking and filtering search results. - - - :param ranker: (Optional) Name of the ranking algorithm to use - - :param score_threshold: (Optional) Minimum relevance score threshold for - results - properties: - ranker: - anyOf: - - type: string - - type: 'null' - title: Ranker - score_threshold: - anyOf: - - type: number - - type: 'null' - default: 0.0 - title: Score Threshold - title: SearchRankingOptions + title: Metadata + description: Any additional metadata for this definition + return_type: + oneOf: + - $ref: '#/components/schemas/StringType' + - $ref: '#/components/schemas/NumberType' + - $ref: '#/components/schemas/BooleanType' + - $ref: '#/components/schemas/ArrayType' + - $ref: '#/components/schemas/ObjectType' + - $ref: '#/components/schemas/JsonType' + - $ref: '#/components/schemas/UnionType' + - $ref: '#/components/schemas/ChatCompletionInputType' + - $ref: '#/components/schemas/CompletionInputType' + - $ref: '#/components/schemas/AgentTurnInputType' + title: Return Type + description: The return type of the deterministic function + discriminator: + propertyName: type + mapping: + agent_turn_input: '#/components/schemas/AgentTurnInputType' + array: '#/components/schemas/ArrayType' + boolean: '#/components/schemas/BooleanType' + chat_completion_input: '#/components/schemas/ChatCompletionInputType' + completion_input: '#/components/schemas/CompletionInputType' + json: '#/components/schemas/JsonType' + number: '#/components/schemas/NumberType' + object: '#/components/schemas/ObjectType' + string: '#/components/schemas/StringType' + union: '#/components/schemas/UnionType' + params: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' + - $ref: '#/components/schemas/RegexParserScoringFnParams' + - $ref: '#/components/schemas/BasicScoringFnParams' + discriminator: + propertyName: type + mapping: + basic: '#/components/schemas/BasicScoringFnParams' + llm_as_judge: '#/components/schemas/LLMAsJudgeScoringFnParams' + regex_parser: '#/components/schemas/RegexParserScoringFnParams' + - type: 'null' + title: Params + description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval + type: object + required: + - identifier + - provider_id + - return_type + title: ScoringFn + description: A scoring function resource for evaluating model outputs. + ScoringResult: + properties: + score_rows: + items: + additionalProperties: true + type: object + type: array + title: Score Rows + description: The scoring result for each row. Each row is a map of column name to value + aggregated_results: + additionalProperties: true type: object - description: >- - Paginated list of OpenAI response objects with navigation metadata. - - - :param data: List of response objects with their input context - - :param has_more: Whether there are more results available beyond this page - - :param first_id: Identifier of the first item in this page - - :param last_id: Identifier of the last item in this page - - :param object: Object type identifier, always "list" + title: Aggregated Results + description: Map of metric name to aggregated value + type: object + required: + - score_rows + - aggregated_results + title: ScoringResult + description: A scoring result for a single row. + SearchRankingOptions: properties: - data: + ranker: + anyOf: + - type: string + - type: 'null' + title: Ranker + score_threshold: + anyOf: + - type: number + - type: 'null' + title: Score Threshold + default: 0.0 + type: object + title: SearchRankingOptions + description: Options for ranking and filtering search results. + Session: + properties: + session_id: + type: string + title: Session Id + description: Unique identifier for the conversation session + session_name: + type: string + title: Session Name + description: Human-readable name for the session + turns: items: - $ref: '#/$defs/OpenAIResponseObjectWithInput' - title: Data + $ref: '#/components/schemas/Turn' type: array - has_more: - title: Has More - type: boolean - first_id: - title: First Id + title: Turns + description: List of all turns that have occurred in this session + started_at: type: string - last_id: - title: Last Id + format: date-time + title: Started At + description: Timestamp when the session was created + type: object + required: + - session_id + - session_name + - turns + - started_at + title: Session + description: A single session of an interaction with an Agentic System. + SetDefaultVersionRequest: + properties: + version: + type: integer + title: Version + description: The version to set as default. + type: object + required: + - version + title: SetDefaultVersionRequest + description: Request model for setting a prompt version as default. + Shield: + properties: + identifier: type: string - object: - const: list - default: list - title: Object + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: shield + title: Type + description: The resource type, always shield + default: shield + params: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Params + description: Configuration parameters for the shield + type: object required: - - data - - has_more - - first_id - - last_id - title: ListOpenAIChatCompletionResponse + - identifier + - provider_id + title: Shield + description: A safety shield resource that can be used to check content. + ShieldCallStep-Output: + properties: + turn_id: + type: string + title: Turn Id + description: The ID of the turn. + step_id: + type: string + title: Step Id + description: The ID of the step. + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At + description: The time the step started. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: The time the step completed. + step_type: + type: string + const: shield_call + title: Step Type + default: shield_call + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + description: The violation from the shield call. + type: object + required: + - turn_id + - step_id + title: ShieldCallStep + description: A shield call step in an agent turn. + StopReason: + type: string + enum: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason + StringType: + properties: + type: + type: string + const: string + title: Type + default: string + type: object + title: StringType + description: "Parameter type for string values.\n\n:param type: Discriminator type. Always \"string\"" + SupervisedFineTuneRequest: + properties: + job_uuid: + type: string + title: Job Uuid + description: The UUID of the job to create + training_config: + $ref: '#/components/schemas/TrainingConfig' + description: The training configuration + hyperparam_search_config: + additionalProperties: true + type: object + title: Hyperparam Search Config + description: The hyperparam search configuration + logger_config: + additionalProperties: true + type: object + title: Logger Config + description: The logger configuration + model: + anyOf: + - type: string + - type: 'null' + title: Model + description: Model descriptor for training if not in provider config` + checkpoint_dir: + anyOf: + - type: string + - type: 'null' + title: Checkpoint Dir + description: The directory to save checkpoint(s) to + algorithm_config: + anyOf: + - oneOf: + - $ref: '#/components/schemas/LoraFinetuningConfig' + - $ref: '#/components/schemas/QATFinetuningConfig' + discriminator: + propertyName: type + mapping: + LoRA: '#/components/schemas/LoraFinetuningConfig' + QAT: '#/components/schemas/QATFinetuningConfig' + - type: 'null' + title: Algorithm Config + description: The algorithm configuration + type: object + required: + - job_uuid + - training_config + - hyperparam_search_config + - logger_config + title: SupervisedFineTuneRequest + description: Request to run supervised fine-tuning of a model. + SystemMessage: + properties: + role: + type: string + const: system + title: Role + default: system + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + type: object + required: + - content + title: SystemMessage + description: A system message providing instructions or context to the model. + SystemMessageBehavior: + type: string + enum: + - append + - replace + title: SystemMessageBehavior + description: "Config for how to override the default system prompt.\n\nhttps://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt-\n'{{function_definitions}}' to indicate where the function definitions should be inserted." + TextContentItem: + properties: + type: + type: string + const: text + title: Type + default: text + text: + type: string + title: Text + type: object + required: + - text + title: TextContentItem + description: A text content item. + ToolCall: + properties: + call_id: + type: string + title: Call Id + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + arguments: + type: string + title: Arguments + type: object + required: + - call_id + - tool_name + - arguments + title: ToolCall + ToolChoice: + type: string + enum: + - auto + - required + - none + title: ToolChoice + description: Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model. + ToolConfig: + properties: + tool_choice: + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: string + - type: 'null' + title: Tool Choice + default: auto + tool_prompt_format: + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' + system_message_behavior: + anyOf: + - $ref: '#/components/schemas/SystemMessageBehavior' + - type: 'null' + default: append type: object - OpenAIAssistantMessageParam: - description: A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. + title: ToolConfig + description: "Configuration for tool use.\n\n- `ToolPromptFormat.json`: The tool calls are formatted as a JSON object.\n- `ToolPromptFormat.function_tag`: The tool calls are enclosed in a tag.\n- `ToolPromptFormat.python_list`: The tool calls are output as Python syntax -- a list of function calls.\n- `SystemMessageBehavior.append`: Appends the provided system message to the default system prompt.\n- `SystemMessageBehavior.replace`: Replaces the default system prompt with the provided system message. The system message can include the string\n '{{function_definitions}}' to indicate where the function definitions should be inserted." + ToolDef: properties: - role: - const: assistant - default: assistant - title: Role - type: string - content: + toolgroup_id: anyOf: - type: string - - items: - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - type: array - title: Content - nullable: true + - type: 'null' + title: Toolgroup Id + description: ID of the tool group this tool belongs to name: + type: string title: Name + description: Name of the tool + description: + anyOf: + - type: string + - type: 'null' + title: Description + description: Human-readable description of what the tool does + input_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Input Schema + description: JSON Schema for tool inputs (MCP inputSchema) + output_schema: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Output Schema + description: JSON Schema for tool outputs (MCP outputSchema) + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Additional metadata about the tool + type: object + required: + - name + title: ToolDef + description: Tool definition used in runtime contexts. + ToolExecutionStep-Output: + properties: + turn_id: + type: string + title: Turn Id + description: The ID of the turn. + step_id: + type: string + title: Step Id + description: The ID of the step. + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At + description: The time the step started. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: The time the step completed. + step_type: type: string - nullable: true + const: tool_execution + title: Step Type + default: tool_execution tool_calls: + items: + $ref: '#/components/schemas/ToolCall' + type: array title: Tool Calls + description: The tool calls to execute. + tool_responses: items: - $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + $ref: '#/components/schemas/ToolResponse-Output' type: array - nullable: true - title: OpenAIAssistantMessageParam + title: Tool Responses + description: The tool responses from the tool calls. type: object - OpenAIChoice: - description: A choice from an OpenAI-compatible chat completion response. + required: + - turn_id + - step_id + - tool_calls + - tool_responses + title: ToolExecutionStep + description: A tool execution step in an agent turn. + ToolGroup: properties: - message: - discriminator: - mapping: - assistant: '#/$defs/OpenAIAssistantMessageParam' - developer: '#/$defs/OpenAIDeveloperMessageParam' - system: '#/$defs/OpenAISystemMessageParam' - tool: '#/$defs/OpenAIToolMessageParam' - user: '#/$defs/OpenAIUserMessageParam' - propertyName: role - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - title: Message - finish_reason: - title: Finish Reason + identifier: type: string - index: - title: Index - type: integer - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - nullable: true - required: - - message - - finish_reason - - index - title: OpenAIChoice + title: Identifier + description: Unique identifier for this resource in llama stack + provider_resource_id: + anyOf: + - type: string + - type: 'null' + title: Provider Resource Id + description: Unique identifier for this resource in the provider + provider_id: + type: string + title: Provider Id + description: ID of the provider that owns this resource + type: + type: string + const: tool_group + title: Type + description: Type of resource, always 'tool_group' + default: tool_group + mcp_endpoint: + anyOf: + - $ref: '#/components/schemas/URL' + - type: 'null' + description: Model Context Protocol endpoint for remote tools + args: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Args + description: Additional arguments for the tool group type: object - OpenAIChoiceLogprobs: - description: The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. + required: + - identifier + - provider_id + title: ToolGroup + description: A group of related tools managed together. + ToolInvocationResult: properties: content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - type: 'null' title: Content - items: - $ref: '#/components/schemas/OpenAITokenLogProb' - type: array - nullable: true - refusal: - title: Refusal - items: - $ref: '#/components/schemas/OpenAITokenLogProb' - type: array - nullable: true - title: OpenAIChoiceLogprobs + description: The output content from the tool execution + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + description: Error message if the tool execution failed + error_code: + anyOf: + - type: integer + - type: 'null' + title: Error Code + description: Numeric error code if the tool execution failed + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata + description: Additional metadata about the tool execution type: object - OpenAICompletionWithInputMessages: + title: ToolInvocationResult + description: Result of a tool invocation. + ToolPromptFormat: + type: string + enum: + - json + - function_tag + - python_list + title: ToolPromptFormat + description: "Prompt format for calling custom / zero shot tools.\n\n:cvar json: JSON format for calling tools. It takes the form:\n {\n \"type\": \"function\",\n \"function\" : {\n \"name\": \"function_name\",\n \"description\": \"function_description\",\n \"parameters\": {...}\n }\n }\n:cvar function_tag: Function tag format, pseudo-XML. This looks like:\n (parameters)\n\n:cvar python_list: Python list. The output is a valid Python expression that can be\n evaluated to a list. Each element in the list is a function call. Example:\n [\"function_name(param1, param2)\", \"function_name(param1, param2)\"]" + ToolResponse-Input: properties: - id: - title: Id - type: string - choices: - items: - $ref: '#/components/schemas/OpenAIChoice' - title: Choices - type: array - object: - const: chat.completion - default: chat.completion - title: Object - type: string - created: - title: Created - type: integer - model: - title: Model + call_id: type: string - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - nullable: true - input_messages: - items: + title: Call Id + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' discriminator: + propertyName: type mapping: - assistant: '#/$defs/OpenAIAssistantMessageParam' - developer: '#/$defs/OpenAIDeveloperMessageParam' - system: '#/$defs/OpenAISystemMessageParam' - tool: '#/$defs/OpenAIToolMessageParam' - user: '#/$defs/OpenAIUserMessageParam' - propertyName: role - oneOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - title: Input Messages - type: array - required: - - id - - choices - - created - - model - - input_messages - title: OpenAICompletionWithInputMessages + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + metadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata type: object - OpenAIUserMessageParam: - description: A message from the user in an OpenAI-compatible chat completion request. + required: + - call_id + - tool_name + - content + title: ToolResponse + description: Response from a tool invocation. + ToolResponse-Output: properties: - role: - const: user - default: user - title: Role + call_id: type: string + title: Call Id + tool_name: + anyOf: + - $ref: '#/components/schemas/BuiltinTool' + - type: string + title: Tool Name content: anyOf: - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' discriminator: - mapping: - file: '#/$defs/OpenAIFile' - image_url: '#/$defs/OpenAIChatCompletionContentPartImageParam' - text: '#/$defs/OpenAIChatCompletionContentPartTextParam' propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' - - $ref: '#/components/schemas/OpenAIChatCompletionContentPartImageParam' - - $ref: '#/components/schemas/OpenAIFile' + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' type: array title: Content - name: - title: Name - type: string - nullable: true - required: - - content - title: OpenAIUserMessageParam - type: object - Checkpoint: - description: Checkpoint created during training runs. - properties: - identifier: - title: Identifier - type: string - created_at: - format: date-time - title: Created At - type: string - epoch: - title: Epoch - type: integer - post_training_job_id: - title: Post Training Job Id - type: string - path: - title: Path - type: string - training_metrics: - $ref: '#/components/schemas/PostTrainingMetric' - nullable: true - required: - - identifier - - created_at - - epoch - - post_training_job_id - - path - title: Checkpoint - type: object - PostTrainingJobArtifactsResponse: - description: Artifacts of a finetuning job. - properties: - job_uuid: - title: Job Uuid - type: string - checkpoints: - items: - $ref: '#/components/schemas/Checkpoint' - title: Checkpoints - type: array - required: - - job_uuid - title: PostTrainingJobArtifactsResponse - type: object - PostTrainingJobStatusResponse: - description: Status of a finetuning job. - properties: - job_uuid: - title: Job Uuid - type: string - status: - $ref: '#/components/schemas/JobStatus' - scheduled_at: - title: Scheduled At - format: date-time - type: string - nullable: true - started_at: - title: Started At - format: date-time - type: string - nullable: true - completed_at: - title: Completed At - format: date-time - type: string - nullable: true - resources_allocated: - title: Resources Allocated - additionalProperties: true - type: object - nullable: true - checkpoints: - items: - $ref: '#/components/schemas/Checkpoint' - title: Checkpoints - type: array - required: - - job_uuid - - status - title: PostTrainingJobStatusResponse - type: object - ScoringFn: - description: A scoring function resource for evaluating model outputs. - properties: - identifier: - description: Unique identifier for this resource in llama stack - title: Identifier - type: string - provider_resource_id: - description: Unique identifier for this resource in the provider - title: Provider Resource Id - type: string - nullable: true - provider_id: - description: ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: scoring_function - default: scoring_function - title: Type - type: string - description: - title: Description - type: string - nullable: true metadata: - additionalProperties: true - description: Any additional metadata for this definition + anyOf: + - additionalProperties: true + type: object + - type: 'null' title: Metadata - type: object - return_type: - description: The return type of the deterministic function - discriminator: - mapping: - agent_turn_input: '#/$defs/AgentTurnInputType' - array: '#/$defs/ArrayType' - boolean: '#/$defs/BooleanType' - chat_completion_input: '#/$defs/ChatCompletionInputType' - completion_input: '#/$defs/CompletionInputType' - json: '#/$defs/JsonType' - number: '#/$defs/NumberType' - object: '#/$defs/ObjectType' - string: '#/$defs/StringType' - union: '#/$defs/UnionType' - propertyName: type - oneOf: - - $ref: '#/components/schemas/StringType' - - $ref: '#/components/schemas/NumberType' - - $ref: '#/components/schemas/BooleanType' - - $ref: '#/components/schemas/ArrayType' - - $ref: '#/components/schemas/ObjectType' - - $ref: '#/components/schemas/JsonType' - - $ref: '#/components/schemas/UnionType' - - $ref: '#/components/schemas/ChatCompletionInputType' - - $ref: '#/components/schemas/CompletionInputType' - - $ref: '#/components/schemas/AgentTurnInputType' - title: Return Type - params: - description: The parameters for the scoring function for benchmark eval, these can be overridden for app eval - title: Params - discriminator: - mapping: - basic: '#/$defs/BasicScoringFnParams' - llm_as_judge: '#/$defs/LLMAsJudgeScoringFnParams' - regex_parser: '#/$defs/RegexParserScoringFnParams' - propertyName: type - oneOf: - - $ref: '#/components/schemas/LLMAsJudgeScoringFnParams' - - $ref: '#/components/schemas/RegexParserScoringFnParams' - - $ref: '#/components/schemas/BasicScoringFnParams' - nullable: true - required: - - identifier - - provider_id - - return_type - title: ScoringFn - type: object - ScoreRequest: type: object - ScoreResponse: - $defs: - ScoringResult: - description: >- - A scoring result for a single row. - - - :param score_rows: The scoring result for each row. Each row is a map - of column name to value. - - :param aggregated_results: Map of metric name to aggregated value - properties: - score_rows: - items: - additionalProperties: true - type: object - title: Score Rows - type: array - aggregated_results: - additionalProperties: true - title: Aggregated Results - type: object - required: - - score_rows - - aggregated_results - title: ScoringResult - type: object - description: >- - The response from scoring. - - - :param results: A map of scoring function name to ScoringResult. - properties: - results: - additionalProperties: - $ref: '#/$defs/ScoringResult' - title: Results - type: object required: - - results - title: ScoreResponse - type: object - ScoreBatchRequest: - type: object - ScoreBatchResponse: - $defs: - ScoringResult: - description: >- - A scoring result for a single row. - - - :param score_rows: The scoring result for each row. Each row is a map - of column name to value. - - :param aggregated_results: Map of metric name to aggregated value - properties: - score_rows: - items: - additionalProperties: true - type: object - title: Score Rows - type: array - aggregated_results: - additionalProperties: true - title: Aggregated Results - type: object - required: - - score_rows - - aggregated_results - title: ScoringResult - type: object - description: >- - Response from batch scoring operations on datasets. - - - :param dataset_id: (Optional) The identifier of the dataset that was scored - - :param results: A map of scoring function name to ScoringResult + - call_id + - tool_name + - content + title: ToolResponse + description: Response from a tool invocation. + ToolResponseMessage-Input: properties: - dataset_id: + role: + type: string + const: tool + title: Role + default: tool + call_id: + type: string + title: Call Id + content: anyOf: - - type: string - - type: 'null' - title: Dataset Id - results: - additionalProperties: - $ref: '#/$defs/ScoringResult' - title: Results - type: object - required: - - results - title: ScoreBatchResponse - type: object - ListShieldsResponse: - $defs: - Shield: - description: >- - A safety shield resource that can be used to check content. - - - :param params: (Optional) Configuration parameters for the shield - - :param type: The resource type, always shield - properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier - type: string - provider_resource_id: - anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: shield - default: shield - title: Type - type: string - params: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Params - required: - - identifier - - provider_id - title: Shield - type: object - properties: - data: - items: - $ref: '#/$defs/Shield' - title: Data - type: array - required: - - data - title: ListShieldsResponse - type: object - RegisterShieldRequest: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content type: object + required: + - call_id + - content + title: ToolResponseMessage + description: A message representing the result of a tool invocation. + ToolResponseMessage-Output: properties: - shield_id: - type: string - description: >- - The identifier of the shield to register. - provider_shield_id: + role: type: string - description: >- - The identifier of the shield in the provider. - provider_id: + const: tool + title: Role + default: tool + call_id: type: string - description: The identifier of the provider. - params: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The parameters of the shield. - additionalProperties: false - required: - - shield_id - title: RegisterShieldRequest - InvokeToolRequest: + title: Call Id + content: + anyOf: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + title: Content type: object - properties: - tool_name: - type: string - description: The name of the tool to invoke. - kwargs: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - A dictionary of arguments to pass to the tool. - additionalProperties: false required: - - tool_name - - kwargs - title: InvokeToolRequest - ImageContentItem: - type: object + - call_id + - content + title: ToolResponseMessage + description: A message representing the result of a tool invocation. + TopKSamplingStrategy: properties: type: type: string - const: image - default: image - description: >- - Discriminator type of the content item. Always "image" - image: - type: object - properties: - url: - $ref: '#/components/schemas/URL' - description: >- - A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - data: - type: string - contentEncoding: base64 - description: base64 encoded image data as string - additionalProperties: false - description: >- - Image as a base64 encoded string or an URL - additionalProperties: false - required: - - type - - image - title: ImageContentItem - description: A image content item - InterleavedContent: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - InterleavedContentItem: - oneOf: - - $ref: '#/components/schemas/ImageContentItem' - - $ref: '#/components/schemas/TextContentItem' - discriminator: - propertyName: type - mapping: - image: '#/components/schemas/ImageContentItem' - text: '#/components/schemas/TextContentItem' - TextContentItem: + const: top_k + title: Type + default: top_k + top_k: + type: integer + minimum: 1.0 + title: Top K type: object + required: + - top_k + title: TopKSamplingStrategy + description: Top-k sampling strategy that restricts sampling to the k most likely tokens. + TopPSamplingStrategy: properties: type: type: string - const: text - default: text - description: >- - Discriminator type of the content item. Always "text" - text: - type: string - description: Text content - additionalProperties: false - required: - - type - - text - title: TextContentItem - description: A text content item - ToolInvocationResult: + const: top_p + title: Type + default: top_p + temperature: + anyOf: + - type: number + minimum: 0.0 + - type: 'null' + title: Temperature + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + default: 0.95 type: object + required: + - temperature + title: TopPSamplingStrategy + description: Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p. + TrainingConfig: properties: - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - (Optional) The output content from the tool execution - error_message: - type: string - description: >- - (Optional) Error message if the tool execution failed - error_code: + n_epochs: type: integer - description: >- - (Optional) Numeric error code if the tool execution failed - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool execution - additionalProperties: false - title: ToolInvocationResult - description: Result of a tool invocation. - URL: + title: N Epochs + max_steps_per_epoch: + type: integer + title: Max Steps Per Epoch + default: 1 + gradient_accumulation_steps: + type: integer + title: Gradient Accumulation Steps + default: 1 + max_validation_steps: + anyOf: + - type: integer + - type: 'null' + title: Max Validation Steps + default: 1 + data_config: + anyOf: + - $ref: '#/components/schemas/DataConfig' + - type: 'null' + optimizer_config: + anyOf: + - $ref: '#/components/schemas/OptimizerConfig' + - type: 'null' + efficiency_config: + anyOf: + - $ref: '#/components/schemas/EfficiencyConfig' + - type: 'null' + dtype: + anyOf: + - type: string + - type: 'null' + title: Dtype + default: bf16 type: object - properties: - uri: - type: string - description: The URL string pointing to the resource - additionalProperties: false required: - - uri - title: URL - description: A URL reference to external content. - ToolDef: - type: object + - n_epochs + title: TrainingConfig + description: Comprehensive configuration for the training process. + Turn: properties: - toolgroup_id: - type: string - description: >- - (Optional) ID of the tool group this tool belongs to - name: + turn_id: type: string - description: Name of the tool - description: + title: Turn Id + description: Unique identifier for the turn within a session + session_id: type: string - description: >- - (Optional) Human-readable description of what the tool does - input_schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON Schema for tool inputs (MCP inputSchema) - output_schema: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) JSON Schema for tool outputs (MCP outputSchema) - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool - additionalProperties: false - required: - - name - title: ToolDef - description: >- - Tool definition used in runtime contexts. - ListToolDefsResponse: - type: object - properties: - data: - type: array + title: Session Id + description: Unique identifier for the conversation session + input_messages: items: - $ref: '#/components/schemas/ToolDef' - description: List of tool definitions - additionalProperties: false - required: - - data - title: ListToolDefsResponse - description: >- - Response containing a list of tool definitions. - RAGDocument: - type: object - properties: - document_id: - type: string - description: The unique identifier for the document. - content: - oneOf: - - type: string - - $ref: '#/components/schemas/InterleavedContentItem' - - type: array - items: - $ref: '#/components/schemas/InterleavedContentItem' - - $ref: '#/components/schemas/URL' - description: The content of the document. - mime_type: - type: string - description: The MIME type of the document. - metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: Additional metadata for the document. - additionalProperties: false - required: - - document_id - - content - - metadata - title: RAGDocument - description: >- - A document to be used for document ingestion in the RAG Tool. - InsertRequest: - type: object - properties: - documents: + anyOf: + - $ref: '#/components/schemas/UserMessage-Output' + - $ref: '#/components/schemas/ToolResponseMessage-Output' type: array + title: Input Messages + description: List of messages that initiated this turn + steps: items: - $ref: '#/components/schemas/RAGDocument' - description: >- - List of documents to index in the RAG system - vector_store_id: + oneOf: + - $ref: '#/components/schemas/InferenceStep-Output' + - $ref: '#/components/schemas/ToolExecutionStep-Output' + - $ref: '#/components/schemas/ShieldCallStep-Output' + - $ref: '#/components/schemas/MemoryRetrievalStep-Output' + discriminator: + propertyName: step_type + mapping: + inference: '#/components/schemas/InferenceStep-Output' + memory_retrieval: '#/components/schemas/MemoryRetrievalStep-Output' + shield_call: '#/components/schemas/ShieldCallStep-Output' + tool_execution: '#/components/schemas/ToolExecutionStep-Output' + type: array + title: Steps + description: Ordered list of processing steps executed during this turn + output_message: + $ref: '#/components/schemas/CompletionMessage-Output' + description: The model's generated response containing content and metadata + output_attachments: + anyOf: + - items: + $ref: '#/components/schemas/Attachment-Output' + type: array + - type: 'null' + title: Output Attachments + description: Files or media attached to the agent's response + started_at: type: string - description: >- - ID of the vector database to store the document embeddings - chunk_size_in_tokens: - type: integer - description: >- - (Optional) Size in tokens for document chunking during indexing - additionalProperties: false - required: - - documents - - vector_store_id - - chunk_size_in_tokens - title: InsertRequest - DefaultRAGQueryGeneratorConfig: + format: date-time + title: Started At + description: Timestamp when the turn began + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + description: Timestamp when the turn finished, if completed type: object + required: + - turn_id + - session_id + - input_messages + - steps + - output_message + - started_at + title: Turn + description: A single turn in an interaction with an Agentic System. + URIDataSource: properties: type: type: string - const: default - default: default - description: >- - Type of query generator, always 'default' - separator: + const: uri + title: Type + description: The type of data source + default: uri + uri: type: string - default: ' ' - description: >- - String separator used to join query terms - additionalProperties: false + title: Uri + description: The dataset can be obtained from a URI. E.g. 'https://mywebsite.com/mydata.jsonl', 'lsfs://mydata.jsonl', 'data:csv;base64,{base64_content}' + type: object required: - - type - - separator - title: DefaultRAGQueryGeneratorConfig - description: >- - Configuration for the default RAG query generator. - LLMRAGQueryGeneratorConfig: + - uri + title: URIDataSource + description: A dataset that can be obtained from a URI. + URL: + properties: + uri: + type: string + title: Uri type: object + required: + - uri + title: URL + description: A URL reference to external content. + UnionType: properties: type: type: string - const: llm - default: llm - description: Type of query generator, always 'llm' - model: - type: string - description: >- - Name of the language model to use for query generation - template: - type: string - description: >- - Template string for formatting the query generation prompt - additionalProperties: false - required: - - type - - model - - template - title: LLMRAGQueryGeneratorConfig - description: >- - Configuration for the LLM-based RAG query generator. - RAGQueryConfig: + const: union + title: Type + default: union type: object + title: UnionType + description: "Parameter type for union values.\n\n:param type: Discriminator type. Always \"union\"" + UpdatePromptRequest: properties: - query_generator_config: - oneOf: - - $ref: '#/components/schemas/DefaultRAGQueryGeneratorConfig' - - $ref: '#/components/schemas/LLMRAGQueryGeneratorConfig' - discriminator: - propertyName: type - mapping: - default: '#/components/schemas/DefaultRAGQueryGeneratorConfig' - llm: '#/components/schemas/LLMRAGQueryGeneratorConfig' - description: Configuration for the query generator. - max_tokens_in_context: - type: integer - default: 4096 - description: Maximum number of tokens in the context. - max_chunks: - type: integer - default: 5 - description: Maximum number of chunks to retrieve. - chunk_template: + prompt: type: string - default: > - Result {index} - - - :param params: (Optional) Configuration parameters for the shield - - :param type: The resource type, always shield + title: Prompt + description: The updated prompt text content. + version: + type: integer + title: Version + description: The current version of the prompt being updated. + variables: + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Variables + description: Updated list of variable names that can be used in the prompt template. + set_as_default: + type: boolean + title: Set As Default + description: Set the new version as the default (default=True). + default: true + type: object + required: + - prompt + - version + title: UpdatePromptRequest + description: Request model for updating an existing prompt. + UserMessage-Input: properties: - identifier: - description: >- - Unique identifier for this resource in llama stack - title: Identifier + role: type: string - provider_resource_id: + const: user + title: Role + default: user + content: anyOf: - - type: string - - type: 'null' - description: >- - Unique identifier for this resource in the provider - title: Provider Resource Id - provider_id: - description: >- - ID of the provider that owns this resource - title: Provider Id - type: string - type: - const: shield - default: shield - title: Type - type: string - params: + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + title: Content + context: anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Params - required: - - identifier - - provider_id - title: Shield + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Input' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Input' + text: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + title: Context type: object - SyntheticDataGenerateRequest: - type: object - SyntheticDataGenerationResponse: - description: >- - Response from the synthetic data generation. Batch of (prompt, response, score) - tuples that pass the threshold. - - - :param synthetic_data: List of generated synthetic data samples that passed - the filtering criteria - - :param statistics: (Optional) Statistical information about the generation - process and filtering results - properties: - synthetic_data: - items: - additionalProperties: true - type: object - title: Synthetic Data - type: array - statistics: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Statistics required: - - synthetic_data - title: SyntheticDataGenerationResponse - type: object - InvokeToolRequest: - type: object - ToolInvocationResult: - $defs: - ImageContentItem: - description: >- - A image content item - - - :param type: Discriminator type of the content item. Always "image" - - :param image: Image as a base64 encoded string or an URL - properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/$defs/_URLOrData' - required: - - image - title: ImageContentItem - type: object - TextContentItem: - description: >- - A text content item - - - :param type: Discriminator type of the content item. Always "text" - - :param text: Text content - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: TextContentItem - type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL - type: object - _URLOrData: - description: >- - A URL or a base64 encoded string - - - :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - - :param data: base64 encoded image data as string - properties: - url: - anyOf: - - $ref: '#/$defs/URL' - - type: 'null' - data: - anyOf: - - type: string - - type: 'null' - contentEncoding: base64 - title: Data - title: _URLOrData - type: object - description: >- - Result of a tool invocation. - - - :param content: (Optional) The output content from the tool execution - - :param error_message: (Optional) Error message if the tool execution failed - - :param error_code: (Optional) Numeric error code if the tool execution failed - - :param metadata: (Optional) Additional metadata about the tool execution + - content + title: UserMessage + description: A message from the user in a chat conversation. + UserMessage-Output: properties: + role: + type: string + const: user + title: Role + default: user content: anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - type: 'null' + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array title: Content - error_message: - anyOf: - - type: string - - type: 'null' - title: Error Message - error_code: - anyOf: - - type: integer - - type: 'null' - title: Error Code - metadata: + context: anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Metadata - title: ToolInvocationResult + - type: string + - oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + - items: + oneOf: + - $ref: '#/components/schemas/ImageContentItem-Output' + - $ref: '#/components/schemas/TextContentItem' + discriminator: + propertyName: type + mapping: + image: '#/components/schemas/ImageContentItem-Output' + text: '#/components/schemas/TextContentItem' + type: array + - type: 'null' + title: Context type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource + required: + - content + title: UserMessage + description: A message from the user in a chat conversation. + VectorStoreChunkingStrategyAuto: properties: - uri: - title: Uri + type: type: string - required: - - uri - title: URL + const: auto + title: Type + default: auto type: object - ListToolDefsResponse: - description: Response containing a list of tool definitions. + title: VectorStoreChunkingStrategyAuto + description: Automatic chunking strategy for vector store files. + VectorStoreChunkingStrategyStatic: properties: - data: - items: - $ref: '#/components/schemas/ToolDef' - title: Data - type: array + type: + type: string + const: static + title: Type + default: static + static: + $ref: '#/components/schemas/VectorStoreChunkingStrategyStaticConfig' + type: object required: - - data - title: ListToolDefsResponse + - static + title: VectorStoreChunkingStrategyStatic + description: Static chunking strategy with configurable parameters. + VectorStoreChunkingStrategyStaticConfig: + properties: + chunk_overlap_tokens: + type: integer + title: Chunk Overlap Tokens + default: 400 + max_chunk_size_tokens: + type: integer + maximum: 4096.0 + minimum: 100.0 + title: Max Chunk Size Tokens + default: 800 + type: object + title: VectorStoreChunkingStrategyStaticConfig + description: Configuration for static chunking strategy. + VectorStoreContent: + properties: + type: + type: string + const: text + title: Type + text: + type: string + title: Text type: object + required: + - type + - text + title: VectorStoreContent + description: Content item from a vector store file or search result. VectorStoreDeleteResponse: - description: Response from deleting a vector store. properties: id: - title: Id type: string + title: Id object: - default: vector_store.deleted - title: Object type: string + title: Object + default: vector_store.deleted deleted: - default: true - title: Deleted type: boolean + title: Deleted + default: true + type: object required: - id title: VectorStoreDeleteResponse + description: Response from deleting a vector store. + VectorStoreFileBatchObject: + properties: + id: + type: string + title: Id + object: + type: string + title: Object + default: vector_store.file_batch + created_at: + type: integer + title: Created At + vector_store_id: + type: string + title: Vector Store Id + status: + anyOf: + - type: string + const: completed + - type: string + const: in_progress + - type: string + const: cancelled + - type: string + const: failed + title: Status + file_counts: + $ref: '#/components/schemas/VectorStoreFileCounts' type: object + required: + - id + - created_at + - vector_store_id + - status + - file_counts + title: VectorStoreFileBatchObject + description: OpenAI Vector Store File Batch object. VectorStoreFileContentsResponse: - description: Response from retrieving the contents of a vector store file. properties: file_id: - title: File Id type: string + title: File Id filename: - title: Filename type: string + title: Filename attributes: additionalProperties: true - title: Attributes type: object + title: Attributes content: items: $ref: '#/components/schemas/VectorStoreContent' - title: Content type: array + title: Content + type: object required: - file_id - filename - attributes - content title: VectorStoreFileContentsResponse + description: Response from retrieving the contents of a vector store file. + VectorStoreFileCounts: + properties: + completed: + type: integer + title: Completed + cancelled: + type: integer + title: Cancelled + failed: + type: integer + title: Failed + in_progress: + type: integer + title: In Progress + total: + type: integer + title: Total type: object + required: + - completed + - cancelled + - failed + - in_progress + - total + title: VectorStoreFileCounts + description: File processing status counts for a vector store. VectorStoreFileDeleteResponse: - description: Response from deleting a vector store file. properties: id: - title: Id type: string + title: Id object: - default: vector_store.file.deleted - title: Object type: string + title: Object + default: vector_store.file.deleted deleted: - default: true - title: Deleted type: boolean + title: Deleted + default: true + type: object required: - id title: VectorStoreFileDeleteResponse + description: Response from deleting a vector store file. + VectorStoreFileLastError: + properties: + code: + anyOf: + - type: string + const: server_error + - type: string + const: rate_limit_exceeded + title: Code + message: + type: string + title: Message type: object - VectorStoreFilesListInBatchResponse: - description: Response from listing files in a vector store file batch. + required: + - code + - message + title: VectorStoreFileLastError + description: Error information for failed vector store file processing. + VectorStoreFileObject: properties: - object: - default: list - title: Object + id: type: string - data: - items: - $ref: '#/components/schemas/VectorStoreFileObject' - title: Data - type: array - first_id: - title: First Id + title: Id + object: type: string - nullable: true - last_id: - title: Last Id + title: Object + default: vector_store.file + attributes: + additionalProperties: true + type: object + title: Attributes + chunking_strategy: + oneOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + title: Chunking Strategy + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' + static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + created_at: + type: integer + title: Created At + last_error: + anyOf: + - $ref: '#/components/schemas/VectorStoreFileLastError' + - type: 'null' + status: + anyOf: + - type: string + const: completed + - type: string + const: in_progress + - type: string + const: cancelled + - type: string + const: failed + title: Status + usage_bytes: + type: integer + title: Usage Bytes + default: 0 + vector_store_id: type: string - nullable: true - has_more: - default: false - title: Has More - type: boolean - required: - - data - title: VectorStoreFilesListInBatchResponse + title: Vector Store Id type: object - VectorStoreListFilesResponse: - description: Response from listing files in a vector store. + required: + - id + - chunking_strategy + - created_at + - status + - vector_store_id + title: VectorStoreFileObject + description: OpenAI Vector Store File object. + VectorStoreFilesListInBatchResponse: properties: object: - default: list - title: Object type: string + title: Object + default: list data: items: $ref: '#/components/schemas/VectorStoreFileObject' - title: Data type: array + title: Data first_id: + anyOf: + - type: string + - type: 'null' title: First Id - type: string - nullable: true last_id: + anyOf: + - type: string + - type: 'null' title: Last Id - type: string - nullable: true has_more: - default: false - title: Has More type: boolean + title: Has More + default: false + type: object required: - data - title: VectorStoreListFilesResponse - type: object - VectorStoreListResponse: - description: Response from listing vector stores. + title: VectorStoreFilesListInBatchResponse + description: Response from listing files in a vector store file batch. + VectorStoreListFilesResponse: properties: object: - default: list - title: Object type: string + title: Object + default: list data: items: - $ref: '#/components/schemas/VectorStoreObject' - title: Data + $ref: '#/components/schemas/VectorStoreFileObject' type: array + title: Data first_id: - title: First Id - type: string - nullable: true - last_id: - title: Last Id - type: string - nullable: true - has_more: - default: false - title: Has More - type: boolean - required: - - data - title: VectorStoreListResponse - type: object - OpenAIResponseMessage: - description: "Corresponds to the various Message types in the Responses API.\nThey are all under one type because the Responses API gives them all\nthe same \"type\" value, and there is no way to tell them apart in certain\nscenarios." - properties: - content: anyOf: - type: string - - items: - discriminator: - mapping: - input_file: '#/$defs/OpenAIResponseInputMessageContentFile' - input_image: '#/$defs/OpenAIResponseInputMessageContentImage' - input_text: '#/$defs/OpenAIResponseInputMessageContentText' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentText' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentImage' - - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' - type: array - - items: - discriminator: - mapping: - output_text: '#/$defs/OpenAIResponseOutputMessageContentOutputText' - refusal: '#/$defs/OpenAIResponseContentPartRefusal' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' - type: array - title: Content - role: - anyOf: - - const: system - type: string - - const: developer - type: string - - const: user - type: string - - const: assistant - type: string - title: Role - type: - const: message - default: message - title: Type - type: string - id: - title: Id - type: string - nullable: true - status: - title: Status - type: string - nullable: true - required: - - content - - role - title: OpenAIResponseMessage - type: object - OpenAIResponseObjectWithInput: - description: OpenAI response object extended with input context information. - properties: - created_at: - title: Created At - type: integer - error: - $ref: '#/components/schemas/OpenAIResponseError' - nullable: true - id: - title: Id - type: string - model: - title: Model - type: string - required: - - session_id - title: AgentSessionCreateResponse - description: >- - Response returned when creating a new agent session. - CompletionMessage: - type: object - properties: - role: - type: string - const: assistant - default: assistant - description: >- - Must be "assistant" to identify this as the model's response - content: - $ref: '#/components/schemas/InterleavedContent' - description: The content of the model's response - stop_reason: - type: string - enum: - - end_of_turn - - end_of_message - - out_of_tokens - description: >- - Reason why the model stopped generating. Options are: - `StopReason.end_of_turn`: - The model finished generating the entire response. - `StopReason.end_of_message`: - The model finished generating but generated a partial response -- usually, - a tool call. The user may call the tool and continue the conversation - with the tool's response. - `StopReason.out_of_tokens`: The model ran - out of token budget. - tool_calls: - type: array - items: - $ref: '#/components/schemas/ToolCall' - description: >- - List of tool calls. Each tool call is a ToolCall object. - additionalProperties: false - required: - - role - - content - - stop_reason - title: CompletionMessage - description: >- - A message containing the model's (assistant) response in a chat conversation. - InferenceStep: - type: object - Session: - $defs: - Attachment: - description: >- - An attachment to an agent turn. - - - :param content: The content of the attachment. - - :param mime_type: The MIME type of the attachment. - properties: - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - $ref: '#/$defs/URL' - title: Content - mime_type: - title: Mime Type - type: string - required: - - content - - mime_type - title: Attachment - type: object - BuiltinTool: - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - type: string - CompletionMessage: - description: >- - A message containing the model's (assistant) response in a chat conversation. - - - :param role: Must be "assistant" to identify this as the model's response - - :param content: The content of the model's response - - :param stop_reason: Reason why the model stopped generating. Options are: - - `StopReason.end_of_turn`: The model finished generating the entire - response. - - `StopReason.end_of_message`: The model finished generating but generated - a partial response -- usually, a tool call. The user may call the tool - and continue the conversation with the tool's response. - - `StopReason.out_of_tokens`: The model ran out of token budget. - :param tool_calls: List of tool calls. Each tool call is a ToolCall object. - properties: - role: - const: assistant - default: assistant - title: Role - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - stop_reason: - $ref: '#/$defs/StopReason' - tool_calls: - anyOf: - - items: - $ref: '#/$defs/ToolCall' - type: array - - type: 'null' - title: Tool Calls - required: - - content - - stop_reason - title: CompletionMessage - type: object - ImageContentItem: - description: >- - A image content item - - - :param type: Discriminator type of the content item. Always "image" - - :param image: Image as a base64 encoded string or an URL - properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/$defs/_URLOrData' - required: - - image - title: ImageContentItem - type: object - InferenceStep: - description: >- - An inference step in an agent turn. - - - :param model_response: The response from the LLM. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: inference - default: inference - title: Step Type - type: string - model_response: - $ref: '#/$defs/CompletionMessage' - required: - - turn_id - - step_id - - model_response - title: InferenceStep - type: object - MemoryRetrievalStep: - description: >- - A memory retrieval step in an agent turn. - - - :param vector_store_ids: The IDs of the vector databases to retrieve context - from. - - :param inserted_context: The context retrieved from the vector databases. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: memory_retrieval - default: memory_retrieval - title: Step Type - type: string - vector_store_ids: - title: Vector Store Ids - type: string - inserted_context: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Inserted Context - required: - - turn_id - - step_id - - vector_store_ids - - inserted_context - title: MemoryRetrievalStep - type: object - SafetyViolation: - description: >- - Details of a safety violation detected by content moderation. - - - :param violation_level: Severity level of the violation - - :param user_message: (Optional) Message to convey to the user about the - violation - - :param metadata: Additional metadata including specific violation codes - for debugging and telemetry - properties: - violation_level: - $ref: '#/$defs/ViolationLevel' - user_message: - anyOf: - - type: string - - type: 'null' - title: User Message - metadata: - additionalProperties: true - title: Metadata - type: object - required: - - violation_level - title: SafetyViolation - type: object - ShieldCallStep: - description: >- - A shield call step in an agent turn. - - - :param violation: The violation from the shield call. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: shield_call - default: shield_call - title: Step Type - type: string - violation: - anyOf: - - $ref: '#/$defs/SafetyViolation' - - type: 'null' - required: - - turn_id - - step_id - - violation - title: ShieldCallStep - type: object - StopReason: - enum: - - end_of_turn - - end_of_message - - out_of_tokens - title: StopReason - type: string - TextContentItem: - description: >- - A text content item - - - :param type: Discriminator type of the content item. Always "text" - - :param text: Text content - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: TextContentItem - type: object - ToolCall: - properties: - call_id: - title: Call Id - type: string - tool_name: - anyOf: - - $ref: '#/$defs/BuiltinTool' - - type: string - title: Tool Name - arguments: - title: Arguments - type: string - required: - - call_id - - tool_name - - arguments - title: ToolCall - type: object - ToolExecutionStep: - description: >- - A tool execution step in an agent turn. - - - :param tool_calls: The tool calls to execute. - - :param tool_responses: The tool responses from the tool calls. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: tool_execution - default: tool_execution - title: Step Type - type: string - tool_calls: - items: - $ref: '#/$defs/ToolCall' - title: Tool Calls - type: array - tool_responses: - items: - $ref: '#/$defs/ToolResponse' - title: Tool Responses - type: array - required: - - turn_id - - step_id - - tool_calls - - tool_responses - title: ToolExecutionStep - type: object - ToolResponse: - description: >- - Response from a tool invocation. - - - :param call_id: Unique identifier for the tool call this response is for - - :param tool_name: Name of the tool that was invoked - - :param content: The response content from the tool - - :param metadata: (Optional) Additional metadata about the tool response - properties: - call_id: - title: Call Id - type: string - tool_name: - anyOf: - - $ref: '#/$defs/BuiltinTool' - - type: string - title: Tool Name - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - metadata: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Metadata - required: - - call_id - - tool_name - - content - title: ToolResponse - type: object - ToolResponseMessage: - description: >- - A message representing the result of a tool invocation. - - - :param role: Must be "tool" to identify this as a tool response - - :param call_id: Unique identifier for the tool call this response is for - - :param content: The response content from the tool - properties: - role: - const: tool - default: tool - title: Role - type: string - call_id: - title: Call Id - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - required: - - call_id - - content - title: ToolResponseMessage - type: object - Turn: - description: >- - A single turn in an interaction with an Agentic System. - - - :param turn_id: Unique identifier for the turn within a session - - :param session_id: Unique identifier for the conversation session - - :param input_messages: List of messages that initiated this turn - - :param steps: Ordered list of processing steps executed during this turn - - :param output_message: The model's generated response containing content - and metadata - - :param output_attachments: (Optional) Files or media attached to the agent's - response - - :param started_at: Timestamp when the turn began - - :param completed_at: (Optional) Timestamp when the turn finished, if completed - properties: - turn_id: - title: Turn Id - type: string - session_id: - title: Session Id - type: string - input_messages: - items: - anyOf: - - $ref: '#/$defs/UserMessage' - - $ref: '#/$defs/ToolResponseMessage' - title: Input Messages - type: array - steps: - items: - discriminator: - mapping: - inference: '#/$defs/InferenceStep' - memory_retrieval: '#/$defs/MemoryRetrievalStep' - shield_call: '#/$defs/ShieldCallStep' - tool_execution: '#/$defs/ToolExecutionStep' - propertyName: step_type - oneOf: - - $ref: '#/$defs/InferenceStep' - - $ref: '#/$defs/ToolExecutionStep' - - $ref: '#/$defs/ShieldCallStep' - - $ref: '#/$defs/MemoryRetrievalStep' - title: Steps - type: array - output_message: - $ref: '#/$defs/CompletionMessage' - output_attachments: - anyOf: - - items: - $ref: '#/$defs/Attachment' - type: array - - type: 'null' - title: Output Attachments - started_at: - format: date-time - title: Started At - type: string - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - required: - - turn_id - - session_id - - input_messages - - steps - - output_message - - started_at - title: Turn - type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL - type: object - UserMessage: - description: >- - A message from the user in a chat conversation. - - - :param role: Must be "user" to identify this as a user message - - :param content: The content of the message, which can include text and - other media - - :param context: (Optional) This field is used internally by Llama Stack - to pass RAG context. This field may be removed in the API in the future. - properties: - role: - const: user - default: user - title: Role - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - context: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - type: 'null' - title: Context - required: - - content - title: UserMessage - type: object - ViolationLevel: - description: >- - Severity level of a safety violation. - - - :cvar INFO: Informational level violation that does not require action - - :cvar WARN: Warning level violation that suggests caution but allows continuation - - :cvar ERROR: Error level violation that requires blocking or intervention - enum: - - info - - warn - - error - title: ViolationLevel - type: string - _URLOrData: - description: >- - A URL or a base64 encoded string - - - :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - - :param data: base64 encoded image data as string - properties: - url: - anyOf: - - $ref: '#/$defs/URL' - - type: 'null' - data: - anyOf: - - type: string - - type: 'null' - contentEncoding: base64 - title: Data - title: _URLOrData - type: object - description: >- - A single session of an interaction with an Agentic System. - - - :param session_id: Unique identifier for the conversation session - - :param session_name: Human-readable name for the session - - :param turns: List of all turns that have occurred in this session - - :param started_at: Timestamp when the session was created - properties: - session_id: - title: Session Id - type: string - session_name: - title: Session Name - type: string - turns: - items: - $ref: '#/$defs/Turn' - title: Turns - type: array - started_at: - format: date-time - title: Started At - type: string - required: - - session_id - - session_name - - turns - - started_at - title: Session - type: object - properties: - turn_id: - type: string - description: The ID of the turn. - step_id: - type: string - description: The ID of the step. - started_at: - type: string - format: date-time - description: The time the step started. - completed_at: - type: string - format: date-time - description: The time the step completed. - step_type: - type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - title: StepType - description: Type of the step in an agent turn. - const: shield_call - default: shield_call - violation: - $ref: '#/components/schemas/SafetyViolation' - description: The violation from the shield call. - additionalProperties: false - required: - - turn_id - - step_id - - step_type - title: ShieldCallStep - description: A shield call step in an agent turn. - ToolCall: + - type: 'null' + title: First Id + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + has_more: + type: boolean + title: Has More + default: false type: object - properties: - call_id: - type: string - tool_name: - oneOf: - - type: string - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - - type: string - arguments: - type: string - additionalProperties: false required: - - call_id - - tool_name - - arguments - title: ToolCall - ToolExecutionStep: - type: object + - data + title: VectorStoreListFilesResponse + description: Response from listing files in a vector store. + VectorStoreListResponse: properties: - turn_id: - type: string - description: The ID of the turn. - step_id: - type: string - description: The ID of the step. - started_at: - type: string - format: date-time - description: The time the step started. - completed_at: - type: string - format: date-time - description: The time the step completed. - step_type: + object: type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - title: StepType - description: Type of the step in an agent turn. - const: tool_execution - default: tool_execution - tool_calls: - type: array + title: Object + default: list + data: items: - $ref: '#/components/schemas/ToolCall' - description: The tool calls to execute. - tool_responses: + $ref: '#/components/schemas/VectorStoreObject' type: array - items: - $ref: '#/components/schemas/ToolResponse' - description: The tool responses from the tool calls. - additionalProperties: false - required: - - turn_id - - step_id - - step_type - - tool_calls - - tool_responses - title: ToolExecutionStep - description: A tool execution step in an agent turn. - ToolResponse: + title: Data + first_id: + anyOf: + - type: string + - type: 'null' + title: First Id + last_id: + anyOf: + - type: string + - type: 'null' + title: Last Id + has_more: + type: boolean + title: Has More + default: false type: object + required: + - data + title: VectorStoreListResponse + description: Response from listing vector stores. + VectorStoreModifyRequest: properties: - call_id: - type: string - description: >- - Unique identifier for the tool call this response is for - tool_name: - oneOf: - - type: string - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - - type: string - description: Name of the tool that was invoked - content: - $ref: '#/components/schemas/InterleavedContent' - description: The response content from the tool + name: + anyOf: + - type: string + - type: 'null' + title: Name + expires_after: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After metadata: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Additional metadata about the tool response - additionalProperties: false - required: - - call_id - - tool_name - - content - title: ToolResponse - description: Response from a tool invocation. - ToolResponseMessage: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata type: object + title: VectorStoreModifyRequest + description: Request to modify a vector store. + VectorStoreObject: properties: - role: - type: string - const: tool - default: tool - description: >- - Must be "tool" to identify this as a tool response - call_id: - type: string - description: >- - Unique identifier for the tool call this response is for - content: - $ref: '#/components/schemas/InterleavedContent' - description: The response content from the tool - additionalProperties: false - required: - - role - - call_id - - content - title: ToolResponseMessage - description: >- - A message representing the result of a tool invocation. - Turn: - $defs: - Attachment: - description: >- - An attachment to an agent turn. - - - :param content: The content of the attachment. - - :param mime_type: The MIME type of the attachment. - properties: - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - $ref: '#/$defs/URL' - title: Content - mime_type: - title: Mime Type - type: string - required: - - content - - mime_type - title: Attachment - type: object - BuiltinTool: - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - type: string - CompletionMessage: - description: >- - A message containing the model's (assistant) response in a chat conversation. - - - :param role: Must be "assistant" to identify this as the model's response - - :param content: The content of the model's response - - :param stop_reason: Reason why the model stopped generating. Options are: - - `StopReason.end_of_turn`: The model finished generating the entire - response. - - `StopReason.end_of_message`: The model finished generating but generated - a partial response -- usually, a tool call. The user may call the tool - and continue the conversation with the tool's response. - - `StopReason.out_of_tokens`: The model ran out of token budget. - :param tool_calls: List of tool calls. Each tool call is a ToolCall object. - properties: - role: - const: assistant - default: assistant - title: Role - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - stop_reason: - $ref: '#/$defs/StopReason' - tool_calls: - anyOf: - - items: - $ref: '#/$defs/ToolCall' - type: array - - type: 'null' - title: Tool Calls - required: - - content - - stop_reason - title: CompletionMessage - type: object - ImageContentItem: - description: >- - A image content item - - - :param type: Discriminator type of the content item. Always "image" - - :param image: Image as a base64 encoded string or an URL - properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/$defs/_URLOrData' - required: - - image - title: ImageContentItem - type: object - InferenceStep: - description: >- - An inference step in an agent turn. - - - :param model_response: The response from the LLM. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: inference - default: inference - title: Step Type - type: string - model_response: - $ref: '#/$defs/CompletionMessage' - required: - - turn_id - - step_id - - model_response - title: InferenceStep - type: object - MemoryRetrievalStep: - description: >- - A memory retrieval step in an agent turn. - - - :param vector_store_ids: The IDs of the vector databases to retrieve context - from. - - :param inserted_context: The context retrieved from the vector databases. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: memory_retrieval - default: memory_retrieval - title: Step Type - type: string - vector_store_ids: - title: Vector Store Ids - type: string - inserted_context: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Inserted Context - required: - - turn_id - - step_id - - vector_store_ids - - inserted_context - title: MemoryRetrievalStep - type: object - SafetyViolation: - description: >- - Details of a safety violation detected by content moderation. - - - :param violation_level: Severity level of the violation - - :param user_message: (Optional) Message to convey to the user about the - violation - - :param metadata: Additional metadata including specific violation codes - for debugging and telemetry - properties: - violation_level: - $ref: '#/$defs/ViolationLevel' - user_message: - anyOf: - - type: string - - type: 'null' - title: User Message - metadata: - additionalProperties: true - title: Metadata - type: object - required: - - violation_level - title: SafetyViolation - type: object - ShieldCallStep: - description: >- - A shield call step in an agent turn. - - - :param violation: The violation from the shield call. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: shield_call - default: shield_call - title: Step Type - type: string - violation: - anyOf: - - $ref: '#/$defs/SafetyViolation' - - type: 'null' - required: - - turn_id - - step_id - - violation - title: ShieldCallStep - type: object - StopReason: - enum: - - end_of_turn - - end_of_message - - out_of_tokens - title: StopReason - type: string - TextContentItem: - description: >- - A text content item - - - :param type: Discriminator type of the content item. Always "text" - - :param text: Text content - properties: - type: - const: text - default: text - title: Type - type: string - text: - title: Text - type: string - required: - - text - title: TextContentItem - type: object - ToolCall: - properties: - call_id: - title: Call Id - type: string - tool_name: - anyOf: - - $ref: '#/$defs/BuiltinTool' - - type: string - title: Tool Name - arguments: - title: Arguments - type: string - required: - - call_id - - tool_name - - arguments - title: ToolCall - type: object - ToolExecutionStep: - description: >- - A tool execution step in an agent turn. - - - :param tool_calls: The tool calls to execute. - - :param tool_responses: The tool responses from the tool calls. - properties: - turn_id: - title: Turn Id - type: string - step_id: - title: Step Id - type: string - started_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Started At - completed_at: - anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - step_type: - const: tool_execution - default: tool_execution - title: Step Type - type: string - tool_calls: - items: - $ref: '#/$defs/ToolCall' - title: Tool Calls - type: array - tool_responses: - items: - $ref: '#/$defs/ToolResponse' - title: Tool Responses - type: array - required: - - turn_id - - step_id - - tool_calls - - tool_responses - title: ToolExecutionStep - type: object - ToolResponse: - description: >- - Response from a tool invocation. - - - :param call_id: Unique identifier for the tool call this response is for - - :param tool_name: Name of the tool that was invoked - - :param content: The response content from the tool - - :param metadata: (Optional) Additional metadata about the tool response - properties: - call_id: - title: Call Id - type: string - tool_name: - anyOf: - - $ref: '#/$defs/BuiltinTool' - - type: string - title: Tool Name - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - metadata: - anyOf: - - additionalProperties: true - type: object - - type: 'null' - title: Metadata - required: - - call_id - - tool_name - - content - title: ToolResponse - type: object - ToolResponseMessage: - description: >- - A message representing the result of a tool invocation. - - - :param role: Must be "tool" to identify this as a tool response - - :param call_id: Unique identifier for the tool call this response is for - - :param content: The response content from the tool - properties: - role: - const: tool - default: tool - title: Role - type: string - call_id: - title: Call Id - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - required: - - call_id - - content - title: ToolResponseMessage - type: object - URL: - description: >- - A URL reference to external content. - - - :param uri: The URL string pointing to the resource - properties: - uri: - title: Uri - type: string - required: - - uri - title: URL - type: object - UserMessage: - description: >- - A message from the user in a chat conversation. - - - :param role: Must be "user" to identify this as a user message - - :param content: The content of the message, which can include text and - other media - - :param context: (Optional) This field is used internally by Llama Stack - to pass RAG context. This field may be removed in the API in the future. - properties: - role: - const: user - default: user - title: Role - type: string - content: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - title: Content - context: - anyOf: - - type: string - - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - - items: - discriminator: - mapping: - image: '#/$defs/ImageContentItem' - text: '#/$defs/TextContentItem' - propertyName: type - oneOf: - - $ref: '#/$defs/ImageContentItem' - - $ref: '#/$defs/TextContentItem' - type: array - - type: 'null' - title: Context - required: - - content - title: UserMessage - type: object - ViolationLevel: - description: >- - Severity level of a safety violation. - - - :cvar INFO: Informational level violation that does not require action - - :cvar WARN: Warning level violation that suggests caution but allows continuation - - :cvar ERROR: Error level violation that requires blocking or intervention - enum: - - info - - warn - - error - title: ViolationLevel - type: string - _URLOrData: - description: >- - A URL or a base64 encoded string - - - :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. - Note that URL could have length limits. - - :param data: base64 encoded image data as string - properties: - url: - anyOf: - - $ref: '#/$defs/URL' - - type: 'null' - data: - anyOf: - - type: string - - type: 'null' - contentEncoding: base64 - title: Data - title: _URLOrData - type: object - description: >- - A single turn in an interaction with an Agentic System. - - - :param turn_id: Unique identifier for the turn within a session - - :param session_id: Unique identifier for the conversation session - - :param input_messages: List of messages that initiated this turn - - :param steps: Ordered list of processing steps executed during this turn - - :param output_message: The model's generated response containing content and - metadata - - :param output_attachments: (Optional) Files or media attached to the agent's - response - - :param started_at: Timestamp when the turn began - - :param completed_at: (Optional) Timestamp when the turn finished, if completed - properties: - turn_id: - title: Turn Id + id: type: string - session_id: - title: Session Id + title: Id + object: type: string - input_messages: - items: - anyOf: - - $ref: '#/$defs/UserMessage' - - $ref: '#/$defs/ToolResponseMessage' - title: Input Messages - type: array - steps: - items: - discriminator: - mapping: - file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' - message: '#/$defs/OpenAIResponseMessage' - web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - title: Output - type: array - parallel_tool_calls: - default: false - title: Parallel Tool Calls - type: boolean - previous_response_id: - title: Previous Response Id + title: Object + default: vector_store + created_at: + type: integer + title: Created At + name: + anyOf: + - type: string + - type: 'null' + title: Name + usage_bytes: + type: integer + title: Usage Bytes + default: 0 + file_counts: + $ref: '#/components/schemas/VectorStoreFileCounts' + status: type: string - completed_at: + title: Status + default: completed + expires_after: anyOf: - - format: date-time - type: string - - type: 'null' - title: Completed At - required: - - turn_id - - session_id - - input_messages - - steps - - output_message - - started_at - title: Turn - description: >- - A single turn in an interaction with an Agentic System. - UserMessage: + - additionalProperties: true + type: object + - type: 'null' + title: Expires After + expires_at: + anyOf: + - type: integer + - type: 'null' + title: Expires At + last_active_at: + anyOf: + - type: integer + - type: 'null' + title: Last Active At + metadata: + additionalProperties: true + type: object + title: Metadata type: object + required: + - id + - created_at + - file_counts + title: VectorStoreObject + description: OpenAI Vector Store object. + VectorStoreSearchResponse: properties: - role: + file_id: type: string - const: user - default: user - description: >- - Must be "user" to identify this as a user message - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - The content of the message, which can include text and other media - context: - $ref: '#/components/schemas/InterleavedContent' - description: >- - (Optional) This field is used internally by Llama Stack to pass RAG context. - This field may be removed in the API in the future. - additionalProperties: false - required: - - role - - content - title: UserMessage - description: >- - A message from the user in a chat conversation. - CreateAgentTurnRequest: - type: object - ResumeAgentTurnRequest: - type: object - AgentStepResponse: - $defs: - BuiltinTool: - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool + title: File Id + filename: type: string - temperature: - title: Temperature - type: number - nullable: true - text: - $ref: '#/components/schemas/OpenAIResponseText' - default: - format: - type: text - top_p: - title: Top P + title: Filename + score: type: number - nullable: true - tools: - title: Tools + title: Score + attributes: + anyOf: + - additionalProperties: + anyOf: + - type: string + - type: number + - type: boolean + type: object + - type: 'null' + title: Attributes + content: items: - discriminator: - mapping: - file_search: '#/$defs/OpenAIResponseInputToolFileSearch' - function: '#/$defs/OpenAIResponseInputToolFunction' - mcp: '#/$defs/OpenAIResponseToolMCP' - web_search: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview: '#/$defs/OpenAIResponseInputToolWebSearch' - web_search_preview_2025_03_11: '#/$defs/OpenAIResponseInputToolWebSearch' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFileSearch' - - $ref: '#/components/schemas/OpenAIResponseInputToolFunction' - - $ref: '#/components/schemas/OpenAIResponseToolMCP' + $ref: '#/components/schemas/VectorStoreContent' type: array - nullable: true - truncation: - title: Truncation + title: Content + type: object + required: + - file_id + - filename + - score + - content + title: VectorStoreSearchResponse + description: Response from searching a vector store. + VectorStoreSearchResponsePage: + properties: + object: type: string - nullable: true - usage: - $ref: '#/components/schemas/OpenAIResponseUsage' - nullable: true - instructions: - title: Instructions + title: Object + default: vector_store.search_results.page + search_query: type: string - nullable: true - input: + title: Search Query + data: items: - anyOf: - - discriminator: - mapping: - file_search_call: '#/$defs/OpenAIResponseOutputMessageFileSearchToolCall' - function_call: '#/$defs/OpenAIResponseOutputMessageFunctionToolCall' - mcp_approval_request: '#/$defs/OpenAIResponseMCPApprovalRequest' - mcp_call: '#/$defs/OpenAIResponseOutputMessageMCPCall' - mcp_list_tools: '#/$defs/OpenAIResponseOutputMessageMCPListTools' - message: '#/$defs/OpenAIResponseMessage' - web_search_call: '#/$defs/OpenAIResponseOutputMessageWebSearchToolCall' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OpenAIResponseMessage' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageWebSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageFunctionToolCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPCall' - - $ref: '#/components/schemas/OpenAIResponseOutputMessageMCPListTools' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalRequest' - - $ref: '#/components/schemas/OpenAIResponseInputFunctionToolCallOutput' - - $ref: '#/components/schemas/OpenAIResponseMCPApprovalResponse' - - $ref: '#/components/schemas/OpenAIResponseMessage' - title: Input + $ref: '#/components/schemas/VectorStoreSearchResponse' type: array - required: - - created_at - - id - - model - - output - - status - - input - title: OpenAIResponseObjectWithInput + title: Data + has_more: + type: boolean + title: Has More + default: false + next_page: + anyOf: + - type: string + - type: 'null' + title: Next Page type: object - ImageContentItem: - description: A image content item - properties: - type: - const: image - default: image - title: Type - type: string - image: - $ref: '#/components/schemas/_URLOrData' required: - - image - title: ImageContentItem - type: object + - search_query + - data + title: VectorStoreSearchResponsePage + description: Paginated response from searching a vector store. + VersionInfo: properties: - type: + version: type: string - const: agent - default: agent - config: - $ref: '#/components/schemas/AgentConfig' - description: >- - The configuration for the agent candidate. - additionalProperties: false - required: - - type - - config - title: AgentCandidate - description: An agent candidate for evaluation. - BenchmarkConfig: + title: Version + description: Version number of the service type: object - properties: - eval_candidate: - oneOf: - - $ref: '#/components/schemas/ModelCandidate' - - $ref: '#/components/schemas/AgentCandidate' - discriminator: - propertyName: type - mapping: - model: '#/components/schemas/ModelCandidate' - agent: '#/components/schemas/AgentCandidate' - description: The candidate to evaluate. - scoring_params: - type: object - additionalProperties: - $ref: '#/components/schemas/ScoringFnParams' - description: >- - Map between scoring function id and parameters for each scoring function - you want to run - num_examples: - type: integer - description: >- - (Optional) The number of examples to evaluate. If not provided, all examples - in the dataset will be evaluated - additionalProperties: false required: - - eval_candidate - - scoring_params - title: BenchmarkConfig - description: >- - A benchmark configuration for evaluation. - ModelCandidate: - type: object + - version + title: VersionInfo + description: Version information for the service. + ViolationLevel: + type: string + enum: + - info + - warn + - error + title: ViolationLevel + description: "Severity level of a safety violation.\n\n:cvar INFO: Informational level violation that does not require action\n:cvar WARN: Warning level violation that suggests caution but allows continuation\n:cvar ERROR: Error level violation that requires blocking or intervention" + WeightedRanker: properties: type: type: string - const: model - default: model - model: - type: string - description: The model ID to evaluate. - sampling_params: - $ref: '#/components/schemas/SamplingParams' - description: The sampling parameters for the model. - system_message: - $ref: '#/components/schemas/SystemMessage' - description: >- - (Optional) The system message providing instructions or context to the - model. - additionalProperties: false - required: - - type - - model - - sampling_params - title: ModelCandidate - description: A model candidate for evaluation. - SystemMessage: - type: object - properties: - role: - type: string - const: system - default: system - description: >- - Must be "system" to identify this as a system message - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - The content of the "system prompt". If multiple system messages are provided, - they are concatenated. The underlying Llama Stack code may also add other - system messages (for example, for formatting tool definitions). - additionalProperties: false - required: - - role - - content - title: SystemMessage - description: >- - A system message providing instructions or context to the model. - EvaluateRowsRequest: - type: object - EvaluateResponse: - $defs: - ScoringResult: - description: >- - A scoring result for a single row. - - - :param score_rows: The scoring result for each row. Each row is a map - of column name to value. - - :param aggregated_results: Map of metric name to aggregated value - properties: - score_rows: - items: - additionalProperties: true - type: object - title: Score Rows - type: array - aggregated_results: - additionalProperties: true - title: Aggregated Results - type: object - required: - - score_rows - - aggregated_results - title: ScoringResult - type: object - description: >- - The response from an evaluation. - - - :param generations: The generations from the evaluation. - - :param scores: The scores from the evaluation. - properties: - epoch: - title: Epoch - type: integer - train_loss: - title: Train Loss - type: number - validation_loss: - title: Validation Loss - type: number - perplexity: - title: Perplexity + const: weighted + title: Type + default: weighted + alpha: type: number - required: - - epoch - - train_loss - - validation_loss - - perplexity - title: PostTrainingMetric + maximum: 1.0 + minimum: 0.0 + title: Alpha + description: Weight factor between 0 and 1. 0 means only keyword scores, 1 means only vector scores. + default: 0.5 type: object - _safety_run_shield_Request: + title: WeightedRanker + description: "Weighted ranker configuration that combines vector and keyword scores.\n\n:param type: The type of ranker, always \"weighted\"\n:param alpha: Weight factor between 0 and 1.\n 0 means only use keyword scores,\n 1 means only use vector scores,\n values in between blend both scores." + _URLOrData: properties: - shield_id: - title: Shield Id - type: string - messages: + url: anyOf: - - $ref: '#/components/schemas/OpenAIUserMessageParam' - - $ref: '#/components/schemas/OpenAISystemMessageParam' - - $ref: '#/components/schemas/OpenAIAssistantMessageParam' - - $ref: '#/components/schemas/OpenAIToolMessageParam' - - $ref: '#/components/schemas/OpenAIDeveloperMessageParam' - title: Messages - params: - title: Params - type: string - required: - - shield_id - - messages - - params - title: _safety_run_shield_Request - type: object - responses: - BadRequest400: - description: The request was invalid or malformed - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 400 - title: Bad Request - detail: The request was invalid or malformed - TooManyRequests429: - description: The client has sent too many requests in a given amount of time - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 429 - title: Too Many Requests - detail: You have exceeded the rate limit. Please try again later. - InternalServerError500: - description: The server encountered an unexpected error - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 500 - title: Internal Server Error - detail: An unexpected error occurred. Our team has been notified. - DefaultError: - description: An unexpected error occurred - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - status: 0 - title: Error - detail: An unexpected error occurred -security: - - Default: [] -tags: - - name: Agents - description: >- - APIs for creating and interacting with agentic systems. - x-displayName: Agents - - name: Batches - description: >- - The API is designed to allow use of openai client libraries for seamless integration. - - - This API provides the following extensions: - - idempotent batch creation - - Note: This API is currently under active development and may undergo changes. - x-displayName: >- - The Batches API enables efficient processing of multiple requests in a single - operation, particularly useful for processing large datasets, batch evaluation - workflows, and cost-effective inference at scale. - - name: Benchmarks - description: '' - - name: Conversations - description: >- - Protocol for conversation management operations. - x-displayName: Conversations - - name: DatasetIO - description: '' - - name: Datasets - description: '' - - name: Eval - description: >- - Llama Stack Evaluation API for running evaluations on model and agent candidates. - x-displayName: Evaluations - - name: Files - description: >- - This API is used to upload documents that can be used with other Llama Stack - APIs. - x-displayName: Files - - name: Inference - description: >- - Llama Stack Inference API for generating completions, chat completions, and - embeddings. - - This API provides the raw interface to the underlying models. Three kinds - of models are supported: - - LLM models: these models generate "raw" and "chat" (conversational) completions. - - Embedding models: these models generate embeddings to be used for semantic - search. - - Rerank models: these models reorder the documents based on their relevance - to a query. - x-displayName: Inference - - name: Inspect - description: >- - APIs for inspecting the Llama Stack service, including health status, available - API routes with methods and implementing providers. - x-displayName: Inspect - - name: Models - description: '' - - name: PostTraining (Coming Soon) - description: '' - - name: Prompts - description: >- - Protocol for prompt management operations. - x-displayName: Prompts - - name: Providers - description: >- - Providers API for inspecting, listing, and modifying providers and their configurations. - x-displayName: Providers - - name: Safety - description: OpenAI-compatible Moderations API. - x-displayName: Safety - - name: Scoring - description: '' - - name: ScoringFunctions - description: '' - - name: Shields - description: '' - - name: ToolGroups - description: '' - - name: ToolRuntime - description: '' - - name: VectorIO - description: '' -x-tagGroups: - - name: Operations - tags: - - Agents - - Batches - - Benchmarks - - Conversations - - DatasetIO - - Datasets - - Eval - - Files - - Inference - - Inspect - - Models - - PostTraining (Coming Soon) - - Prompts - - Providers - - Safety - - Scoring - - ScoringFunctions - - Shields - - ToolGroups - - ToolRuntime - - VectorIO + - $ref: '#/components/schemas/URL' + - type: 'null' + data: + anyOf: + - type: string + - type: 'null' + contentEncoding: base64 + title: Data + type: object + title: _URLOrData + description: A URL or a base64 encoded string. diff --git a/scripts/fastapi_generator.py b/scripts/fastapi_generator.py index 7a8b87afe1..c0fa9bc4ab 100755 --- a/scripts/fastapi_generator.py +++ b/scripts/fastapi_generator.py @@ -9,10 +9,10 @@ FastAPI-based OpenAPI generator for Llama Stack. """ -import inspect +import importlib import json from pathlib import Path -from typing import Annotated, Any, Literal, get_args, get_origin +from typing import Any import yaml from fastapi import FastAPI @@ -20,79 +20,15 @@ from openapi_spec_validator import validate_spec from openapi_spec_validator.exceptions import OpenAPISpecValidatorError -from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1, LLAMA_STACK_API_V1ALPHA, LLAMA_STACK_API_V1BETA +from llama_stack.core.distribution import INTERNAL_APIS, providable_apis from llama_stack.core.resolver import api_protocol_map -# Import the existing route discovery system -from llama_stack.core.server.routes import get_all_api_routes - -# Global list to store dynamic models created during endpoint generation -_dynamic_models = [] - -# Global mapping from (path, method) to webmethod for parameter description extraction -_path_webmethod_map: dict[tuple[str, str], Any] = {} - - -def _get_all_api_routes_with_functions(): - """ - Get all API routes with their actual function references. - This is a modified version of get_all_api_routes that includes the function. - """ - from aiohttp import hdrs - from starlette.routing import Route - - from llama_stack.apis.tools import RAGToolRuntime, SpecialToolGroup - - apis = {} - protocols = api_protocol_map() - toolgroup_protocols = { - SpecialToolGroup.rag_tool: RAGToolRuntime, - } - - for api, protocol in protocols.items(): - routes = [] - protocol_methods = inspect.getmembers(protocol, predicate=inspect.isfunction) - - # HACK ALERT - if api == Api.tool_runtime: - for tool_group in SpecialToolGroup: - sub_protocol = toolgroup_protocols[tool_group] - sub_protocol_methods = inspect.getmembers(sub_protocol, predicate=inspect.isfunction) - for name, method in sub_protocol_methods: - if not hasattr(method, "__webmethod__"): - continue - protocol_methods.append((f"{tool_group.value}.{name}", method)) - - for name, method in protocol_methods: - # Get all webmethods for this method (supports multiple decorators) - webmethods = getattr(method, "__webmethods__", []) - if not webmethods: - continue - - # Create routes for each webmethod decorator - for webmethod in webmethods: - path = f"/{webmethod.level}/{webmethod.route.lstrip('/')}" - if webmethod.method == hdrs.METH_GET: - http_method = hdrs.METH_GET - elif webmethod.method == hdrs.METH_DELETE: - http_method = hdrs.METH_DELETE - else: - http_method = hdrs.METH_POST - - # Store the function reference in the webmethod - webmethod.func = method - - routes.append((Route(path=path, methods=[http_method], name=name, endpoint=None), webmethod)) - - apis[api] = routes - - return apis - def create_llama_stack_app() -> FastAPI: """ Create a FastAPI app that represents the Llama Stack API. - This uses the existing route discovery system to automatically find all routes. + All APIs use FastAPI routers for OpenAPI generation. """ app = FastAPI( title="Llama Stack API", @@ -104,572 +40,57 @@ def create_llama_stack_app() -> FastAPI: ], ) - # Get all API routes using the modified system that includes functions - api_routes = _get_all_api_routes_with_functions() - - # Create FastAPI routes from the discovered routes - for _, routes in api_routes.items(): - for route, webmethod in routes: - # Store mapping for later use in parameter description extraction - for method in route.methods: - _path_webmethod_map[(route.path, method.lower())] = webmethod - # Convert the route to a FastAPI endpoint - _create_fastapi_endpoint(app, route, webmethod) - - return app - - -def _extract_path_parameters(path: str, webmethod=None) -> list[dict[str, Any]]: - """ - Extract path parameters from a URL path and return them as OpenAPI parameter definitions. - Parameters are returned in the order they appear in the docstring if available, - otherwise in the order they appear in the path. - - Args: - path: URL path with parameters like /v1/batches/{batch_id}/cancel - webmethod: Optional webmethod to extract parameter descriptions from docstring - - Returns: - List of parameter definitions for OpenAPI - """ - import re - - # Find all path parameters in the format {param} or {param:type} - param_pattern = r"\{([^}:]+)(?::[^}]+)?\}" - path_params = set(re.findall(param_pattern, path)) - - # Extract parameter descriptions and order from docstring if available - param_descriptions = {} - docstring_param_order = [] - if webmethod: - func = getattr(webmethod, "func", None) - if func and func.__doc__: - docstring = func.__doc__ - lines = docstring.split("\n") - for line in lines: - line = line.strip() - if line.startswith(":param "): - # Extract parameter name and description - # Format: :param param_name: description - parts = line[7:].split(":", 1) - if len(parts) == 2: - param_name = parts[0].strip() - description = parts[1].strip() - # Only track path parameters that exist in the path - if param_name in path_params: - if description: - param_descriptions[param_name] = description - if param_name not in docstring_param_order: - docstring_param_order.append(param_name) - - # Build parameters list preserving docstring order for path parameters found in docstring, - # then add any remaining path parameters in path order - parameters = [] - # First add parameters in docstring order - for param_name in docstring_param_order: - if param_name in path_params: - description = param_descriptions.get(param_name, f"Path parameter: {param_name}") - parameters.append( - { - "name": param_name, - "in": "path", - "required": True, - "schema": {"type": "string"}, - "description": description, - } - ) - # Then add any path parameters not in docstring, in path order - path_param_list = re.findall(param_pattern, path) - for param_name in path_param_list: - if param_name not in docstring_param_order: - description = param_descriptions.get(param_name, f"Path parameter: {param_name}") - parameters.append( - { - "name": param_name, - "in": "path", - "required": True, - "schema": {"type": "string"}, - "description": description, - } - ) - - return parameters + # Import API modules to ensure routers are registered (they register on import) + # Import all providable APIs plus internal APIs that need routers + apis_to_import = set(providable_apis()) | INTERNAL_APIS - -def _create_fastapi_endpoint(app: FastAPI, route, webmethod): - """ - Create a FastAPI endpoint from a discovered route and webmethod. - This creates endpoints with actual Pydantic models for proper schema generation. - """ - # Extract route information - path = route.path - methods = route.methods - name = route.name - - # Convert path parameters from {param} to {param:path} format for FastAPI - fastapi_path = path.replace("{", "{").replace("}", "}") - - # Try to find actual models for this endpoint - request_model, response_model, query_parameters = _find_models_for_endpoint(webmethod) - - # Debug: Print info for safety endpoints - if "safety" in webmethod.route or "shield" in webmethod.route: - print( - f"Debug: {webmethod.route} - request_model: {request_model}, response_model: {response_model}, query_parameters: {query_parameters}" - ) - - # Extract summary and response description from webmethod docstring - summary = _extract_summary_from_docstring(webmethod) - response_description = _extract_response_description_from_docstring(webmethod, response_model) - - # Create endpoint function with proper typing - if request_model and response_model: - # POST/PUT request with request body - async def typed_endpoint(request: request_model) -> response_model: - """Typed endpoint for proper schema generation.""" - return response_model() - - endpoint_func = typed_endpoint - elif response_model and query_parameters: - # Check if this is a POST/PUT endpoint with individual parameters - # For POST/PUT, individual parameters should go in request body, not query params - is_post_put = any(method.upper() in ["POST", "PUT", "PATCH"] for method in methods) - - if is_post_put: - # POST/PUT with individual parameters - create a request body model - try: - from pydantic import create_model - - # Create a dynamic Pydantic model for the request body - field_definitions = {} - for param_name, param_type, default_value in query_parameters: - # Handle complex types that might cause issues with create_model - safe_type = _make_type_safe_for_fastapi(param_type) - - if default_value is None: - field_definitions[param_name] = (safe_type, ...) # Required field - else: - field_definitions[param_name] = (safe_type, default_value) # Optional field with default - - # Create the request model dynamically - # Clean up the route name to create a valid schema name - clean_route = webmethod.route.replace("/", "_").replace("{", "").replace("}", "").replace("-", "_") - model_name = f"{clean_route}_Request" - - print(f"Debug: Creating model {model_name} with fields: {field_definitions}") - request_model = create_model(model_name, **field_definitions) - print(f"Debug: Successfully created model {model_name}") - - # Store the dynamic model in the global list for schema inclusion - _dynamic_models.append(request_model) - - # Create endpoint with request body - async def typed_endpoint(request: request_model) -> response_model: - """Typed endpoint for proper schema generation.""" - return response_model() - - # Set the function signature to ensure FastAPI recognizes the request model - typed_endpoint.__annotations__ = {"request": request_model, "return": response_model} - - endpoint_func = typed_endpoint - except Exception as e: - # If dynamic model creation fails, fall back to query parameters - print(f"Warning: Failed to create dynamic request model for {webmethod.route}: {e}") - print(f" Query parameters: {query_parameters}") - # Fall through to the query parameter handling - pass - - if not is_post_put: - # GET with query parameters - create a function with the actual query parameters - def create_query_endpoint_func(): - # Build the function signature dynamically - import inspect - - # Create parameter annotations - param_annotations = {} - param_defaults = {} - - for param_name, param_type, default_value in query_parameters: - # Handle problematic type annotations that cause FastAPI issues - safe_type = _make_type_safe_for_fastapi(param_type) - param_annotations[param_name] = safe_type - if default_value is not None: - param_defaults[param_name] = default_value - - # Create the function with the correct signature - def create_endpoint_func(): - # Sort parameters so that required parameters come before optional ones - # Parameters with None default are required, others are optional - sorted_params = sorted( - query_parameters, - key=lambda x: (x[2] is not None, x[0]), # False (required) comes before True (optional) - ) - - # Create the function signature - sig = inspect.Signature( - [ - inspect.Parameter( - name=param_name, - kind=inspect.Parameter.POSITIONAL_OR_KEYWORD, - default=default_value if default_value is not None else inspect.Parameter.empty, - annotation=param_annotations[param_name], - ) - for param_name, param_type, default_value in sorted_params - ] - ) - - # Create a simple function without **kwargs - async def query_endpoint(): - """Query endpoint for proper schema generation.""" - return response_model() - - # Set the signature and annotations - query_endpoint.__signature__ = sig - query_endpoint.__annotations__ = param_annotations - - return query_endpoint - - return create_endpoint_func() - - endpoint_func = create_query_endpoint_func() - elif response_model: - # Response-only endpoint (no parameters) - async def response_only_endpoint() -> response_model: - """Response-only endpoint for proper schema generation.""" - return response_model() - - endpoint_func = response_only_endpoint - else: - # Fallback to generic endpoint - async def generic_endpoint(*args, **kwargs): - """Generic endpoint - this would be replaced with actual implementation.""" - return {"message": f"Endpoint {name} not implemented in OpenAPI generator"} - - endpoint_func = generic_endpoint - - # Add the endpoint to the FastAPI app - is_deprecated = webmethod.deprecated or False - route_kwargs = { - "name": name, - "tags": [_get_tag_from_api(webmethod)], - "deprecated": is_deprecated, - "responses": { - 200: { - "description": response_description, - "content": { - "application/json": { - "schema": {"$ref": f"#/components/schemas/{response_model.__name__}"} if response_model else {} - } - }, - }, - 400: {"$ref": "#/components/responses/BadRequest400"}, - 429: {"$ref": "#/components/responses/TooManyRequests429"}, - 500: {"$ref": "#/components/responses/InternalServerError500"}, - "default": {"$ref": "#/components/responses/DefaultError"}, - }, + # Map API enum values to their actual module names (for APIs where they differ) + api_module_map = { + "tool_runtime": "tools", + "tool_groups": "tools", } - if summary: - route_kwargs["summary"] = summary + imported_modules = set() + for api in apis_to_import: + module_name = api_module_map.get(api.value, api.value) # type: ignore[attr-defined] - for method in methods: - if method.upper() == "GET": - app.get(fastapi_path, **route_kwargs)(endpoint_func) - elif method.upper() == "POST": - app.post(fastapi_path, **route_kwargs)(endpoint_func) - elif method.upper() == "PUT": - app.put(fastapi_path, **route_kwargs)(endpoint_func) - elif method.upper() == "DELETE": - app.delete(fastapi_path, **route_kwargs)(endpoint_func) - elif method.upper() == "PATCH": - app.patch(fastapi_path, **route_kwargs)(endpoint_func) - - -def _extract_summary_from_docstring(webmethod) -> str | None: - """ - Extract summary from the actual function docstring. - The summary is typically the first non-empty line of the docstring, - before any :param:, :returns:, or other docstring field markers. - """ - func = getattr(webmethod, "func", None) - if not func: - return None - - docstring = func.__doc__ or "" - if not docstring: - return None - - lines = docstring.split("\n") - for line in lines: - line = line.strip() - if not line: + # Skip if we've already imported this module (e.g., both tool_runtime and tool_groups use 'tools') + if module_name in imported_modules: continue - if line.startswith(":param:") or line.startswith(":returns:") or line.startswith(":raises:"): - break - return line - return None - - -def _extract_response_description_from_docstring(webmethod, response_model) -> str: - """ - Extract response description from the actual function docstring. - Looks for :returns: in the docstring and uses that as the description. - """ - func = getattr(webmethod, "func", None) - if not func: - return "Successful Response" - - docstring = func.__doc__ or "" - - lines = docstring.split("\n") - for line in lines: - line = line.strip() - if line.startswith(":returns:"): - description = line[9:].strip() - if description: - return description - - return "Successful Response" - - -def _get_tag_from_api(webmethod) -> str: - """Extract a tag name from the webmethod for API grouping.""" - # Extract API name from the route path - if webmethod.level: - return webmethod.level.replace("/", "").title() - return "API" - - -def _find_models_for_endpoint(webmethod) -> tuple[type | None, type | None, list[tuple[str, type, Any]]]: - """ - Find appropriate request and response models for an endpoint by analyzing the actual function signature. - This uses the webmethod's function to determine the correct models dynamically. - - Returns: - tuple: (request_model, response_model, query_parameters) - where query_parameters is a list of (name, type, default_value) tuples - """ - try: - # Get the actual function from the webmethod - func = getattr(webmethod, "func", None) - if not func: - return None, None, [] - - # Analyze the function signature - sig = inspect.signature(func) - - # Find request model (first parameter that's not 'self') - request_model = None - query_parameters = [] - - for param_name, param in sig.parameters.items(): - if param_name == "self": - continue - - # Skip *args and **kwargs parameters - these are not real API parameters - if param.kind in (inspect.Parameter.VAR_POSITIONAL, inspect.Parameter.VAR_KEYWORD): - continue - - # Check if it's a Pydantic model (for POST/PUT requests) - param_type = param.annotation - if hasattr(param_type, "model_json_schema"): - request_model = param_type - break - elif get_origin(param_type) is Annotated: - # Handle Annotated types - get the base type - args = get_args(param_type) - if args and hasattr(args[0], "model_json_schema"): - request_model = args[0] - break - else: - # This is likely a query parameter for GET requests - # Store the parameter info for later use - default_value = param.default if param.default != inspect.Parameter.empty else None - - # Extract the base type from union types (e.g., str | None -> str) - # Also make it safe for FastAPI to avoid forward reference issues - base_type = _make_type_safe_for_fastapi(param_type) - query_parameters.append((param_name, base_type, default_value)) - - # Find response model from return annotation - response_model = None - return_annotation = sig.return_annotation - if return_annotation != inspect.Signature.empty: - if hasattr(return_annotation, "model_json_schema"): - response_model = return_annotation - elif get_origin(return_annotation) is Annotated: - # Handle Annotated return types - args = get_args(return_annotation) - if args: - # Check if the first argument is a Pydantic model - if hasattr(args[0], "model_json_schema"): - response_model = args[0] - # Check if the first argument is a union type - elif get_origin(args[0]) is type(args[0]): # Union type - union_args = get_args(args[0]) - for arg in union_args: - if hasattr(arg, "model_json_schema"): - response_model = arg - break - elif get_origin(return_annotation) is type(return_annotation): # Union type - # Handle union types - try to find the first Pydantic model - args = get_args(return_annotation) - for arg in args: - if hasattr(arg, "model_json_schema"): - response_model = arg - break - - return request_model, response_model, query_parameters - - except Exception: - # If we can't analyze the function signature, return None - return None, None, [] - - -def _make_type_safe_for_fastapi(type_hint) -> type: - """ - Make a type hint safe for FastAPI by converting problematic types to their base types. - This handles cases like Literal["24h"] that cause forward reference errors. - Also removes Union with None to avoid anyOf with type: 'null' schemas. - """ - # Handle Literal types that might cause issues - if hasattr(type_hint, "__origin__") and type_hint.__origin__ is Literal: - args = get_args(type_hint) - if args: - # Get the type of the first literal value - first_arg = args[0] - if isinstance(first_arg, str): - return str - elif isinstance(first_arg, int): - return int - elif isinstance(first_arg, float): - return float - elif isinstance(first_arg, bool): - return bool - else: - return type(first_arg) - - # Handle Union types (Python 3.10+ uses | syntax) - origin = get_origin(type_hint) - - if origin is type(None) or (origin is type and type_hint is type(None)): - # This is just None, return None - return type_hint - - # Handle Union types (both old Union and new | syntax) - if origin is type(type_hint) or (hasattr(type_hint, "__args__") and type_hint.__args__): - # This is a union type, find the non-None type - args = get_args(type_hint) - non_none_types = [arg for arg in args if arg is not type(None) and arg is not None] - - if non_none_types: - # Return the first non-None type to avoid anyOf with null - return non_none_types[0] - elif args: - # If all args are None, return the first one - return args[0] - else: - return type_hint + try: + importlib.import_module(f"llama_stack.apis.{module_name}") + imported_modules.add(module_name) + except ImportError: + print( + f"❌ Failed to import module {module_name}, this API will not be included in the OpenAPI specification" + ) + pass - # Not a union type, return as-is - return type_hint + # Import router registry + from llama_stack.core.server.routers import create_router, has_router + from llama_stack.providers.datatypes import Api + # Get all APIs that should be served + protocols = api_protocol_map() + apis_to_serve = set(protocols.keys()) -def _generate_schema_for_type(type_hint) -> dict[str, Any]: - """ - Generate a JSON schema for a given type hint. - This is a simplified version that handles basic types. - """ - # Handle Union types (e.g., str | None) - if get_origin(type_hint) is type(None) or (get_origin(type_hint) is type and type_hint is type(None)): - return {"type": "null"} - - # Handle list types - if get_origin(type_hint) is list: - args = get_args(type_hint) - if args: - item_type = args[0] - return {"type": "array", "items": _generate_schema_for_type(item_type)} - return {"type": "array"} - - # Handle basic types - if type_hint is str: - return {"type": "string"} - elif type_hint is int: - return {"type": "integer"} - elif type_hint is float: - return {"type": "number"} - elif type_hint is bool: - return {"type": "boolean"} - elif type_hint is dict: - return {"type": "object"} - elif type_hint is list: - return {"type": "array"} - - # For complex types, try to get the schema from Pydantic - try: - if hasattr(type_hint, "model_json_schema"): - return type_hint.model_json_schema() - elif hasattr(type_hint, "__name__"): - return {"$ref": f"#/components/schemas/{type_hint.__name__}"} - except Exception: + # Create a dummy impl_getter that returns a mock implementation + # This is only for OpenAPI generation, so we don't need real implementations + class MockImpl: pass - # Fallback - return {"type": "object"} - - -def _add_llama_stack_extensions(openapi_schema: dict[str, Any], app: FastAPI) -> dict[str, Any]: - """ - Add Llama Stack specific extensions to the OpenAPI schema. - This includes x-llama-stack-extra-body-params for ExtraBodyField parameters. - """ - # Get all API routes to find functions with ExtraBodyField parameters - api_routes = get_all_api_routes() - - for api_name, routes in api_routes.items(): - for route, webmethod in routes: - # Extract path and method - path = route.path - methods = route.methods - - for method in methods: - method_lower = method.lower() - if method_lower in openapi_schema.get("paths", {}).get(path, {}): - operation = openapi_schema["paths"][path][method_lower] + def impl_getter(api: Api) -> Any: + return MockImpl() - # Try to find the actual function that implements this route - # and extract its ExtraBodyField parameters - extra_body_params = _find_extra_body_params_for_route(api_name, route, webmethod) + # Register all routers - all APIs now use routers + for api in apis_to_serve: + if has_router(api): + router = create_router(api, impl_getter) + if router: + app.include_router(router) - if extra_body_params: - operation["x-llama-stack-extra-body-params"] = extra_body_params - - return openapi_schema - - -def _find_extra_body_params_for_route(api_name: str, route, webmethod) -> list[dict[str, Any]]: - """ - Find the actual function that implements a route and extract its ExtraBodyField parameters. - """ - try: - # Try to get the actual function from the API protocol map - from llama_stack.core.resolver import api_protocol_map - - # Look up the API implementation - if api_name in api_protocol_map: - _ = api_protocol_map[api_name] - - # Try to find the method that matches this route - # This is a simplified approach - we'd need to map the route to the actual method - # For now, we'll return an empty list to avoid hardcoding - return [] - - return [] - except Exception: - # If we can't find the function, return empty list - return [] + return app def _ensure_json_schema_types_included(openapi_schema: dict[str, Any]) -> dict[str, Any]: @@ -729,20 +150,6 @@ def _ensure_json_schema_types_included(openapi_schema: dict[str, Any]) -> dict[s except (AttributeError, TypeError): continue - # Also include any dynamic models that were created during endpoint generation - # This is a workaround to ensure dynamic models appear in the schema - global _dynamic_models - if "_dynamic_models" in globals(): - for model in _dynamic_models: - try: - schema_name = model.__name__ - if schema_name not in openapi_schema["components"]["schemas"]: - schema = model.model_json_schema() - openapi_schema["components"]["schemas"][schema_name] = schema - except Exception: - # Skip if we can't generate the schema - continue - return openapi_schema @@ -767,296 +174,6 @@ def fix_refs(obj: Any) -> None: return openapi_schema -def _fix_anyof_with_null(openapi_schema: dict[str, Any]) -> dict[str, Any]: - """ - Fix anyOf schemas that contain type: 'null' by removing the null type - and making the field optional through the required field instead. - """ - - def fix_anyof(obj: Any) -> None: - if isinstance(obj, dict): - if "anyOf" in obj and isinstance(obj["anyOf"], list): - # Check if anyOf contains type: 'null' - has_null = any(item.get("type") == "null" for item in obj["anyOf"] if isinstance(item, dict)) - if has_null: - # Remove null types and keep only the non-null types - non_null_types = [ - item for item in obj["anyOf"] if not (isinstance(item, dict) and item.get("type") == "null") - ] - if len(non_null_types) == 1: - # If only one non-null type remains, replace anyOf with that type - obj.update(non_null_types[0]) - if "anyOf" in obj: - del obj["anyOf"] - else: - # Keep the anyOf but without null types - obj["anyOf"] = non_null_types - - # Recursively process all values - for value in obj.values(): - fix_anyof(value) - elif isinstance(obj, list): - for item in obj: - fix_anyof(item) - - fix_anyof(openapi_schema) - return openapi_schema - - -def _eliminate_defs_section(openapi_schema: dict[str, Any]) -> dict[str, Any]: - """ - Eliminate $defs section entirely by moving all definitions to components/schemas. - This matches the structure of the old pyopenapi generator for oasdiff compatibility. - """ - if "components" not in openapi_schema: - openapi_schema["components"] = {} - - if "schemas" not in openapi_schema["components"]: - openapi_schema["components"]["schemas"] = {} - - # First pass: collect all $defs from anywhere in the schema - defs_to_move = {} - - def collect_defs(obj: Any) -> None: - if isinstance(obj, dict): - if "$defs" in obj: - # Collect $defs for later processing - for def_name, def_schema in obj["$defs"].items(): - if def_name not in defs_to_move: - defs_to_move[def_name] = def_schema - - # Recursively process all values - for value in obj.values(): - collect_defs(value) - elif isinstance(obj, list): - for item in obj: - collect_defs(item) - - # Collect all $defs - collect_defs(openapi_schema) - - # Move all $defs to components/schemas - for def_name, def_schema in defs_to_move.items(): - if def_name not in openapi_schema["components"]["schemas"]: - openapi_schema["components"]["schemas"][def_name] = def_schema - - # Also move any existing root-level $defs to components/schemas - if "$defs" in openapi_schema: - print(f"Found root-level $defs with {len(openapi_schema['$defs'])} items, moving to components/schemas") - for def_name, def_schema in openapi_schema["$defs"].items(): - if def_name not in openapi_schema["components"]["schemas"]: - openapi_schema["components"]["schemas"][def_name] = def_schema - # Remove the root-level $defs - del openapi_schema["$defs"] - - # Second pass: remove all $defs sections from anywhere in the schema - def remove_defs(obj: Any) -> None: - if isinstance(obj, dict): - if "$defs" in obj: - del obj["$defs"] - - # Recursively process all values - for value in obj.values(): - remove_defs(value) - elif isinstance(obj, list): - for item in obj: - remove_defs(item) - - # Remove all $defs sections - remove_defs(openapi_schema) - - return openapi_schema - - -def _add_error_responses(openapi_schema: dict[str, Any]) -> dict[str, Any]: - """ - Add standard error response definitions to the OpenAPI schema. - Uses the actual Error model from the codebase for consistency. - """ - if "components" not in openapi_schema: - openapi_schema["components"] = {} - - if "responses" not in openapi_schema["components"]: - openapi_schema["components"]["responses"] = {} - - # Import the actual Error model - try: - from llama_stack.apis.datatypes import Error - - # Generate the Error schema using Pydantic - error_schema = Error.model_json_schema() - - # Ensure the Error schema is in the components/schemas - if "schemas" not in openapi_schema["components"]: - openapi_schema["components"]["schemas"] = {} - - # Only add Error schema if it doesn't already exist - if "Error" not in openapi_schema["components"]["schemas"]: - openapi_schema["components"]["schemas"]["Error"] = error_schema - - except ImportError: - # Fallback if we can't import the Error model - error_schema = {"$ref": "#/components/schemas/Error"} - - # Define standard HTTP error responses - error_responses = { - 400: { - "name": "BadRequest400", - "description": "The request was invalid or malformed", - "example": {"status": 400, "title": "Bad Request", "detail": "The request was invalid or malformed"}, - }, - 429: { - "name": "TooManyRequests429", - "description": "The client has sent too many requests in a given amount of time", - "example": { - "status": 429, - "title": "Too Many Requests", - "detail": "You have exceeded the rate limit. Please try again later.", - }, - }, - 500: { - "name": "InternalServerError500", - "description": "The server encountered an unexpected error", - "example": { - "status": 500, - "title": "Internal Server Error", - "detail": "An unexpected error occurred. Our team has been notified.", - }, - }, - } - - # Add each error response to the schema - for _, error_info in error_responses.items(): - response_name = error_info["name"] - openapi_schema["components"]["responses"][response_name] = { - "description": error_info["description"], - "content": { - "application/json": {"schema": {"$ref": "#/components/schemas/Error"}, "example": error_info["example"]} - }, - } - - # Add a default error response - openapi_schema["components"]["responses"]["DefaultError"] = { - "description": "An unexpected error occurred", - "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}, - } - - return openapi_schema - - -def _fix_path_parameters(openapi_schema: dict[str, Any]) -> dict[str, Any]: - """ - Fix path parameter resolution issues by adding explicit parameter definitions. - Uses docstring descriptions if available. - """ - global _path_webmethod_map - - if "paths" not in openapi_schema: - return openapi_schema - - for path, path_item in openapi_schema["paths"].items(): - # Add parameters to each operation in this path - for method in ["get", "post", "put", "delete", "patch", "head", "options"]: - if method in path_item and isinstance(path_item[method], dict): - operation = path_item[method] - - # Get webmethod for this path/method to extract parameter descriptions - webmethod = _path_webmethod_map.get((path, method)) - - # Extract path parameters from the URL with descriptions from docstring - path_params = _extract_path_parameters(path, webmethod) - - if not path_params: - continue - - if "parameters" not in operation: - operation["parameters"] = [] - - # Separate path and non-path parameters - existing_params = operation["parameters"] - non_path_params = [p for p in existing_params if p.get("in") != "path"] - existing_path_params = {p.get("name"): p for p in existing_params if p.get("in") == "path"} - - # Build new parameters list: non-path params first, then path params in docstring order - new_params = non_path_params.copy() - - # Add path parameters in docstring order - for param in path_params: - param_name = param["name"] - if param_name in existing_path_params: - # Update existing parameter description if we have a better one - existing_param = existing_path_params[param_name] - if param["description"] != f"Path parameter: {param_name}": - existing_param["description"] = param["description"] - new_params.append(existing_param) - else: - # Add new path parameter - new_params.append(param) - - operation["parameters"] = new_params - - return openapi_schema - - -def _extract_first_line_from_description(description: str) -> str: - """ - Extract all lines from a description string that don't start with docstring keywords. - Stops at the first line that starts with :param:, :returns:, :raises:, etc. - Preserves multiple lines and formatting. - """ - if not description: - return description - - lines = description.split("\n") - description_lines = [] - - for line in lines: - stripped = line.strip() - if not stripped: - # Keep empty lines in the description to preserve formatting - description_lines.append(line) - continue - if ( - stripped.startswith(":param") - or stripped.startswith(":returns") - or stripped.startswith(":raises") - or (stripped.startswith(":") and len(stripped) > 1 and stripped[1].isalpha()) - ): - break - description_lines.append(line) - - # Join lines and strip trailing whitespace/newlines - result = "\n".join(description_lines).rstrip() - return result if result else description - - -def _fix_component_descriptions(openapi_schema: dict[str, Any]) -> dict[str, Any]: - """ - Fix component descriptions to only include the first line (summary), - removing :param:, :returns:, and other docstring directives. - """ - if "components" not in openapi_schema or "schemas" not in openapi_schema["components"]: - return openapi_schema - - schemas = openapi_schema["components"]["schemas"] - - def fix_description_in_schema(schema_def: dict[str, Any]) -> None: - if isinstance(schema_def, dict): - if "description" in schema_def and isinstance(schema_def["description"], str): - schema_def["description"] = _extract_first_line_from_description(schema_def["description"]) - - for value in schema_def.values(): - fix_description_in_schema(value) - elif isinstance(schema_def, list): - for item in schema_def: - fix_description_in_schema(item) - - for _, schema_def in schemas.items(): - fix_description_in_schema(schema_def) - - return openapi_schema - - def _fix_schema_issues(openapi_schema: dict[str, Any]) -> dict[str, Any]: """ Fix common schema issues that cause OpenAPI validation problems. @@ -1070,7 +187,6 @@ def _fix_schema_issues(openapi_schema: dict[str, Any]) -> dict[str, Any]: # Fix exclusiveMinimum issues for _, schema_def in schemas.items(): _fix_exclusive_minimum_in_schema(schema_def) - _fix_all_null_defaults(schema_def) return openapi_schema @@ -1102,32 +218,6 @@ def validate_openapi_schema(schema: dict[str, Any], schema_name: str = "OpenAPI return False -def validate_schema_file(file_path: Path) -> bool: - """ - Validate an OpenAPI schema file (YAML or JSON). - - Args: - file_path: Path to the schema file - - Returns: - True if valid, False otherwise - """ - try: - with open(file_path) as f: - if file_path.suffix.lower() in [".yaml", ".yml"]: - schema = yaml.safe_load(f) - elif file_path.suffix.lower() == ".json": - schema = json.load(f) - else: - print(f"❌ Unsupported file format: {file_path.suffix}") - return False - - return validate_openapi_schema(schema, str(file_path)) - except Exception as e: - print(f"❌ Failed to read {file_path}: {e}") - return False - - def _fix_exclusive_minimum_in_schema(obj: Any) -> None: """ Recursively fix exclusiveMinimum issues in a schema object. @@ -1150,73 +240,37 @@ def _fix_exclusive_minimum_in_schema(obj: Any) -> None: _fix_exclusive_minimum_in_schema(item) -def _fix_string_fields_with_null_defaults(obj: Any) -> None: - """ - Recursively fix string fields that have default: null. - This violates OpenAPI spec - string fields should either have a string default or be optional. - """ - if isinstance(obj, dict): - # Check if this is a field definition with type: string and default: null - if obj.get("type") == "string" and "default" in obj and obj["default"] is None: - # Remove the default: null to make the field optional - del obj["default"] - # Add nullable: true to indicate the field can be null - obj["nullable"] = True - - # Recursively process all values - for value in obj.values(): - _fix_string_fields_with_null_defaults(value) - - elif isinstance(obj, list): - # Recursively process all items - for item in obj: - _fix_string_fields_with_null_defaults(item) - - -def _fix_anyof_with_null_defaults(obj: Any) -> None: - """ - Recursively fix anyOf schemas that have default: null. - This violates OpenAPI spec - anyOf fields should not have null defaults. +def _get_path_version(path: str) -> str | None: """ - if isinstance(obj, dict): - # Check if this is a field definition with anyOf and default: null - if "anyOf" in obj and "default" in obj and obj["default"] is None: - # Remove the default: null to make the field optional - del obj["default"] - # Add nullable: true to indicate the field can be null - obj["nullable"] = True + Determine the API version of a path based on its prefix. - # Recursively process all values - for value in obj.values(): - _fix_anyof_with_null_defaults(value) + Args: + path: The API path (e.g., "/v1/datasets", "/v1beta/models") - elif isinstance(obj, list): - # Recursively process all items - for item in obj: - _fix_anyof_with_null_defaults(item) + Returns: + Version string ("v1", "v1alpha", "v1beta") or None if no recognized version + """ + if path.startswith("/" + LLAMA_STACK_API_V1BETA): + return "v1beta" + elif path.startswith("/" + LLAMA_STACK_API_V1ALPHA): + return "v1alpha" + elif path.startswith("/" + LLAMA_STACK_API_V1): + return "v1" + return None -def _fix_all_null_defaults(obj: Any) -> None: - """ - Recursively fix all field types that have default: null. - This violates OpenAPI spec - fields should not have null defaults. - """ - if isinstance(obj, dict): - # Check if this is a field definition with default: null - if "default" in obj and obj["default"] is None: - # Remove the default: null to make the field optional - del obj["default"] - # Add nullable: true to indicate the field can be null - obj["nullable"] = True +def _is_stable_path(path: str) -> bool: + """Check if a path is a stable v1 path (not experimental).""" + return ( + path.startswith("/" + LLAMA_STACK_API_V1) + and not path.startswith("/" + LLAMA_STACK_API_V1ALPHA) + and not path.startswith("/" + LLAMA_STACK_API_V1BETA) + ) - # Recursively process all values - for value in obj.values(): - _fix_all_null_defaults(value) - elif isinstance(obj, list): - # Recursively process all items - for item in obj: - _fix_all_null_defaults(item) +def _is_experimental_path(path: str) -> bool: + """Check if a path is experimental (v1alpha or v1beta).""" + return path.startswith("/" + LLAMA_STACK_API_V1ALPHA) or path.startswith("/" + LLAMA_STACK_API_V1BETA) def _sort_paths_alphabetically(openapi_schema: dict[str, Any]) -> dict[str, Any]: @@ -1237,15 +291,9 @@ def path_sort_key(path: str) -> tuple: - 2 for v1 - 3 for others """ - if path.startswith("/v1beta/"): - version_priority = 0 - elif path.startswith("/v1alpha/"): - version_priority = 1 - elif path.startswith("/v1/"): - version_priority = 2 - else: - version_priority = 3 - + version = _get_path_version(path) + version_priority_map = {LLAMA_STACK_API_V1BETA: 0, LLAMA_STACK_API_V1ALPHA: 1, LLAMA_STACK_API_V1: 2} + version_priority = version_priority_map.get(version, 3) if version else 3 return (version_priority, path) def sort_path_item(path_item: dict[str, Any]) -> dict[str, Any]: @@ -1282,16 +330,52 @@ def sort_path_item(path_item: dict[str, Any]) -> dict[str, Any]: return openapi_schema -def _filter_schema_by_version( - openapi_schema: dict[str, Any], stable_only: bool = True, exclude_deprecated: bool = True +def _should_include_path( + path: str, path_item: dict[str, Any], include_stable: bool, include_experimental: bool, exclude_deprecated: bool +) -> bool: + """ + Determine if a path should be included in the filtered schema. + + Args: + path: The API path + path_item: The path item from OpenAPI schema + include_stable: Whether to include stable v1 paths + include_experimental: Whether to include experimental (v1alpha/v1beta) paths + exclude_deprecated: Whether to exclude deprecated endpoints + + Returns: + True if the path should be included + """ + if exclude_deprecated and _is_path_deprecated(path_item): + return False + + is_stable = _is_stable_path(path) + is_experimental = _is_experimental_path(path) + + if is_stable and include_stable: + return True + if is_experimental and include_experimental: + return True + + return False + + +def _filter_schema( + openapi_schema: dict[str, Any], + include_stable: bool = True, + include_experimental: bool = False, + deprecated_mode: str = "exclude", + filter_schemas: bool = True, ) -> dict[str, Any]: """ - Filter OpenAPI schema by API version. + Filter OpenAPI schema by version and deprecated status. Args: openapi_schema: The full OpenAPI schema - stable_only: If True, return only /v1/ paths (stable). If False, return only /v1alpha/ and /v1beta/ paths (experimental). - exclude_deprecated: If True, exclude deprecated endpoints from the result. + include_stable: Whether to include stable v1 paths + include_experimental: Whether to include experimental (v1alpha/v1beta) paths + deprecated_mode: One of "include", "exclude", or "only" + filter_schemas: Whether to filter components/schemas to only referenced ones Returns: Filtered OpenAPI schema @@ -1301,49 +385,44 @@ def _filter_schema_by_version( if "paths" not in filtered_schema: return filtered_schema - # Filter paths based on version prefix and deprecated status + # Determine deprecated filtering logic + if deprecated_mode == "only": + exclude_deprecated = False + include_deprecated_only = True + elif deprecated_mode == "exclude": + exclude_deprecated = True + include_deprecated_only = False + else: # "include" + exclude_deprecated = False + include_deprecated_only = False + + # Filter paths filtered_paths = {} for path, path_item in filtered_schema["paths"].items(): - # Check if path has any deprecated operations is_deprecated = _is_path_deprecated(path_item) - # Skip deprecated endpoints if exclude_deprecated is True - if exclude_deprecated and is_deprecated: - continue - - if stable_only: - # Only include /v1/ paths, exclude /v1alpha/ and /v1beta/ - if path.startswith("/v1/") and not path.startswith("/v1alpha/") and not path.startswith("/v1beta/"): - filtered_paths[path] = path_item - else: - # Only include /v1alpha/ and /v1beta/ paths, exclude /v1/ - if path.startswith("/v1alpha/") or path.startswith("/v1beta/"): + if include_deprecated_only: + if is_deprecated: filtered_paths[path] = path_item + elif _should_include_path(path, path_item, include_stable, include_experimental, exclude_deprecated): + filtered_paths[path] = path_item filtered_schema["paths"] = filtered_paths - # Filter schemas/components to only include ones referenced by filtered paths - if "components" in filtered_schema and "schemas" in filtered_schema["components"]: - # Find all schemas that are actually referenced by the filtered paths - # Use the original schema to find all references, not the filtered one + # Filter schemas/components if requested + if filter_schemas and "components" in filtered_schema and "schemas" in filtered_schema["components"]: referenced_schemas = _find_schemas_referenced_by_paths(filtered_paths, openapi_schema) - - # Only keep schemas that are referenced by the filtered paths - filtered_schemas = {} - for schema_name, schema_def in filtered_schema["components"]["schemas"].items(): - if schema_name in referenced_schemas: - filtered_schemas[schema_name] = schema_def - - filtered_schema["components"]["schemas"] = filtered_schemas + filtered_schema["components"]["schemas"] = { + name: schema + for name, schema in filtered_schema["components"]["schemas"].items() + if name in referenced_schemas + } # Preserve $defs section if it exists if "components" in openapi_schema and "$defs" in openapi_schema["components"]: if "components" not in filtered_schema: filtered_schema["components"] = {} filtered_schema["components"]["$defs"] = openapi_schema["components"]["$defs"] - print(f"Preserved $defs section with {len(openapi_schema['components']['$defs'])} items") - else: - print("No $defs section to preserve") return filtered_schema @@ -1432,78 +511,12 @@ def _is_path_deprecated(path_item: dict[str, Any]) -> bool: return False -def _filter_deprecated_schema(openapi_schema: dict[str, Any]) -> dict[str, Any]: - """ - Filter OpenAPI schema to include only deprecated endpoints. - Includes all deprecated endpoints regardless of version (v1, v1alpha, v1beta). - """ - filtered_schema = openapi_schema.copy() - - if "paths" not in filtered_schema: - return filtered_schema - - # Filter paths to only include deprecated ones - filtered_paths = {} - for path, path_item in filtered_schema["paths"].items(): - if _is_path_deprecated(path_item): - filtered_paths[path] = path_item - - filtered_schema["paths"] = filtered_paths - - return filtered_schema - - -def _filter_combined_schema(openapi_schema: dict[str, Any]) -> dict[str, Any]: - """ - Filter OpenAPI schema to include both stable (v1) and experimental (v1alpha, v1beta) APIs. - Excludes deprecated endpoints. This is used for the combined "stainless" spec. - """ - filtered_schema = openapi_schema.copy() - - if "paths" not in filtered_schema: - return filtered_schema - - # Filter paths to include stable (v1) and experimental (v1alpha, v1beta), excluding deprecated - filtered_paths = {} - for path, path_item in filtered_schema["paths"].items(): - # Check if path has any deprecated operations - is_deprecated = _is_path_deprecated(path_item) - - # Skip deprecated endpoints - if is_deprecated: - continue - - # Include /v1/ paths (stable) - if path.startswith("/v1/") and not path.startswith("/v1alpha/") and not path.startswith("/v1beta/"): - filtered_paths[path] = path_item - # Include /v1alpha/ and /v1beta/ paths (experimental) - elif path.startswith("/v1alpha/") or path.startswith("/v1beta/"): - filtered_paths[path] = path_item - - filtered_schema["paths"] = filtered_paths - - # Filter schemas/components to only include ones referenced by filtered paths - if "components" in filtered_schema and "schemas" in filtered_schema["components"]: - referenced_schemas = _find_schemas_referenced_by_paths(filtered_paths, openapi_schema) - - filtered_schemas = {} - for schema_name, schema_def in filtered_schema["components"]["schemas"].items(): - if schema_name in referenced_schemas: - filtered_schemas[schema_name] = schema_def - - filtered_schema["components"]["schemas"] = filtered_schemas - - return filtered_schema - - -def generate_openapi_spec(output_dir: str, format: str = "yaml", include_examples: bool = True) -> dict[str, Any]: +def generate_openapi_spec(output_dir: str) -> dict[str, Any]: """ Generate OpenAPI specification using FastAPI's built-in method. Args: output_dir: Directory to save the generated files - format: Output format ("yaml", "json", or "both") - include_examples: Whether to include examples in the spec Returns: The generated OpenAPI specification as a dictionary @@ -1520,88 +533,32 @@ def generate_openapi_spec(output_dir: str, format: str = "yaml", include_example servers=app.servers, ) - # Debug: Check if there's a root-level $defs in the original schema - if "$defs" in openapi_schema: - print(f"Original schema has root-level $defs with {len(openapi_schema['$defs'])} items") - else: - print("Original schema has no root-level $defs") - - # Add Llama Stack specific extensions - openapi_schema = _add_llama_stack_extensions(openapi_schema, app) - - # Add standard error responses - openapi_schema = _add_error_responses(openapi_schema) - # Ensure all @json_schema_type decorated models are included openapi_schema = _ensure_json_schema_types_included(openapi_schema) # Fix $ref references to point to components/schemas instead of $defs openapi_schema = _fix_ref_references(openapi_schema) - # Debug: Check if there are any $ref references to $defs in the schema - defs_refs = [] - - def find_defs_refs(obj: Any, path: str = "") -> None: - if isinstance(obj, dict): - if "$ref" in obj and obj["$ref"].startswith("#/$defs/"): - defs_refs.append(f"{path}: {obj['$ref']}") - for key, value in obj.items(): - find_defs_refs(value, f"{path}.{key}" if path else key) - elif isinstance(obj, list): - for i, item in enumerate(obj): - find_defs_refs(item, f"{path}[{i}]") - - find_defs_refs(openapi_schema) - if defs_refs: - print(f"Found {len(defs_refs)} $ref references to $defs in schema") - for ref in defs_refs[:5]: # Show first 5 - print(f" {ref}") - else: - print("No $ref references to $defs found in schema") - - # Note: Let Pydantic/FastAPI generate the correct, standards-compliant schema - # Fields with default values should be optional according to OpenAPI standards - - # Fix anyOf schemas with type: 'null' to avoid oasdiff errors - openapi_schema = _fix_anyof_with_null(openapi_schema) - - # Fix path parameter resolution issues - openapi_schema = _fix_path_parameters(openapi_schema) - - # Eliminate $defs section entirely for oasdiff compatibility - openapi_schema = _eliminate_defs_section(openapi_schema) - - # Fix component descriptions to only include first line (summary) - openapi_schema = _fix_component_descriptions(openapi_schema) - - # Debug: Check if there's a root-level $defs after flattening - if "$defs" in openapi_schema: - print(f"After flattening: root-level $defs with {len(openapi_schema['$defs'])} items") - else: - print("After flattening: no root-level $defs") - - # Ensure all referenced schemas are included - # DISABLED: This was using hardcoded schema generation. FastAPI should handle this automatically. - # openapi_schema = _ensure_referenced_schemas(openapi_schema) - - # Control schema registration based on @json_schema_type decorator - # Temporarily disabled to fix missing schema issues - # openapi_schema = _control_schema_registration(openapi_schema) - - # Fix malformed schemas after all other processing - # DISABLED: This was a hardcoded workaround. Using Pydantic's TypeAdapter instead. - # _fix_malformed_schemas(openapi_schema) - # Split into stable (v1 only), experimental (v1alpha + v1beta), deprecated, and combined (stainless) specs # Each spec needs its own deep copy of the full schema to avoid cross-contamination import copy - stable_schema = _filter_schema_by_version(copy.deepcopy(openapi_schema), stable_only=True, exclude_deprecated=True) - experimental_schema = _filter_schema_by_version( - copy.deepcopy(openapi_schema), stable_only=False, exclude_deprecated=True + stable_schema = _filter_schema( + copy.deepcopy(openapi_schema), include_stable=True, include_experimental=False, deprecated_mode="exclude" + ) + experimental_schema = _filter_schema( + copy.deepcopy(openapi_schema), include_stable=False, include_experimental=True, deprecated_mode="exclude" + ) + deprecated_schema = _filter_schema( + copy.deepcopy(openapi_schema), + include_stable=True, + include_experimental=True, + deprecated_mode="only", + filter_schemas=False, + ) + combined_schema = _filter_schema( + copy.deepcopy(openapi_schema), include_stable=True, include_experimental=True, deprecated_mode="exclude" ) - deprecated_schema = _filter_deprecated_schema(copy.deepcopy(openapi_schema)) - combined_schema = _filter_combined_schema(copy.deepcopy(openapi_schema)) # Update title and description for combined schema if "info" in combined_schema: @@ -1628,251 +585,95 @@ def find_defs_refs(obj: Any, path: str = "") -> None: combined_schema = _fix_schema_issues(combined_schema) # Validate the schemas - print("\n🔍 Validating generated schemas...") - stable_valid = validate_openapi_schema(stable_schema, "Stable schema") - experimental_valid = validate_openapi_schema(experimental_schema, "Experimental schema") - deprecated_valid = validate_openapi_schema(deprecated_schema, "Deprecated schema") - combined_valid = validate_openapi_schema(combined_schema, "Combined (stainless) schema") - - if not all([stable_valid, experimental_valid, deprecated_valid, combined_valid]): - print("⚠️ Some schemas failed validation, but continuing with generation...") - - # Add any custom modifications here if needed - if include_examples: - # Add examples to the schema if needed - pass + validate_openapi_schema(stable_schema, "Stable schema") + validate_openapi_schema(experimental_schema, "Experimental schema") + validate_openapi_schema(deprecated_schema, "Deprecated schema") + validate_openapi_schema(combined_schema, "Combined (stainless) schema") # Ensure output directory exists output_path = Path(output_dir) output_path.mkdir(parents=True, exist_ok=True) # Save the stable specification - if format in ["yaml", "both"]: - yaml_path = output_path / "llama-stack-spec.yaml" + yaml_path = output_path / "llama-stack-spec.yaml" - # Use ruamel.yaml for better YAML formatting - try: - from ruamel.yaml import YAML + # Use ruamel.yaml for better YAML formatting + try: + from ruamel.yaml import YAML - yaml_writer = YAML() - yaml_writer.default_flow_style = False - yaml_writer.sort_keys = False - yaml_writer.width = 4096 # Prevent line wrapping - yaml_writer.allow_unicode = True + yaml_writer = YAML() + yaml_writer.default_flow_style = False + yaml_writer.sort_keys = False + yaml_writer.width = 4096 # Prevent line wrapping + yaml_writer.allow_unicode = True - with open(yaml_path, "w") as f: - yaml_writer.dump(stable_schema, f) + with open(yaml_path, "w") as f: + yaml_writer.dump(stable_schema, f) - # Post-process the YAML file to remove $defs section and fix references - # Re-read and re-write with ruamel.yaml - with open(yaml_path) as f: - yaml_content = f.read() - - if " $defs:" in yaml_content or "#/$defs/" in yaml_content: - print("Post-processing YAML to remove $defs section") - - # Use string replacement to fix references directly - if "#/$defs/" in yaml_content: - refs_fixed = yaml_content.count("#/$defs/") - yaml_content = yaml_content.replace("#/$defs/", "#/components/schemas/") - print(f"Fixed {refs_fixed} $ref references using string replacement") - - # Parse using PyYAML safe_load first to avoid issues with custom types - # This handles block scalars better during post-processing - import yaml as pyyaml - - with open(yaml_path) as f: - yaml_data = pyyaml.safe_load(f) - - # Move $defs to components/schemas if it exists - if "$defs" in yaml_data: - print(f"Found $defs section with {len(yaml_data['$defs'])} items") - if "components" not in yaml_data: - yaml_data["components"] = {} - if "schemas" not in yaml_data["components"]: - yaml_data["components"]["schemas"] = {} - - # Move all $defs to components/schemas - for def_name, def_schema in yaml_data["$defs"].items(): - yaml_data["components"]["schemas"][def_name] = def_schema - - # Remove the $defs section - del yaml_data["$defs"] - print("Moved $defs to components/schemas") - - # Write the modified YAML back with ruamel.yaml - with open(yaml_path, "w") as f: - yaml_writer.dump(yaml_data, f) - print("Updated YAML file") - except ImportError: - # Fallback to standard yaml if ruamel.yaml is not available - with open(yaml_path, "w") as f: - yaml.dump(stable_schema, f, default_flow_style=False, sort_keys=False) + # Post-process the YAML file to remove $defs section and fix references + # Re-read and re-write with ruamel.yaml + with open(yaml_path) as f: + yaml_content = f.read() - print(f"✅ Generated YAML (stable): {yaml_path}") + if "#/$defs/" in yaml_content: + yaml_content = yaml_content.replace("#/$defs/", "#/components/schemas/") + import yaml as pyyaml - experimental_yaml_path = output_path / "experimental-llama-stack-spec.yaml" - with open(experimental_yaml_path, "w") as f: - yaml.dump(experimental_schema, f, default_flow_style=False, sort_keys=False) - print(f"✅ Generated YAML (experimental): {experimental_yaml_path}") + with open(yaml_path) as f: + yaml_data = pyyaml.safe_load(f) - deprecated_yaml_path = output_path / "deprecated-llama-stack-spec.yaml" - with open(deprecated_yaml_path, "w") as f: - yaml.dump(deprecated_schema, f, default_flow_style=False, sort_keys=False) - print(f"✅ Generated YAML (deprecated): {deprecated_yaml_path}") + if "$defs" in yaml_data: + if "components" not in yaml_data: + yaml_data["components"] = {} + if "schemas" not in yaml_data["components"]: + yaml_data["components"]["schemas"] = {} + yaml_data["components"]["schemas"].update(yaml_data["$defs"]) + del yaml_data["$defs"] - # Generate combined (stainless) spec - stainless_yaml_path = output_path / "stainless-llama-stack-spec.yaml" + with open(yaml_path, "w") as f: + yaml_writer.dump(yaml_data, f) + except ImportError: + # Fallback to standard yaml if ruamel.yaml is not available + with open(yaml_path, "w") as f: + yaml.dump(stable_schema, f, default_flow_style=False, sort_keys=False) + + for name, schema in [ + ("experimental", experimental_schema), + ("deprecated", deprecated_schema), + ("stainless", combined_schema), + ]: + file_path = output_path / f"{name}-llama-stack-spec.yaml" try: from ruamel.yaml import YAML yaml_writer = YAML() yaml_writer.default_flow_style = False yaml_writer.sort_keys = False - yaml_writer.width = 4096 # Prevent line wrapping + yaml_writer.width = 4096 yaml_writer.allow_unicode = True - - with open(stainless_yaml_path, "w") as f: - yaml_writer.dump(combined_schema, f) + with open(file_path, "w") as f: + yaml_writer.dump(schema, f) except ImportError: - # Fallback to standard yaml if ruamel.yaml is not available - with open(stainless_yaml_path, "w") as f: - yaml.dump(combined_schema, f, default_flow_style=False, sort_keys=False) - print(f"✅ Generated YAML (stainless/combined): {stainless_yaml_path}") - - if format in ["json", "both"]: - json_path = output_path / "llama-stack-spec.json" - with open(json_path, "w") as f: - json.dump(stable_schema, f, indent=2) - print(f"✅ Generated JSON (stable): {json_path}") - - experimental_json_path = output_path / "experimental-llama-stack-spec.json" - with open(experimental_json_path, "w") as f: - json.dump(experimental_schema, f, indent=2) - print(f"✅ Generated JSON (experimental): {experimental_json_path}") - - deprecated_json_path = output_path / "deprecated-llama-stack-spec.json" - with open(deprecated_json_path, "w") as f: - json.dump(deprecated_schema, f, indent=2) - print(f"✅ Generated JSON (deprecated): {deprecated_json_path}") - - stainless_json_path = output_path / "stainless-llama-stack-spec.json" - with open(stainless_json_path, "w") as f: - json.dump(combined_schema, f, indent=2) - print(f"✅ Generated JSON (stainless/combined): {stainless_json_path}") - - # Generate HTML documentation - html_path = output_path / "llama-stack-spec.html" - generate_html_docs(stable_schema, html_path) - print(f"✅ Generated HTML: {html_path}") - - experimental_html_path = output_path / "experimental-llama-stack-spec.html" - generate_html_docs(experimental_schema, experimental_html_path, spec_file="experimental-llama-stack-spec.yaml") - print(f"✅ Generated HTML (experimental): {experimental_html_path}") - - deprecated_html_path = output_path / "deprecated-llama-stack-spec.html" - generate_html_docs(deprecated_schema, deprecated_html_path, spec_file="deprecated-llama-stack-spec.yaml") - print(f"✅ Generated HTML (deprecated): {deprecated_html_path}") - - stainless_html_path = output_path / "stainless-llama-stack-spec.html" - generate_html_docs(combined_schema, stainless_html_path, spec_file="stainless-llama-stack-spec.yaml") - print(f"✅ Generated HTML (stainless/combined): {stainless_html_path}") + with open(file_path, "w") as f: + yaml.dump(schema, f, default_flow_style=False, sort_keys=False) return stable_schema -def generate_html_docs( - openapi_schema: dict[str, Any], output_path: Path, spec_file: str = "llama-stack-spec.yaml" -) -> None: - """Generate HTML documentation using ReDoc.""" - html_template = f""" - - - - Llama Stack API Documentation - - - - - - - - - - - """.strip() - - with open(output_path, "w") as f: - f.write(html_template + "\n") - - def main(): """Main entry point for the FastAPI OpenAPI generator.""" import argparse parser = argparse.ArgumentParser(description="Generate OpenAPI specification using FastAPI") parser.add_argument("output_dir", help="Output directory for generated files") - parser.add_argument("--format", choices=["yaml", "json", "both"], default="both", help="Output format") - parser.add_argument("--no-examples", action="store_true", help="Exclude examples from the specification") - parser.add_argument( - "--validate-only", action="store_true", help="Only validate existing schema files, don't generate new ones" - ) - parser.add_argument("--validate-file", help="Validate a specific schema file") args = parser.parse_args() - # Handle validation-only mode - if args.validate_only or args.validate_file: - if args.validate_file: - # Validate a specific file - file_path = Path(args.validate_file) - if not file_path.exists(): - print(f"❌ File not found: {file_path}") - return 1 - - print(f"🔍 Validating {file_path}...") - is_valid = validate_schema_file(file_path) - return 0 if is_valid else 1 - else: - # Validate all schema files in output directory - output_path = Path(args.output_dir) - if not output_path.exists(): - print(f"❌ Output directory not found: {output_path}") - return 1 - - print(f"🔍 Validating all schema files in {output_path}...") - schema_files = ( - list(output_path.glob("*.yaml")) + list(output_path.glob("*.yml")) + list(output_path.glob("*.json")) - ) - - if not schema_files: - print("❌ No schema files found to validate") - return 1 - - all_valid = True - for schema_file in schema_files: - print(f"\n📄 Validating {schema_file.name}...") - is_valid = validate_schema_file(schema_file) - if not is_valid: - all_valid = False - - if all_valid: - print("\n✅ All schema files are valid!") - return 0 - else: - print("\n❌ Some schema files failed validation") - return 1 - print("🚀 Generating OpenAPI specification using FastAPI...") print(f"📁 Output directory: {args.output_dir}") - print(f"📄 Format: {args.format}") try: - openapi_schema = generate_openapi_spec( - output_dir=args.output_dir, format=args.format, include_examples=not args.no_examples - ) + openapi_schema = generate_openapi_spec(output_dir=args.output_dir) print("\n✅ OpenAPI specification generated successfully!") print(f"📊 Schemas: {len(openapi_schema.get('components', {}).get('schemas', {}))}") diff --git a/scripts/validate_openapi.py b/scripts/validate_openapi.py index ddc88f0f8d..c7bc95b60f 100755 --- a/scripts/validate_openapi.py +++ b/scripts/validate_openapi.py @@ -15,6 +15,7 @@ import argparse import json import sys +import traceback from pathlib import Path from typing import Any @@ -44,6 +45,8 @@ def validate_openapi_schema(schema: dict[str, Any], schema_name: str = "OpenAPI return False except Exception as e: print(f"❌ {schema_name} validation error: {e}") + print(" Traceback:") + traceback.print_exc() return False diff --git a/src/llama_stack/apis/agents/__init__.py b/src/llama_stack/apis/agents/__init__.py index 6416b283b8..d35374fc1a 100644 --- a/src/llama_stack/apis/agents/__init__.py +++ b/src/llama_stack/apis/agents/__init__.py @@ -4,4 +4,108 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .agents import * +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .agents_service import AgentsService +from .models import ( + Agent, + AgentConfig, + AgentConfigCommon, + AgentConfigOverridablePerTurn, + AgentCreateResponse, + AgentSessionCreateResponse, + AgentStepResponse, + AgentToolGroup, + AgentToolGroupWithArgs, + AgentTurnCreateRequest, + AgentTurnResponseEvent, + AgentTurnResponseEventPayload, + AgentTurnResponseEventType, + AgentTurnResponseStepCompletePayload, + AgentTurnResponseStepProgressPayload, + AgentTurnResponseStepStartPayload, + AgentTurnResponseStreamChunk, + AgentTurnResponseTurnAwaitingInputPayload, + AgentTurnResponseTurnCompletePayload, + AgentTurnResponseTurnStartPayload, + AgentTurnResumeRequest, + Attachment, + CreateAgentSessionRequest, + CreateOpenAIResponseRequest, + Document, + InferenceStep, + MemoryRetrievalStep, + ResponseGuardrail, + ResponseGuardrailSpec, + Session, + ShieldCallStep, + Step, + StepCommon, + StepType, + ToolExecutionStep, + Turn, +) +from .openai_responses import ( + ListOpenAIResponseInputItem, + ListOpenAIResponseObject, + OpenAIDeleteResponseObject, + OpenAIResponseInput, + OpenAIResponseInputTool, + OpenAIResponseObject, + OpenAIResponseObjectStream, + OpenAIResponsePrompt, + OpenAIResponseText, +) + +# Backward compatibility - export Agents as alias for AgentsService +Agents = AgentsService + +__all__ = [ + "Agents", + "AgentsService", + "Agent", + "AgentConfig", + "AgentConfigCommon", + "AgentConfigOverridablePerTurn", + "AgentCreateResponse", + "AgentSessionCreateResponse", + "AgentStepResponse", + "AgentToolGroup", + "AgentToolGroupWithArgs", + "AgentTurnCreateRequest", + "AgentTurnResumeRequest", + "AgentTurnResponseEvent", + "AgentTurnResponseEventPayload", + "AgentTurnResponseEventType", + "AgentTurnResponseStepCompletePayload", + "AgentTurnResponseStepProgressPayload", + "AgentTurnResponseStepStartPayload", + "AgentTurnResponseStreamChunk", + "AgentTurnResponseTurnAwaitingInputPayload", + "AgentTurnResponseTurnCompletePayload", + "AgentTurnResponseTurnStartPayload", + "Attachment", + "CreateAgentSessionRequest", + "CreateOpenAIResponseRequest", + "Document", + "InferenceStep", + "MemoryRetrievalStep", + "ResponseGuardrail", + "ResponseGuardrailSpec", + "Session", + "ShieldCallStep", + "Step", + "StepCommon", + "StepType", + "ToolExecutionStep", + "Turn", + "ListOpenAIResponseInputItem", + "ListOpenAIResponseObject", + "OpenAIDeleteResponseObject", + "OpenAIResponseInput", + "OpenAIResponseInputTool", + "OpenAIResponseObject", + "OpenAIResponseObjectStream", + "OpenAIResponsePrompt", + "OpenAIResponseText", +] diff --git a/src/llama_stack/apis/agents/agents.py b/src/llama_stack/apis/agents/agents.py deleted file mode 100644 index 365766c420..0000000000 --- a/src/llama_stack/apis/agents/agents.py +++ /dev/null @@ -1,814 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -from collections.abc import AsyncIterator -from datetime import datetime -from enum import StrEnum -from typing import Annotated, Any, Literal, Protocol, runtime_checkable - -from pydantic import BaseModel, ConfigDict, Field - -from llama_stack.apis.common.content_types import URL, ContentDelta, InterleavedContent -from llama_stack.apis.common.responses import Order, PaginatedResponse -from llama_stack.apis.inference import ( - CompletionMessage, - ResponseFormat, - SamplingParams, - ToolCall, - ToolChoice, - ToolConfig, - ToolPromptFormat, - ToolResponse, - ToolResponseMessage, - UserMessage, -) -from llama_stack.apis.safety import SafetyViolation -from llama_stack.apis.tools import ToolDef -from llama_stack.apis.version import LLAMA_STACK_API_V1, LLAMA_STACK_API_V1ALPHA -from llama_stack.schema_utils import ExtraBodyField, json_schema_type, register_schema, webmethod - -from .openai_responses import ( - ListOpenAIResponseInputItem, - ListOpenAIResponseObject, - OpenAIDeleteResponseObject, - OpenAIResponseInput, - OpenAIResponseInputTool, - OpenAIResponseObject, - OpenAIResponseObjectStream, - OpenAIResponsePrompt, - OpenAIResponseText, -) - - -@json_schema_type -class ResponseGuardrailSpec(BaseModel): - """Specification for a guardrail to apply during response generation. - - :param type: The type/identifier of the guardrail. - """ - - type: str - # TODO: more fields to be added for guardrail configuration - - -ResponseGuardrail = str | ResponseGuardrailSpec - - -class Attachment(BaseModel): - """An attachment to an agent turn. - - :param content: The content of the attachment. - :param mime_type: The MIME type of the attachment. - """ - - content: InterleavedContent | URL - mime_type: str - - -class Document(BaseModel): - """A document to be used by an agent. - - :param content: The content of the document. - :param mime_type: The MIME type of the document. - """ - - content: InterleavedContent | URL - mime_type: str - - -class StepCommon(BaseModel): - """A common step in an agent turn. - - :param turn_id: The ID of the turn. - :param step_id: The ID of the step. - :param started_at: The time the step started. - :param completed_at: The time the step completed. - """ - - turn_id: str - step_id: str - started_at: datetime | None = None - completed_at: datetime | None = None - - -class StepType(StrEnum): - """Type of the step in an agent turn. - - :cvar inference: The step is an inference step that calls an LLM. - :cvar tool_execution: The step is a tool execution step that executes a tool call. - :cvar shield_call: The step is a shield call step that checks for safety violations. - :cvar memory_retrieval: The step is a memory retrieval step that retrieves context for vector dbs. - """ - - inference = "inference" - tool_execution = "tool_execution" - shield_call = "shield_call" - memory_retrieval = "memory_retrieval" - - -@json_schema_type -class InferenceStep(StepCommon): - """An inference step in an agent turn. - - :param model_response: The response from the LLM. - """ - - model_config = ConfigDict(protected_namespaces=()) - - step_type: Literal[StepType.inference] = StepType.inference - model_response: CompletionMessage - - -@json_schema_type -class ToolExecutionStep(StepCommon): - """A tool execution step in an agent turn. - - :param tool_calls: The tool calls to execute. - :param tool_responses: The tool responses from the tool calls. - """ - - step_type: Literal[StepType.tool_execution] = StepType.tool_execution - tool_calls: list[ToolCall] - tool_responses: list[ToolResponse] - - -@json_schema_type -class ShieldCallStep(StepCommon): - """A shield call step in an agent turn. - - :param violation: The violation from the shield call. - """ - - step_type: Literal[StepType.shield_call] = StepType.shield_call - violation: SafetyViolation | None - - -@json_schema_type -class MemoryRetrievalStep(StepCommon): - """A memory retrieval step in an agent turn. - - :param vector_store_ids: The IDs of the vector databases to retrieve context from. - :param inserted_context: The context retrieved from the vector databases. - """ - - step_type: Literal[StepType.memory_retrieval] = StepType.memory_retrieval - # TODO: should this be List[str]? - vector_store_ids: str - inserted_context: InterleavedContent - - -Step = Annotated[ - InferenceStep | ToolExecutionStep | ShieldCallStep | MemoryRetrievalStep, - Field(discriminator="step_type"), -] - - -@json_schema_type -class Turn(BaseModel): - """A single turn in an interaction with an Agentic System. - - :param turn_id: Unique identifier for the turn within a session - :param session_id: Unique identifier for the conversation session - :param input_messages: List of messages that initiated this turn - :param steps: Ordered list of processing steps executed during this turn - :param output_message: The model's generated response containing content and metadata - :param output_attachments: (Optional) Files or media attached to the agent's response - :param started_at: Timestamp when the turn began - :param completed_at: (Optional) Timestamp when the turn finished, if completed - """ - - turn_id: str - session_id: str - input_messages: list[UserMessage | ToolResponseMessage] - steps: list[Step] - output_message: CompletionMessage - output_attachments: list[Attachment] | None = Field(default_factory=lambda: []) - - started_at: datetime - completed_at: datetime | None = None - - -@json_schema_type -class Session(BaseModel): - """A single session of an interaction with an Agentic System. - - :param session_id: Unique identifier for the conversation session - :param session_name: Human-readable name for the session - :param turns: List of all turns that have occurred in this session - :param started_at: Timestamp when the session was created - """ - - session_id: str - session_name: str - turns: list[Turn] - started_at: datetime - - -class AgentToolGroupWithArgs(BaseModel): - name: str - args: dict[str, Any] - - -AgentToolGroup = str | AgentToolGroupWithArgs -register_schema(AgentToolGroup, name="AgentTool") - - -class AgentConfigCommon(BaseModel): - sampling_params: SamplingParams | None = Field(default_factory=SamplingParams) - - input_shields: list[str] | None = Field(default_factory=lambda: []) - output_shields: list[str] | None = Field(default_factory=lambda: []) - toolgroups: list[AgentToolGroup] | None = Field(default_factory=lambda: []) - client_tools: list[ToolDef] | None = Field(default_factory=lambda: []) - tool_choice: ToolChoice | None = Field(default=None, deprecated="use tool_config instead") - tool_prompt_format: ToolPromptFormat | None = Field(default=None, deprecated="use tool_config instead") - tool_config: ToolConfig | None = Field(default=None) - - max_infer_iters: int | None = 10 - - def model_post_init(self, __context): - if self.tool_config: - if self.tool_choice and self.tool_config.tool_choice != self.tool_choice: - raise ValueError("tool_choice is deprecated. Use tool_choice in tool_config instead.") - if self.tool_prompt_format and self.tool_config.tool_prompt_format != self.tool_prompt_format: - raise ValueError("tool_prompt_format is deprecated. Use tool_prompt_format in tool_config instead.") - else: - params = {} - if self.tool_choice: - params["tool_choice"] = self.tool_choice - if self.tool_prompt_format: - params["tool_prompt_format"] = self.tool_prompt_format - self.tool_config = ToolConfig(**params) - - -@json_schema_type -class AgentConfig(AgentConfigCommon): - """Configuration for an agent. - - :param model: The model identifier to use for the agent - :param instructions: The system instructions for the agent - :param name: Optional name for the agent, used in telemetry and identification - :param enable_session_persistence: Optional flag indicating whether session data has to be persisted - :param response_format: Optional response format configuration - """ - - model: str - instructions: str - name: str | None = None - enable_session_persistence: bool | None = False - response_format: ResponseFormat | None = None - - -@json_schema_type -class Agent(BaseModel): - """An agent instance with configuration and metadata. - - :param agent_id: Unique identifier for the agent - :param agent_config: Configuration settings for the agent - :param created_at: Timestamp when the agent was created - """ - - agent_id: str - agent_config: AgentConfig - created_at: datetime - - -class AgentConfigOverridablePerTurn(AgentConfigCommon): - instructions: str | None = None - - -class AgentTurnResponseEventType(StrEnum): - step_start = "step_start" - step_complete = "step_complete" - step_progress = "step_progress" - - turn_start = "turn_start" - turn_complete = "turn_complete" - turn_awaiting_input = "turn_awaiting_input" - - -@json_schema_type -class AgentTurnResponseStepStartPayload(BaseModel): - """Payload for step start events in agent turn responses. - - :param event_type: Type of event being reported - :param step_type: Type of step being executed - :param step_id: Unique identifier for the step within a turn - :param metadata: (Optional) Additional metadata for the step - """ - - event_type: Literal[AgentTurnResponseEventType.step_start] = AgentTurnResponseEventType.step_start - step_type: StepType - step_id: str - metadata: dict[str, Any] | None = Field(default_factory=lambda: {}) - - -@json_schema_type -class AgentTurnResponseStepCompletePayload(BaseModel): - """Payload for step completion events in agent turn responses. - - :param event_type: Type of event being reported - :param step_type: Type of step being executed - :param step_id: Unique identifier for the step within a turn - :param step_details: Complete details of the executed step - """ - - event_type: Literal[AgentTurnResponseEventType.step_complete] = AgentTurnResponseEventType.step_complete - step_type: StepType - step_id: str - step_details: Step - - -@json_schema_type -class AgentTurnResponseStepProgressPayload(BaseModel): - """Payload for step progress events in agent turn responses. - - :param event_type: Type of event being reported - :param step_type: Type of step being executed - :param step_id: Unique identifier for the step within a turn - :param delta: Incremental content changes during step execution - """ - - model_config = ConfigDict(protected_namespaces=()) - - event_type: Literal[AgentTurnResponseEventType.step_progress] = AgentTurnResponseEventType.step_progress - step_type: StepType - step_id: str - - delta: ContentDelta - - -@json_schema_type -class AgentTurnResponseTurnStartPayload(BaseModel): - """Payload for turn start events in agent turn responses. - - :param event_type: Type of event being reported - :param turn_id: Unique identifier for the turn within a session - """ - - event_type: Literal[AgentTurnResponseEventType.turn_start] = AgentTurnResponseEventType.turn_start - turn_id: str - - -@json_schema_type -class AgentTurnResponseTurnCompletePayload(BaseModel): - """Payload for turn completion events in agent turn responses. - - :param event_type: Type of event being reported - :param turn: Complete turn data including all steps and results - """ - - event_type: Literal[AgentTurnResponseEventType.turn_complete] = AgentTurnResponseEventType.turn_complete - turn: Turn - - -@json_schema_type -class AgentTurnResponseTurnAwaitingInputPayload(BaseModel): - """Payload for turn awaiting input events in agent turn responses. - - :param event_type: Type of event being reported - :param turn: Turn data when waiting for external tool responses - """ - - event_type: Literal[AgentTurnResponseEventType.turn_awaiting_input] = AgentTurnResponseEventType.turn_awaiting_input - turn: Turn - - -AgentTurnResponseEventPayload = Annotated[ - AgentTurnResponseStepStartPayload - | AgentTurnResponseStepProgressPayload - | AgentTurnResponseStepCompletePayload - | AgentTurnResponseTurnStartPayload - | AgentTurnResponseTurnCompletePayload - | AgentTurnResponseTurnAwaitingInputPayload, - Field(discriminator="event_type"), -] -register_schema(AgentTurnResponseEventPayload, name="AgentTurnResponseEventPayload") - - -@json_schema_type -class AgentTurnResponseEvent(BaseModel): - """An event in an agent turn response stream. - - :param payload: Event-specific payload containing event data - """ - - payload: AgentTurnResponseEventPayload - - -@json_schema_type -class AgentCreateResponse(BaseModel): - """Response returned when creating a new agent. - - :param agent_id: Unique identifier for the created agent - """ - - agent_id: str - - -@json_schema_type -class AgentSessionCreateResponse(BaseModel): - """Response returned when creating a new agent session. - - :param session_id: Unique identifier for the created session - """ - - session_id: str - - -@json_schema_type -class AgentTurnCreateRequest(AgentConfigOverridablePerTurn): - """Request to create a new turn for an agent. - - :param agent_id: Unique identifier for the agent - :param session_id: Unique identifier for the conversation session - :param messages: List of messages to start the turn with - :param documents: (Optional) List of documents to provide to the agent - :param toolgroups: (Optional) List of tool groups to make available for this turn - :param stream: (Optional) Whether to stream the response - :param tool_config: (Optional) Tool configuration to override agent defaults - """ - - agent_id: str - session_id: str - - # TODO: figure out how we can simplify this and make why - # ToolResponseMessage needs to be here (it is function call - # execution from outside the system) - messages: list[UserMessage | ToolResponseMessage] - - documents: list[Document] | None = None - toolgroups: list[AgentToolGroup] | None = Field(default_factory=lambda: []) - - stream: bool | None = False - tool_config: ToolConfig | None = None - - -@json_schema_type -class AgentTurnResumeRequest(BaseModel): - """Request to resume an agent turn with tool responses. - - :param agent_id: Unique identifier for the agent - :param session_id: Unique identifier for the conversation session - :param turn_id: Unique identifier for the turn within a session - :param tool_responses: List of tool responses to submit to continue the turn - :param stream: (Optional) Whether to stream the response - """ - - agent_id: str - session_id: str - turn_id: str - tool_responses: list[ToolResponse] - stream: bool | None = False - - -@json_schema_type -class AgentTurnResponseStreamChunk(BaseModel): - """Streamed agent turn completion response. - - :param event: Individual event in the agent turn response stream - """ - - event: AgentTurnResponseEvent - - -@json_schema_type -class AgentStepResponse(BaseModel): - """Response containing details of a specific agent step. - - :param step: The complete step data and execution details - """ - - step: Step - - -@runtime_checkable -class Agents(Protocol): - """Agents - - APIs for creating and interacting with agentic systems.""" - - @webmethod( - route="/agents", - method="POST", - descriptive_name="create_agent", - level=LLAMA_STACK_API_V1ALPHA, - ) - async def create_agent( - self, - agent_config: AgentConfig, - ) -> AgentCreateResponse: - """Create an agent with the given configuration. - - :param agent_config: The configuration for the agent. - :returns: An AgentCreateResponse with the agent ID. - """ - ... - - @webmethod( - route="/agents/{agent_id}/session/{session_id}/turn", - method="POST", - descriptive_name="create_agent_turn", - level=LLAMA_STACK_API_V1ALPHA, - ) - async def create_agent_turn( - self, - agent_id: str, - session_id: str, - messages: list[UserMessage | ToolResponseMessage], - stream: bool | None = False, - documents: list[Document] | None = None, - toolgroups: list[AgentToolGroup] | None = None, - tool_config: ToolConfig | None = None, - ) -> Turn | AsyncIterator[AgentTurnResponseStreamChunk]: - """Create a new turn for an agent. - - :param agent_id: The ID of the agent to create the turn for. - :param session_id: The ID of the session to create the turn for. - :param messages: List of messages to start the turn with. - :param stream: (Optional) If True, generate an SSE event stream of the response. Defaults to False. - :param documents: (Optional) List of documents to create the turn with. - :param toolgroups: (Optional) List of toolgroups to create the turn with, will be used in addition to the agent's config toolgroups for the request. - :param tool_config: (Optional) The tool configuration to create the turn with, will be used to override the agent's tool_config. - :returns: If stream=False, returns a Turn object. - If stream=True, returns an SSE event stream of AgentTurnResponseStreamChunk. - """ - ... - - @webmethod( - route="/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume", - method="POST", - descriptive_name="resume_agent_turn", - level=LLAMA_STACK_API_V1ALPHA, - ) - async def resume_agent_turn( - self, - agent_id: str, - session_id: str, - turn_id: str, - tool_responses: list[ToolResponse], - stream: bool | None = False, - ) -> Turn | AsyncIterator[AgentTurnResponseStreamChunk]: - """Resume an agent turn with executed tool call responses. - - When a Turn has the status `awaiting_input` due to pending input from client side tool calls, this endpoint can be used to submit the outputs from the tool calls once they are ready. - - :param agent_id: The ID of the agent to resume. - :param session_id: The ID of the session to resume. - :param turn_id: The ID of the turn to resume. - :param tool_responses: The tool call responses to resume the turn with. - :param stream: Whether to stream the response. - :returns: A Turn object if stream is False, otherwise an AsyncIterator of AgentTurnResponseStreamChunk objects. - """ - ... - - @webmethod( - route="/agents/{agent_id}/session/{session_id}/turn/{turn_id}", - method="GET", - level=LLAMA_STACK_API_V1ALPHA, - ) - async def get_agents_turn( - self, - agent_id: str, - session_id: str, - turn_id: str, - ) -> Turn: - """Retrieve an agent turn by its ID. - - :param agent_id: The ID of the agent to get the turn for. - :param session_id: The ID of the session to get the turn for. - :param turn_id: The ID of the turn to get. - :returns: A Turn. - """ - ... - - @webmethod( - route="/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}", - method="GET", - level=LLAMA_STACK_API_V1ALPHA, - ) - async def get_agents_step( - self, - agent_id: str, - session_id: str, - turn_id: str, - step_id: str, - ) -> AgentStepResponse: - """Retrieve an agent step by its ID. - - :param agent_id: The ID of the agent to get the step for. - :param session_id: The ID of the session to get the step for. - :param turn_id: The ID of the turn to get the step for. - :param step_id: The ID of the step to get. - :returns: An AgentStepResponse. - """ - ... - - @webmethod( - route="/agents/{agent_id}/session", - method="POST", - descriptive_name="create_agent_session", - level=LLAMA_STACK_API_V1ALPHA, - ) - async def create_agent_session( - self, - agent_id: str, - session_name: str, - ) -> AgentSessionCreateResponse: - """Create a new session for an agent. - - :param agent_id: The ID of the agent to create the session for. - :param session_name: The name of the session to create. - :returns: An AgentSessionCreateResponse. - """ - ... - - @webmethod( - route="/agents/{agent_id}/session/{session_id}", - method="GET", - level=LLAMA_STACK_API_V1ALPHA, - ) - async def get_agents_session( - self, - session_id: str, - agent_id: str, - turn_ids: list[str] | None = None, - ) -> Session: - """Retrieve an agent session by its ID. - - :param session_id: The ID of the session to get. - :param agent_id: The ID of the agent to get the session for. - :param turn_ids: (Optional) List of turn IDs to filter the session by. - :returns: A Session. - """ - ... - - @webmethod( - route="/agents/{agent_id}/session/{session_id}", - method="DELETE", - level=LLAMA_STACK_API_V1ALPHA, - ) - async def delete_agents_session( - self, - session_id: str, - agent_id: str, - ) -> None: - """Delete an agent session by its ID and its associated turns. - - :param session_id: The ID of the session to delete. - :param agent_id: The ID of the agent to delete the session for. - """ - ... - - @webmethod(route="/agents/{agent_id}", method="DELETE", level=LLAMA_STACK_API_V1ALPHA) - async def delete_agent( - self, - agent_id: str, - ) -> None: - """Delete an agent by its ID and its associated sessions and turns. - - :param agent_id: The ID of the agent to delete. - """ - ... - - @webmethod(route="/agents", method="GET", level=LLAMA_STACK_API_V1ALPHA) - async def list_agents(self, start_index: int | None = None, limit: int | None = None) -> PaginatedResponse: - """List all agents. - - :param start_index: The index to start the pagination from. - :param limit: The number of agents to return. - :returns: A PaginatedResponse. - """ - ... - - @webmethod(route="/agents/{agent_id}", method="GET", level=LLAMA_STACK_API_V1ALPHA) - async def get_agent(self, agent_id: str) -> Agent: - """Describe an agent by its ID. - - :param agent_id: ID of the agent. - :returns: An Agent of the agent. - """ - ... - - @webmethod(route="/agents/{agent_id}/sessions", method="GET", level=LLAMA_STACK_API_V1ALPHA) - async def list_agent_sessions( - self, - agent_id: str, - start_index: int | None = None, - limit: int | None = None, - ) -> PaginatedResponse: - """List all session(s) of a given agent. - - :param agent_id: The ID of the agent to list sessions for. - :param start_index: The index to start the pagination from. - :param limit: The number of sessions to return. - :returns: A PaginatedResponse. - """ - ... - - # We situate the OpenAI Responses API in the Agents API just like we did things - # for Inference. The Responses API, in its intent, serves the same purpose as - # the Agents API above -- it is essentially a lightweight "agentic loop" with - # integrated tool calling. - # - # Both of these APIs are inherently stateful. - - @webmethod(route="/responses/{response_id}", method="GET", level=LLAMA_STACK_API_V1) - async def get_openai_response( - self, - response_id: str, - ) -> OpenAIResponseObject: - """Get a model response. - - :param response_id: The ID of the OpenAI response to retrieve. - :returns: An OpenAIResponseObject. - """ - ... - - @webmethod(route="/responses", method="POST", level=LLAMA_STACK_API_V1) - async def create_openai_response( - self, - input: str | list[OpenAIResponseInput], - model: str, - prompt: OpenAIResponsePrompt | None = None, - instructions: str | None = None, - previous_response_id: str | None = None, - conversation: str | None = None, - store: bool | None = True, - stream: bool | None = False, - temperature: float | None = None, - text: OpenAIResponseText | None = None, - tools: list[OpenAIResponseInputTool] | None = None, - include: list[str] | None = None, - max_infer_iters: int | None = 10, # this is an extension to the OpenAI API - guardrails: Annotated[ - list[ResponseGuardrail] | None, - ExtraBodyField( - "List of guardrails to apply during response generation. Guardrails provide safety and content moderation." - ), - ] = None, - ) -> OpenAIResponseObject | AsyncIterator[OpenAIResponseObjectStream]: - """Create a model response. - - :param input: Input message(s) to create the response. - :param model: The underlying LLM used for completions. - :param prompt: (Optional) Prompt object with ID, version, and variables. - :param previous_response_id: (Optional) if specified, the new response will be a continuation of the previous response. This can be used to easily fork-off new responses from existing responses. - :param conversation: (Optional) The ID of a conversation to add the response to. Must begin with 'conv_'. Input and output messages will be automatically added to the conversation. - :param include: (Optional) Additional fields to include in the response. - :param guardrails: (Optional) List of guardrails to apply during response generation. Can be guardrail IDs (strings) or guardrail specifications. - :returns: An OpenAIResponseObject. - """ - ... - - @webmethod(route="/responses", method="GET", level=LLAMA_STACK_API_V1) - async def list_openai_responses( - self, - after: str | None = None, - limit: int | None = 50, - model: str | None = None, - order: Order | None = Order.desc, - ) -> ListOpenAIResponseObject: - """List all responses. - - :param after: The ID of the last response to return. - :param limit: The number of responses to return. - :param model: The model to filter responses by. - :param order: The order to sort responses by when sorted by created_at ('asc' or 'desc'). - :returns: A ListOpenAIResponseObject. - """ - ... - - @webmethod(route="/responses/{response_id}/input_items", method="GET", level=LLAMA_STACK_API_V1) - async def list_openai_response_input_items( - self, - response_id: str, - after: str | None = None, - before: str | None = None, - include: list[str] | None = None, - limit: int | None = 20, - order: Order | None = Order.desc, - ) -> ListOpenAIResponseInputItem: - """List input items. - - :param response_id: The ID of the response to retrieve input items for. - :param after: An item ID to list items after, used for pagination. - :param before: An item ID to list items before, used for pagination. - :param include: Additional fields to include in the response. - :param limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - :param order: The order to return the input items in. Default is desc. - :returns: An ListOpenAIResponseInputItem. - """ - ... - - @webmethod(route="/responses/{response_id}", method="DELETE", level=LLAMA_STACK_API_V1) - async def delete_openai_response(self, response_id: str) -> OpenAIDeleteResponseObject: - """Delete a response. - - :param response_id: The ID of the OpenAI response to delete. - :returns: An OpenAIDeleteResponseObject - """ - ... diff --git a/src/llama_stack/apis/agents/agents_service.py b/src/llama_stack/apis/agents/agents_service.py new file mode 100644 index 0000000000..0c5e61a1d2 --- /dev/null +++ b/src/llama_stack/apis/agents/agents_service.py @@ -0,0 +1,308 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from collections.abc import AsyncIterator +from typing import Annotated, Protocol, runtime_checkable + +from llama_stack.apis.common.responses import Order, PaginatedResponse +from llama_stack.apis.inference import ToolConfig, ToolResponse, ToolResponseMessage, UserMessage +from llama_stack.core.telemetry.trace_protocol import trace_protocol +from llama_stack.schema_utils import ExtraBodyField + +from .models import ( + Agent, + AgentConfig, + AgentCreateResponse, + AgentSessionCreateResponse, + AgentStepResponse, + AgentToolGroup, + AgentTurnResponseStreamChunk, + Document, + ResponseGuardrail, + Session, + Turn, +) +from .openai_responses import ( + ListOpenAIResponseInputItem, + ListOpenAIResponseObject, + OpenAIDeleteResponseObject, + OpenAIResponseInput, + OpenAIResponseInputTool, + OpenAIResponseObject, + OpenAIResponseObjectStream, + OpenAIResponsePrompt, + OpenAIResponseText, +) + + +@runtime_checkable +@trace_protocol +class AgentsService(Protocol): + """Agents + + APIs for creating and interacting with agentic systems.""" + + async def create_agent( + self, + agent_config: AgentConfig, + ) -> AgentCreateResponse: + """Create an agent with the given configuration. + + :param agent_config: The configuration for the agent. + :returns: An AgentCreateResponse with the agent ID. + """ + ... + + async def create_agent_turn( + self, + agent_id: str, + session_id: str, + messages: list[UserMessage | ToolResponseMessage], + stream: bool | None = False, + documents: list[Document] | None = None, + toolgroups: list[AgentToolGroup] | None = None, + tool_config: ToolConfig | None = None, + ) -> Turn | AsyncIterator[AgentTurnResponseStreamChunk]: + """Create a new turn for an agent. + + :param agent_id: The ID of the agent to create the turn for. + :param session_id: The ID of the session to create the turn for. + :param messages: List of messages to start the turn with. + :param stream: (Optional) If True, generate an SSE event stream of the response. Defaults to False. + :param documents: (Optional) List of documents to create the turn with. + :param toolgroups: (Optional) List of toolgroups to create the turn with, will be used in addition to the agent's config toolgroups for the request. + :param tool_config: (Optional) The tool configuration to create the turn with, will be used to override the agent's tool_config. + :returns: If stream=False, returns a Turn object. + If stream=True, returns an SSE event stream of AgentTurnResponseStreamChunk. + """ + ... + + async def resume_agent_turn( + self, + agent_id: str, + session_id: str, + turn_id: str, + tool_responses: list[ToolResponse], + stream: bool | None = False, + ) -> Turn | AsyncIterator[AgentTurnResponseStreamChunk]: + """Resume an agent turn with executed tool call responses. + + When a Turn has the status `awaiting_input` due to pending input from client side tool calls, this endpoint can be used to submit the outputs from the tool calls once they are ready. + + :param agent_id: The ID of the agent to resume. + :param session_id: The ID of the session to resume. + :param turn_id: The ID of the turn to resume. + :param tool_responses: The tool call responses to resume the turn with. + :param stream: Whether to stream the response. + :returns: A Turn object if stream is False, otherwise an AsyncIterator of AgentTurnResponseStreamChunk objects. + """ + ... + + async def get_agents_turn( + self, + agent_id: str, + session_id: str, + turn_id: str, + ) -> Turn: + """Retrieve an agent turn by its ID. + + :param agent_id: The ID of the agent to get the turn for. + :param session_id: The ID of the session to get the turn for. + :param turn_id: The ID of the turn to get. + :returns: A Turn. + """ + ... + + async def get_agents_step( + self, + agent_id: str, + session_id: str, + turn_id: str, + step_id: str, + ) -> AgentStepResponse: + """Retrieve an agent step by its ID. + + :param agent_id: The ID of the agent to get the step for. + :param session_id: The ID of the session to get the step for. + :param turn_id: The ID of the turn to get the step for. + :param step_id: The ID of the step to get. + :returns: An AgentStepResponse. + """ + ... + + async def create_agent_session( + self, + agent_id: str, + session_name: str, + ) -> AgentSessionCreateResponse: + """Create a new session for an agent. + + :param agent_id: The ID of the agent to create the session for. + :param session_name: The name of the session to create. + :returns: An AgentSessionCreateResponse. + """ + ... + + async def get_agents_session( + self, + session_id: str, + agent_id: str, + turn_ids: list[str] | None = None, + ) -> Session: + """Retrieve an agent session by its ID. + + :param session_id: The ID of the session to get. + :param agent_id: The ID of the agent to get the session for. + :param turn_ids: (Optional) List of turn IDs to filter the session by. + :returns: A Session. + """ + ... + + async def delete_agents_session( + self, + session_id: str, + agent_id: str, + ) -> None: + """Delete an agent session by its ID and its associated turns. + + :param session_id: The ID of the session to delete. + :param agent_id: The ID of the agent to delete the session for. + """ + ... + + async def delete_agent( + self, + agent_id: str, + ) -> None: + """Delete an agent by its ID and its associated sessions and turns. + + :param agent_id: The ID of the agent to delete. + """ + ... + + async def list_agents(self, start_index: int | None = None, limit: int | None = None) -> PaginatedResponse: + """List all agents. + + :param start_index: The index to start the pagination from. + :param limit: The number of agents to return. + :returns: A PaginatedResponse. + """ + ... + + async def get_agent(self, agent_id: str) -> Agent: + """Describe an agent by its ID. + + :param agent_id: ID of the agent. + :returns: An Agent of the agent. + """ + ... + + async def list_agent_sessions( + self, + agent_id: str, + start_index: int | None = None, + limit: int | None = None, + ) -> PaginatedResponse: + """List all session(s) of a given agent. + + :param agent_id: The ID of the agent to list sessions for. + :param start_index: The index to start the pagination from. + :param limit: The number of sessions to return. + :returns: A PaginatedResponse. + """ + ... + + async def get_openai_response( + self, + response_id: str, + ) -> OpenAIResponseObject: + """Get a model response. + + :param response_id: The ID of the OpenAI response to retrieve. + :returns: An OpenAIResponseObject. + """ + ... + + async def create_openai_response( + self, + input: str | list[OpenAIResponseInput], + model: str, + prompt: OpenAIResponsePrompt | None = None, + instructions: str | None = None, + previous_response_id: str | None = None, + conversation: str | None = None, + store: bool | None = True, + stream: bool | None = False, + temperature: float | None = None, + text: OpenAIResponseText | None = None, + tools: list[OpenAIResponseInputTool] | None = None, + include: list[str] | None = None, + max_infer_iters: int | None = 10, + guardrails: Annotated[ + list[ResponseGuardrail] | None, + ExtraBodyField( + "List of guardrails to apply during response generation. Guardrails provide safety and content moderation." + ), + ] = None, + ) -> OpenAIResponseObject | AsyncIterator[OpenAIResponseObjectStream]: + """Create a model response. + + :param input: Input message(s) to create the response. + :param model: The underlying LLM used for completions. + :param prompt: (Optional) Prompt object with ID, version, and variables. + :param previous_response_id: (Optional) if specified, the new response will be a continuation of the previous response. This can be used to easily fork-off new responses from existing responses. + :param conversation: (Optional) The ID of a conversation to add the response to. Must begin with 'conv_'. Input and output messages will be automatically added to the conversation. + :param include: (Optional) Additional fields to include in the response. + :param guardrails: (Optional) List of guardrails to apply during response generation. Can be guardrail IDs (strings) or guardrail specifications. + :returns: An OpenAIResponseObject. + """ + ... + + async def list_openai_responses( + self, + after: str | None = None, + limit: int | None = 50, + model: str | None = None, + order: Order | None = Order.desc, + ) -> ListOpenAIResponseObject: + """List all responses. + + :param after: The ID of the last response to return. + :param limit: The number of responses to return. + :param model: The model to filter responses by. + :param order: The order to sort responses by when sorted by created_at ('asc' or 'desc'). + :returns: A ListOpenAIResponseObject. + """ + ... + + async def list_openai_response_input_items( + self, + response_id: str, + after: str | None = None, + before: str | None = None, + include: list[str] | None = None, + limit: int | None = 20, + order: Order | None = Order.desc, + ) -> ListOpenAIResponseInputItem: + """List input items. + + :param response_id: The ID of the response to retrieve input items for. + :param after: An item ID to list items after, used for pagination. + :param before: An item ID to list items before, used for pagination. + :param include: Additional fields to include in the response. + :param limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + :param order: The order to return the input items in. Default is desc. + :returns: An ListOpenAIResponseInputItem. + """ + ... + + async def delete_openai_response(self, response_id: str) -> OpenAIDeleteResponseObject: + """Delete a response. + + :param response_id: The ID of the OpenAI response to delete. + :returns: An OpenAIDeleteResponseObject + """ + ... diff --git a/src/llama_stack/apis/agents/models.py b/src/llama_stack/apis/agents/models.py new file mode 100644 index 0000000000..633e736f78 --- /dev/null +++ b/src/llama_stack/apis/agents/models.py @@ -0,0 +1,409 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from datetime import datetime +from enum import StrEnum +from typing import Annotated, Any, Literal + +from pydantic import BaseModel, ConfigDict, Field + +from llama_stack.apis.common.content_types import URL, ContentDelta, InterleavedContent +from llama_stack.apis.inference import ( + CompletionMessage, + ResponseFormat, + SamplingParams, + ToolCall, + ToolChoice, + ToolConfig, + ToolPromptFormat, + ToolResponse, + ToolResponseMessage, + UserMessage, +) +from llama_stack.apis.safety import SafetyViolation +from llama_stack.apis.tools import ToolDef +from llama_stack.schema_utils import json_schema_type, register_schema + +from .openai_responses import ( + OpenAIResponseInput, + OpenAIResponseInputTool, + OpenAIResponsePrompt, + OpenAIResponseText, +) + + +@json_schema_type +class ResponseGuardrailSpec(BaseModel): + """Specification for a guardrail to apply during response generation.""" + + type: str = Field(description="The type/identifier of the guardrail.") + # TODO: more fields to be added for guardrail configuration + + +ResponseGuardrail = str | ResponseGuardrailSpec + + +class Attachment(BaseModel): + """An attachment to an agent turn.""" + + content: InterleavedContent | URL = Field(description="The content of the attachment.") + mime_type: str = Field(description="The MIME type of the attachment.") + + +class Document(BaseModel): + """A document to be used by an agent.""" + + content: InterleavedContent | URL = Field(description="The content of the document.") + mime_type: str = Field(description="The MIME type of the document.") + + +class StepCommon(BaseModel): + """A common step in an agent turn.""" + + turn_id: str = Field(description="The ID of the turn.") + step_id: str = Field(description="The ID of the step.") + started_at: datetime | None = Field(default=None, description="The time the step started.") + completed_at: datetime | None = Field(default=None, description="The time the step completed.") + + +class StepType(StrEnum): + """Type of the step in an agent turn.""" + + inference = "inference" + tool_execution = "tool_execution" + shield_call = "shield_call" + memory_retrieval = "memory_retrieval" + + +@json_schema_type +class InferenceStep(StepCommon): + """An inference step in an agent turn.""" + + model_config = ConfigDict(protected_namespaces=()) + + step_type: Literal[StepType.inference] = Field(default=StepType.inference) + model_response: CompletionMessage = Field(description="The response from the LLM.") + + +@json_schema_type +class ToolExecutionStep(StepCommon): + """A tool execution step in an agent turn.""" + + step_type: Literal[StepType.tool_execution] = Field(default=StepType.tool_execution) + tool_calls: list[ToolCall] = Field(description="The tool calls to execute.") + tool_responses: list[ToolResponse] = Field(description="The tool responses from the tool calls.") + + +@json_schema_type +class ShieldCallStep(StepCommon): + """A shield call step in an agent turn.""" + + step_type: Literal[StepType.shield_call] = Field(default=StepType.shield_call) + violation: SafetyViolation | None = Field(default=None, description="The violation from the shield call.") + + +@json_schema_type +class MemoryRetrievalStep(StepCommon): + """A memory retrieval step in an agent turn.""" + + step_type: Literal[StepType.memory_retrieval] = Field(default=StepType.memory_retrieval) + # TODO: should this be List[str]? + vector_store_ids: str = Field(description="The IDs of the vector databases to retrieve context from.") + inserted_context: InterleavedContent = Field(description="The context retrieved from the vector databases.") + + +Step = Annotated[ + InferenceStep | ToolExecutionStep | ShieldCallStep | MemoryRetrievalStep, + Field(discriminator="step_type"), +] + + +@json_schema_type +class Turn(BaseModel): + """A single turn in an interaction with an Agentic System.""" + + turn_id: str = Field(description="Unique identifier for the turn within a session") + session_id: str = Field(description="Unique identifier for the conversation session") + input_messages: list[UserMessage | ToolResponseMessage] = Field( + description="List of messages that initiated this turn" + ) + steps: list[Step] = Field(description="Ordered list of processing steps executed during this turn") + output_message: CompletionMessage = Field( + description="The model's generated response containing content and metadata" + ) + output_attachments: list[Attachment] | None = Field( + default_factory=lambda: [], description="Files or media attached to the agent's response" + ) + + started_at: datetime = Field(description="Timestamp when the turn began") + completed_at: datetime | None = Field(default=None, description="Timestamp when the turn finished, if completed") + + +@json_schema_type +class Session(BaseModel): + """A single session of an interaction with an Agentic System.""" + + session_id: str = Field(description="Unique identifier for the conversation session") + session_name: str = Field(description="Human-readable name for the session") + turns: list[Turn] = Field(description="List of all turns that have occurred in this session") + started_at: datetime = Field(description="Timestamp when the session was created") + + +class AgentToolGroupWithArgs(BaseModel): + name: str = Field() + args: dict[str, Any] = Field() + + +AgentToolGroup = str | AgentToolGroupWithArgs +register_schema(AgentToolGroup, name="AgentTool") + + +class AgentConfigCommon(BaseModel): + sampling_params: SamplingParams | None = Field(default_factory=SamplingParams) + + input_shields: list[str] | None = Field(default_factory=lambda: []) + output_shields: list[str] | None = Field(default_factory=lambda: []) + toolgroups: list[AgentToolGroup] | None = Field(default_factory=lambda: []) + client_tools: list[ToolDef] | None = Field(default_factory=lambda: []) + tool_choice: ToolChoice | None = Field(default=None, deprecated="use tool_config instead") + tool_prompt_format: ToolPromptFormat | None = Field(default=None, deprecated="use tool_config instead") + tool_config: ToolConfig | None = Field(default=None) + + max_infer_iters: int | None = 10 + + def model_post_init(self, __context): + if self.tool_config: + if self.tool_choice and self.tool_config.tool_choice != self.tool_choice: + raise ValueError("tool_choice is deprecated. Use tool_choice in tool_config instead.") + if self.tool_prompt_format and self.tool_config.tool_prompt_format != self.tool_prompt_format: + raise ValueError("tool_prompt_format is deprecated. Use tool_prompt_format in tool_config instead.") + else: + params = {} + if self.tool_choice: + params["tool_choice"] = self.tool_choice + if self.tool_prompt_format: + params["tool_prompt_format"] = self.tool_prompt_format + self.tool_config = ToolConfig(**params) + + +@json_schema_type +class AgentConfig(AgentConfigCommon): + """Configuration for an agent.""" + + model: str = Field(description="The model identifier to use for the agent") + instructions: str = Field(description="The system instructions for the agent") + name: str | None = Field( + default=None, description="Optional name for the agent, used in telemetry and identification" + ) + enable_session_persistence: bool | None = Field( + default=False, description="Optional flag indicating whether session data has to be persisted" + ) + response_format: ResponseFormat | None = Field(default=None, description="Optional response format configuration") + + +@json_schema_type +class Agent(BaseModel): + """An agent instance with configuration and metadata.""" + + agent_id: str = Field(description="Unique identifier for the agent") + agent_config: AgentConfig = Field(description="Configuration settings for the agent") + created_at: datetime = Field(description="Timestamp when the agent was created") + + +class AgentConfigOverridablePerTurn(AgentConfigCommon): + instructions: str | None = Field(default=None) + + +class AgentTurnResponseEventType(StrEnum): + step_start = "step_start" + step_complete = "step_complete" + step_progress = "step_progress" + + turn_start = "turn_start" + turn_complete = "turn_complete" + turn_awaiting_input = "turn_awaiting_input" + + +@json_schema_type +class AgentTurnResponseStepStartPayload(BaseModel): + """Payload for step start events in agent turn responses.""" + + event_type: Literal[AgentTurnResponseEventType.step_start] = Field( + default=AgentTurnResponseEventType.step_start, description="Type of event being reported" + ) + step_type: StepType = Field(description="Type of step being executed") + step_id: str = Field(description="Unique identifier for the step within a turn") + metadata: dict[str, Any] | None = Field(default_factory=lambda: {}, description="Additional metadata for the step") + + +@json_schema_type +class AgentTurnResponseStepCompletePayload(BaseModel): + """Payload for step completion events in agent turn responses.""" + + event_type: Literal[AgentTurnResponseEventType.step_complete] = Field( + default=AgentTurnResponseEventType.step_complete, description="Type of event being reported" + ) + step_type: StepType = Field(description="Type of step being executed") + step_id: str = Field(description="Unique identifier for the step within a turn") + step_details: Step = Field(description="Complete details of the executed step") + + +@json_schema_type +class AgentTurnResponseStepProgressPayload(BaseModel): + """Payload for step progress events in agent turn responses.""" + + model_config = ConfigDict(protected_namespaces=()) + + event_type: Literal[AgentTurnResponseEventType.step_progress] = Field( + default=AgentTurnResponseEventType.step_progress, description="Type of event being reported" + ) + step_type: StepType = Field(description="Type of step being executed") + step_id: str = Field(description="Unique identifier for the step within a turn") + + delta: ContentDelta = Field(description="Incremental content changes during step execution") + + +@json_schema_type +class AgentTurnResponseTurnStartPayload(BaseModel): + """Payload for turn start events in agent turn responses.""" + + event_type: Literal[AgentTurnResponseEventType.turn_start] = Field( + default=AgentTurnResponseEventType.turn_start, description="Type of event being reported" + ) + turn_id: str = Field(description="Unique identifier for the turn within a session") + + +@json_schema_type +class AgentTurnResponseTurnCompletePayload(BaseModel): + """Payload for turn completion events in agent turn responses.""" + + event_type: Literal[AgentTurnResponseEventType.turn_complete] = Field( + default=AgentTurnResponseEventType.turn_complete, description="Type of event being reported" + ) + turn: Turn = Field(description="Complete turn data including all steps and results") + + +@json_schema_type +class AgentTurnResponseTurnAwaitingInputPayload(BaseModel): + """Payload for turn awaiting input events in agent turn responses.""" + + event_type: Literal[AgentTurnResponseEventType.turn_awaiting_input] = Field( + default=AgentTurnResponseEventType.turn_awaiting_input, description="Type of event being reported" + ) + turn: Turn = Field(description="Turn data when waiting for external tool responses") + + +AgentTurnResponseEventPayload = Annotated[ + AgentTurnResponseStepStartPayload + | AgentTurnResponseStepProgressPayload + | AgentTurnResponseStepCompletePayload + | AgentTurnResponseTurnStartPayload + | AgentTurnResponseTurnCompletePayload + | AgentTurnResponseTurnAwaitingInputPayload, + Field(discriminator="event_type"), +] +register_schema(AgentTurnResponseEventPayload, name="AgentTurnResponseEventPayload") + + +@json_schema_type +class AgentTurnResponseEvent(BaseModel): + """An event in an agent turn response stream.""" + + payload: AgentTurnResponseEventPayload = Field(description="Event-specific payload containing event data") + + +@json_schema_type +class AgentCreateResponse(BaseModel): + """Response returned when creating a new agent.""" + + agent_id: str = Field(description="Unique identifier for the created agent") + + +@json_schema_type +class AgentSessionCreateResponse(BaseModel): + """Response returned when creating a new agent session.""" + + session_id: str = Field(description="Unique identifier for the created session") + + +@json_schema_type +class AgentTurnCreateRequest(AgentConfigOverridablePerTurn): + """Request to create a new turn for an agent.""" + + agent_id: str = Field(description="Unique identifier for the agent") + session_id: str = Field(description="Unique identifier for the conversation session") + + # TODO: figure out how we can simplify this and make why + # ToolResponseMessage needs to be here (it is function call + # execution from outside the system) + messages: list[UserMessage | ToolResponseMessage] = Field(description="List of messages to start the turn with") + + documents: list[Document] | None = Field(default=None, description="List of documents to provide to the agent") + toolgroups: list[AgentToolGroup] | None = Field( + default_factory=lambda: [], description="List of tool groups to make available for this turn" + ) + + stream: bool | None = Field(default=False, description="Whether to stream the response") + tool_config: ToolConfig | None = Field(default=None, description="Tool configuration to override agent defaults") + + +@json_schema_type +class AgentTurnResumeRequest(BaseModel): + """Request to resume an agent turn with tool responses.""" + + agent_id: str = Field(description="Unique identifier for the agent") + session_id: str = Field(description="Unique identifier for the conversation session") + turn_id: str = Field(description="Unique identifier for the turn within a session") + tool_responses: list[ToolResponse] = Field(description="List of tool responses to submit to continue the turn") + stream: bool | None = Field(default=False, description="Whether to stream the response") + + +@json_schema_type +class AgentTurnResponseStreamChunk(BaseModel): + """Streamed agent turn completion response.""" + + event: AgentTurnResponseEvent = Field(description="Individual event in the agent turn response stream") + + +@json_schema_type +class AgentStepResponse(BaseModel): + """Response containing details of a specific agent step.""" + + step: Step = Field(description="The complete step data and execution details") + + +@json_schema_type +class CreateAgentSessionRequest(BaseModel): + """Request to create a new session for an agent.""" + + agent_id: str = Field(..., description="The ID of the agent to create the session for") + session_name: str = Field(..., description="The name of the session to create") + + +@json_schema_type +class CreateOpenAIResponseRequest(BaseModel): + """Request to create a model response.""" + + input: str | list[OpenAIResponseInput] = Field(..., description="Input message(s) to create the response") + model: str = Field(..., description="The underlying LLM used for completions") + prompt: OpenAIResponsePrompt | None = Field(None, description="Prompt object with ID, version, and variables") + instructions: str | None = Field(None, description="System instructions") + previous_response_id: str | None = Field( + None, description="If specified, the new response will be a continuation of the previous response" + ) + conversation: str | None = Field( + None, description="The ID of a conversation to add the response to. Must begin with 'conv_'" + ) + store: bool = Field(True, description="Whether to store the response") + stream: bool = Field(False, description="Whether to stream the response") + temperature: float | None = Field(None, description="Sampling temperature") + text: OpenAIResponseText | None = Field(None, description="Text generation parameters") + tools: list[OpenAIResponseInputTool] | None = Field(None, description="Tools to make available") + include: list[str] | None = Field(None, description="Additional fields to include in the response") + max_infer_iters: int = Field(10, description="Maximum number of inference iterations (extension to the OpenAI API)") + guardrails: list[ResponseGuardrail] | None = Field( + None, description="List of guardrails to apply during response generation" + ) diff --git a/src/llama_stack/apis/agents/openai_responses.py b/src/llama_stack/apis/agents/openai_responses.py index 3febbb733d..89ad7ca25e 100644 --- a/src/llama_stack/apis/agents/openai_responses.py +++ b/src/llama_stack/apis/agents/openai_responses.py @@ -25,8 +25,8 @@ class OpenAIResponseError(BaseModel): :param message: Human-readable error message describing the failure """ - code: str - message: str + code: str = Field(description="Error code identifying the type of failure") + message: str = Field(description="Human-readable error message describing the failure") @json_schema_type @@ -37,8 +37,10 @@ class OpenAIResponseInputMessageContentText(BaseModel): :param type: Content type identifier, always "input_text" """ - text: str - type: Literal["input_text"] = "input_text" + text: str = Field(description="The text content of the input message") + type: Literal["input_text"] = Field( + default="input_text", description='Content type identifier, always "input_text"' + ) @json_schema_type @@ -51,10 +53,14 @@ class OpenAIResponseInputMessageContentImage(BaseModel): :param image_url: (Optional) URL of the image content """ - detail: Literal["low"] | Literal["high"] | Literal["auto"] = "auto" - type: Literal["input_image"] = "input_image" - file_id: str | None = None - image_url: str | None = None + detail: Literal["low"] | Literal["high"] | Literal["auto"] = Field( + default="auto", description='Level of detail for image processing, can be "low", "high", or "auto"' + ) + type: Literal["input_image"] = Field( + default="input_image", description='Content type identifier, always "input_image"' + ) + file_id: str | None = Field(default=None, description="The ID of the file to be sent to the model.") + image_url: str | None = Field(default=None, description="URL of the image content") @json_schema_type @@ -68,11 +74,13 @@ class OpenAIResponseInputMessageContentFile(BaseModel): :param filename: The name of the file to be sent to the model. """ - type: Literal["input_file"] = "input_file" - file_data: str | None = None - file_id: str | None = None - file_url: str | None = None - filename: str | None = None + type: Literal["input_file"] = Field( + default="input_file", description="The type of the input item. Always `input_file`." + ) + file_data: str | None = Field(default=None, description="The data of the file to be sent to the model.") + file_id: str | None = Field(default=None, description="The ID of the file to be sent to the model.") + file_url: str | None = Field(default=None, description="The URL of the file to be sent to the model.") + filename: str | None = Field(default=None, description="The name of the file to be sent to the model.") @model_validator(mode="after") def validate_file_source(self) -> "OpenAIResponseInputMessageContentFile": @@ -102,9 +110,14 @@ class OpenAIResponsePrompt(BaseModel): :param version: Version number of the prompt to use (defaults to latest if not specified) """ - id: str - variables: dict[str, OpenAIResponseInputMessageContent] | None = None - version: str | None = None + id: str = Field(description="Unique identifier of the prompt template") + variables: dict[str, OpenAIResponseInputMessageContent] | None = Field( + default=None, + description="Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files.", + ) + version: str | None = Field( + default=None, description="Version number of the prompt to use (defaults to latest if not specified)" + ) @json_schema_type @@ -117,10 +130,12 @@ class OpenAIResponseAnnotationFileCitation(BaseModel): :param index: Position index of the citation within the content """ - type: Literal["file_citation"] = "file_citation" - file_id: str - filename: str - index: int + type: Literal["file_citation"] = Field( + default="file_citation", description='Annotation type identifier, always "file_citation"' + ) + file_id: str = Field(description="Unique identifier of the referenced file") + filename: str = Field(description="Name of the referenced file") + index: int = Field(description="Position index of the citation within the content") @json_schema_type @@ -134,28 +149,30 @@ class OpenAIResponseAnnotationCitation(BaseModel): :param url: URL of the referenced web resource """ - type: Literal["url_citation"] = "url_citation" - end_index: int - start_index: int - title: str - url: str + type: Literal["url_citation"] = Field( + default="url_citation", description='Annotation type identifier, always "url_citation"' + ) + end_index: int = Field(description="End position of the citation span in the content") + start_index: int = Field(description="Start position of the citation span in the content") + title: str = Field(description="Title of the referenced web resource") + url: str = Field(description="URL of the referenced web resource") @json_schema_type class OpenAIResponseAnnotationContainerFileCitation(BaseModel): - type: Literal["container_file_citation"] = "container_file_citation" - container_id: str - end_index: int - file_id: str - filename: str - start_index: int + type: Literal["container_file_citation"] = Field(default="container_file_citation") + container_id: str = Field() + end_index: int = Field() + file_id: str = Field() + filename: str = Field() + start_index: int = Field() @json_schema_type class OpenAIResponseAnnotationFilePath(BaseModel): - type: Literal["file_path"] = "file_path" - file_id: str - index: int + type: Literal["file_path"] = Field(default="file_path") + file_id: str = Field() + index: int = Field() OpenAIResponseAnnotations = Annotated[ @@ -170,8 +187,8 @@ class OpenAIResponseAnnotationFilePath(BaseModel): @json_schema_type class OpenAIResponseOutputMessageContentOutputText(BaseModel): - text: str - type: Literal["output_text"] = "output_text" + text: str = Field() + type: Literal["output_text"] = Field(default="output_text") annotations: list[OpenAIResponseAnnotations] = Field(default_factory=list) @@ -183,8 +200,8 @@ class OpenAIResponseContentPartRefusal(BaseModel): :param refusal: Refusal text supplied by the model """ - type: Literal["refusal"] = "refusal" - refusal: str + type: Literal["refusal"] = Field(default="refusal", description='Content part type identifier, always "refusal"') + refusal: str = Field(description="Refusal text supplied by the model") OpenAIResponseOutputMessageContent = Annotated[ @@ -203,13 +220,13 @@ class OpenAIResponseMessage(BaseModel): scenarios. """ - content: str | Sequence[OpenAIResponseInputMessageContent] | Sequence[OpenAIResponseOutputMessageContent] - role: Literal["system"] | Literal["developer"] | Literal["user"] | Literal["assistant"] - type: Literal["message"] = "message" + content: str | Sequence[OpenAIResponseInputMessageContent] | Sequence[OpenAIResponseOutputMessageContent] = Field() + role: Literal["system"] | Literal["developer"] | Literal["user"] | Literal["assistant"] = Field() + type: Literal["message"] = Field(default="message") # The fields below are not used in all scenarios, but are required in others. - id: str | None = None - status: str | None = None + id: str | None = Field(default=None) + status: str | None = Field(default=None) @json_schema_type @@ -221,9 +238,11 @@ class OpenAIResponseOutputMessageWebSearchToolCall(BaseModel): :param type: Tool call type identifier, always "web_search_call" """ - id: str - status: str - type: Literal["web_search_call"] = "web_search_call" + id: str = Field(description="Unique identifier for this tool call") + status: str = Field(description="Current status of the web search operation") + type: Literal["web_search_call"] = Field( + default="web_search_call", description='Tool call type identifier, always "web_search_call"' + ) class OpenAIResponseOutputMessageFileSearchToolCallResults(BaseModel): @@ -236,11 +255,11 @@ class OpenAIResponseOutputMessageFileSearchToolCallResults(BaseModel): :param text: Text content of the search result """ - attributes: dict[str, Any] - file_id: str - filename: str - score: float - text: str + attributes: dict[str, Any] = Field(description="Key-value attributes associated with the file") + file_id: str = Field(description="Unique identifier of the file containing the result") + filename: str = Field(description="Name of the file containing the result") + score: float = Field(description="Relevance score for this search result (between 0 and 1)") + text: str = Field(description="Text content of the search result") @json_schema_type @@ -254,11 +273,15 @@ class OpenAIResponseOutputMessageFileSearchToolCall(BaseModel): :param results: (Optional) Search results returned by the file search operation """ - id: str - queries: Sequence[str] - status: str - type: Literal["file_search_call"] = "file_search_call" - results: Sequence[OpenAIResponseOutputMessageFileSearchToolCallResults] | None = None + id: str = Field(description="Unique identifier for this tool call") + queries: Sequence[str] = Field(description="List of search queries executed") + status: str = Field(description="Current status of the file search operation") + type: Literal["file_search_call"] = Field( + default="file_search_call", description='Tool call type identifier, always "file_search_call"' + ) + results: Sequence[OpenAIResponseOutputMessageFileSearchToolCallResults] | None = Field( + default=None, description="Search results returned by the file search operation" + ) @json_schema_type @@ -273,12 +296,14 @@ class OpenAIResponseOutputMessageFunctionToolCall(BaseModel): :param status: (Optional) Current status of the function call execution """ - call_id: str - name: str - arguments: str - type: Literal["function_call"] = "function_call" - id: str | None = None - status: str | None = None + call_id: str = Field(description="Unique identifier for the function call") + name: str = Field(description="Name of the function being called") + arguments: str = Field(description="JSON string containing the function arguments") + type: Literal["function_call"] = Field( + default="function_call", description='Tool call type identifier, always "function_call"' + ) + id: str | None = Field(default=None, description="Additional identifier for the tool call") + status: str | None = Field(default=None, description="Current status of the function call execution") @json_schema_type @@ -294,13 +319,13 @@ class OpenAIResponseOutputMessageMCPCall(BaseModel): :param output: (Optional) Output result from the successful MCP call """ - id: str - type: Literal["mcp_call"] = "mcp_call" - arguments: str - name: str - server_label: str - error: str | None = None - output: str | None = None + id: str = Field(description="Unique identifier for this MCP call") + type: Literal["mcp_call"] = Field(default="mcp_call", description='Tool call type identifier, always "mcp_call"') + arguments: str = Field(description="JSON string containing the MCP call arguments") + name: str = Field(description="Name of the MCP method being called") + server_label: str = Field(description="Label identifying the MCP server handling the call") + error: str | None = Field(default=None, description="Error message if the MCP call failed") + output: str | None = Field(default=None, description="Output result from the successful MCP call") class MCPListToolsTool(BaseModel): @@ -311,9 +336,9 @@ class MCPListToolsTool(BaseModel): :param description: (Optional) Description of what the tool does """ - input_schema: dict[str, Any] - name: str - description: str | None = None + input_schema: dict[str, Any] = Field(description="JSON schema defining the tool's input parameters") + name: str = Field(description="Name of the tool") + description: str | None = Field(default=None, description="Description of what the tool does") @json_schema_type @@ -326,10 +351,12 @@ class OpenAIResponseOutputMessageMCPListTools(BaseModel): :param tools: List of available tools provided by the MCP server """ - id: str - type: Literal["mcp_list_tools"] = "mcp_list_tools" - server_label: str - tools: list[MCPListToolsTool] + id: str = Field(description="Unique identifier for this MCP list tools operation") + type: Literal["mcp_list_tools"] = Field( + default="mcp_list_tools", description='Tool call type identifier, always "mcp_list_tools"' + ) + server_label: str = Field(description="Label identifying the MCP server providing the tools") + tools: list[MCPListToolsTool] = Field(description="List of available tools provided by the MCP server") @json_schema_type @@ -338,11 +365,11 @@ class OpenAIResponseMCPApprovalRequest(BaseModel): A request for human approval of a tool invocation. """ - arguments: str - id: str - name: str - server_label: str - type: Literal["mcp_approval_request"] = "mcp_approval_request" + arguments: str = Field() + id: str = Field() + name: str = Field() + server_label: str = Field() + type: Literal["mcp_approval_request"] = Field(default="mcp_approval_request") @json_schema_type @@ -351,11 +378,11 @@ class OpenAIResponseMCPApprovalResponse(BaseModel): A response to an MCP approval request. """ - approval_request_id: str - approve: bool - type: Literal["mcp_approval_response"] = "mcp_approval_response" - id: str | None = None - reason: str | None = None + approval_request_id: str = Field() + approve: bool = Field() + type: Literal["mcp_approval_response"] = Field(default="mcp_approval_response") + id: str | None = Field(default=None) + reason: str | None = Field(default=None) OpenAIResponseOutput = Annotated[ @@ -399,7 +426,9 @@ class OpenAIResponseText(BaseModel): :param format: (Optional) Text format configuration specifying output format requirements """ - format: OpenAIResponseTextFormat | None = None + format: OpenAIResponseTextFormat | None = Field( + default=None, description="Text format configuration specifying output format requirements" + ) # Must match type Literals of OpenAIResponseInputToolWebSearch below @@ -415,11 +444,15 @@ class OpenAIResponseInputToolWebSearch(BaseModel): """ # Must match values of WebSearchToolTypes above - type: Literal["web_search"] | Literal["web_search_preview"] | Literal["web_search_preview_2025_03_11"] = ( - "web_search" + type: Literal["web_search"] | Literal["web_search_preview"] | Literal["web_search_preview_2025_03_11"] = Field( + default="web_search", description="Web search tool type variant to use" ) # TODO: actually use search_context_size somewhere... - search_context_size: str | None = Field(default="medium", pattern="^low|medium|high$") + search_context_size: str | None = Field( + default="medium", + pattern="^low|medium|high$", + description='Size of search context, must be "low", "medium", or "high"', + ) # TODO: add user_location @@ -434,11 +467,13 @@ class OpenAIResponseInputToolFunction(BaseModel): :param strict: (Optional) Whether to enforce strict parameter validation """ - type: Literal["function"] = "function" - name: str - description: str | None = None - parameters: dict[str, Any] | None - strict: bool | None = None + type: Literal["function"] = Field(default="function", description='Tool type identifier, always "function"') + name: str = Field(description="Name of the function that can be called") + description: str | None = Field(default=None, description="Description of what the function does") + parameters: dict[str, Any] | None = Field( + default=None, description="JSON schema defining the function's parameters" + ) + strict: bool | None = Field(default=None, description="Whether to enforce strict parameter validation") @json_schema_type @@ -452,11 +487,17 @@ class OpenAIResponseInputToolFileSearch(BaseModel): :param ranking_options: (Optional) Options for ranking and scoring search results """ - type: Literal["file_search"] = "file_search" - vector_store_ids: list[str] - filters: dict[str, Any] | None = None - max_num_results: int | None = Field(default=10, ge=1, le=50) - ranking_options: FileSearchRankingOptions | None = None + type: Literal["file_search"] = Field( + default="file_search", description='Tool type identifier, always "file_search"' + ) + vector_store_ids: list[str] = Field(description="List of vector store identifiers to search within") + filters: dict[str, Any] | None = Field(default=None, description="Additional filters to apply to the search") + max_num_results: int | None = Field( + default=10, ge=1, le=50, description="Maximum number of search results to return (1-50)" + ) + ranking_options: FileSearchRankingOptions | None = Field( + default=None, description="Options for ranking and scoring search results" + ) class ApprovalFilter(BaseModel): @@ -466,8 +507,8 @@ class ApprovalFilter(BaseModel): :param never: (Optional) List of tool names that never require approval """ - always: list[str] | None = None - never: list[str] | None = None + always: list[str] | None = Field(default=None, description="List of tool names that always require approval") + never: list[str] | None = Field(default=None, description="List of tool names that never require approval") class AllowedToolsFilter(BaseModel): @@ -476,7 +517,7 @@ class AllowedToolsFilter(BaseModel): :param tool_names: (Optional) List of specific tool names that are allowed """ - tool_names: list[str] | None = None + tool_names: list[str] | None = Field(default=None, description="List of specific tool names that are allowed") @json_schema_type @@ -491,13 +532,19 @@ class OpenAIResponseInputToolMCP(BaseModel): :param allowed_tools: (Optional) Restriction on which tools can be used from this server """ - type: Literal["mcp"] = "mcp" - server_label: str - server_url: str - headers: dict[str, Any] | None = None + type: Literal["mcp"] = Field(default="mcp", description='Tool type identifier, always "mcp"') + server_label: str = Field(description="Label to identify this MCP server") + server_url: str = Field(description="URL endpoint of the MCP server") + headers: dict[str, Any] | None = Field( + default=None, description="HTTP headers to include when connecting to the server" + ) - require_approval: Literal["always"] | Literal["never"] | ApprovalFilter = "never" - allowed_tools: list[str] | AllowedToolsFilter | None = None + require_approval: Literal["always"] | Literal["never"] | ApprovalFilter = Field( + default="never", description='Approval requirement for tool calls ("always", "never", or filter)' + ) + allowed_tools: list[str] | AllowedToolsFilter | None = Field( + default=None, description="Restriction on which tools can be used from this server" + ) OpenAIResponseInputTool = Annotated[ @@ -519,9 +566,11 @@ class OpenAIResponseToolMCP(BaseModel): :param allowed_tools: (Optional) Restriction on which tools can be used from this server """ - type: Literal["mcp"] = "mcp" - server_label: str - allowed_tools: list[str] | AllowedToolsFilter | None = None + type: Literal["mcp"] = Field(default="mcp", description='Tool type identifier, always "mcp"') + server_label: str = Field(description="Label to identify this MCP server") + allowed_tools: list[str] | AllowedToolsFilter | None = Field( + default=None, description="Restriction on which tools can be used from this server" + ) OpenAIResponseTool = Annotated[ @@ -540,7 +589,7 @@ class OpenAIResponseUsageOutputTokensDetails(BaseModel): :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) """ - reasoning_tokens: int | None = None + reasoning_tokens: int | None = Field(default=None, description="Number of tokens used for reasoning (o1/o3 models)") class OpenAIResponseUsageInputTokensDetails(BaseModel): @@ -549,7 +598,7 @@ class OpenAIResponseUsageInputTokensDetails(BaseModel): :param cached_tokens: Number of tokens retrieved from cache """ - cached_tokens: int | None = None + cached_tokens: int | None = Field(default=None, description="Number of tokens retrieved from cache") @json_schema_type @@ -563,11 +612,15 @@ class OpenAIResponseUsage(BaseModel): :param output_tokens_details: Detailed breakdown of output token usage """ - input_tokens: int - output_tokens: int - total_tokens: int - input_tokens_details: OpenAIResponseUsageInputTokensDetails | None = None - output_tokens_details: OpenAIResponseUsageOutputTokensDetails | None = None + input_tokens: int = Field(description="Number of tokens in the input") + output_tokens: int = Field(description="Number of tokens in the output") + total_tokens: int = Field(description="Total tokens used (input + output)") + input_tokens_details: OpenAIResponseUsageInputTokensDetails | None = Field( + default=None, description="Detailed breakdown of input token usage" + ) + output_tokens_details: OpenAIResponseUsageOutputTokensDetails | None = Field( + default=None, description="Detailed breakdown of output token usage" + ) @json_schema_type @@ -593,25 +646,36 @@ class OpenAIResponseObject(BaseModel): :param instructions: (Optional) System message inserted into the model's context """ - created_at: int - error: OpenAIResponseError | None = None - id: str - model: str - object: Literal["response"] = "response" - output: Sequence[OpenAIResponseOutput] - parallel_tool_calls: bool = False - previous_response_id: str | None = None - prompt: OpenAIResponsePrompt | None = None - status: str - temperature: float | None = None + created_at: int = Field(description="Unix timestamp when the response was created") + error: OpenAIResponseError | None = Field( + default=None, description="Error details if the response generation failed" + ) + id: str = Field(description="Unique identifier for this response") + model: str = Field(description="Model identifier used for generation") + object: Literal["response"] = Field(default="response", description='Object type identifier, always "response"') + output: Sequence[OpenAIResponseOutput] = Field( + description="List of generated output items (messages, tool calls, etc.)" + ) + parallel_tool_calls: bool = Field(default=False, description="Whether tool calls can be executed in parallel") + previous_response_id: str | None = Field(default=None, description="ID of the previous response in a conversation") + prompt: OpenAIResponsePrompt | None = Field( + default=None, description="Reference to a prompt template and its variables." + ) + status: str = Field(description="Current status of the response generation") + temperature: float | None = Field(default=None, description="Sampling temperature used for generation") # Default to text format to avoid breaking the loading of old responses # before the field was added. New responses will have this set always. - text: OpenAIResponseText = OpenAIResponseText(format=OpenAIResponseTextFormat(type="text")) - top_p: float | None = None - tools: Sequence[OpenAIResponseTool] | None = None - truncation: str | None = None - usage: OpenAIResponseUsage | None = None - instructions: str | None = None + text: OpenAIResponseText = Field( + default_factory=lambda: OpenAIResponseText(format=OpenAIResponseTextFormat(type="text")), + description="Text formatting configuration for the response", + ) + top_p: float | None = Field(default=None, description="Nucleus sampling parameter used for generation") + tools: Sequence[OpenAIResponseTool] | None = Field( + default=None, description="An array of tools the model may call while generating a response." + ) + truncation: str | None = Field(default=None, description="Truncation strategy applied to the response") + usage: OpenAIResponseUsage | None = Field(default=None, description="Token usage information for the response") + instructions: str | None = Field(default=None, description="System message inserted into the model's context") @json_schema_type @@ -623,9 +687,9 @@ class OpenAIDeleteResponseObject(BaseModel): :param deleted: Deletion confirmation flag, always True """ - id: str - object: Literal["response"] = "response" - deleted: bool = True + id: str = Field(description="Unique identifier of the deleted response") + object: Literal["response"] = Field(default="response", description='Object type identifier, always "response"') + deleted: bool = Field(default=True, description="Deletion confirmation flag, always True") @json_schema_type @@ -636,8 +700,10 @@ class OpenAIResponseObjectStreamResponseCreated(BaseModel): :param type: Event type identifier, always "response.created" """ - response: OpenAIResponseObject - type: Literal["response.created"] = "response.created" + response: OpenAIResponseObject = Field(description="The response object that was created") + type: Literal["response.created"] = Field( + default="response.created", description='Event type identifier, always "response.created"' + ) @json_schema_type @@ -649,9 +715,11 @@ class OpenAIResponseObjectStreamResponseInProgress(BaseModel): :param type: Event type identifier, always "response.in_progress" """ - response: OpenAIResponseObject - sequence_number: int - type: Literal["response.in_progress"] = "response.in_progress" + response: OpenAIResponseObject = Field(description="Current response state while in progress") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.in_progress"] = Field( + default="response.in_progress", description='Event type identifier, always "response.in_progress"' + ) @json_schema_type @@ -662,8 +730,10 @@ class OpenAIResponseObjectStreamResponseCompleted(BaseModel): :param type: Event type identifier, always "response.completed" """ - response: OpenAIResponseObject - type: Literal["response.completed"] = "response.completed" + response: OpenAIResponseObject = Field(description="Completed response object") + type: Literal["response.completed"] = Field( + default="response.completed", description='Event type identifier, always "response.completed"' + ) @json_schema_type @@ -675,9 +745,11 @@ class OpenAIResponseObjectStreamResponseIncomplete(BaseModel): :param type: Event type identifier, always "response.incomplete" """ - response: OpenAIResponseObject - sequence_number: int - type: Literal["response.incomplete"] = "response.incomplete" + response: OpenAIResponseObject = Field(description="Response object describing the incomplete state") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.incomplete"] = Field( + default="response.incomplete", description='Event type identifier, always "response.incomplete"' + ) @json_schema_type @@ -689,9 +761,11 @@ class OpenAIResponseObjectStreamResponseFailed(BaseModel): :param type: Event type identifier, always "response.failed" """ - response: OpenAIResponseObject - sequence_number: int - type: Literal["response.failed"] = "response.failed" + response: OpenAIResponseObject = Field(description="Response object describing the failure") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.failed"] = Field( + default="response.failed", description='Event type identifier, always "response.failed"' + ) @json_schema_type @@ -705,11 +779,13 @@ class OpenAIResponseObjectStreamResponseOutputItemAdded(BaseModel): :param type: Event type identifier, always "response.output_item.added" """ - response_id: str - item: OpenAIResponseOutput - output_index: int - sequence_number: int - type: Literal["response.output_item.added"] = "response.output_item.added" + response_id: str = Field(description="Unique identifier of the response containing this output") + item: OpenAIResponseOutput = Field(description="The output item that was added (message, tool call, etc.)") + output_index: int = Field(description="Index position of this item in the output list") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.output_item.added"] = Field( + default="response.output_item.added", description='Event type identifier, always "response.output_item.added"' + ) @json_schema_type @@ -723,11 +799,13 @@ class OpenAIResponseObjectStreamResponseOutputItemDone(BaseModel): :param type: Event type identifier, always "response.output_item.done" """ - response_id: str - item: OpenAIResponseOutput - output_index: int - sequence_number: int - type: Literal["response.output_item.done"] = "response.output_item.done" + response_id: str = Field(description="Unique identifier of the response containing this output") + item: OpenAIResponseOutput = Field(description="The completed output item (message, tool call, etc.)") + output_index: int = Field(description="Index position of this item in the output list") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.output_item.done"] = Field( + default="response.output_item.done", description='Event type identifier, always "response.output_item.done"' + ) @json_schema_type @@ -742,12 +820,14 @@ class OpenAIResponseObjectStreamResponseOutputTextDelta(BaseModel): :param type: Event type identifier, always "response.output_text.delta" """ - content_index: int - delta: str - item_id: str - output_index: int - sequence_number: int - type: Literal["response.output_text.delta"] = "response.output_text.delta" + content_index: int = Field(description="Index position within the text content") + delta: str = Field(description="Incremental text content being added") + item_id: str = Field(description="Unique identifier of the output item being updated") + output_index: int = Field(description="Index position of the item in the output list") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.output_text.delta"] = Field( + default="response.output_text.delta", description='Event type identifier, always "response.output_text.delta"' + ) @json_schema_type @@ -762,12 +842,14 @@ class OpenAIResponseObjectStreamResponseOutputTextDone(BaseModel): :param type: Event type identifier, always "response.output_text.done" """ - content_index: int - text: str # final text of the output item - item_id: str - output_index: int - sequence_number: int - type: Literal["response.output_text.done"] = "response.output_text.done" + content_index: int = Field(description="Index position within the text content") + text: str = Field(description="Final complete text content of the output item") # final text of the output item + item_id: str = Field(description="Unique identifier of the completed output item") + output_index: int = Field(description="Index position of the item in the output list") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.output_text.done"] = Field( + default="response.output_text.done", description='Event type identifier, always "response.output_text.done"' + ) @json_schema_type @@ -781,11 +863,14 @@ class OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta(BaseModel): :param type: Event type identifier, always "response.function_call_arguments.delta" """ - delta: str - item_id: str - output_index: int - sequence_number: int - type: Literal["response.function_call_arguments.delta"] = "response.function_call_arguments.delta" + delta: str = Field(description="Incremental function call arguments being added") + item_id: str = Field(description="Unique identifier of the function call being updated") + output_index: int = Field(description="Index position of the item in the output list") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.function_call_arguments.delta"] = Field( + default="response.function_call_arguments.delta", + description='Event type identifier, always "response.function_call_arguments.delta"', + ) @json_schema_type @@ -799,11 +884,16 @@ class OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone(BaseModel): :param type: Event type identifier, always "response.function_call_arguments.done" """ - arguments: str # final arguments of the function call - item_id: str - output_index: int - sequence_number: int - type: Literal["response.function_call_arguments.done"] = "response.function_call_arguments.done" + arguments: str = Field( + description="Final complete arguments JSON string for the function call" + ) # final arguments of the function call + item_id: str = Field(description="Unique identifier of the completed function call") + output_index: int = Field(description="Index position of the item in the output list") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.function_call_arguments.done"] = Field( + default="response.function_call_arguments.done", + description='Event type identifier, always "response.function_call_arguments.done"', + ) @json_schema_type @@ -816,18 +906,21 @@ class OpenAIResponseObjectStreamResponseWebSearchCallInProgress(BaseModel): :param type: Event type identifier, always "response.web_search_call.in_progress" """ - item_id: str - output_index: int - sequence_number: int - type: Literal["response.web_search_call.in_progress"] = "response.web_search_call.in_progress" + item_id: str = Field(description="Unique identifier of the web search call") + output_index: int = Field(description="Index position of the item in the output list") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.web_search_call.in_progress"] = Field( + default="response.web_search_call.in_progress", + description='Event type identifier, always "response.web_search_call.in_progress"', + ) @json_schema_type class OpenAIResponseObjectStreamResponseWebSearchCallSearching(BaseModel): - item_id: str - output_index: int - sequence_number: int - type: Literal["response.web_search_call.searching"] = "response.web_search_call.searching" + item_id: str = Field() + output_index: int = Field() + sequence_number: int = Field() + type: Literal["response.web_search_call.searching"] = Field(default="response.web_search_call.searching") @json_schema_type @@ -840,46 +933,49 @@ class OpenAIResponseObjectStreamResponseWebSearchCallCompleted(BaseModel): :param type: Event type identifier, always "response.web_search_call.completed" """ - item_id: str - output_index: int - sequence_number: int - type: Literal["response.web_search_call.completed"] = "response.web_search_call.completed" + item_id: str = Field(description="Unique identifier of the completed web search call") + output_index: int = Field(description="Index position of the item in the output list") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.web_search_call.completed"] = Field( + default="response.web_search_call.completed", + description='Event type identifier, always "response.web_search_call.completed"', + ) @json_schema_type class OpenAIResponseObjectStreamResponseMcpListToolsInProgress(BaseModel): - sequence_number: int - type: Literal["response.mcp_list_tools.in_progress"] = "response.mcp_list_tools.in_progress" + sequence_number: int = Field() + type: Literal["response.mcp_list_tools.in_progress"] = Field(default="response.mcp_list_tools.in_progress") @json_schema_type class OpenAIResponseObjectStreamResponseMcpListToolsFailed(BaseModel): - sequence_number: int - type: Literal["response.mcp_list_tools.failed"] = "response.mcp_list_tools.failed" + sequence_number: int = Field() + type: Literal["response.mcp_list_tools.failed"] = Field(default="response.mcp_list_tools.failed") @json_schema_type class OpenAIResponseObjectStreamResponseMcpListToolsCompleted(BaseModel): - sequence_number: int - type: Literal["response.mcp_list_tools.completed"] = "response.mcp_list_tools.completed" + sequence_number: int = Field() + type: Literal["response.mcp_list_tools.completed"] = Field(default="response.mcp_list_tools.completed") @json_schema_type class OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta(BaseModel): - delta: str - item_id: str - output_index: int - sequence_number: int - type: Literal["response.mcp_call.arguments.delta"] = "response.mcp_call.arguments.delta" + delta: str = Field() + item_id: str = Field() + output_index: int = Field() + sequence_number: int = Field() + type: Literal["response.mcp_call.arguments.delta"] = Field(default="response.mcp_call.arguments.delta") @json_schema_type class OpenAIResponseObjectStreamResponseMcpCallArgumentsDone(BaseModel): - arguments: str # final arguments of the MCP call - item_id: str - output_index: int - sequence_number: int - type: Literal["response.mcp_call.arguments.done"] = "response.mcp_call.arguments.done" + arguments: str = Field() # final arguments of the MCP call + item_id: str = Field() + output_index: int = Field() + sequence_number: int = Field() + type: Literal["response.mcp_call.arguments.done"] = Field(default="response.mcp_call.arguments.done") @json_schema_type @@ -892,10 +988,13 @@ class OpenAIResponseObjectStreamResponseMcpCallInProgress(BaseModel): :param type: Event type identifier, always "response.mcp_call.in_progress" """ - item_id: str - output_index: int - sequence_number: int - type: Literal["response.mcp_call.in_progress"] = "response.mcp_call.in_progress" + item_id: str = Field(description="Unique identifier of the MCP call") + output_index: int = Field(description="Index position of the item in the output list") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.mcp_call.in_progress"] = Field( + default="response.mcp_call.in_progress", + description='Event type identifier, always "response.mcp_call.in_progress"', + ) @json_schema_type @@ -906,8 +1005,10 @@ class OpenAIResponseObjectStreamResponseMcpCallFailed(BaseModel): :param type: Event type identifier, always "response.mcp_call.failed" """ - sequence_number: int - type: Literal["response.mcp_call.failed"] = "response.mcp_call.failed" + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.mcp_call.failed"] = Field( + default="response.mcp_call.failed", description='Event type identifier, always "response.mcp_call.failed"' + ) @json_schema_type @@ -918,8 +1019,10 @@ class OpenAIResponseObjectStreamResponseMcpCallCompleted(BaseModel): :param type: Event type identifier, always "response.mcp_call.completed" """ - sequence_number: int - type: Literal["response.mcp_call.completed"] = "response.mcp_call.completed" + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.mcp_call.completed"] = Field( + default="response.mcp_call.completed", description='Event type identifier, always "response.mcp_call.completed"' + ) @json_schema_type @@ -932,10 +1035,14 @@ class OpenAIResponseContentPartOutputText(BaseModel): :param logprobs: (Optional) Token log probability details """ - type: Literal["output_text"] = "output_text" - text: str - annotations: list[OpenAIResponseAnnotations] = Field(default_factory=list) - logprobs: list[dict[str, Any]] | None = None + type: Literal["output_text"] = Field( + default="output_text", description='Content part type identifier, always "output_text"' + ) + text: str = Field(description="Text emitted for this content part") + annotations: list[OpenAIResponseAnnotations] = Field( + default_factory=list, description="Structured annotations associated with the text" + ) + logprobs: list[dict[str, Any]] | None = Field(default=None, description="Token log probability details") @json_schema_type @@ -946,8 +1053,10 @@ class OpenAIResponseContentPartReasoningText(BaseModel): :param text: Reasoning text supplied by the model """ - type: Literal["reasoning_text"] = "reasoning_text" - text: str + type: Literal["reasoning_text"] = Field( + default="reasoning_text", description='Content part type identifier, always "reasoning_text"' + ) + text: str = Field(description="Reasoning text supplied by the model") OpenAIResponseContentPart = Annotated[ @@ -970,13 +1079,15 @@ class OpenAIResponseObjectStreamResponseContentPartAdded(BaseModel): :param type: Event type identifier, always "response.content_part.added" """ - content_index: int - response_id: str - item_id: str - output_index: int - part: OpenAIResponseContentPart - sequence_number: int - type: Literal["response.content_part.added"] = "response.content_part.added" + content_index: int = Field(description="Index position of the part within the content array") + response_id: str = Field(description="Unique identifier of the response containing this content") + item_id: str = Field(description="Unique identifier of the output item containing this content part") + output_index: int = Field(description="Index position of the output item in the response") + part: OpenAIResponseContentPart = Field(description="The content part that was added") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.content_part.added"] = Field( + default="response.content_part.added", description='Event type identifier, always "response.content_part.added"' + ) @json_schema_type @@ -992,13 +1103,15 @@ class OpenAIResponseObjectStreamResponseContentPartDone(BaseModel): :param type: Event type identifier, always "response.content_part.done" """ - content_index: int - response_id: str - item_id: str - output_index: int - part: OpenAIResponseContentPart - sequence_number: int - type: Literal["response.content_part.done"] = "response.content_part.done" + content_index: int = Field(description="Index position of the part within the content array") + response_id: str = Field(description="Unique identifier of the response containing this content") + item_id: str = Field(description="Unique identifier of the output item containing this content part") + output_index: int = Field(description="Index position of the output item in the response") + part: OpenAIResponseContentPart = Field(description="The completed content part") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.content_part.done"] = Field( + default="response.content_part.done", description='Event type identifier, always "response.content_part.done"' + ) @json_schema_type @@ -1013,12 +1126,15 @@ class OpenAIResponseObjectStreamResponseReasoningTextDelta(BaseModel): :param type: Event type identifier, always "response.reasoning_text.delta" """ - content_index: int - delta: str - item_id: str - output_index: int - sequence_number: int - type: Literal["response.reasoning_text.delta"] = "response.reasoning_text.delta" + content_index: int = Field(description="Index position of the reasoning content part") + delta: str = Field(description="Incremental reasoning text being added") + item_id: str = Field(description="Unique identifier of the output item being updated") + output_index: int = Field(description="Index position of the item in the output list") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.reasoning_text.delta"] = Field( + default="response.reasoning_text.delta", + description='Event type identifier, always "response.reasoning_text.delta"', + ) @json_schema_type @@ -1033,12 +1149,15 @@ class OpenAIResponseObjectStreamResponseReasoningTextDone(BaseModel): :param type: Event type identifier, always "response.reasoning_text.done" """ - content_index: int - text: str - item_id: str - output_index: int - sequence_number: int - type: Literal["response.reasoning_text.done"] = "response.reasoning_text.done" + content_index: int = Field(description="Index position of the reasoning content part") + text: str = Field(description="Final complete reasoning text") + item_id: str = Field(description="Unique identifier of the completed output item") + output_index: int = Field(description="Index position of the item in the output list") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.reasoning_text.done"] = Field( + default="response.reasoning_text.done", + description='Event type identifier, always "response.reasoning_text.done"', + ) @json_schema_type @@ -1049,8 +1168,10 @@ class OpenAIResponseContentPartReasoningSummary(BaseModel): :param text: Summary text """ - type: Literal["summary_text"] = "summary_text" - text: str + type: Literal["summary_text"] = Field( + default="summary_text", description='Content part type identifier, always "summary_text"' + ) + text: str = Field(description="Summary text") @json_schema_type @@ -1065,12 +1186,15 @@ class OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded(BaseModel): :param type: Event type identifier, always "response.reasoning_summary_part.added" """ - item_id: str - output_index: int - part: OpenAIResponseContentPartReasoningSummary - sequence_number: int - summary_index: int - type: Literal["response.reasoning_summary_part.added"] = "response.reasoning_summary_part.added" + item_id: str = Field(description="Unique identifier of the output item") + output_index: int = Field(description="Index position of the output item") + part: OpenAIResponseContentPartReasoningSummary = Field(description="The summary part that was added") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + summary_index: int = Field(description="Index of the summary part within the reasoning summary") + type: Literal["response.reasoning_summary_part.added"] = Field( + default="response.reasoning_summary_part.added", + description='Event type identifier, always "response.reasoning_summary_part.added"', + ) @json_schema_type @@ -1085,12 +1209,15 @@ class OpenAIResponseObjectStreamResponseReasoningSummaryPartDone(BaseModel): :param type: Event type identifier, always "response.reasoning_summary_part.done" """ - item_id: str - output_index: int - part: OpenAIResponseContentPartReasoningSummary - sequence_number: int - summary_index: int - type: Literal["response.reasoning_summary_part.done"] = "response.reasoning_summary_part.done" + item_id: str = Field(description="Unique identifier of the output item") + output_index: int = Field(description="Index position of the output item") + part: OpenAIResponseContentPartReasoningSummary = Field(description="The completed summary part") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + summary_index: int = Field(description="Index of the summary part within the reasoning summary") + type: Literal["response.reasoning_summary_part.done"] = Field( + default="response.reasoning_summary_part.done", + description='Event type identifier, always "response.reasoning_summary_part.done"', + ) @json_schema_type @@ -1105,12 +1232,15 @@ class OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta(BaseModel): :param type: Event type identifier, always "response.reasoning_summary_text.delta" """ - delta: str - item_id: str - output_index: int - sequence_number: int - summary_index: int - type: Literal["response.reasoning_summary_text.delta"] = "response.reasoning_summary_text.delta" + delta: str = Field(description="Incremental summary text being added") + item_id: str = Field(description="Unique identifier of the output item") + output_index: int = Field(description="Index position of the output item") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + summary_index: int = Field(description="Index of the summary part within the reasoning summary") + type: Literal["response.reasoning_summary_text.delta"] = Field( + default="response.reasoning_summary_text.delta", + description='Event type identifier, always "response.reasoning_summary_text.delta"', + ) @json_schema_type @@ -1125,12 +1255,15 @@ class OpenAIResponseObjectStreamResponseReasoningSummaryTextDone(BaseModel): :param type: Event type identifier, always "response.reasoning_summary_text.done" """ - text: str - item_id: str - output_index: int - sequence_number: int - summary_index: int - type: Literal["response.reasoning_summary_text.done"] = "response.reasoning_summary_text.done" + text: str = Field(description="Final complete summary text") + item_id: str = Field(description="Unique identifier of the output item") + output_index: int = Field(description="Index position of the output item") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + summary_index: int = Field(description="Index of the summary part within the reasoning summary") + type: Literal["response.reasoning_summary_text.done"] = Field( + default="response.reasoning_summary_text.done", + description='Event type identifier, always "response.reasoning_summary_text.done"', + ) @json_schema_type @@ -1145,12 +1278,14 @@ class OpenAIResponseObjectStreamResponseRefusalDelta(BaseModel): :param type: Event type identifier, always "response.refusal.delta" """ - content_index: int - delta: str - item_id: str - output_index: int - sequence_number: int - type: Literal["response.refusal.delta"] = "response.refusal.delta" + content_index: int = Field(description="Index position of the content part") + delta: str = Field(description="Incremental refusal text being added") + item_id: str = Field(description="Unique identifier of the output item") + output_index: int = Field(description="Index position of the item in the output list") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.refusal.delta"] = Field( + default="response.refusal.delta", description='Event type identifier, always "response.refusal.delta"' + ) @json_schema_type @@ -1165,12 +1300,14 @@ class OpenAIResponseObjectStreamResponseRefusalDone(BaseModel): :param type: Event type identifier, always "response.refusal.done" """ - content_index: int - refusal: str - item_id: str - output_index: int - sequence_number: int - type: Literal["response.refusal.done"] = "response.refusal.done" + content_index: int = Field(description="Index position of the content part") + refusal: str = Field(description="Final complete refusal text") + item_id: str = Field(description="Unique identifier of the output item") + output_index: int = Field(description="Index position of the item in the output list") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.refusal.done"] = Field( + default="response.refusal.done", description='Event type identifier, always "response.refusal.done"' + ) @json_schema_type @@ -1186,13 +1323,16 @@ class OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded(BaseModel): :param type: Event type identifier, always "response.output_text.annotation.added" """ - item_id: str - output_index: int - content_index: int - annotation_index: int - annotation: OpenAIResponseAnnotations - sequence_number: int - type: Literal["response.output_text.annotation.added"] = "response.output_text.annotation.added" + item_id: str = Field(description="Unique identifier of the item to which the annotation is being added") + output_index: int = Field(description="Index position of the output item in the response's output array") + content_index: int = Field(description="Index position of the content part within the output item") + annotation_index: int = Field(description="Index of the annotation within the content part") + annotation: OpenAIResponseAnnotations = Field(description="The annotation object being added") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.output_text.annotation.added"] = Field( + default="response.output_text.annotation.added", + description='Event type identifier, always "response.output_text.annotation.added"', + ) @json_schema_type @@ -1205,10 +1345,13 @@ class OpenAIResponseObjectStreamResponseFileSearchCallInProgress(BaseModel): :param type: Event type identifier, always "response.file_search_call.in_progress" """ - item_id: str - output_index: int - sequence_number: int - type: Literal["response.file_search_call.in_progress"] = "response.file_search_call.in_progress" + item_id: str = Field(description="Unique identifier of the file search call") + output_index: int = Field(description="Index position of the item in the output list") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.file_search_call.in_progress"] = Field( + default="response.file_search_call.in_progress", + description='Event type identifier, always "response.file_search_call.in_progress"', + ) @json_schema_type @@ -1221,10 +1364,13 @@ class OpenAIResponseObjectStreamResponseFileSearchCallSearching(BaseModel): :param type: Event type identifier, always "response.file_search_call.searching" """ - item_id: str - output_index: int - sequence_number: int - type: Literal["response.file_search_call.searching"] = "response.file_search_call.searching" + item_id: str = Field(description="Unique identifier of the file search call") + output_index: int = Field(description="Index position of the item in the output list") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.file_search_call.searching"] = Field( + default="response.file_search_call.searching", + description='Event type identifier, always "response.file_search_call.searching"', + ) @json_schema_type @@ -1237,10 +1383,13 @@ class OpenAIResponseObjectStreamResponseFileSearchCallCompleted(BaseModel): :param type: Event type identifier, always "response.file_search_call.completed" """ - item_id: str - output_index: int - sequence_number: int - type: Literal["response.file_search_call.completed"] = "response.file_search_call.completed" + item_id: str = Field(description="Unique identifier of the completed file search call") + output_index: int = Field(description="Index position of the item in the output list") + sequence_number: int = Field(description="Sequential number for ordering streaming events") + type: Literal["response.file_search_call.completed"] = Field( + default="response.file_search_call.completed", + description='Event type identifier, always "response.file_search_call.completed"', + ) OpenAIResponseObjectStream = Annotated[ @@ -1291,11 +1440,11 @@ class OpenAIResponseInputFunctionToolCallOutput(BaseModel): This represents the output of a function call that gets passed back to the model. """ - call_id: str - output: str - type: Literal["function_call_output"] = "function_call_output" - id: str | None = None - status: str | None = None + call_id: str = Field() + output: str = Field() + type: Literal["function_call_output"] = Field(default="function_call_output") + id: str | None = Field(default=None) + status: str | None = Field(default=None) OpenAIResponseInput = Annotated[ @@ -1317,8 +1466,8 @@ class ListOpenAIResponseInputItem(BaseModel): :param object: Object type identifier, always "list" """ - data: Sequence[OpenAIResponseInput] - object: Literal["list"] = "list" + data: Sequence[OpenAIResponseInput] = Field(description="List of input items") + object: Literal["list"] = Field(default="list", description='Object type identifier, always "list"') @json_schema_type @@ -1328,7 +1477,7 @@ class OpenAIResponseObjectWithInput(OpenAIResponseObject): :param input: List of input items that led to this response """ - input: Sequence[OpenAIResponseInput] + input: Sequence[OpenAIResponseInput] = Field(description="List of input items that led to this response") def to_response_object(self) -> OpenAIResponseObject: """Convert to OpenAIResponseObject by excluding input field.""" @@ -1346,8 +1495,10 @@ class ListOpenAIResponseObject(BaseModel): :param object: Object type identifier, always "list" """ - data: Sequence[OpenAIResponseObjectWithInput] - has_more: bool - first_id: str - last_id: str - object: Literal["list"] = "list" + data: Sequence[OpenAIResponseObjectWithInput] = Field( + description="List of response objects with their input context" + ) + has_more: bool = Field(description="Whether there are more results available beyond this page") + first_id: str = Field(description="Identifier of the first item in this page") + last_id: str = Field(description="Identifier of the last item in this page") + object: Literal["list"] = Field(default="list", description='Object type identifier, always "list"') diff --git a/src/llama_stack/apis/agents/routes.py b/src/llama_stack/apis/agents/routes.py new file mode 100644 index 0000000000..6161aa9f56 --- /dev/null +++ b/src/llama_stack/apis/agents/routes.py @@ -0,0 +1,452 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated + +from fastapi import Body, Depends, Query, Request +from fastapi import Path as FastAPIPath + +from llama_stack.apis.common.responses import Order +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1, LLAMA_STACK_API_V1ALPHA +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .agents_service import AgentsService +from .models import ( + Agent, + AgentConfig, + AgentCreateResponse, + AgentSessionCreateResponse, + AgentStepResponse, + AgentTurnCreateRequest, + AgentTurnResumeRequest, + CreateAgentSessionRequest, + CreateOpenAIResponseRequest, + Session, + Turn, +) +from .openai_responses import ( + ListOpenAIResponseInputItem, + ListOpenAIResponseObject, + OpenAIDeleteResponseObject, + OpenAIResponseObject, +) + + +def get_agents_service(request: Request) -> AgentsService: + """Dependency to get the agents service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.agents not in impls: + raise ValueError("Agents API implementation not found") + return impls[Api.agents] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Agents"], + responses=standard_responses, +) + +router_v1alpha = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1ALPHA}", + tags=["Agents"], + responses=standard_responses, +) + + +@router.post( + "/agents", + response_model=AgentCreateResponse, + summary="Create an agent.", + description="Create an agent with the given configuration.", + deprecated=True, +) +@router_v1alpha.post( + "/agents", + response_model=AgentCreateResponse, + summary="Create an agent.", + description="Create an agent with the given configuration.", +) +async def create_agent( + agent_config: AgentConfig = Body(...), + svc: AgentsService = Depends(get_agents_service), +) -> AgentCreateResponse: + """Create an agent with the given configuration.""" + return await svc.create_agent(agent_config=agent_config) + + +@router.post( + "/agents/{agent_id}/session/{session_id}/turn", + summary="Create a new turn for an agent.", + description="Create a new turn for an agent.", + deprecated=True, +) +@router_v1alpha.post( + "/agents/{{agent_id}}/session/{{session_id}}/turn", + summary="Create a new turn for an agent.", + description="Create a new turn for an agent.", +) +async def create_agent_turn( + agent_id: Annotated[str, FastAPIPath(..., description="The ID of the agent to create the turn for.")], + session_id: Annotated[str, FastAPIPath(..., description="The ID of the session to create the turn for.")], + body: AgentTurnCreateRequest = Body(...), + svc: AgentsService = Depends(get_agents_service), +): + """Create a new turn for an agent.""" + return await svc.create_agent_turn( + agent_id=agent_id, + session_id=session_id, + messages=body.messages, + stream=body.stream, + documents=body.documents, + toolgroups=body.toolgroups, + tool_config=body.tool_config, + ) + + +@router.post( + "/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume", + summary="Resume an agent turn.", + description="Resume an agent turn with executed tool call responses.", + deprecated=True, +) +@router_v1alpha.post( + "/agents/{{agent_id}}/session/{{session_id}}/turn/{{turn_id}}/resume", + summary="Resume an agent turn.", + description="Resume an agent turn with executed tool call responses.", +) +async def resume_agent_turn( + agent_id: Annotated[str, FastAPIPath(..., description="The ID of the agent to resume.")], + session_id: Annotated[str, FastAPIPath(..., description="The ID of the session to resume.")], + turn_id: Annotated[str, FastAPIPath(..., description="The ID of the turn to resume.")], + body: AgentTurnResumeRequest = Body(...), + svc: AgentsService = Depends(get_agents_service), +): + """Resume an agent turn with executed tool call responses.""" + return await svc.resume_agent_turn( + agent_id=agent_id, + session_id=session_id, + turn_id=turn_id, + tool_responses=body.tool_responses, + stream=body.stream, + ) + + +@router.get( + "/agents/{agent_id}/session/{session_id}/turn/{turn_id}", + response_model=Turn, + summary="Retrieve an agent turn.", + description="Retrieve an agent turn by its ID.", + deprecated=True, +) +@router_v1alpha.get( + "/agents/{{agent_id}}/session/{{session_id}}/turn/{{turn_id}}", + response_model=Turn, + summary="Retrieve an agent turn.", + description="Retrieve an agent turn by its ID.", +) +async def get_agents_turn( + agent_id: Annotated[str, FastAPIPath(..., description="The ID of the agent to get the turn for.")], + session_id: Annotated[str, FastAPIPath(..., description="The ID of the session to get the turn for.")], + turn_id: Annotated[str, FastAPIPath(..., description="The ID of the turn to get.")], + svc: AgentsService = Depends(get_agents_service), +) -> Turn: + """Retrieve an agent turn by its ID.""" + return await svc.get_agents_turn(agent_id=agent_id, session_id=session_id, turn_id=turn_id) + + +@router.get( + "/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}", + response_model=AgentStepResponse, + summary="Retrieve an agent step.", + description="Retrieve an agent step by its ID.", + deprecated=True, +) +@router_v1alpha.get( + "/agents/{{agent_id}}/session/{{session_id}}/turn/{{turn_id}}/step/{{step_id}}", + response_model=AgentStepResponse, + summary="Retrieve an agent step.", + description="Retrieve an agent step by its ID.", +) +async def get_agents_step( + agent_id: Annotated[str, FastAPIPath(..., description="The ID of the agent to get the step for.")], + session_id: Annotated[str, FastAPIPath(..., description="The ID of the session to get the step for.")], + turn_id: Annotated[str, FastAPIPath(..., description="The ID of the turn to get the step for.")], + step_id: Annotated[str, FastAPIPath(..., description="The ID of the step to get.")], + svc: AgentsService = Depends(get_agents_service), +) -> AgentStepResponse: + """Retrieve an agent step by its ID.""" + return await svc.get_agents_step(agent_id=agent_id, session_id=session_id, turn_id=turn_id, step_id=step_id) + + +@router.post( + "/agents/{agent_id}/session", + response_model=AgentSessionCreateResponse, + summary="Create a new session for an agent.", + description="Create a new session for an agent.", + deprecated=True, +) +@router_v1alpha.post( + "/agents/{{agent_id}}/session", + response_model=AgentSessionCreateResponse, + summary="Create a new session for an agent.", + description="Create a new session for an agent.", +) +async def create_agent_session( + agent_id: Annotated[str, FastAPIPath(..., description="The ID of the agent to create the session for.")], + body: CreateAgentSessionRequest = Body(...), + svc: AgentsService = Depends(get_agents_service), +) -> AgentSessionCreateResponse: + """Create a new session for an agent.""" + return await svc.create_agent_session(agent_id=agent_id, session_name=body.session_name) + + +@router.get( + "/agents/{agent_id}/session/{session_id}", + response_model=Session, + summary="Retrieve an agent session.", + description="Retrieve an agent session by its ID.", + deprecated=True, +) +@router_v1alpha.get( + "/agents/{{agent_id}}/session/{{session_id}}", + response_model=Session, + summary="Retrieve an agent session.", + description="Retrieve an agent session by its ID.", +) +async def get_agents_session( + agent_id: Annotated[str, FastAPIPath(..., description="The ID of the agent to get the session for.")], + session_id: Annotated[str, FastAPIPath(..., description="The ID of the session to get.")], + turn_ids: list[str] | None = Query(None, description="List of turn IDs to filter the session by."), + svc: AgentsService = Depends(get_agents_service), +) -> Session: + """Retrieve an agent session by its ID.""" + return await svc.get_agents_session(session_id=session_id, agent_id=agent_id, turn_ids=turn_ids) + + +@router.delete( + "/agents/{agent_id}/session/{session_id}", + response_model=None, + status_code=204, + summary="Delete an agent session.", + description="Delete an agent session by its ID.", + deprecated=True, +) +@router_v1alpha.delete( + "/agents/{{agent_id}}/session/{{session_id}}", + response_model=None, + status_code=204, + summary="Delete an agent session.", + description="Delete an agent session by its ID.", +) +async def delete_agents_session( + agent_id: Annotated[str, FastAPIPath(..., description="The ID of the agent to delete the session for.")], + session_id: Annotated[str, FastAPIPath(..., description="The ID of the session to delete.")], + svc: AgentsService = Depends(get_agents_service), +) -> None: + """Delete an agent session by its ID and its associated turns.""" + await svc.delete_agents_session(session_id=session_id, agent_id=agent_id) + + +@router.delete( + "/agents/{agent_id}", + response_model=None, + status_code=204, + summary="Delete an agent.", + description="Delete an agent by its ID.", + deprecated=True, +) +@router_v1alpha.delete( + "/agents/{{agent_id}}", + response_model=None, + status_code=204, + summary="Delete an agent.", + description="Delete an agent by its ID.", +) +async def delete_agent( + agent_id: Annotated[str, FastAPIPath(..., description="The ID of the agent to delete.")], + svc: AgentsService = Depends(get_agents_service), +) -> None: + """Delete an agent by its ID and its associated sessions and turns.""" + await svc.delete_agent(agent_id=agent_id) + + +@router.get( + "/agents", + summary="List all agents.", + description="List all agents.", + deprecated=True, +) +@router_v1alpha.get( + "/agents", + summary="List all agents.", + description="List all agents.", +) +async def list_agents( + start_index: int | None = Query(None, description="The index to start the pagination from."), + limit: int | None = Query(None, description="The number of agents to return."), + svc: AgentsService = Depends(get_agents_service), +): + """List all agents.""" + return await svc.list_agents(start_index=start_index, limit=limit) + + +@router.get( + "/agents/{agent_id}", + response_model=Agent, + summary="Describe an agent.", + description="Describe an agent by its ID.", + deprecated=True, +) +@router_v1alpha.get( + "/agents/{{agent_id}}", + response_model=Agent, + summary="Describe an agent.", + description="Describe an agent by its ID.", +) +async def get_agent( + agent_id: Annotated[str, FastAPIPath(..., description="ID of the agent.")], + svc: AgentsService = Depends(get_agents_service), +) -> Agent: + """Describe an agent by its ID.""" + return await svc.get_agent(agent_id=agent_id) + + +@router.get( + "/agents/{agent_id}/sessions", + summary="List all sessions of an agent.", + description="List all session(s) of a given agent.", + deprecated=True, +) +@router_v1alpha.get( + "/agents/{{agent_id}}/sessions", + summary="List all sessions of an agent.", + description="List all session(s) of a given agent.", +) +async def list_agent_sessions( + agent_id: Annotated[str, FastAPIPath(..., description="The ID of the agent to list sessions for.")], + start_index: int | None = Query(None, description="The index to start the pagination from."), + limit: int | None = Query(None, description="The number of sessions to return."), + svc: AgentsService = Depends(get_agents_service), +): + """List all session(s) of a given agent.""" + return await svc.list_agent_sessions(agent_id=agent_id, start_index=start_index, limit=limit) + + +# OpenAI Responses API endpoints +@router.get( + "/responses/{response_id}", + response_model=OpenAIResponseObject, + summary="Get a model response.", + description="Get a model response.", +) +async def get_openai_response( + response_id: Annotated[str, FastAPIPath(..., description="The ID of the OpenAI response to retrieve.")], + svc: AgentsService = Depends(get_agents_service), +) -> OpenAIResponseObject: + """Get a model response.""" + return await svc.get_openai_response(response_id=response_id) + + +@router.post( + "/responses", + summary="Create a model response.", + description="Create a model response.", +) +async def create_openai_response( + body: CreateOpenAIResponseRequest = Body(...), + svc: AgentsService = Depends(get_agents_service), +): + """Create a model response.""" + return await svc.create_openai_response( + input=body.input, + model=body.model, + prompt=body.prompt, + instructions=body.instructions, + previous_response_id=body.previous_response_id, + conversation=body.conversation, + store=body.store, + stream=body.stream, + temperature=body.temperature, + text=body.text, + tools=body.tools, + include=body.include, + max_infer_iters=body.max_infer_iters, + guardrails=body.guardrails, + ) + + +@router.get( + "/responses", + response_model=ListOpenAIResponseObject, + summary="List all responses.", + description="List all responses.", +) +async def list_openai_responses( + after: str | None = Query(None, description="The ID of the last response to return."), + limit: int | None = Query(50, description="The number of responses to return."), + model: str | None = Query(None, description="The model to filter responses by."), + order: Order | None = Query( + Order.desc, description="The order to sort responses by when sorted by created_at ('asc' or 'desc')." + ), + svc: AgentsService = Depends(get_agents_service), +) -> ListOpenAIResponseObject: + """List all responses.""" + return await svc.list_openai_responses(after=after, limit=limit, model=model, order=order) + + +@router.get( + "/responses/{response_id}/input_items", + response_model=ListOpenAIResponseInputItem, + summary="List input items.", + description="List input items.", +) +async def list_openai_response_input_items( + response_id: Annotated[str, FastAPIPath(..., description="The ID of the response to retrieve input items for.")], + after: str | None = Query(None, description="An item ID to list items after, used for pagination."), + before: str | None = Query(None, description="An item ID to list items before, used for pagination."), + include: list[str] | None = Query(None, description="Additional fields to include in the response."), + limit: int | None = Query( + 20, + description="A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.", + ge=1, + le=100, + ), + order: Order | None = Query(Order.desc, description="The order to return the input items in. Default is desc."), + svc: AgentsService = Depends(get_agents_service), +) -> ListOpenAIResponseInputItem: + """List input items.""" + return await svc.list_openai_response_input_items( + response_id=response_id, after=after, before=before, include=include, limit=limit, order=order + ) + + +@router.delete( + "/responses/{response_id}", + response_model=OpenAIDeleteResponseObject, + summary="Delete a response.", + description="Delete a response.", +) +async def delete_openai_response( + response_id: Annotated[str, FastAPIPath(..., description="The ID of the OpenAI response to delete.")], + svc: AgentsService = Depends(get_agents_service), +) -> OpenAIDeleteResponseObject: + """Delete a response.""" + return await svc.delete_openai_response(response_id=response_id) + + +# For backward compatibility with the router registry system +def create_agents_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Agents API (legacy compatibility).""" + main_router = APIRouter() + main_router.include_router(router) + main_router.include_router(router_v1alpha) + return main_router + + +# Register the router factory +register_router(Api.agents, create_agents_router) diff --git a/src/llama_stack/apis/batches/__init__.py b/src/llama_stack/apis/batches/__init__.py index 9ce7d3d75c..036786c0e7 100644 --- a/src/llama_stack/apis/batches/__init__.py +++ b/src/llama_stack/apis/batches/__init__.py @@ -4,6 +4,17 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .batches import Batches, BatchObject, ListBatchesResponse +try: + from openai.types import Batch as BatchObject +except ImportError: + BatchObject = None # type: ignore[assignment,misc] -__all__ = ["Batches", "BatchObject", "ListBatchesResponse"] +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .batches_service import BatchService +from .models import CreateBatchRequest, ListBatchesResponse + +# Backward compatibility - export Batches as alias for BatchService +Batches = BatchService + +__all__ = ["Batches", "BatchService", "BatchObject", "ListBatchesResponse", "CreateBatchRequest"] diff --git a/src/llama_stack/apis/batches/batches.py b/src/llama_stack/apis/batches/batches.py deleted file mode 100644 index 1ee9fdb15d..0000000000 --- a/src/llama_stack/apis/batches/batches.py +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -from typing import Literal, Protocol, runtime_checkable - -from pydantic import BaseModel, Field - -from llama_stack.apis.version import LLAMA_STACK_API_V1 -from llama_stack.schema_utils import json_schema_type, webmethod - -try: - from openai.types import Batch as BatchObject -except ImportError as e: - raise ImportError("OpenAI package is required for batches API. Please install it with: pip install openai") from e - - -@json_schema_type -class ListBatchesResponse(BaseModel): - """Response containing a list of batch objects.""" - - object: Literal["list"] = "list" - data: list[BatchObject] = Field(..., description="List of batch objects") - first_id: str | None = Field(default=None, description="ID of the first batch in the list") - last_id: str | None = Field(default=None, description="ID of the last batch in the list") - has_more: bool = Field(default=False, description="Whether there are more batches available") - - -@runtime_checkable -class Batches(Protocol): - """ - The Batches API enables efficient processing of multiple requests in a single operation, - particularly useful for processing large datasets, batch evaluation workflows, and - cost-effective inference at scale. - - The API is designed to allow use of openai client libraries for seamless integration. - - This API provides the following extensions: - - idempotent batch creation - - Note: This API is currently under active development and may undergo changes. - """ - - @webmethod(route="/batches", method="POST", level=LLAMA_STACK_API_V1) - async def create_batch( - self, - input_file_id: str, - endpoint: str, - completion_window: Literal["24h"], - metadata: dict[str, str] | None = None, - idempotency_key: str | None = None, - ) -> BatchObject: - """Create a new batch for processing multiple API requests. - - :param input_file_id: The ID of an uploaded file containing requests for the batch. - :param endpoint: The endpoint to be used for all requests in the batch. - :param completion_window: The time window within which the batch should be processed. - :param metadata: Optional metadata for the batch. - :param idempotency_key: Optional idempotency key. When provided, enables idempotent behavior. - :returns: The created batch object. - """ - ... - - @webmethod(route="/batches/{batch_id}", method="GET", level=LLAMA_STACK_API_V1) - async def retrieve_batch(self, batch_id: str) -> BatchObject: - """Retrieve information about a specific batch. - - :param batch_id: The ID of the batch to retrieve. - :returns: The batch object. - """ - ... - - @webmethod(route="/batches/{batch_id}/cancel", method="POST", level=LLAMA_STACK_API_V1) - async def cancel_batch(self, batch_id: str) -> BatchObject: - """Cancel a batch that is in progress. - - :param batch_id: The ID of the batch to cancel. - :returns: The updated batch object. - """ - ... - - @webmethod(route="/batches", method="GET", level=LLAMA_STACK_API_V1) - async def list_batches( - self, - after: str | None = None, - limit: int = 20, - ) -> ListBatchesResponse: - """List all batches for the current user. - - :param after: A cursor for pagination; returns batches after this batch ID. - :param limit: Number of batches to return (default 20, max 100). - :returns: A list of batch objects. - """ - ... diff --git a/src/llama_stack/apis/batches/batches_service.py b/src/llama_stack/apis/batches/batches_service.py new file mode 100644 index 0000000000..3c6d12362e --- /dev/null +++ b/src/llama_stack/apis/batches/batches_service.py @@ -0,0 +1,56 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Literal, Protocol, runtime_checkable + +try: + from openai.types import Batch as BatchObject +except ImportError as e: + raise ImportError("OpenAI package is required for batches API. Please install it with: pip install openai") from e + +from .models import ListBatchesResponse + + +@runtime_checkable +class BatchService(Protocol): + """The Batches API enables efficient processing of multiple requests in a single operation, + particularly useful for processing large datasets, batch evaluation workflows, and + cost-effective inference at scale. + + The API is designed to allow use of openai client libraries for seamless integration. + + This API provides the following extensions: + - idempotent batch creation + + Note: This API is currently under active development and may undergo changes. + """ + + async def create_batch( + self, + input_file_id: str, + endpoint: str, + completion_window: Literal["24h"], + metadata: dict[str, str] | None = None, + idempotency_key: str | None = None, + ) -> BatchObject: + """Create a new batch for processing multiple API requests.""" + ... + + async def retrieve_batch(self, batch_id: str) -> BatchObject: + """Retrieve information about a specific batch.""" + ... + + async def cancel_batch(self, batch_id: str) -> BatchObject: + """Cancel a batch that is in progress.""" + ... + + async def list_batches( + self, + after: str | None = None, + limit: int = 20, + ) -> ListBatchesResponse: + """List all batches for the current user.""" + ... diff --git a/src/llama_stack/apis/batches/models.py b/src/llama_stack/apis/batches/models.py new file mode 100644 index 0000000000..01a4ec32fd --- /dev/null +++ b/src/llama_stack/apis/batches/models.py @@ -0,0 +1,42 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Literal + +from pydantic import BaseModel, Field + +from llama_stack.schema_utils import json_schema_type + +try: + from openai.types import Batch as BatchObject +except ImportError as e: + raise ImportError("OpenAI package is required for batches API. Please install it with: pip install openai") from e + + +@json_schema_type +class CreateBatchRequest(BaseModel): + """Request model for creating a batch.""" + + input_file_id: str = Field(..., description="The ID of an uploaded file containing requests for the batch.") + endpoint: str = Field(..., description="The endpoint to be used for all requests in the batch.") + completion_window: Literal["24h"] = Field( + ..., description="The time window within which the batch should be processed." + ) + metadata: dict[str, str] | None = Field(default=None, description="Optional metadata for the batch.") + idempotency_key: str | None = Field( + default=None, description="Optional idempotency key. When provided, enables idempotent behavior." + ) + + +@json_schema_type +class ListBatchesResponse(BaseModel): + """Response containing a list of batch objects.""" + + object: Literal["list"] = Field(default="list", description="The object type, which is always 'list'.") + data: list[BatchObject] = Field(..., description="List of batch objects.") + first_id: str | None = Field(default=None, description="ID of the first batch in the list.") + last_id: str | None = Field(default=None, description="ID of the last batch in the list.") + has_more: bool = Field(default=False, description="Whether there are more batches available.") diff --git a/src/llama_stack/apis/batches/routes.py b/src/llama_stack/apis/batches/routes.py new file mode 100644 index 0000000000..3d8583b5f2 --- /dev/null +++ b/src/llama_stack/apis/batches/routes.py @@ -0,0 +1,111 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated + +from fastapi import Body, Depends, Query, Request +from fastapi import Path as FastAPIPath + +try: + from openai.types import Batch as BatchObject +except ImportError as e: + raise ImportError("OpenAI package is required for batches API. Please install it with: pip install openai") from e + +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1 +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .batches_service import BatchService +from .models import CreateBatchRequest, ListBatchesResponse + + +def get_batch_service(request: Request) -> BatchService: + """Dependency to get the batch service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.batches not in impls: + raise ValueError("Batches API implementation not found") + return impls[Api.batches] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Batches"], + responses=standard_responses, +) + + +@router.post( + "/batches", + response_model=BatchObject, + summary="Create a new batch for processing multiple API requests.", + description="Create a new batch for processing multiple API requests.", +) +async def create_batch( + request: CreateBatchRequest = Body(...), + svc: BatchService = Depends(get_batch_service), +) -> BatchObject: + """Create a new batch.""" + return await svc.create_batch( + input_file_id=request.input_file_id, + endpoint=request.endpoint, + completion_window=request.completion_window, + metadata=request.metadata, + idempotency_key=request.idempotency_key, + ) + + +@router.get( + "/batches/{batch_id}", + response_model=BatchObject, + summary="Retrieve information about a specific batch.", + description="Retrieve information about a specific batch.", +) +async def retrieve_batch( + batch_id: Annotated[str, FastAPIPath(..., description="The ID of the batch to retrieve.")], + svc: BatchService = Depends(get_batch_service), +) -> BatchObject: + """Retrieve batch information.""" + return await svc.retrieve_batch(batch_id) + + +@router.post( + "/batches/{batch_id}/cancel", + response_model=BatchObject, + summary="Cancel a batch that is in progress.", + description="Cancel a batch that is in progress.", +) +async def cancel_batch( + batch_id: Annotated[str, FastAPIPath(..., description="The ID of the batch to cancel.")], + svc: BatchService = Depends(get_batch_service), +) -> BatchObject: + """Cancel a batch.""" + return await svc.cancel_batch(batch_id) + + +@router.get( + "/batches", + response_model=ListBatchesResponse, + summary="List all batches for the current user.", + description="List all batches for the current user.", +) +async def list_batches( + after: str | None = Query(None, description="A cursor for pagination; returns batches after this batch ID."), + limit: int = Query(20, description="Number of batches to return (default 20, max 100).", ge=1, le=100), + svc: BatchService = Depends(get_batch_service), +) -> ListBatchesResponse: + """List all batches.""" + return await svc.list_batches(after=after, limit=limit) + + +# For backward compatibility with the router registry system +def create_batches_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Batches API (legacy compatibility).""" + return router + + +# Register the router factory +register_router(Api.batches, create_batches_router) diff --git a/src/llama_stack/apis/benchmarks/__init__.py b/src/llama_stack/apis/benchmarks/__init__.py index 62d1b367c5..67c44eb6aa 100644 --- a/src/llama_stack/apis/benchmarks/__init__.py +++ b/src/llama_stack/apis/benchmarks/__init__.py @@ -4,4 +4,26 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .benchmarks import * +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .benchmarks_service import BenchmarksService +from .models import ( + Benchmark, + BenchmarkInput, + CommonBenchmarkFields, + ListBenchmarksResponse, + RegisterBenchmarkRequest, +) + +# Backward compatibility - export Benchmarks as alias for BenchmarksService +Benchmarks = BenchmarksService + +__all__ = [ + "Benchmarks", + "BenchmarksService", + "Benchmark", + "BenchmarkInput", + "CommonBenchmarkFields", + "ListBenchmarksResponse", + "RegisterBenchmarkRequest", +] diff --git a/src/llama_stack/apis/benchmarks/benchmarks.py b/src/llama_stack/apis/benchmarks/benchmarks.py deleted file mode 100644 index 9332054890..0000000000 --- a/src/llama_stack/apis/benchmarks/benchmarks.py +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. -from typing import Any, Literal, Protocol, runtime_checkable - -from pydantic import BaseModel, Field - -from llama_stack.apis.resource import Resource, ResourceType -from llama_stack.apis.version import LLAMA_STACK_API_V1ALPHA -from llama_stack.schema_utils import json_schema_type, webmethod - - -class CommonBenchmarkFields(BaseModel): - dataset_id: str - scoring_functions: list[str] - metadata: dict[str, Any] = Field( - default_factory=dict, - description="Metadata for this evaluation task", - ) - - -@json_schema_type -class Benchmark(CommonBenchmarkFields, Resource): - """A benchmark resource for evaluating model performance. - - :param dataset_id: Identifier of the dataset to use for the benchmark evaluation - :param scoring_functions: List of scoring function identifiers to apply during evaluation - :param metadata: Metadata for this evaluation task - :param type: The resource type, always benchmark - """ - - type: Literal[ResourceType.benchmark] = ResourceType.benchmark - - @property - def benchmark_id(self) -> str: - return self.identifier - - @property - def provider_benchmark_id(self) -> str | None: - return self.provider_resource_id - - -class BenchmarkInput(CommonBenchmarkFields, BaseModel): - benchmark_id: str - provider_id: str | None = None - provider_benchmark_id: str | None = None - - -class ListBenchmarksResponse(BaseModel): - data: list[Benchmark] - - -@runtime_checkable -class Benchmarks(Protocol): - @webmethod(route="/eval/benchmarks", method="GET", level=LLAMA_STACK_API_V1ALPHA) - async def list_benchmarks(self) -> ListBenchmarksResponse: - """List all benchmarks. - - :returns: A ListBenchmarksResponse. - """ - ... - - @webmethod(route="/eval/benchmarks/{benchmark_id}", method="GET", level=LLAMA_STACK_API_V1ALPHA) - async def get_benchmark( - self, - benchmark_id: str, - ) -> Benchmark: - """Get a benchmark by its ID. - - :param benchmark_id: The ID of the benchmark to get. - :returns: A Benchmark. - """ - ... - - @webmethod(route="/eval/benchmarks", method="POST", level=LLAMA_STACK_API_V1ALPHA) - async def register_benchmark( - self, - benchmark_id: str, - dataset_id: str, - scoring_functions: list[str], - provider_benchmark_id: str | None = None, - provider_id: str | None = None, - metadata: dict[str, Any] | None = None, - ) -> None: - """Register a benchmark. - - :param benchmark_id: The ID of the benchmark to register. - :param dataset_id: The ID of the dataset to use for the benchmark. - :param scoring_functions: The scoring functions to use for the benchmark. - :param provider_benchmark_id: The ID of the provider benchmark to use for the benchmark. - :param provider_id: The ID of the provider to use for the benchmark. - :param metadata: The metadata to use for the benchmark. - """ - ... - - @webmethod(route="/eval/benchmarks/{benchmark_id}", method="DELETE", level=LLAMA_STACK_API_V1ALPHA) - async def unregister_benchmark(self, benchmark_id: str) -> None: - """Unregister a benchmark. - - :param benchmark_id: The ID of the benchmark to unregister. - """ - ... diff --git a/src/llama_stack/apis/benchmarks/benchmarks_service.py b/src/llama_stack/apis/benchmarks/benchmarks_service.py new file mode 100644 index 0000000000..05ebbde17d --- /dev/null +++ b/src/llama_stack/apis/benchmarks/benchmarks_service.py @@ -0,0 +1,42 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Any, Protocol, runtime_checkable + +from llama_stack.core.telemetry.trace_protocol import trace_protocol + +from .models import Benchmark, ListBenchmarksResponse + + +@runtime_checkable +@trace_protocol +class BenchmarksService(Protocol): + async def list_benchmarks(self) -> ListBenchmarksResponse: + """List all benchmarks.""" + ... + + async def get_benchmark( + self, + benchmark_id: str, + ) -> Benchmark: + """Get a benchmark by its ID.""" + ... + + async def register_benchmark( + self, + benchmark_id: str, + dataset_id: str, + scoring_functions: list[str], + provider_benchmark_id: str | None = None, + provider_id: str | None = None, + metadata: dict[str, Any] | None = None, + ) -> None: + """Register a benchmark.""" + ... + + async def unregister_benchmark(self, benchmark_id: str) -> None: + """Unregister a benchmark.""" + ... diff --git a/src/llama_stack/apis/benchmarks/models.py b/src/llama_stack/apis/benchmarks/models.py new file mode 100644 index 0000000000..84507becb5 --- /dev/null +++ b/src/llama_stack/apis/benchmarks/models.py @@ -0,0 +1,58 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Any, Literal + +from pydantic import BaseModel, Field + +from llama_stack.apis.resource import Resource, ResourceType +from llama_stack.schema_utils import json_schema_type + + +class CommonBenchmarkFields(BaseModel): + dataset_id: str = Field(..., description="The ID of the dataset to use for the benchmark") + scoring_functions: list[str] = Field(..., description="The scoring functions to use for the benchmark") + metadata: dict[str, Any] = Field( + default_factory=dict, + description="Metadata for this evaluation task", + ) + + +@json_schema_type +class Benchmark(CommonBenchmarkFields, Resource): + """A benchmark resource for evaluating model performance.""" + + type: Literal[ResourceType.benchmark] = Field( + default=ResourceType.benchmark, description="The resource type, always benchmark" + ) + + +class ListBenchmarksResponse(BaseModel): + """Response model for listing benchmarks.""" + + data: list[Benchmark] = Field(..., description="List of benchmark resources") + + +@json_schema_type +class RegisterBenchmarkRequest(BaseModel): + """Request model for registering a benchmark.""" + + benchmark_id: str = Field(..., description="The ID of the benchmark to register") + dataset_id: str = Field(..., description="The ID of the dataset to use for the benchmark") + scoring_functions: list[str] = Field(..., description="The scoring functions to use for the benchmark") + provider_benchmark_id: str | None = Field( + default=None, description="The ID of the provider benchmark to use for the benchmark" + ) + provider_id: str | None = Field(default=None, description="The ID of the provider to use for the benchmark") + metadata: dict[str, Any] | None = Field(default=None, description="The metadata to use for the benchmark") + + +class BenchmarkInput(CommonBenchmarkFields, BaseModel): + benchmark_id: str = Field(..., description="The ID of the benchmark to use for the benchmark") + provider_id: str | None = Field(default=None, description="The ID of the provider to use for the benchmark") + provider_benchmark_id: str | None = Field( + default=None, description="The ID of the provider benchmark to use for the benchmark" + ) diff --git a/src/llama_stack/apis/benchmarks/routes.py b/src/llama_stack/apis/benchmarks/routes.py new file mode 100644 index 0000000000..654e70fd00 --- /dev/null +++ b/src/llama_stack/apis/benchmarks/routes.py @@ -0,0 +1,144 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated + +from fastapi import Body, Depends, Request +from fastapi import Path as FastAPIPath + +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1, LLAMA_STACK_API_V1ALPHA +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .benchmarks_service import BenchmarksService +from .models import Benchmark, ListBenchmarksResponse, RegisterBenchmarkRequest + + +def get_benchmarks_service(request: Request) -> BenchmarksService: + """Dependency to get the benchmarks service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.benchmarks not in impls: + raise ValueError("Benchmarks API implementation not found") + return impls[Api.benchmarks] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Benchmarks"], + responses=standard_responses, +) + +router_v1alpha = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1ALPHA}", + tags=["Benchmarks"], + responses=standard_responses, +) + + +@router.get( + "/eval/benchmarks", + response_model=ListBenchmarksResponse, + summary="List all benchmarks", + description="List all benchmarks", + deprecated=True, +) +@router_v1alpha.get( + "/eval/benchmarks", + response_model=ListBenchmarksResponse, + summary="List all benchmarks", + description="List all benchmarks", +) +async def list_benchmarks(svc: BenchmarksService = Depends(get_benchmarks_service)) -> ListBenchmarksResponse: + """List all benchmarks.""" + return await svc.list_benchmarks() + + +@router.get( + "/eval/benchmarks/{benchmark_id}", + response_model=Benchmark, + summary="Get a benchmark by its ID", + description="Get a benchmark by its ID", + deprecated=True, +) +@router_v1alpha.get( + "/eval/benchmarks/{{benchmark_id}}", + response_model=Benchmark, + summary="Get a benchmark by its ID", + description="Get a benchmark by its ID", +) +async def get_benchmark( + benchmark_id: Annotated[str, FastAPIPath(..., description="The ID of the benchmark to get")], + svc: BenchmarksService = Depends(get_benchmarks_service), +) -> Benchmark: + """Get a benchmark by its ID.""" + return await svc.get_benchmark(benchmark_id=benchmark_id) + + +@router.post( + "/eval/benchmarks", + response_model=None, + status_code=204, + summary="Register a benchmark", + description="Register a benchmark", + deprecated=True, +) +@router_v1alpha.post( + "/eval/benchmarks", + response_model=None, + status_code=204, + summary="Register a benchmark", + description="Register a benchmark", +) +async def register_benchmark( + body: RegisterBenchmarkRequest = Body(...), + svc: BenchmarksService = Depends(get_benchmarks_service), +) -> None: + """Register a benchmark.""" + return await svc.register_benchmark( + benchmark_id=body.benchmark_id, + dataset_id=body.dataset_id, + scoring_functions=body.scoring_functions, + provider_benchmark_id=body.provider_benchmark_id, + provider_id=body.provider_id, + metadata=body.metadata, + ) + + +@router.delete( + "/eval/benchmarks/{benchmark_id}", + response_model=None, + status_code=204, + summary="Unregister a benchmark", + description="Unregister a benchmark", + deprecated=True, +) +@router_v1alpha.delete( + "/eval/benchmarks/{{benchmark_id}}", + response_model=None, + status_code=204, + summary="Unregister a benchmark", + description="Unregister a benchmark", +) +async def unregister_benchmark( + benchmark_id: Annotated[str, FastAPIPath(..., description="The ID of the benchmark to unregister")], + svc: BenchmarksService = Depends(get_benchmarks_service), +) -> None: + """Unregister a benchmark.""" + await svc.unregister_benchmark(benchmark_id=benchmark_id) + + +# For backward compatibility with the router registry system +def create_benchmarks_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Benchmarks API (legacy compatibility).""" + main_router = APIRouter() + main_router.include_router(router) + main_router.include_router(router_v1alpha) + return main_router + + +# Register the router factory +register_router(Api.benchmarks, create_benchmarks_router) diff --git a/src/llama_stack/apis/common/content_types.py b/src/llama_stack/apis/common/content_types.py index 950dd17ff0..e3c79f053f 100644 --- a/src/llama_stack/apis/common/content_types.py +++ b/src/llama_stack/apis/common/content_types.py @@ -15,21 +15,13 @@ @json_schema_type class URL(BaseModel): - """A URL reference to external content. - - :param uri: The URL string pointing to the resource - """ + """A URL reference to external content.""" uri: str class _URLOrData(BaseModel): - """ - A URL or a base64 encoded string - - :param url: A URL of the image or data URL in the format of data:image/{type};base64,{data}. Note that URL could have length limits. - :param data: base64 encoded image data as string - """ + """A URL or a base64 encoded string.""" url: URL | None = None # data is a base64 encoded string, hint with contentEncoding=base64 @@ -45,11 +37,7 @@ def validator(cls, values): @json_schema_type class ImageContentItem(BaseModel): - """A image content item - - :param type: Discriminator type of the content item. Always "image" - :param image: Image as a base64 encoded string or an URL - """ + """A image content item.""" type: Literal["image"] = "image" image: _URLOrData @@ -57,11 +45,7 @@ class ImageContentItem(BaseModel): @json_schema_type class TextContentItem(BaseModel): - """A text content item - - :param type: Discriminator type of the content item. Always "text" - :param text: Text content - """ + """A text content item.""" type: Literal["text"] = "text" text: str @@ -81,11 +65,7 @@ class TextContentItem(BaseModel): @json_schema_type class TextDelta(BaseModel): - """A text content delta for streaming responses. - - :param type: Discriminator type of the delta. Always "text" - :param text: The incremental text content - """ + """A text content delta for streaming responses.""" type: Literal["text"] = "text" text: str @@ -93,23 +73,14 @@ class TextDelta(BaseModel): @json_schema_type class ImageDelta(BaseModel): - """An image content delta for streaming responses. - - :param type: Discriminator type of the delta. Always "image" - :param image: The incremental image data as bytes - """ + """An image content delta for streaming responses.""" type: Literal["image"] = "image" image: bytes class ToolCallParseStatus(Enum): - """Status of tool call parsing during streaming. - :cvar started: Tool call parsing has begun - :cvar in_progress: Tool call parsing is ongoing - :cvar failed: Tool call parsing failed - :cvar succeeded: Tool call parsing completed successfully - """ + """Status of tool call parsing during streaming.""" started = "started" in_progress = "in_progress" @@ -119,12 +90,7 @@ class ToolCallParseStatus(Enum): @json_schema_type class ToolCallDelta(BaseModel): - """A tool call content delta for streaming responses. - - :param type: Discriminator type of the delta. Always "tool_call" - :param tool_call: Either an in-progress tool call string or the final parsed tool call - :param parse_status: Current parsing status of the tool call - """ + """A tool call content delta for streaming responses.""" type: Literal["tool_call"] = "tool_call" diff --git a/src/llama_stack/apis/common/job_types.py b/src/llama_stack/apis/common/job_types.py index 5da42bfd3a..860871d6f4 100644 --- a/src/llama_stack/apis/common/job_types.py +++ b/src/llama_stack/apis/common/job_types.py @@ -28,11 +28,7 @@ class JobStatus(Enum): @json_schema_type class Job(BaseModel): - """A job execution instance with status tracking. - - :param job_id: Unique identifier for the job - :param status: Current execution status of the job - """ + """A job execution instance with status tracking.""" job_id: str status: JobStatus diff --git a/src/llama_stack/apis/common/responses.py b/src/llama_stack/apis/common/responses.py index 616bee73aa..2994cfe8e3 100644 --- a/src/llama_stack/apis/common/responses.py +++ b/src/llama_stack/apis/common/responses.py @@ -7,16 +7,13 @@ from enum import Enum from typing import Any -from pydantic import BaseModel +from pydantic import BaseModel, Field from llama_stack.schema_utils import json_schema_type class Order(Enum): - """Sort order for paginated responses. - :cvar asc: Ascending order - :cvar desc: Descending order - """ + """Sort order for paginated responses.""" asc = "asc" desc = "desc" @@ -24,13 +21,8 @@ class Order(Enum): @json_schema_type class PaginatedResponse(BaseModel): - """A generic paginated response that follows a simple format. + """A generic paginated response that follows a simple format.""" - :param data: The list of items for the current page - :param has_more: Whether there are more items available after this set - :param url: The URL for accessing this list - """ - - data: list[dict[str, Any]] - has_more: bool - url: str | None = None + data: list[dict[str, Any]] = Field(description="The list of items for the current page.") + has_more: bool = Field(description="Whether there are more items available after this set.") + url: str | None = Field(description="The URL for accessing this list.") diff --git a/src/llama_stack/apis/common/training_types.py b/src/llama_stack/apis/common/training_types.py index 5c236a25d5..1b390ec350 100644 --- a/src/llama_stack/apis/common/training_types.py +++ b/src/llama_stack/apis/common/training_types.py @@ -6,42 +6,28 @@ from datetime import datetime -from pydantic import BaseModel +from pydantic import BaseModel, Field from llama_stack.schema_utils import json_schema_type @json_schema_type class PostTrainingMetric(BaseModel): - """Training metrics captured during post-training jobs. + """Training metrics captured during post-training jobs.""" - :param epoch: Training epoch number - :param train_loss: Loss value on the training dataset - :param validation_loss: Loss value on the validation dataset - :param perplexity: Perplexity metric indicating model confidence - """ - - epoch: int - train_loss: float - validation_loss: float - perplexity: float + epoch: int = Field(description="Training epoch number.") + train_loss: float = Field(description="Loss value on the training dataset.") + validation_loss: float = Field(description="Loss value on the validation dataset.") + perplexity: float = Field(description="Perplexity metric indicating model confidence.") @json_schema_type class Checkpoint(BaseModel): - """Checkpoint created during training runs. - - :param identifier: Unique identifier for the checkpoint - :param created_at: Timestamp when the checkpoint was created - :param epoch: Training epoch when the checkpoint was saved - :param post_training_job_id: Identifier of the training job that created this checkpoint - :param path: File system path where the checkpoint is stored - :param training_metrics: (Optional) Training metrics associated with this checkpoint - """ - - identifier: str - created_at: datetime - epoch: int - post_training_job_id: str - path: str - training_metrics: PostTrainingMetric | None = None + """Checkpoint created during training runs.""" + + identifier: str = Field(description="Unique identifier for the checkpoint.") + created_at: datetime = Field(description="Timestamp when the checkpoint was created.") + epoch: int = Field(description="Training epoch when the checkpoint was saved.") + post_training_job_id: str = Field(description="Identifier of the training job that created this checkpoint.") + path: str = Field(description="File system path where the checkpoint is stored.") + training_metrics: PostTrainingMetric | None = Field(description="Training metrics associated with this checkpoint.") diff --git a/src/llama_stack/apis/conversations/__init__.py b/src/llama_stack/apis/conversations/__init__.py index 2d214d27a3..b9d3e7e082 100644 --- a/src/llama_stack/apis/conversations/__init__.py +++ b/src/llama_stack/apis/conversations/__init__.py @@ -4,28 +4,38 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .conversations import ( +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .conversations_service import ConversationService +from .models import ( Conversation, ConversationCreateRequest, ConversationDeletedResource, ConversationItem, ConversationItemCreateRequest, ConversationItemDeletedResource, + ConversationItemInclude, ConversationItemList, - Conversations, + ConversationMessage, ConversationUpdateRequest, Metadata, ) +# Backward compatibility - export Conversations as alias for ConversationService +Conversations = ConversationService + __all__ = [ + "Conversations", + "ConversationService", "Conversation", + "ConversationMessage", + "ConversationItem", "ConversationCreateRequest", + "ConversationUpdateRequest", "ConversationDeletedResource", - "ConversationItem", "ConversationItemCreateRequest", - "ConversationItemDeletedResource", "ConversationItemList", - "Conversations", - "ConversationUpdateRequest", + "ConversationItemDeletedResource", + "ConversationItemInclude", "Metadata", ] diff --git a/src/llama_stack/apis/conversations/conversations_service.py b/src/llama_stack/apis/conversations/conversations_service.py new file mode 100644 index 0000000000..d6af15007c --- /dev/null +++ b/src/llama_stack/apis/conversations/conversations_service.py @@ -0,0 +1,70 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Literal, Protocol, runtime_checkable + +from llama_stack.core.telemetry.trace_protocol import trace_protocol + +from .models import ( + Conversation, + ConversationDeletedResource, + ConversationItem, + ConversationItemDeletedResource, + ConversationItemInclude, + ConversationItemList, + Metadata, +) + + +@runtime_checkable +@trace_protocol +class ConversationService(Protocol): + """Conversations + + Protocol for conversation management operations.""" + + async def create_conversation( + self, items: list[ConversationItem] | None = None, metadata: Metadata | None = None + ) -> Conversation: + """Create a conversation.""" + ... + + async def get_conversation(self, conversation_id: str) -> Conversation: + """Retrieve a conversation.""" + ... + + async def update_conversation(self, conversation_id: str, metadata: Metadata) -> Conversation: + """Update a conversation.""" + ... + + async def openai_delete_conversation(self, conversation_id: str) -> ConversationDeletedResource: + """Delete a conversation.""" + ... + + async def add_items(self, conversation_id: str, items: list[ConversationItem]) -> ConversationItemList: + """Create items.""" + ... + + async def retrieve(self, conversation_id: str, item_id: str) -> ConversationItem: + """Retrieve an item.""" + ... + + async def list_items( + self, + conversation_id: str, + after: str | None = None, + include: list[ConversationItemInclude] | None = None, + limit: int | None = None, + order: Literal["asc", "desc"] | None = None, + ) -> ConversationItemList: + """List items.""" + ... + + async def openai_delete_conversation_item( + self, conversation_id: str, item_id: str + ) -> ConversationItemDeletedResource: + """Delete an item.""" + ... diff --git a/src/llama_stack/apis/conversations/conversations.py b/src/llama_stack/apis/conversations/models.py similarity index 53% rename from src/llama_stack/apis/conversations/conversations.py rename to src/llama_stack/apis/conversations/models.py index d75683efa3..f1b24715a6 100644 --- a/src/llama_stack/apis/conversations/conversations.py +++ b/src/llama_stack/apis/conversations/models.py @@ -5,7 +5,7 @@ # the root directory of this source tree. from enum import StrEnum -from typing import Annotated, Literal, Protocol, runtime_checkable +from typing import Annotated, Literal from pydantic import BaseModel, Field @@ -20,9 +20,7 @@ OpenAIResponseOutputMessageMCPListTools, OpenAIResponseOutputMessageWebSearchToolCall, ) -from llama_stack.apis.version import LLAMA_STACK_API_V1 -from llama_stack.core.telemetry.trace_protocol import trace_protocol -from llama_stack.schema_utils import json_schema_type, register_schema, webmethod +from llama_stack.schema_utils import json_schema_type, register_schema Metadata = dict[str, str] @@ -76,31 +74,6 @@ class ConversationMessage(BaseModel): ] register_schema(ConversationItem, name="ConversationItem") -# Using OpenAI types directly caused issues but some notes for reference: -# Note that ConversationItem is a Annotated Union of the types below: -# from openai.types.responses import * -# from openai.types.responses.response_item import * -# from openai.types.conversations import ConversationItem -# f = [ -# ResponseFunctionToolCallItem, -# ResponseFunctionToolCallOutputItem, -# ResponseFileSearchToolCall, -# ResponseFunctionWebSearch, -# ImageGenerationCall, -# ResponseComputerToolCall, -# ResponseComputerToolCallOutputItem, -# ResponseReasoningItem, -# ResponseCodeInterpreterToolCall, -# LocalShellCall, -# LocalShellCallOutput, -# McpListTools, -# McpApprovalRequest, -# McpApprovalResponse, -# McpCall, -# ResponseCustomToolCall, -# ResponseCustomToolCallOutput -# ] - @json_schema_type class ConversationCreateRequest(BaseModel): @@ -180,119 +153,3 @@ class ConversationItemDeletedResource(BaseModel): id: str = Field(..., description="The deleted item identifier") object: str = Field(default="conversation.item.deleted", description="Object type") deleted: bool = Field(default=True, description="Whether the object was deleted") - - -@runtime_checkable -@trace_protocol -class Conversations(Protocol): - """Conversations - - Protocol for conversation management operations.""" - - @webmethod(route="/conversations", method="POST", level=LLAMA_STACK_API_V1) - async def create_conversation( - self, items: list[ConversationItem] | None = None, metadata: Metadata | None = None - ) -> Conversation: - """Create a conversation. - - Create a conversation. - - :param items: Initial items to include in the conversation context. - :param metadata: Set of key-value pairs that can be attached to an object. - :returns: The created conversation object. - """ - ... - - @webmethod(route="/conversations/{conversation_id}", method="GET", level=LLAMA_STACK_API_V1) - async def get_conversation(self, conversation_id: str) -> Conversation: - """Retrieve a conversation. - - Get a conversation with the given ID. - - :param conversation_id: The conversation identifier. - :returns: The conversation object. - """ - ... - - @webmethod(route="/conversations/{conversation_id}", method="POST", level=LLAMA_STACK_API_V1) - async def update_conversation(self, conversation_id: str, metadata: Metadata) -> Conversation: - """Update a conversation. - - Update a conversation's metadata with the given ID. - - :param conversation_id: The conversation identifier. - :param metadata: Set of key-value pairs that can be attached to an object. - :returns: The updated conversation object. - """ - ... - - @webmethod(route="/conversations/{conversation_id}", method="DELETE", level=LLAMA_STACK_API_V1) - async def openai_delete_conversation(self, conversation_id: str) -> ConversationDeletedResource: - """Delete a conversation. - - Delete a conversation with the given ID. - - :param conversation_id: The conversation identifier. - :returns: The deleted conversation resource. - """ - ... - - @webmethod(route="/conversations/{conversation_id}/items", method="POST", level=LLAMA_STACK_API_V1) - async def add_items(self, conversation_id: str, items: list[ConversationItem]) -> ConversationItemList: - """Create items. - - Create items in the conversation. - - :param conversation_id: The conversation identifier. - :param items: Items to include in the conversation context. - :returns: List of created items. - """ - ... - - @webmethod(route="/conversations/{conversation_id}/items/{item_id}", method="GET", level=LLAMA_STACK_API_V1) - async def retrieve(self, conversation_id: str, item_id: str) -> ConversationItem: - """Retrieve an item. - - Retrieve a conversation item. - - :param conversation_id: The conversation identifier. - :param item_id: The item identifier. - :returns: The conversation item. - """ - ... - - @webmethod(route="/conversations/{conversation_id}/items", method="GET", level=LLAMA_STACK_API_V1) - async def list_items( - self, - conversation_id: str, - after: str | None = None, - include: list[ConversationItemInclude] | None = None, - limit: int | None = None, - order: Literal["asc", "desc"] | None = None, - ) -> ConversationItemList: - """List items. - - List items in the conversation. - - :param conversation_id: The conversation identifier. - :param after: An item ID to list items after, used in pagination. - :param include: Specify additional output data to include in the response. - :param limit: A limit on the number of objects to be returned (1-100, default 20). - :param order: The order to return items in (asc or desc, default desc). - :returns: List of conversation items. - """ - ... - - @webmethod(route="/conversations/{conversation_id}/items/{item_id}", method="DELETE", level=LLAMA_STACK_API_V1) - async def openai_delete_conversation_item( - self, conversation_id: str, item_id: str - ) -> ConversationItemDeletedResource: - """Delete an item. - - Delete a conversation item. - - :param conversation_id: The conversation identifier. - :param item_id: The item identifier. - :returns: The deleted item resource. - """ - ... diff --git a/src/llama_stack/apis/conversations/routes.py b/src/llama_stack/apis/conversations/routes.py new file mode 100644 index 0000000000..971fc8c0d2 --- /dev/null +++ b/src/llama_stack/apis/conversations/routes.py @@ -0,0 +1,177 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated, Literal + +from fastapi import Body, Depends, Query, Request +from fastapi import Path as FastAPIPath + +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1 +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .conversations_service import ConversationService +from .models import ( + Conversation, + ConversationCreateRequest, + ConversationDeletedResource, + ConversationItem, + ConversationItemCreateRequest, + ConversationItemDeletedResource, + ConversationItemInclude, + ConversationItemList, + ConversationUpdateRequest, +) + + +def get_conversation_service(request: Request) -> ConversationService: + """Dependency to get the conversation service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.conversations not in impls: + raise ValueError("Conversations API implementation not found") + return impls[Api.conversations] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Conversations"], + responses=standard_responses, +) + + +@router.post( + "/conversations", + response_model=Conversation, + summary="Create a conversation", + description="Create a conversation", +) +async def create_conversation( + body: ConversationCreateRequest = Body(...), + svc: ConversationService = Depends(get_conversation_service), +) -> Conversation: + """Create a conversation.""" + return await svc.create_conversation(items=body.items, metadata=body.metadata) + + +@router.get( + "/conversations/{conversation_id}", + response_model=Conversation, + summary="Retrieve a conversation", + description="Get a conversation with the given ID", +) +async def get_conversation( + conversation_id: Annotated[str, FastAPIPath(..., description="The conversation identifier")], + svc: ConversationService = Depends(get_conversation_service), +) -> Conversation: + """Get a conversation.""" + return await svc.get_conversation(conversation_id=conversation_id) + + +@router.post( + "/conversations/{conversation_id}", + response_model=Conversation, + summary="Update a conversation", + description="Update a conversation's metadata with the given ID", +) +async def update_conversation( + conversation_id: Annotated[str, FastAPIPath(..., description="The conversation identifier")], + body: ConversationUpdateRequest = Body(...), + svc: ConversationService = Depends(get_conversation_service), +) -> Conversation: + """Update a conversation.""" + return await svc.update_conversation(conversation_id=conversation_id, metadata=body.metadata) + + +@router.delete( + "/conversations/{conversation_id}", + response_model=ConversationDeletedResource, + summary="Delete a conversation", + description="Delete a conversation with the given ID", +) +async def openai_delete_conversation( + conversation_id: Annotated[str, FastAPIPath(..., description="The conversation identifier")], + svc: ConversationService = Depends(get_conversation_service), +) -> ConversationDeletedResource: + """Delete a conversation.""" + return await svc.openai_delete_conversation(conversation_id=conversation_id) + + +@router.post( + "/conversations/{conversation_id}/items", + response_model=ConversationItemList, + summary="Create items", + description="Create items in the conversation", +) +async def add_items( + conversation_id: Annotated[str, FastAPIPath(..., description="The conversation identifier")], + body: ConversationItemCreateRequest = Body(...), + svc: ConversationService = Depends(get_conversation_service), +) -> ConversationItemList: + """Create items in the conversation.""" + return await svc.add_items(conversation_id=conversation_id, items=body.items) + + +@router.get( + "/conversations/{conversation_id}/items/{item_id}", + response_model=ConversationItem, + summary="Retrieve an item", + description="Retrieve a conversation item", +) +async def retrieve( + conversation_id: Annotated[str, FastAPIPath(..., description="The conversation identifier")], + item_id: Annotated[str, FastAPIPath(..., description="The item identifier")], + svc: ConversationService = Depends(get_conversation_service), +) -> ConversationItem: + """Retrieve a conversation item.""" + return await svc.retrieve(conversation_id=conversation_id, item_id=item_id) + + +@router.get( + "/conversations/{conversation_id}/items", + response_model=ConversationItemList, + summary="List items", + description="List items in the conversation", +) +async def list_items( + conversation_id: Annotated[str, FastAPIPath(..., description="The conversation identifier")], + after: str | None = Query(None, description="An item ID to list items after, used in pagination"), + include: list[ConversationItemInclude] | None = Query( + None, description="Specify additional output data to include in the response" + ), + limit: int | None = Query(None, description="A limit on the number of objects to be returned (1-100, default 20)"), + order: Literal["asc", "desc"] | None = Query( + None, description="The order to return items in (asc or desc, default desc)" + ), + svc: ConversationService = Depends(get_conversation_service), +) -> ConversationItemList: + """List items in the conversation.""" + return await svc.list_items(conversation_id=conversation_id, after=after, include=include, limit=limit, order=order) + + +@router.delete( + "/conversations/{conversation_id}/items/{item_id}", + response_model=ConversationItemDeletedResource, + summary="Delete an item", + description="Delete a conversation item", +) +async def openai_delete_conversation_item( + conversation_id: Annotated[str, FastAPIPath(..., description="The conversation identifier")], + item_id: Annotated[str, FastAPIPath(..., description="The item identifier")], + svc: ConversationService = Depends(get_conversation_service), +) -> ConversationItemDeletedResource: + """Delete a conversation item.""" + return await svc.openai_delete_conversation_item(conversation_id=conversation_id, item_id=item_id) + + +# For backward compatibility with the router registry system +def create_conversations_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Conversations API (legacy compatibility).""" + return router + + +# Register the router factory +register_router(Api.conversations, create_conversations_router) diff --git a/src/llama_stack/apis/datasetio/__init__.py b/src/llama_stack/apis/datasetio/__init__.py index 8c087bfa45..b0ac30c862 100644 --- a/src/llama_stack/apis/datasetio/__init__.py +++ b/src/llama_stack/apis/datasetio/__init__.py @@ -4,4 +4,11 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .datasetio import * +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .datasetio_service import DatasetIOService, DatasetStore + +# Backward compatibility - export DatasetIO as alias for DatasetIOService +DatasetIO = DatasetIOService + +__all__ = ["DatasetIO", "DatasetIOService", "DatasetStore"] diff --git a/src/llama_stack/apis/datasetio/datasetio.py b/src/llama_stack/apis/datasetio/datasetio_service.py similarity index 56% rename from src/llama_stack/apis/datasetio/datasetio.py rename to src/llama_stack/apis/datasetio/datasetio_service.py index a0c4a1afc1..e08f98b1d7 100644 --- a/src/llama_stack/apis/datasetio/datasetio.py +++ b/src/llama_stack/apis/datasetio/datasetio_service.py @@ -17,7 +17,7 @@ def get_dataset(self, dataset_id: str) -> Dataset: ... @runtime_checkable -class DatasetIO(Protocol): +class DatasetIOService(Protocol): # keeping for aligning with inference/safety, but this is not used dataset_store: DatasetStore @@ -28,28 +28,10 @@ async def iterrows( start_index: int | None = None, limit: int | None = None, ) -> PaginatedResponse: - """Get a paginated list of rows from a dataset. - - Uses offset-based pagination where: - - start_index: The starting index (0-based). If None, starts from beginning. - - limit: Number of items to return. If None or -1, returns all items. - - The response includes: - - data: List of items for the current page. - - has_more: Whether there are more items available after this set. - - :param dataset_id: The ID of the dataset to get the rows from. - :param start_index: Index into dataset for the first row to get. Get all rows if None. - :param limit: The number of rows to get. - :returns: A PaginatedResponse. - """ + """Get a paginated list of rows from a dataset.""" ... @webmethod(route="/datasetio/append-rows/{dataset_id:path}", method="POST", level=LLAMA_STACK_API_V1BETA) async def append_rows(self, dataset_id: str, rows: list[dict[str, Any]]) -> None: - """Append rows to a dataset. - - :param dataset_id: The ID of the dataset to append the rows to. - :param rows: The rows to append to the dataset. - """ + """Append rows to a dataset.""" ... diff --git a/src/llama_stack/apis/datasetio/models.py b/src/llama_stack/apis/datasetio/models.py new file mode 100644 index 0000000000..756f351d88 --- /dev/null +++ b/src/llama_stack/apis/datasetio/models.py @@ -0,0 +1,5 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. diff --git a/src/llama_stack/apis/datasetio/routes.py b/src/llama_stack/apis/datasetio/routes.py new file mode 100644 index 0000000000..4301ae852d --- /dev/null +++ b/src/llama_stack/apis/datasetio/routes.py @@ -0,0 +1,77 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated, Any + +from fastapi import Body, Depends, Query, Request +from fastapi import Path as FastAPIPath + +from llama_stack.apis.common.responses import PaginatedResponse +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1BETA +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .datasetio_service import DatasetIOService + + +def get_datasetio_service(request: Request) -> DatasetIOService: + """Dependency to get the datasetio service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.datasetio not in impls: + raise ValueError("DatasetIO API implementation not found") + return impls[Api.datasetio] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1BETA}", + tags=["DatasetIO"], + responses=standard_responses, +) + + +@router.get( + "/datasetio/iterrows/{dataset_id:path}", + response_model=PaginatedResponse, + summary="Get a paginated list of rows from a dataset.", + description="Get a paginated list of rows from a dataset using offset-based pagination.", +) +async def iterrows( + dataset_id: Annotated[str, FastAPIPath(..., description="The ID of the dataset to get the rows from")], + start_index: int | None = Query( + None, description="Index into dataset for the first row to get. Get all rows if None." + ), + limit: int | None = Query(None, description="The number of rows to get."), + svc: DatasetIOService = Depends(get_datasetio_service), +) -> PaginatedResponse: + """Get a paginated list of rows from a dataset.""" + return await svc.iterrows(dataset_id=dataset_id, start_index=start_index, limit=limit) + + +@router.post( + "/datasetio/append-rows/{dataset_id:path}", + response_model=None, + status_code=204, + summary="Append rows to a dataset.", + description="Append rows to a dataset.", +) +async def append_rows( + dataset_id: Annotated[str, FastAPIPath(..., description="The ID of the dataset to append the rows to")], + body: list[dict[str, Any]] = Body(..., description="The rows to append to the dataset."), + svc: DatasetIOService = Depends(get_datasetio_service), +) -> None: + """Append rows to a dataset.""" + await svc.append_rows(dataset_id=dataset_id, rows=body) + + +# For backward compatibility with the router registry system +def create_datasetio_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the DatasetIO API (legacy compatibility).""" + return router + + +# Register the router factory +register_router(Api.datasetio, create_datasetio_router) diff --git a/src/llama_stack/apis/datasets/__init__.py b/src/llama_stack/apis/datasets/__init__.py index 9c9a128d2b..7c02d4aaaf 100644 --- a/src/llama_stack/apis/datasets/__init__.py +++ b/src/llama_stack/apis/datasets/__init__.py @@ -4,4 +4,36 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .datasets import * +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .datasets_service import DatasetsService +from .models import ( + CommonDatasetFields, + Dataset, + DatasetInput, + DatasetPurpose, + DatasetType, + DataSource, + ListDatasetsResponse, + RegisterDatasetRequest, + RowsDataSource, + URIDataSource, +) + +# Backward compatibility - export Datasets as alias for DatasetsService +Datasets = DatasetsService + +__all__ = [ + "Datasets", + "DatasetsService", + "Dataset", + "DatasetInput", + "CommonDatasetFields", + "DatasetPurpose", + "DatasetType", + "DataSource", + "URIDataSource", + "RowsDataSource", + "ListDatasetsResponse", + "RegisterDatasetRequest", +] diff --git a/src/llama_stack/apis/datasets/datasets.py b/src/llama_stack/apis/datasets/datasets.py deleted file mode 100644 index ed4ecec226..0000000000 --- a/src/llama_stack/apis/datasets/datasets.py +++ /dev/null @@ -1,247 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -from enum import Enum, StrEnum -from typing import Annotated, Any, Literal, Protocol - -from pydantic import BaseModel, Field - -from llama_stack.apis.resource import Resource, ResourceType -from llama_stack.apis.version import LLAMA_STACK_API_V1BETA -from llama_stack.schema_utils import json_schema_type, register_schema, webmethod - - -class DatasetPurpose(StrEnum): - """ - Purpose of the dataset. Each purpose has a required input data schema. - - :cvar post-training/messages: The dataset contains messages used for post-training. - { - "messages": [ - {"role": "user", "content": "Hello, world!"}, - {"role": "assistant", "content": "Hello, world!"}, - ] - } - :cvar eval/question-answer: The dataset contains a question column and an answer column. - { - "question": "What is the capital of France?", - "answer": "Paris" - } - :cvar eval/messages-answer: The dataset contains a messages column with list of messages and an answer column. - { - "messages": [ - {"role": "user", "content": "Hello, my name is John Doe."}, - {"role": "assistant", "content": "Hello, John Doe. How can I help you today?"}, - {"role": "user", "content": "What's my name?"}, - ], - "answer": "John Doe" - } - """ - - post_training_messages = "post-training/messages" - eval_question_answer = "eval/question-answer" - eval_messages_answer = "eval/messages-answer" - - # TODO: add more schemas here - - -class DatasetType(Enum): - """ - Type of the dataset source. - :cvar uri: The dataset can be obtained from a URI. - :cvar rows: The dataset is stored in rows. - """ - - uri = "uri" - rows = "rows" - - -@json_schema_type -class URIDataSource(BaseModel): - """A dataset that can be obtained from a URI. - :param uri: The dataset can be obtained from a URI. E.g. - - "https://mywebsite.com/mydata.jsonl" - - "lsfs://mydata.jsonl" - - "data:csv;base64,{base64_content}" - """ - - type: Literal["uri"] = "uri" - uri: str - - -@json_schema_type -class RowsDataSource(BaseModel): - """A dataset stored in rows. - :param rows: The dataset is stored in rows. E.g. - - [ - {"messages": [{"role": "user", "content": "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}]} - ] - """ - - type: Literal["rows"] = "rows" - rows: list[dict[str, Any]] - - -DataSource = Annotated[ - URIDataSource | RowsDataSource, - Field(discriminator="type"), -] -register_schema(DataSource, name="DataSource") - - -class CommonDatasetFields(BaseModel): - """ - Common fields for a dataset. - - :param purpose: Purpose of the dataset indicating its intended use - :param source: Data source configuration for the dataset - :param metadata: Additional metadata for the dataset - """ - - purpose: DatasetPurpose - source: DataSource - metadata: dict[str, Any] = Field( - default_factory=dict, - description="Any additional metadata for this dataset", - ) - - -@json_schema_type -class Dataset(CommonDatasetFields, Resource): - """Dataset resource for storing and accessing training or evaluation data. - - :param type: Type of resource, always 'dataset' for datasets - """ - - type: Literal[ResourceType.dataset] = ResourceType.dataset - - @property - def dataset_id(self) -> str: - return self.identifier - - @property - def provider_dataset_id(self) -> str | None: - return self.provider_resource_id - - -class DatasetInput(CommonDatasetFields, BaseModel): - """Input parameters for dataset operations. - - :param dataset_id: Unique identifier for the dataset - """ - - dataset_id: str - - -class ListDatasetsResponse(BaseModel): - """Response from listing datasets. - - :param data: List of datasets - """ - - data: list[Dataset] - - -class Datasets(Protocol): - @webmethod(route="/datasets", method="POST", level=LLAMA_STACK_API_V1BETA) - async def register_dataset( - self, - purpose: DatasetPurpose, - source: DataSource, - metadata: dict[str, Any] | None = None, - dataset_id: str | None = None, - ) -> Dataset: - """ - Register a new dataset. - - :param purpose: The purpose of the dataset. - One of: - - "post-training/messages": The dataset contains a messages column with list of messages for post-training. - { - "messages": [ - {"role": "user", "content": "Hello, world!"}, - {"role": "assistant", "content": "Hello, world!"}, - ] - } - - "eval/question-answer": The dataset contains a question column and an answer column for evaluation. - { - "question": "What is the capital of France?", - "answer": "Paris" - } - - "eval/messages-answer": The dataset contains a messages column with list of messages and an answer column for evaluation. - { - "messages": [ - {"role": "user", "content": "Hello, my name is John Doe."}, - {"role": "assistant", "content": "Hello, John Doe. How can I help you today?"}, - {"role": "user", "content": "What's my name?"}, - ], - "answer": "John Doe" - } - :param source: The data source of the dataset. Ensure that the data source schema is compatible with the purpose of the dataset. Examples: - - { - "type": "uri", - "uri": "https://mywebsite.com/mydata.jsonl" - } - - { - "type": "uri", - "uri": "lsfs://mydata.jsonl" - } - - { - "type": "uri", - "uri": "data:csv;base64,{base64_content}" - } - - { - "type": "uri", - "uri": "huggingface://llamastack/simpleqa?split=train" - } - - { - "type": "rows", - "rows": [ - { - "messages": [ - {"role": "user", "content": "Hello, world!"}, - {"role": "assistant", "content": "Hello, world!"}, - ] - } - ] - } - :param metadata: The metadata for the dataset. - - E.g. {"description": "My dataset"}. - :param dataset_id: The ID of the dataset. If not provided, an ID will be generated. - :returns: A Dataset. - """ - ... - - @webmethod(route="/datasets/{dataset_id:path}", method="GET", level=LLAMA_STACK_API_V1BETA) - async def get_dataset( - self, - dataset_id: str, - ) -> Dataset: - """Get a dataset by its ID. - - :param dataset_id: The ID of the dataset to get. - :returns: A Dataset. - """ - ... - - @webmethod(route="/datasets", method="GET", level=LLAMA_STACK_API_V1BETA) - async def list_datasets(self) -> ListDatasetsResponse: - """List all datasets. - - :returns: A ListDatasetsResponse. - """ - ... - - @webmethod(route="/datasets/{dataset_id:path}", method="DELETE", level=LLAMA_STACK_API_V1BETA) - async def unregister_dataset( - self, - dataset_id: str, - ) -> None: - """Unregister a dataset by its ID. - - :param dataset_id: The ID of the dataset to unregister. - """ - ... diff --git a/src/llama_stack/apis/datasets/datasets_service.py b/src/llama_stack/apis/datasets/datasets_service.py new file mode 100644 index 0000000000..88e4c23de9 --- /dev/null +++ b/src/llama_stack/apis/datasets/datasets_service.py @@ -0,0 +1,65 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Any, Protocol, runtime_checkable + +from llama_stack.core.telemetry.trace_protocol import trace_protocol + +from .models import Dataset, DatasetPurpose, DataSource, ListDatasetsResponse + + +@runtime_checkable +@trace_protocol +class DatasetsService(Protocol): + async def register_dataset( + self, + purpose: DatasetPurpose, + source: DataSource, + metadata: dict[str, Any] | None = None, + dataset_id: str | None = None, + ) -> Dataset: + """ + Register a new dataset. + + :param purpose: The purpose of the dataset. + One of: + - "post-training/messages": The dataset contains a messages column with list of messages for post-training. + - "eval/question-answer": The dataset contains a question column and an answer column for evaluation. + - "eval/messages-answer": The dataset contains a messages column with list of messages and an answer column for evaluation. + :param source: The data source of the dataset. Ensure that the data source schema is compatible with the purpose of the dataset. + :param metadata: The metadata for the dataset. + :param dataset_id: The ID of the dataset. If not provided, an ID will be generated. + :returns: A Dataset. + """ + ... + + async def get_dataset( + self, + dataset_id: str, + ) -> Dataset: + """Get a dataset by its ID. + + :param dataset_id: The ID of the dataset to get. + :returns: A Dataset. + """ + ... + + async def list_datasets(self) -> ListDatasetsResponse: + """List all datasets. + + :returns: A ListDatasetsResponse. + """ + ... + + async def unregister_dataset( + self, + dataset_id: str, + ) -> None: + """Unregister a dataset by its ID. + + :param dataset_id: The ID of the dataset to unregister. + """ + ... diff --git a/src/llama_stack/apis/datasets/models.py b/src/llama_stack/apis/datasets/models.py new file mode 100644 index 0000000000..ee1baaa215 --- /dev/null +++ b/src/llama_stack/apis/datasets/models.py @@ -0,0 +1,134 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from enum import Enum, StrEnum +from typing import Annotated, Any, Literal + +from pydantic import BaseModel, Field + +from llama_stack.apis.resource import Resource, ResourceType +from llama_stack.schema_utils import json_schema_type, register_schema + + +class DatasetPurpose(StrEnum): + """ + Purpose of the dataset. Each purpose has a required input data schema. + + { + "messages": [ + {"role": "user", "content": "Hello, world!"}, + {"role": "assistant", "content": "Hello, world!"}, + ] + } + { + "question": "What is the capital of France?", + "answer": "Paris" + } + { + "messages": [ + {"role": "user", "content": "Hello, my name is John Doe."}, + {"role": "assistant", "content": "Hello, John Doe. How can I help you today?"}, + {"role": "user", "content": "What's my name?"}, + ], + "answer": "John Doe" + } + """ + + post_training_messages = "post-training/messages" + eval_question_answer = "eval/question-answer" + eval_messages_answer = "eval/messages-answer" + + # TODO: add more schemas here + + +class DatasetType(Enum): + """ + Type of the dataset source. + """ + + uri = "uri" + rows = "rows" + + +@json_schema_type +class URIDataSource(BaseModel): + """A dataset that can be obtained from a URI.""" + + type: Literal["uri"] = Field(default="uri", description="The type of data source") + uri: str = Field( + ..., + description="The dataset can be obtained from a URI. E.g. 'https://mywebsite.com/mydata.jsonl', 'lsfs://mydata.jsonl', 'data:csv;base64,{base64_content}'", + ) + + +@json_schema_type +class RowsDataSource(BaseModel): + """A dataset stored in rows.""" + + type: Literal["rows"] = Field(default="rows", description="The type of data source") + rows: list[dict[str, Any]] = Field( + ..., + description="The dataset is stored in rows. E.g. [{'messages': [{'role': 'user', 'content': 'Hello, world!'}, {'role': 'assistant', 'content': 'Hello, world!'}]}]", + ) + + +DataSource = Annotated[ + URIDataSource | RowsDataSource, + Field(discriminator="type"), +] +register_schema(DataSource, name="DataSource") + + +class CommonDatasetFields(BaseModel): + """Common fields for a dataset.""" + + purpose: DatasetPurpose + source: DataSource + metadata: dict[str, Any] = Field( + default_factory=dict, + description="Any additional metadata for this dataset", + ) + + +@json_schema_type +class Dataset(CommonDatasetFields, Resource): + """Dataset resource for storing and accessing training or evaluation data.""" + + type: Literal[ResourceType.dataset] = Field( + default=ResourceType.dataset, description="Type of resource, always 'dataset' for datasets" + ) + + @property + def dataset_id(self) -> str: + return self.identifier + + @property + def provider_dataset_id(self) -> str | None: + return self.provider_resource_id + + +class DatasetInput(CommonDatasetFields, BaseModel): + """Input parameters for dataset operations.""" + + dataset_id: str = Field(..., description="Unique identifier for the dataset") + + +class ListDatasetsResponse(BaseModel): + """Response from listing datasets.""" + + data: list[Dataset] = Field(..., description="List of datasets") + + +@json_schema_type +class RegisterDatasetRequest(BaseModel): + """Request model for registering a dataset.""" + + purpose: DatasetPurpose = Field(..., description="The purpose of the dataset") + source: DataSource = Field(..., description="The data source of the dataset") + metadata: dict[str, Any] | None = Field(default=None, description="The metadata for the dataset") + dataset_id: str | None = Field( + default=None, description="The ID of the dataset. If not provided, an ID will be generated" + ) diff --git a/src/llama_stack/apis/datasets/routes.py b/src/llama_stack/apis/datasets/routes.py new file mode 100644 index 0000000000..671c454a06 --- /dev/null +++ b/src/llama_stack/apis/datasets/routes.py @@ -0,0 +1,140 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated + +from fastapi import Body, Depends, Request +from fastapi import Path as FastAPIPath + +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1, LLAMA_STACK_API_V1BETA +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .datasets_service import DatasetsService +from .models import Dataset, ListDatasetsResponse, RegisterDatasetRequest + + +def get_datasets_service(request: Request) -> DatasetsService: + """Dependency to get the datasets service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.datasets not in impls: + raise ValueError("Datasets API implementation not found") + return impls[Api.datasets] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Datasets"], + responses=standard_responses, +) + +router_v1beta = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1BETA}", + tags=["Datasets"], + responses=standard_responses, +) + + +@router.post( + "/datasets", + response_model=Dataset, + summary="Register a new dataset", + description="Register a new dataset", + deprecated=True, +) +@router_v1beta.post( + "/datasets", + response_model=Dataset, + summary="Register a new dataset", + description="Register a new dataset", +) +async def register_dataset( + body: RegisterDatasetRequest = Body(...), + svc: DatasetsService = Depends(get_datasets_service), +) -> Dataset: + """Register a new dataset.""" + return await svc.register_dataset( + purpose=body.purpose, + source=body.source, + metadata=body.metadata, + dataset_id=body.dataset_id, + ) + + +@router.get( + "/datasets/{dataset_id:path}", + response_model=Dataset, + summary="Get a dataset by its ID", + description="Get a dataset by its ID", + deprecated=True, +) +@router_v1beta.get( + "/datasets/{{dataset_id:path}}", + response_model=Dataset, + summary="Get a dataset by its ID", + description="Get a dataset by its ID", +) +async def get_dataset( + dataset_id: Annotated[str, FastAPIPath(..., description="The ID of the dataset to get")], + svc: DatasetsService = Depends(get_datasets_service), +) -> Dataset: + """Get a dataset by its ID.""" + return await svc.get_dataset(dataset_id=dataset_id) + + +@router.get( + "/datasets", + response_model=ListDatasetsResponse, + summary="List all datasets", + description="List all datasets", + deprecated=True, +) +@router_v1beta.get( + "/datasets", + response_model=ListDatasetsResponse, + summary="List all datasets", + description="List all datasets", +) +async def list_datasets(svc: DatasetsService = Depends(get_datasets_service)) -> ListDatasetsResponse: + """List all datasets.""" + return await svc.list_datasets() + + +@router.delete( + "/datasets/{dataset_id:path}", + response_model=None, + status_code=204, + summary="Unregister a dataset by its ID", + description="Unregister a dataset by its ID", + deprecated=True, +) +@router_v1beta.delete( + "/datasets/{{dataset_id:path}}", + response_model=None, + status_code=204, + summary="Unregister a dataset by its ID", + description="Unregister a dataset by its ID", +) +async def unregister_dataset( + dataset_id: Annotated[str, FastAPIPath(..., description="The ID of the dataset to unregister")], + svc: DatasetsService = Depends(get_datasets_service), +) -> None: + """Unregister a dataset by its ID.""" + await svc.unregister_dataset(dataset_id=dataset_id) + + +# For backward compatibility with the router registry system +def create_datasets_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Datasets API (legacy compatibility).""" + main_router = APIRouter() + main_router.include_router(router) + main_router.include_router(router_v1beta) + return main_router + + +# Register the router factory +register_router(Api.datasets, create_datasets_router) diff --git a/src/llama_stack/apis/datatypes.py b/src/llama_stack/apis/datatypes.py index ae01c5dfc5..00fab1ab37 100644 --- a/src/llama_stack/apis/datatypes.py +++ b/src/llama_stack/apis/datatypes.py @@ -130,23 +130,22 @@ class Api(Enum, metaclass=DynamicApiMeta): # built-in API inspect = "inspect" + synthetic_data_generation = "synthetic_data_generation" @json_schema_type class Error(BaseModel): - """ - Error response from the API. Roughly follows RFC 7807. - - :param status: HTTP status code - :param title: Error title, a short summary of the error which is invariant for an error type - :param detail: Error detail, a longer human-readable description of the error - :param instance: (Optional) A URL which can be used to retrieve more information about the specific occurrence of the error - """ - - status: int - title: str - detail: str - instance: str | None = None + """Error response from the API. Roughly follows RFC 7807.""" + + status: int = Field(..., description="HTTP status code") + title: str = Field( + ..., description="Error title, a short summary of the error which is invariant for an error type" + ) + detail: str = Field(..., description="Error detail, a longer human-readable description of the error") + instance: str | None = Field( + None, + description="(Optional) A URL which can be used to retrieve more information about the specific occurrence of the error", + ) class ExternalApiSpec(BaseModel): diff --git a/src/llama_stack/apis/eval/__init__.py b/src/llama_stack/apis/eval/__init__.py index 28a1d60499..ecdba18f8c 100644 --- a/src/llama_stack/apis/eval/__init__.py +++ b/src/llama_stack/apis/eval/__init__.py @@ -4,4 +4,28 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .eval import * +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .eval_service import EvalService +from .models import ( + AgentCandidate, + BenchmarkConfig, + EvalCandidate, + EvaluateResponse, + EvaluateRowsRequest, + ModelCandidate, +) + +# Backward compatibility - export Eval as alias for EvalService +Eval = EvalService + +__all__ = [ + "Eval", + "EvalService", + "ModelCandidate", + "AgentCandidate", + "EvalCandidate", + "BenchmarkConfig", + "EvaluateResponse", + "EvaluateRowsRequest", +] diff --git a/src/llama_stack/apis/eval/eval.py b/src/llama_stack/apis/eval/eval.py deleted file mode 100644 index 424c906748..0000000000 --- a/src/llama_stack/apis/eval/eval.py +++ /dev/null @@ -1,150 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -from typing import Annotated, Any, Literal, Protocol - -from pydantic import BaseModel, Field - -from llama_stack.apis.agents import AgentConfig -from llama_stack.apis.common.job_types import Job -from llama_stack.apis.inference import SamplingParams, SystemMessage -from llama_stack.apis.scoring import ScoringResult -from llama_stack.apis.scoring_functions import ScoringFnParams -from llama_stack.apis.version import LLAMA_STACK_API_V1ALPHA -from llama_stack.schema_utils import json_schema_type, register_schema, webmethod - - -@json_schema_type -class ModelCandidate(BaseModel): - """A model candidate for evaluation. - - :param model: The model ID to evaluate. - :param sampling_params: The sampling parameters for the model. - :param system_message: (Optional) The system message providing instructions or context to the model. - """ - - type: Literal["model"] = "model" - model: str - sampling_params: SamplingParams - system_message: SystemMessage | None = None - - -@json_schema_type -class AgentCandidate(BaseModel): - """An agent candidate for evaluation. - - :param config: The configuration for the agent candidate. - """ - - type: Literal["agent"] = "agent" - config: AgentConfig - - -EvalCandidate = Annotated[ModelCandidate | AgentCandidate, Field(discriminator="type")] -register_schema(EvalCandidate, name="EvalCandidate") - - -@json_schema_type -class BenchmarkConfig(BaseModel): - """A benchmark configuration for evaluation. - - :param eval_candidate: The candidate to evaluate. - :param scoring_params: Map between scoring function id and parameters for each scoring function you want to run - :param num_examples: (Optional) The number of examples to evaluate. If not provided, all examples in the dataset will be evaluated - """ - - eval_candidate: EvalCandidate - scoring_params: dict[str, ScoringFnParams] = Field( - description="Map between scoring function id and parameters for each scoring function you want to run", - default_factory=dict, - ) - num_examples: int | None = Field( - description="Number of examples to evaluate (useful for testing), if not provided, all examples in the dataset will be evaluated", - default=None, - ) - # we could optinally add any specific dataset config here - - -@json_schema_type -class EvaluateResponse(BaseModel): - """The response from an evaluation. - - :param generations: The generations from the evaluation. - :param scores: The scores from the evaluation. - """ - - generations: list[dict[str, Any]] - # each key in the dict is a scoring function name - scores: dict[str, ScoringResult] - - -class Eval(Protocol): - """Evaluations - - Llama Stack Evaluation API for running evaluations on model and agent candidates.""" - - @webmethod(route="/eval/benchmarks/{benchmark_id}/jobs", method="POST", level=LLAMA_STACK_API_V1ALPHA) - async def run_eval( - self, - benchmark_id: str, - benchmark_config: BenchmarkConfig, - ) -> Job: - """Run an evaluation on a benchmark. - - :param benchmark_id: The ID of the benchmark to run the evaluation on. - :param benchmark_config: The configuration for the benchmark. - :returns: The job that was created to run the evaluation. - """ - ... - - @webmethod(route="/eval/benchmarks/{benchmark_id}/evaluations", method="POST", level=LLAMA_STACK_API_V1ALPHA) - async def evaluate_rows( - self, - benchmark_id: str, - input_rows: list[dict[str, Any]], - scoring_functions: list[str], - benchmark_config: BenchmarkConfig, - ) -> EvaluateResponse: - """Evaluate a list of rows on a benchmark. - - :param benchmark_id: The ID of the benchmark to run the evaluation on. - :param input_rows: The rows to evaluate. - :param scoring_functions: The scoring functions to use for the evaluation. - :param benchmark_config: The configuration for the benchmark. - :returns: EvaluateResponse object containing generations and scores. - """ - ... - - @webmethod(route="/eval/benchmarks/{benchmark_id}/jobs/{job_id}", method="GET", level=LLAMA_STACK_API_V1ALPHA) - async def job_status(self, benchmark_id: str, job_id: str) -> Job: - """Get the status of a job. - - :param benchmark_id: The ID of the benchmark to run the evaluation on. - :param job_id: The ID of the job to get the status of. - :returns: The status of the evaluation job. - """ - ... - - @webmethod(route="/eval/benchmarks/{benchmark_id}/jobs/{job_id}", method="DELETE", level=LLAMA_STACK_API_V1ALPHA) - async def job_cancel(self, benchmark_id: str, job_id: str) -> None: - """Cancel a job. - - :param benchmark_id: The ID of the benchmark to run the evaluation on. - :param job_id: The ID of the job to cancel. - """ - ... - - @webmethod( - route="/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result", method="GET", level=LLAMA_STACK_API_V1ALPHA - ) - async def job_result(self, benchmark_id: str, job_id: str) -> EvaluateResponse: - """Get the result of a job. - - :param benchmark_id: The ID of the benchmark to run the evaluation on. - :param job_id: The ID of the job to get the result of. - :returns: The result of the job. - """ - ... diff --git a/src/llama_stack/apis/eval/eval_service.py b/src/llama_stack/apis/eval/eval_service.py new file mode 100644 index 0000000000..80e6039ea3 --- /dev/null +++ b/src/llama_stack/apis/eval/eval_service.py @@ -0,0 +1,50 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Any, Protocol, runtime_checkable + +from llama_stack.apis.common.job_types import Job +from llama_stack.core.telemetry.trace_protocol import trace_protocol + +from .models import BenchmarkConfig, EvaluateResponse + + +@runtime_checkable +@trace_protocol +class EvalService(Protocol): + """Evaluations + + Llama Stack Evaluation API for running evaluations on model and agent candidates.""" + + async def run_eval( + self, + benchmark_id: str, + benchmark_config: BenchmarkConfig, + ) -> Job: + """Run an evaluation on a benchmark.""" + ... + + async def evaluate_rows( + self, + benchmark_id: str, + input_rows: list[dict[str, Any]], + scoring_functions: list[str], + benchmark_config: BenchmarkConfig, + ) -> EvaluateResponse: + """Evaluate a list of rows on a benchmark.""" + ... + + async def job_status(self, benchmark_id: str, job_id: str) -> Job: + """Get the status of a job.""" + ... + + async def job_cancel(self, benchmark_id: str, job_id: str) -> None: + """Cancel a job.""" + ... + + async def job_result(self, benchmark_id: str, job_id: str) -> EvaluateResponse: + """Get the result of a job.""" + ... diff --git a/src/llama_stack/apis/eval/models.py b/src/llama_stack/apis/eval/models.py new file mode 100644 index 0000000000..e8d8ff8d5d --- /dev/null +++ b/src/llama_stack/apis/eval/models.py @@ -0,0 +1,73 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated, Any, Literal + +from pydantic import BaseModel, Field + +from llama_stack.apis.agents import AgentConfig +from llama_stack.apis.inference import SamplingParams, SystemMessage +from llama_stack.apis.scoring.models import ScoringResult +from llama_stack.apis.scoring_functions import ScoringFnParams +from llama_stack.schema_utils import json_schema_type, register_schema + + +@json_schema_type +class ModelCandidate(BaseModel): + """A model candidate for evaluation.""" + + type: Literal["model"] = Field(default="model", description="The type of candidate.") + model: str = Field(..., description="The model ID to evaluate.") + sampling_params: SamplingParams = Field(..., description="The sampling parameters for the model.") + system_message: SystemMessage | None = Field( + default=None, description="The system message providing instructions or context to the model." + ) + + +@json_schema_type +class AgentCandidate(BaseModel): + """An agent candidate for evaluation.""" + + type: Literal["agent"] = Field(default="agent", description="The type of candidate.") + config: AgentConfig = Field(..., description="The configuration for the agent candidate.") + + +EvalCandidate = Annotated[ModelCandidate | AgentCandidate, Field(discriminator="type")] +register_schema(EvalCandidate, name="EvalCandidate") + + +@json_schema_type +class BenchmarkConfig(BaseModel): + """A benchmark configuration for evaluation.""" + + eval_candidate: EvalCandidate = Field(..., description="The candidate to evaluate.") + scoring_params: dict[str, ScoringFnParams] = Field( + description="Map between scoring function id and parameters for each scoring function you want to run.", + default_factory=dict, + ) + num_examples: int | None = Field( + description="The number of examples to evaluate. If not provided, all examples in the dataset will be evaluated.", + default=None, + ) + + +@json_schema_type +class EvaluateResponse(BaseModel): + """The response from an evaluation.""" + + generations: list[dict[str, Any]] = Field(..., description="The generations from the evaluation.") + scores: dict[str, ScoringResult] = Field( + ..., description="The scores from the evaluation. Each key in the dict is a scoring function name." + ) + + +@json_schema_type +class EvaluateRowsRequest(BaseModel): + """Request model for evaluating rows.""" + + input_rows: list[dict[str, Any]] = Field(..., description="The rows to evaluate.") + scoring_functions: list[str] = Field(..., description="The scoring functions to use for the evaluation.") + benchmark_config: BenchmarkConfig = Field(..., description="The configuration for the benchmark.") diff --git a/src/llama_stack/apis/eval/routes.py b/src/llama_stack/apis/eval/routes.py new file mode 100644 index 0000000000..1ce147e902 --- /dev/null +++ b/src/llama_stack/apis/eval/routes.py @@ -0,0 +1,170 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated + +from fastapi import Body, Depends, Request +from fastapi import Path as FastAPIPath + +from llama_stack.apis.common.job_types import Job +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1, LLAMA_STACK_API_V1ALPHA +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .eval_service import EvalService +from .models import BenchmarkConfig, EvaluateResponse, EvaluateRowsRequest + + +def get_eval_service(request: Request) -> EvalService: + """Dependency to get the eval service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.eval not in impls: + raise ValueError("Eval API implementation not found") + return impls[Api.eval] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Eval"], + responses=standard_responses, +) + +router_v1alpha = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1ALPHA}", + tags=["Eval"], + responses=standard_responses, +) + + +@router.post( + "/eval/benchmarks/{benchmark_id}/jobs", + response_model=Job, + summary="Run an evaluation on a benchmark", + description="Run an evaluation on a benchmark", + deprecated=True, +) +@router_v1alpha.post( + "/eval/benchmarks/{{benchmark_id}}/jobs", + response_model=Job, + summary="Run an evaluation on a benchmark", + description="Run an evaluation on a benchmark", +) +async def run_eval( + benchmark_id: Annotated[str, FastAPIPath(..., description="The ID of the benchmark to run the evaluation on")], + benchmark_config: BenchmarkConfig = Body(...), + svc: EvalService = Depends(get_eval_service), +) -> Job: + """Run an evaluation on a benchmark.""" + return await svc.run_eval(benchmark_id=benchmark_id, benchmark_config=benchmark_config) + + +@router.post( + "/eval/benchmarks/{benchmark_id}/evaluations", + response_model=EvaluateResponse, + summary="Evaluate a list of rows on a benchmark", + description="Evaluate a list of rows on a benchmark", + deprecated=True, +) +@router_v1alpha.post( + "/eval/benchmarks/{{benchmark_id}}/evaluations", + response_model=EvaluateResponse, + summary="Evaluate a list of rows on a benchmark", + description="Evaluate a list of rows on a benchmark", +) +async def evaluate_rows( + benchmark_id: Annotated[str, FastAPIPath(..., description="The ID of the benchmark to run the evaluation on")], + body: EvaluateRowsRequest = Body(...), + svc: EvalService = Depends(get_eval_service), +) -> EvaluateResponse: + """Evaluate a list of rows on a benchmark.""" + return await svc.evaluate_rows( + benchmark_id=benchmark_id, + input_rows=body.input_rows, + scoring_functions=body.scoring_functions, + benchmark_config=body.benchmark_config, + ) + + +@router.get( + "/eval/benchmarks/{benchmark_id}/jobs/{job_id}", + response_model=Job, + summary="Get the status of a job", + description="Get the status of a job", + deprecated=True, +) +@router_v1alpha.get( + "/eval/benchmarks/{{benchmark_id}}/jobs/{{job_id}}", + response_model=Job, + summary="Get the status of a job", + description="Get the status of a job", +) +async def job_status( + benchmark_id: Annotated[str, FastAPIPath(..., description="The ID of the benchmark to run the evaluation on")], + job_id: Annotated[str, FastAPIPath(..., description="The ID of the job to get the status of")], + svc: EvalService = Depends(get_eval_service), +) -> Job: + """Get the status of a job.""" + return await svc.job_status(benchmark_id=benchmark_id, job_id=job_id) + + +@router.delete( + "/eval/benchmarks/{benchmark_id}/jobs/{job_id}", + response_model=None, + status_code=204, + summary="Cancel a job", + description="Cancel a job", + deprecated=True, +) +@router_v1alpha.delete( + "/eval/benchmarks/{{benchmark_id}}/jobs/{{job_id}}", + response_model=None, + status_code=204, + summary="Cancel a job", + description="Cancel a job", +) +async def job_cancel( + benchmark_id: Annotated[str, FastAPIPath(..., description="The ID of the benchmark to run the evaluation on")], + job_id: Annotated[str, FastAPIPath(..., description="The ID of the job to cancel")], + svc: EvalService = Depends(get_eval_service), +) -> None: + """Cancel a job.""" + await svc.job_cancel(benchmark_id=benchmark_id, job_id=job_id) + + +@router.get( + "/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result", + response_model=EvaluateResponse, + summary="Get the result of a job", + description="Get the result of a job", + deprecated=True, +) +@router_v1alpha.get( + "/eval/benchmarks/{{benchmark_id}}/jobs/{{job_id}}/result", + response_model=EvaluateResponse, + summary="Get the result of a job", + description="Get the result of a job", +) +async def job_result( + benchmark_id: Annotated[str, FastAPIPath(..., description="The ID of the benchmark to run the evaluation on")], + job_id: Annotated[str, FastAPIPath(..., description="The ID of the job to get the result of")], + svc: EvalService = Depends(get_eval_service), +) -> EvaluateResponse: + """Get the result of a job.""" + return await svc.job_result(benchmark_id=benchmark_id, job_id=job_id) + + +# For backward compatibility with the router registry system +def create_eval_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Eval API (legacy compatibility).""" + main_router = APIRouter() + main_router.include_router(router) + main_router.include_router(router_v1alpha) + return main_router + + +# Register the router factory +register_router(Api.eval, create_eval_router) diff --git a/src/llama_stack/apis/files/__init__.py b/src/llama_stack/apis/files/__init__.py index 189e4de192..e4638e0ad2 100644 --- a/src/llama_stack/apis/files/__init__.py +++ b/src/llama_stack/apis/files/__init__.py @@ -4,4 +4,26 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .files import * +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .files_service import FileService +from .models import ( + ExpiresAfter, + ListOpenAIFileResponse, + OpenAIFileDeleteResponse, + OpenAIFileObject, + OpenAIFilePurpose, +) + +# Backward compatibility - export Files as alias for FileService +Files = FileService + +__all__ = [ + "Files", + "FileService", + "OpenAIFileObject", + "OpenAIFilePurpose", + "ExpiresAfter", + "ListOpenAIFileResponse", + "OpenAIFileDeleteResponse", +] diff --git a/src/llama_stack/apis/files/files.py b/src/llama_stack/apis/files/files.py deleted file mode 100644 index 657e9f500a..0000000000 --- a/src/llama_stack/apis/files/files.py +++ /dev/null @@ -1,194 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -from enum import StrEnum -from typing import Annotated, ClassVar, Literal, Protocol, runtime_checkable - -from fastapi import File, Form, Response, UploadFile -from pydantic import BaseModel, Field - -from llama_stack.apis.common.responses import Order -from llama_stack.apis.version import LLAMA_STACK_API_V1 -from llama_stack.core.telemetry.trace_protocol import trace_protocol -from llama_stack.schema_utils import json_schema_type, webmethod - - -# OpenAI Files API Models -class OpenAIFilePurpose(StrEnum): - """ - Valid purpose values for OpenAI Files API. - """ - - ASSISTANTS = "assistants" - BATCH = "batch" - # TODO: Add other purposes as needed - - -@json_schema_type -class OpenAIFileObject(BaseModel): - """ - OpenAI File object as defined in the OpenAI Files API. - - :param object: The object type, which is always "file" - :param id: The file identifier, which can be referenced in the API endpoints - :param bytes: The size of the file, in bytes - :param created_at: The Unix timestamp (in seconds) for when the file was created - :param expires_at: The Unix timestamp (in seconds) for when the file expires - :param filename: The name of the file - :param purpose: The intended purpose of the file - """ - - object: Literal["file"] = "file" - id: str - bytes: int - created_at: int - expires_at: int - filename: str - purpose: OpenAIFilePurpose - - -@json_schema_type -class ExpiresAfter(BaseModel): - """ - Control expiration of uploaded files. - - Params: - - anchor, must be "created_at" - - seconds, must be int between 3600 and 2592000 (1 hour to 30 days) - """ - - MIN: ClassVar[int] = 3600 # 1 hour - MAX: ClassVar[int] = 2592000 # 30 days - - anchor: Literal["created_at"] - seconds: int = Field(..., ge=3600, le=2592000) - - -@json_schema_type -class ListOpenAIFileResponse(BaseModel): - """ - Response for listing files in OpenAI Files API. - - :param data: List of file objects - :param has_more: Whether there are more files available beyond this page - :param first_id: ID of the first file in the list for pagination - :param last_id: ID of the last file in the list for pagination - :param object: The object type, which is always "list" - """ - - data: list[OpenAIFileObject] - has_more: bool - first_id: str - last_id: str - object: Literal["list"] = "list" - - -@json_schema_type -class OpenAIFileDeleteResponse(BaseModel): - """ - Response for deleting a file in OpenAI Files API. - - :param id: The file identifier that was deleted - :param object: The object type, which is always "file" - :param deleted: Whether the file was successfully deleted - """ - - id: str - object: Literal["file"] = "file" - deleted: bool - - -@runtime_checkable -@trace_protocol -class Files(Protocol): - """Files - - This API is used to upload documents that can be used with other Llama Stack APIs. - """ - - # OpenAI Files API Endpoints - @webmethod(route="/files", method="POST", level=LLAMA_STACK_API_V1) - async def openai_upload_file( - self, - file: Annotated[UploadFile, File()], - purpose: Annotated[OpenAIFilePurpose, Form()], - expires_after: Annotated[ExpiresAfter | None, Form()] = None, - ) -> OpenAIFileObject: - """Upload file. - - Upload a file that can be used across various endpoints. - - The file upload should be a multipart form request with: - - file: The File object (not file name) to be uploaded. - - purpose: The intended purpose of the uploaded file. - - expires_after: Optional form values describing expiration for the file. - - :param file: The uploaded file object containing content and metadata (filename, content_type, etc.). - :param purpose: The intended purpose of the uploaded file (e.g., "assistants", "fine-tune"). - :param expires_after: Optional form values describing expiration for the file. - :returns: An OpenAIFileObject representing the uploaded file. - """ - ... - - @webmethod(route="/files", method="GET", level=LLAMA_STACK_API_V1) - async def openai_list_files( - self, - after: str | None = None, - limit: int | None = 10000, - order: Order | None = Order.desc, - purpose: OpenAIFilePurpose | None = None, - ) -> ListOpenAIFileResponse: - """List files. - - Returns a list of files that belong to the user's organization. - - :param after: A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - :param limit: A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000. - :param order: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - :param purpose: Only return files with the given purpose. - :returns: An ListOpenAIFileResponse containing the list of files. - """ - ... - - @webmethod(route="/files/{file_id}", method="GET", level=LLAMA_STACK_API_V1) - async def openai_retrieve_file( - self, - file_id: str, - ) -> OpenAIFileObject: - """Retrieve file. - - Returns information about a specific file. - - :param file_id: The ID of the file to use for this request. - :returns: An OpenAIFileObject containing file information. - """ - ... - - @webmethod(route="/files/{file_id}", method="DELETE", level=LLAMA_STACK_API_V1) - async def openai_delete_file( - self, - file_id: str, - ) -> OpenAIFileDeleteResponse: - """Delete file. - - :param file_id: The ID of the file to use for this request. - :returns: An OpenAIFileDeleteResponse indicating successful deletion. - """ - ... - - @webmethod(route="/files/{file_id}/content", method="GET", level=LLAMA_STACK_API_V1) - async def openai_retrieve_file_content( - self, - file_id: str, - ) -> Response: - """Retrieve file content. - - Returns the contents of the specified file. - - :param file_id: The ID of the file to use for this request. - :returns: The raw file content as a binary response. - """ - ... diff --git a/src/llama_stack/apis/files/files_service.py b/src/llama_stack/apis/files/files_service.py new file mode 100644 index 0000000000..6e71fe2483 --- /dev/null +++ b/src/llama_stack/apis/files/files_service.py @@ -0,0 +1,70 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated, Protocol, runtime_checkable + +from fastapi import File, Form, Response, UploadFile + +from llama_stack.apis.common.responses import Order +from llama_stack.core.telemetry.trace_protocol import trace_protocol + +from .models import ( + ExpiresAfter, + ListOpenAIFileResponse, + OpenAIFileDeleteResponse, + OpenAIFileObject, + OpenAIFilePurpose, +) + + +@runtime_checkable +@trace_protocol +class FileService(Protocol): + """Files + + This API is used to upload documents that can be used with other Llama Stack APIs. + """ + + # OpenAI Files API Endpoints + async def openai_upload_file( + self, + file: Annotated[UploadFile, File()], + purpose: Annotated[OpenAIFilePurpose, Form()], + expires_after: Annotated[ExpiresAfter | None, Form()] = None, + ) -> OpenAIFileObject: + """Upload file.""" + ... + + async def openai_list_files( + self, + after: str | None = None, + limit: int | None = 10000, + order: Order | None = Order.desc, + purpose: OpenAIFilePurpose | None = None, + ) -> ListOpenAIFileResponse: + """List files.""" + ... + + async def openai_retrieve_file( + self, + file_id: str, + ) -> OpenAIFileObject: + """Retrieve file.""" + ... + + async def openai_delete_file( + self, + file_id: str, + ) -> OpenAIFileDeleteResponse: + """Delete file.""" + ... + + async def openai_retrieve_file_content( + self, + file_id: str, + ) -> Response: + """Retrieve file content.""" + ... diff --git a/src/llama_stack/apis/files/models.py b/src/llama_stack/apis/files/models.py new file mode 100644 index 0000000000..f767a03719 --- /dev/null +++ b/src/llama_stack/apis/files/models.py @@ -0,0 +1,66 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from enum import StrEnum +from typing import ClassVar, Literal + +from pydantic import BaseModel, Field + +from llama_stack.schema_utils import json_schema_type + + +class OpenAIFilePurpose(StrEnum): + """ + Valid purpose values for OpenAI Files API. + """ + + ASSISTANTS = "assistants" + BATCH = "batch" + # TODO: Add other purposes as needed + + +@json_schema_type +class OpenAIFileObject(BaseModel): + """OpenAI File object as defined in the OpenAI Files API.""" + + object: Literal["file"] = Field(default="file", description="The object type, which is always 'file'.") + id: str = Field(..., description="The file identifier, which can be referenced in the API endpoints.") + bytes: int = Field(..., description="The size of the file, in bytes.") + created_at: int = Field(..., description="The Unix timestamp (in seconds) for when the file was created.") + expires_at: int = Field(..., description="The Unix timestamp (in seconds) for when the file expires.") + filename: str = Field(..., description="The name of the file.") + purpose: OpenAIFilePurpose = Field(..., description="The intended purpose of the file.") + + +@json_schema_type +class ExpiresAfter(BaseModel): + """Control expiration of uploaded files.""" + + MIN: ClassVar[int] = 3600 # 1 hour + MAX: ClassVar[int] = 2592000 # 30 days + + anchor: Literal["created_at"] = Field(..., description="Anchor must be 'created_at'.") + seconds: int = Field(..., ge=3600, le=2592000, description="Seconds between 3600 and 2592000 (1 hour to 30 days).") + + +@json_schema_type +class ListOpenAIFileResponse(BaseModel): + """Response for listing files in OpenAI Files API.""" + + data: list[OpenAIFileObject] = Field(..., description="List of file objects.") + has_more: bool = Field(..., description="Whether there are more files available beyond this page.") + first_id: str = Field(..., description="ID of the first file in the list for pagination.") + last_id: str = Field(..., description="ID of the last file in the list for pagination.") + object: Literal["list"] = Field(default="list", description="The object type, which is always 'list'.") + + +@json_schema_type +class OpenAIFileDeleteResponse(BaseModel): + """Response for deleting a file in OpenAI Files API.""" + + id: str = Field(..., description="The file identifier that was deleted.") + object: Literal["file"] = Field(default="file", description="The object type, which is always 'file'.") + deleted: bool = Field(..., description="Whether the file was successfully deleted.") diff --git a/src/llama_stack/apis/files/routes.py b/src/llama_stack/apis/files/routes.py new file mode 100644 index 0000000000..277febddc2 --- /dev/null +++ b/src/llama_stack/apis/files/routes.py @@ -0,0 +1,135 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated + +from fastapi import Depends, File, Form, Query, Request, Response, UploadFile +from fastapi import Path as FastAPIPath + +from llama_stack.apis.common.responses import Order +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1 +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .files_service import FileService +from .models import ( + ExpiresAfter, + ListOpenAIFileResponse, + OpenAIFileDeleteResponse, + OpenAIFileObject, + OpenAIFilePurpose, +) + + +def get_file_service(request: Request) -> FileService: + """Dependency to get the file service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.files not in impls: + raise ValueError("Files API implementation not found") + return impls[Api.files] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Files"], + responses=standard_responses, +) + + +@router.post( + "/files", + response_model=OpenAIFileObject, + summary="Upload file.", + description="Upload a file that can be used across various endpoints.", +) +async def openai_upload_file( + file: Annotated[UploadFile, File(..., description="The File object to be uploaded.")], + purpose: Annotated[OpenAIFilePurpose, Form(..., description="The intended purpose of the uploaded file.")], + expires_after: Annotated[ + ExpiresAfter | None, Form(description="Optional form values describing expiration for the file.") + ] = None, + svc: FileService = Depends(get_file_service), +) -> OpenAIFileObject: + """Upload a file.""" + return await svc.openai_upload_file(file=file, purpose=purpose, expires_after=expires_after) + + +@router.get( + "/files", + response_model=ListOpenAIFileResponse, + summary="List files.", + description="Returns a list of files that belong to the user's organization.", +) +async def openai_list_files( + after: str | None = Query( + None, description="A cursor for use in pagination. `after` is an object ID that defines your place in the list." + ), + limit: int | None = Query( + 10000, + description="A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000.", + ), + order: Order | None = Query( + Order.desc, + description="Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.", + ), + purpose: OpenAIFilePurpose | None = Query(None, description="Only return files with the given purpose."), + svc: FileService = Depends(get_file_service), +) -> ListOpenAIFileResponse: + """List files.""" + return await svc.openai_list_files(after=after, limit=limit, order=order, purpose=purpose) + + +@router.get( + "/files/{file_id}", + response_model=OpenAIFileObject, + summary="Retrieve file.", + description="Returns information about a specific file.", +) +async def openai_retrieve_file( + file_id: Annotated[str, FastAPIPath(..., description="The ID of the file to use for this request.")], + svc: FileService = Depends(get_file_service), +) -> OpenAIFileObject: + """Retrieve file information.""" + return await svc.openai_retrieve_file(file_id=file_id) + + +@router.delete( + "/files/{file_id}", + response_model=OpenAIFileDeleteResponse, + summary="Delete file.", + description="Delete a file.", +) +async def openai_delete_file( + file_id: Annotated[str, FastAPIPath(..., description="The ID of the file to use for this request.")], + svc: FileService = Depends(get_file_service), +) -> OpenAIFileDeleteResponse: + """Delete a file.""" + return await svc.openai_delete_file(file_id=file_id) + + +@router.get( + "/files/{file_id}/content", + response_class=Response, + summary="Retrieve file content.", + description="Returns the contents of the specified file.", +) +async def openai_retrieve_file_content( + file_id: Annotated[str, FastAPIPath(..., description="The ID of the file to use for this request.")], + svc: FileService = Depends(get_file_service), +) -> Response: + """Retrieve file content.""" + return await svc.openai_retrieve_file_content(file_id=file_id) + + +# For backward compatibility with the router registry system +def create_files_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Files API (legacy compatibility).""" + return router + + +# Register the router factory +register_router(Api.files, create_files_router) diff --git a/src/llama_stack/apis/inference/__init__.py b/src/llama_stack/apis/inference/__init__.py index f0c8783c14..7a8d17bf43 100644 --- a/src/llama_stack/apis/inference/__init__.py +++ b/src/llama_stack/apis/inference/__init__.py @@ -4,4 +4,206 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .inference import * +# Import routes to trigger router registration +from llama_stack.apis.common.content_types import InterleavedContent +from llama_stack.apis.common.responses import Order +from llama_stack.models.llama.datatypes import BuiltinTool, StopReason, ToolCall, ToolDefinition, ToolPromptFormat + +from . import routes # noqa: F401 +from .inference_service import InferenceService +from .models import ( + Bf16QuantizationConfig, + ChatCompletionRequest, + ChatCompletionResponse, + ChatCompletionResponseEvent, + ChatCompletionResponseEventType, + ChatCompletionResponseStreamChunk, + CompletionMessage, + CompletionRequest, + CompletionResponse, + CompletionResponseStreamChunk, + EmbeddingsResponse, + EmbeddingTaskType, + Fp8QuantizationConfig, + GrammarResponseFormat, + GreedySamplingStrategy, + Int4QuantizationConfig, + JsonSchemaResponseFormat, + ListOpenAIChatCompletionResponse, + LogProbConfig, + Message, + ModelStore, + OpenAIAssistantMessageParam, + OpenAIChatCompletion, + OpenAIChatCompletionChunk, + OpenAIChatCompletionContentPartImageParam, + OpenAIChatCompletionContentPartParam, + OpenAIChatCompletionContentPartTextParam, + OpenAIChatCompletionMessageContent, + OpenAIChatCompletionRequestWithExtraBody, + OpenAIChatCompletionTextOnlyMessageContent, + OpenAIChatCompletionToolCall, + OpenAIChatCompletionToolCallFunction, + OpenAIChatCompletionUsage, + OpenAIChatCompletionUsageCompletionTokensDetails, + OpenAIChatCompletionUsagePromptTokensDetails, + OpenAIChoice, + OpenAIChoiceDelta, + OpenAIChoiceLogprobs, + OpenAIChunkChoice, + OpenAICompletion, + OpenAICompletionChoice, + OpenAICompletionLogprobs, + OpenAICompletionRequestWithExtraBody, + OpenAICompletionWithInputMessages, + OpenAIDeveloperMessageParam, + OpenAIEmbeddingData, + OpenAIEmbeddingsRequestWithExtraBody, + OpenAIEmbeddingsResponse, + OpenAIEmbeddingUsage, + OpenAIFile, + OpenAIFileFile, + OpenAIImageURL, + OpenAIJSONSchema, + OpenAIMessageParam, + OpenAIResponseFormatJSONObject, + OpenAIResponseFormatJSONSchema, + OpenAIResponseFormatParam, + OpenAIResponseFormatText, + OpenAISystemMessageParam, + OpenAITokenLogProb, + OpenAIToolMessageParam, + OpenAITopLogProb, + OpenAIUserMessageParam, + QuantizationConfig, + QuantizationType, + RerankData, + RerankResponse, + ResponseFormat, + ResponseFormatType, + SamplingParams, + SamplingStrategy, + SystemMessage, + SystemMessageBehavior, + TextTruncation, + TokenLogProbs, + ToolChoice, + ToolConfig, + ToolResponse, + ToolResponseMessage, + TopKSamplingStrategy, + TopPSamplingStrategy, + UserMessage, +) + +# Backward compatibility - export Inference as alias for InferenceService +Inference = InferenceService +InferenceProvider = InferenceService + +__all__ = [ + "Inference", + "InferenceProvider", + "InferenceService", + "InterleavedContent", + "ModelStore", + "Order", + # Sampling + "SamplingParams", + "SamplingStrategy", + "GreedySamplingStrategy", + "TopPSamplingStrategy", + "TopKSamplingStrategy", + # Quantization + "QuantizationConfig", + "QuantizationType", + "Bf16QuantizationConfig", + "Fp8QuantizationConfig", + "Int4QuantizationConfig", + # Messages + "Message", + "UserMessage", + "SystemMessage", + "ToolResponseMessage", + "CompletionMessage", + # Tools + "BuiltinTool", + "ToolCall", + "ToolChoice", + "ToolConfig", + "ToolDefinition", + "ToolPromptFormat", + "ToolResponse", + # StopReason + "StopReason", + # Completion + "CompletionRequest", + "CompletionResponse", + "CompletionResponseStreamChunk", + # Chat Completion + "ChatCompletionRequest", + "ChatCompletionResponse", + "ChatCompletionResponseStreamChunk", + "ChatCompletionResponseEvent", + "ChatCompletionResponseEventType", + # Embeddings + "EmbeddingsResponse", + "EmbeddingTaskType", + "TextTruncation", + # Rerank + "RerankResponse", + "RerankData", + # Response Format + "ResponseFormat", + "ResponseFormatType", + "JsonSchemaResponseFormat", + "GrammarResponseFormat", + # Log Probs + "LogProbConfig", + "TokenLogProbs", + # System Message Behavior + "SystemMessageBehavior", + # OpenAI Models + "OpenAICompletion", + "OpenAICompletionRequestWithExtraBody", + "OpenAICompletionChoice", + "OpenAICompletionLogprobs", + "OpenAIChatCompletion", + "OpenAIChatCompletionRequestWithExtraBody", + "OpenAIChatCompletionChunk", + "OpenAIChatCompletionUsage", + "OpenAIChatCompletionUsageCompletionTokensDetails", + "OpenAIChatCompletionUsagePromptTokensDetails", + "OpenAIChoice", + "OpenAIChoiceDelta", + "OpenAIChoiceLogprobs", + "OpenAIChunkChoice", + "OpenAIMessageParam", + "OpenAIUserMessageParam", + "OpenAISystemMessageParam", + "OpenAIAssistantMessageParam", + "OpenAIToolMessageParam", + "OpenAIDeveloperMessageParam", + "OpenAIChatCompletionContentPartParam", + "OpenAIChatCompletionContentPartTextParam", + "OpenAIChatCompletionContentPartImageParam", + "OpenAIChatCompletionMessageContent", + "OpenAIChatCompletionTextOnlyMessageContent", + "OpenAIChatCompletionToolCall", + "OpenAIChatCompletionToolCallFunction", + "OpenAIEmbeddingsRequestWithExtraBody", + "OpenAIEmbeddingsResponse", + "OpenAIEmbeddingData", + "OpenAIEmbeddingUsage", + "OpenAIResponseFormatParam", + "OpenAIResponseFormatText", + "OpenAIResponseFormatJSONSchema", + "OpenAIResponseFormatJSONObject", + "OpenAIJSONSchema", + "OpenAIImageURL", + "OpenAIFile", + "OpenAIFileFile", + "OpenAITokenLogProb", + "OpenAITopLogProb", + "OpenAICompletionWithInputMessages", + "ListOpenAIChatCompletionResponse", +] diff --git a/src/llama_stack/apis/inference/inference.py b/src/llama_stack/apis/inference/inference.py deleted file mode 100644 index f399571901..0000000000 --- a/src/llama_stack/apis/inference/inference.py +++ /dev/null @@ -1,1267 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -from collections.abc import AsyncIterator -from enum import Enum -from typing import ( - Annotated, - Any, - Literal, - Protocol, - runtime_checkable, -) - -from fastapi import Body -from pydantic import BaseModel, Field, field_validator -from typing_extensions import TypedDict - -from llama_stack.apis.common.content_types import ContentDelta, InterleavedContent -from llama_stack.apis.common.responses import Order -from llama_stack.apis.models import Model -from llama_stack.apis.version import LLAMA_STACK_API_V1, LLAMA_STACK_API_V1ALPHA -from llama_stack.core.telemetry.telemetry import MetricResponseMixin -from llama_stack.core.telemetry.trace_protocol import trace_protocol -from llama_stack.models.llama.datatypes import ( - BuiltinTool, - StopReason, - ToolCall, - ToolDefinition, - ToolPromptFormat, -) -from llama_stack.schema_utils import json_schema_type, register_schema, webmethod - -register_schema(ToolCall) -register_schema(ToolDefinition) - -from enum import StrEnum - - -@json_schema_type -class GreedySamplingStrategy(BaseModel): - """Greedy sampling strategy that selects the highest probability token at each step. - - :param type: Must be "greedy" to identify this sampling strategy - """ - - type: Literal["greedy"] = "greedy" - - -@json_schema_type -class TopPSamplingStrategy(BaseModel): - """Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p. - - :param type: Must be "top_p" to identify this sampling strategy - :param temperature: Controls randomness in sampling. Higher values increase randomness - :param top_p: Cumulative probability threshold for nucleus sampling. Defaults to 0.95 - """ - - type: Literal["top_p"] = "top_p" - temperature: float | None = Field(..., gt=0.0) - top_p: float | None = 0.95 - - -@json_schema_type -class TopKSamplingStrategy(BaseModel): - """Top-k sampling strategy that restricts sampling to the k most likely tokens. - - :param type: Must be "top_k" to identify this sampling strategy - :param top_k: Number of top tokens to consider for sampling. Must be at least 1 - """ - - type: Literal["top_k"] = "top_k" - top_k: int = Field(..., ge=1) - - -SamplingStrategy = Annotated[ - GreedySamplingStrategy | TopPSamplingStrategy | TopKSamplingStrategy, - Field(discriminator="type"), -] -register_schema(SamplingStrategy, name="SamplingStrategy") - - -@json_schema_type -class SamplingParams(BaseModel): - """Sampling parameters. - - :param strategy: The sampling strategy. - :param max_tokens: The maximum number of tokens that can be generated in the completion. The token count of - your prompt plus max_tokens cannot exceed the model's context length. - :param repetition_penalty: Number between -2.0 and 2.0. Positive values penalize new tokens - based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. - :param stop: Up to 4 sequences where the API will stop generating further tokens. - The returned text will not contain the stop sequence. - """ - - strategy: SamplingStrategy = Field(default_factory=GreedySamplingStrategy) - - max_tokens: int | None = None - repetition_penalty: float | None = 1.0 - stop: list[str] | None = None - - -class LogProbConfig(BaseModel): - """ - - :param top_k: How many tokens (for each position) to return log probabilities for. - """ - - top_k: int | None = 0 - - -class QuantizationType(Enum): - """Type of model quantization to run inference with. - - :cvar bf16: BFloat16 typically this means _no_ quantization - :cvar fp8_mixed: 8-bit floating point quantization with mixed precision - :cvar int4_mixed: 4-bit integer quantization with mixed precision - """ - - bf16 = "bf16" - fp8_mixed = "fp8_mixed" - int4_mixed = "int4_mixed" - - -@json_schema_type -class Fp8QuantizationConfig(BaseModel): - """Configuration for 8-bit floating point quantization. - - :param type: Must be "fp8_mixed" to identify this quantization type - """ - - type: Literal["fp8_mixed"] = "fp8_mixed" - - -@json_schema_type -class Bf16QuantizationConfig(BaseModel): - """Configuration for BFloat16 precision (typically no quantization). - - :param type: Must be "bf16" to identify this quantization type - """ - - type: Literal["bf16"] = "bf16" - - -@json_schema_type -class Int4QuantizationConfig(BaseModel): - """Configuration for 4-bit integer quantization. - - :param type: Must be "int4" to identify this quantization type - :param scheme: Quantization scheme to use. Defaults to "int4_weight_int8_dynamic_activation" - """ - - type: Literal["int4_mixed"] = "int4_mixed" - scheme: str | None = "int4_weight_int8_dynamic_activation" - - -QuantizationConfig = Annotated[ - Bf16QuantizationConfig | Fp8QuantizationConfig | Int4QuantizationConfig, - Field(discriminator="type"), -] - - -@json_schema_type -class UserMessage(BaseModel): - """A message from the user in a chat conversation. - - :param role: Must be "user" to identify this as a user message - :param content: The content of the message, which can include text and other media - :param context: (Optional) This field is used internally by Llama Stack to pass RAG context. This field may be removed in the API in the future. - """ - - role: Literal["user"] = "user" - content: InterleavedContent - context: InterleavedContent | None = None - - -@json_schema_type -class SystemMessage(BaseModel): - """A system message providing instructions or context to the model. - - :param role: Must be "system" to identify this as a system message - :param content: The content of the "system prompt". If multiple system messages are provided, they are concatenated. The underlying Llama Stack code may also add other system messages (for example, for formatting tool definitions). - """ - - role: Literal["system"] = "system" - content: InterleavedContent - - -@json_schema_type -class ToolResponseMessage(BaseModel): - """A message representing the result of a tool invocation. - - :param role: Must be "tool" to identify this as a tool response - :param call_id: Unique identifier for the tool call this response is for - :param content: The response content from the tool - """ - - role: Literal["tool"] = "tool" - call_id: str - content: InterleavedContent - - -@json_schema_type -class CompletionMessage(BaseModel): - """A message containing the model's (assistant) response in a chat conversation. - - :param role: Must be "assistant" to identify this as the model's response - :param content: The content of the model's response - :param stop_reason: Reason why the model stopped generating. Options are: - - `StopReason.end_of_turn`: The model finished generating the entire response. - - `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response. - - `StopReason.out_of_tokens`: The model ran out of token budget. - :param tool_calls: List of tool calls. Each tool call is a ToolCall object. - """ - - role: Literal["assistant"] = "assistant" - content: InterleavedContent - stop_reason: StopReason - tool_calls: list[ToolCall] | None = Field(default_factory=lambda: []) - - -Message = Annotated[ - UserMessage | SystemMessage | ToolResponseMessage | CompletionMessage, - Field(discriminator="role"), -] -register_schema(Message, name="Message") - - -@json_schema_type -class ToolResponse(BaseModel): - """Response from a tool invocation. - - :param call_id: Unique identifier for the tool call this response is for - :param tool_name: Name of the tool that was invoked - :param content: The response content from the tool - :param metadata: (Optional) Additional metadata about the tool response - """ - - call_id: str - tool_name: BuiltinTool | str - content: InterleavedContent - metadata: dict[str, Any] | None = None - - @field_validator("tool_name", mode="before") - @classmethod - def validate_field(cls, v): - if isinstance(v, str): - try: - return BuiltinTool(v) - except ValueError: - return v - return v - - -class ToolChoice(Enum): - """Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model. - - :cvar auto: The model may use tools if it determines that is appropriate. - :cvar required: The model must use tools. - :cvar none: The model must not use tools. - """ - - auto = "auto" - required = "required" - none = "none" - - -@json_schema_type -class TokenLogProbs(BaseModel): - """Log probabilities for generated tokens. - - :param logprobs_by_token: Dictionary mapping tokens to their log probabilities - """ - - logprobs_by_token: dict[str, float] - - -class ChatCompletionResponseEventType(Enum): - """Types of events that can occur during chat completion. - - :cvar start: Inference has started - :cvar complete: Inference is complete and a full response is available - :cvar progress: Inference is in progress and a partial response is available - """ - - start = "start" - complete = "complete" - progress = "progress" - - -@json_schema_type -class ChatCompletionResponseEvent(BaseModel): - """An event during chat completion generation. - - :param event_type: Type of the event - :param delta: Content generated since last event. This can be one or more tokens, or a tool call. - :param logprobs: Optional log probabilities for generated tokens - :param stop_reason: Optional reason why generation stopped, if complete - """ - - event_type: ChatCompletionResponseEventType - delta: ContentDelta - logprobs: list[TokenLogProbs] | None = None - stop_reason: StopReason | None = None - - -class ResponseFormatType(StrEnum): - """Types of formats for structured (guided) decoding. - - :cvar json_schema: Response should conform to a JSON schema. In a Python SDK, this is often a `pydantic` model. - :cvar grammar: Response should conform to a BNF grammar - """ - - json_schema = "json_schema" - grammar = "grammar" - - -@json_schema_type -class JsonSchemaResponseFormat(BaseModel): - """Configuration for JSON schema-guided response generation. - - :param type: Must be "json_schema" to identify this format type - :param json_schema: The JSON schema the response should conform to. In a Python SDK, this is often a `pydantic` model. - """ - - type: Literal[ResponseFormatType.json_schema] = ResponseFormatType.json_schema - json_schema: dict[str, Any] - - -@json_schema_type -class GrammarResponseFormat(BaseModel): - """Configuration for grammar-guided response generation. - - :param type: Must be "grammar" to identify this format type - :param bnf: The BNF grammar specification the response should conform to - """ - - type: Literal[ResponseFormatType.grammar] = ResponseFormatType.grammar - bnf: dict[str, Any] - - -ResponseFormat = Annotated[ - JsonSchemaResponseFormat | GrammarResponseFormat, - Field(discriminator="type"), -] -register_schema(ResponseFormat, name="ResponseFormat") - - -# This is an internally used class -class CompletionRequest(BaseModel): - model: str - content: InterleavedContent - sampling_params: SamplingParams | None = Field(default_factory=SamplingParams) - response_format: ResponseFormat | None = None - stream: bool | None = False - logprobs: LogProbConfig | None = None - - -@json_schema_type -class CompletionResponse(MetricResponseMixin): - """Response from a completion request. - - :param content: The generated completion text - :param stop_reason: Reason why generation stopped - :param logprobs: Optional log probabilities for generated tokens - """ - - content: str - stop_reason: StopReason - logprobs: list[TokenLogProbs] | None = None - - -@json_schema_type -class CompletionResponseStreamChunk(MetricResponseMixin): - """A chunk of a streamed completion response. - - :param delta: New content generated since last chunk. This can be one or more tokens. - :param stop_reason: Optional reason why generation stopped, if complete - :param logprobs: Optional log probabilities for generated tokens - """ - - delta: str - stop_reason: StopReason | None = None - logprobs: list[TokenLogProbs] | None = None - - -class SystemMessageBehavior(Enum): - """Config for how to override the default system prompt. - - :cvar append: Appends the provided system message to the default system prompt: - https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt- - :cvar replace: Replaces the default system prompt with the provided system message. The system message can include the string - '{{function_definitions}}' to indicate where the function definitions should be inserted. - """ - - append = "append" - replace = "replace" - - -@json_schema_type -class ToolConfig(BaseModel): - """Configuration for tool use. - - :param tool_choice: (Optional) Whether tool use is automatic, required, or none. Can also specify a tool name to use a specific tool. Defaults to ToolChoice.auto. - :param tool_prompt_format: (Optional) Instructs the model how to format tool calls. By default, Llama Stack will attempt to use a format that is best adapted to the model. - - `ToolPromptFormat.json`: The tool calls are formatted as a JSON object. - - `ToolPromptFormat.function_tag`: The tool calls are enclosed in a tag. - - `ToolPromptFormat.python_list`: The tool calls are output as Python syntax -- a list of function calls. - :param system_message_behavior: (Optional) Config for how to override the default system prompt. - - `SystemMessageBehavior.append`: Appends the provided system message to the default system prompt. - - `SystemMessageBehavior.replace`: Replaces the default system prompt with the provided system message. The system message can include the string - '{{function_definitions}}' to indicate where the function definitions should be inserted. - """ - - tool_choice: ToolChoice | str | None = Field(default=ToolChoice.auto) - tool_prompt_format: ToolPromptFormat | None = Field(default=None) - system_message_behavior: SystemMessageBehavior | None = Field(default=SystemMessageBehavior.append) - - def model_post_init(self, __context: Any) -> None: - if isinstance(self.tool_choice, str): - try: - self.tool_choice = ToolChoice[self.tool_choice] - except KeyError: - pass - - -# This is an internally used class -@json_schema_type -class ChatCompletionRequest(BaseModel): - model: str - messages: list[Message] - sampling_params: SamplingParams | None = Field(default_factory=SamplingParams) - - tools: list[ToolDefinition] | None = Field(default_factory=lambda: []) - tool_config: ToolConfig | None = Field(default_factory=ToolConfig) - - response_format: ResponseFormat | None = None - stream: bool | None = False - logprobs: LogProbConfig | None = None - - -@json_schema_type -class ChatCompletionResponseStreamChunk(MetricResponseMixin): - """A chunk of a streamed chat completion response. - - :param event: The event containing the new content - """ - - event: ChatCompletionResponseEvent - - -@json_schema_type -class ChatCompletionResponse(MetricResponseMixin): - """Response from a chat completion request. - - :param completion_message: The complete response message - :param logprobs: Optional log probabilities for generated tokens - """ - - completion_message: CompletionMessage - logprobs: list[TokenLogProbs] | None = None - - -@json_schema_type -class EmbeddingsResponse(BaseModel): - """Response containing generated embeddings. - - :param embeddings: List of embedding vectors, one per input content. Each embedding is a list of floats. The dimensionality of the embedding is model-specific; you can check model metadata using /models/{model_id} - """ - - embeddings: list[list[float]] - - -@json_schema_type -class RerankData(BaseModel): - """A single rerank result from a reranking response. - - :param index: The original index of the document in the input list - :param relevance_score: The relevance score from the model output. Values are inverted when applicable so that higher scores indicate greater relevance. - """ - - index: int - relevance_score: float - - -@json_schema_type -class RerankResponse(BaseModel): - """Response from a reranking request. - - :param data: List of rerank result objects, sorted by relevance score (descending) - """ - - data: list[RerankData] - - -@json_schema_type -class OpenAIChatCompletionContentPartTextParam(BaseModel): - """Text content part for OpenAI-compatible chat completion messages. - - :param type: Must be "text" to identify this as text content - :param text: The text content of the message - """ - - type: Literal["text"] = "text" - text: str - - -@json_schema_type -class OpenAIImageURL(BaseModel): - """Image URL specification for OpenAI-compatible chat completion messages. - - :param url: URL of the image to include in the message - :param detail: (Optional) Level of detail for image processing. Can be "low", "high", or "auto" - """ - - url: str - detail: str | None = None - - -@json_schema_type -class OpenAIChatCompletionContentPartImageParam(BaseModel): - """Image content part for OpenAI-compatible chat completion messages. - - :param type: Must be "image_url" to identify this as image content - :param image_url: Image URL specification and processing details - """ - - type: Literal["image_url"] = "image_url" - image_url: OpenAIImageURL - - -@json_schema_type -class OpenAIFileFile(BaseModel): - file_data: str | None = None - file_id: str | None = None - filename: str | None = None - - -@json_schema_type -class OpenAIFile(BaseModel): - type: Literal["file"] = "file" - file: OpenAIFileFile - - -OpenAIChatCompletionContentPartParam = Annotated[ - OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam | OpenAIFile, - Field(discriminator="type"), -] -register_schema(OpenAIChatCompletionContentPartParam, name="OpenAIChatCompletionContentPartParam") - - -OpenAIChatCompletionMessageContent = str | list[OpenAIChatCompletionContentPartParam] - -OpenAIChatCompletionTextOnlyMessageContent = str | list[OpenAIChatCompletionContentPartTextParam] - - -@json_schema_type -class OpenAIUserMessageParam(BaseModel): - """A message from the user in an OpenAI-compatible chat completion request. - - :param role: Must be "user" to identify this as a user message - :param content: The content of the message, which can include text and other media - :param name: (Optional) The name of the user message participant. - """ - - role: Literal["user"] = "user" - content: OpenAIChatCompletionMessageContent - name: str | None = None - - -@json_schema_type -class OpenAISystemMessageParam(BaseModel): - """A system message providing instructions or context to the model. - - :param role: Must be "system" to identify this as a system message - :param content: The content of the "system prompt". If multiple system messages are provided, they are concatenated. The underlying Llama Stack code may also add other system messages (for example, for formatting tool definitions). - :param name: (Optional) The name of the system message participant. - """ - - role: Literal["system"] = "system" - content: OpenAIChatCompletionTextOnlyMessageContent - name: str | None = None - - -@json_schema_type -class OpenAIChatCompletionToolCallFunction(BaseModel): - """Function call details for OpenAI-compatible tool calls. - - :param name: (Optional) Name of the function to call - :param arguments: (Optional) Arguments to pass to the function as a JSON string - """ - - name: str | None = None - arguments: str | None = None - - -@json_schema_type -class OpenAIChatCompletionToolCall(BaseModel): - """Tool call specification for OpenAI-compatible chat completion responses. - - :param index: (Optional) Index of the tool call in the list - :param id: (Optional) Unique identifier for the tool call - :param type: Must be "function" to identify this as a function call - :param function: (Optional) Function call details - """ - - index: int | None = None - id: str | None = None - type: Literal["function"] = "function" - function: OpenAIChatCompletionToolCallFunction | None = None - - -@json_schema_type -class OpenAIAssistantMessageParam(BaseModel): - """A message containing the model's (assistant) response in an OpenAI-compatible chat completion request. - - :param role: Must be "assistant" to identify this as the model's response - :param content: The content of the model's response - :param name: (Optional) The name of the assistant message participant. - :param tool_calls: List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object. - """ - - role: Literal["assistant"] = "assistant" - content: OpenAIChatCompletionTextOnlyMessageContent | None = None - name: str | None = None - tool_calls: list[OpenAIChatCompletionToolCall] | None = None - - -@json_schema_type -class OpenAIToolMessageParam(BaseModel): - """A message representing the result of a tool invocation in an OpenAI-compatible chat completion request. - - :param role: Must be "tool" to identify this as a tool response - :param tool_call_id: Unique identifier for the tool call this response is for - :param content: The response content from the tool - """ - - role: Literal["tool"] = "tool" - tool_call_id: str - content: OpenAIChatCompletionTextOnlyMessageContent - - -@json_schema_type -class OpenAIDeveloperMessageParam(BaseModel): - """A message from the developer in an OpenAI-compatible chat completion request. - - :param role: Must be "developer" to identify this as a developer message - :param content: The content of the developer message - :param name: (Optional) The name of the developer message participant. - """ - - role: Literal["developer"] = "developer" - content: OpenAIChatCompletionTextOnlyMessageContent - name: str | None = None - - -OpenAIMessageParam = Annotated[ - OpenAIUserMessageParam - | OpenAISystemMessageParam - | OpenAIAssistantMessageParam - | OpenAIToolMessageParam - | OpenAIDeveloperMessageParam, - Field(discriminator="role"), -] -register_schema(OpenAIMessageParam, name="OpenAIMessageParam") - - -@json_schema_type -class OpenAIResponseFormatText(BaseModel): - """Text response format for OpenAI-compatible chat completion requests. - - :param type: Must be "text" to indicate plain text response format - """ - - type: Literal["text"] = "text" - - -@json_schema_type -class OpenAIJSONSchema(TypedDict, total=False): - """JSON schema specification for OpenAI-compatible structured response format. - - :param name: Name of the schema - :param description: (Optional) Description of the schema - :param strict: (Optional) Whether to enforce strict adherence to the schema - :param schema: (Optional) The JSON schema definition - """ - - name: str - description: str | None - strict: bool | None - - # Pydantic BaseModel cannot be used with a schema param, since it already - # has one. And, we don't want to alias here because then have to handle - # that alias when converting to OpenAI params. So, to support schema, - # we use a TypedDict. - schema: dict[str, Any] | None - - -@json_schema_type -class OpenAIResponseFormatJSONSchema(BaseModel): - """JSON schema response format for OpenAI-compatible chat completion requests. - - :param type: Must be "json_schema" to indicate structured JSON response format - :param json_schema: The JSON schema specification for the response - """ - - type: Literal["json_schema"] = "json_schema" - json_schema: OpenAIJSONSchema - - -@json_schema_type -class OpenAIResponseFormatJSONObject(BaseModel): - """JSON object response format for OpenAI-compatible chat completion requests. - - :param type: Must be "json_object" to indicate generic JSON object response format - """ - - type: Literal["json_object"] = "json_object" - - -OpenAIResponseFormatParam = Annotated[ - OpenAIResponseFormatText | OpenAIResponseFormatJSONSchema | OpenAIResponseFormatJSONObject, - Field(discriminator="type"), -] -register_schema(OpenAIResponseFormatParam, name="OpenAIResponseFormatParam") - - -@json_schema_type -class OpenAITopLogProb(BaseModel): - """The top log probability for a token from an OpenAI-compatible chat completion response. - - :token: The token - :bytes: (Optional) The bytes for the token - :logprob: The log probability of the token - """ - - token: str - bytes: list[int] | None = None - logprob: float - - -@json_schema_type -class OpenAITokenLogProb(BaseModel): - """The log probability for a token from an OpenAI-compatible chat completion response. - - :token: The token - :bytes: (Optional) The bytes for the token - :logprob: The log probability of the token - :top_logprobs: The top log probabilities for the token - """ - - token: str - bytes: list[int] | None = None - logprob: float - top_logprobs: list[OpenAITopLogProb] - - -@json_schema_type -class OpenAIChoiceLogprobs(BaseModel): - """The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response. - - :param content: (Optional) The log probabilities for the tokens in the message - :param refusal: (Optional) The log probabilities for the tokens in the message - """ - - content: list[OpenAITokenLogProb] | None = None - refusal: list[OpenAITokenLogProb] | None = None - - -@json_schema_type -class OpenAIChoiceDelta(BaseModel): - """A delta from an OpenAI-compatible chat completion streaming response. - - :param content: (Optional) The content of the delta - :param refusal: (Optional) The refusal of the delta - :param role: (Optional) The role of the delta - :param tool_calls: (Optional) The tool calls of the delta - :param reasoning_content: (Optional) The reasoning content from the model (non-standard, for o1/o3 models) - """ - - content: str | None = None - refusal: str | None = None - role: str | None = None - tool_calls: list[OpenAIChatCompletionToolCall] | None = None - reasoning_content: str | None = None - - -@json_schema_type -class OpenAIChunkChoice(BaseModel): - """A chunk choice from an OpenAI-compatible chat completion streaming response. - - :param delta: The delta from the chunk - :param finish_reason: The reason the model stopped generating - :param index: The index of the choice - :param logprobs: (Optional) The log probabilities for the tokens in the message - """ - - delta: OpenAIChoiceDelta - finish_reason: str - index: int - logprobs: OpenAIChoiceLogprobs | None = None - - -@json_schema_type -class OpenAIChoice(BaseModel): - """A choice from an OpenAI-compatible chat completion response. - - :param message: The message from the model - :param finish_reason: The reason the model stopped generating - :param index: The index of the choice - :param logprobs: (Optional) The log probabilities for the tokens in the message - """ - - message: OpenAIMessageParam - finish_reason: str - index: int - logprobs: OpenAIChoiceLogprobs | None = None - - -class OpenAIChatCompletionUsageCompletionTokensDetails(BaseModel): - """Token details for output tokens in OpenAI chat completion usage. - - :param reasoning_tokens: Number of tokens used for reasoning (o1/o3 models) - """ - - reasoning_tokens: int | None = None - - -class OpenAIChatCompletionUsagePromptTokensDetails(BaseModel): - """Token details for prompt tokens in OpenAI chat completion usage. - - :param cached_tokens: Number of tokens retrieved from cache - """ - - cached_tokens: int | None = None - - -@json_schema_type -class OpenAIChatCompletionUsage(BaseModel): - """Usage information for OpenAI chat completion. - - :param prompt_tokens: Number of tokens in the prompt - :param completion_tokens: Number of tokens in the completion - :param total_tokens: Total tokens used (prompt + completion) - :param input_tokens_details: Detailed breakdown of input token usage - :param output_tokens_details: Detailed breakdown of output token usage - """ - - prompt_tokens: int - completion_tokens: int - total_tokens: int - prompt_tokens_details: OpenAIChatCompletionUsagePromptTokensDetails | None = None - completion_tokens_details: OpenAIChatCompletionUsageCompletionTokensDetails | None = None - - -@json_schema_type -class OpenAIChatCompletion(BaseModel): - """Response from an OpenAI-compatible chat completion request. - - :param id: The ID of the chat completion - :param choices: List of choices - :param object: The object type, which will be "chat.completion" - :param created: The Unix timestamp in seconds when the chat completion was created - :param model: The model that was used to generate the chat completion - :param usage: Token usage information for the completion - """ - - id: str - choices: list[OpenAIChoice] - object: Literal["chat.completion"] = "chat.completion" - created: int - model: str - usage: OpenAIChatCompletionUsage | None = None - - -@json_schema_type -class OpenAIChatCompletionChunk(BaseModel): - """Chunk from a streaming response to an OpenAI-compatible chat completion request. - - :param id: The ID of the chat completion - :param choices: List of choices - :param object: The object type, which will be "chat.completion.chunk" - :param created: The Unix timestamp in seconds when the chat completion was created - :param model: The model that was used to generate the chat completion - :param usage: Token usage information (typically included in final chunk with stream_options) - """ - - id: str - choices: list[OpenAIChunkChoice] - object: Literal["chat.completion.chunk"] = "chat.completion.chunk" - created: int - model: str - usage: OpenAIChatCompletionUsage | None = None - - -@json_schema_type -class OpenAICompletionLogprobs(BaseModel): - """The log probabilities for the tokens in the message from an OpenAI-compatible completion response. - - :text_offset: (Optional) The offset of the token in the text - :token_logprobs: (Optional) The log probabilities for the tokens - :tokens: (Optional) The tokens - :top_logprobs: (Optional) The top log probabilities for the tokens - """ - - text_offset: list[int] | None = None - token_logprobs: list[float] | None = None - tokens: list[str] | None = None - top_logprobs: list[dict[str, float]] | None = None - - -@json_schema_type -class OpenAICompletionChoice(BaseModel): - """A choice from an OpenAI-compatible completion response. - - :finish_reason: The reason the model stopped generating - :text: The text of the choice - :index: The index of the choice - :logprobs: (Optional) The log probabilities for the tokens in the choice - """ - - finish_reason: str - text: str - index: int - logprobs: OpenAIChoiceLogprobs | None = None - - -@json_schema_type -class OpenAICompletion(BaseModel): - """Response from an OpenAI-compatible completion request. - - :id: The ID of the completion - :choices: List of choices - :created: The Unix timestamp in seconds when the completion was created - :model: The model that was used to generate the completion - :object: The object type, which will be "text_completion" - """ - - id: str - choices: list[OpenAICompletionChoice] - created: int - model: str - object: Literal["text_completion"] = "text_completion" - - -@json_schema_type -class OpenAIEmbeddingData(BaseModel): - """A single embedding data object from an OpenAI-compatible embeddings response. - - :param object: The object type, which will be "embedding" - :param embedding: The embedding vector as a list of floats (when encoding_format="float") or as a base64-encoded string (when encoding_format="base64") - :param index: The index of the embedding in the input list - """ - - object: Literal["embedding"] = "embedding" - # TODO: consider dropping str and using openai.types.embeddings.Embedding instead of OpenAIEmbeddingData - embedding: list[float] | str - index: int - - -@json_schema_type -class OpenAIEmbeddingUsage(BaseModel): - """Usage information for an OpenAI-compatible embeddings response. - - :param prompt_tokens: The number of tokens in the input - :param total_tokens: The total number of tokens used - """ - - prompt_tokens: int - total_tokens: int - - -@json_schema_type -class OpenAIEmbeddingsResponse(BaseModel): - """Response from an OpenAI-compatible embeddings request. - - :param object: The object type, which will be "list" - :param data: List of embedding data objects - :param model: The model that was used to generate the embeddings - :param usage: Usage information - """ - - object: Literal["list"] = "list" - data: list[OpenAIEmbeddingData] - model: str - usage: OpenAIEmbeddingUsage - - -class ModelStore(Protocol): - async def get_model(self, identifier: str) -> Model: ... - - -class TextTruncation(Enum): - """Config for how to truncate text for embedding when text is longer than the model's max sequence length. Start and End semantics depend on whether the language is left-to-right or right-to-left. - - :cvar none: No truncation (default). If the text is longer than the model's max sequence length, you will get an error. - :cvar start: Truncate from the start - :cvar end: Truncate from the end - """ - - none = "none" - start = "start" - end = "end" - - -class EmbeddingTaskType(Enum): - """How is the embedding being used? This is only supported by asymmetric embedding models. - - :cvar query: Used for a query for semantic search. - :cvar document: Used at indexing time when ingesting documents. - """ - - query = "query" - document = "document" - - -class OpenAICompletionWithInputMessages(OpenAIChatCompletion): - input_messages: list[OpenAIMessageParam] - - -@json_schema_type -class ListOpenAIChatCompletionResponse(BaseModel): - """Response from listing OpenAI-compatible chat completions. - - :param data: List of chat completion objects with their input messages - :param has_more: Whether there are more completions available beyond this list - :param first_id: ID of the first completion in this list - :param last_id: ID of the last completion in this list - :param object: Must be "list" to identify this as a list response - """ - - data: list[OpenAICompletionWithInputMessages] - has_more: bool - first_id: str - last_id: str - object: Literal["list"] = "list" - - -# extra_body can be accessed via .model_extra -@json_schema_type -class OpenAICompletionRequestWithExtraBody(BaseModel, extra="allow"): - """Request parameters for OpenAI-compatible completion endpoint. - - :param model: The identifier of the model to use. The model must be registered with Llama Stack and available via the /models endpoint. - :param prompt: The prompt to generate a completion for. - :param best_of: (Optional) The number of completions to generate. - :param echo: (Optional) Whether to echo the prompt. - :param frequency_penalty: (Optional) The penalty for repeated tokens. - :param logit_bias: (Optional) The logit bias to use. - :param logprobs: (Optional) The log probabilities to use. - :param max_tokens: (Optional) The maximum number of tokens to generate. - :param n: (Optional) The number of completions to generate. - :param presence_penalty: (Optional) The penalty for repeated tokens. - :param seed: (Optional) The seed to use. - :param stop: (Optional) The stop tokens to use. - :param stream: (Optional) Whether to stream the response. - :param stream_options: (Optional) The stream options to use. - :param temperature: (Optional) The temperature to use. - :param top_p: (Optional) The top p to use. - :param user: (Optional) The user to use. - :param suffix: (Optional) The suffix that should be appended to the completion. - """ - - # Standard OpenAI completion parameters - model: str - prompt: str | list[str] | list[int] | list[list[int]] - best_of: int | None = None - echo: bool | None = None - frequency_penalty: float | None = None - logit_bias: dict[str, float] | None = None - logprobs: bool | None = None - max_tokens: int | None = None - n: int | None = None - presence_penalty: float | None = None - seed: int | None = None - stop: str | list[str] | None = None - stream: bool | None = None - stream_options: dict[str, Any] | None = None - temperature: float | None = None - top_p: float | None = None - user: str | None = None - suffix: str | None = None - - -# extra_body can be accessed via .model_extra -@json_schema_type -class OpenAIChatCompletionRequestWithExtraBody(BaseModel, extra="allow"): - """Request parameters for OpenAI-compatible chat completion endpoint. - - :param model: The identifier of the model to use. The model must be registered with Llama Stack and available via the /models endpoint. - :param messages: List of messages in the conversation. - :param frequency_penalty: (Optional) The penalty for repeated tokens. - :param function_call: (Optional) The function call to use. - :param functions: (Optional) List of functions to use. - :param logit_bias: (Optional) The logit bias to use. - :param logprobs: (Optional) The log probabilities to use. - :param max_completion_tokens: (Optional) The maximum number of tokens to generate. - :param max_tokens: (Optional) The maximum number of tokens to generate. - :param n: (Optional) The number of completions to generate. - :param parallel_tool_calls: (Optional) Whether to parallelize tool calls. - :param presence_penalty: (Optional) The penalty for repeated tokens. - :param response_format: (Optional) The response format to use. - :param seed: (Optional) The seed to use. - :param stop: (Optional) The stop tokens to use. - :param stream: (Optional) Whether to stream the response. - :param stream_options: (Optional) The stream options to use. - :param temperature: (Optional) The temperature to use. - :param tool_choice: (Optional) The tool choice to use. - :param tools: (Optional) The tools to use. - :param top_logprobs: (Optional) The top log probabilities to use. - :param top_p: (Optional) The top p to use. - :param user: (Optional) The user to use. - """ - - # Standard OpenAI chat completion parameters - model: str - messages: Annotated[list[OpenAIMessageParam], Field(..., min_length=1)] - frequency_penalty: float | None = None - function_call: str | dict[str, Any] | None = None - functions: list[dict[str, Any]] | None = None - logit_bias: dict[str, float] | None = None - logprobs: bool | None = None - max_completion_tokens: int | None = None - max_tokens: int | None = None - n: int | None = None - parallel_tool_calls: bool | None = None - presence_penalty: float | None = None - response_format: OpenAIResponseFormatParam | None = None - seed: int | None = None - stop: str | list[str] | None = None - stream: bool | None = None - stream_options: dict[str, Any] | None = None - temperature: float | None = None - tool_choice: str | dict[str, Any] | None = None - tools: list[dict[str, Any]] | None = None - top_logprobs: int | None = None - top_p: float | None = None - user: str | None = None - - -# extra_body can be accessed via .model_extra -@json_schema_type -class OpenAIEmbeddingsRequestWithExtraBody(BaseModel, extra="allow"): - """Request parameters for OpenAI-compatible embeddings endpoint. - - :param model: The identifier of the model to use. The model must be an embedding model registered with Llama Stack and available via the /models endpoint. - :param input: Input text to embed, encoded as a string or array of strings. To embed multiple inputs in a single request, pass an array of strings. - :param encoding_format: (Optional) The format to return the embeddings in. Can be either "float" or "base64". Defaults to "float". - :param dimensions: (Optional) The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models. - :param user: (Optional) A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. - """ - - model: str - input: str | list[str] - encoding_format: str | None = "float" - dimensions: int | None = None - user: str | None = None - - -@runtime_checkable -@trace_protocol -class InferenceProvider(Protocol): - """ - This protocol defines the interface that should be implemented by all inference providers. - """ - - API_NAMESPACE: str = "Inference" - - model_store: ModelStore | None = None - - @webmethod(route="/inference/rerank", method="POST", level=LLAMA_STACK_API_V1ALPHA) - async def rerank( - self, - model: str, - query: str | OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam, - items: list[str | OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam], - max_num_results: int | None = None, - ) -> RerankResponse: - """Rerank a list of documents based on their relevance to a query. - - :param model: The identifier of the reranking model to use. - :param query: The search query to rank items against. Can be a string, text content part, or image content part. The input must not exceed the model's max input token length. - :param items: List of items to rerank. Each item can be a string, text content part, or image content part. Each input must not exceed the model's max input token length. - :param max_num_results: (Optional) Maximum number of results to return. Default: returns all. - :returns: RerankResponse with indices sorted by relevance score (descending). - """ - raise NotImplementedError("Reranking is not implemented") - return # this is so mypy's safe-super rule will consider the method concrete - - @webmethod(route="/completions", method="POST", level=LLAMA_STACK_API_V1) - async def openai_completion( - self, - params: Annotated[OpenAICompletionRequestWithExtraBody, Body(...)], - ) -> OpenAICompletion: - """Create completion. - - Generate an OpenAI-compatible completion for the given prompt using the specified model. - :returns: An OpenAICompletion. - """ - ... - - @webmethod(route="/chat/completions", method="POST", level=LLAMA_STACK_API_V1) - async def openai_chat_completion( - self, - params: Annotated[OpenAIChatCompletionRequestWithExtraBody, Body(...)], - ) -> OpenAIChatCompletion | AsyncIterator[OpenAIChatCompletionChunk]: - """Create chat completions. - - Generate an OpenAI-compatible chat completion for the given messages using the specified model. - :returns: An OpenAIChatCompletion. - """ - ... - - @webmethod(route="/embeddings", method="POST", level=LLAMA_STACK_API_V1) - async def openai_embeddings( - self, - params: Annotated[OpenAIEmbeddingsRequestWithExtraBody, Body(...)], - ) -> OpenAIEmbeddingsResponse: - """Create embeddings. - - Generate OpenAI-compatible embeddings for the given input using the specified model. - :returns: An OpenAIEmbeddingsResponse containing the embeddings. - """ - ... - - -class Inference(InferenceProvider): - """Inference - - Llama Stack Inference API for generating completions, chat completions, and embeddings. - - This API provides the raw interface to the underlying models. Three kinds of models are supported: - - LLM models: these models generate "raw" and "chat" (conversational) completions. - - Embedding models: these models generate embeddings to be used for semantic search. - - Rerank models: these models reorder the documents based on their relevance to a query. - """ - - @webmethod(route="/chat/completions", method="GET", level=LLAMA_STACK_API_V1) - async def list_chat_completions( - self, - after: str | None = None, - limit: int | None = 20, - model: str | None = None, - order: Order | None = Order.desc, - ) -> ListOpenAIChatCompletionResponse: - """List chat completions. - - :param after: The ID of the last chat completion to return. - :param limit: The maximum number of chat completions to return. - :param model: The model to filter by. - :param order: The order to sort the chat completions by: "asc" or "desc". Defaults to "desc". - :returns: A ListOpenAIChatCompletionResponse. - """ - raise NotImplementedError("List chat completions is not implemented") - - @webmethod(route="/chat/completions/{completion_id}", method="GET", level=LLAMA_STACK_API_V1) - async def get_chat_completion(self, completion_id: str) -> OpenAICompletionWithInputMessages: - """Get chat completion. - - Describe a chat completion by its ID. - - :param completion_id: ID of the chat completion. - :returns: A OpenAICompletionWithInputMessages. - """ - raise NotImplementedError("Get chat completion is not implemented") diff --git a/src/llama_stack/apis/inference/inference_service.py b/src/llama_stack/apis/inference/inference_service.py new file mode 100644 index 0000000000..65b6af33b9 --- /dev/null +++ b/src/llama_stack/apis/inference/inference_service.py @@ -0,0 +1,93 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from collections.abc import AsyncIterator +from typing import Annotated, Protocol, runtime_checkable + +from fastapi import Body + +from llama_stack.apis.common.responses import Order +from llama_stack.core.telemetry.trace_protocol import trace_protocol + +from .models import ( + ListOpenAIChatCompletionResponse, + ModelStore, + OpenAIChatCompletion, + OpenAIChatCompletionChunk, + OpenAIChatCompletionContentPartImageParam, + OpenAIChatCompletionContentPartTextParam, + OpenAIChatCompletionRequestWithExtraBody, + OpenAICompletion, + OpenAICompletionRequestWithExtraBody, + OpenAICompletionWithInputMessages, + OpenAIEmbeddingsRequestWithExtraBody, + OpenAIEmbeddingsResponse, + RerankResponse, +) + + +@runtime_checkable +@trace_protocol +class InferenceService(Protocol): + """ + This protocol defines the interface that should be implemented by all inference providers. + + Llama Stack Inference API for generating completions, chat completions, and embeddings. + + This API provides the raw interface to the underlying models. Three kinds of models are supported: + - LLM models: these models generate "raw" and "chat" (conversational) completions. + - Embedding models: these models generate embeddings to be used for semantic search. + - Rerank models: these models reorder the documents based on their relevance to a query. + """ + + API_NAMESPACE: str = "Inference" + + model_store: ModelStore | None = None + + async def rerank( + self, + model: str, + query: str | OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam, + items: list[str | OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam], + max_num_results: int | None = None, + ) -> RerankResponse: + """Rerank a list of documents based on their relevance to a query.""" + ... + + async def openai_completion( + self, + params: Annotated[OpenAICompletionRequestWithExtraBody, Body(...)], + ) -> OpenAICompletion: + """Create completion.""" + ... + + async def openai_chat_completion( + self, + params: Annotated[OpenAIChatCompletionRequestWithExtraBody, Body(...)], + ) -> OpenAIChatCompletion | AsyncIterator[OpenAIChatCompletionChunk]: + """Create chat completions.""" + ... + + async def openai_embeddings( + self, + params: Annotated[OpenAIEmbeddingsRequestWithExtraBody, Body(...)], + ) -> OpenAIEmbeddingsResponse: + """Create embeddings.""" + ... + + async def list_chat_completions( + self, + after: str | None = None, + limit: int | None = 20, + model: str | None = None, + order: Order | None = Order.desc, + ) -> ListOpenAIChatCompletionResponse: + """List chat completions.""" + ... + + async def get_chat_completion(self, completion_id: str) -> OpenAICompletionWithInputMessages: + """Get chat completion.""" + ... diff --git a/src/llama_stack/apis/inference/models.py b/src/llama_stack/apis/inference/models.py new file mode 100644 index 0000000000..4547211978 --- /dev/null +++ b/src/llama_stack/apis/inference/models.py @@ -0,0 +1,818 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from enum import Enum, StrEnum +from typing import Annotated, Any, Literal, Protocol + +from pydantic import BaseModel, Field, field_validator +from typing_extensions import TypedDict + +from llama_stack.apis.common.content_types import ContentDelta, InterleavedContent +from llama_stack.apis.models import Model +from llama_stack.core.telemetry.telemetry import MetricResponseMixin +from llama_stack.models.llama.datatypes import ( + BuiltinTool, + StopReason, + ToolCall, + ToolDefinition, + ToolPromptFormat, +) +from llama_stack.schema_utils import json_schema_type, register_schema + +register_schema(ToolCall) +register_schema(ToolDefinition) + + +@json_schema_type +class GreedySamplingStrategy(BaseModel): + """Greedy sampling strategy that selects the highest probability token at each step.""" + + type: Literal["greedy"] = "greedy" + + +@json_schema_type +class TopPSamplingStrategy(BaseModel): + """Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p.""" + + type: Literal["top_p"] = "top_p" + temperature: float | None = Field(..., gt=0.0) + top_p: float | None = 0.95 + + +@json_schema_type +class TopKSamplingStrategy(BaseModel): + """Top-k sampling strategy that restricts sampling to the k most likely tokens.""" + + type: Literal["top_k"] = "top_k" + top_k: int = Field(..., ge=1) + + +SamplingStrategy = Annotated[ + GreedySamplingStrategy | TopPSamplingStrategy | TopKSamplingStrategy, + Field(discriminator="type"), +] +register_schema(SamplingStrategy, name="SamplingStrategy") + + +@json_schema_type +class SamplingParams(BaseModel): + """Sampling parameters.""" + + strategy: SamplingStrategy = Field(default_factory=GreedySamplingStrategy) + + max_tokens: int | None = None + repetition_penalty: float | None = 1.0 + stop: list[str] | None = None + + +class LogProbConfig(BaseModel): + """Configuration for log probability generation.""" + + top_k: int | None = 0 + + +class QuantizationType(Enum): + """Type of model quantization to run inference with.""" + + bf16 = "bf16" + fp8_mixed = "fp8_mixed" + int4_mixed = "int4_mixed" + + +@json_schema_type +class Fp8QuantizationConfig(BaseModel): + """Configuration for 8-bit floating point quantization.""" + + type: Literal["fp8_mixed"] = "fp8_mixed" + + +@json_schema_type +class Bf16QuantizationConfig(BaseModel): + """Configuration for BFloat16 precision (typically no quantization).""" + + type: Literal["bf16"] = "bf16" + + +@json_schema_type +class Int4QuantizationConfig(BaseModel): + """Configuration for 4-bit integer quantization.""" + + type: Literal["int4_mixed"] = "int4_mixed" + scheme: str | None = "int4_weight_int8_dynamic_activation" + + +QuantizationConfig = Annotated[ + Bf16QuantizationConfig | Fp8QuantizationConfig | Int4QuantizationConfig, + Field(discriminator="type"), +] + + +@json_schema_type +class UserMessage(BaseModel): + """A message from the user in a chat conversation.""" + + role: Literal["user"] = "user" + content: InterleavedContent + context: InterleavedContent | None = None + + +@json_schema_type +class SystemMessage(BaseModel): + """A system message providing instructions or context to the model.""" + + role: Literal["system"] = "system" + content: InterleavedContent + + +@json_schema_type +class ToolResponseMessage(BaseModel): + """A message representing the result of a tool invocation.""" + + role: Literal["tool"] = "tool" + call_id: str + content: InterleavedContent + + +@json_schema_type +class CompletionMessage(BaseModel): + """A message containing the model's (assistant) response in a chat conversation. + + - `StopReason.end_of_turn`: The model finished generating the entire response. + - `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response. + - `StopReason.out_of_tokens`: The model ran out of token budget. + """ + + role: Literal["assistant"] = "assistant" + content: InterleavedContent + stop_reason: StopReason + tool_calls: list[ToolCall] | None = Field(default_factory=lambda: []) + + +Message = Annotated[ + UserMessage | SystemMessage | ToolResponseMessage | CompletionMessage, + Field(discriminator="role"), +] +register_schema(Message, name="Message") + + +@json_schema_type +class ToolResponse(BaseModel): + """Response from a tool invocation.""" + + call_id: str + tool_name: BuiltinTool | str + content: InterleavedContent + metadata: dict[str, Any] | None = None + + @field_validator("tool_name", mode="before") + @classmethod + def validate_field(cls, v): + if isinstance(v, str): + try: + return BuiltinTool(v) + except ValueError: + return v + return v + + +class ToolChoice(Enum): + """Whether tool use is required or automatic. This is a hint to the model which may not be followed. It depends on the Instruction Following capabilities of the model.""" + + auto = "auto" + required = "required" + none = "none" + + +@json_schema_type +class TokenLogProbs(BaseModel): + """Log probabilities for generated tokens.""" + + logprobs_by_token: dict[str, float] + + +class ChatCompletionResponseEventType(Enum): + """Types of events that can occur during chat completion.""" + + start = "start" + complete = "complete" + progress = "progress" + + +@json_schema_type +class ChatCompletionResponseEvent(BaseModel): + """An event during chat completion generation.""" + + event_type: ChatCompletionResponseEventType + delta: ContentDelta + logprobs: list[TokenLogProbs] | None = None + stop_reason: StopReason | None = None + + +class ResponseFormatType(StrEnum): + """Types of formats for structured (guided) decoding.""" + + json_schema = "json_schema" + grammar = "grammar" + + +@json_schema_type +class JsonSchemaResponseFormat(BaseModel): + """Configuration for JSON schema-guided response generation.""" + + type: Literal[ResponseFormatType.json_schema] = ResponseFormatType.json_schema + json_schema: dict[str, Any] + + +@json_schema_type +class GrammarResponseFormat(BaseModel): + """Configuration for grammar-guided response generation.""" + + type: Literal[ResponseFormatType.grammar] = ResponseFormatType.grammar + bnf: dict[str, Any] + + +ResponseFormat = Annotated[ + JsonSchemaResponseFormat | GrammarResponseFormat, + Field(discriminator="type"), +] +register_schema(ResponseFormat, name="ResponseFormat") + + +# This is an internally used class +class CompletionRequest(BaseModel): + content: InterleavedContent + sampling_params: SamplingParams | None = Field(default_factory=SamplingParams) + response_format: ResponseFormat | None = None + stream: bool | None = False + logprobs: LogProbConfig | None = None + + +@json_schema_type +class CompletionResponse(MetricResponseMixin): + """Response from a completion request.""" + + content: str + stop_reason: StopReason + logprobs: list[TokenLogProbs] | None = None + + +@json_schema_type +class CompletionResponseStreamChunk(MetricResponseMixin): + """A chunk of a streamed completion response.""" + + delta: str + stop_reason: StopReason | None = None + logprobs: list[TokenLogProbs] | None = None + + +class SystemMessageBehavior(Enum): + """Config for how to override the default system prompt. + + https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_2/#-function-definitions-in-the-system-prompt- + '{{function_definitions}}' to indicate where the function definitions should be inserted. + """ + + append = "append" + replace = "replace" + + +@json_schema_type +class ToolConfig(BaseModel): + """Configuration for tool use. + + - `ToolPromptFormat.json`: The tool calls are formatted as a JSON object. + - `ToolPromptFormat.function_tag`: The tool calls are enclosed in a tag. + - `ToolPromptFormat.python_list`: The tool calls are output as Python syntax -- a list of function calls. + - `SystemMessageBehavior.append`: Appends the provided system message to the default system prompt. + - `SystemMessageBehavior.replace`: Replaces the default system prompt with the provided system message. The system message can include the string + '{{function_definitions}}' to indicate where the function definitions should be inserted. + """ + + tool_choice: ToolChoice | str | None = Field(default=ToolChoice.auto) + tool_prompt_format: ToolPromptFormat | None = Field(default=None) + system_message_behavior: SystemMessageBehavior | None = Field(default=SystemMessageBehavior.append) + + def model_post_init(self, __context: Any) -> None: + if isinstance(self.tool_choice, str): + try: + self.tool_choice = ToolChoice[self.tool_choice] + except KeyError: + pass + + +# This is an internally used class +@json_schema_type +class ChatCompletionRequest(BaseModel): + messages: list[Message] + sampling_params: SamplingParams | None = Field(default_factory=SamplingParams) + + tools: list[ToolDefinition] | None = Field(default_factory=lambda: []) + tool_config: ToolConfig | None = Field(default_factory=ToolConfig) + + response_format: ResponseFormat | None = None + stream: bool | None = False + logprobs: LogProbConfig | None = None + + +@json_schema_type +class ChatCompletionResponseStreamChunk(MetricResponseMixin): + """A chunk of a streamed chat completion response.""" + + event: ChatCompletionResponseEvent + + +@json_schema_type +class ChatCompletionResponse(MetricResponseMixin): + """Response from a chat completion request.""" + + completion_message: CompletionMessage + logprobs: list[TokenLogProbs] | None = None + + +@json_schema_type +class EmbeddingsResponse(BaseModel): + """Response containing generated embeddings.""" + + embeddings: list[list[float]] + + +@json_schema_type +class RerankData(BaseModel): + """A single rerank result from a reranking response.""" + + index: int + relevance_score: float + + +@json_schema_type +class RerankResponse(BaseModel): + """Response from a reranking request.""" + + data: list[RerankData] + + +@json_schema_type +class OpenAIChatCompletionContentPartTextParam(BaseModel): + """Text content part for OpenAI-compatible chat completion messages.""" + + type: Literal["text"] = "text" + text: str + + +@json_schema_type +class OpenAIImageURL(BaseModel): + """Image URL specification for OpenAI-compatible chat completion messages.""" + + url: str + detail: str | None = None + + +@json_schema_type +class OpenAIChatCompletionContentPartImageParam(BaseModel): + """Image content part for OpenAI-compatible chat completion messages.""" + + type: Literal["image_url"] = "image_url" + image_url: OpenAIImageURL + + +@json_schema_type +class OpenAIFileFile(BaseModel): + file_id: str | None = None + filename: str | None = None + + +@json_schema_type +class OpenAIFile(BaseModel): + type: Literal["file"] = "file" + file: OpenAIFileFile + + +OpenAIChatCompletionContentPartParam = Annotated[ + OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam | OpenAIFile, + Field(discriminator="type"), +] +register_schema(OpenAIChatCompletionContentPartParam, name="OpenAIChatCompletionContentPartParam") + + +OpenAIChatCompletionMessageContent = str | list[OpenAIChatCompletionContentPartParam] + +OpenAIChatCompletionTextOnlyMessageContent = str | list[OpenAIChatCompletionContentPartTextParam] + + +@json_schema_type +class OpenAIUserMessageParam(BaseModel): + """A message from the user in an OpenAI-compatible chat completion request.""" + + role: Literal["user"] = "user" + content: OpenAIChatCompletionMessageContent + name: str | None = None + + +@json_schema_type +class OpenAISystemMessageParam(BaseModel): + """A system message providing instructions or context to the model.""" + + role: Literal["system"] = "system" + content: OpenAIChatCompletionTextOnlyMessageContent + name: str | None = None + + +@json_schema_type +class OpenAIChatCompletionToolCallFunction(BaseModel): + """Function call details for OpenAI-compatible tool calls.""" + + name: str | None = None + arguments: str | None = None + + +@json_schema_type +class OpenAIChatCompletionToolCall(BaseModel): + """Tool call specification for OpenAI-compatible chat completion responses.""" + + index: int | None = None + id: str | None = None + type: Literal["function"] = "function" + function: OpenAIChatCompletionToolCallFunction | None = None + + +@json_schema_type +class OpenAIAssistantMessageParam(BaseModel): + """A message containing the model's (assistant) response in an OpenAI-compatible chat completion request.""" + + role: Literal["assistant"] = "assistant" + content: OpenAIChatCompletionTextOnlyMessageContent | None = None + name: str | None = None + tool_calls: list[OpenAIChatCompletionToolCall] | None = None + + +@json_schema_type +class OpenAIToolMessageParam(BaseModel): + """A message representing the result of a tool invocation in an OpenAI-compatible chat completion request.""" + + role: Literal["tool"] = "tool" + tool_call_id: str + content: OpenAIChatCompletionTextOnlyMessageContent + + +@json_schema_type +class OpenAIDeveloperMessageParam(BaseModel): + """A message from the developer in an OpenAI-compatible chat completion request.""" + + role: Literal["developer"] = "developer" + content: OpenAIChatCompletionTextOnlyMessageContent + name: str | None = None + + +OpenAIMessageParam = Annotated[ + OpenAIUserMessageParam + | OpenAISystemMessageParam + | OpenAIAssistantMessageParam + | OpenAIToolMessageParam + | OpenAIDeveloperMessageParam, + Field(discriminator="role"), +] +register_schema(OpenAIMessageParam, name="OpenAIMessageParam") + + +@json_schema_type +class OpenAIResponseFormatText(BaseModel): + """Text response format for OpenAI-compatible chat completion requests.""" + + type: Literal["text"] = "text" + + +@json_schema_type +class OpenAIJSONSchema(TypedDict, total=False): + """JSON schema specification for OpenAI-compatible structured response format.""" + + name: str + description: str | None + strict: bool | None + + # Pydantic BaseModel cannot be used with a schema param, since it already + # has one. And, we don't want to alias here because then have to handle + # that alias when converting to OpenAI params. So, to support schema, + # we use a TypedDict. + schema: dict[str, Any] | None + + +@json_schema_type +class OpenAIResponseFormatJSONSchema(BaseModel): + """JSON schema response format for OpenAI-compatible chat completion requests.""" + + type: Literal["json_schema"] = "json_schema" + json_schema: OpenAIJSONSchema + + +@json_schema_type +class OpenAIResponseFormatJSONObject(BaseModel): + """JSON object response format for OpenAI-compatible chat completion requests.""" + + type: Literal["json_object"] = "json_object" + + +OpenAIResponseFormatParam = Annotated[ + OpenAIResponseFormatText | OpenAIResponseFormatJSONSchema | OpenAIResponseFormatJSONObject, + Field(discriminator="type"), +] +register_schema(OpenAIResponseFormatParam, name="OpenAIResponseFormatParam") + + +@json_schema_type +class OpenAITopLogProb(BaseModel): + """The top log probability for a token from an OpenAI-compatible chat completion response. + + :token: The token + :bytes: (Optional) The bytes for the token + :logprob: The log probability of the token + """ + + token: str + bytes: list[int] | None = None + logprob: float + + +@json_schema_type +class OpenAITokenLogProb(BaseModel): + """The log probability for a token from an OpenAI-compatible chat completion response. + + :token: The token + :bytes: (Optional) The bytes for the token + :logprob: The log probability of the token + :top_logprobs: The top log probabilities for the token + """ + + token: str + bytes: list[int] | None = None + logprob: float + top_logprobs: list[OpenAITopLogProb] + + +@json_schema_type +class OpenAIChoiceLogprobs(BaseModel): + """The log probabilities for the tokens in the message from an OpenAI-compatible chat completion response.""" + + content: list[OpenAITokenLogProb] | None = None + refusal: list[OpenAITokenLogProb] | None = None + + +@json_schema_type +class OpenAIChoiceDelta(BaseModel): + """A delta from an OpenAI-compatible chat completion streaming response.""" + + content: str | None = None + refusal: str | None = None + role: str | None = None + tool_calls: list[OpenAIChatCompletionToolCall] | None = None + reasoning_content: str | None = None + + +@json_schema_type +class OpenAIChunkChoice(BaseModel): + """A chunk choice from an OpenAI-compatible chat completion streaming response.""" + + delta: OpenAIChoiceDelta + finish_reason: str + index: int + logprobs: OpenAIChoiceLogprobs | None = None + + +@json_schema_type +class OpenAIChoice(BaseModel): + """A choice from an OpenAI-compatible chat completion response.""" + + message: OpenAIMessageParam + finish_reason: str + index: int + logprobs: OpenAIChoiceLogprobs | None = None + + +class OpenAIChatCompletionUsageCompletionTokensDetails(BaseModel): + """Token details for output tokens in OpenAI chat completion usage.""" + + reasoning_tokens: int | None = None + + +class OpenAIChatCompletionUsagePromptTokensDetails(BaseModel): + """Token details for prompt tokens in OpenAI chat completion usage.""" + + cached_tokens: int | None = None + + +@json_schema_type +class OpenAIChatCompletionUsage(BaseModel): + """Usage information for OpenAI chat completion.""" + + prompt_tokens: int + completion_tokens: int + total_tokens: int + prompt_tokens_details: OpenAIChatCompletionUsagePromptTokensDetails | None = None + completion_tokens_details: OpenAIChatCompletionUsageCompletionTokensDetails | None = None + + +@json_schema_type +class OpenAIChatCompletion(BaseModel): + """Response from an OpenAI-compatible chat completion request.""" + + id: str + choices: list[OpenAIChoice] + object: Literal["chat.completion"] = "chat.completion" + created: int + model: str + usage: OpenAIChatCompletionUsage | None = None + + +@json_schema_type +class OpenAIChatCompletionChunk(BaseModel): + """Chunk from a streaming response to an OpenAI-compatible chat completion request.""" + + id: str + choices: list[OpenAIChunkChoice] + object: Literal["chat.completion.chunk"] = "chat.completion.chunk" + created: int + model: str + usage: OpenAIChatCompletionUsage | None = None + + +@json_schema_type +class OpenAICompletionLogprobs(BaseModel): + """The log probabilities for the tokens in the message from an OpenAI-compatible completion response. + + :text_offset: (Optional) The offset of the token in the text + :token_logprobs: (Optional) The log probabilities for the tokens + :tokens: (Optional) The tokens + :top_logprobs: (Optional) The top log probabilities for the tokens + """ + + text_offset: list[int] | None = None + token_logprobs: list[float] | None = None + tokens: list[str] | None = None + top_logprobs: list[dict[str, float]] | None = None + + +@json_schema_type +class OpenAICompletionChoice(BaseModel): + """A choice from an OpenAI-compatible completion response. + + :finish_reason: The reason the model stopped generating + :text: The text of the choice + :index: The index of the choice + :logprobs: (Optional) The log probabilities for the tokens in the choice + """ + + finish_reason: str + text: str + index: int + logprobs: OpenAIChoiceLogprobs | None = None + + +@json_schema_type +class OpenAICompletion(BaseModel): + """Response from an OpenAI-compatible completion request. + + :id: The ID of the completion + :choices: List of choices + :created: The Unix timestamp in seconds when the completion was created + :model: The model that was used to generate the completion + :object: The object type, which will be "text_completion" + """ + + id: str + choices: list[OpenAICompletionChoice] + created: int + model: str + object: Literal["text_completion"] = "text_completion" + + +@json_schema_type +class OpenAIEmbeddingData(BaseModel): + """A single embedding data object from an OpenAI-compatible embeddings response.""" + + object: Literal["embedding"] = "embedding" + # TODO: consider dropping str and using openai.types.embeddings.Embedding instead of OpenAIEmbeddingData + embedding: list[float] | str + index: int + + +@json_schema_type +class OpenAIEmbeddingUsage(BaseModel): + """Usage information for an OpenAI-compatible embeddings response.""" + + prompt_tokens: int + total_tokens: int + + +@json_schema_type +class OpenAIEmbeddingsResponse(BaseModel): + """Response from an OpenAI-compatible embeddings request.""" + + object: Literal["list"] = "list" + data: list[OpenAIEmbeddingData] + model: str + usage: OpenAIEmbeddingUsage + + +class ModelStore(Protocol): + async def get_model(self, identifier: str) -> Model: ... + + +class TextTruncation(Enum): + """Config for how to truncate text for embedding when text is longer than the model's max sequence length. Start and End semantics depend on whether the language is left-to-right or right-to-left.""" + + none = "none" + start = "start" + end = "end" + + +class EmbeddingTaskType(Enum): + """How is the embedding being used? This is only supported by asymmetric embedding models.""" + + query = "query" + document = "document" + + +class OpenAICompletionWithInputMessages(OpenAIChatCompletion): + input_messages: list[OpenAIMessageParam] + + +@json_schema_type +class ListOpenAIChatCompletionResponse(BaseModel): + """Response from listing OpenAI-compatible chat completions.""" + + data: list[OpenAICompletionWithInputMessages] + has_more: bool + first_id: str + last_id: str + object: Literal["list"] = "list" + + +# extra_body can be accessed via .model_extra +@json_schema_type +class OpenAICompletionRequestWithExtraBody(BaseModel, extra="allow"): + """Request parameters for OpenAI-compatible completion endpoint.""" + + # Standard OpenAI completion parameters + model: str + prompt: str | list[str] | list[int] | list[list[int]] + best_of: int | None = None + echo: bool | None = None + frequency_penalty: float | None = None + logit_bias: dict[str, float] | None = None + logprobs: int | None = Field(None, ge=0, le=5) + max_tokens: int | None = None + n: int | None = None + presence_penalty: float | None = None + seed: int | None = None + stop: str | list[str] | None = None + stream: bool | None = None + stream_options: dict[str, Any] | None = None + temperature: float | None = None + top_p: float | None = None + user: str | None = None + suffix: str | None = None + + +# extra_body can be accessed via .model_extra +@json_schema_type +class OpenAIChatCompletionRequestWithExtraBody(BaseModel, extra="allow"): + """Request parameters for OpenAI-compatible chat completion endpoint.""" + + # Standard OpenAI chat completion parameters + model: str + messages: Annotated[list[OpenAIMessageParam], Field(..., min_length=1)] + frequency_penalty: float | None = None + function_call: str | dict[str, Any] | None = None + functions: list[dict[str, Any]] | None = None + logit_bias: dict[str, float] | None = None + logprobs: bool | None = None + max_completion_tokens: int | None = None + max_tokens: int | None = None + n: int | None = None + parallel_tool_calls: bool | None = None + presence_penalty: float | None = None + response_format: OpenAIResponseFormatParam | None = None + seed: int | None = None + stop: str | list[str] | None = None + stream: bool | None = None + stream_options: dict[str, Any] | None = None + temperature: float | None = None + tool_choice: str | dict[str, Any] | None = None + tools: list[dict[str, Any]] | None = None + top_logprobs: int | None = None + top_p: float | None = None + user: str | None = None + + +# extra_body can be accessed via .model_extra +@json_schema_type +class OpenAIEmbeddingsRequestWithExtraBody(BaseModel, extra="allow"): + """Request parameters for OpenAI-compatible embeddings endpoint.""" + + model: str + input: str | list[str] + encoding_format: str | None = "float" + dimensions: int | None = None + user: str | None = None diff --git a/src/llama_stack/apis/inference/routes.py b/src/llama_stack/apis/inference/routes.py new file mode 100644 index 0000000000..708b548918 --- /dev/null +++ b/src/llama_stack/apis/inference/routes.py @@ -0,0 +1,183 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +import json +from typing import Annotated + +from fastapi import Body, Depends, Query, Request +from fastapi import Path as FastAPIPath +from fastapi.responses import StreamingResponse +from pydantic import BaseModel + +from llama_stack.apis.common.responses import Order +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1, LLAMA_STACK_API_V1ALPHA +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .inference_service import InferenceService +from .models import ( + ListOpenAIChatCompletionResponse, + OpenAIChatCompletionContentPartImageParam, + OpenAIChatCompletionContentPartTextParam, + OpenAIChatCompletionRequestWithExtraBody, + OpenAICompletion, + OpenAICompletionRequestWithExtraBody, + OpenAICompletionWithInputMessages, + OpenAIEmbeddingsRequestWithExtraBody, + OpenAIEmbeddingsResponse, + RerankResponse, +) + + +def get_inference_service(request: Request) -> InferenceService: + """Dependency to get the inference service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.inference not in impls: + raise ValueError("Inference API implementation not found") + return impls[Api.inference] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Inference"], + responses=standard_responses, +) + +router_v1alpha = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1ALPHA}", + tags=["Inference"], + responses=standard_responses, +) + + +@router_v1alpha.post( + "/inference/rerank", + response_model=RerankResponse, + summary="Rerank a list of documents.", + description="Rerank a list of documents based on their relevance to a query.", +) +async def rerank( + model: str = Body(..., description="The identifier of the reranking model to use."), + query: str | OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam = Body( + ..., description="The search query to rank items against." + ), + items: list[str | OpenAIChatCompletionContentPartTextParam | OpenAIChatCompletionContentPartImageParam] = Body( + ..., description="List of items to rerank." + ), + max_num_results: int | None = Body(None, description="Maximum number of results to return. Default: returns all."), + svc: InferenceService = Depends(get_inference_service), +) -> RerankResponse: + """Rerank a list of documents based on their relevance to a query.""" + return await svc.rerank(model=model, query=query, items=items, max_num_results=max_num_results) + + +@router.post( + "/completions", + response_model=OpenAICompletion, + summary="Create completion.", + description="Create completion.", +) +async def openai_completion( + params: OpenAICompletionRequestWithExtraBody = Body(...), + svc: InferenceService = Depends(get_inference_service), +) -> OpenAICompletion: + """Create completion.""" + return await svc.openai_completion(params=params) + + +@router.post( + "/chat/completions", + summary="Create chat completions.", + description="Create chat completions.", +) +async def openai_chat_completion( + params: OpenAIChatCompletionRequestWithExtraBody = Body(...), + svc: InferenceService = Depends(get_inference_service), +): + """Create chat completions.""" + response = await svc.openai_chat_completion(params=params) + + # Check if response is an async generator/iterator (streaming response) + # Check for __aiter__ method which all async iterators have + if hasattr(response, "__aiter__"): + # Convert async generator to SSE stream + async def sse_stream(): + try: + async for chunk in response: + if isinstance(chunk, BaseModel): + data = chunk.model_dump_json() + else: + data = json.dumps(chunk) + yield f"data: {data}\n\n" + except Exception as e: + # Send error as SSE event + error_data = json.dumps({"error": {"message": str(e)}}) + yield f"data: {error_data}\n\n" + + return StreamingResponse(sse_stream(), media_type="text/event-stream") + + return response + + +@router.post( + "/embeddings", + response_model=OpenAIEmbeddingsResponse, + summary="Create embeddings.", + description="Create embeddings.", +) +async def openai_embeddings( + params: OpenAIEmbeddingsRequestWithExtraBody = Body(...), + svc: InferenceService = Depends(get_inference_service), +) -> OpenAIEmbeddingsResponse: + """Create embeddings.""" + return await svc.openai_embeddings(params=params) + + +@router.get( + "/chat/completions", + response_model=ListOpenAIChatCompletionResponse, + summary="List chat completions.", + description="List chat completions.", +) +async def list_chat_completions( + after: str | None = Query(None, description="The ID of the last chat completion to return."), + limit: int | None = Query(20, description="The maximum number of chat completions to return."), + model: str | None = Query(None, description="The model to filter by."), + order: Order | None = Query( + Order.desc, description="The order to sort the chat completions by: 'asc' or 'desc'. Defaults to 'desc'." + ), + svc: InferenceService = Depends(get_inference_service), +) -> ListOpenAIChatCompletionResponse: + """List chat completions.""" + return await svc.list_chat_completions(after=after, limit=limit, model=model, order=order) + + +@router.get( + "/chat/completions/{completion_id}", + response_model=OpenAICompletionWithInputMessages, + summary="Get chat completion.", + description="Get chat completion.", +) +async def get_chat_completion( + completion_id: Annotated[str, FastAPIPath(..., description="ID of the chat completion.")], + svc: InferenceService = Depends(get_inference_service), +) -> OpenAICompletionWithInputMessages: + """Get chat completion.""" + return await svc.get_chat_completion(completion_id=completion_id) + + +# For backward compatibility with the router registry system +def create_inference_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Inference API (legacy compatibility).""" + main_router = APIRouter() + main_router.include_router(router) + main_router.include_router(router_v1alpha) + return main_router + + +# Register the router factory +register_router(Api.inference, create_inference_router) diff --git a/src/llama_stack/apis/inspect/__init__.py b/src/llama_stack/apis/inspect/__init__.py index 016937e3df..afb0a588c9 100644 --- a/src/llama_stack/apis/inspect/__init__.py +++ b/src/llama_stack/apis/inspect/__init__.py @@ -4,4 +4,12 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .inspect import * +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .inspect_service import InspectService +from .models import HealthInfo, ListRoutesResponse, RouteInfo, VersionInfo + +# Backward compatibility - export Inspect as alias for InspectService +Inspect = InspectService + +__all__ = ["Inspect", "InspectService", "ListRoutesResponse", "RouteInfo", "HealthInfo", "VersionInfo"] diff --git a/src/llama_stack/apis/inspect/inspect.py b/src/llama_stack/apis/inspect/inspect.py deleted file mode 100644 index 4e0e2548bb..0000000000 --- a/src/llama_stack/apis/inspect/inspect.py +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -from typing import Literal, Protocol, runtime_checkable - -from pydantic import BaseModel - -from llama_stack.apis.version import ( - LLAMA_STACK_API_V1, -) -from llama_stack.providers.datatypes import HealthStatus -from llama_stack.schema_utils import json_schema_type, webmethod - -# Valid values for the route filter parameter. -# Actual API levels: v1, v1alpha, v1beta (filters by level, excludes deprecated) -# Special filter value: "deprecated" (shows deprecated routes regardless of level) -ApiFilter = Literal["v1", "v1alpha", "v1beta", "deprecated"] - - -@json_schema_type -class RouteInfo(BaseModel): - """Information about an API route including its path, method, and implementing providers. - - :param route: The API endpoint path - :param method: HTTP method for the route - :param provider_types: List of provider types that implement this route - """ - - route: str - method: str - provider_types: list[str] - - -@json_schema_type -class HealthInfo(BaseModel): - """Health status information for the service. - - :param status: Current health status of the service - """ - - status: HealthStatus - - -@json_schema_type -class VersionInfo(BaseModel): - """Version information for the service. - - :param version: Version number of the service - """ - - version: str - - -class ListRoutesResponse(BaseModel): - """Response containing a list of all available API routes. - - :param data: List of available route information objects - """ - - data: list[RouteInfo] - - -@runtime_checkable -class Inspect(Protocol): - """Inspect - - APIs for inspecting the Llama Stack service, including health status, available API routes with methods and implementing providers. - """ - - @webmethod(route="/inspect/routes", method="GET", level=LLAMA_STACK_API_V1) - async def list_routes(self, api_filter: ApiFilter | None = None) -> ListRoutesResponse: - """List routes. - - List all available API routes with their methods and implementing providers. - - :param api_filter: Optional filter to control which routes are returned. Can be an API level ('v1', 'v1alpha', 'v1beta') to show non-deprecated routes at that level, or 'deprecated' to show deprecated routes across all levels. If not specified, returns only non-deprecated v1 routes. - :returns: Response containing information about all available routes. - """ - ... - - @webmethod(route="/health", method="GET", level=LLAMA_STACK_API_V1, require_authentication=False) - async def health(self) -> HealthInfo: - """Get health status. - - Get the current health status of the service. - - :returns: Health information indicating if the service is operational. - """ - ... - - @webmethod(route="/version", method="GET", level=LLAMA_STACK_API_V1, require_authentication=False) - async def version(self) -> VersionInfo: - """Get version. - - Get the version of the service. - - :returns: Version information containing the service version number. - """ - ... diff --git a/src/llama_stack/apis/inspect/inspect_service.py b/src/llama_stack/apis/inspect/inspect_service.py new file mode 100644 index 0000000000..e117cb5c6d --- /dev/null +++ b/src/llama_stack/apis/inspect/inspect_service.py @@ -0,0 +1,29 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Protocol, runtime_checkable + +from .models import HealthInfo, ListRoutesResponse, VersionInfo + + +@runtime_checkable +class InspectService(Protocol): + """Inspect + + APIs for inspecting the Llama Stack service, including health status, available API routes with methods and implementing providers. + """ + + async def list_routes(self) -> ListRoutesResponse: + """List routes.""" + ... + + async def health(self) -> HealthInfo: + """Get health status.""" + ... + + async def version(self) -> VersionInfo: + """Get version.""" + ... diff --git a/src/llama_stack/apis/inspect/models.py b/src/llama_stack/apis/inspect/models.py new file mode 100644 index 0000000000..d84421ec7c --- /dev/null +++ b/src/llama_stack/apis/inspect/models.py @@ -0,0 +1,39 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from pydantic import BaseModel, Field + +from llama_stack.providers.datatypes import HealthStatus +from llama_stack.schema_utils import json_schema_type + + +@json_schema_type +class RouteInfo(BaseModel): + """Information about an API route including its path, method, and implementing providers.""" + + route: str = Field(..., description="The API endpoint path") + method: str = Field(..., description="HTTP method for the route") + provider_types: list[str] = Field(..., description="List of provider types that implement this route") + + +@json_schema_type +class HealthInfo(BaseModel): + """Health status information for the service.""" + + status: HealthStatus = Field(..., description="Current health status of the service") + + +@json_schema_type +class VersionInfo(BaseModel): + """Version information for the service.""" + + version: str = Field(..., description="Version number of the service") + + +class ListRoutesResponse(BaseModel): + """Response containing a list of all available API routes.""" + + data: list[RouteInfo] = Field(..., description="List of available route information objects") diff --git a/src/llama_stack/apis/inspect/routes.py b/src/llama_stack/apis/inspect/routes.py new file mode 100644 index 0000000000..14aeebfd1c --- /dev/null +++ b/src/llama_stack/apis/inspect/routes.py @@ -0,0 +1,73 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from fastapi import Depends, Request + +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1 +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .inspect_service import InspectService +from .models import HealthInfo, ListRoutesResponse, VersionInfo + + +def get_inspect_service(request: Request) -> InspectService: + """Dependency to get the inspect service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.inspect not in impls: + raise ValueError("Inspect API implementation not found") + return impls[Api.inspect] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Inspect"], + responses=standard_responses, +) + + +@router.get( + "/inspect/routes", + response_model=ListRoutesResponse, + summary="List routes.", + description="List all available API routes with their methods and implementing providers.", +) +async def list_routes(svc: InspectService = Depends(get_inspect_service)) -> ListRoutesResponse: + """List all available API routes.""" + return await svc.list_routes() + + +@router.get( + "/health", + response_model=HealthInfo, + summary="Get health status.", + description="Get the current health status of the service.", +) +async def health(svc: InspectService = Depends(get_inspect_service)) -> HealthInfo: + """Get the current health status of the service.""" + return await svc.health() + + +@router.get( + "/version", + response_model=VersionInfo, + summary="Get version.", + description="Get the version of the service.", +) +async def version(svc: InspectService = Depends(get_inspect_service)) -> VersionInfo: + """Get the version of the service.""" + return await svc.version() + + +# For backward compatibility with the router registry system +def create_inspect_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Inspect API (legacy compatibility).""" + return router + + +# Register the router factory +register_router(Api.inspect, create_inspect_router) diff --git a/src/llama_stack/apis/models/__init__.py b/src/llama_stack/apis/models/__init__.py index ee90106b6a..c6093de8e0 100644 --- a/src/llama_stack/apis/models/__init__.py +++ b/src/llama_stack/apis/models/__init__.py @@ -4,4 +4,30 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .models import * +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .model_schemas import ( + ListModelsResponse, + Model, + ModelInput, + ModelType, + OpenAIListModelsResponse, + OpenAIModel, + RegisterModelRequest, +) +from .models_service import ModelService + +# Backward compatibility - export Models as alias for ModelService +Models = ModelService + +__all__ = [ + "Models", + "ModelService", + "Model", + "ModelInput", + "ModelType", + "ListModelsResponse", + "RegisterModelRequest", + "OpenAIModel", + "OpenAIListModelsResponse", +] diff --git a/src/llama_stack/apis/models/model_schemas.py b/src/llama_stack/apis/models/model_schemas.py new file mode 100644 index 0000000000..9428063852 --- /dev/null +++ b/src/llama_stack/apis/models/model_schemas.py @@ -0,0 +1,98 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from enum import StrEnum +from typing import Any, Literal + +from pydantic import BaseModel, ConfigDict, Field, field_validator + +from llama_stack.apis.resource import Resource, ResourceType +from llama_stack.schema_utils import json_schema_type + + +class CommonModelFields(BaseModel): + metadata: dict[str, Any] = Field( + default_factory=dict, + description="Any additional metadata for this model.", + ) + + +@json_schema_type +class ModelType(StrEnum): + """Enumeration of supported model types in Llama Stack.""" + + llm = "llm" + embedding = "embedding" + rerank = "rerank" + + +@json_schema_type +class Model(CommonModelFields, Resource): + """A model resource representing an AI model registered in Llama Stack.""" + + type: Literal[ResourceType.model] = Field( + default=ResourceType.model, description="The resource type, always 'model' for model resources." + ) + model_type: ModelType = Field(default=ModelType.llm, description="The type of model (LLM or embedding model).") + + @property + def model_id(self) -> str: + return self.identifier + + @property + def provider_model_id(self) -> str: + assert self.provider_resource_id is not None, "Provider resource ID must be set" + return self.provider_resource_id + + model_config = ConfigDict(protected_namespaces=()) + + @field_validator("provider_resource_id") + @classmethod + def validate_provider_resource_id(cls, v): + if v is None: + raise ValueError("provider_resource_id cannot be None") + return v + + +class ModelInput(CommonModelFields): + model_id: str + provider_id: str | None = None + provider_model_id: str | None = None + model_type: ModelType | None = ModelType.llm + model_config = ConfigDict(protected_namespaces=()) + + +class ListModelsResponse(BaseModel): + """Response model for listing models.""" + + data: list[Model] = Field(description="List of model resources.") + + +@json_schema_type +class RegisterModelRequest(BaseModel): + """Request model for registering a new model.""" + + model_id: str = Field(..., description="The identifier of the model to register.") + provider_model_id: str | None = Field(default=None, description="The identifier of the model in the provider.") + provider_id: str | None = Field(default=None, description="The identifier of the provider.") + metadata: dict[str, Any] | None = Field(default=None, description="Any additional metadata for this model.") + model_type: ModelType | None = Field(default=None, description="The type of model to register.") + + +@json_schema_type +class OpenAIModel(BaseModel): + """A model from OpenAI.""" + + id: str = Field(..., description="The ID of the model.") + object: Literal["model"] = Field(default="model", description="The object type, which will be 'model'.") + created: int = Field(..., description="The Unix timestamp in seconds when the model was created.") + owned_by: str = Field(..., description="The owner of the model.") + + +class OpenAIListModelsResponse(BaseModel): + """Response model for listing OpenAI models.""" + + data: list[OpenAIModel] = Field(description="List of OpenAI model objects.") diff --git a/src/llama_stack/apis/models/models.py b/src/llama_stack/apis/models/models.py deleted file mode 100644 index 552f47c30e..0000000000 --- a/src/llama_stack/apis/models/models.py +++ /dev/null @@ -1,172 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -from enum import StrEnum -from typing import Any, Literal, Protocol, runtime_checkable - -from pydantic import BaseModel, ConfigDict, Field, field_validator - -from llama_stack.apis.resource import Resource, ResourceType -from llama_stack.apis.version import LLAMA_STACK_API_V1 -from llama_stack.core.telemetry.trace_protocol import trace_protocol -from llama_stack.schema_utils import json_schema_type, webmethod - - -class CommonModelFields(BaseModel): - metadata: dict[str, Any] = Field( - default_factory=dict, - description="Any additional metadata for this model", - ) - - -@json_schema_type -class ModelType(StrEnum): - """Enumeration of supported model types in Llama Stack. - :cvar llm: Large language model for text generation and completion - :cvar embedding: Embedding model for converting text to vector representations - :cvar rerank: Reranking model for reordering documents based on their relevance to a query - """ - - llm = "llm" - embedding = "embedding" - rerank = "rerank" - - -@json_schema_type -class Model(CommonModelFields, Resource): - """A model resource representing an AI model registered in Llama Stack. - - :param type: The resource type, always 'model' for model resources - :param model_type: The type of model (LLM or embedding model) - :param metadata: Any additional metadata for this model - :param identifier: Unique identifier for this resource in llama stack - :param provider_resource_id: Unique identifier for this resource in the provider - :param provider_id: ID of the provider that owns this resource - """ - - type: Literal[ResourceType.model] = ResourceType.model - - @property - def model_id(self) -> str: - return self.identifier - - @property - def provider_model_id(self) -> str: - assert self.provider_resource_id is not None, "Provider resource ID must be set" - return self.provider_resource_id - - model_config = ConfigDict(protected_namespaces=()) - - model_type: ModelType = Field(default=ModelType.llm) - - @field_validator("provider_resource_id") - @classmethod - def validate_provider_resource_id(cls, v): - if v is None: - raise ValueError("provider_resource_id cannot be None") - return v - - -class ModelInput(CommonModelFields): - model_id: str - provider_id: str | None = None - provider_model_id: str | None = None - model_type: ModelType | None = ModelType.llm - model_config = ConfigDict(protected_namespaces=()) - - -class ListModelsResponse(BaseModel): - data: list[Model] - - -@json_schema_type -class OpenAIModel(BaseModel): - """A model from OpenAI. - - :id: The ID of the model - :object: The object type, which will be "model" - :created: The Unix timestamp in seconds when the model was created - :owned_by: The owner of the model - :custom_metadata: Llama Stack-specific metadata including model_type, provider info, and additional metadata - """ - - id: str - object: Literal["model"] = "model" - created: int - owned_by: str - custom_metadata: dict[str, Any] | None = None - - -class OpenAIListModelsResponse(BaseModel): - data: list[OpenAIModel] - - -@runtime_checkable -@trace_protocol -class Models(Protocol): - async def list_models(self) -> ListModelsResponse: - """List all models. - - :returns: A ListModelsResponse. - """ - ... - - @webmethod(route="/models", method="GET", level=LLAMA_STACK_API_V1) - async def openai_list_models(self) -> OpenAIListModelsResponse: - """List models using the OpenAI API. - - :returns: A OpenAIListModelsResponse. - """ - ... - - @webmethod(route="/models/{model_id:path}", method="GET", level=LLAMA_STACK_API_V1) - async def get_model( - self, - model_id: str, - ) -> Model: - """Get model. - - Get a model by its identifier. - - :param model_id: The identifier of the model to get. - :returns: A Model. - """ - ... - - @webmethod(route="/models", method="POST", level=LLAMA_STACK_API_V1) - async def register_model( - self, - model_id: str, - provider_model_id: str | None = None, - provider_id: str | None = None, - metadata: dict[str, Any] | None = None, - model_type: ModelType | None = None, - ) -> Model: - """Register model. - - Register a model. - - :param model_id: The identifier of the model to register. - :param provider_model_id: The identifier of the model in the provider. - :param provider_id: The identifier of the provider. - :param metadata: Any additional metadata for this model. - :param model_type: The type of model to register. - :returns: A Model. - """ - ... - - @webmethod(route="/models/{model_id:path}", method="DELETE", level=LLAMA_STACK_API_V1) - async def unregister_model( - self, - model_id: str, - ) -> None: - """Unregister model. - - Unregister a model. - - :param model_id: The identifier of the model to unregister. - """ - ... diff --git a/src/llama_stack/apis/models/models_models.py b/src/llama_stack/apis/models/models_models.py new file mode 100644 index 0000000000..9428063852 --- /dev/null +++ b/src/llama_stack/apis/models/models_models.py @@ -0,0 +1,98 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from enum import StrEnum +from typing import Any, Literal + +from pydantic import BaseModel, ConfigDict, Field, field_validator + +from llama_stack.apis.resource import Resource, ResourceType +from llama_stack.schema_utils import json_schema_type + + +class CommonModelFields(BaseModel): + metadata: dict[str, Any] = Field( + default_factory=dict, + description="Any additional metadata for this model.", + ) + + +@json_schema_type +class ModelType(StrEnum): + """Enumeration of supported model types in Llama Stack.""" + + llm = "llm" + embedding = "embedding" + rerank = "rerank" + + +@json_schema_type +class Model(CommonModelFields, Resource): + """A model resource representing an AI model registered in Llama Stack.""" + + type: Literal[ResourceType.model] = Field( + default=ResourceType.model, description="The resource type, always 'model' for model resources." + ) + model_type: ModelType = Field(default=ModelType.llm, description="The type of model (LLM or embedding model).") + + @property + def model_id(self) -> str: + return self.identifier + + @property + def provider_model_id(self) -> str: + assert self.provider_resource_id is not None, "Provider resource ID must be set" + return self.provider_resource_id + + model_config = ConfigDict(protected_namespaces=()) + + @field_validator("provider_resource_id") + @classmethod + def validate_provider_resource_id(cls, v): + if v is None: + raise ValueError("provider_resource_id cannot be None") + return v + + +class ModelInput(CommonModelFields): + model_id: str + provider_id: str | None = None + provider_model_id: str | None = None + model_type: ModelType | None = ModelType.llm + model_config = ConfigDict(protected_namespaces=()) + + +class ListModelsResponse(BaseModel): + """Response model for listing models.""" + + data: list[Model] = Field(description="List of model resources.") + + +@json_schema_type +class RegisterModelRequest(BaseModel): + """Request model for registering a new model.""" + + model_id: str = Field(..., description="The identifier of the model to register.") + provider_model_id: str | None = Field(default=None, description="The identifier of the model in the provider.") + provider_id: str | None = Field(default=None, description="The identifier of the provider.") + metadata: dict[str, Any] | None = Field(default=None, description="Any additional metadata for this model.") + model_type: ModelType | None = Field(default=None, description="The type of model to register.") + + +@json_schema_type +class OpenAIModel(BaseModel): + """A model from OpenAI.""" + + id: str = Field(..., description="The ID of the model.") + object: Literal["model"] = Field(default="model", description="The object type, which will be 'model'.") + created: int = Field(..., description="The Unix timestamp in seconds when the model was created.") + owned_by: str = Field(..., description="The owner of the model.") + + +class OpenAIListModelsResponse(BaseModel): + """Response model for listing OpenAI models.""" + + data: list[OpenAIModel] = Field(description="List of OpenAI model objects.") diff --git a/src/llama_stack/apis/models/models_service.py b/src/llama_stack/apis/models/models_service.py new file mode 100644 index 0000000000..3cf2f6bea9 --- /dev/null +++ b/src/llama_stack/apis/models/models_service.py @@ -0,0 +1,53 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Any, Protocol, runtime_checkable + +from llama_stack.core.telemetry.trace_protocol import trace_protocol + +from .model_schemas import ( + ListModelsResponse, + Model, + ModelType, + OpenAIListModelsResponse, +) + + +@runtime_checkable +@trace_protocol +class ModelService(Protocol): + async def list_models(self) -> ListModelsResponse: + """List all models.""" + ... + + async def openai_list_models(self) -> OpenAIListModelsResponse: + """List models using the OpenAI API.""" + ... + + async def get_model( + self, + model_id: str, + ) -> Model: + """Get model.""" + ... + + async def register_model( + self, + model_id: str, + provider_model_id: str | None = None, + provider_id: str | None = None, + metadata: dict[str, Any] | None = None, + model_type: ModelType | None = None, + ) -> Model: + """Register model.""" + ... + + async def unregister_model( + self, + model_id: str, + ) -> None: + """Unregister model.""" + ... diff --git a/src/llama_stack/apis/models/routes.py b/src/llama_stack/apis/models/routes.py new file mode 100644 index 0000000000..510f502d54 --- /dev/null +++ b/src/llama_stack/apis/models/routes.py @@ -0,0 +1,107 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated + +from fastapi import Body, Depends, Request +from fastapi import Path as FastAPIPath + +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1 +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .model_schemas import ( + ListModelsResponse, + Model, + RegisterModelRequest, +) +from .models_service import ModelService + + +def get_model_service(request: Request) -> ModelService: + """Dependency to get the model service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.models not in impls: + raise ValueError("Models API implementation not found") + return impls[Api.models] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Models"], + responses=standard_responses, +) + + +@router.get( + "/models", + response_model=ListModelsResponse, + summary="List all models.", + description="List all models registered in Llama Stack.", +) +async def list_models(svc: ModelService = Depends(get_model_service)) -> ListModelsResponse: + """List all models.""" + return await svc.list_models() + + +@router.get( + "/models/{model_id:path}", + response_model=Model, + summary="Get model.", + description="Get a model by its identifier.", +) +async def get_model( + model_id: Annotated[str, FastAPIPath(..., description="The identifier of the model to get.")], + svc: ModelService = Depends(get_model_service), +) -> Model: + """Get model by its identifier.""" + return await svc.get_model(model_id=model_id) + + +@router.post( + "/models", + response_model=Model, + summary="Register model.", + description="Register a new model in Llama Stack.", +) +async def register_model( + body: RegisterModelRequest = Body(...), + svc: ModelService = Depends(get_model_service), +) -> Model: + """Register a new model.""" + return await svc.register_model( + model_id=body.model_id, + provider_model_id=body.provider_model_id, + provider_id=body.provider_id, + metadata=body.metadata, + model_type=body.model_type, + ) + + +@router.delete( + "/models/{model_id:path}", + response_model=None, + status_code=204, + summary="Unregister model.", + description="Unregister a model from Llama Stack.", +) +async def unregister_model( + model_id: Annotated[str, FastAPIPath(..., description="The identifier of the model to unregister.")], + svc: ModelService = Depends(get_model_service), +) -> None: + """Unregister a model.""" + await svc.unregister_model(model_id=model_id) + + +# For backward compatibility with the router registry system +def create_models_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Models API (legacy compatibility).""" + return router + + +# Register the router factory +register_router(Api.models, create_models_router) diff --git a/src/llama_stack/apis/post_training/__init__.py b/src/llama_stack/apis/post_training/__init__.py index 695575a308..3b1fce1ad5 100644 --- a/src/llama_stack/apis/post_training/__init__.py +++ b/src/llama_stack/apis/post_training/__init__.py @@ -4,4 +4,61 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .post_training import * +# Import routes to trigger router registration +from llama_stack.apis.common.job_types import JobStatus +from llama_stack.apis.common.training_types import Checkpoint + +from . import routes # noqa: F401 +from .models import ( + AlgorithmConfig, + DataConfig, + DatasetFormat, + DPOAlignmentConfig, + DPOLossType, + EfficiencyConfig, + ListPostTrainingJobsResponse, + LoraFinetuningConfig, + OptimizerConfig, + OptimizerType, + PostTrainingJob, + PostTrainingJobArtifactsResponse, + PostTrainingJobLogStream, + PostTrainingJobStatusResponse, + PostTrainingRLHFRequest, + PreferenceOptimizeRequest, + QATFinetuningConfig, + RLHFAlgorithm, + SupervisedFineTuneRequest, + TrainingConfig, +) +from .post_training_service import PostTrainingService + +# Backward compatibility - export PostTraining as alias for PostTrainingService +PostTraining = PostTrainingService + +__all__ = [ + "PostTraining", + "PostTrainingService", + "Checkpoint", + "JobStatus", + "OptimizerType", + "DatasetFormat", + "DataConfig", + "OptimizerConfig", + "EfficiencyConfig", + "TrainingConfig", + "LoraFinetuningConfig", + "QATFinetuningConfig", + "AlgorithmConfig", + "PostTrainingJobLogStream", + "RLHFAlgorithm", + "DPOLossType", + "DPOAlignmentConfig", + "PostTrainingRLHFRequest", + "PostTrainingJob", + "PostTrainingJobStatusResponse", + "ListPostTrainingJobsResponse", + "PostTrainingJobArtifactsResponse", + "SupervisedFineTuneRequest", + "PreferenceOptimizeRequest", +] diff --git a/src/llama_stack/apis/post_training/models.py b/src/llama_stack/apis/post_training/models.py new file mode 100644 index 0000000000..4be609a900 --- /dev/null +++ b/src/llama_stack/apis/post_training/models.py @@ -0,0 +1,222 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from datetime import datetime +from enum import Enum +from typing import Annotated, Any, Literal + +from pydantic import BaseModel, Field + +from llama_stack.apis.common.content_types import URL +from llama_stack.apis.common.job_types import JobStatus +from llama_stack.apis.common.training_types import Checkpoint +from llama_stack.schema_utils import json_schema_type, register_schema + + +@json_schema_type +class OptimizerType(Enum): + """Available optimizer algorithms for training.""" + + adam = "adam" + adamw = "adamw" + sgd = "sgd" + + +@json_schema_type +class DatasetFormat(Enum): + """Format of the training dataset.""" + + instruct = "instruct" + dialog = "dialog" + + +@json_schema_type +class DataConfig(BaseModel): + """Configuration for training data and data loading.""" + + dataset_id: str + batch_size: int + shuffle: bool + data_format: DatasetFormat + validation_dataset_id: str | None = None + packed: bool | None = False + train_on_input: bool | None = False + + +@json_schema_type +class OptimizerConfig(BaseModel): + """Configuration parameters for the optimization algorithm.""" + + optimizer_type: OptimizerType + lr: float + weight_decay: float + num_warmup_steps: int + + +@json_schema_type +class EfficiencyConfig(BaseModel): + """Configuration for memory and compute efficiency optimizations.""" + + enable_activation_checkpointing: bool | None = False + enable_activation_offloading: bool | None = False + memory_efficient_fsdp_wrap: bool | None = False + fsdp_cpu_offload: bool | None = False + + +@json_schema_type +class TrainingConfig(BaseModel): + """Comprehensive configuration for the training process.""" + + n_epochs: int + max_steps_per_epoch: int = 1 + gradient_accumulation_steps: int = 1 + max_validation_steps: int | None = 1 + data_config: DataConfig | None = None + optimizer_config: OptimizerConfig | None = None + efficiency_config: EfficiencyConfig | None = None + dtype: str | None = "bf16" + + +@json_schema_type +class LoraFinetuningConfig(BaseModel): + """Configuration for Low-Rank Adaptation (LoRA) fine-tuning.""" + + type: Literal["LoRA"] = "LoRA" + lora_attn_modules: list[str] + apply_lora_to_mlp: bool + apply_lora_to_output: bool + rank: int + alpha: int + use_dora: bool | None = False + quantize_base: bool | None = False + + +@json_schema_type +class QATFinetuningConfig(BaseModel): + """Configuration for Quantization-Aware Training (QAT) fine-tuning.""" + + type: Literal["QAT"] = "QAT" + quantizer_name: str + group_size: int + + +AlgorithmConfig = Annotated[LoraFinetuningConfig | QATFinetuningConfig, Field(discriminator="type")] +register_schema(AlgorithmConfig, name="AlgorithmConfig") + + +@json_schema_type +class PostTrainingJobLogStream(BaseModel): + """Stream of logs from a finetuning job.""" + + job_uuid: str + log_lines: list[str] + + +@json_schema_type +class RLHFAlgorithm(Enum): + """Available reinforcement learning from human feedback algorithms.""" + + dpo = "dpo" + + +@json_schema_type +class DPOLossType(Enum): + sigmoid = "sigmoid" + hinge = "hinge" + ipo = "ipo" + kto_pair = "kto_pair" + + +@json_schema_type +class DPOAlignmentConfig(BaseModel): + """Configuration for Direct Preference Optimization (DPO) alignment.""" + + beta: float + loss_type: DPOLossType = DPOLossType.sigmoid + + +@json_schema_type +class PostTrainingRLHFRequest(BaseModel): + """Request to finetune a model using reinforcement learning from human feedback.""" + + job_uuid: str + + finetuned_model: URL + + dataset_id: str + validation_dataset_id: str + + algorithm: RLHFAlgorithm + algorithm_config: DPOAlignmentConfig + + optimizer_config: OptimizerConfig + training_config: TrainingConfig + + # TODO: define these + hyperparam_search_config: dict[str, Any] + logger_config: dict[str, Any] + + +class PostTrainingJob(BaseModel): + job_uuid: str = Field(..., description="The UUID of the job") + + +@json_schema_type +class PostTrainingJobStatusResponse(BaseModel): + """Status of a finetuning job.""" + + job_uuid: str + status: JobStatus + + scheduled_at: datetime | None = None + started_at: datetime | None = None + completed_at: datetime | None = None + + resources_allocated: dict[str, Any] | None = None + + checkpoints: list[Checkpoint] = Field(default_factory=list) + + +class ListPostTrainingJobsResponse(BaseModel): + data: list[PostTrainingJob] = Field(..., description="The list of training jobs") + + +@json_schema_type +class PostTrainingJobArtifactsResponse(BaseModel): + """Artifacts of a finetuning job.""" + + job_uuid: str = Field(..., description="The UUID of the job") + checkpoints: list[Checkpoint] = Field(default_factory=list) + + # TODO(ashwin): metrics, evals + + +@json_schema_type +class SupervisedFineTuneRequest(BaseModel): + """Request to run supervised fine-tuning of a model.""" + + job_uuid: str = Field(..., description="The UUID of the job to create") + training_config: TrainingConfig = Field(..., description="The training configuration") + hyperparam_search_config: dict[str, Any] = Field(..., description="The hyperparam search configuration") + logger_config: dict[str, Any] = Field(..., description="The logger configuration") + model: str | None = Field( + default=None, + description="Model descriptor for training if not in provider config`", + ) + checkpoint_dir: str | None = Field(default=None, description="The directory to save checkpoint(s) to") + algorithm_config: AlgorithmConfig | None = Field(default=None, description="The algorithm configuration") + + +@json_schema_type +class PreferenceOptimizeRequest(BaseModel): + """Request to run preference optimization of a model.""" + + job_uuid: str = Field(..., description="The UUID of the job to create") + finetuned_model: str = Field(..., description="The model to fine-tune") + algorithm_config: DPOAlignmentConfig = Field(..., description="The algorithm configuration") + training_config: TrainingConfig = Field(..., description="The training configuration") + hyperparam_search_config: dict[str, Any] = Field(..., description="The hyperparam search configuration") + logger_config: dict[str, Any] = Field(..., description="The logger configuration") diff --git a/src/llama_stack/apis/post_training/post_training.py b/src/llama_stack/apis/post_training/post_training.py deleted file mode 100644 index 2b7a6222f4..0000000000 --- a/src/llama_stack/apis/post_training/post_training.py +++ /dev/null @@ -1,368 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -from datetime import datetime -from enum import Enum -from typing import Annotated, Any, Literal, Protocol - -from pydantic import BaseModel, Field - -from llama_stack.apis.common.content_types import URL -from llama_stack.apis.common.job_types import JobStatus -from llama_stack.apis.common.training_types import Checkpoint -from llama_stack.apis.version import LLAMA_STACK_API_V1ALPHA -from llama_stack.schema_utils import json_schema_type, register_schema, webmethod - - -@json_schema_type -class OptimizerType(Enum): - """Available optimizer algorithms for training. - :cvar adam: Adaptive Moment Estimation optimizer - :cvar adamw: AdamW optimizer with weight decay - :cvar sgd: Stochastic Gradient Descent optimizer - """ - - adam = "adam" - adamw = "adamw" - sgd = "sgd" - - -@json_schema_type -class DatasetFormat(Enum): - """Format of the training dataset. - :cvar instruct: Instruction-following format with prompt and completion - :cvar dialog: Multi-turn conversation format with messages - """ - - instruct = "instruct" - dialog = "dialog" - - -@json_schema_type -class DataConfig(BaseModel): - """Configuration for training data and data loading. - - :param dataset_id: Unique identifier for the training dataset - :param batch_size: Number of samples per training batch - :param shuffle: Whether to shuffle the dataset during training - :param data_format: Format of the dataset (instruct or dialog) - :param validation_dataset_id: (Optional) Unique identifier for the validation dataset - :param packed: (Optional) Whether to pack multiple samples into a single sequence for efficiency - :param train_on_input: (Optional) Whether to compute loss on input tokens as well as output tokens - """ - - dataset_id: str - batch_size: int - shuffle: bool - data_format: DatasetFormat - validation_dataset_id: str | None = None - packed: bool | None = False - train_on_input: bool | None = False - - -@json_schema_type -class OptimizerConfig(BaseModel): - """Configuration parameters for the optimization algorithm. - - :param optimizer_type: Type of optimizer to use (adam, adamw, or sgd) - :param lr: Learning rate for the optimizer - :param weight_decay: Weight decay coefficient for regularization - :param num_warmup_steps: Number of steps for learning rate warmup - """ - - optimizer_type: OptimizerType - lr: float - weight_decay: float - num_warmup_steps: int - - -@json_schema_type -class EfficiencyConfig(BaseModel): - """Configuration for memory and compute efficiency optimizations. - - :param enable_activation_checkpointing: (Optional) Whether to use activation checkpointing to reduce memory usage - :param enable_activation_offloading: (Optional) Whether to offload activations to CPU to save GPU memory - :param memory_efficient_fsdp_wrap: (Optional) Whether to use memory-efficient FSDP wrapping - :param fsdp_cpu_offload: (Optional) Whether to offload FSDP parameters to CPU - """ - - enable_activation_checkpointing: bool | None = False - enable_activation_offloading: bool | None = False - memory_efficient_fsdp_wrap: bool | None = False - fsdp_cpu_offload: bool | None = False - - -@json_schema_type -class TrainingConfig(BaseModel): - """Comprehensive configuration for the training process. - - :param n_epochs: Number of training epochs to run - :param max_steps_per_epoch: Maximum number of steps to run per epoch - :param gradient_accumulation_steps: Number of steps to accumulate gradients before updating - :param max_validation_steps: (Optional) Maximum number of validation steps per epoch - :param data_config: (Optional) Configuration for data loading and formatting - :param optimizer_config: (Optional) Configuration for the optimization algorithm - :param efficiency_config: (Optional) Configuration for memory and compute optimizations - :param dtype: (Optional) Data type for model parameters (bf16, fp16, fp32) - """ - - n_epochs: int - max_steps_per_epoch: int = 1 - gradient_accumulation_steps: int = 1 - max_validation_steps: int | None = 1 - data_config: DataConfig | None = None - optimizer_config: OptimizerConfig | None = None - efficiency_config: EfficiencyConfig | None = None - dtype: str | None = "bf16" - - -@json_schema_type -class LoraFinetuningConfig(BaseModel): - """Configuration for Low-Rank Adaptation (LoRA) fine-tuning. - - :param type: Algorithm type identifier, always "LoRA" - :param lora_attn_modules: List of attention module names to apply LoRA to - :param apply_lora_to_mlp: Whether to apply LoRA to MLP layers - :param apply_lora_to_output: Whether to apply LoRA to output projection layers - :param rank: Rank of the LoRA adaptation (lower rank = fewer parameters) - :param alpha: LoRA scaling parameter that controls adaptation strength - :param use_dora: (Optional) Whether to use DoRA (Weight-Decomposed Low-Rank Adaptation) - :param quantize_base: (Optional) Whether to quantize the base model weights - """ - - type: Literal["LoRA"] = "LoRA" - lora_attn_modules: list[str] - apply_lora_to_mlp: bool - apply_lora_to_output: bool - rank: int - alpha: int - use_dora: bool | None = False - quantize_base: bool | None = False - - -@json_schema_type -class QATFinetuningConfig(BaseModel): - """Configuration for Quantization-Aware Training (QAT) fine-tuning. - - :param type: Algorithm type identifier, always "QAT" - :param quantizer_name: Name of the quantization algorithm to use - :param group_size: Size of groups for grouped quantization - """ - - type: Literal["QAT"] = "QAT" - quantizer_name: str - group_size: int - - -AlgorithmConfig = Annotated[LoraFinetuningConfig | QATFinetuningConfig, Field(discriminator="type")] -register_schema(AlgorithmConfig, name="AlgorithmConfig") - - -@json_schema_type -class PostTrainingJobLogStream(BaseModel): - """Stream of logs from a finetuning job. - - :param job_uuid: Unique identifier for the training job - :param log_lines: List of log message strings from the training process - """ - - job_uuid: str - log_lines: list[str] - - -@json_schema_type -class RLHFAlgorithm(Enum): - """Available reinforcement learning from human feedback algorithms. - :cvar dpo: Direct Preference Optimization algorithm - """ - - dpo = "dpo" - - -@json_schema_type -class DPOLossType(Enum): - sigmoid = "sigmoid" - hinge = "hinge" - ipo = "ipo" - kto_pair = "kto_pair" - - -@json_schema_type -class DPOAlignmentConfig(BaseModel): - """Configuration for Direct Preference Optimization (DPO) alignment. - - :param beta: Temperature parameter for the DPO loss - :param loss_type: The type of loss function to use for DPO - """ - - beta: float - loss_type: DPOLossType = DPOLossType.sigmoid - - -@json_schema_type -class PostTrainingRLHFRequest(BaseModel): - """Request to finetune a model using reinforcement learning from human feedback. - - :param job_uuid: Unique identifier for the training job - :param finetuned_model: URL or path to the base model to fine-tune - :param dataset_id: Unique identifier for the training dataset - :param validation_dataset_id: Unique identifier for the validation dataset - :param algorithm: RLHF algorithm to use for training - :param algorithm_config: Configuration parameters for the RLHF algorithm - :param optimizer_config: Configuration parameters for the optimization algorithm - :param training_config: Configuration parameters for the training process - :param hyperparam_search_config: Configuration for hyperparameter search - :param logger_config: Configuration for training logging - """ - - job_uuid: str - - finetuned_model: URL - - dataset_id: str - validation_dataset_id: str - - algorithm: RLHFAlgorithm - algorithm_config: DPOAlignmentConfig - - optimizer_config: OptimizerConfig - training_config: TrainingConfig - - # TODO: define these - hyperparam_search_config: dict[str, Any] - logger_config: dict[str, Any] - - -class PostTrainingJob(BaseModel): - job_uuid: str - - -@json_schema_type -class PostTrainingJobStatusResponse(BaseModel): - """Status of a finetuning job. - - :param job_uuid: Unique identifier for the training job - :param status: Current status of the training job - :param scheduled_at: (Optional) Timestamp when the job was scheduled - :param started_at: (Optional) Timestamp when the job execution began - :param completed_at: (Optional) Timestamp when the job finished, if completed - :param resources_allocated: (Optional) Information about computational resources allocated to the job - :param checkpoints: List of model checkpoints created during training - """ - - job_uuid: str - status: JobStatus - - scheduled_at: datetime | None = None - started_at: datetime | None = None - completed_at: datetime | None = None - - resources_allocated: dict[str, Any] | None = None - - checkpoints: list[Checkpoint] = Field(default_factory=list) - - -class ListPostTrainingJobsResponse(BaseModel): - data: list[PostTrainingJob] - - -@json_schema_type -class PostTrainingJobArtifactsResponse(BaseModel): - """Artifacts of a finetuning job. - - :param job_uuid: Unique identifier for the training job - :param checkpoints: List of model checkpoints created during training - """ - - job_uuid: str - checkpoints: list[Checkpoint] = Field(default_factory=list) - - # TODO(ashwin): metrics, evals - - -class PostTraining(Protocol): - @webmethod(route="/post-training/supervised-fine-tune", method="POST", level=LLAMA_STACK_API_V1ALPHA) - async def supervised_fine_tune( - self, - job_uuid: str, - training_config: TrainingConfig, - hyperparam_search_config: dict[str, Any], - logger_config: dict[str, Any], - model: str | None = Field( - default=None, - description="Model descriptor for training if not in provider config`", - ), - checkpoint_dir: str | None = None, - algorithm_config: AlgorithmConfig | None = None, - ) -> PostTrainingJob: - """Run supervised fine-tuning of a model. - - :param job_uuid: The UUID of the job to create. - :param training_config: The training configuration. - :param hyperparam_search_config: The hyperparam search configuration. - :param logger_config: The logger configuration. - :param model: The model to fine-tune. - :param checkpoint_dir: The directory to save checkpoint(s) to. - :param algorithm_config: The algorithm configuration. - :returns: A PostTrainingJob. - """ - ... - - @webmethod(route="/post-training/preference-optimize", method="POST", level=LLAMA_STACK_API_V1ALPHA) - async def preference_optimize( - self, - job_uuid: str, - finetuned_model: str, - algorithm_config: DPOAlignmentConfig, - training_config: TrainingConfig, - hyperparam_search_config: dict[str, Any], - logger_config: dict[str, Any], - ) -> PostTrainingJob: - """Run preference optimization of a model. - - :param job_uuid: The UUID of the job to create. - :param finetuned_model: The model to fine-tune. - :param algorithm_config: The algorithm configuration. - :param training_config: The training configuration. - :param hyperparam_search_config: The hyperparam search configuration. - :param logger_config: The logger configuration. - :returns: A PostTrainingJob. - """ - ... - - @webmethod(route="/post-training/jobs", method="GET", level=LLAMA_STACK_API_V1ALPHA) - async def get_training_jobs(self) -> ListPostTrainingJobsResponse: - """Get all training jobs. - - :returns: A ListPostTrainingJobsResponse. - """ - ... - - @webmethod(route="/post-training/job/status", method="GET", level=LLAMA_STACK_API_V1ALPHA) - async def get_training_job_status(self, job_uuid: str) -> PostTrainingJobStatusResponse: - """Get the status of a training job. - - :param job_uuid: The UUID of the job to get the status of. - :returns: A PostTrainingJobStatusResponse. - """ - ... - - @webmethod(route="/post-training/job/cancel", method="POST", level=LLAMA_STACK_API_V1ALPHA) - async def cancel_training_job(self, job_uuid: str) -> None: - """Cancel a training job. - - :param job_uuid: The UUID of the job to cancel. - """ - ... - - @webmethod(route="/post-training/job/artifacts", method="GET", level=LLAMA_STACK_API_V1ALPHA) - async def get_training_job_artifacts(self, job_uuid: str) -> PostTrainingJobArtifactsResponse: - """Get the artifacts of a training job. - - :param job_uuid: The UUID of the job to get the artifacts of. - :returns: A PostTrainingJobArtifactsResponse. - """ - ... diff --git a/src/llama_stack/apis/post_training/post_training_service.py b/src/llama_stack/apis/post_training/post_training_service.py new file mode 100644 index 0000000000..0338e7b5c5 --- /dev/null +++ b/src/llama_stack/apis/post_training/post_training_service.py @@ -0,0 +1,64 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Any, Protocol, runtime_checkable + +from llama_stack.core.telemetry.trace_protocol import trace_protocol + +from .models import ( + AlgorithmConfig, + DPOAlignmentConfig, + ListPostTrainingJobsResponse, + PostTrainingJob, + PostTrainingJobArtifactsResponse, + PostTrainingJobStatusResponse, + TrainingConfig, +) + + +@runtime_checkable +@trace_protocol +class PostTrainingService(Protocol): + async def supervised_fine_tune( + self, + job_uuid: str, + training_config: TrainingConfig, + hyperparam_search_config: dict[str, Any], + logger_config: dict[str, Any], + model: str | None = None, + checkpoint_dir: str | None = None, + algorithm_config: AlgorithmConfig | None = None, + ) -> PostTrainingJob: + """Run supervised fine-tuning of a model.""" + ... + + async def preference_optimize( + self, + job_uuid: str, + finetuned_model: str, + algorithm_config: DPOAlignmentConfig, + training_config: TrainingConfig, + hyperparam_search_config: dict[str, Any], + logger_config: dict[str, Any], + ) -> PostTrainingJob: + """Run preference optimization of a model.""" + ... + + async def get_training_jobs(self) -> ListPostTrainingJobsResponse: + """Get all training jobs.""" + ... + + async def get_training_job_status(self, job_uuid: str) -> PostTrainingJobStatusResponse: + """Get the status of a training job.""" + ... + + async def cancel_training_job(self, job_uuid: str) -> None: + """Cancel a training job.""" + ... + + async def get_training_job_artifacts(self, job_uuid: str) -> PostTrainingJobArtifactsResponse: + """Get the artifacts of a training job.""" + ... diff --git a/src/llama_stack/apis/post_training/routes.py b/src/llama_stack/apis/post_training/routes.py new file mode 100644 index 0000000000..3a10047993 --- /dev/null +++ b/src/llama_stack/apis/post_training/routes.py @@ -0,0 +1,199 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + + +from fastapi import Body, Depends, Query, Request + +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1, LLAMA_STACK_API_V1ALPHA +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .models import ( + ListPostTrainingJobsResponse, + PostTrainingJob, + PostTrainingJobArtifactsResponse, + PostTrainingJobStatusResponse, + PreferenceOptimizeRequest, + SupervisedFineTuneRequest, +) +from .post_training_service import PostTrainingService + + +def get_post_training_service(request: Request) -> PostTrainingService: + """Dependency to get the post training service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.post_training not in impls: + raise ValueError("Post Training API implementation not found") + return impls[Api.post_training] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Post Training"], + responses=standard_responses, +) + +router_v1alpha = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1ALPHA}", + tags=["Post Training"], + responses=standard_responses, +) + + +@router.post( + "/post-training/supervised-fine-tune", + response_model=PostTrainingJob, + summary="Run supervised fine-tuning of a model", + description="Run supervised fine-tuning of a model", + deprecated=True, +) +@router_v1alpha.post( + "/post-training/supervised-fine-tune", + response_model=PostTrainingJob, + summary="Run supervised fine-tuning of a model", + description="Run supervised fine-tuning of a model", +) +async def supervised_fine_tune( + body: SupervisedFineTuneRequest = Body(...), + svc: PostTrainingService = Depends(get_post_training_service), +) -> PostTrainingJob: + """Run supervised fine-tuning of a model.""" + return await svc.supervised_fine_tune( + job_uuid=body.job_uuid, + training_config=body.training_config, + hyperparam_search_config=body.hyperparam_search_config, + logger_config=body.logger_config, + model=body.model, + checkpoint_dir=body.checkpoint_dir, + algorithm_config=body.algorithm_config, + ) + + +@router.post( + "/post-training/preference-optimize", + response_model=PostTrainingJob, + summary="Run preference optimization of a model", + description="Run preference optimization of a model", + deprecated=True, +) +@router_v1alpha.post( + "/post-training/preference-optimize", + response_model=PostTrainingJob, + summary="Run preference optimization of a model", + description="Run preference optimization of a model", +) +async def preference_optimize( + body: PreferenceOptimizeRequest = Body(...), + svc: PostTrainingService = Depends(get_post_training_service), +) -> PostTrainingJob: + """Run preference optimization of a model.""" + return await svc.preference_optimize( + job_uuid=body.job_uuid, + finetuned_model=body.finetuned_model, + algorithm_config=body.algorithm_config, + training_config=body.training_config, + hyperparam_search_config=body.hyperparam_search_config, + logger_config=body.logger_config, + ) + + +@router.get( + "/post-training/jobs", + response_model=ListPostTrainingJobsResponse, + summary="Get all training jobs", + description="Get all training jobs", + deprecated=True, +) +@router_v1alpha.get( + "/post-training/jobs", + response_model=ListPostTrainingJobsResponse, + summary="Get all training jobs", + description="Get all training jobs", +) +async def get_training_jobs( + svc: PostTrainingService = Depends(get_post_training_service), +) -> ListPostTrainingJobsResponse: + """Get all training jobs.""" + return await svc.get_training_jobs() + + +@router.get( + "/post-training/job/status", + response_model=PostTrainingJobStatusResponse, + summary="Get the status of a training job", + description="Get the status of a training job", + deprecated=True, +) +@router_v1alpha.get( + "/post-training/job/status", + response_model=PostTrainingJobStatusResponse, + summary="Get the status of a training job", + description="Get the status of a training job", +) +async def get_training_job_status( + job_uuid: str = Query(..., description="The UUID of the job to get the status of"), + svc: PostTrainingService = Depends(get_post_training_service), +) -> PostTrainingJobStatusResponse: + """Get the status of a training job.""" + return await svc.get_training_job_status(job_uuid=job_uuid) + + +@router.post( + "/post-training/job/cancel", + response_model=None, + status_code=204, + summary="Cancel a training job", + description="Cancel a training job", + deprecated=True, +) +@router_v1alpha.post( + "/post-training/job/cancel", + response_model=None, + status_code=204, + summary="Cancel a training job", + description="Cancel a training job", +) +async def cancel_training_job( + job_uuid: str = Query(..., description="The UUID of the job to cancel"), + svc: PostTrainingService = Depends(get_post_training_service), +) -> None: + """Cancel a training job.""" + await svc.cancel_training_job(job_uuid=job_uuid) + + +@router.get( + "/post-training/job/artifacts", + response_model=PostTrainingJobArtifactsResponse, + summary="Get the artifacts of a training job", + description="Get the artifacts of a training job", + deprecated=True, +) +@router_v1alpha.get( + "/post-training/job/artifacts", + response_model=PostTrainingJobArtifactsResponse, + summary="Get the artifacts of a training job", + description="Get the artifacts of a training job", +) +async def get_training_job_artifacts( + job_uuid: str = Query(..., description="The UUID of the job to get the artifacts of"), + svc: PostTrainingService = Depends(get_post_training_service), +) -> PostTrainingJobArtifactsResponse: + """Get the artifacts of a training job.""" + return await svc.get_training_job_artifacts(job_uuid=job_uuid) + + +# For backward compatibility with the router registry system +def create_post_training_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Post Training API (legacy compatibility).""" + main_router = APIRouter() + main_router.include_router(router) + main_router.include_router(router_v1alpha) + return main_router + + +# Register the router factory +register_router(Api.post_training, create_post_training_router) diff --git a/src/llama_stack/apis/prompts/__init__.py b/src/llama_stack/apis/prompts/__init__.py index 6070f34504..6bda77a1c8 100644 --- a/src/llama_stack/apis/prompts/__init__.py +++ b/src/llama_stack/apis/prompts/__init__.py @@ -4,6 +4,26 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .prompts import ListPromptsResponse, Prompt, Prompts +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .models import ( + CreatePromptRequest, + ListPromptsResponse, + Prompt, + SetDefaultVersionRequest, + UpdatePromptRequest, +) +from .prompts_service import PromptService -__all__ = ["Prompt", "Prompts", "ListPromptsResponse"] +# Backward compatibility - export Prompts as alias for PromptService +Prompts = PromptService + +__all__ = [ + "Prompts", + "PromptService", + "Prompt", + "ListPromptsResponse", + "CreatePromptRequest", + "UpdatePromptRequest", + "SetDefaultVersionRequest", +] diff --git a/src/llama_stack/apis/prompts/models.py b/src/llama_stack/apis/prompts/models.py new file mode 100644 index 0000000000..a984d091be --- /dev/null +++ b/src/llama_stack/apis/prompts/models.py @@ -0,0 +1,113 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +import re +import secrets + +from pydantic import BaseModel, Field, field_validator, model_validator + +from llama_stack.schema_utils import json_schema_type + + +@json_schema_type +class Prompt(BaseModel): + """A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack.""" + + prompt: str | None = Field( + default=None, + description="The system prompt text with variable placeholders. Variables are only supported when using the Responses API.", + ) + version: int = Field(description="Version (integer starting at 1, incremented on save).", ge=1) + prompt_id: str = Field(description="Unique identifier formatted as 'pmpt_<48-digit-hash>'.") + variables: list[str] = Field( + default_factory=list, description="List of prompt variable names that can be used in the prompt template." + ) + is_default: bool = Field( + default=False, description="Boolean indicating whether this version is the default version for this prompt." + ) + + @field_validator("prompt_id") + @classmethod + def validate_prompt_id(cls, prompt_id: str) -> str: + if not isinstance(prompt_id, str): + raise TypeError("prompt_id must be a string in format 'pmpt_<48-digit-hash>'") + + if not prompt_id.startswith("pmpt_"): + raise ValueError("prompt_id must start with 'pmpt_' prefix") + + hex_part = prompt_id[5:] + if len(hex_part) != 48: + raise ValueError("prompt_id must be in format 'pmpt_<48-digit-hash>' (48 lowercase hex chars)") + + for char in hex_part: + if char not in "0123456789abcdef": + raise ValueError("prompt_id hex part must contain only lowercase hex characters [0-9a-f]") + + return prompt_id + + @field_validator("version") + @classmethod + def validate_version(cls, prompt_version: int) -> int: + if prompt_version < 1: + raise ValueError("version must be >= 1") + return prompt_version + + @model_validator(mode="after") + def validate_prompt_variables(self): + """Validate that all variables used in the prompt are declared in the variables list.""" + if not self.prompt: + return self + + prompt_variables = set(re.findall(r"{{\s*(\w+)\s*}}", self.prompt)) + declared_variables = set(self.variables) + + undeclared = prompt_variables - declared_variables + if undeclared: + raise ValueError(f"Prompt contains undeclared variables: {sorted(undeclared)}") + + return self + + @classmethod + def generate_prompt_id(cls) -> str: + # Generate 48 hex characters (24 bytes) + random_bytes = secrets.token_bytes(24) + hex_string = random_bytes.hex() + return f"pmpt_{hex_string}" + + +class ListPromptsResponse(BaseModel): + """Response model to list prompts.""" + + data: list[Prompt] = Field(description="List of prompt resources.") + + +@json_schema_type +class CreatePromptRequest(BaseModel): + """Request model for creating a new prompt.""" + + prompt: str = Field(..., description="The prompt text content with variable placeholders.") + variables: list[str] | None = Field( + default=None, description="List of variable names that can be used in the prompt template." + ) + + +@json_schema_type +class UpdatePromptRequest(BaseModel): + """Request model for updating an existing prompt.""" + + prompt: str = Field(..., description="The updated prompt text content.") + version: int = Field(..., description="The current version of the prompt being updated.") + variables: list[str] | None = Field( + default=None, description="Updated list of variable names that can be used in the prompt template." + ) + set_as_default: bool = Field(default=True, description="Set the new version as the default (default=True).") + + +@json_schema_type +class SetDefaultVersionRequest(BaseModel): + """Request model for setting a prompt version as default.""" + + version: int = Field(..., description="The version to set as default.") diff --git a/src/llama_stack/apis/prompts/prompts.py b/src/llama_stack/apis/prompts/prompts.py deleted file mode 100644 index 4651b92946..0000000000 --- a/src/llama_stack/apis/prompts/prompts.py +++ /dev/null @@ -1,204 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -import re -import secrets -from typing import Protocol, runtime_checkable - -from pydantic import BaseModel, Field, field_validator, model_validator - -from llama_stack.apis.version import LLAMA_STACK_API_V1 -from llama_stack.core.telemetry.trace_protocol import trace_protocol -from llama_stack.schema_utils import json_schema_type, webmethod - - -@json_schema_type -class Prompt(BaseModel): - """A prompt resource representing a stored OpenAI Compatible prompt template in Llama Stack. - - :param prompt: The system prompt text with variable placeholders. Variables are only supported when using the Responses API. - :param version: Version (integer starting at 1, incremented on save) - :param prompt_id: Unique identifier formatted as 'pmpt_<48-digit-hash>' - :param variables: List of prompt variable names that can be used in the prompt template - :param is_default: Boolean indicating whether this version is the default version for this prompt - """ - - prompt: str | None = Field(default=None, description="The system prompt with variable placeholders") - version: int = Field(description="Version (integer starting at 1, incremented on save)", ge=1) - prompt_id: str = Field(description="Unique identifier in format 'pmpt_<48-digit-hash>'") - variables: list[str] = Field( - default_factory=list, description="List of variable names that can be used in the prompt template" - ) - is_default: bool = Field( - default=False, description="Boolean indicating whether this version is the default version" - ) - - @field_validator("prompt_id") - @classmethod - def validate_prompt_id(cls, prompt_id: str) -> str: - if not isinstance(prompt_id, str): - raise TypeError("prompt_id must be a string in format 'pmpt_<48-digit-hash>'") - - if not prompt_id.startswith("pmpt_"): - raise ValueError("prompt_id must start with 'pmpt_' prefix") - - hex_part = prompt_id[5:] - if len(hex_part) != 48: - raise ValueError("prompt_id must be in format 'pmpt_<48-digit-hash>' (48 lowercase hex chars)") - - for char in hex_part: - if char not in "0123456789abcdef": - raise ValueError("prompt_id hex part must contain only lowercase hex characters [0-9a-f]") - - return prompt_id - - @field_validator("version") - @classmethod - def validate_version(cls, prompt_version: int) -> int: - if prompt_version < 1: - raise ValueError("version must be >= 1") - return prompt_version - - @model_validator(mode="after") - def validate_prompt_variables(self): - """Validate that all variables used in the prompt are declared in the variables list.""" - if not self.prompt: - return self - - prompt_variables = set(re.findall(r"{{\s*(\w+)\s*}}", self.prompt)) - declared_variables = set(self.variables) - - undeclared = prompt_variables - declared_variables - if undeclared: - raise ValueError(f"Prompt contains undeclared variables: {sorted(undeclared)}") - - return self - - @classmethod - def generate_prompt_id(cls) -> str: - # Generate 48 hex characters (24 bytes) - random_bytes = secrets.token_bytes(24) - hex_string = random_bytes.hex() - return f"pmpt_{hex_string}" - - -class ListPromptsResponse(BaseModel): - """Response model to list prompts.""" - - data: list[Prompt] - - -@runtime_checkable -@trace_protocol -class Prompts(Protocol): - """Prompts - - Protocol for prompt management operations.""" - - @webmethod(route="/prompts", method="GET", level=LLAMA_STACK_API_V1) - async def list_prompts(self) -> ListPromptsResponse: - """List all prompts. - - :returns: A ListPromptsResponse containing all prompts. - """ - ... - - @webmethod(route="/prompts/{prompt_id}/versions", method="GET", level=LLAMA_STACK_API_V1) - async def list_prompt_versions( - self, - prompt_id: str, - ) -> ListPromptsResponse: - """List prompt versions. - - List all versions of a specific prompt. - - :param prompt_id: The identifier of the prompt to list versions for. - :returns: A ListPromptsResponse containing all versions of the prompt. - """ - ... - - @webmethod(route="/prompts/{prompt_id}", method="GET", level=LLAMA_STACK_API_V1) - async def get_prompt( - self, - prompt_id: str, - version: int | None = None, - ) -> Prompt: - """Get prompt. - - Get a prompt by its identifier and optional version. - - :param prompt_id: The identifier of the prompt to get. - :param version: The version of the prompt to get (defaults to latest). - :returns: A Prompt resource. - """ - ... - - @webmethod(route="/prompts", method="POST", level=LLAMA_STACK_API_V1) - async def create_prompt( - self, - prompt: str, - variables: list[str] | None = None, - ) -> Prompt: - """Create prompt. - - Create a new prompt. - - :param prompt: The prompt text content with variable placeholders. - :param variables: List of variable names that can be used in the prompt template. - :returns: The created Prompt resource. - """ - ... - - @webmethod(route="/prompts/{prompt_id}", method="PUT", level=LLAMA_STACK_API_V1) - async def update_prompt( - self, - prompt_id: str, - prompt: str, - version: int, - variables: list[str] | None = None, - set_as_default: bool = True, - ) -> Prompt: - """Update prompt. - - Update an existing prompt (increments version). - - :param prompt_id: The identifier of the prompt to update. - :param prompt: The updated prompt text content. - :param version: The current version of the prompt being updated. - :param variables: Updated list of variable names that can be used in the prompt template. - :param set_as_default: Set the new version as the default (default=True). - :returns: The updated Prompt resource with incremented version. - """ - ... - - @webmethod(route="/prompts/{prompt_id}", method="DELETE", level=LLAMA_STACK_API_V1) - async def delete_prompt( - self, - prompt_id: str, - ) -> None: - """Delete prompt. - - Delete a prompt. - - :param prompt_id: The identifier of the prompt to delete. - """ - ... - - @webmethod(route="/prompts/{prompt_id}/set-default-version", method="PUT", level=LLAMA_STACK_API_V1) - async def set_default_version( - self, - prompt_id: str, - version: int, - ) -> Prompt: - """Set prompt version. - - Set which version of a prompt should be the default in get_prompt (latest). - - :param prompt_id: The identifier of the prompt. - :param version: The version to set as default. - :returns: The prompt with the specified version now set as default. - """ - ... diff --git a/src/llama_stack/apis/prompts/prompts_service.py b/src/llama_stack/apis/prompts/prompts_service.py new file mode 100644 index 0000000000..b51bb27e67 --- /dev/null +++ b/src/llama_stack/apis/prompts/prompts_service.py @@ -0,0 +1,72 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Protocol, runtime_checkable + +from llama_stack.core.telemetry.trace_protocol import trace_protocol + +from .models import ListPromptsResponse, Prompt + + +@runtime_checkable +@trace_protocol +class PromptService(Protocol): + """Prompts + + Protocol for prompt management operations.""" + + async def list_prompts(self) -> ListPromptsResponse: + """List all prompts.""" + ... + + async def list_prompt_versions( + self, + prompt_id: str, + ) -> ListPromptsResponse: + """List prompt versions.""" + ... + + async def get_prompt( + self, + prompt_id: str, + version: int | None = None, + ) -> Prompt: + """Get prompt.""" + ... + + async def create_prompt( + self, + prompt: str, + variables: list[str] | None = None, + ) -> Prompt: + """Create prompt.""" + ... + + async def update_prompt( + self, + prompt_id: str, + prompt: str, + version: int, + variables: list[str] | None = None, + set_as_default: bool = True, + ) -> Prompt: + """Update prompt.""" + ... + + async def delete_prompt( + self, + prompt_id: str, + ) -> None: + """Delete prompt.""" + ... + + async def set_default_version( + self, + prompt_id: str, + version: int, + ) -> Prompt: + """Set prompt version.""" + ... diff --git a/src/llama_stack/apis/prompts/routes.py b/src/llama_stack/apis/prompts/routes.py new file mode 100644 index 0000000000..45542b8fb3 --- /dev/null +++ b/src/llama_stack/apis/prompts/routes.py @@ -0,0 +1,154 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated + +from fastapi import Body, Depends, Query, Request +from fastapi import Path as FastAPIPath + +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1 +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .models import ( + CreatePromptRequest, + ListPromptsResponse, + Prompt, + SetDefaultVersionRequest, + UpdatePromptRequest, +) +from .prompts_service import PromptService + + +def get_prompt_service(request: Request) -> PromptService: + """Dependency to get the prompt service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.prompts not in impls: + raise ValueError("Prompts API implementation not found") + return impls[Api.prompts] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Prompts"], + responses=standard_responses, +) + + +@router.get( + "/prompts", + response_model=ListPromptsResponse, + summary="List all prompts", + description="List all prompts registered in Llama Stack", +) +async def list_prompts(svc: PromptService = Depends(get_prompt_service)) -> ListPromptsResponse: + """List all prompts.""" + return await svc.list_prompts() + + +@router.get( + "/prompts/{prompt_id}/versions", + response_model=ListPromptsResponse, + summary="List prompt versions", + description="List all versions of a specific prompt", +) +async def list_prompt_versions( + prompt_id: Annotated[str, FastAPIPath(..., description="The identifier of the prompt to list versions for")], + svc: PromptService = Depends(get_prompt_service), +) -> ListPromptsResponse: + """List prompt versions.""" + return await svc.list_prompt_versions(prompt_id=prompt_id) + + +@router.get( + "/prompts/{prompt_id}", + response_model=Prompt, + summary="Get prompt", + description="Get a prompt by its identifier and optional version", +) +async def get_prompt( + prompt_id: Annotated[str, FastAPIPath(..., description="The identifier of the prompt to get")], + version: int | None = Query(None, description="The version of the prompt to get (defaults to latest)"), + svc: PromptService = Depends(get_prompt_service), +) -> Prompt: + """Get prompt by its identifier and optional version.""" + return await svc.get_prompt(prompt_id=prompt_id, version=version) + + +@router.post( + "/prompts", + response_model=Prompt, + summary="Create prompt", + description="Create a new prompt", +) +async def create_prompt( + body: CreatePromptRequest = Body(...), + svc: PromptService = Depends(get_prompt_service), +) -> Prompt: + """Create a new prompt.""" + return await svc.create_prompt(prompt=body.prompt, variables=body.variables) + + +@router.post( + "/prompts/{prompt_id}", + response_model=Prompt, + summary="Update prompt", + description="Update an existing prompt (increments version)", +) +async def update_prompt( + prompt_id: Annotated[str, FastAPIPath(..., description="The identifier of the prompt to update")], + body: UpdatePromptRequest = Body(...), + svc: PromptService = Depends(get_prompt_service), +) -> Prompt: + """Update an existing prompt.""" + return await svc.update_prompt( + prompt_id=prompt_id, + prompt=body.prompt, + version=body.version, + variables=body.variables, + set_as_default=body.set_as_default, + ) + + +@router.delete( + "/prompts/{prompt_id}", + response_model=None, + status_code=204, + summary="Delete prompt", + description="Delete a prompt", +) +async def delete_prompt( + prompt_id: Annotated[str, FastAPIPath(..., description="The identifier of the prompt to delete")], + svc: PromptService = Depends(get_prompt_service), +) -> None: + """Delete a prompt.""" + await svc.delete_prompt(prompt_id=prompt_id) + + +@router.post( + "/prompts/{prompt_id}/set-default-version", + response_model=Prompt, + summary="Set prompt version", + description="Set which version of a prompt should be the default in get_prompt (latest)", +) +async def set_default_version( + prompt_id: Annotated[str, FastAPIPath(..., description="The identifier of the prompt")], + body: SetDefaultVersionRequest = Body(...), + svc: PromptService = Depends(get_prompt_service), +) -> Prompt: + """Set which version of a prompt should be the default.""" + return await svc.set_default_version(prompt_id=prompt_id, version=body.version) + + +# For backward compatibility with the router registry system +def create_prompts_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Prompts API (legacy compatibility).""" + return router + + +# Register the router factory +register_router(Api.prompts, create_prompts_router) diff --git a/src/llama_stack/apis/providers/__init__.py b/src/llama_stack/apis/providers/__init__.py index e35e2fe474..951968bf55 100644 --- a/src/llama_stack/apis/providers/__init__.py +++ b/src/llama_stack/apis/providers/__init__.py @@ -4,4 +4,12 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .providers import * +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .models import ListProvidersResponse, ProviderInfo +from .providers_service import ProviderService + +# Backward compatibility - export Providers as alias for ProviderService +Providers = ProviderService + +__all__ = ["Providers", "ProviderService", "ListProvidersResponse", "ProviderInfo"] diff --git a/src/llama_stack/apis/providers/models.py b/src/llama_stack/apis/providers/models.py new file mode 100644 index 0000000000..f6b4ab2ac5 --- /dev/null +++ b/src/llama_stack/apis/providers/models.py @@ -0,0 +1,29 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Any + +from pydantic import BaseModel, Field + +from llama_stack.providers.datatypes import HealthResponse +from llama_stack.schema_utils import json_schema_type + + +@json_schema_type +class ProviderInfo(BaseModel): + """Information about a registered provider including its configuration and health status.""" + + api: str = Field(..., description="The API name this provider implements") + provider_id: str = Field(..., description="Unique identifier for the provider") + provider_type: str = Field(..., description="The type of provider implementation") + config: dict[str, Any] = Field(..., description="Configuration parameters for the provider") + health: HealthResponse = Field(..., description="Current health status of the provider") + + +class ListProvidersResponse(BaseModel): + """Response containing a list of all available providers.""" + + data: list[ProviderInfo] = Field(..., description="List of provider information objects") diff --git a/src/llama_stack/apis/providers/providers.py b/src/llama_stack/apis/providers/providers.py deleted file mode 100644 index e1872571d9..0000000000 --- a/src/llama_stack/apis/providers/providers.py +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -from typing import Any, Protocol, runtime_checkable - -from pydantic import BaseModel - -from llama_stack.apis.version import LLAMA_STACK_API_V1 -from llama_stack.providers.datatypes import HealthResponse -from llama_stack.schema_utils import json_schema_type, webmethod - - -@json_schema_type -class ProviderInfo(BaseModel): - """Information about a registered provider including its configuration and health status. - - :param api: The API name this provider implements - :param provider_id: Unique identifier for the provider - :param provider_type: The type of provider implementation - :param config: Configuration parameters for the provider - :param health: Current health status of the provider - """ - - api: str - provider_id: str - provider_type: str - config: dict[str, Any] - health: HealthResponse - - -class ListProvidersResponse(BaseModel): - """Response containing a list of all available providers. - - :param data: List of provider information objects - """ - - data: list[ProviderInfo] - - -@runtime_checkable -class Providers(Protocol): - """Providers - - Providers API for inspecting, listing, and modifying providers and their configurations. - """ - - @webmethod(route="/providers", method="GET", level=LLAMA_STACK_API_V1) - async def list_providers(self) -> ListProvidersResponse: - """List providers. - - List all available providers. - - :returns: A ListProvidersResponse containing information about all providers. - """ - ... - - @webmethod(route="/providers/{provider_id}", method="GET", level=LLAMA_STACK_API_V1) - async def inspect_provider(self, provider_id: str) -> ProviderInfo: - """Get provider. - - Get detailed information about a specific provider. - - :param provider_id: The ID of the provider to inspect. - :returns: A ProviderInfo object containing the provider's details. - """ - ... diff --git a/src/llama_stack/apis/providers/providers_service.py b/src/llama_stack/apis/providers/providers_service.py new file mode 100644 index 0000000000..1a7a86560d --- /dev/null +++ b/src/llama_stack/apis/providers/providers_service.py @@ -0,0 +1,25 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Protocol, runtime_checkable + +from .models import ListProvidersResponse, ProviderInfo + + +@runtime_checkable +class ProviderService(Protocol): + """Providers + + Providers API for inspecting, listing, and modifying providers and their configurations. + """ + + async def list_providers(self) -> ListProvidersResponse: + """List providers.""" + ... + + async def inspect_provider(self, provider_id: str) -> ProviderInfo: + """Get provider.""" + ... diff --git a/src/llama_stack/apis/providers/routes.py b/src/llama_stack/apis/providers/routes.py new file mode 100644 index 0000000000..53a09443bc --- /dev/null +++ b/src/llama_stack/apis/providers/routes.py @@ -0,0 +1,68 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated + +from fastapi import Depends, Request +from fastapi import Path as FastAPIPath + +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1 +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .models import ListProvidersResponse, ProviderInfo +from .providers_service import ProviderService + + +def get_provider_service(request: Request) -> ProviderService: + """Dependency to get the provider service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.providers not in impls: + raise ValueError("Providers API implementation not found") + return impls[Api.providers] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Providers"], + responses=standard_responses, +) + + +@router.get( + "/providers", + response_model=ListProvidersResponse, + summary="List providers", + description="List all available providers", +) +async def list_providers(svc: ProviderService = Depends(get_provider_service)) -> ListProvidersResponse: + """List all available providers.""" + return await svc.list_providers() + + +@router.get( + "/providers/{provider_id}", + response_model=ProviderInfo, + summary="Get provider", + description="Get detailed information about a specific provider", +) +async def inspect_provider( + provider_id: Annotated[str, FastAPIPath(..., description="The ID of the provider to inspect")], + svc: ProviderService = Depends(get_provider_service), +) -> ProviderInfo: + """Get detailed information about a specific provider.""" + return await svc.inspect_provider(provider_id=provider_id) + + +# For backward compatibility with the router registry system +def create_providers_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Providers API (legacy compatibility).""" + return router + + +# Register the router factory +register_router(Api.providers, create_providers_router) diff --git a/src/llama_stack/apis/safety/__init__.py b/src/llama_stack/apis/safety/__init__.py index d93bc13550..d6396300df 100644 --- a/src/llama_stack/apis/safety/__init__.py +++ b/src/llama_stack/apis/safety/__init__.py @@ -4,4 +4,31 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .safety import * +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .models import ( + ModerationObject, + ModerationObjectResults, + RunModerationRequest, + RunShieldRequest, + RunShieldResponse, + SafetyViolation, + ViolationLevel, +) +from .safety_service import SafetyService, ShieldStore + +# Backward compatibility - export Safety as alias for SafetyService +Safety = SafetyService + +__all__ = [ + "Safety", + "SafetyService", + "ShieldStore", + "ModerationObject", + "ModerationObjectResults", + "RunShieldRequest", + "RunShieldResponse", + "RunModerationRequest", + "SafetyViolation", + "ViolationLevel", +] diff --git a/src/llama_stack/apis/safety/models.py b/src/llama_stack/apis/safety/models.py new file mode 100644 index 0000000000..9aa109ddc1 --- /dev/null +++ b/src/llama_stack/apis/safety/models.py @@ -0,0 +1,96 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from enum import Enum +from typing import Any + +from pydantic import BaseModel, Field + +from llama_stack.apis.inference import OpenAIMessageParam +from llama_stack.schema_utils import json_schema_type + + +@json_schema_type +class ModerationObjectResults(BaseModel): + """A moderation object.""" + + flagged: bool = Field(..., description="Whether any of the below categories are flagged.") + categories: dict[str, bool] | None = Field( + default=None, description="A list of the categories, and whether they are flagged or not." + ) + category_applied_input_types: dict[str, list[str]] | None = Field( + default=None, + description="A list of the categories along with the input type(s) that the score applies to.", + ) + category_scores: dict[str, float] | None = Field( + default=None, description="A list of the categories along with their scores as predicted by model." + ) + user_message: str | None = Field(default=None, description="User message.") + metadata: dict[str, Any] = Field(default_factory=dict, description="Additional metadata.") + + +@json_schema_type +class ModerationObject(BaseModel): + """A moderation object.""" + + id: str = Field(..., description="The unique identifier for the moderation request.") + model: str = Field(..., description="The model used to generate the moderation results.") + results: list[ModerationObjectResults] = Field(..., description="A list of moderation objects.") + + +@json_schema_type +class ViolationLevel(Enum): + """Severity level of a safety violation. + + :cvar INFO: Informational level violation that does not require action + :cvar WARN: Warning level violation that suggests caution but allows continuation + :cvar ERROR: Error level violation that requires blocking or intervention + """ + + INFO = "info" + WARN = "warn" + ERROR = "error" + + +@json_schema_type +class SafetyViolation(BaseModel): + """Details of a safety violation detected by content moderation.""" + + violation_level: ViolationLevel = Field(..., description="Severity level of the violation.") + user_message: str | None = Field(default=None, description="Message to convey to the user about the violation.") + metadata: dict[str, Any] = Field( + default_factory=dict, + description="Additional metadata including specific violation codes for debugging and telemetry.", + ) + + +@json_schema_type +class RunShieldResponse(BaseModel): + """Response from running a safety shield.""" + + violation: SafetyViolation | None = Field( + default=None, description="Safety violation detected by the shield, if any." + ) + + +@json_schema_type +class RunShieldRequest(BaseModel): + """Request model for running a shield.""" + + shield_id: str = Field(..., description="The identifier of the shield to run.") + messages: list[OpenAIMessageParam] = Field(..., description="The messages to run the shield on.") + params: dict[str, Any] = Field(..., description="The parameters of the shield.") + + +@json_schema_type +class RunModerationRequest(BaseModel): + """Request model for running moderation.""" + + input: str | list[str] = Field( + ..., + description="Input (or inputs) to classify. Can be a single string, an array of strings, or an array of multi-modal input objects similar to other models.", + ) + model: str | None = Field(default=None, description="The content moderation model you would like to use.") diff --git a/src/llama_stack/apis/safety/routes.py b/src/llama_stack/apis/safety/routes.py new file mode 100644 index 0000000000..2896cd86a0 --- /dev/null +++ b/src/llama_stack/apis/safety/routes.py @@ -0,0 +1,68 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from fastapi import Body, Depends, Request + +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1 +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .models import ModerationObject, RunModerationRequest, RunShieldRequest, RunShieldResponse +from .safety_service import SafetyService + + +def get_safety_service(request: Request) -> SafetyService: + """Dependency to get the safety service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.safety not in impls: + raise ValueError("Safety API implementation not found") + return impls[Api.safety] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Safety"], + responses=standard_responses, +) + + +@router.post( + "/safety/run-shield", + response_model=RunShieldResponse, + summary="Run shield.", + description="Run a shield.", +) +async def run_shield( + body: RunShieldRequest = Body(...), + svc: SafetyService = Depends(get_safety_service), +) -> RunShieldResponse: + """Run a shield.""" + return await svc.run_shield(shield_id=body.shield_id, messages=body.messages, params=body.params) + + +@router.post( + "/moderations", + response_model=ModerationObject, + summary="Create moderation.", + description="Classifies if text and/or image inputs are potentially harmful.", +) +async def run_moderation( + body: RunModerationRequest = Body(...), + svc: SafetyService = Depends(get_safety_service), +) -> ModerationObject: + """Create moderation.""" + return await svc.run_moderation(input=body.input, model=body.model) + + +# For backward compatibility with the router registry system +def create_safety_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Safety API (legacy compatibility).""" + return router + + +# Register the router factory +register_router(Api.safety, create_safety_router) diff --git a/src/llama_stack/apis/safety/safety.py b/src/llama_stack/apis/safety/safety.py deleted file mode 100644 index 97fffcff1e..0000000000 --- a/src/llama_stack/apis/safety/safety.py +++ /dev/null @@ -1,134 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -from enum import Enum -from typing import Any, Protocol, runtime_checkable - -from pydantic import BaseModel, Field - -from llama_stack.apis.inference import OpenAIMessageParam -from llama_stack.apis.shields import Shield -from llama_stack.apis.version import LLAMA_STACK_API_V1 -from llama_stack.core.telemetry.trace_protocol import trace_protocol -from llama_stack.schema_utils import json_schema_type, webmethod - - -@json_schema_type -class ModerationObjectResults(BaseModel): - """A moderation object. - :param flagged: Whether any of the below categories are flagged. - :param categories: A list of the categories, and whether they are flagged or not. - :param category_applied_input_types: A list of the categories along with the input type(s) that the score applies to. - :param category_scores: A list of the categories along with their scores as predicted by model. - """ - - flagged: bool - categories: dict[str, bool] | None = None - category_applied_input_types: dict[str, list[str]] | None = None - category_scores: dict[str, float] | None = None - user_message: str | None = None - metadata: dict[str, Any] = Field(default_factory=dict) - - -@json_schema_type -class ModerationObject(BaseModel): - """A moderation object. - :param id: The unique identifier for the moderation request. - :param model: The model used to generate the moderation results. - :param results: A list of moderation objects - """ - - id: str - model: str - results: list[ModerationObjectResults] - - -@json_schema_type -class ViolationLevel(Enum): - """Severity level of a safety violation. - - :cvar INFO: Informational level violation that does not require action - :cvar WARN: Warning level violation that suggests caution but allows continuation - :cvar ERROR: Error level violation that requires blocking or intervention - """ - - INFO = "info" - WARN = "warn" - ERROR = "error" - - -@json_schema_type -class SafetyViolation(BaseModel): - """Details of a safety violation detected by content moderation. - - :param violation_level: Severity level of the violation - :param user_message: (Optional) Message to convey to the user about the violation - :param metadata: Additional metadata including specific violation codes for debugging and telemetry - """ - - violation_level: ViolationLevel - - # what message should you convey to the user - user_message: str | None = None - - # additional metadata (including specific violation codes) more for - # debugging, telemetry - metadata: dict[str, Any] = Field(default_factory=dict) - - -@json_schema_type -class RunShieldResponse(BaseModel): - """Response from running a safety shield. - - :param violation: (Optional) Safety violation detected by the shield, if any - """ - - violation: SafetyViolation | None = None - - -class ShieldStore(Protocol): - async def get_shield(self, identifier: str) -> Shield: ... - - -@runtime_checkable -@trace_protocol -class Safety(Protocol): - """Safety - - OpenAI-compatible Moderations API. - """ - - shield_store: ShieldStore - - @webmethod(route="/safety/run-shield", method="POST", level=LLAMA_STACK_API_V1) - async def run_shield( - self, - shield_id: str, - messages: list[OpenAIMessageParam], - params: dict[str, Any], - ) -> RunShieldResponse: - """Run shield. - - Run a shield. - - :param shield_id: The identifier of the shield to run. - :param messages: The messages to run the shield on. - :param params: The parameters of the shield. - :returns: A RunShieldResponse. - """ - ... - - @webmethod(route="/moderations", method="POST", level=LLAMA_STACK_API_V1) - async def run_moderation(self, input: str | list[str], model: str | None = None) -> ModerationObject: - """Create moderation. - - Classifies if text and/or image inputs are potentially harmful. - :param input: Input (or inputs) to classify. - Can be a single string, an array of strings, or an array of multi-modal input objects similar to other models. - :param model: (Optional) The content moderation model you would like to use. - :returns: A moderation object. - """ - ... diff --git a/src/llama_stack/apis/safety/safety_service.py b/src/llama_stack/apis/safety/safety_service.py new file mode 100644 index 0000000000..12bd43f897 --- /dev/null +++ b/src/llama_stack/apis/safety/safety_service.py @@ -0,0 +1,41 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Any, Protocol, runtime_checkable + +from llama_stack.apis.inference import OpenAIMessageParam +from llama_stack.apis.shields import Shield +from llama_stack.core.telemetry.trace_protocol import trace_protocol + +from .models import ModerationObject, RunShieldResponse + + +class ShieldStore(Protocol): + async def get_shield(self, identifier: str) -> Shield: ... + + +@runtime_checkable +@trace_protocol +class SafetyService(Protocol): + """Safety + + OpenAI-compatible Moderations API. + """ + + shield_store: ShieldStore + + async def run_shield( + self, + shield_id: str, + messages: list[OpenAIMessageParam], + params: dict[str, Any], + ) -> RunShieldResponse: + """Run shield.""" + ... + + async def run_moderation(self, input: str | list[str], model: str | None = None) -> ModerationObject: + """Create moderation.""" + ... diff --git a/src/llama_stack/apis/scoring/__init__.py b/src/llama_stack/apis/scoring/__init__.py index 624b9e7042..e9ccc3c24a 100644 --- a/src/llama_stack/apis/scoring/__init__.py +++ b/src/llama_stack/apis/scoring/__init__.py @@ -4,4 +4,29 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .scoring import * +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .models import ( + ScoreBatchRequest, + ScoreBatchResponse, + ScoreRequest, + ScoreResponse, + ScoringResult, + ScoringResultRow, +) +from .scoring_service import ScoringFunctionStore, ScoringService + +# Backward compatibility - export Scoring as alias for ScoringService +Scoring = ScoringService + +__all__ = [ + "Scoring", + "ScoringService", + "ScoringFunctionStore", + "ScoreBatchRequest", + "ScoreBatchResponse", + "ScoreRequest", + "ScoreResponse", + "ScoringResult", + "ScoringResultRow", +] diff --git a/src/llama_stack/apis/scoring/models.py b/src/llama_stack/apis/scoring/models.py new file mode 100644 index 0000000000..04c111e50a --- /dev/null +++ b/src/llama_stack/apis/scoring/models.py @@ -0,0 +1,61 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Any + +from pydantic import BaseModel, Field + +from llama_stack.apis.scoring_functions import ScoringFnParams +from llama_stack.schema_utils import json_schema_type + +# mapping of metric to value +ScoringResultRow = dict[str, Any] + + +@json_schema_type +class ScoringResult(BaseModel): + """A scoring result for a single row.""" + + score_rows: list[ScoringResultRow] = Field( + ..., description="The scoring result for each row. Each row is a map of column name to value" + ) + aggregated_results: dict[str, Any] = Field(..., description="Map of metric name to aggregated value") + + +@json_schema_type +class ScoreBatchResponse(BaseModel): + """Response from batch scoring operations on datasets.""" + + dataset_id: str | None = Field(default=None, description="The identifier of the dataset that was scored") + results: dict[str, ScoringResult] = Field(..., description="A map of scoring function name to ScoringResult") + + +@json_schema_type +class ScoreResponse(BaseModel): + """The response from scoring.""" + + results: dict[str, ScoringResult] = Field(..., description="A map of scoring function name to ScoringResult") + + +@json_schema_type +class ScoreBatchRequest(BaseModel): + """Request for batch scoring operations.""" + + dataset_id: str = Field(..., description="The ID of the dataset to score") + scoring_functions: dict[str, ScoringFnParams | None] = Field( + ..., description="The scoring functions to use for the scoring" + ) + save_results_dataset: bool = Field(default=False, description="Whether to save the results to a dataset") + + +@json_schema_type +class ScoreRequest(BaseModel): + """Request for scoring a list of rows.""" + + input_rows: list[dict[str, Any]] = Field(..., description="The rows to score") + scoring_functions: dict[str, ScoringFnParams | None] = Field( + ..., description="The scoring functions to use for the scoring" + ) diff --git a/src/llama_stack/apis/scoring/routes.py b/src/llama_stack/apis/scoring/routes.py new file mode 100644 index 0000000000..4f7747924a --- /dev/null +++ b/src/llama_stack/apis/scoring/routes.py @@ -0,0 +1,75 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from fastapi import Body, Depends, Request + +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1 +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .models import ScoreBatchRequest, ScoreBatchResponse, ScoreRequest, ScoreResponse +from .scoring_service import ScoringService + + +def get_scoring_service(request: Request) -> ScoringService: + """Dependency to get the scoring service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.scoring not in impls: + raise ValueError("Scoring API implementation not found") + return impls[Api.scoring] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Scoring"], + responses=standard_responses, +) + + +@router.post( + "/scoring/score-batch", + response_model=ScoreBatchResponse, + summary="Score a batch of rows", + description="Score a batch of rows from a dataset", +) +async def score_batch( + body: ScoreBatchRequest = Body(...), + svc: ScoringService = Depends(get_scoring_service), +) -> ScoreBatchResponse: + """Score a batch of rows from a dataset.""" + return await svc.score_batch( + dataset_id=body.dataset_id, + scoring_functions=body.scoring_functions, + save_results_dataset=body.save_results_dataset, + ) + + +@router.post( + "/scoring/score", + response_model=ScoreResponse, + summary="Score a list of rows", + description="Score a list of rows", +) +async def score( + body: ScoreRequest = Body(...), + svc: ScoringService = Depends(get_scoring_service), +) -> ScoreResponse: + """Score a list of rows.""" + return await svc.score( + input_rows=body.input_rows, + scoring_functions=body.scoring_functions, + ) + + +# For backward compatibility with the router registry system +def create_scoring_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Scoring API (legacy compatibility).""" + return router + + +# Register the router factory +register_router(Api.scoring, create_scoring_router) diff --git a/src/llama_stack/apis/scoring/scoring.py b/src/llama_stack/apis/scoring/scoring.py deleted file mode 100644 index 03d943e943..0000000000 --- a/src/llama_stack/apis/scoring/scoring.py +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -from typing import Any, Protocol, runtime_checkable - -from pydantic import BaseModel - -from llama_stack.apis.scoring_functions import ScoringFn, ScoringFnParams -from llama_stack.apis.version import LLAMA_STACK_API_V1 -from llama_stack.schema_utils import json_schema_type, webmethod - -# mapping of metric to value -ScoringResultRow = dict[str, Any] - - -@json_schema_type -class ScoringResult(BaseModel): - """ - A scoring result for a single row. - - :param score_rows: The scoring result for each row. Each row is a map of column name to value. - :param aggregated_results: Map of metric name to aggregated value - """ - - score_rows: list[ScoringResultRow] - # aggregated metrics to value - aggregated_results: dict[str, Any] - - -@json_schema_type -class ScoreBatchResponse(BaseModel): - """Response from batch scoring operations on datasets. - - :param dataset_id: (Optional) The identifier of the dataset that was scored - :param results: A map of scoring function name to ScoringResult - """ - - dataset_id: str | None = None - results: dict[str, ScoringResult] - - -@json_schema_type -class ScoreResponse(BaseModel): - """ - The response from scoring. - - :param results: A map of scoring function name to ScoringResult. - """ - - # each key in the dict is a scoring function name - results: dict[str, ScoringResult] - - -class ScoringFunctionStore(Protocol): - def get_scoring_function(self, scoring_fn_id: str) -> ScoringFn: ... - - -@runtime_checkable -class Scoring(Protocol): - scoring_function_store: ScoringFunctionStore - - @webmethod(route="/scoring/score-batch", method="POST", level=LLAMA_STACK_API_V1) - async def score_batch( - self, - dataset_id: str, - scoring_functions: dict[str, ScoringFnParams | None], - save_results_dataset: bool = False, - ) -> ScoreBatchResponse: - """Score a batch of rows. - - :param dataset_id: The ID of the dataset to score. - :param scoring_functions: The scoring functions to use for the scoring. - :param save_results_dataset: Whether to save the results to a dataset. - :returns: A ScoreBatchResponse. - """ - ... - - @webmethod(route="/scoring/score", method="POST", level=LLAMA_STACK_API_V1) - async def score( - self, - input_rows: list[dict[str, Any]], - scoring_functions: dict[str, ScoringFnParams | None], - ) -> ScoreResponse: - """Score a list of rows. - - :param input_rows: The rows to score. - :param scoring_functions: The scoring functions to use for the scoring. - :returns: A ScoreResponse object containing rows and aggregated results. - """ - ... diff --git a/src/llama_stack/apis/scoring/scoring_service.py b/src/llama_stack/apis/scoring/scoring_service.py new file mode 100644 index 0000000000..3cba521e78 --- /dev/null +++ b/src/llama_stack/apis/scoring/scoring_service.py @@ -0,0 +1,37 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Any, Protocol, runtime_checkable + +from llama_stack.apis.scoring_functions import ScoringFn, ScoringFnParams + +from .models import ScoreBatchResponse, ScoreResponse + + +class ScoringFunctionStore(Protocol): + def get_scoring_function(self, scoring_fn_id: str) -> ScoringFn: ... + + +@runtime_checkable +class ScoringService(Protocol): + scoring_function_store: ScoringFunctionStore + + async def score_batch( + self, + dataset_id: str, + scoring_functions: dict[str, ScoringFnParams | None], + save_results_dataset: bool = False, + ) -> ScoreBatchResponse: + """Score a batch of rows.""" + ... + + async def score( + self, + input_rows: list[dict[str, Any]], + scoring_functions: dict[str, ScoringFnParams | None], + ) -> ScoreResponse: + """Score a list of rows.""" + ... diff --git a/src/llama_stack/apis/scoring_functions/__init__.py b/src/llama_stack/apis/scoring_functions/__init__.py index fc1de03116..18cb2116ae 100644 --- a/src/llama_stack/apis/scoring_functions/__init__.py +++ b/src/llama_stack/apis/scoring_functions/__init__.py @@ -4,4 +4,38 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .scoring_functions import * +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .models import ( + AggregationFunctionType, + BasicScoringFnParams, + CommonScoringFnFields, + ListScoringFunctionsResponse, + LLMAsJudgeScoringFnParams, + RegexParserScoringFnParams, + RegisterScoringFunctionRequest, + ScoringFn, + ScoringFnInput, + ScoringFnParams, + ScoringFnParamsType, +) +from .scoring_functions_service import ScoringFunctionsService + +# Backward compatibility - export ScoringFunctions as alias for ScoringFunctionsService +ScoringFunctions = ScoringFunctionsService + +__all__ = [ + "ScoringFunctions", + "ScoringFunctionsService", + "ScoringFn", + "ScoringFnInput", + "CommonScoringFnFields", + "ScoringFnParams", + "ScoringFnParamsType", + "LLMAsJudgeScoringFnParams", + "RegexParserScoringFnParams", + "BasicScoringFnParams", + "AggregationFunctionType", + "ListScoringFunctionsResponse", + "RegisterScoringFunctionRequest", +] diff --git a/src/llama_stack/apis/scoring_functions/models.py b/src/llama_stack/apis/scoring_functions/models.py new file mode 100644 index 0000000000..6c0fd1c17e --- /dev/null +++ b/src/llama_stack/apis/scoring_functions/models.py @@ -0,0 +1,143 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from enum import StrEnum +from typing import Annotated, Any, Literal + +from pydantic import BaseModel, Field + +from llama_stack.apis.common.type_system import ParamType +from llama_stack.apis.resource import Resource, ResourceType +from llama_stack.schema_utils import json_schema_type, register_schema + + +@json_schema_type +class ScoringFnParamsType(StrEnum): + """Types of scoring function parameter configurations.""" + + llm_as_judge = "llm_as_judge" + regex_parser = "regex_parser" + basic = "basic" + + +@json_schema_type +class AggregationFunctionType(StrEnum): + """Types of aggregation functions for scoring results.""" + + average = "average" + weighted_average = "weighted_average" + median = "median" + categorical_count = "categorical_count" + accuracy = "accuracy" + + +@json_schema_type +class LLMAsJudgeScoringFnParams(BaseModel): + """Parameters for LLM-as-judge scoring function configuration.""" + + type: Literal[ScoringFnParamsType.llm_as_judge] = ScoringFnParamsType.llm_as_judge + judge_model: str + prompt_template: str | None = None + judge_score_regexes: list[str] = Field( + description="Regexes to extract the answer from generated response", + default_factory=lambda: [], + ) + aggregation_functions: list[AggregationFunctionType] = Field( + description="Aggregation functions to apply to the scores of each row", + default_factory=lambda: [], + ) + + +@json_schema_type +class RegexParserScoringFnParams(BaseModel): + """Parameters for regex parser scoring function configuration.""" + + type: Literal[ScoringFnParamsType.regex_parser] = ScoringFnParamsType.regex_parser + parsing_regexes: list[str] = Field( + description="Regex to extract the answer from generated response", + default_factory=lambda: [], + ) + aggregation_functions: list[AggregationFunctionType] = Field( + description="Aggregation functions to apply to the scores of each row", + default_factory=lambda: [], + ) + + +@json_schema_type +class BasicScoringFnParams(BaseModel): + """Parameters for basic scoring function configuration.""" + + type: Literal[ScoringFnParamsType.basic] = ScoringFnParamsType.basic + aggregation_functions: list[AggregationFunctionType] = Field( + description="Aggregation functions to apply to the scores of each row", + default_factory=list, + ) + + +ScoringFnParams = Annotated[ + LLMAsJudgeScoringFnParams | RegexParserScoringFnParams | BasicScoringFnParams, + Field(discriminator="type"), +] +register_schema(ScoringFnParams, name="ScoringFnParams") + + +class CommonScoringFnFields(BaseModel): + description: str | None = None + metadata: dict[str, Any] = Field( + default_factory=dict, + description="Any additional metadata for this definition", + ) + return_type: ParamType = Field( + description="The return type of the deterministic function", + ) + params: ScoringFnParams | None = Field( + description="The parameters for the scoring function for benchmark eval, these can be overridden for app eval", + default=None, + ) + + +@json_schema_type +class ScoringFn(CommonScoringFnFields, Resource): + """A scoring function resource for evaluating model outputs.""" + + type: Literal[ResourceType.scoring_function] = ResourceType.scoring_function + + @property + def scoring_fn_id(self) -> str: + return self.identifier + + @property + def provider_scoring_fn_id(self) -> str | None: + return self.provider_resource_id + + +class ScoringFnInput(CommonScoringFnFields, BaseModel): + scoring_fn_id: str + provider_id: str | None = None + provider_scoring_fn_id: str | None = None + + +class ListScoringFunctionsResponse(BaseModel): + """Response model for listing scoring functions.""" + + data: list[ScoringFn] = Field(..., description="List of scoring function resources") + + +@json_schema_type +class RegisterScoringFunctionRequest(BaseModel): + """Request model for registering a scoring function.""" + + scoring_fn_id: str = Field(..., description="The ID of the scoring function to register") + description: str = Field(..., description="The description of the scoring function") + return_type: ParamType = Field(..., description="The return type of the scoring function") + provider_scoring_fn_id: str | None = Field( + default=None, description="The ID of the provider scoring function to use for the scoring function" + ) + provider_id: str | None = Field(default=None, description="The ID of the provider to use for the scoring function") + params: ScoringFnParams | None = Field( + default=None, + description="The parameters for the scoring function for benchmark eval, these can be overridden for app eval", + ) diff --git a/src/llama_stack/apis/scoring_functions/routes.py b/src/llama_stack/apis/scoring_functions/routes.py new file mode 100644 index 0000000000..a983e0cf7c --- /dev/null +++ b/src/llama_stack/apis/scoring_functions/routes.py @@ -0,0 +1,111 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated + +from fastapi import Body, Depends, Request +from fastapi import Path as FastAPIPath + +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1 +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .models import ( + ListScoringFunctionsResponse, + RegisterScoringFunctionRequest, + ScoringFn, +) +from .scoring_functions_service import ScoringFunctionsService + + +def get_scoring_functions_service(request: Request) -> ScoringFunctionsService: + """Dependency to get the scoring functions service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.scoring_functions not in impls: + raise ValueError("Scoring Functions API implementation not found") + return impls[Api.scoring_functions] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Scoring Functions"], + responses=standard_responses, +) + + +@router.get( + "/scoring-functions", + response_model=ListScoringFunctionsResponse, + summary="List all scoring functions", + description="List all scoring functions", +) +async def list_scoring_functions( + svc: ScoringFunctionsService = Depends(get_scoring_functions_service), +) -> ListScoringFunctionsResponse: + """List all scoring functions.""" + return await svc.list_scoring_functions() + + +@router.get( + "/scoring-functions/{scoring_fn_id:path}", + response_model=ScoringFn, + summary="Get a scoring function by its ID", + description="Get a scoring function by its ID", +) +async def get_scoring_function( + scoring_fn_id: Annotated[str, FastAPIPath(..., description="The ID of the scoring function to get")], + svc: ScoringFunctionsService = Depends(get_scoring_functions_service), +) -> ScoringFn: + """Get a scoring function by its ID.""" + return await svc.get_scoring_function(scoring_fn_id) + + +@router.post( + "/scoring-functions", + response_model=None, + status_code=204, + summary="Register a scoring function", + description="Register a scoring function", +) +async def register_scoring_function( + body: RegisterScoringFunctionRequest = Body(...), + svc: ScoringFunctionsService = Depends(get_scoring_functions_service), +) -> None: + """Register a scoring function.""" + return await svc.register_scoring_function( + scoring_fn_id=body.scoring_fn_id, + description=body.description, + return_type=body.return_type, + provider_scoring_fn_id=body.provider_scoring_fn_id, + provider_id=body.provider_id, + params=body.params, + ) + + +@router.delete( + "/scoring-functions/{scoring_fn_id:path}", + response_model=None, + status_code=204, + summary="Unregister a scoring function", + description="Unregister a scoring function", +) +async def unregister_scoring_function( + scoring_fn_id: Annotated[str, FastAPIPath(..., description="The ID of the scoring function to unregister")], + svc: ScoringFunctionsService = Depends(get_scoring_functions_service), +) -> None: + """Unregister a scoring function.""" + await svc.unregister_scoring_function(scoring_fn_id) + + +# For backward compatibility with the router registry system +def create_scoring_functions_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Scoring Functions API (legacy compatibility).""" + return router + + +# Register the router factory +register_router(Api.scoring_functions, create_scoring_functions_router) diff --git a/src/llama_stack/apis/scoring_functions/scoring_functions.py b/src/llama_stack/apis/scoring_functions/scoring_functions.py deleted file mode 100644 index fe49723ab1..0000000000 --- a/src/llama_stack/apis/scoring_functions/scoring_functions.py +++ /dev/null @@ -1,208 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -# TODO: use enum.StrEnum when we drop support for python 3.10 -from enum import StrEnum -from typing import ( - Annotated, - Any, - Literal, - Protocol, - runtime_checkable, -) - -from pydantic import BaseModel, Field - -from llama_stack.apis.common.type_system import ParamType -from llama_stack.apis.resource import Resource, ResourceType -from llama_stack.apis.version import LLAMA_STACK_API_V1 -from llama_stack.schema_utils import json_schema_type, register_schema, webmethod - - -# Perhaps more structure can be imposed on these functions. Maybe they could be associated -# with standard metrics so they can be rolled up? -@json_schema_type -class ScoringFnParamsType(StrEnum): - """Types of scoring function parameter configurations. - :cvar llm_as_judge: Use an LLM model to evaluate and score responses - :cvar regex_parser: Use regex patterns to extract and score specific parts of responses - :cvar basic: Basic scoring with simple aggregation functions - """ - - llm_as_judge = "llm_as_judge" - regex_parser = "regex_parser" - basic = "basic" - - -@json_schema_type -class AggregationFunctionType(StrEnum): - """Types of aggregation functions for scoring results. - :cvar average: Calculate the arithmetic mean of scores - :cvar weighted_average: Calculate a weighted average of scores - :cvar median: Calculate the median value of scores - :cvar categorical_count: Count occurrences of categorical values - :cvar accuracy: Calculate accuracy as the proportion of correct answers - """ - - average = "average" - weighted_average = "weighted_average" - median = "median" - categorical_count = "categorical_count" - accuracy = "accuracy" - - -@json_schema_type -class LLMAsJudgeScoringFnParams(BaseModel): - """Parameters for LLM-as-judge scoring function configuration. - :param type: The type of scoring function parameters, always llm_as_judge - :param judge_model: Identifier of the LLM model to use as a judge for scoring - :param prompt_template: (Optional) Custom prompt template for the judge model - :param judge_score_regexes: Regexes to extract the answer from generated response - :param aggregation_functions: Aggregation functions to apply to the scores of each row - """ - - type: Literal[ScoringFnParamsType.llm_as_judge] = ScoringFnParamsType.llm_as_judge - judge_model: str - prompt_template: str | None = None - judge_score_regexes: list[str] = Field( - description="Regexes to extract the answer from generated response", - default_factory=lambda: [], - ) - aggregation_functions: list[AggregationFunctionType] = Field( - description="Aggregation functions to apply to the scores of each row", - default_factory=lambda: [], - ) - - -@json_schema_type -class RegexParserScoringFnParams(BaseModel): - """Parameters for regex parser scoring function configuration. - :param type: The type of scoring function parameters, always regex_parser - :param parsing_regexes: Regex to extract the answer from generated response - :param aggregation_functions: Aggregation functions to apply to the scores of each row - """ - - type: Literal[ScoringFnParamsType.regex_parser] = ScoringFnParamsType.regex_parser - parsing_regexes: list[str] = Field( - description="Regex to extract the answer from generated response", - default_factory=lambda: [], - ) - aggregation_functions: list[AggregationFunctionType] = Field( - description="Aggregation functions to apply to the scores of each row", - default_factory=lambda: [], - ) - - -@json_schema_type -class BasicScoringFnParams(BaseModel): - """Parameters for basic scoring function configuration. - :param type: The type of scoring function parameters, always basic - :param aggregation_functions: Aggregation functions to apply to the scores of each row - """ - - type: Literal[ScoringFnParamsType.basic] = ScoringFnParamsType.basic - aggregation_functions: list[AggregationFunctionType] = Field( - description="Aggregation functions to apply to the scores of each row", - default_factory=list, - ) - - -ScoringFnParams = Annotated[ - LLMAsJudgeScoringFnParams | RegexParserScoringFnParams | BasicScoringFnParams, - Field(discriminator="type"), -] -register_schema(ScoringFnParams, name="ScoringFnParams") - - -class CommonScoringFnFields(BaseModel): - description: str | None = None - metadata: dict[str, Any] = Field( - default_factory=dict, - description="Any additional metadata for this definition", - ) - return_type: ParamType = Field( - description="The return type of the deterministic function", - ) - params: ScoringFnParams | None = Field( - description="The parameters for the scoring function for benchmark eval, these can be overridden for app eval", - default=None, - ) - - -@json_schema_type -class ScoringFn(CommonScoringFnFields, Resource): - """A scoring function resource for evaluating model outputs. - :param type: The resource type, always scoring_function - """ - - type: Literal[ResourceType.scoring_function] = ResourceType.scoring_function - - @property - def scoring_fn_id(self) -> str: - return self.identifier - - @property - def provider_scoring_fn_id(self) -> str | None: - return self.provider_resource_id - - -class ScoringFnInput(CommonScoringFnFields, BaseModel): - scoring_fn_id: str - provider_id: str | None = None - provider_scoring_fn_id: str | None = None - - -class ListScoringFunctionsResponse(BaseModel): - data: list[ScoringFn] - - -@runtime_checkable -class ScoringFunctions(Protocol): - @webmethod(route="/scoring-functions", method="GET", level=LLAMA_STACK_API_V1) - async def list_scoring_functions(self) -> ListScoringFunctionsResponse: - """List all scoring functions. - - :returns: A ListScoringFunctionsResponse. - """ - ... - - @webmethod(route="/scoring-functions/{scoring_fn_id:path}", method="GET", level=LLAMA_STACK_API_V1) - async def get_scoring_function(self, scoring_fn_id: str, /) -> ScoringFn: - """Get a scoring function by its ID. - - :param scoring_fn_id: The ID of the scoring function to get. - :returns: A ScoringFn. - """ - ... - - @webmethod(route="/scoring-functions", method="POST", level=LLAMA_STACK_API_V1) - async def register_scoring_function( - self, - scoring_fn_id: str, - description: str, - return_type: ParamType, - provider_scoring_fn_id: str | None = None, - provider_id: str | None = None, - params: ScoringFnParams | None = None, - ) -> None: - """Register a scoring function. - - :param scoring_fn_id: The ID of the scoring function to register. - :param description: The description of the scoring function. - :param return_type: The return type of the scoring function. - :param provider_scoring_fn_id: The ID of the provider scoring function to use for the scoring function. - :param provider_id: The ID of the provider to use for the scoring function. - :param params: The parameters for the scoring function for benchmark eval, these can be overridden for app eval. - """ - ... - - @webmethod(route="/scoring-functions/{scoring_fn_id:path}", method="DELETE", level=LLAMA_STACK_API_V1) - async def unregister_scoring_function(self, scoring_fn_id: str) -> None: - """Unregister a scoring function. - - :param scoring_fn_id: The ID of the scoring function to unregister. - """ - ... diff --git a/src/llama_stack/apis/scoring_functions/scoring_functions_service.py b/src/llama_stack/apis/scoring_functions/scoring_functions_service.py new file mode 100644 index 0000000000..8182747055 --- /dev/null +++ b/src/llama_stack/apis/scoring_functions/scoring_functions_service.py @@ -0,0 +1,40 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Protocol, runtime_checkable + +from llama_stack.apis.common.type_system import ParamType +from llama_stack.core.telemetry.trace_protocol import trace_protocol + +from .models import ListScoringFunctionsResponse, ScoringFn, ScoringFnParams + + +@runtime_checkable +@trace_protocol +class ScoringFunctionsService(Protocol): + async def list_scoring_functions(self) -> ListScoringFunctionsResponse: + """List all scoring functions.""" + ... + + async def get_scoring_function(self, scoring_fn_id: str, /) -> ScoringFn: + """Get a scoring function by its ID.""" + ... + + async def register_scoring_function( + self, + scoring_fn_id: str, + description: str, + return_type: ParamType, + provider_scoring_fn_id: str | None = None, + provider_id: str | None = None, + params: ScoringFnParams | None = None, + ) -> None: + """Register a scoring function.""" + ... + + async def unregister_scoring_function(self, scoring_fn_id: str) -> None: + """Unregister a scoring function.""" + ... diff --git a/src/llama_stack/apis/shields/__init__.py b/src/llama_stack/apis/shields/__init__.py index 783a4d1245..b3ba02a7e6 100644 --- a/src/llama_stack/apis/shields/__init__.py +++ b/src/llama_stack/apis/shields/__init__.py @@ -4,4 +4,20 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .shields import * +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .models import CommonShieldFields, ListShieldsResponse, RegisterShieldRequest, Shield, ShieldInput +from .shields_service import ShieldsService + +# Backward compatibility - export Shields as alias for ShieldsService +Shields = ShieldsService + +__all__ = [ + "Shields", + "ShieldsService", + "Shield", + "ShieldInput", + "CommonShieldFields", + "ListShieldsResponse", + "RegisterShieldRequest", +] diff --git a/src/llama_stack/apis/shields/models.py b/src/llama_stack/apis/shields/models.py new file mode 100644 index 0000000000..060ea97d8c --- /dev/null +++ b/src/llama_stack/apis/shields/models.py @@ -0,0 +1,55 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Any, Literal + +from pydantic import BaseModel, Field + +from llama_stack.apis.resource import Resource, ResourceType +from llama_stack.schema_utils import json_schema_type + + +class CommonShieldFields(BaseModel): + params: dict[str, Any] | None = Field(default=None, description="Configuration parameters for the shield") + + +@json_schema_type +class Shield(CommonShieldFields, Resource): + """A safety shield resource that can be used to check content.""" + + type: Literal[ResourceType.shield] = Field( + default=ResourceType.shield, description="The resource type, always shield" + ) + + @property + def shield_id(self) -> str: + return self.identifier + + @property + def provider_shield_id(self) -> str | None: + return self.provider_resource_id + + +class ShieldInput(CommonShieldFields): + shield_id: str + provider_id: str | None = None + provider_shield_id: str | None = None + + +class ListShieldsResponse(BaseModel): + """Response model for listing shields.""" + + data: list[Shield] = Field(..., description="List of shield resources") + + +@json_schema_type +class RegisterShieldRequest(BaseModel): + """Request model for registering a shield.""" + + shield_id: str = Field(..., description="The identifier of the shield to register") + provider_shield_id: str | None = Field(default=None, description="The identifier of the shield in the provider") + provider_id: str | None = Field(default=None, description="The identifier of the provider") + params: dict[str, Any] | None = Field(default=None, description="The parameters of the shield") diff --git a/src/llama_stack/apis/shields/routes.py b/src/llama_stack/apis/shields/routes.py new file mode 100644 index 0000000000..88daecd96d --- /dev/null +++ b/src/llama_stack/apis/shields/routes.py @@ -0,0 +1,102 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated + +from fastapi import Body, Depends, Request +from fastapi import Path as FastAPIPath + +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1 +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .models import ListShieldsResponse, RegisterShieldRequest, Shield +from .shields_service import ShieldsService + + +def get_shields_service(request: Request) -> ShieldsService: + """Dependency to get the shields service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.shields not in impls: + raise ValueError("Shields API implementation not found") + return impls[Api.shields] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Shields"], + responses=standard_responses, +) + + +@router.get( + "/shields", + response_model=ListShieldsResponse, + summary="List all shields", + description="List all shields", +) +async def list_shields(svc: ShieldsService = Depends(get_shields_service)) -> ListShieldsResponse: + """List all shields.""" + return await svc.list_shields() + + +@router.get( + "/shields/{identifier:path}", + response_model=Shield, + summary="Get a shield by its identifier", + description="Get a shield by its identifier", +) +async def get_shield( + identifier: Annotated[str, FastAPIPath(..., description="The identifier of the shield to get")], + svc: ShieldsService = Depends(get_shields_service), +) -> Shield: + """Get a shield by its identifier.""" + return await svc.get_shield(identifier=identifier) + + +@router.post( + "/shields", + response_model=Shield, + summary="Register a shield", + description="Register a shield", +) +async def register_shield( + body: RegisterShieldRequest = Body(...), + svc: ShieldsService = Depends(get_shields_service), +) -> Shield: + """Register a shield.""" + return await svc.register_shield( + shield_id=body.shield_id, + provider_shield_id=body.provider_shield_id, + provider_id=body.provider_id, + params=body.params, + ) + + +@router.delete( + "/shields/{identifier:path}", + response_model=None, + status_code=204, + summary="Unregister a shield", + description="Unregister a shield", +) +async def unregister_shield( + identifier: Annotated[str, FastAPIPath(..., description="The identifier of the shield to unregister")], + svc: ShieldsService = Depends(get_shields_service), +) -> None: + """Unregister a shield.""" + await svc.unregister_shield(identifier=identifier) + + +# For backward compatibility with the router registry system +def create_shields_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Shields API (legacy compatibility).""" + return router + + +# Register the router factory +register_router(Api.shields, create_shields_router) diff --git a/src/llama_stack/apis/shields/shields.py b/src/llama_stack/apis/shields/shields.py deleted file mode 100644 index 565e1db15c..0000000000 --- a/src/llama_stack/apis/shields/shields.py +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -from typing import Any, Literal, Protocol, runtime_checkable - -from pydantic import BaseModel - -from llama_stack.apis.resource import Resource, ResourceType -from llama_stack.apis.version import LLAMA_STACK_API_V1 -from llama_stack.core.telemetry.trace_protocol import trace_protocol -from llama_stack.schema_utils import json_schema_type, webmethod - - -class CommonShieldFields(BaseModel): - params: dict[str, Any] | None = None - - -@json_schema_type -class Shield(CommonShieldFields, Resource): - """A safety shield resource that can be used to check content. - - :param params: (Optional) Configuration parameters for the shield - :param type: The resource type, always shield - """ - - type: Literal[ResourceType.shield] = ResourceType.shield - - @property - def shield_id(self) -> str: - return self.identifier - - @property - def provider_shield_id(self) -> str | None: - return self.provider_resource_id - - -class ShieldInput(CommonShieldFields): - shield_id: str - provider_id: str | None = None - provider_shield_id: str | None = None - - -class ListShieldsResponse(BaseModel): - data: list[Shield] - - -@runtime_checkable -@trace_protocol -class Shields(Protocol): - @webmethod(route="/shields", method="GET", level=LLAMA_STACK_API_V1) - async def list_shields(self) -> ListShieldsResponse: - """List all shields. - - :returns: A ListShieldsResponse. - """ - ... - - @webmethod(route="/shields/{identifier:path}", method="GET", level=LLAMA_STACK_API_V1) - async def get_shield(self, identifier: str) -> Shield: - """Get a shield by its identifier. - - :param identifier: The identifier of the shield to get. - :returns: A Shield. - """ - ... - - @webmethod(route="/shields", method="POST", level=LLAMA_STACK_API_V1) - async def register_shield( - self, - shield_id: str, - provider_shield_id: str | None = None, - provider_id: str | None = None, - params: dict[str, Any] | None = None, - ) -> Shield: - """Register a shield. - - :param shield_id: The identifier of the shield to register. - :param provider_shield_id: The identifier of the shield in the provider. - :param provider_id: The identifier of the provider. - :param params: The parameters of the shield. - :returns: A Shield. - """ - ... - - @webmethod(route="/shields/{identifier:path}", method="DELETE", level=LLAMA_STACK_API_V1) - async def unregister_shield(self, identifier: str) -> None: - """Unregister a shield. - - :param identifier: The identifier of the shield to unregister. - """ - ... diff --git a/src/llama_stack/apis/shields/shields_service.py b/src/llama_stack/apis/shields/shields_service.py new file mode 100644 index 0000000000..25d051f63f --- /dev/null +++ b/src/llama_stack/apis/shields/shields_service.py @@ -0,0 +1,37 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Any, Protocol, runtime_checkable + +from llama_stack.core.telemetry.trace_protocol import trace_protocol + +from .models import ListShieldsResponse, Shield + + +@runtime_checkable +@trace_protocol +class ShieldsService(Protocol): + async def list_shields(self) -> ListShieldsResponse: + """List all shields.""" + ... + + async def get_shield(self, identifier: str) -> Shield: + """Get a shield by its identifier.""" + ... + + async def register_shield( + self, + shield_id: str, + provider_shield_id: str | None = None, + provider_id: str | None = None, + params: dict[str, Any] | None = None, + ) -> Shield: + """Register a shield.""" + ... + + async def unregister_shield(self, identifier: str) -> None: + """Unregister a shield.""" + ... diff --git a/src/llama_stack/apis/synthetic_data_generation/models.py b/src/llama_stack/apis/synthetic_data_generation/models.py new file mode 100644 index 0000000000..9f94894bc8 --- /dev/null +++ b/src/llama_stack/apis/synthetic_data_generation/models.py @@ -0,0 +1,60 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from enum import Enum +from typing import Any + +from pydantic import BaseModel, Field + +from llama_stack.apis.inference import Message +from llama_stack.schema_utils import json_schema_type + + +class FilteringFunction(Enum): + """The type of filtering function. + + :cvar none: No filtering applied, accept all generated synthetic data + :cvar random: Random sampling of generated data points + :cvar top_k: Keep only the top-k highest scoring synthetic data samples + :cvar top_p: Nucleus-style filtering, keep samples exceeding cumulative score threshold + :cvar top_k_top_p: Combined top-k and top-p filtering strategy + :cvar sigmoid: Apply sigmoid function for probability-based filtering + """ + + none = "none" + random = "random" + top_k = "top_k" + top_p = "top_p" + top_k_top_p = "top_k_top_p" + sigmoid = "sigmoid" + + +@json_schema_type +class SyntheticDataGenerationRequest(BaseModel): + """Request to generate synthetic data. A small batch of prompts and a filtering function.""" + + dialogs: list[Message] = Field( + ..., description="List of conversation messages to use as input for synthetic data generation" + ) + filtering_function: FilteringFunction = Field( + default=FilteringFunction.none, description="Type of filtering to apply to generated synthetic data samples" + ) + model: str | None = Field( + default=None, + description="The identifier of the model to use. The model must be registered with Llama Stack and available via the /models endpoint", + ) + + +@json_schema_type +class SyntheticDataGenerationResponse(BaseModel): + """Response from the synthetic data generation. Batch of (prompt, response, score) tuples that pass the threshold.""" + + synthetic_data: list[dict[str, Any]] = Field( + ..., description="List of generated synthetic data samples that passed the filtering criteria" + ) + statistics: dict[str, Any] | None = Field( + default=None, description="Statistical information about the generation process and filtering results" + ) diff --git a/src/llama_stack/apis/synthetic_data_generation/routes.py b/src/llama_stack/apis/synthetic_data_generation/routes.py new file mode 100644 index 0000000000..77900f4912 --- /dev/null +++ b/src/llama_stack/apis/synthetic_data_generation/routes.py @@ -0,0 +1,61 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from fastapi import Body, Depends, Request + +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1 +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .models import ( + SyntheticDataGenerationRequest, + SyntheticDataGenerationResponse, +) +from .synthetic_data_generation_service import SyntheticDataGenerationService + + +def get_synthetic_data_generation_service(request: Request) -> SyntheticDataGenerationService: + """Dependency to get the synthetic data generation service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.synthetic_data_generation not in impls: + raise ValueError("Synthetic Data Generation API implementation not found") + return impls[Api.synthetic_data_generation] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Synthetic Data Generation"], + responses=standard_responses, +) + + +@router.post( + "/synthetic-data-generation/generate", + response_model=SyntheticDataGenerationResponse, + summary="Generate synthetic data based on input dialogs and apply filtering", + description="Generate synthetic data based on input dialogs and apply filtering", +) +def synthetic_data_generate( + body: SyntheticDataGenerationRequest = Body(...), + svc: SyntheticDataGenerationService = Depends(get_synthetic_data_generation_service), +) -> SyntheticDataGenerationResponse: + """Generate synthetic data based on input dialogs and apply filtering.""" + return svc.synthetic_data_generate( + dialogs=body.dialogs, + filtering_function=body.filtering_function, + model=body.model, + ) + + +# For backward compatibility with the router registry system +def create_synthetic_data_generation_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Synthetic Data Generation API (legacy compatibility).""" + return router + + +# Register the router factory +register_router(Api.synthetic_data_generation, create_synthetic_data_generation_router) diff --git a/src/llama_stack/apis/synthetic_data_generation/synthetic_data_generation_service.py b/src/llama_stack/apis/synthetic_data_generation/synthetic_data_generation_service.py new file mode 100644 index 0000000000..9b278be01a --- /dev/null +++ b/src/llama_stack/apis/synthetic_data_generation/synthetic_data_generation_service.py @@ -0,0 +1,31 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Protocol, runtime_checkable + +from llama_stack.apis.inference import Message +from llama_stack.core.telemetry.trace_protocol import trace_protocol + +from .models import FilteringFunction, SyntheticDataGenerationResponse + + +@runtime_checkable +@trace_protocol +class SyntheticDataGenerationService(Protocol): + def synthetic_data_generate( + self, + dialogs: list[Message], + filtering_function: FilteringFunction = FilteringFunction.none, + model: str | None = None, + ) -> SyntheticDataGenerationResponse: + """Generate synthetic data based on input dialogs and apply filtering. + + :param dialogs: List of conversation messages to use as input for synthetic data generation + :param filtering_function: Type of filtering to apply to generated synthetic data samples + :param model: (Optional) The identifier of the model to use. The model must be registered with Llama Stack and available via the /models endpoint + :returns: Response containing filtered synthetic data samples and optional statistics + """ + ... diff --git a/src/llama_stack/apis/tools/__init__.py b/src/llama_stack/apis/tools/__init__.py index b25310ecf7..e59fcfb870 100644 --- a/src/llama_stack/apis/tools/__init__.py +++ b/src/llama_stack/apis/tools/__init__.py @@ -4,5 +4,44 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .rag_tool import * -from .tools import * +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .models import ( + InvokeToolRequest, + ListToolDefsResponse, + ListToolGroupsResponse, + RegisterToolGroupRequest, + SpecialToolGroup, + ToolDef, + ToolGroup, + ToolGroupInput, + ToolInvocationResult, +) +from .rag_tool import RAGDocument, RAGQueryConfig, RAGQueryResult, RAGToolRuntime +from .tool_groups_service import ToolGroupsService, ToolStore +from .tool_runtime_service import ToolRuntimeService + +# Backward compatibility - export as aliases +ToolGroups = ToolGroupsService +ToolRuntime = ToolRuntimeService + +__all__ = [ + "ToolGroups", + "ToolGroupsService", + "ToolRuntime", + "ToolRuntimeService", + "ToolStore", + "ToolDef", + "ToolGroup", + "ToolGroupInput", + "ToolInvocationResult", + "ListToolGroupsResponse", + "ListToolDefsResponse", + "RegisterToolGroupRequest", + "InvokeToolRequest", + "SpecialToolGroup", + "RAGToolRuntime", + "RAGDocument", + "RAGQueryConfig", + "RAGQueryResult", +] diff --git a/src/llama_stack/apis/tools/models.py b/src/llama_stack/apis/tools/models.py new file mode 100644 index 0000000000..3aa3b5a845 --- /dev/null +++ b/src/llama_stack/apis/tools/models.py @@ -0,0 +1,101 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from enum import Enum +from typing import Any, Literal + +from pydantic import BaseModel, Field + +from llama_stack.apis.common.content_types import URL, InterleavedContent +from llama_stack.apis.resource import Resource, ResourceType +from llama_stack.schema_utils import json_schema_type + + +@json_schema_type +class ToolDef(BaseModel): + """Tool definition used in runtime contexts.""" + + toolgroup_id: str | None = Field(default=None, description="ID of the tool group this tool belongs to") + name: str = Field(..., description="Name of the tool") + description: str | None = Field(default=None, description="Human-readable description of what the tool does") + input_schema: dict[str, Any] | None = Field( + default=None, description="JSON Schema for tool inputs (MCP inputSchema)" + ) + output_schema: dict[str, Any] | None = Field( + default=None, description="JSON Schema for tool outputs (MCP outputSchema)" + ) + metadata: dict[str, Any] | None = Field(default=None, description="Additional metadata about the tool") + + +@json_schema_type +class ToolGroupInput(BaseModel): + """Input data for registering a tool group.""" + + toolgroup_id: str = Field(..., description="Unique identifier for the tool group") + provider_id: str = Field(..., description="ID of the provider that will handle this tool group") + args: dict[str, Any] | None = Field(default=None, description="Additional arguments to pass to the provider") + mcp_endpoint: URL | None = Field(default=None, description="Model Context Protocol endpoint for remote tools") + + +@json_schema_type +class ToolGroup(Resource): + """A group of related tools managed together.""" + + type: Literal[ResourceType.tool_group] = Field( + default=ResourceType.tool_group, description="Type of resource, always 'tool_group'" + ) + mcp_endpoint: URL | None = Field(default=None, description="Model Context Protocol endpoint for remote tools") + args: dict[str, Any] | None = Field(default=None, description="Additional arguments for the tool group") + + +@json_schema_type +class ToolInvocationResult(BaseModel): + """Result of a tool invocation.""" + + content: InterleavedContent | None = Field(default=None, description="The output content from the tool execution") + error_message: str | None = Field(default=None, description="Error message if the tool execution failed") + error_code: int | None = Field(default=None, description="Numeric error code if the tool execution failed") + metadata: dict[str, Any] | None = Field(default=None, description="Additional metadata about the tool execution") + + +class ListToolGroupsResponse(BaseModel): + """Response containing a list of tool groups.""" + + data: list[ToolGroup] = Field(..., description="List of tool groups") + + +@json_schema_type +class ListToolDefsResponse(BaseModel): + """Response containing a list of tool definitions.""" + + data: list[ToolDef] = Field(..., description="List of tool definitions") + + +@json_schema_type +class RegisterToolGroupRequest(BaseModel): + """Request model for registering a tool group.""" + + toolgroup_id: str = Field(..., description="The ID of the tool group to register") + provider_id: str = Field(..., description="The ID of the provider to use for the tool group") + mcp_endpoint: URL | None = Field(default=None, description="The MCP endpoint to use for the tool group") + args: dict[str, Any] | None = Field(default=None, description="A dictionary of arguments to pass to the tool group") + + +@json_schema_type +class InvokeToolRequest(BaseModel): + """Request model for invoking a tool.""" + + tool_name: str = Field(..., description="The name of the tool to invoke") + kwargs: dict[str, Any] = Field(..., description="A dictionary of arguments to pass to the tool") + + +class SpecialToolGroup(Enum): + """Special tool groups with predefined functionality. + + :cvar rag_tool: Retrieval-Augmented Generation tool group for document search and retrieval + """ + + rag_tool = "rag_tool" diff --git a/src/llama_stack/apis/tools/rag_tool.py b/src/llama_stack/apis/tools/rag_tool.py index 4e43bb2844..ace5b27047 100644 --- a/src/llama_stack/apis/tools/rag_tool.py +++ b/src/llama_stack/apis/tools/rag_tool.py @@ -11,9 +11,8 @@ from typing_extensions import runtime_checkable from llama_stack.apis.common.content_types import URL, InterleavedContent -from llama_stack.apis.version import LLAMA_STACK_API_V1 from llama_stack.core.telemetry.trace_protocol import trace_protocol -from llama_stack.schema_utils import json_schema_type, register_schema, webmethod +from llama_stack.schema_utils import json_schema_type, register_schema @json_schema_type @@ -186,7 +185,6 @@ def validate_chunk_template(cls, v: str) -> str: @runtime_checkable @trace_protocol class RAGToolRuntime(Protocol): - @webmethod(route="/tool-runtime/rag-tool/insert", method="POST", level=LLAMA_STACK_API_V1) async def insert( self, documents: list[RAGDocument], @@ -201,7 +199,6 @@ async def insert( """ ... - @webmethod(route="/tool-runtime/rag-tool/query", method="POST", level=LLAMA_STACK_API_V1) async def query( self, content: InterleavedContent, diff --git a/src/llama_stack/apis/tools/routes.py b/src/llama_stack/apis/tools/routes.py new file mode 100644 index 0000000000..46862428fc --- /dev/null +++ b/src/llama_stack/apis/tools/routes.py @@ -0,0 +1,240 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated + +from fastapi import Body, Depends, Query, Request +from fastapi import Path as FastAPIPath + +from llama_stack.apis.common.content_types import URL, InterleavedContent +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1 +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .models import ( + InvokeToolRequest, + ListToolDefsResponse, + ListToolGroupsResponse, + RegisterToolGroupRequest, + ToolDef, + ToolGroup, + ToolInvocationResult, +) +from .rag_tool import RAGDocument, RAGQueryConfig, RAGQueryResult +from .tool_groups_service import ToolGroupsService +from .tool_runtime_service import ToolRuntimeService + + +def get_tool_groups_service(request: Request) -> ToolGroupsService: + """Dependency to get the tool groups service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.tool_groups not in impls: + raise ValueError("Tool Groups API implementation not found") + return impls[Api.tool_groups] + + +def get_tool_runtime_service(request: Request) -> ToolRuntimeService: + """Dependency to get the tool runtime service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.tool_runtime not in impls: + raise ValueError("Tool Runtime API implementation not found") + return impls[Api.tool_runtime] + + +# Tool Groups Router +tool_groups_router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Tool Groups"], + responses=standard_responses, +) + + +@tool_groups_router.post( + "/toolgroups", + response_model=None, + status_code=204, + summary="Register a tool group", + description="Register a tool group", +) +async def register_tool_group( + body: RegisterToolGroupRequest = Body(...), + svc: ToolGroupsService = Depends(get_tool_groups_service), +) -> None: + """Register a tool group.""" + await svc.register_tool_group( + toolgroup_id=body.toolgroup_id, + provider_id=body.provider_id, + mcp_endpoint=body.mcp_endpoint, + args=body.args, + ) + + +@tool_groups_router.get( + "/toolgroups/{toolgroup_id:path}", + response_model=ToolGroup, + summary="Get a tool group by its ID", + description="Get a tool group by its ID", +) +async def get_tool_group( + toolgroup_id: Annotated[str, FastAPIPath(..., description="The ID of the tool group to get")], + svc: ToolGroupsService = Depends(get_tool_groups_service), +) -> ToolGroup: + """Get a tool group by its ID.""" + return await svc.get_tool_group(toolgroup_id=toolgroup_id) + + +@tool_groups_router.get( + "/toolgroups", + response_model=ListToolGroupsResponse, + summary="List tool groups", + description="List tool groups with optional provider", +) +async def list_tool_groups(svc: ToolGroupsService = Depends(get_tool_groups_service)) -> ListToolGroupsResponse: + """List tool groups.""" + return await svc.list_tool_groups() + + +@tool_groups_router.get( + "/tools", + response_model=ListToolDefsResponse, + summary="List tools", + description="List tools with optional tool group", +) +async def list_tools( + toolgroup_id: str | None = Query(None, description="The ID of the tool group to list tools for"), + svc: ToolGroupsService = Depends(get_tool_groups_service), +) -> ListToolDefsResponse: + """List tools.""" + return await svc.list_tools(toolgroup_id=toolgroup_id) + + +@tool_groups_router.get( + "/tools/{tool_name:path}", + response_model=ToolDef, + summary="Get a tool by its name", + description="Get a tool by its name", +) +async def get_tool( + tool_name: Annotated[str, FastAPIPath(..., description="The name of the tool to get")], + svc: ToolGroupsService = Depends(get_tool_groups_service), +) -> ToolDef: + """Get a tool by its name.""" + return await svc.get_tool(tool_name=tool_name) + + +@tool_groups_router.delete( + "/toolgroups/{toolgroup_id:path}", + response_model=None, + status_code=204, + summary="Unregister a tool group", + description="Unregister a tool group", +) +async def unregister_toolgroup( + toolgroup_id: Annotated[str, FastAPIPath(..., description="The ID of the tool group to unregister")], + svc: ToolGroupsService = Depends(get_tool_groups_service), +) -> None: + """Unregister a tool group.""" + await svc.unregister_toolgroup(toolgroup_id=toolgroup_id) + + +# Tool Runtime Router +tool_runtime_router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Tool Runtime"], + responses=standard_responses, +) + + +@tool_runtime_router.get( + "/tool-runtime/list-tools", + response_model=ListToolDefsResponse, + summary="List all tools in the runtime", + description="List all tools in the runtime", +) +async def list_runtime_tools( + tool_group_id: str | None = Query(None, description="The ID of the tool group to list tools for"), + mcp_endpoint: str | None = Query(None, description="The MCP endpoint URL to use for the tool group"), + svc: ToolRuntimeService = Depends(get_tool_runtime_service), +) -> ListToolDefsResponse: + """List all tools in the runtime.""" + url_obj = URL(uri=mcp_endpoint) if mcp_endpoint else None + return await svc.list_runtime_tools(tool_group_id=tool_group_id, mcp_endpoint=url_obj) + + +@tool_runtime_router.post( + "/tool-runtime/invoke", + response_model=ToolInvocationResult, + summary="Run a tool with the given arguments", + description="Run a tool with the given arguments", +) +async def invoke_tool( + body: InvokeToolRequest = Body(...), + svc: ToolRuntimeService = Depends(get_tool_runtime_service), +) -> ToolInvocationResult: + """Invoke a tool.""" + return await svc.invoke_tool(tool_name=body.tool_name, kwargs=body.kwargs) + + +@tool_runtime_router.post( + "/tool-runtime/rag-tool/insert", + response_model=None, + status_code=204, + summary="Insert documents into the RAG system.", + description="Index documents so they can be used by the RAG system.", +) +async def rag_tool_insert( + documents: list[RAGDocument] = Body(..., description="List of documents to index in the RAG system."), + vector_store_id: str = Body(..., description="ID of the vector database to store the document embeddings."), + chunk_size_in_tokens: int = Body(512, description="Size in tokens for document chunking during indexing."), + svc: ToolRuntimeService = Depends(get_tool_runtime_service), +) -> None: + """Insert documents into the RAG system.""" + if svc.rag_tool is None: + raise ValueError("RAG tool is not available") + await svc.rag_tool.insert( + documents=documents, + vector_store_id=vector_store_id, + chunk_size_in_tokens=chunk_size_in_tokens, + ) + + +@tool_runtime_router.post( + "/tool-runtime/rag-tool/query", + response_model=RAGQueryResult, + summary="Query the RAG system for context.", + description="Query the RAG system for context; typically invoked by the agent.", +) +async def rag_tool_query( + content: InterleavedContent = Body(..., description="The query content to search for in the indexed documents."), + vector_store_ids: list[str] = Body(..., description="List of vector database IDs to search within."), + query_config: RAGQueryConfig | None = Body(None, description="Configuration parameters for the query operation."), + svc: ToolRuntimeService = Depends(get_tool_runtime_service), +) -> RAGQueryResult: + """Query the RAG system for context.""" + if svc.rag_tool is None: + raise ValueError("RAG tool is not available") + return await svc.rag_tool.query( + content=content, + vector_store_ids=vector_store_ids, + query_config=query_config, + ) + + +# For backward compatibility with the router registry system +def create_tool_groups_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Tool Groups API (legacy compatibility).""" + return tool_groups_router + + +def create_tool_runtime_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Tool Runtime API (legacy compatibility).""" + return tool_runtime_router + + +# Register the router factories +register_router(Api.tool_groups, create_tool_groups_router) +register_router(Api.tool_runtime, create_tool_runtime_router) diff --git a/src/llama_stack/apis/tools/tool_groups_service.py b/src/llama_stack/apis/tools/tool_groups_service.py new file mode 100644 index 0000000000..d558351f7b --- /dev/null +++ b/src/llama_stack/apis/tools/tool_groups_service.py @@ -0,0 +1,61 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Any, Protocol, runtime_checkable + +from llama_stack.apis.common.content_types import URL +from llama_stack.core.telemetry.trace_protocol import trace_protocol + +from .models import ListToolDefsResponse, ListToolGroupsResponse, ToolDef, ToolGroup + + +class ToolStore(Protocol): + async def get_tool(self, tool_name: str) -> ToolDef: ... + + async def get_tool_group(self, toolgroup_id: str) -> ToolGroup: ... + + +@runtime_checkable +@trace_protocol +class ToolGroupsService(Protocol): + async def register_tool_group( + self, + toolgroup_id: str, + provider_id: str, + mcp_endpoint: URL | None = None, + args: dict[str, Any] | None = None, + ) -> None: + """Register a tool group.""" + ... + + async def get_tool_group( + self, + toolgroup_id: str, + ) -> ToolGroup: + """Get a tool group by its ID.""" + ... + + async def list_tool_groups(self) -> ListToolGroupsResponse: + """List tool groups with optional provider.""" + ... + + async def list_tools(self, toolgroup_id: str | None = None) -> ListToolDefsResponse: + """List tools with optional tool group.""" + ... + + async def get_tool( + self, + tool_name: str, + ) -> ToolDef: + """Get a tool by its name.""" + ... + + async def unregister_toolgroup( + self, + toolgroup_id: str, + ) -> None: + """Unregister a tool group.""" + ... diff --git a/src/llama_stack/apis/tools/tool_runtime_service.py b/src/llama_stack/apis/tools/tool_runtime_service.py new file mode 100644 index 0000000000..f72aa461f3 --- /dev/null +++ b/src/llama_stack/apis/tools/tool_runtime_service.py @@ -0,0 +1,38 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Any, Protocol, runtime_checkable + +from llama_stack.apis.common.content_types import URL +from llama_stack.core.telemetry.trace_protocol import trace_protocol + +from .models import ListToolDefsResponse, ToolInvocationResult +from .rag_tool import RAGToolRuntime + + +class ToolStore(Protocol): + async def get_tool(self, tool_name: str) -> Any: ... + + async def get_tool_group(self, toolgroup_id: str) -> Any: ... + + +@runtime_checkable +@trace_protocol +class ToolRuntimeService(Protocol): + tool_store: ToolStore | None = None + + rag_tool: RAGToolRuntime | None = None + + # TODO: This needs to be renamed once OPEN API generator name conflict issue is fixed. + async def list_runtime_tools( + self, tool_group_id: str | None = None, mcp_endpoint: URL | None = None + ) -> ListToolDefsResponse: + """List all tools in the runtime.""" + ... + + async def invoke_tool(self, tool_name: str, kwargs: dict[str, Any]) -> ToolInvocationResult: + """Run a tool with the given arguments.""" + ... diff --git a/src/llama_stack/apis/tools/tools.py b/src/llama_stack/apis/tools/tools.py deleted file mode 100644 index 39706d2cbc..0000000000 --- a/src/llama_stack/apis/tools/tools.py +++ /dev/null @@ -1,222 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -from enum import Enum -from typing import Any, Literal, Protocol - -from pydantic import BaseModel -from typing_extensions import runtime_checkable - -from llama_stack.apis.common.content_types import URL, InterleavedContent -from llama_stack.apis.resource import Resource, ResourceType -from llama_stack.apis.version import LLAMA_STACK_API_V1 -from llama_stack.core.telemetry.trace_protocol import trace_protocol -from llama_stack.schema_utils import json_schema_type, webmethod - -from .rag_tool import RAGToolRuntime - - -@json_schema_type -class ToolDef(BaseModel): - """Tool definition used in runtime contexts. - - :param name: Name of the tool - :param description: (Optional) Human-readable description of what the tool does - :param input_schema: (Optional) JSON Schema for tool inputs (MCP inputSchema) - :param output_schema: (Optional) JSON Schema for tool outputs (MCP outputSchema) - :param metadata: (Optional) Additional metadata about the tool - :param toolgroup_id: (Optional) ID of the tool group this tool belongs to - """ - - toolgroup_id: str | None = None - name: str - description: str | None = None - input_schema: dict[str, Any] | None = None - output_schema: dict[str, Any] | None = None - metadata: dict[str, Any] | None = None - - -@json_schema_type -class ToolGroupInput(BaseModel): - """Input data for registering a tool group. - - :param toolgroup_id: Unique identifier for the tool group - :param provider_id: ID of the provider that will handle this tool group - :param args: (Optional) Additional arguments to pass to the provider - :param mcp_endpoint: (Optional) Model Context Protocol endpoint for remote tools - """ - - toolgroup_id: str - provider_id: str - args: dict[str, Any] | None = None - mcp_endpoint: URL | None = None - - -@json_schema_type -class ToolGroup(Resource): - """A group of related tools managed together. - - :param type: Type of resource, always 'tool_group' - :param mcp_endpoint: (Optional) Model Context Protocol endpoint for remote tools - :param args: (Optional) Additional arguments for the tool group - """ - - type: Literal[ResourceType.tool_group] = ResourceType.tool_group - mcp_endpoint: URL | None = None - args: dict[str, Any] | None = None - - -@json_schema_type -class ToolInvocationResult(BaseModel): - """Result of a tool invocation. - - :param content: (Optional) The output content from the tool execution - :param error_message: (Optional) Error message if the tool execution failed - :param error_code: (Optional) Numeric error code if the tool execution failed - :param metadata: (Optional) Additional metadata about the tool execution - """ - - content: InterleavedContent | None = None - error_message: str | None = None - error_code: int | None = None - metadata: dict[str, Any] | None = None - - -class ToolStore(Protocol): - async def get_tool(self, tool_name: str) -> ToolDef: ... - async def get_tool_group(self, toolgroup_id: str) -> ToolGroup: ... - - -class ListToolGroupsResponse(BaseModel): - """Response containing a list of tool groups. - - :param data: List of tool groups - """ - - data: list[ToolGroup] - - -@json_schema_type -class ListToolDefsResponse(BaseModel): - """Response containing a list of tool definitions. - - :param data: List of tool definitions - """ - - data: list[ToolDef] - - -@runtime_checkable -@trace_protocol -class ToolGroups(Protocol): - @webmethod(route="/toolgroups", method="POST", level=LLAMA_STACK_API_V1) - async def register_tool_group( - self, - toolgroup_id: str, - provider_id: str, - mcp_endpoint: URL | None = None, - args: dict[str, Any] | None = None, - ) -> None: - """Register a tool group. - - :param toolgroup_id: The ID of the tool group to register. - :param provider_id: The ID of the provider to use for the tool group. - :param mcp_endpoint: The MCP endpoint to use for the tool group. - :param args: A dictionary of arguments to pass to the tool group. - """ - ... - - @webmethod(route="/toolgroups/{toolgroup_id:path}", method="GET", level=LLAMA_STACK_API_V1) - async def get_tool_group( - self, - toolgroup_id: str, - ) -> ToolGroup: - """Get a tool group by its ID. - - :param toolgroup_id: The ID of the tool group to get. - :returns: A ToolGroup. - """ - ... - - @webmethod(route="/toolgroups", method="GET", level=LLAMA_STACK_API_V1) - async def list_tool_groups(self) -> ListToolGroupsResponse: - """List tool groups with optional provider. - - :returns: A ListToolGroupsResponse. - """ - ... - - @webmethod(route="/tools", method="GET", level=LLAMA_STACK_API_V1) - async def list_tools(self, toolgroup_id: str | None = None) -> ListToolDefsResponse: - """List tools with optional tool group. - - :param toolgroup_id: The ID of the tool group to list tools for. - :returns: A ListToolDefsResponse. - """ - ... - - @webmethod(route="/tools/{tool_name:path}", method="GET", level=LLAMA_STACK_API_V1) - async def get_tool( - self, - tool_name: str, - ) -> ToolDef: - """Get a tool by its name. - - :param tool_name: The name of the tool to get. - :returns: A ToolDef. - """ - ... - - @webmethod(route="/toolgroups/{toolgroup_id:path}", method="DELETE", level=LLAMA_STACK_API_V1) - async def unregister_toolgroup( - self, - toolgroup_id: str, - ) -> None: - """Unregister a tool group. - - :param toolgroup_id: The ID of the tool group to unregister. - """ - ... - - -class SpecialToolGroup(Enum): - """Special tool groups with predefined functionality. - - :cvar rag_tool: Retrieval-Augmented Generation tool group for document search and retrieval - """ - - rag_tool = "rag_tool" - - -@runtime_checkable -@trace_protocol -class ToolRuntime(Protocol): - tool_store: ToolStore | None = None - - rag_tool: RAGToolRuntime | None = None - - # TODO: This needs to be renamed once OPEN API generator name conflict issue is fixed. - @webmethod(route="/tool-runtime/list-tools", method="GET", level=LLAMA_STACK_API_V1) - async def list_runtime_tools( - self, tool_group_id: str | None = None, mcp_endpoint: URL | None = None - ) -> ListToolDefsResponse: - """List all tools in the runtime. - - :param tool_group_id: The ID of the tool group to list tools for. - :param mcp_endpoint: The MCP endpoint to use for the tool group. - :returns: A ListToolDefsResponse. - """ - ... - - @webmethod(route="/tool-runtime/invoke", method="POST", level=LLAMA_STACK_API_V1) - async def invoke_tool(self, tool_name: str, kwargs: dict[str, Any]) -> ToolInvocationResult: - """Run a tool with the given arguments. - - :param tool_name: The name of the tool to invoke. - :param kwargs: A dictionary of arguments to pass to the tool. - :returns: A ToolInvocationResult. - """ - ... diff --git a/src/llama_stack/apis/vector_io/__init__.py b/src/llama_stack/apis/vector_io/__init__.py index 3f4c608058..d00805efed 100644 --- a/src/llama_stack/apis/vector_io/__init__.py +++ b/src/llama_stack/apis/vector_io/__init__.py @@ -4,4 +4,77 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .vector_io import * +# Import routes to trigger router registration +from . import routes # noqa: F401 +from .models import ( + Chunk, + ChunkMetadata, + InsertChunksRequest, + OpenAICreateVectorStoreFileBatchRequestWithExtraBody, + OpenAICreateVectorStoreRequestWithExtraBody, + QueryChunksRequest, + QueryChunksResponse, + SearchRankingOptions, + VectorStoreChunkingStrategy, + VectorStoreChunkingStrategyAuto, + VectorStoreChunkingStrategyStatic, + VectorStoreChunkingStrategyStaticConfig, + VectorStoreContent, + VectorStoreCreateRequest, + VectorStoreDeleteResponse, + VectorStoreFileBatchObject, + VectorStoreFileContentsResponse, + VectorStoreFileCounts, + VectorStoreFileDeleteResponse, + VectorStoreFileLastError, + VectorStoreFileObject, + VectorStoreFilesListInBatchResponse, + VectorStoreFileStatus, + VectorStoreListFilesResponse, + VectorStoreListResponse, + VectorStoreModifyRequest, + VectorStoreObject, + VectorStoreSearchRequest, + VectorStoreSearchResponse, + VectorStoreSearchResponsePage, +) +from .vector_io_service import VectorIOService, VectorStoreTable + +# Backward compatibility - export VectorIO as alias for VectorIOService +VectorIO = VectorIOService + +__all__ = [ + "VectorIO", + "VectorIOService", + "VectorStoreTable", + "Chunk", + "ChunkMetadata", + "QueryChunksResponse", + "InsertChunksRequest", + "QueryChunksRequest", + "VectorStoreObject", + "VectorStoreCreateRequest", + "VectorStoreModifyRequest", + "VectorStoreListResponse", + "VectorStoreDeleteResponse", + "VectorStoreSearchRequest", + "VectorStoreSearchResponse", + "VectorStoreSearchResponsePage", + "VectorStoreContent", + "VectorStoreFileCounts", + "VectorStoreFileObject", + "VectorStoreListFilesResponse", + "VectorStoreFileContentsResponse", + "VectorStoreFileDeleteResponse", + "VectorStoreFileBatchObject", + "VectorStoreFilesListInBatchResponse", + "VectorStoreChunkingStrategy", + "VectorStoreChunkingStrategyAuto", + "VectorStoreChunkingStrategyStatic", + "VectorStoreChunkingStrategyStaticConfig", + "VectorStoreFileStatus", + "VectorStoreFileLastError", + "SearchRankingOptions", + "OpenAICreateVectorStoreRequestWithExtraBody", + "OpenAICreateVectorStoreFileBatchRequestWithExtraBody", +] diff --git a/src/llama_stack/apis/vector_io/models.py b/src/llama_stack/apis/vector_io/models.py new file mode 100644 index 0000000000..f0cad3585d --- /dev/null +++ b/src/llama_stack/apis/vector_io/models.py @@ -0,0 +1,339 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated, Any, Literal + +from pydantic import BaseModel, Field + +from llama_stack.apis.inference import InterleavedContent +from llama_stack.schema_utils import json_schema_type, register_schema + + +@json_schema_type +class ChunkMetadata(BaseModel): + """ + `ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that + will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata` + is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after. + Use `Chunk.metadata` for metadata that will be used in the context during inference. + """ + + chunk_id: str | None = None + document_id: str | None = None + source: str | None = None + created_timestamp: int | None = None + updated_timestamp: int | None = None + chunk_window: str | None = None + chunk_tokenizer: str | None = None + chunk_embedding_model: str | None = None + chunk_embedding_dimension: int | None = None + content_token_count: int | None = None + metadata_token_count: int | None = None + + +@json_schema_type +class Chunk(BaseModel): + """A chunk of content that can be inserted into a vector database.""" + + content: InterleavedContent + chunk_id: str + metadata: dict[str, Any] = Field(default_factory=dict) + embedding: list[float] | None = None + chunk_metadata: ChunkMetadata | None = None + + @property + def document_id(self) -> str | None: + """Returns the document_id from either metadata or chunk_metadata, with metadata taking precedence.""" + # Check metadata first (takes precedence) + doc_id = self.metadata.get("document_id") + if doc_id is not None: + if not isinstance(doc_id, str): + raise TypeError(f"metadata['document_id'] must be a string, got {type(doc_id).__name__}: {doc_id!r}") + return doc_id + + # Fall back to chunk_metadata if available (Pydantic ensures type safety) + if self.chunk_metadata is not None: + return self.chunk_metadata.document_id + + return None + + +@json_schema_type +class QueryChunksResponse(BaseModel): + """Response from querying chunks in a vector database.""" + + chunks: list[Chunk] + scores: list[float] + + +@json_schema_type +class VectorStoreFileCounts(BaseModel): + """File processing status counts for a vector store.""" + + completed: int + cancelled: int + failed: int + in_progress: int + total: int + + +# TODO: rename this as OpenAIVectorStore +@json_schema_type +class VectorStoreObject(BaseModel): + """OpenAI Vector Store object.""" + + id: str + object: str = "vector_store" + created_at: int + name: str | None = None + usage_bytes: int = 0 + file_counts: VectorStoreFileCounts + status: str = "completed" + expires_after: dict[str, Any] | None = None + expires_at: int | None = None + last_active_at: int | None = None + metadata: dict[str, Any] = Field(default_factory=dict) + + +@json_schema_type +class VectorStoreCreateRequest(BaseModel): + """Request to create a vector store.""" + + name: str | None = None + file_ids: list[str] = Field(default_factory=list) + expires_after: dict[str, Any] | None = None + chunking_strategy: dict[str, Any] | None = None + metadata: dict[str, Any] = Field(default_factory=dict) + + +@json_schema_type +class VectorStoreModifyRequest(BaseModel): + """Request to modify a vector store.""" + + name: str | None = None + expires_after: dict[str, Any] | None = None + metadata: dict[str, Any] | None = None + + +@json_schema_type +class VectorStoreListResponse(BaseModel): + """Response from listing vector stores.""" + + object: str = "list" + data: list[VectorStoreObject] + first_id: str | None = None + last_id: str | None = None + has_more: bool = False + + +@json_schema_type +class VectorStoreSearchRequest(BaseModel): + """Request to search a vector store.""" + + query: str | list[str] + filters: dict[str, Any] | None = None + max_num_results: int = 10 + ranking_options: dict[str, Any] | None = None + rewrite_query: bool = False + + +@json_schema_type +class VectorStoreContent(BaseModel): + """Content item from a vector store file or search result.""" + + type: Literal["text"] + text: str + + +@json_schema_type +class VectorStoreSearchResponse(BaseModel): + """Response from searching a vector store.""" + + file_id: str + filename: str + score: float + attributes: dict[str, str | float | bool] | None = None + content: list[VectorStoreContent] + + +@json_schema_type +class VectorStoreSearchResponsePage(BaseModel): + """Paginated response from searching a vector store.""" + + object: str = "vector_store.search_results.page" + search_query: str + data: list[VectorStoreSearchResponse] + has_more: bool = False + next_page: str | None = None + + +@json_schema_type +class VectorStoreDeleteResponse(BaseModel): + """Response from deleting a vector store.""" + + id: str + object: str = "vector_store.deleted" + deleted: bool = True + + +@json_schema_type +class VectorStoreChunkingStrategyAuto(BaseModel): + """Automatic chunking strategy for vector store files.""" + + type: Literal["auto"] = "auto" + + +@json_schema_type +class VectorStoreChunkingStrategyStaticConfig(BaseModel): + """Configuration for static chunking strategy.""" + + chunk_overlap_tokens: int = 400 + max_chunk_size_tokens: int = Field(800, ge=100, le=4096) + + +@json_schema_type +class VectorStoreChunkingStrategyStatic(BaseModel): + """Static chunking strategy with configurable parameters.""" + + type: Literal["static"] = "static" + static: VectorStoreChunkingStrategyStaticConfig + + +VectorStoreChunkingStrategy = Annotated[ + VectorStoreChunkingStrategyAuto | VectorStoreChunkingStrategyStatic, + Field(discriminator="type"), +] +register_schema(VectorStoreChunkingStrategy, name="VectorStoreChunkingStrategy") + + +class SearchRankingOptions(BaseModel): + """Options for ranking and filtering search results.""" + + ranker: str | None = None + # NOTE: OpenAI File Search Tool requires threshold to be between 0 and 1, however + # we don't guarantee that the score is between 0 and 1, so will leave this unconstrained + # and let the provider handle it + score_threshold: float | None = Field(default=0.0) + + +@json_schema_type +class VectorStoreFileLastError(BaseModel): + """Error information for failed vector store file processing.""" + + code: Literal["server_error"] | Literal["rate_limit_exceeded"] + message: str + + +VectorStoreFileStatus = Literal["completed"] | Literal["in_progress"] | Literal["cancelled"] | Literal["failed"] +register_schema(VectorStoreFileStatus, name="VectorStoreFileStatus") + + +@json_schema_type +class VectorStoreFileObject(BaseModel): + """OpenAI Vector Store File object.""" + + id: str + object: str = "vector_store.file" + attributes: dict[str, Any] = Field(default_factory=dict) + chunking_strategy: VectorStoreChunkingStrategy + created_at: int + last_error: VectorStoreFileLastError | None = None + status: VectorStoreFileStatus + usage_bytes: int = 0 + vector_store_id: str + + +@json_schema_type +class VectorStoreListFilesResponse(BaseModel): + """Response from listing files in a vector store.""" + + object: str = "list" + data: list[VectorStoreFileObject] + first_id: str | None = None + last_id: str | None = None + has_more: bool = False + + +@json_schema_type +class VectorStoreFileContentsResponse(BaseModel): + """Response from retrieving the contents of a vector store file.""" + + file_id: str + filename: str + attributes: dict[str, Any] + content: list[VectorStoreContent] + + +@json_schema_type +class VectorStoreFileDeleteResponse(BaseModel): + """Response from deleting a vector store file.""" + + id: str + object: str = "vector_store.file.deleted" + deleted: bool = True + + +@json_schema_type +class VectorStoreFileBatchObject(BaseModel): + """OpenAI Vector Store File Batch object.""" + + id: str + object: str = "vector_store.file_batch" + created_at: int + vector_store_id: str + status: VectorStoreFileStatus + file_counts: VectorStoreFileCounts + + +@json_schema_type +class VectorStoreFilesListInBatchResponse(BaseModel): + """Response from listing files in a vector store file batch.""" + + object: str = "list" + data: list[VectorStoreFileObject] + first_id: str | None = None + last_id: str | None = None + has_more: bool = False + + +# extra_body can be accessed via .model_extra +@json_schema_type +class OpenAICreateVectorStoreRequestWithExtraBody(BaseModel, extra="allow"): + """Request to create a vector store with extra_body support.""" + + name: str | None = None + file_ids: list[str] | None = None + expires_after: dict[str, Any] | None = None + chunking_strategy: dict[str, Any] | None = None + metadata: dict[str, Any] | None = None + + +# extra_body can be accessed via .model_extra +@json_schema_type +class OpenAICreateVectorStoreFileBatchRequestWithExtraBody(BaseModel, extra="allow"): + """Request to create a vector store file batch with extra_body support.""" + + file_ids: list[str] + attributes: dict[str, Any] | None = None + chunking_strategy: VectorStoreChunkingStrategy | None = None + + +@json_schema_type +class InsertChunksRequest(BaseModel): + """Request to insert chunks into a vector database.""" + + vector_store_id: str = Field(..., description="The identifier of the vector database to insert the chunks into.") + chunks: list[Chunk] = Field(..., description="The chunks to insert.") + ttl_seconds: int | None = Field(None, description="The time to live of the chunks.") + + +@json_schema_type +class QueryChunksRequest(BaseModel): + """Request to query chunks from a vector database.""" + + vector_store_id: str = Field(..., description="The identifier of the vector database to query.") + query: InterleavedContent = Field(..., description="The query to search for.") + params: dict[str, Any] | None = Field(None, description="The parameters of the query.") diff --git a/src/llama_stack/apis/vector_io/routes.py b/src/llama_stack/apis/vector_io/routes.py new file mode 100644 index 0000000000..2f25358541 --- /dev/null +++ b/src/llama_stack/apis/vector_io/routes.py @@ -0,0 +1,452 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated, Any + +from fastapi import Body, Depends, Query, Request +from fastapi import Path as FastAPIPath + +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1 +from llama_stack.core.server.router_utils import standard_responses +from llama_stack.core.server.routers import APIRouter, register_router + +from .models import ( + InsertChunksRequest, + OpenAICreateVectorStoreFileBatchRequestWithExtraBody, + OpenAICreateVectorStoreRequestWithExtraBody, + QueryChunksRequest, + QueryChunksResponse, + SearchRankingOptions, + VectorStoreChunkingStrategy, + VectorStoreDeleteResponse, + VectorStoreFileBatchObject, + VectorStoreFileContentsResponse, + VectorStoreFileDeleteResponse, + VectorStoreFileObject, + VectorStoreFilesListInBatchResponse, + VectorStoreFileStatus, + VectorStoreListFilesResponse, + VectorStoreListResponse, + VectorStoreModifyRequest, + VectorStoreObject, + VectorStoreSearchResponsePage, +) +from .vector_io_service import VectorIOService + + +def get_vector_io_service(request: Request) -> VectorIOService: + """Dependency to get the vector io service implementation from app state.""" + impls = getattr(request.app.state, "impls", {}) + if Api.vector_io not in impls: + raise ValueError("Vector IO API implementation not found") + return impls[Api.vector_io] + + +router = APIRouter( + prefix=f"/{LLAMA_STACK_API_V1}", + tags=["Vector IO"], + responses=standard_responses, +) + + +@router.post( + "/vector-io/insert", + response_model=None, + status_code=204, + summary="Insert chunks into a vector database.", + description="Insert chunks into a vector database.", +) +async def insert_chunks( + body: InsertChunksRequest = Body(...), + svc: VectorIOService = Depends(get_vector_io_service), +) -> None: + """Insert chunks into a vector database.""" + await svc.insert_chunks(vector_store_id=body.vector_store_id, chunks=body.chunks, ttl_seconds=body.ttl_seconds) + + +@router.post( + "/vector-io/query", + response_model=QueryChunksResponse, + summary="Query chunks from a vector database.", + description="Query chunks from a vector database.", +) +async def query_chunks( + body: QueryChunksRequest = Body(...), + svc: VectorIOService = Depends(get_vector_io_service), +) -> QueryChunksResponse: + """Query chunks from a vector database.""" + return await svc.query_chunks(vector_store_id=body.vector_store_id, query=body.query, params=body.params) + + +# OpenAI Vector Stores API endpoints +@router.post( + "/vector_stores", + response_model=VectorStoreObject, + summary="Creates a vector store.", + description="Creates a vector store.", +) +async def openai_create_vector_store( + body: OpenAICreateVectorStoreRequestWithExtraBody = Body(...), + svc: VectorIOService = Depends(get_vector_io_service), +) -> VectorStoreObject: + """Creates a vector store.""" + return await svc.openai_create_vector_store(params=body) + + +@router.get( + "/vector_stores", + response_model=VectorStoreListResponse, + summary="Returns a list of vector stores.", + description="Returns a list of vector stores.", +) +async def openai_list_vector_stores( + limit: int | None = Query( + 20, + description="A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.", + ge=1, + le=100, + ), + order: str | None = Query( + "desc", + description="Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.", + ), + after: str | None = Query( + None, description="A cursor for use in pagination. `after` is an object ID that defines your place in the list." + ), + before: str | None = Query( + None, + description="A cursor for use in pagination. `before` is an object ID that defines your place in the list.", + ), + svc: VectorIOService = Depends(get_vector_io_service), +) -> VectorStoreListResponse: + """Returns a list of vector stores.""" + return await svc.openai_list_vector_stores(limit=limit, order=order, after=after, before=before) + + +@router.get( + "/vector_stores/{vector_store_id}", + response_model=VectorStoreObject, + summary="Retrieves a vector store.", + description="Retrieves a vector store.", +) +async def openai_retrieve_vector_store( + vector_store_id: Annotated[str, FastAPIPath(..., description="The ID of the vector store to retrieve.")], + svc: VectorIOService = Depends(get_vector_io_service), +) -> VectorStoreObject: + """Retrieves a vector store.""" + return await svc.openai_retrieve_vector_store(vector_store_id=vector_store_id) + + +@router.post( + "/vector_stores/{vector_store_id}", + response_model=VectorStoreObject, + summary="Updates a vector store.", + description="Updates a vector store.", +) +async def openai_update_vector_store( + vector_store_id: Annotated[str, FastAPIPath(..., description="The ID of the vector store to update.")], + body: VectorStoreModifyRequest = Body(...), + svc: VectorIOService = Depends(get_vector_io_service), +) -> VectorStoreObject: + """Updates a vector store.""" + return await svc.openai_update_vector_store( + vector_store_id=vector_store_id, + name=body.name, + expires_after=body.expires_after, + metadata=body.metadata, + ) + + +@router.delete( + "/vector_stores/{vector_store_id}", + response_model=VectorStoreDeleteResponse, + summary="Delete a vector store.", + description="Delete a vector store.", +) +async def openai_delete_vector_store( + vector_store_id: Annotated[str, FastAPIPath(..., description="The ID of the vector store to delete.")], + svc: VectorIOService = Depends(get_vector_io_service), +) -> VectorStoreDeleteResponse: + """Delete a vector store.""" + return await svc.openai_delete_vector_store(vector_store_id=vector_store_id) + + +@router.post( + "/vector_stores/{vector_store_id}/search", + response_model=VectorStoreSearchResponsePage, + summary="Search for chunks in a vector store.", + description="Search for chunks in a vector store.", +) +async def openai_search_vector_store( + vector_store_id: Annotated[str, FastAPIPath(..., description="The ID of the vector store to search.")], + query: str | list[str] = Body(..., description="The query string or array for performing the search."), + filters: dict[str, Any] | None = Body( + None, description="Filters based on file attributes to narrow the search results." + ), + max_num_results: int | None = Body( + 10, description="Maximum number of results to return (1 to 50 inclusive, default 10).", ge=1, le=50 + ), + ranking_options: SearchRankingOptions | None = Body( + None, description="Ranking options for fine-tuning the search results." + ), + rewrite_query: bool = Body( + False, description="Whether to rewrite the natural language query for vector search (default false)." + ), + search_mode: str | None = Body( + "vector", description="The search mode to use - 'keyword', 'vector', or 'hybrid' (default 'vector')." + ), + svc: VectorIOService = Depends(get_vector_io_service), +) -> VectorStoreSearchResponsePage: + """Search for chunks in a vector store.""" + return await svc.openai_search_vector_store( + vector_store_id=vector_store_id, + query=query, + filters=filters, + max_num_results=max_num_results, + ranking_options=ranking_options, + rewrite_query=rewrite_query, + search_mode=search_mode, + ) + + +@router.post( + "/vector_stores/{vector_store_id}/files", + response_model=VectorStoreFileObject, + summary="Attach a file to a vector store.", + description="Attach a file to a vector store.", +) +async def openai_attach_file_to_vector_store( + vector_store_id: Annotated[str, FastAPIPath(..., description="The ID of the vector store to attach the file to.")], + file_id: str = Body(..., description="The ID of the file to attach to the vector store."), + attributes: dict[str, Any] | None = Body( + None, description="The key-value attributes stored with the file, which can be used for filtering." + ), + chunking_strategy: VectorStoreChunkingStrategy | None = Body( + None, description="The chunking strategy to use for the file." + ), + svc: VectorIOService = Depends(get_vector_io_service), +) -> VectorStoreFileObject: + """Attach a file to a vector store.""" + return await svc.openai_attach_file_to_vector_store( + vector_store_id=vector_store_id, + file_id=file_id, + attributes=attributes, + chunking_strategy=chunking_strategy, + ) + + +@router.get( + "/vector_stores/{vector_store_id}/files", + response_model=VectorStoreListFilesResponse, + summary="List files in a vector store.", + description="List files in a vector store.", +) +async def openai_list_files_in_vector_store( + vector_store_id: Annotated[str, FastAPIPath(..., description="The ID of the vector store to list files from.")], + limit: int | None = Query( + 20, + description="A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.", + ge=1, + le=100, + ), + order: str | None = Query( + "desc", + description="Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.", + ), + after: str | None = Query( + None, description="A cursor for use in pagination. `after` is an object ID that defines your place in the list." + ), + before: str | None = Query( + None, + description="A cursor for use in pagination. `before` is an object ID that defines your place in the list.", + ), + filter: VectorStoreFileStatus | None = Query( + None, description="Filter by file status to only return files with the specified status." + ), + svc: VectorIOService = Depends(get_vector_io_service), +) -> VectorStoreListFilesResponse: + """List files in a vector store.""" + return await svc.openai_list_files_in_vector_store( + vector_store_id=vector_store_id, limit=limit, order=order, after=after, before=before, filter=filter + ) + + +@router.get( + "/vector_stores/{vector_store_id}/files/{file_id}", + response_model=VectorStoreFileObject, + summary="Retrieves a vector store file.", + description="Retrieves a vector store file.", +) +async def openai_retrieve_vector_store_file( + vector_store_id: Annotated[ + str, FastAPIPath(..., description="The ID of the vector store containing the file to retrieve.") + ], + file_id: Annotated[str, FastAPIPath(..., description="The ID of the file to retrieve.")], + svc: VectorIOService = Depends(get_vector_io_service), +) -> VectorStoreFileObject: + """Retrieves a vector store file.""" + return await svc.openai_retrieve_vector_store_file(vector_store_id=vector_store_id, file_id=file_id) + + +@router.get( + "/vector_stores/{vector_store_id}/files/{file_id}/content", + response_model=VectorStoreFileContentsResponse, + summary="Retrieves the contents of a vector store file.", + description="Retrieves the contents of a vector store file.", +) +async def openai_retrieve_vector_store_file_contents( + vector_store_id: Annotated[ + str, FastAPIPath(..., description="The ID of the vector store containing the file to retrieve.") + ], + file_id: Annotated[str, FastAPIPath(..., description="The ID of the file to retrieve.")], + svc: VectorIOService = Depends(get_vector_io_service), +) -> VectorStoreFileContentsResponse: + """Retrieves the contents of a vector store file.""" + return await svc.openai_retrieve_vector_store_file_contents(vector_store_id=vector_store_id, file_id=file_id) + + +@router.post( + "/vector_stores/{vector_store_id}/files/{file_id}", + response_model=VectorStoreFileObject, + summary="Updates a vector store file.", + description="Updates a vector store file.", +) +async def openai_update_vector_store_file( + vector_store_id: Annotated[ + str, FastAPIPath(..., description="The ID of the vector store containing the file to update.") + ], + file_id: Annotated[str, FastAPIPath(..., description="The ID of the file to update.")], + attributes: dict[str, Any] = Body(..., description="The updated key-value attributes to store with the file."), + svc: VectorIOService = Depends(get_vector_io_service), +) -> VectorStoreFileObject: + """Updates a vector store file.""" + return await svc.openai_update_vector_store_file( + vector_store_id=vector_store_id, file_id=file_id, attributes=attributes + ) + + +@router.delete( + "/vector_stores/{vector_store_id}/files/{file_id}", + response_model=VectorStoreFileDeleteResponse, + summary="Delete a vector store file.", + description="Delete a vector store file.", +) +async def openai_delete_vector_store_file( + vector_store_id: Annotated[ + str, FastAPIPath(..., description="The ID of the vector store containing the file to delete.") + ], + file_id: Annotated[str, FastAPIPath(..., description="The ID of the file to delete.")], + svc: VectorIOService = Depends(get_vector_io_service), +) -> VectorStoreFileDeleteResponse: + """Delete a vector store file.""" + return await svc.openai_delete_vector_store_file(vector_store_id=vector_store_id, file_id=file_id) + + +@router.post( + "/vector_stores/{vector_store_id}/file_batches", + response_model=VectorStoreFileBatchObject, + summary="Create a vector store file batch.", + description="Create a vector store file batch.", +) +async def openai_create_vector_store_file_batch( + vector_store_id: Annotated[ + str, FastAPIPath(..., description="The ID of the vector store to create the file batch for.") + ], + body: OpenAICreateVectorStoreFileBatchRequestWithExtraBody = Body(...), + svc: VectorIOService = Depends(get_vector_io_service), +) -> VectorStoreFileBatchObject: + """Create a vector store file batch.""" + return await svc.openai_create_vector_store_file_batch(vector_store_id=vector_store_id, params=body) + + +@router.get( + "/vector_stores/{vector_store_id}/file_batches/{batch_id}", + response_model=VectorStoreFileBatchObject, + summary="Retrieve a vector store file batch.", + description="Retrieve a vector store file batch.", +) +async def openai_retrieve_vector_store_file_batch( + vector_store_id: Annotated[ + str, FastAPIPath(..., description="The ID of the vector store containing the file batch.") + ], + batch_id: Annotated[str, FastAPIPath(..., description="The ID of the file batch to retrieve.")], + svc: VectorIOService = Depends(get_vector_io_service), +) -> VectorStoreFileBatchObject: + """Retrieve a vector store file batch.""" + return await svc.openai_retrieve_vector_store_file_batch(batch_id=batch_id, vector_store_id=vector_store_id) + + +@router.get( + "/vector_stores/{vector_store_id}/file_batches/{batch_id}/files", + response_model=VectorStoreFilesListInBatchResponse, + summary="Returns a list of vector store files in a batch.", + description="Returns a list of vector store files in a batch.", +) +async def openai_list_files_in_vector_store_file_batch( + vector_store_id: Annotated[ + str, FastAPIPath(..., description="The ID of the vector store containing the file batch.") + ], + batch_id: Annotated[str, FastAPIPath(..., description="The ID of the file batch to list files from.")], + after: str | None = Query( + None, description="A cursor for use in pagination. `after` is an object ID that defines your place in the list." + ), + before: str | None = Query( + None, + description="A cursor for use in pagination. `before` is an object ID that defines your place in the list.", + ), + filter: str | None = Query( + None, description="Filter by file status. One of in_progress, completed, failed, cancelled." + ), + limit: int | None = Query( + 20, + description="A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.", + ge=1, + le=100, + ), + order: str | None = Query( + "desc", + description="Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.", + ), + svc: VectorIOService = Depends(get_vector_io_service), +) -> VectorStoreFilesListInBatchResponse: + """Returns a list of vector store files in a batch.""" + return await svc.openai_list_files_in_vector_store_file_batch( + batch_id=batch_id, + vector_store_id=vector_store_id, + after=after, + before=before, + filter=filter, + limit=limit, + order=order, + ) + + +@router.post( + "/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel", + response_model=VectorStoreFileBatchObject, + summary="Cancels a vector store file batch.", + description="Cancels a vector store file batch.", +) +async def openai_cancel_vector_store_file_batch( + vector_store_id: Annotated[ + str, FastAPIPath(..., description="The ID of the vector store containing the file batch.") + ], + batch_id: Annotated[str, FastAPIPath(..., description="The ID of the file batch to cancel.")], + svc: VectorIOService = Depends(get_vector_io_service), +) -> VectorStoreFileBatchObject: + """Cancels a vector store file batch.""" + return await svc.openai_cancel_vector_store_file_batch(batch_id=batch_id, vector_store_id=vector_store_id) + + +# For backward compatibility with the router registry system +def create_vector_io_router(impl_getter) -> APIRouter: + """Create a FastAPI router for the Vector IO API (legacy compatibility).""" + return router + + +# Register the router factory +register_router(Api.vector_io, create_vector_io_router) diff --git a/src/llama_stack/apis/vector_io/vector_io.py b/src/llama_stack/apis/vector_io/vector_io.py deleted file mode 100644 index 892dc07113..0000000000 --- a/src/llama_stack/apis/vector_io/vector_io.py +++ /dev/null @@ -1,861 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. -from typing import Annotated, Any, Literal, Protocol, runtime_checkable - -from fastapi import Body -from pydantic import BaseModel, Field - -from llama_stack.apis.inference import InterleavedContent -from llama_stack.apis.vector_stores import VectorStore -from llama_stack.apis.version import LLAMA_STACK_API_V1 -from llama_stack.core.telemetry.trace_protocol import trace_protocol -from llama_stack.schema_utils import json_schema_type, register_schema, webmethod - - -@json_schema_type -class ChunkMetadata(BaseModel): - """ - `ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that - will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata` - is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after. - Use `Chunk.metadata` for metadata that will be used in the context during inference. - :param chunk_id: The ID of the chunk. If not set, it will be generated based on the document ID and content. - :param document_id: The ID of the document this chunk belongs to. - :param source: The source of the content, such as a URL, file path, or other identifier. - :param created_timestamp: An optional timestamp indicating when the chunk was created. - :param updated_timestamp: An optional timestamp indicating when the chunk was last updated. - :param chunk_window: The window of the chunk, which can be used to group related chunks together. - :param chunk_tokenizer: The tokenizer used to create the chunk. Default is Tiktoken. - :param chunk_embedding_model: The embedding model used to create the chunk's embedding. - :param chunk_embedding_dimension: The dimension of the embedding vector for the chunk. - :param content_token_count: The number of tokens in the content of the chunk. - :param metadata_token_count: The number of tokens in the metadata of the chunk. - """ - - chunk_id: str | None = None - document_id: str | None = None - source: str | None = None - created_timestamp: int | None = None - updated_timestamp: int | None = None - chunk_window: str | None = None - chunk_tokenizer: str | None = None - chunk_embedding_model: str | None = None - chunk_embedding_dimension: int | None = None - content_token_count: int | None = None - metadata_token_count: int | None = None - - -@json_schema_type -class Chunk(BaseModel): - """ - A chunk of content that can be inserted into a vector database. - :param content: The content of the chunk, which can be interleaved text, images, or other types. - :param chunk_id: Unique identifier for the chunk. Must be provided explicitly. - :param metadata: Metadata associated with the chunk that will be used in the model context during inference. - :param embedding: Optional embedding for the chunk. If not provided, it will be computed later. - :param chunk_metadata: Metadata for the chunk that will NOT be used in the context during inference. - The `chunk_metadata` is required backend functionality. - """ - - content: InterleavedContent - chunk_id: str - metadata: dict[str, Any] = Field(default_factory=dict) - embedding: list[float] | None = None - chunk_metadata: ChunkMetadata | None = None - - @property - def document_id(self) -> str | None: - """Returns the document_id from either metadata or chunk_metadata, with metadata taking precedence.""" - # Check metadata first (takes precedence) - doc_id = self.metadata.get("document_id") - if doc_id is not None: - if not isinstance(doc_id, str): - raise TypeError(f"metadata['document_id'] must be a string, got {type(doc_id).__name__}: {doc_id!r}") - return doc_id - - # Fall back to chunk_metadata if available (Pydantic ensures type safety) - if self.chunk_metadata is not None: - return self.chunk_metadata.document_id - - return None - - -@json_schema_type -class QueryChunksResponse(BaseModel): - """Response from querying chunks in a vector database. - - :param chunks: List of content chunks returned from the query - :param scores: Relevance scores corresponding to each returned chunk - """ - - chunks: list[Chunk] - scores: list[float] - - -@json_schema_type -class VectorStoreFileCounts(BaseModel): - """File processing status counts for a vector store. - - :param completed: Number of files that have been successfully processed - :param cancelled: Number of files that had their processing cancelled - :param failed: Number of files that failed to process - :param in_progress: Number of files currently being processed - :param total: Total number of files in the vector store - """ - - completed: int - cancelled: int - failed: int - in_progress: int - total: int - - -# TODO: rename this as OpenAIVectorStore -@json_schema_type -class VectorStoreObject(BaseModel): - """OpenAI Vector Store object. - - :param id: Unique identifier for the vector store - :param object: Object type identifier, always "vector_store" - :param created_at: Timestamp when the vector store was created - :param name: (Optional) Name of the vector store - :param usage_bytes: Storage space used by the vector store in bytes - :param file_counts: File processing status counts for the vector store - :param status: Current status of the vector store - :param expires_after: (Optional) Expiration policy for the vector store - :param expires_at: (Optional) Timestamp when the vector store will expire - :param last_active_at: (Optional) Timestamp of last activity on the vector store - :param metadata: Set of key-value pairs that can be attached to the vector store - """ - - id: str - object: str = "vector_store" - created_at: int - name: str | None = None - usage_bytes: int = 0 - file_counts: VectorStoreFileCounts - status: str = "completed" - expires_after: dict[str, Any] | None = None - expires_at: int | None = None - last_active_at: int | None = None - metadata: dict[str, Any] = Field(default_factory=dict) - - -@json_schema_type -class VectorStoreCreateRequest(BaseModel): - """Request to create a vector store. - - :param name: (Optional) Name for the vector store - :param file_ids: List of file IDs to include in the vector store - :param expires_after: (Optional) Expiration policy for the vector store - :param chunking_strategy: (Optional) Strategy for splitting files into chunks - :param metadata: Set of key-value pairs that can be attached to the vector store - """ - - name: str | None = None - file_ids: list[str] = Field(default_factory=list) - expires_after: dict[str, Any] | None = None - chunking_strategy: dict[str, Any] | None = None - metadata: dict[str, Any] = Field(default_factory=dict) - - -@json_schema_type -class VectorStoreModifyRequest(BaseModel): - """Request to modify a vector store. - - :param name: (Optional) Updated name for the vector store - :param expires_after: (Optional) Updated expiration policy for the vector store - :param metadata: (Optional) Updated set of key-value pairs for the vector store - """ - - name: str | None = None - expires_after: dict[str, Any] | None = None - metadata: dict[str, Any] | None = None - - -@json_schema_type -class VectorStoreListResponse(BaseModel): - """Response from listing vector stores. - - :param object: Object type identifier, always "list" - :param data: List of vector store objects - :param first_id: (Optional) ID of the first vector store in the list for pagination - :param last_id: (Optional) ID of the last vector store in the list for pagination - :param has_more: Whether there are more vector stores available beyond this page - """ - - object: str = "list" - data: list[VectorStoreObject] - first_id: str | None = None - last_id: str | None = None - has_more: bool = False - - -@json_schema_type -class VectorStoreSearchRequest(BaseModel): - """Request to search a vector store. - - :param query: Search query as a string or list of strings - :param filters: (Optional) Filters based on file attributes to narrow search results - :param max_num_results: Maximum number of results to return, defaults to 10 - :param ranking_options: (Optional) Options for ranking and filtering search results - :param rewrite_query: Whether to rewrite the query for better vector search performance - """ - - query: str | list[str] - filters: dict[str, Any] | None = None - max_num_results: int = 10 - ranking_options: dict[str, Any] | None = None - rewrite_query: bool = False - - -@json_schema_type -class VectorStoreContent(BaseModel): - """Content item from a vector store file or search result. - - :param type: Content type, currently only "text" is supported - :param text: The actual text content - """ - - type: Literal["text"] - text: str - - -@json_schema_type -class VectorStoreSearchResponse(BaseModel): - """Response from searching a vector store. - - :param file_id: Unique identifier of the file containing the result - :param filename: Name of the file containing the result - :param score: Relevance score for this search result - :param attributes: (Optional) Key-value attributes associated with the file - :param content: List of content items matching the search query - """ - - file_id: str - filename: str - score: float - attributes: dict[str, str | float | bool] | None = None - content: list[VectorStoreContent] - - -@json_schema_type -class VectorStoreSearchResponsePage(BaseModel): - """Paginated response from searching a vector store. - - :param object: Object type identifier for the search results page - :param search_query: The original search query that was executed - :param data: List of search result objects - :param has_more: Whether there are more results available beyond this page - :param next_page: (Optional) Token for retrieving the next page of results - """ - - object: str = "vector_store.search_results.page" - search_query: str - data: list[VectorStoreSearchResponse] - has_more: bool = False - next_page: str | None = None - - -@json_schema_type -class VectorStoreDeleteResponse(BaseModel): - """Response from deleting a vector store. - - :param id: Unique identifier of the deleted vector store - :param object: Object type identifier for the deletion response - :param deleted: Whether the deletion operation was successful - """ - - id: str - object: str = "vector_store.deleted" - deleted: bool = True - - -@json_schema_type -class VectorStoreChunkingStrategyAuto(BaseModel): - """Automatic chunking strategy for vector store files. - - :param type: Strategy type, always "auto" for automatic chunking - """ - - type: Literal["auto"] = "auto" - - -@json_schema_type -class VectorStoreChunkingStrategyStaticConfig(BaseModel): - """Configuration for static chunking strategy. - - :param chunk_overlap_tokens: Number of tokens to overlap between adjacent chunks - :param max_chunk_size_tokens: Maximum number of tokens per chunk, must be between 100 and 4096 - """ - - chunk_overlap_tokens: int = 400 - max_chunk_size_tokens: int = Field(800, ge=100, le=4096) - - -@json_schema_type -class VectorStoreChunkingStrategyStatic(BaseModel): - """Static chunking strategy with configurable parameters. - - :param type: Strategy type, always "static" for static chunking - :param static: Configuration parameters for the static chunking strategy - """ - - type: Literal["static"] = "static" - static: VectorStoreChunkingStrategyStaticConfig - - -VectorStoreChunkingStrategy = Annotated[ - VectorStoreChunkingStrategyAuto | VectorStoreChunkingStrategyStatic, - Field(discriminator="type"), -] -register_schema(VectorStoreChunkingStrategy, name="VectorStoreChunkingStrategy") - - -class SearchRankingOptions(BaseModel): - """Options for ranking and filtering search results. - - :param ranker: (Optional) Name of the ranking algorithm to use - :param score_threshold: (Optional) Minimum relevance score threshold for results - """ - - ranker: str | None = None - # NOTE: OpenAI File Search Tool requires threshold to be between 0 and 1, however - # we don't guarantee that the score is between 0 and 1, so will leave this unconstrained - # and let the provider handle it - score_threshold: float | None = Field(default=0.0) - - -@json_schema_type -class VectorStoreFileLastError(BaseModel): - """Error information for failed vector store file processing. - - :param code: Error code indicating the type of failure - :param message: Human-readable error message describing the failure - """ - - code: Literal["server_error"] | Literal["rate_limit_exceeded"] - message: str - - -VectorStoreFileStatus = Literal["completed"] | Literal["in_progress"] | Literal["cancelled"] | Literal["failed"] -register_schema(VectorStoreFileStatus, name="VectorStoreFileStatus") - - -@json_schema_type -class VectorStoreFileObject(BaseModel): - """OpenAI Vector Store File object. - - :param id: Unique identifier for the file - :param object: Object type identifier, always "vector_store.file" - :param attributes: Key-value attributes associated with the file - :param chunking_strategy: Strategy used for splitting the file into chunks - :param created_at: Timestamp when the file was added to the vector store - :param last_error: (Optional) Error information if file processing failed - :param status: Current processing status of the file - :param usage_bytes: Storage space used by this file in bytes - :param vector_store_id: ID of the vector store containing this file - """ - - id: str - object: str = "vector_store.file" - attributes: dict[str, Any] = Field(default_factory=dict) - chunking_strategy: VectorStoreChunkingStrategy - created_at: int - last_error: VectorStoreFileLastError | None = None - status: VectorStoreFileStatus - usage_bytes: int = 0 - vector_store_id: str - - -@json_schema_type -class VectorStoreListFilesResponse(BaseModel): - """Response from listing files in a vector store. - - :param object: Object type identifier, always "list" - :param data: List of vector store file objects - :param first_id: (Optional) ID of the first file in the list for pagination - :param last_id: (Optional) ID of the last file in the list for pagination - :param has_more: Whether there are more files available beyond this page - """ - - object: str = "list" - data: list[VectorStoreFileObject] - first_id: str | None = None - last_id: str | None = None - has_more: bool = False - - -@json_schema_type -class VectorStoreFileContentsResponse(BaseModel): - """Response from retrieving the contents of a vector store file. - - :param file_id: Unique identifier for the file - :param filename: Name of the file - :param attributes: Key-value attributes associated with the file - :param content: List of content items from the file - """ - - file_id: str - filename: str - attributes: dict[str, Any] - content: list[VectorStoreContent] - - -@json_schema_type -class VectorStoreFileDeleteResponse(BaseModel): - """Response from deleting a vector store file. - - :param id: Unique identifier of the deleted file - :param object: Object type identifier for the deletion response - :param deleted: Whether the deletion operation was successful - """ - - id: str - object: str = "vector_store.file.deleted" - deleted: bool = True - - -@json_schema_type -class VectorStoreFileBatchObject(BaseModel): - """OpenAI Vector Store File Batch object. - - :param id: Unique identifier for the file batch - :param object: Object type identifier, always "vector_store.file_batch" - :param created_at: Timestamp when the file batch was created - :param vector_store_id: ID of the vector store containing the file batch - :param status: Current processing status of the file batch - :param file_counts: File processing status counts for the batch - """ - - id: str - object: str = "vector_store.file_batch" - created_at: int - vector_store_id: str - status: VectorStoreFileStatus - file_counts: VectorStoreFileCounts - - -@json_schema_type -class VectorStoreFilesListInBatchResponse(BaseModel): - """Response from listing files in a vector store file batch. - - :param object: Object type identifier, always "list" - :param data: List of vector store file objects in the batch - :param first_id: (Optional) ID of the first file in the list for pagination - :param last_id: (Optional) ID of the last file in the list for pagination - :param has_more: Whether there are more files available beyond this page - """ - - object: str = "list" - data: list[VectorStoreFileObject] - first_id: str | None = None - last_id: str | None = None - has_more: bool = False - - -# extra_body can be accessed via .model_extra -@json_schema_type -class OpenAICreateVectorStoreRequestWithExtraBody(BaseModel, extra="allow"): - """Request to create a vector store with extra_body support. - - :param name: (Optional) A name for the vector store - :param file_ids: List of file IDs to include in the vector store - :param expires_after: (Optional) Expiration policy for the vector store - :param chunking_strategy: (Optional) Strategy for splitting files into chunks - :param metadata: Set of key-value pairs that can be attached to the vector store - """ - - name: str | None = None - file_ids: list[str] | None = None - expires_after: dict[str, Any] | None = None - chunking_strategy: dict[str, Any] | None = None - metadata: dict[str, Any] | None = None - - -# extra_body can be accessed via .model_extra -@json_schema_type -class OpenAICreateVectorStoreFileBatchRequestWithExtraBody(BaseModel, extra="allow"): - """Request to create a vector store file batch with extra_body support. - - :param file_ids: A list of File IDs that the vector store should use - :param attributes: (Optional) Key-value attributes to store with the files - :param chunking_strategy: (Optional) The chunking strategy used to chunk the file(s). Defaults to auto - """ - - file_ids: list[str] - attributes: dict[str, Any] | None = None - chunking_strategy: VectorStoreChunkingStrategy | None = None - - -class VectorStoreTable(Protocol): - def get_vector_store(self, vector_store_id: str) -> VectorStore | None: ... - - -@runtime_checkable -@trace_protocol -class VectorIO(Protocol): - vector_store_table: VectorStoreTable | None = None - - # this will just block now until chunks are inserted, but it should - # probably return a Job instance which can be polled for completion - # TODO: rename vector_store_id to vector_store_id once Stainless is working - @webmethod(route="/vector-io/insert", method="POST", level=LLAMA_STACK_API_V1) - async def insert_chunks( - self, - vector_store_id: str, - chunks: list[Chunk], - ttl_seconds: int | None = None, - ) -> None: - """Insert chunks into a vector database. - - :param vector_store_id: The identifier of the vector database to insert the chunks into. - :param chunks: The chunks to insert. Each `Chunk` should contain content which can be interleaved text, images, or other types. - `metadata`: `dict[str, Any]` and `embedding`: `List[float]` are optional. - If `metadata` is provided, you configure how Llama Stack formats the chunk during generation. - If `embedding` is not provided, it will be computed later. - :param ttl_seconds: The time to live of the chunks. - """ - ... - - # TODO: rename vector_store_id to vector_store_id once Stainless is working - @webmethod(route="/vector-io/query", method="POST", level=LLAMA_STACK_API_V1) - async def query_chunks( - self, - vector_store_id: str, - query: InterleavedContent, - params: dict[str, Any] | None = None, - ) -> QueryChunksResponse: - """Query chunks from a vector database. - - :param vector_store_id: The identifier of the vector database to query. - :param query: The query to search for. - :param params: The parameters of the query. - :returns: A QueryChunksResponse. - """ - ... - - # OpenAI Vector Stores API endpoints - @webmethod(route="/vector_stores", method="POST", level=LLAMA_STACK_API_V1) - async def openai_create_vector_store( - self, - params: Annotated[OpenAICreateVectorStoreRequestWithExtraBody, Body(...)], - ) -> VectorStoreObject: - """Creates a vector store. - - Generate an OpenAI-compatible vector store with the given parameters. - :returns: A VectorStoreObject representing the created vector store. - """ - ... - - @webmethod(route="/vector_stores", method="GET", level=LLAMA_STACK_API_V1) - async def openai_list_vector_stores( - self, - limit: int | None = 20, - order: str | None = "desc", - after: str | None = None, - before: str | None = None, - ) -> VectorStoreListResponse: - """Returns a list of vector stores. - - :param limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - :param order: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - :param after: A cursor for use in pagination. `after` is an object ID that defines your place in the list. - :param before: A cursor for use in pagination. `before` is an object ID that defines your place in the list. - :returns: A VectorStoreListResponse containing the list of vector stores. - """ - ... - - @webmethod(route="/vector_stores/{vector_store_id}", method="GET", level=LLAMA_STACK_API_V1) - async def openai_retrieve_vector_store( - self, - vector_store_id: str, - ) -> VectorStoreObject: - """Retrieves a vector store. - - :param vector_store_id: The ID of the vector store to retrieve. - :returns: A VectorStoreObject representing the vector store. - """ - ... - - @webmethod( - route="/vector_stores/{vector_store_id}", - method="POST", - level=LLAMA_STACK_API_V1, - ) - async def openai_update_vector_store( - self, - vector_store_id: str, - name: str | None = None, - expires_after: dict[str, Any] | None = None, - metadata: dict[str, Any] | None = None, - ) -> VectorStoreObject: - """Updates a vector store. - - :param vector_store_id: The ID of the vector store to update. - :param name: The name of the vector store. - :param expires_after: The expiration policy for a vector store. - :param metadata: Set of 16 key-value pairs that can be attached to an object. - :returns: A VectorStoreObject representing the updated vector store. - """ - ... - - @webmethod( - route="/vector_stores/{vector_store_id}", - method="DELETE", - level=LLAMA_STACK_API_V1, - ) - async def openai_delete_vector_store( - self, - vector_store_id: str, - ) -> VectorStoreDeleteResponse: - """Delete a vector store. - - :param vector_store_id: The ID of the vector store to delete. - :returns: A VectorStoreDeleteResponse indicating the deletion status. - """ - ... - - @webmethod( - route="/vector_stores/{vector_store_id}/search", - method="POST", - level=LLAMA_STACK_API_V1, - ) - async def openai_search_vector_store( - self, - vector_store_id: str, - query: str | list[str], - filters: dict[str, Any] | None = None, - max_num_results: int | None = 10, - ranking_options: SearchRankingOptions | None = None, - rewrite_query: bool | None = False, - search_mode: ( - str | None - ) = "vector", # Using str instead of Literal due to OpenAPI schema generator limitations - ) -> VectorStoreSearchResponsePage: - """Search for chunks in a vector store. - - Searches a vector store for relevant chunks based on a query and optional file attribute filters. - - :param vector_store_id: The ID of the vector store to search. - :param query: The query string or array for performing the search. - :param filters: Filters based on file attributes to narrow the search results. - :param max_num_results: Maximum number of results to return (1 to 50 inclusive, default 10). - :param ranking_options: Ranking options for fine-tuning the search results. - :param rewrite_query: Whether to rewrite the natural language query for vector search (default false) - :param search_mode: The search mode to use - "keyword", "vector", or "hybrid" (default "vector") - :returns: A VectorStoreSearchResponse containing the search results. - """ - ... - - @webmethod( - route="/vector_stores/{vector_store_id}/files", - method="POST", - level=LLAMA_STACK_API_V1, - ) - async def openai_attach_file_to_vector_store( - self, - vector_store_id: str, - file_id: str, - attributes: dict[str, Any] | None = None, - chunking_strategy: VectorStoreChunkingStrategy | None = None, - ) -> VectorStoreFileObject: - """Attach a file to a vector store. - - :param vector_store_id: The ID of the vector store to attach the file to. - :param file_id: The ID of the file to attach to the vector store. - :param attributes: The key-value attributes stored with the file, which can be used for filtering. - :param chunking_strategy: The chunking strategy to use for the file. - :returns: A VectorStoreFileObject representing the attached file. - """ - ... - - @webmethod( - route="/vector_stores/{vector_store_id}/files", - method="GET", - level=LLAMA_STACK_API_V1, - ) - async def openai_list_files_in_vector_store( - self, - vector_store_id: str, - limit: int | None = 20, - order: str | None = "desc", - after: str | None = None, - before: str | None = None, - filter: VectorStoreFileStatus | None = None, - ) -> VectorStoreListFilesResponse: - """List files in a vector store. - - :param vector_store_id: The ID of the vector store to list files from. - :param limit: (Optional) A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - :param order: (Optional) Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - :param after: (Optional) A cursor for use in pagination. `after` is an object ID that defines your place in the list. - :param before: (Optional) A cursor for use in pagination. `before` is an object ID that defines your place in the list. - :param filter: (Optional) Filter by file status to only return files with the specified status. - :returns: A VectorStoreListFilesResponse containing the list of files. - """ - ... - - @webmethod( - route="/vector_stores/{vector_store_id}/files/{file_id}", - method="GET", - level=LLAMA_STACK_API_V1, - ) - async def openai_retrieve_vector_store_file( - self, - vector_store_id: str, - file_id: str, - ) -> VectorStoreFileObject: - """Retrieves a vector store file. - - :param vector_store_id: The ID of the vector store containing the file to retrieve. - :param file_id: The ID of the file to retrieve. - :returns: A VectorStoreFileObject representing the file. - """ - ... - - @webmethod( - route="/vector_stores/{vector_store_id}/files/{file_id}/content", - method="GET", - level=LLAMA_STACK_API_V1, - ) - async def openai_retrieve_vector_store_file_contents( - self, - vector_store_id: str, - file_id: str, - ) -> VectorStoreFileContentsResponse: - """Retrieves the contents of a vector store file. - - :param vector_store_id: The ID of the vector store containing the file to retrieve. - :param file_id: The ID of the file to retrieve. - :returns: A list of InterleavedContent representing the file contents. - """ - ... - - @webmethod( - route="/vector_stores/{vector_store_id}/files/{file_id}", - method="POST", - level=LLAMA_STACK_API_V1, - ) - async def openai_update_vector_store_file( - self, - vector_store_id: str, - file_id: str, - attributes: dict[str, Any], - ) -> VectorStoreFileObject: - """Updates a vector store file. - - :param vector_store_id: The ID of the vector store containing the file to update. - :param file_id: The ID of the file to update. - :param attributes: The updated key-value attributes to store with the file. - :returns: A VectorStoreFileObject representing the updated file. - """ - ... - - @webmethod( - route="/vector_stores/{vector_store_id}/files/{file_id}", - method="DELETE", - level=LLAMA_STACK_API_V1, - ) - async def openai_delete_vector_store_file( - self, - vector_store_id: str, - file_id: str, - ) -> VectorStoreFileDeleteResponse: - """Delete a vector store file. - - :param vector_store_id: The ID of the vector store containing the file to delete. - :param file_id: The ID of the file to delete. - :returns: A VectorStoreFileDeleteResponse indicating the deletion status. - """ - ... - - @webmethod( - route="/vector_stores/{vector_store_id}/file_batches", - method="POST", - level=LLAMA_STACK_API_V1, - ) - async def openai_create_vector_store_file_batch( - self, - vector_store_id: str, - params: Annotated[OpenAICreateVectorStoreFileBatchRequestWithExtraBody, Body(...)], - ) -> VectorStoreFileBatchObject: - """Create a vector store file batch. - - Generate an OpenAI-compatible vector store file batch for the given vector store. - :param vector_store_id: The ID of the vector store to create the file batch for. - :returns: A VectorStoreFileBatchObject representing the created file batch. - """ - ... - - @webmethod( - route="/vector_stores/{vector_store_id}/file_batches/{batch_id}", - method="GET", - level=LLAMA_STACK_API_V1, - ) - async def openai_retrieve_vector_store_file_batch( - self, - batch_id: str, - vector_store_id: str, - ) -> VectorStoreFileBatchObject: - """Retrieve a vector store file batch. - - :param batch_id: The ID of the file batch to retrieve. - :param vector_store_id: The ID of the vector store containing the file batch. - :returns: A VectorStoreFileBatchObject representing the file batch. - """ - ... - - @webmethod( - route="/vector_stores/{vector_store_id}/file_batches/{batch_id}/files", - method="GET", - level=LLAMA_STACK_API_V1, - ) - async def openai_list_files_in_vector_store_file_batch( - self, - batch_id: str, - vector_store_id: str, - after: str | None = None, - before: str | None = None, - filter: str | None = None, - limit: int | None = 20, - order: str | None = "desc", - ) -> VectorStoreFilesListInBatchResponse: - """Returns a list of vector store files in a batch. - - :param batch_id: The ID of the file batch to list files from. - :param vector_store_id: The ID of the vector store containing the file batch. - :param after: A cursor for use in pagination. `after` is an object ID that defines your place in the list. - :param before: A cursor for use in pagination. `before` is an object ID that defines your place in the list. - :param filter: Filter by file status. One of in_progress, completed, failed, cancelled. - :param limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - :param order: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - :returns: A VectorStoreFilesListInBatchResponse containing the list of files in the batch. - """ - ... - - @webmethod( - route="/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel", - method="POST", - level=LLAMA_STACK_API_V1, - ) - async def openai_cancel_vector_store_file_batch( - self, - batch_id: str, - vector_store_id: str, - ) -> VectorStoreFileBatchObject: - """Cancels a vector store file batch. - - :param batch_id: The ID of the file batch to cancel. - :param vector_store_id: The ID of the vector store containing the file batch. - :returns: A VectorStoreFileBatchObject representing the cancelled file batch. - """ - ... diff --git a/src/llama_stack/apis/vector_io/vector_io_service.py b/src/llama_stack/apis/vector_io/vector_io_service.py new file mode 100644 index 0000000000..24d709f23b --- /dev/null +++ b/src/llama_stack/apis/vector_io/vector_io_service.py @@ -0,0 +1,326 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Annotated, Any, Protocol, runtime_checkable + +from fastapi import Body + +from llama_stack.apis.inference import InterleavedContent +from llama_stack.apis.vector_stores import VectorStore +from llama_stack.core.telemetry.trace_protocol import trace_protocol + +from .models import ( + Chunk, + OpenAICreateVectorStoreFileBatchRequestWithExtraBody, + OpenAICreateVectorStoreRequestWithExtraBody, + QueryChunksResponse, + SearchRankingOptions, + VectorStoreChunkingStrategy, + VectorStoreDeleteResponse, + VectorStoreFileBatchObject, + VectorStoreFileContentsResponse, + VectorStoreFileDeleteResponse, + VectorStoreFileObject, + VectorStoreFilesListInBatchResponse, + VectorStoreFileStatus, + VectorStoreListFilesResponse, + VectorStoreListResponse, + VectorStoreObject, + VectorStoreSearchResponsePage, +) + + +class VectorStoreTable(Protocol): + def get_vector_store(self, vector_store_id: str) -> VectorStore | None: ... + + +@runtime_checkable +@trace_protocol +class VectorIOService(Protocol): + vector_store_table: VectorStoreTable | None = None + + # this will just block now until chunks are inserted, but it should + # probably return a Job instance which can be polled for completion + # TODO: rename vector_store_id to vector_store_id once Stainless is working + async def insert_chunks( + self, + vector_store_id: str, + chunks: list[Chunk], + ttl_seconds: int | None = None, + ) -> None: + """Insert chunks into a vector database. + + :param vector_store_id: The identifier of the vector database to insert the chunks into. + :param chunks: The chunks to insert. Each `Chunk` should contain content which can be interleaved text, images, or other types. + `metadata`: `dict[str, Any]` and `embedding`: `List[float]` are optional. + If `metadata` is provided, you configure how Llama Stack formats the chunk during generation. + If `embedding` is not provided, it will be computed later. + :param ttl_seconds: The time to live of the chunks. + """ + ... + + # TODO: rename vector_store_id to vector_store_id once Stainless is working + async def query_chunks( + self, + vector_store_id: str, + query: InterleavedContent, + params: dict[str, Any] | None = None, + ) -> QueryChunksResponse: + """Query chunks from a vector database. + + :param vector_store_id: The identifier of the vector database to query. + :param query: The query to search for. + :param params: The parameters of the query. + :returns: A QueryChunksResponse. + """ + ... + + # OpenAI Vector Stores API endpoints + async def openai_create_vector_store( + self, + params: Annotated[OpenAICreateVectorStoreRequestWithExtraBody, Body(...)], + ) -> VectorStoreObject: + """Creates a vector store. + + Generate an OpenAI-compatible vector store with the given parameters. + :returns: A VectorStoreObject representing the created vector store. + """ + ... + + async def openai_list_vector_stores( + self, + limit: int | None = 20, + order: str | None = "desc", + after: str | None = None, + before: str | None = None, + ) -> VectorStoreListResponse: + """Returns a list of vector stores. + + :param limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + :param order: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + :param after: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + :param before: A cursor for use in pagination. `before` is an object ID that defines your place in the list. + :returns: A VectorStoreListResponse containing the list of vector stores. + """ + ... + + async def openai_retrieve_vector_store( + self, + vector_store_id: str, + ) -> VectorStoreObject: + """Retrieves a vector store. + + :param vector_store_id: The ID of the vector store to retrieve. + :returns: A VectorStoreObject representing the vector store. + """ + ... + + async def openai_update_vector_store( + self, + vector_store_id: str, + name: str | None = None, + expires_after: dict[str, Any] | None = None, + metadata: dict[str, Any] | None = None, + ) -> VectorStoreObject: + """Updates a vector store. + + :param vector_store_id: The ID of the vector store to update. + :param name: The name of the vector store. + :param expires_after: The expiration policy for a vector store. + :param metadata: Set of 16 key-value pairs that can be attached to an object. + :returns: A VectorStoreObject representing the updated vector store. + """ + ... + + async def openai_delete_vector_store( + self, + vector_store_id: str, + ) -> VectorStoreDeleteResponse: + """Delete a vector store. + + :param vector_store_id: The ID of the vector store to delete. + :returns: A VectorStoreDeleteResponse indicating the deletion status. + """ + ... + + async def openai_search_vector_store( + self, + vector_store_id: str, + query: str | list[str], + filters: dict[str, Any] | None = None, + max_num_results: int | None = 10, + ranking_options: SearchRankingOptions | None = None, + rewrite_query: bool | None = False, + search_mode: str | None = "vector", + ) -> VectorStoreSearchResponsePage: + """Search for chunks in a vector store. + + Searches a vector store for relevant chunks based on a query and optional file attribute filters. + + :param vector_store_id: The ID of the vector store to search. + :param query: The query string or array for performing the search. + :param filters: Filters based on file attributes to narrow the search results. + :param max_num_results: Maximum number of results to return (1 to 50 inclusive, default 10). + :param ranking_options: Ranking options for fine-tuning the search results. + :param rewrite_query: Whether to rewrite the natural language query for vector search (default false) + :param search_mode: The search mode to use - "keyword", "vector", or "hybrid" (default "vector") + :returns: A VectorStoreSearchResponse containing the search results. + """ + ... + + async def openai_attach_file_to_vector_store( + self, + vector_store_id: str, + file_id: str, + attributes: dict[str, Any] | None = None, + chunking_strategy: VectorStoreChunkingStrategy | None = None, + ) -> VectorStoreFileObject: + """Attach a file to a vector store. + + :param vector_store_id: The ID of the vector store to attach the file to. + :param file_id: The ID of the file to attach to the vector store. + :param attributes: The key-value attributes stored with the file, which can be used for filtering. + :param chunking_strategy: The chunking strategy to use for the file. + :returns: A VectorStoreFileObject representing the attached file. + """ + ... + + async def openai_list_files_in_vector_store( + self, + vector_store_id: str, + limit: int | None = 20, + order: str | None = "desc", + after: str | None = None, + before: str | None = None, + filter: VectorStoreFileStatus | None = None, + ) -> VectorStoreListFilesResponse: + """List files in a vector store. + + :param vector_store_id: The ID of the vector store to list files from. + :param limit: (Optional) A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + :param order: (Optional) Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + :param after: (Optional) A cursor for use in pagination. `after` is an object ID that defines your place in the list. + :param before: (Optional) A cursor for use in pagination. `before` is an object ID that defines your place in the list. + :param filter: (Optional) Filter by file status to only return files with the specified status. + :returns: A VectorStoreListFilesResponse containing the list of files. + """ + ... + + async def openai_retrieve_vector_store_file( + self, + vector_store_id: str, + file_id: str, + ) -> VectorStoreFileObject: + """Retrieves a vector store file. + + :param vector_store_id: The ID of the vector store containing the file to retrieve. + :param file_id: The ID of the file to retrieve. + :returns: A VectorStoreFileObject representing the file. + """ + ... + + async def openai_retrieve_vector_store_file_contents( + self, + vector_store_id: str, + file_id: str, + ) -> VectorStoreFileContentsResponse: + """Retrieves the contents of a vector store file. + + :param vector_store_id: The ID of the vector store containing the file to retrieve. + :param file_id: The ID of the file to retrieve. + :returns: A list of InterleavedContent representing the file contents. + """ + ... + + async def openai_update_vector_store_file( + self, + vector_store_id: str, + file_id: str, + attributes: dict[str, Any], + ) -> VectorStoreFileObject: + """Updates a vector store file. + + :param vector_store_id: The ID of the vector store containing the file to update. + :param file_id: The ID of the file to update. + :param attributes: The updated key-value attributes to store with the file. + :returns: A VectorStoreFileObject representing the updated file. + """ + ... + + async def openai_delete_vector_store_file( + self, + vector_store_id: str, + file_id: str, + ) -> VectorStoreFileDeleteResponse: + """Delete a vector store file. + + :param vector_store_id: The ID of the vector store containing the file to delete. + :param file_id: The ID of the file to delete. + :returns: A VectorStoreFileDeleteResponse indicating the deletion status. + """ + ... + + async def openai_create_vector_store_file_batch( + self, + vector_store_id: str, + params: Annotated[OpenAICreateVectorStoreFileBatchRequestWithExtraBody, Body(...)], + ) -> VectorStoreFileBatchObject: + """Create a vector store file batch. + + Generate an OpenAI-compatible vector store file batch for the given vector store. + :param vector_store_id: The ID of the vector store to create the file batch for. + :returns: A VectorStoreFileBatchObject representing the created file batch. + """ + ... + + async def openai_retrieve_vector_store_file_batch( + self, + batch_id: str, + vector_store_id: str, + ) -> VectorStoreFileBatchObject: + """Retrieve a vector store file batch. + + :param batch_id: The ID of the file batch to retrieve. + :param vector_store_id: The ID of the vector store containing the file batch. + :returns: A VectorStoreFileBatchObject representing the file batch. + """ + ... + + async def openai_list_files_in_vector_store_file_batch( + self, + batch_id: str, + vector_store_id: str, + after: str | None = None, + before: str | None = None, + filter: str | None = None, + limit: int | None = 20, + order: str | None = "desc", + ) -> VectorStoreFilesListInBatchResponse: + """Returns a list of vector store files in a batch. + + :param batch_id: The ID of the file batch to list files from. + :param vector_store_id: The ID of the vector store containing the file batch. + :param after: A cursor for use in pagination. `after` is an object ID that defines your place in the list. + :param before: A cursor for use in pagination. `before` is an object ID that defines your place in the list. + :param filter: Filter by file status. One of in_progress, completed, failed, cancelled. + :param limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + :param order: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + :returns: A VectorStoreFilesListInBatchResponse containing the list of files in the batch. + """ + ... + + async def openai_cancel_vector_store_file_batch( + self, + batch_id: str, + vector_store_id: str, + ) -> VectorStoreFileBatchObject: + """Cancels a vector store file batch. + + :param batch_id: The ID of the file batch to cancel. + :param vector_store_id: The ID of the vector store containing the file batch. + :returns: A VectorStoreFileBatchObject representing the cancelled file batch. + """ + ... diff --git a/src/llama_stack/apis/vector_stores/__init__.py b/src/llama_stack/apis/vector_stores/__init__.py index 8fc34058a4..17183363ab 100644 --- a/src/llama_stack/apis/vector_stores/__init__.py +++ b/src/llama_stack/apis/vector_stores/__init__.py @@ -4,4 +4,6 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from .vector_stores import * +from .models import VectorStore, VectorStoreInput + +__all__ = ["VectorStore", "VectorStoreInput"] diff --git a/src/llama_stack/apis/vector_stores/models.py b/src/llama_stack/apis/vector_stores/models.py new file mode 100644 index 0000000000..c5455f9194 --- /dev/null +++ b/src/llama_stack/apis/vector_stores/models.py @@ -0,0 +1,42 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +from typing import Literal + +from pydantic import BaseModel, Field + +from llama_stack.apis.resource import Resource, ResourceType + + +# Internal resource type for storing the vector store routing and other information +class VectorStore(Resource): + """Vector database resource for storing and querying vector embeddings.""" + + type: Literal[ResourceType.vector_store] = ResourceType.vector_store + + embedding_model: str = Field(..., description="Name of the embedding model to use for vector generation") + embedding_dimension: int = Field(..., description="Dimension of the embedding vectors") + vector_store_name: str | None = Field(default=None, description="Name of the vector store") + + @property + def vector_store_id(self) -> str: + return self.identifier + + @property + def provider_vector_store_id(self) -> str | None: + return self.provider_resource_id + + +class VectorStoreInput(BaseModel): + """Input parameters for creating or configuring a vector database.""" + + vector_store_id: str = Field(..., description="Unique identifier for the vector store") + embedding_model: str = Field(..., description="Name of the embedding model to use for vector generation") + embedding_dimension: int = Field(..., description="Dimension of the embedding vectors") + provider_id: str | None = Field(default=None, description="ID of the provider that owns this vector store") + provider_vector_store_id: str | None = Field( + default=None, description="Provider-specific identifier for the vector store" + ) diff --git a/src/llama_stack/apis/vector_stores/vector_stores.py b/src/llama_stack/apis/vector_stores/vector_stores.py deleted file mode 100644 index 5246240289..0000000000 --- a/src/llama_stack/apis/vector_stores/vector_stores.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -from typing import Literal - -from pydantic import BaseModel - -from llama_stack.apis.resource import Resource, ResourceType - - -# Internal resource type for storing the vector store routing and other information -class VectorStore(Resource): - """Vector database resource for storing and querying vector embeddings. - - :param type: Type of resource, always 'vector_store' for vector stores - :param embedding_model: Name of the embedding model to use for vector generation - :param embedding_dimension: Dimension of the embedding vectors - """ - - type: Literal[ResourceType.vector_store] = ResourceType.vector_store - - embedding_model: str - embedding_dimension: int - vector_store_name: str | None = None - - @property - def vector_store_id(self) -> str: - return self.identifier - - @property - def provider_vector_store_id(self) -> str | None: - return self.provider_resource_id - - -class VectorStoreInput(BaseModel): - """Input parameters for creating or configuring a vector database. - - :param vector_store_id: Unique identifier for the vector store - :param embedding_model: Name of the embedding model to use for vector generation - :param embedding_dimension: Dimension of the embedding vectors - :param provider_vector_store_id: (Optional) Provider-specific identifier for the vector store - """ - - vector_store_id: str - embedding_model: str - embedding_dimension: int - provider_id: str | None = None - provider_vector_store_id: str | None = None diff --git a/src/llama_stack/core/conversations/conversations.py b/src/llama_stack/core/conversations/conversations.py index 951de5e9db..d4cf0c620a 100644 --- a/src/llama_stack/core/conversations/conversations.py +++ b/src/llama_stack/core/conversations/conversations.py @@ -10,7 +10,7 @@ from pydantic import BaseModel, TypeAdapter -from llama_stack.apis.conversations.conversations import ( +from llama_stack.apis.conversations import ( Conversation, ConversationDeletedResource, ConversationItem, diff --git a/src/llama_stack/core/inspect.py b/src/llama_stack/core/inspect.py index 6352af00f3..c08de35c54 100644 --- a/src/llama_stack/core/inspect.py +++ b/src/llama_stack/core/inspect.py @@ -18,8 +18,9 @@ from llama_stack.apis.version import LLAMA_STACK_API_V1 from llama_stack.core.datatypes import StackRunConfig from llama_stack.core.external import load_external_apis -from llama_stack.core.server.routes import get_all_api_routes -from llama_stack.providers.datatypes import HealthStatus +from llama_stack.core.resolver import api_protocol_map +from llama_stack.core.server.routers import create_router, has_router +from llama_stack.providers.datatypes import Api, HealthStatus class DistributionInspectConfig(BaseModel): @@ -56,36 +57,77 @@ def should_include_route(webmethod) -> bool: return not webmethod.deprecated and webmethod.level == api_filter ret = [] + + # Create a dummy impl_getter for router creation + def dummy_impl_getter(_api: Api) -> None: + return None + + # Get all APIs that should be served + external_apis = load_external_apis(run_config) - all_endpoints = get_all_api_routes(external_apis) - for api, endpoints in all_endpoints.items(): - # Always include provider and inspect APIs, filter others based on run config + protocols = api_protocol_map(external_apis) + + # Get APIs to serve + if run_config.apis: + apis_to_serve = set(run_config.apis) + else: + apis_to_serve = set(protocols.keys()) + + apis_to_serve.add("inspect") + apis_to_serve.add("providers") + apis_to_serve.add("prompts") + apis_to_serve.add("conversations") + + # Get routes from routers + for api_str in apis_to_serve: + api = Api(api_str) + + # Skip if no router registered + if not has_router(api): + continue + + # Create router to extract routes + router = create_router(api, dummy_impl_getter) + if not router: + continue + + # Extract routes from the router + provider_types: list[str] = [] if api.value in ["providers", "inspect"]: - ret.extend( - [ - RouteInfo( - route=e.path, - method=next(iter([m for m in e.methods if m != "HEAD"])), - provider_types=[], # These APIs don't have "real" providers - they're internal to the stack - ) - for e, webmethod in endpoints - if e.methods is not None and should_include_route(webmethod) - ] - ) + # These APIs don't have "real" providers + provider_types = [] else: providers = run_config.providers.get(api.value, []) - if providers: # Only process if there are providers for this API - ret.extend( - [ - RouteInfo( - route=e.path, - method=next(iter([m for m in e.methods if m != "HEAD"])), - provider_types=[p.provider_type for p in providers], - ) - for e, webmethod in endpoints - if e.methods is not None and should_include_route(webmethod) - ] + provider_types = [p.provider_type for p in providers] + + # Extract routes from router + for route in router.routes: + if not hasattr(route, "path") or not hasattr(route, "methods"): + continue + + # Filter out HEAD method + methods = [m for m in route.methods if m != "HEAD"] + if not methods: + continue + + # Get full path (prefix + path) + path = route.path + if hasattr(router, "prefix") and router.prefix: + if path.startswith("/"): + full_path = path + else: + full_path = router.prefix + "/" + path + full_path = full_path.replace("//", "/") + else: + full_path = path + + ret.append( + RouteInfo( + route=full_path, + method=methods[0], + provider_types=provider_types, ) + ) return ListRoutesResponse(data=ret) diff --git a/src/llama_stack/core/resolver.py b/src/llama_stack/core/resolver.py index 805d260fc3..ab903e88aa 100644 --- a/src/llama_stack/core/resolver.py +++ b/src/llama_stack/core/resolver.py @@ -17,7 +17,7 @@ from llama_stack.apis.datatypes import ExternalApiSpec from llama_stack.apis.eval import Eval from llama_stack.apis.files import Files -from llama_stack.apis.inference import Inference, InferenceProvider +from llama_stack.apis.inference import Inference, InferenceProvider, InferenceService from llama_stack.apis.inspect import Inspect from llama_stack.apis.models import Models from llama_stack.apis.post_training import PostTraining @@ -397,14 +397,16 @@ async def instantiate_provider( impl.__provider_spec__ = provider_spec impl.__provider_config__ = config - protocols = api_protocol_map_for_compliance_check(run_config) - additional_protocols = additional_protocols_map() - # TODO: check compliance for special tool groups - # the impl should be for Api.tool_runtime, the name should be the special tool group, the protocol should be the special tool group protocol - check_protocol_compliance(impl, protocols[provider_spec.api]) - if not isinstance(provider_spec, AutoRoutedProviderSpec) and provider_spec.api in additional_protocols: - additional_api, _, _ = additional_protocols[provider_spec.api] - check_protocol_compliance(impl, additional_api) + # Skip protocol compliance checks for routing tables - they implement RoutingTable, not the full API protocol + if not isinstance(provider_spec, RoutingTableProviderSpec): + protocols = api_protocol_map_for_compliance_check(run_config) + additional_protocols = additional_protocols_map() + # TODO: check compliance for special tool groups + # the impl should be for Api.tool_runtime, the name should be the special tool group, the protocol should be the special tool group protocol + check_protocol_compliance(impl, protocols[provider_spec.api]) + if not isinstance(provider_spec, AutoRoutedProviderSpec) and provider_spec.api in additional_protocols: + additional_api, _, _ = additional_protocols[provider_spec.api] + check_protocol_compliance(impl, additional_api) return impl @@ -412,9 +414,60 @@ async def instantiate_provider( def check_protocol_compliance(obj: Any, protocol: Any) -> None: missing_methods = [] + # Define optional methods per protocol that don't need to be implemented by providers + # These are methods that are either: + # 1. Alpha API methods (only in V1ALPHA routes) + # 2. Methods handled by routers (like inference store methods) + optional_methods = { + Inference: {"rerank", "list_chat_completions", "get_chat_completion"}, + InferenceService: {"rerank", "list_chat_completions", "get_chat_completion"}, + InferenceProvider: {"rerank", "list_chat_completions", "get_chat_completion"}, + } + + protocol_optional = optional_methods.get(protocol, set()) + + # Skip Pydantic BaseModel methods - these are not part of the protocol interface + # These methods come from BaseModel and should not be checked for compliance + pydantic_methods = { + "copy", + "dict", + "json", + "model_copy", + "model_dump", + "model_dump_json", + "model_post_init", + "model_validate", + "model_validate_json", + "parse_obj", + "parse_raw", + "schema", + "schema_json", + "construct", + "update_forward_refs", + "validate", + } + mro = type(obj).__mro__ for name, value in inspect.getmembers(protocol): - if inspect.isfunction(value) and hasattr(value, "__webmethods__"): + # Check all protocol methods, not just ones with webmethods + # Skip properties, attributes, and class variables + if not inspect.isfunction(value): + continue + + # Skip private methods (starting with _) + if name.startswith("_"): + continue + + # Skip Pydantic BaseModel methods + if name in pydantic_methods: + continue + + # Skip optional methods for this protocol + if name in protocol_optional: + continue + + # For methods that still have webmethods (unmigrated APIs), check for alpha API + if hasattr(value, "__webmethods__"): has_alpha_api = False for webmethod in value.__webmethods__: if webmethod.level == LLAMA_STACK_API_V1ALPHA: @@ -423,32 +476,37 @@ def check_protocol_compliance(obj: Any, protocol: Any) -> None: # if this API has multiple webmethods, and one of them is an alpha API, this API should be skipped when checking for missing or not callable routes if has_alpha_api: continue - if not hasattr(obj, name): - missing_methods.append((name, "missing")) - elif not callable(getattr(obj, name)): - missing_methods.append((name, "not_callable")) + + if not hasattr(obj, name): + missing_methods.append((name, "missing")) + elif not callable(getattr(obj, name)): + missing_methods.append((name, "not_callable")) + else: + # Check if the method signatures are compatible + obj_method = getattr(obj, name) + proto_sig = inspect.signature(value) + obj_sig = inspect.signature(obj_method) + + proto_params = list(proto_sig.parameters.values()) + proto_params = [p for p in proto_params if p.name != "self"] + obj_params = list(obj_sig.parameters.values()) + obj_params = [p for p in obj_params if p.name != "self"] + + # Check positional compatibility: same number of parameters + if len(proto_params) != len(obj_params): + logger.error( + f"Method {name} incompatible: proto has {len(proto_params)} params, obj has {len(obj_params)} params" + ) + missing_methods.append((name, "signature_mismatch")) else: - # Check if the method signatures are compatible - obj_method = getattr(obj, name) - proto_sig = inspect.signature(value) - obj_sig = inspect.signature(obj_method) - - proto_params = set(proto_sig.parameters) - proto_params.discard("self") - obj_params = set(obj_sig.parameters) - obj_params.discard("self") - if not (proto_params <= obj_params): - logger.error(f"Method {name} incompatible proto: {proto_params} vs. obj: {obj_params}") - missing_methods.append((name, "signature_mismatch")) - else: - # Check if the method has a concrete implementation (not just a protocol stub) - # Find all classes in MRO that define this method - method_owners = [cls for cls in mro if name in cls.__dict__] - - # Allow methods from mixins/parents, only reject if ONLY the protocol defines it - if len(method_owners) == 1 and method_owners[0].__name__ == protocol.__name__: - # Only reject if the method is ONLY defined in the protocol itself (abstract stub) - missing_methods.append((name, "not_actually_implemented")) + # Check if the method has a concrete implementation (not just a protocol stub) + # Find all classes in MRO that define this method + method_owners = [cls for cls in mro if name in cls.__dict__] + + # Allow methods from mixins/parents, only reject if ONLY the protocol defines it + if len(method_owners) == 1 and method_owners[0].__name__ == protocol.__name__: + # Only reject if the method is ONLY defined in the protocol itself (abstract stub) + missing_methods.append((name, "not_actually_implemented")) if missing_methods: raise ValueError( diff --git a/src/llama_stack/core/routers/eval_scoring.py b/src/llama_stack/core/routers/eval_scoring.py index ffca81bf0b..929b0ed564 100644 --- a/src/llama_stack/core/routers/eval_scoring.py +++ b/src/llama_stack/core/routers/eval_scoring.py @@ -6,13 +6,14 @@ from typing import Any -from llama_stack.apis.eval import BenchmarkConfig, Eval, EvaluateResponse, Job +from llama_stack.apis.common.job_types import Job +from llama_stack.apis.eval import BenchmarkConfig, Eval, EvaluateResponse from llama_stack.apis.scoring import ( ScoreBatchResponse, ScoreResponse, Scoring, - ScoringFnParams, ) +from llama_stack.apis.scoring_functions import ScoringFnParams from llama_stack.log import get_logger from llama_stack.providers.datatypes import RoutingTable diff --git a/src/llama_stack/core/routers/inference.py b/src/llama_stack/core/routers/inference.py index a4f0f44115..530bbb2dcd 100644 --- a/src/llama_stack/core/routers/inference.py +++ b/src/llama_stack/core/routers/inference.py @@ -22,6 +22,8 @@ OpenAIAssistantMessageParam, OpenAIChatCompletion, OpenAIChatCompletionChunk, + OpenAIChatCompletionContentPartImageParam, + OpenAIChatCompletionContentPartTextParam, OpenAIChatCompletionRequestWithExtraBody, OpenAIChatCompletionToolCall, OpenAIChatCompletionToolCallFunction, @@ -36,10 +38,6 @@ Order, RerankResponse, ) -from llama_stack.apis.inference.inference import ( - OpenAIChatCompletionContentPartImageParam, - OpenAIChatCompletionContentPartTextParam, -) from llama_stack.apis.models import ModelType from llama_stack.core.telemetry.telemetry import MetricEvent from llama_stack.core.telemetry.tracing import enqueue_event, get_current_span diff --git a/src/llama_stack/core/routers/safety.py b/src/llama_stack/core/routers/safety.py index 79eac8b468..3c9de40e36 100644 --- a/src/llama_stack/core/routers/safety.py +++ b/src/llama_stack/core/routers/safety.py @@ -7,8 +7,7 @@ from typing import Any from llama_stack.apis.inference import Message -from llama_stack.apis.safety import RunShieldResponse, Safety -from llama_stack.apis.safety.safety import ModerationObject +from llama_stack.apis.safety import ModerationObject, RunShieldResponse, Safety from llama_stack.apis.shields import Shield from llama_stack.core.datatypes import SafetyConfig from llama_stack.log import get_logger diff --git a/src/llama_stack/core/routing_tables/vector_stores.py b/src/llama_stack/core/routing_tables/vector_stores.py index c6c80a01e4..4d31c2635a 100644 --- a/src/llama_stack/core/routing_tables/vector_stores.py +++ b/src/llama_stack/core/routing_tables/vector_stores.py @@ -11,7 +11,7 @@ from llama_stack.apis.resource import ResourceType # Removed VectorStores import to avoid exposing public API -from llama_stack.apis.vector_io.vector_io import ( +from llama_stack.apis.vector_io import ( SearchRankingOptions, VectorStoreChunkingStrategy, VectorStoreDeleteResponse, diff --git a/src/llama_stack/core/server/auth.py b/src/llama_stack/core/server/auth.py index 8a4c8956f3..64505d5f91 100644 --- a/src/llama_stack/core/server/auth.py +++ b/src/llama_stack/core/server/auth.py @@ -7,12 +7,9 @@ import json import httpx -from aiohttp import hdrs -from llama_stack.core.datatypes import AuthenticationConfig, User -from llama_stack.core.request_headers import user_from_scope +from llama_stack.core.datatypes import AuthenticationConfig from llama_stack.core.server.auth_providers import create_auth_provider -from llama_stack.core.server.routes import find_matching_route, initialize_route_impls from llama_stack.log import get_logger logger = get_logger(name=__name__, category="core::auth") @@ -28,9 +25,8 @@ class AuthenticationMiddleware: 4. Makes these attributes available to the route handlers for access control Unauthenticated Access: - Endpoints can opt out of authentication by setting require_authentication=False - in their @webmethod decorator. This is typically used for operational endpoints - like /health and /version to support monitoring, load balancers, and observability tools. + Public endpoints (like /health and /version) are configured in the middleware + and bypass authentication. All other endpoints require authentication. The middleware supports multiple authentication providers through the AuthProvider interface: - Kubernetes: Validates tokens against the Kubernetes API server @@ -93,23 +89,24 @@ def __init__(self, app, auth_config: AuthenticationConfig, impls): async def __call__(self, scope, receive, send): if scope["type"] == "http": - # Find the route and check if authentication is required + # Check if authentication is required path = scope.get("path", "") - method = scope.get("method", hdrs.METH_GET) - if not hasattr(self, "route_impls"): - self.route_impls = initialize_route_impls(self.impls) + # Known public endpoints that don't require authentication + # These are typically operational endpoints like health checks + public_paths = ( + "/v1/health", + "/v1/inspect/version", + ) - webmethod = None - try: - _, _, _, webmethod = find_matching_route(method, path, self.route_impls) - except ValueError: - # If no matching endpoint is found, pass here to run auth anyways - pass - - # If webmethod explicitly sets require_authentication=False, allow without auth - if webmethod and webmethod.require_authentication is False: - logger.debug(f"Allowing unauthenticated access to endpoint: {path}") + # Check if this is a public endpoint + if ( + path in public_paths + or path.startswith("/docs") + or path.startswith("/redoc") + or path.startswith("/openapi.json") + ): + logger.debug(f"Allowing unauthenticated access to public endpoint: {path}") return await self.app(scope, receive, send) # Handle authentication @@ -150,15 +147,8 @@ async def __call__(self, scope, receive, send): f"Authentication successful: {validation_result.principal} with {len(validation_result.attributes)} attributes" ) - # Scope-based API access control - if webmethod and webmethod.required_scope: - user = user_from_scope(scope) - if not _has_required_scope(webmethod.required_scope, user): - return await self._send_auth_error( - send, - f"Access denied: user does not have required scope: {webmethod.required_scope}", - status=403, - ) + # Note: Scope-based API access control can be implemented at the route level + # using FastAPI dependencies if needed return await self.app(scope, receive, send) @@ -173,15 +163,3 @@ async def _send_auth_error(self, send, message, status=401): error_key = "message" if status == 401 else "detail" error_msg = json.dumps({"error": {error_key: message}}).encode() await send({"type": "http.response.body", "body": error_msg}) - - -def _has_required_scope(required_scope: str, user: User | None) -> bool: - # if no user, assume auth is not enabled - if not user: - return True - - if not user.attributes: - return False - - user_scopes = user.attributes.get("scopes", []) - return required_scope in user_scopes diff --git a/src/llama_stack/core/server/router_utils.py b/src/llama_stack/core/server/router_utils.py new file mode 100644 index 0000000000..5b72f01e6d --- /dev/null +++ b/src/llama_stack/core/server/router_utils.py @@ -0,0 +1,28 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +"""Utilities for creating FastAPI routers with standard error responses.""" + +from llama_stack.apis.datatypes import Error + +standard_responses = { + 400: { + "model": Error, + "description": "The request was invalid or malformed.", + }, + 429: { + "model": Error, + "description": "The client has sent too many requests in a given amount of time.", + }, + 500: { + "model": Error, + "description": "The server encountered an unexpected error.", + }, + "default": { + "model": Error, + "description": "An unexpected error occurred.", + }, +} diff --git a/src/llama_stack/core/server/routers.py b/src/llama_stack/core/server/routers.py new file mode 100644 index 0000000000..c6f5372024 --- /dev/null +++ b/src/llama_stack/core/server/routers.py @@ -0,0 +1,64 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + +""" +Router registry for FastAPI routers. + +This module provides a way to register FastAPI routers for APIs that have been +migrated to use explicit FastAPI routers instead of Protocol-based route discovery. +""" + +from collections.abc import Callable +from typing import TYPE_CHECKING, Any + +from fastapi import APIRouter + +if TYPE_CHECKING: + from llama_stack.apis.datatypes import Api + +# Registry of router factory functions +# Each factory function takes a callable that returns the implementation for a given API +# and returns an APIRouter +# Use string keys to avoid circular imports +_router_factories: dict[str, Callable[[Callable[[str], Any]], APIRouter]] = {} + + +def register_router(api: "Api", router_factory: Callable[[Callable[["Api"], Any]], APIRouter]) -> None: + """Register a router factory for an API. + + Args: + api: The API enum value + router_factory: A function that takes an impl_getter function and returns an APIRouter + """ + _router_factories[api.value] = router_factory # type: ignore[attr-defined] + + +def has_router(api: "Api") -> bool: + """Check if an API has a registered router. + + Args: + api: The API enum value + + Returns: + True if a router factory is registered for this API + """ + return api.value in _router_factories # type: ignore[attr-defined] + + +def create_router(api: "Api", impl_getter: Callable[["Api"], Any]) -> APIRouter | None: + """Create a router for an API if one is registered. + + Args: + api: The API enum value + impl_getter: Function that returns the implementation for a given API + + Returns: + APIRouter if registered, None otherwise + """ + api_value = api.value # type: ignore[attr-defined] + if api_value not in _router_factories: + return None + return _router_factories[api_value](impl_getter) diff --git a/src/llama_stack/core/server/server.py b/src/llama_stack/core/server/server.py index 80505c3f93..4f4369fe9e 100644 --- a/src/llama_stack/core/server/server.py +++ b/src/llama_stack/core/server/server.py @@ -6,33 +6,28 @@ import asyncio import concurrent.futures -import functools import inspect import json -import logging # allow-direct-logging import os import sys import traceback import warnings -from collections.abc import Callable from contextlib import asynccontextmanager from importlib.metadata import version as parse_version from pathlib import Path -from typing import Annotated, Any, get_origin +from typing import Any import httpx import rich.pretty import yaml -from fastapi import Body, FastAPI, HTTPException, Request, Response -from fastapi import Path as FastapiPath +from fastapi import FastAPI, HTTPException, Request from fastapi.exceptions import RequestValidationError from fastapi.middleware.cors import CORSMiddleware -from fastapi.responses import JSONResponse, StreamingResponse -from openai import BadRequestError +from fastapi.responses import JSONResponse +from openai import BadRequestError, NotFoundError from pydantic import BaseModel, ValidationError from llama_stack.apis.common.errors import ConflictError, ResourceNotFoundError -from llama_stack.apis.common.responses import PaginatedResponse from llama_stack.core.access_control.access_control import AccessDeniedError from llama_stack.core.datatypes import ( AuthenticationRequiredError, @@ -41,22 +36,15 @@ ) from llama_stack.core.distribution import builtin_automatically_routed_apis from llama_stack.core.external import load_external_apis -from llama_stack.core.request_headers import ( - PROVIDER_DATA_VAR, - request_provider_data_context, - user_from_scope, -) -from llama_stack.core.server.routes import get_all_api_routes from llama_stack.core.stack import ( Stack, cast_image_name_to_string, replace_env_vars, ) from llama_stack.core.telemetry import Telemetry -from llama_stack.core.telemetry.tracing import CURRENT_TRACE_CONTEXT, setup_logger +from llama_stack.core.telemetry.tracing import setup_logger from llama_stack.core.utils.config import redact_sensitive_fields from llama_stack.core.utils.config_resolution import Mode, resolve_config_or_distro -from llama_stack.core.utils.context import preserve_contexts_async_generator from llama_stack.log import LoggingConfig, get_logger, setup_logging from llama_stack.providers.datatypes import Api @@ -89,9 +77,15 @@ def create_sse_event(data: Any) -> str: async def global_exception_handler(request: Request, exc: Exception): - traceback.print_exception(exc) http_exc = translate_exception(exc) + # Only log full tracebacks for unexpected server errors (5xx), not expected client/provider errors + if http_exc.status_code >= 500: + traceback.print_exception(exc) + elif http_exc.status_code >= 400: + # Log expected errors at debug level without full traceback + logger.debug(f"Client error {http_exc.status_code}: {http_exc.detail}") + return JSONResponse(status_code=http_exc.status_code, content={"error": {"detail": http_exc.detail}}) @@ -121,6 +115,8 @@ def translate_exception(exc: Exception) -> HTTPException | RequestValidationErro return HTTPException(status_code=httpx.codes.BAD_REQUEST, detail=f"Invalid value: {str(exc)}") elif isinstance(exc, BadRequestError): return HTTPException(status_code=httpx.codes.BAD_REQUEST, detail=str(exc)) + elif isinstance(exc, NotFoundError): + return HTTPException(status_code=httpx.codes.NOT_FOUND, detail=str(exc)) elif isinstance(exc, PermissionError | AccessDeniedError): return HTTPException(status_code=httpx.codes.FORBIDDEN, detail=f"Permission denied: {str(exc)}") elif isinstance(exc, ConnectionError | httpx.ConnectError): @@ -177,21 +173,6 @@ async def lifespan(app: StackApp): await app.stack.shutdown() -def is_streaming_request(func_name: str, request: Request, **kwargs): - # TODO: pass the api method and punt it to the Protocol definition directly - # If there's a stream parameter at top level, use it - if "stream" in kwargs: - return kwargs["stream"] - - # If there's a stream parameter inside a "params" parameter, e.g. openai_chat_completion() use it - if "params" in kwargs: - params = kwargs["params"] - if hasattr(params, "stream"): - return params.stream - - return False - - async def maybe_await(value): if inspect.iscoroutine(value): return await value @@ -236,90 +217,6 @@ async def log_request_pre_validation(request: Request): logger.warning(f"Could not read or log request body for {request.method} {request.url.path}: {e}") -def create_dynamic_typed_route(func: Any, method: str, route: str) -> Callable: - @functools.wraps(func) - async def route_handler(request: Request, **kwargs): - # Get auth attributes from the request scope - user = user_from_scope(request.scope) - - await log_request_pre_validation(request) - - test_context_token = None - test_context_var = None - reset_test_context_fn = None - - # Use context manager with both provider data and auth attributes - with request_provider_data_context(request.headers, user): - if os.environ.get("LLAMA_STACK_TEST_INFERENCE_MODE"): - from llama_stack.core.testing_context import ( - TEST_CONTEXT, - reset_test_context, - sync_test_context_from_provider_data, - ) - - test_context_token = sync_test_context_from_provider_data() - test_context_var = TEST_CONTEXT - reset_test_context_fn = reset_test_context - - is_streaming = is_streaming_request(func.__name__, request, **kwargs) - - try: - if is_streaming: - context_vars = [CURRENT_TRACE_CONTEXT, PROVIDER_DATA_VAR] - if test_context_var is not None: - context_vars.append(test_context_var) - gen = preserve_contexts_async_generator(sse_generator(func(**kwargs)), context_vars) - return StreamingResponse(gen, media_type="text/event-stream") - else: - value = func(**kwargs) - result = await maybe_await(value) - if isinstance(result, PaginatedResponse) and result.url is None: - result.url = route - - if method.upper() == "DELETE" and result is None: - return Response(status_code=httpx.codes.NO_CONTENT) - - return result - except Exception as e: - if logger.isEnabledFor(logging.INFO): - logger.exception(f"Error executing endpoint {route=} {method=}") - else: - logger.error(f"Error executing endpoint {route=} {method=}: {str(e)}") - raise translate_exception(e) from e - finally: - if test_context_token is not None and reset_test_context_fn is not None: - reset_test_context_fn(test_context_token) - - sig = inspect.signature(func) - - new_params = [inspect.Parameter("request", inspect.Parameter.POSITIONAL_OR_KEYWORD, annotation=Request)] - new_params.extend(sig.parameters.values()) - - path_params = extract_path_params(route) - if method == "post": - # Annotate parameters that are in the path with Path(...) and others with Body(...), - # but preserve existing File() and Form() annotations for multipart form data - new_params = ( - [new_params[0]] - + [ - ( - param.replace(annotation=Annotated[param.annotation, FastapiPath(..., title=param.name)]) - if param.name in path_params - else ( - param # Keep original annotation if it's already an Annotated type - if get_origin(param.annotation) is Annotated - else param.replace(annotation=Annotated[param.annotation, Body(..., embed=True)]) - ) - ) - for param in new_params[1:] - ] - ) - - route_handler.__signature__ = sig.replace(parameters=new_params) - - return route_handler - - class ClientVersionMiddleware: def __init__(self, app): self.app = app @@ -448,7 +345,30 @@ def create_app() -> StackApp: # Load external APIs if configured external_apis = load_external_apis(config) - all_routes = get_all_api_routes(external_apis) + + # Import API modules to ensure routers are registered (they register on import) + # External APIs must also register their routers via register_router() in their module + from llama_stack.apis import ( # noqa: F401 + batches, + benchmarks, + conversations, + datasetio, + datasets, + eval, + files, + inspect, + models, + prompts, + providers, + safety, + scoring, + scoring_functions, + shields, + tools, + ) + + # Import router registry to ensure routers are registered + from llama_stack.core.server.routers import create_router, has_router if config.apis: apis_to_serve = set(config.apis) @@ -465,37 +385,29 @@ def create_app() -> StackApp: apis_to_serve.add("providers") apis_to_serve.add("prompts") apis_to_serve.add("conversations") + + # Store impls in app state for dependency injection + app.state.impls = impls + + # Create impl_getter function for routers + def impl_getter(api: Api) -> Any: + return impls[api] + + # Register routers for all APIs (including external APIs that must register routers) for api_str in apis_to_serve: api = Api(api_str) - - routes = all_routes[api] - try: - impl = impls[api] - except KeyError as e: - raise ValueError(f"Could not find provider implementation for {api} API") from e - - for route, _ in routes: - if not hasattr(impl, route.name): - # ideally this should be a typing violation already - raise ValueError(f"Could not find method {route.name} on {impl}!") - - impl_method = getattr(impl, route.name) - # Filter out HEAD method since it's automatically handled by FastAPI for GET routes - available_methods = [m for m in route.methods if m != "HEAD"] - if not available_methods: - raise ValueError(f"No methods found for {route.name} on {impl}") - method = available_methods[0] - logger.debug(f"{method} {route.path}") - - with warnings.catch_warnings(): - warnings.filterwarnings("ignore", category=UserWarning, module="pydantic._internal._fields") - getattr(app, method.lower())(route.path, response_model=None)( - create_dynamic_typed_route( - impl_method, - method.lower(), - route.path, - ) - ) + if has_router(api): + router = create_router(api, impl_getter) + if router: + app.include_router(router) + logger.debug(f"Registered router for {api} API") + else: + # All APIs must now use routers - this is a breaking change for external APIs + logger.warning( + f"API '{api.value}' does not have a registered router. " + f"External APIs must register a router using register_router() in their module. " + f"Skipping this API." + ) logger.debug(f"serving APIs: {apis_to_serve}") @@ -516,14 +428,6 @@ def _log_run_config(run_config: StackRunConfig): logger.info(yaml.dump(clean_config, indent=2)) -def extract_path_params(route: str) -> list[str]: - segments = route.split("/") - params = [seg[1:-1] for seg in segments if seg.startswith("{") and seg.endswith("}")] - # to handle path params like {param:path} - params = [param.split(":")[0] for param in params] - return params - - def remove_disabled_providers(obj): if isinstance(obj, dict): keys = ["provider_id", "shield_id", "provider_model_id", "model_id"] diff --git a/src/llama_stack/core/server/tracing.py b/src/llama_stack/core/server/tracing.py index c4901d9b12..9c4480bcfa 100644 --- a/src/llama_stack/core/server/tracing.py +++ b/src/llama_stack/core/server/tracing.py @@ -3,10 +3,8 @@ # # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from aiohttp import hdrs +from typing import Any -from llama_stack.core.external import ExternalApiSpec -from llama_stack.core.server.routes import find_matching_route, initialize_route_impls from llama_stack.core.telemetry.tracing import end_trace, start_trace from llama_stack.log import get_logger @@ -14,7 +12,7 @@ class TracingMiddleware: - def __init__(self, app, impls, external_apis: dict[str, ExternalApiSpec]): + def __init__(self, app, impls, external_apis: dict[str, Any]): self.app = app self.impls = impls self.external_apis = external_apis @@ -33,26 +31,6 @@ async def __call__(self, scope, receive, send): logger.debug(f"Bypassing custom routing for FastAPI built-in path: {path}") return await self.app(scope, receive, send) - if not hasattr(self, "route_impls"): - self.route_impls = initialize_route_impls(self.impls, self.external_apis) - - try: - _, _, route_path, webmethod = find_matching_route( - scope.get("method", hdrs.METH_GET), path, self.route_impls - ) - except ValueError: - # If no matching endpoint is found, pass through to FastAPI - logger.debug(f"No matching route found for path: {path}, falling back to FastAPI") - return await self.app(scope, receive, send) - - # Log deprecation warning if route is deprecated - if getattr(webmethod, "deprecated", False): - logger.warning( - f"DEPRECATED ROUTE USED: {scope.get('method', 'GET')} {path} - " - f"This route is deprecated and may be removed in a future version. " - f"Please check the docs for the supported version." - ) - trace_attributes = {"__location__": "server", "raw_path": path} # Extract W3C trace context headers and store as trace attributes @@ -64,8 +42,8 @@ async def __call__(self, scope, receive, send): if tracestate: trace_attributes["tracestate"] = tracestate - trace_path = webmethod.descriptive_name or route_path - trace_context = await start_trace(trace_path, trace_attributes) + # Use path as trace name (FastAPI will handle routing) + trace_context = await start_trace(path, trace_attributes) async def send_with_trace_id(message): if message["type"] == "http.response.start": diff --git a/src/llama_stack/providers/inline/agents/meta_reference/agents.py b/src/llama_stack/providers/inline/agents/meta_reference/agents.py index 85c6cb2513..dec214acf9 100644 --- a/src/llama_stack/providers/inline/agents/meta_reference/agents.py +++ b/src/llama_stack/providers/inline/agents/meta_reference/agents.py @@ -25,13 +25,13 @@ OpenAIResponseInput, OpenAIResponseInputTool, OpenAIResponseObject, - Order, + OpenAIResponsePrompt, + OpenAIResponseText, + ResponseGuardrail, Session, Turn, ) -from llama_stack.apis.agents.agents import ResponseGuardrail -from llama_stack.apis.agents.openai_responses import OpenAIResponsePrompt, OpenAIResponseText -from llama_stack.apis.common.responses import PaginatedResponse +from llama_stack.apis.common.responses import Order, PaginatedResponse from llama_stack.apis.conversations import Conversations from llama_stack.apis.inference import ( Inference, diff --git a/src/llama_stack/providers/inline/agents/meta_reference/responses/openai_responses.py b/src/llama_stack/providers/inline/agents/meta_reference/responses/openai_responses.py index 933cfe963a..9025f918d6 100644 --- a/src/llama_stack/providers/inline/agents/meta_reference/responses/openai_responses.py +++ b/src/llama_stack/providers/inline/agents/meta_reference/responses/openai_responses.py @@ -10,8 +10,7 @@ from pydantic import BaseModel, TypeAdapter -from llama_stack.apis.agents import Order -from llama_stack.apis.agents.agents import ResponseGuardrailSpec +from llama_stack.apis.agents import ResponseGuardrailSpec from llama_stack.apis.agents.openai_responses import ( ListOpenAIResponseInputItem, ListOpenAIResponseObject, @@ -29,8 +28,8 @@ from llama_stack.apis.common.errors import ( InvalidConversationIdError, ) -from llama_stack.apis.conversations import Conversations -from llama_stack.apis.conversations.conversations import ConversationItem +from llama_stack.apis.common.responses import Order +from llama_stack.apis.conversations import ConversationItem, Conversations from llama_stack.apis.inference import ( Inference, OpenAIMessageParam, diff --git a/src/llama_stack/providers/inline/agents/meta_reference/responses/utils.py b/src/llama_stack/providers/inline/agents/meta_reference/responses/utils.py index 26af1d5958..eb62f9c517 100644 --- a/src/llama_stack/providers/inline/agents/meta_reference/responses/utils.py +++ b/src/llama_stack/providers/inline/agents/meta_reference/responses/utils.py @@ -9,7 +9,7 @@ import uuid from collections.abc import Sequence -from llama_stack.apis.agents.agents import ResponseGuardrailSpec +from llama_stack.apis.agents import ResponseGuardrailSpec from llama_stack.apis.agents.openai_responses import ( OpenAIResponseAnnotationFileCitation, OpenAIResponseInput, diff --git a/src/llama_stack/providers/inline/eval/meta_reference/eval.py b/src/llama_stack/providers/inline/eval/meta_reference/eval.py index 3c1e2e4622..a23f34d57b 100644 --- a/src/llama_stack/providers/inline/eval/meta_reference/eval.py +++ b/src/llama_stack/providers/inline/eval/meta_reference/eval.py @@ -29,7 +29,7 @@ from llama_stack.providers.utils.kvstore import kvstore_impl from .....apis.common.job_types import Job, JobStatus -from .....apis.eval.eval import BenchmarkConfig, Eval, EvaluateResponse +from .....apis.eval import BenchmarkConfig, Eval, EvaluateResponse from .config import MetaReferenceEvalConfig EVAL_TASKS_PREFIX = "benchmarks:" diff --git a/src/llama_stack/providers/inline/inference/meta_reference/inference.py b/src/llama_stack/providers/inline/inference/meta_reference/inference.py index 286335a7dd..52d524d0c5 100644 --- a/src/llama_stack/providers/inline/inference/meta_reference/inference.py +++ b/src/llama_stack/providers/inline/inference/meta_reference/inference.py @@ -9,13 +9,11 @@ from llama_stack.apis.inference import ( InferenceProvider, - OpenAIChatCompletionRequestWithExtraBody, - OpenAICompletionRequestWithExtraBody, -) -from llama_stack.apis.inference.inference import ( OpenAIChatCompletion, OpenAIChatCompletionChunk, + OpenAIChatCompletionRequestWithExtraBody, OpenAICompletion, + OpenAICompletionRequestWithExtraBody, ) from llama_stack.apis.models import Model, ModelType from llama_stack.log import get_logger diff --git a/src/llama_stack/providers/inline/inference/sentence_transformers/sentence_transformers.py b/src/llama_stack/providers/inline/inference/sentence_transformers/sentence_transformers.py index cb72aa13aa..25e257819d 100644 --- a/src/llama_stack/providers/inline/inference/sentence_transformers/sentence_transformers.py +++ b/src/llama_stack/providers/inline/inference/sentence_transformers/sentence_transformers.py @@ -8,13 +8,11 @@ from llama_stack.apis.inference import ( InferenceProvider, - OpenAIChatCompletionRequestWithExtraBody, - OpenAICompletionRequestWithExtraBody, -) -from llama_stack.apis.inference.inference import ( OpenAIChatCompletion, OpenAIChatCompletionChunk, + OpenAIChatCompletionRequestWithExtraBody, OpenAICompletion, + OpenAICompletionRequestWithExtraBody, ) from llama_stack.apis.models import ModelType from llama_stack.log import get_logger diff --git a/src/llama_stack/providers/inline/safety/code_scanner/code_scanner.py b/src/llama_stack/providers/inline/safety/code_scanner/code_scanner.py index 7da9ea0d72..09a4420cc9 100644 --- a/src/llama_stack/providers/inline/safety/code_scanner/code_scanner.py +++ b/src/llama_stack/providers/inline/safety/code_scanner/code_scanner.py @@ -12,12 +12,13 @@ from llama_stack.apis.inference import OpenAIMessageParam from llama_stack.apis.safety import ( + ModerationObject, + ModerationObjectResults, RunShieldResponse, Safety, SafetyViolation, ViolationLevel, ) -from llama_stack.apis.safety.safety import ModerationObject, ModerationObjectResults from llama_stack.apis.shields import Shield from llama_stack.log import get_logger from llama_stack.providers.utils.inference.prompt_adapter import ( @@ -50,6 +51,9 @@ async def register_shield(self, shield: Shield) -> None: f"Unsupported Code Scanner ID: {shield.provider_resource_id}. Allowed IDs: {ALLOWED_CODE_SCANNER_MODEL_IDS}" ) + async def unregister_shield(self, identifier: str) -> None: + pass + async def run_shield( self, shield_id: str, diff --git a/src/llama_stack/providers/inline/safety/llama_guard/llama_guard.py b/src/llama_stack/providers/inline/safety/llama_guard/llama_guard.py index 6f6346e820..1869ddb618 100644 --- a/src/llama_stack/providers/inline/safety/llama_guard/llama_guard.py +++ b/src/llama_stack/providers/inline/safety/llama_guard/llama_guard.py @@ -17,12 +17,13 @@ OpenAIUserMessageParam, ) from llama_stack.apis.safety import ( + ModerationObject, + ModerationObjectResults, RunShieldResponse, Safety, SafetyViolation, ViolationLevel, ) -from llama_stack.apis.safety.safety import ModerationObject, ModerationObjectResults from llama_stack.apis.shields import Shield from llama_stack.core.datatypes import Api from llama_stack.log import get_logger diff --git a/src/llama_stack/providers/inline/safety/prompt_guard/prompt_guard.py b/src/llama_stack/providers/inline/safety/prompt_guard/prompt_guard.py index 2015e11509..801d012dad 100644 --- a/src/llama_stack/providers/inline/safety/prompt_guard/prompt_guard.py +++ b/src/llama_stack/providers/inline/safety/prompt_guard/prompt_guard.py @@ -11,13 +11,13 @@ from llama_stack.apis.inference import OpenAIMessageParam from llama_stack.apis.safety import ( + ModerationObject, RunShieldResponse, Safety, SafetyViolation, ShieldStore, ViolationLevel, ) -from llama_stack.apis.safety.safety import ModerationObject from llama_stack.apis.shields import Shield from llama_stack.core.utils.model_utils import model_local_dir from llama_stack.log import get_logger diff --git a/src/llama_stack/providers/registry/synthetic_data_generation.py b/src/llama_stack/providers/registry/synthetic_data_generation.py new file mode 100644 index 0000000000..b13cc1222b --- /dev/null +++ b/src/llama_stack/providers/registry/synthetic_data_generation.py @@ -0,0 +1,13 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + + +from llama_stack.providers.datatypes import ProviderSpec + + +def available_providers() -> list[ProviderSpec]: + """Return available providers for synthetic data generation API.""" + return [] diff --git a/src/llama_stack/providers/remote/inference/bedrock/bedrock.py b/src/llama_stack/providers/remote/inference/bedrock/bedrock.py index d266f9e6f7..e259e71ab3 100644 --- a/src/llama_stack/providers/remote/inference/bedrock/bedrock.py +++ b/src/llama_stack/providers/remote/inference/bedrock/bedrock.py @@ -12,16 +12,14 @@ from llama_stack.apis.inference import ( ChatCompletionRequest, Inference, + OpenAIChatCompletion, + OpenAIChatCompletionChunk, OpenAIChatCompletionRequestWithExtraBody, + OpenAICompletion, OpenAICompletionRequestWithExtraBody, OpenAIEmbeddingsRequestWithExtraBody, OpenAIEmbeddingsResponse, ) -from llama_stack.apis.inference.inference import ( - OpenAIChatCompletion, - OpenAIChatCompletionChunk, - OpenAICompletion, -) from llama_stack.providers.remote.inference.bedrock.config import BedrockConfig from llama_stack.providers.utils.bedrock.client import create_bedrock_client from llama_stack.providers.utils.inference.model_registry import ( diff --git a/src/llama_stack/providers/remote/inference/llama_openai_compat/llama.py b/src/llama_stack/providers/remote/inference/llama_openai_compat/llama.py index 05d6e8cc84..27d50590eb 100644 --- a/src/llama_stack/providers/remote/inference/llama_openai_compat/llama.py +++ b/src/llama_stack/providers/remote/inference/llama_openai_compat/llama.py @@ -4,7 +4,7 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from llama_stack.apis.inference.inference import ( +from llama_stack.apis.inference import ( OpenAICompletion, OpenAICompletionRequestWithExtraBody, OpenAIEmbeddingsRequestWithExtraBody, diff --git a/src/llama_stack/providers/remote/inference/nvidia/nvidia.py b/src/llama_stack/providers/remote/inference/nvidia/nvidia.py index bc5aa79531..7d7a0acb53 100644 --- a/src/llama_stack/providers/remote/inference/nvidia/nvidia.py +++ b/src/llama_stack/providers/remote/inference/nvidia/nvidia.py @@ -10,12 +10,10 @@ import aiohttp from llama_stack.apis.inference import ( - RerankData, - RerankResponse, -) -from llama_stack.apis.inference.inference import ( OpenAIChatCompletionContentPartImageParam, OpenAIChatCompletionContentPartTextParam, + RerankData, + RerankResponse, ) from llama_stack.apis.models import Model, ModelType from llama_stack.log import get_logger diff --git a/src/llama_stack/providers/remote/inference/together/together.py b/src/llama_stack/providers/remote/inference/together/together.py index 963b384a03..d159ca755e 100644 --- a/src/llama_stack/providers/remote/inference/together/together.py +++ b/src/llama_stack/providers/remote/inference/together/together.py @@ -14,8 +14,8 @@ from llama_stack.apis.inference import ( OpenAIEmbeddingsRequestWithExtraBody, OpenAIEmbeddingsResponse, + OpenAIEmbeddingUsage, ) -from llama_stack.apis.inference.inference import OpenAIEmbeddingUsage from llama_stack.apis.models import Model from llama_stack.core.request_headers import NeedsRequestProviderData from llama_stack.log import get_logger diff --git a/src/llama_stack/providers/remote/inference/watsonx/watsonx.py b/src/llama_stack/providers/remote/inference/watsonx/watsonx.py index b31f1f5e81..85561e9e2f 100644 --- a/src/llama_stack/providers/remote/inference/watsonx/watsonx.py +++ b/src/llama_stack/providers/remote/inference/watsonx/watsonx.py @@ -10,7 +10,7 @@ import litellm import requests -from llama_stack.apis.inference.inference import ( +from llama_stack.apis.inference import ( OpenAIChatCompletion, OpenAIChatCompletionChunk, OpenAIChatCompletionRequestWithExtraBody, diff --git a/src/llama_stack/providers/utils/inference/openai_mixin.py b/src/llama_stack/providers/utils/inference/openai_mixin.py index 09059da099..3c6377802c 100644 --- a/src/llama_stack/providers/utils/inference/openai_mixin.py +++ b/src/llama_stack/providers/utils/inference/openai_mixin.py @@ -14,7 +14,6 @@ from pydantic import BaseModel, ConfigDict from llama_stack.apis.inference import ( - Model, OpenAIChatCompletion, OpenAIChatCompletionChunk, OpenAIChatCompletionRequestWithExtraBody, @@ -26,7 +25,7 @@ OpenAIEmbeddingUsage, OpenAIMessageParam, ) -from llama_stack.apis.models import ModelType +from llama_stack.apis.models import Model, ModelType from llama_stack.core.request_headers import NeedsRequestProviderData from llama_stack.log import get_logger from llama_stack.providers.utils.inference.model_registry import RemoteInferenceProviderConfig diff --git a/src/llama_stack/providers/utils/responses/responses_store.py b/src/llama_stack/providers/utils/responses/responses_store.py index 40466d00c4..e2553929e6 100644 --- a/src/llama_stack/providers/utils/responses/responses_store.py +++ b/src/llama_stack/providers/utils/responses/responses_store.py @@ -6,9 +6,6 @@ import asyncio from typing import Any -from llama_stack.apis.agents import ( - Order, -) from llama_stack.apis.agents.openai_responses import ( ListOpenAIResponseInputItem, ListOpenAIResponseObject, @@ -17,6 +14,7 @@ OpenAIResponseObject, OpenAIResponseObjectWithInput, ) +from llama_stack.apis.common.responses import Order from llama_stack.apis.inference import OpenAIMessageParam from llama_stack.core.datatypes import AccessRule from llama_stack.core.storage.datatypes import ResponsesStoreReference, SqlStoreReference, StorageBackendType diff --git a/src/llama_stack/providers/utils/scoring/base_scoring_fn.py b/src/llama_stack/providers/utils/scoring/base_scoring_fn.py index 2fae177b77..f193e7ea56 100644 --- a/src/llama_stack/providers/utils/scoring/base_scoring_fn.py +++ b/src/llama_stack/providers/utils/scoring/base_scoring_fn.py @@ -6,8 +6,8 @@ from abc import ABC, abstractmethod from typing import Any -from llama_stack.apis.scoring import ScoringFnParams, ScoringResultRow -from llama_stack.apis.scoring_functions import ScoringFn +from llama_stack.apis.scoring import ScoringResultRow +from llama_stack.apis.scoring_functions import ScoringFn, ScoringFnParams from llama_stack.providers.utils.scoring.aggregation_utils import aggregate_metrics diff --git a/tests/integration/inference/test_provider_data_routing.py b/tests/integration/inference/test_provider_data_routing.py index 34ee2672fb..1f04ed3635 100644 --- a/tests/integration/inference/test_provider_data_routing.py +++ b/tests/integration/inference/test_provider_data_routing.py @@ -18,7 +18,7 @@ from llama_stack import LlamaStackAsLibraryClient from llama_stack.apis.datatypes import Api -from llama_stack.apis.inference.inference import ( +from llama_stack.apis.inference import ( OpenAIAssistantMessageParam, OpenAIChatCompletion, OpenAIChatCompletionUsage, From 1f388377b2f6e9ec034f29bbeff0d76770a2bd54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Tue, 4 Nov 2025 18:09:38 +0100 Subject: [PATCH 6/6] need to fix default: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sébastien Han --- docs/static/deprecated-llama-stack-spec.yaml | 598 +------------------ scripts/fastapi_generator.py | 108 +++- 2 files changed, 95 insertions(+), 611 deletions(-) diff --git a/docs/static/deprecated-llama-stack-spec.yaml b/docs/static/deprecated-llama-stack-spec.yaml index 964cfe0656..0b5e4e32d9 100644 --- a/docs/static/deprecated-llama-stack-spec.yaml +++ b/docs/static/deprecated-llama-stack-spec.yaml @@ -3715,7 +3715,6 @@ components: bnf: additionalProperties: true type: object - minProperties: 1 title: Bnf type: object required: @@ -3939,7 +3938,6 @@ components: json_schema: additionalProperties: true type: object - minProperties: 1 title: Json Schema type: object required: @@ -8260,13 +8258,11 @@ components: max_tokens: anyOf: - type: integer - minimum: 0.0 - type: 'null' title: Max Tokens repetition_penalty: anyOf: - type: number - minimum: 0.0 - type: 'null' title: Repetition Penalty default: 1.0 @@ -8275,7 +8271,6 @@ components: - items: type: string type: array - minItems: 1 - type: 'null' title: Stop type: object @@ -9065,7 +9060,6 @@ components: properties: call_id: type: string - minLength: 1 title: Call Id tool_name: anyOf: @@ -9111,7 +9105,6 @@ components: properties: call_id: type: string - minLength: 1 title: Call Id tool_name: anyOf: @@ -10118,7 +10111,6 @@ components: type: string bnf: additionalProperties: true - minProperties: 1 title: Bnf type: object required: @@ -10145,7 +10137,6 @@ components: type: string json_schema: additionalProperties: true - minProperties: 1 title: Json Schema type: object required: @@ -10169,15 +10160,12 @@ components: title: Strategy max_tokens: anyOf: - - minimum: 0 - type: integer + - type: integer - type: 'null' - default: title: Max Tokens repetition_penalty: anyOf: - - minimum: 0.0 - type: number + - type: number - type: 'null' default: 1.0 title: Repetition Penalty @@ -10185,10 +10173,8 @@ components: anyOf: - items: type: string - minItems: 1 type: array - type: 'null' - default: title: Stop title: SamplingParams type: object @@ -10221,7 +10207,6 @@ components: anyOf: - $ref: '#/components/schemas/ToolPromptFormat' - type: 'null' - default: system_message_behavior: anyOf: - $ref: '#/components/schemas/SystemMessageBehavior' @@ -10236,7 +10221,6 @@ components: anyOf: - type: string - type: 'null' - default: description: ID of the tool group this tool belongs to title: Toolgroup Id name: @@ -10247,7 +10231,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Human-readable description of what the tool does title: Description input_schema: @@ -10255,7 +10238,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: description: JSON Schema for tool inputs (MCP inputSchema) title: Input Schema output_schema: @@ -10263,7 +10245,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: description: JSON Schema for tool outputs (MCP outputSchema) title: Output Schema metadata: @@ -10271,7 +10252,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: description: Additional metadata about the tool title: Metadata required: @@ -10366,19 +10346,16 @@ components: anyOf: - $ref: '#/components/schemas/ToolChoice' - type: 'null' - default: deprecated: true tool_prompt_format: anyOf: - $ref: '#/components/schemas/ToolPromptFormat' - type: 'null' - default: deprecated: true tool_config: anyOf: - $ref: '#/components/schemas/ToolConfig' - type: 'null' - default: max_infer_iters: anyOf: - type: integer @@ -10397,7 +10374,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Optional name for the agent, used in telemetry and identification title: Name enable_session_persistence: @@ -10418,7 +10394,6 @@ components: - $ref: '#/components/schemas/JsonSchemaResponseFormat' - $ref: '#/components/schemas/GrammarResponseFormat' - type: 'null' - default: description: Optional response format configuration title: Response Format required: @@ -10711,7 +10686,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -10719,7 +10693,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -10752,7 +10725,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -10760,7 +10732,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -10812,7 +10783,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Message to convey to the user about the violation. title: User Message metadata: @@ -10840,7 +10810,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -10848,7 +10817,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -10860,7 +10828,6 @@ components: anyOf: - $ref: '#/components/schemas/SafetyViolation' - type: 'null' - default: description: The violation from the shield call. required: - turn_id @@ -10977,7 +10944,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -10985,7 +10951,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -11016,7 +10981,6 @@ components: description: Response from a tool invocation. properties: call_id: - minLength: 1 title: Call Id type: string tool_name: @@ -11051,7 +11015,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: title: Metadata required: - call_id @@ -11154,7 +11117,6 @@ components: - format: date-time type: string - type: 'null' - default: description: Timestamp when the turn finished, if completed title: Completed At required: @@ -11228,7 +11190,6 @@ components: - $ref: '#/components/schemas/TextContentItem' type: array - type: 'null' - default: title: Context required: - content @@ -11249,13 +11210,11 @@ components: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: data: anyOf: - type: string - type: 'null' contentEncoding: base64 - default: title: Data title: _URLOrData type: object @@ -11368,7 +11327,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -11376,7 +11334,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -11409,7 +11366,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -11417,7 +11373,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -11469,7 +11424,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Message to convey to the user about the violation. title: User Message metadata: @@ -11497,7 +11451,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -11505,7 +11458,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -11517,7 +11469,6 @@ components: anyOf: - $ref: '#/components/schemas/SafetyViolation' - type: 'null' - default: description: The violation from the shield call. required: - turn_id @@ -11590,7 +11541,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -11598,7 +11548,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -11629,7 +11578,6 @@ components: description: Response from a tool invocation. properties: call_id: - minLength: 1 title: Call Id type: string tool_name: @@ -11664,7 +11612,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: title: Metadata required: - call_id @@ -11697,13 +11644,11 @@ components: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: data: anyOf: - type: string - type: 'null' contentEncoding: base64 - default: title: Data title: _URLOrData type: object @@ -12224,7 +12169,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -12232,7 +12176,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -12265,7 +12208,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -12273,7 +12215,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -12325,7 +12266,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Message to convey to the user about the violation. title: User Message metadata: @@ -12353,7 +12293,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -12361,7 +12300,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -12373,7 +12311,6 @@ components: anyOf: - $ref: '#/components/schemas/SafetyViolation' - type: 'null' - default: description: The violation from the shield call. required: - turn_id @@ -12490,7 +12427,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -12498,7 +12434,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -12529,7 +12464,6 @@ components: description: Response from a tool invocation. properties: call_id: - minLength: 1 title: Call Id type: string tool_name: @@ -12564,7 +12498,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: title: Metadata required: - call_id @@ -12667,7 +12600,6 @@ components: - format: date-time type: string - type: 'null' - default: description: Timestamp when the turn finished, if completed title: Completed At required: @@ -12741,7 +12673,6 @@ components: - $ref: '#/components/schemas/TextContentItem' type: array - type: 'null' - default: title: Context required: - content @@ -12762,13 +12693,11 @@ components: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: data: anyOf: - type: string - type: 'null' contentEncoding: base64 - default: title: Data title: _URLOrData type: object @@ -12901,7 +12830,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -12909,7 +12837,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -12942,7 +12869,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -12950,7 +12876,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -13002,7 +12927,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Message to convey to the user about the violation. title: User Message metadata: @@ -13030,7 +12954,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -13038,7 +12961,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -13050,7 +12972,6 @@ components: anyOf: - $ref: '#/components/schemas/SafetyViolation' - type: 'null' - default: description: The violation from the shield call. required: - turn_id @@ -13114,7 +13035,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -13122,7 +13042,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -13153,7 +13072,6 @@ components: description: Response from a tool invocation. properties: call_id: - minLength: 1 title: Call Id type: string tool_name: @@ -13188,7 +13106,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: title: Metadata required: - call_id @@ -13291,7 +13208,6 @@ components: - format: date-time type: string - type: 'null' - default: description: Timestamp when the turn finished, if completed title: Completed At required: @@ -13365,7 +13281,6 @@ components: - $ref: '#/components/schemas/TextContentItem' type: array - type: 'null' - default: title: Context required: - content @@ -13386,13 +13301,11 @@ components: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: data: anyOf: - type: string - type: 'null' contentEncoding: base64 - default: title: Data title: _URLOrData type: object @@ -13531,7 +13444,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -13539,7 +13451,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -13572,7 +13483,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -13580,7 +13490,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -13632,7 +13541,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Message to convey to the user about the violation. title: User Message metadata: @@ -13660,7 +13568,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -13668,7 +13575,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -13680,7 +13586,6 @@ components: anyOf: - $ref: '#/components/schemas/SafetyViolation' - type: 'null' - default: description: The violation from the shield call. required: - turn_id @@ -13744,7 +13649,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -13752,7 +13656,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -13783,7 +13686,6 @@ components: description: Response from a tool invocation. properties: call_id: - minLength: 1 title: Call Id type: string tool_name: @@ -13818,7 +13720,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: title: Metadata required: - call_id @@ -13921,7 +13822,6 @@ components: - format: date-time type: string - type: 'null' - default: description: Timestamp when the turn finished, if completed title: Completed At required: @@ -13995,7 +13895,6 @@ components: - $ref: '#/components/schemas/TextContentItem' type: array - type: 'null' - default: title: Context required: - content @@ -14016,13 +13915,11 @@ components: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: data: anyOf: - type: string - type: 'null' contentEncoding: base64 - default: title: Data title: _URLOrData type: object @@ -14184,13 +14081,11 @@ components: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: data: anyOf: - type: string - type: 'null' contentEncoding: base64 - default: title: Data title: _URLOrData type: object @@ -14209,7 +14104,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -14217,7 +14111,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -14282,13 +14175,11 @@ components: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: data: anyOf: - type: string - type: 'null' contentEncoding: base64 - default: title: Data title: _URLOrData type: object @@ -14307,7 +14198,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -14315,7 +14205,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -14369,7 +14258,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Message to convey to the user about the violation. title: User Message metadata: @@ -14404,7 +14292,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -14412,7 +14299,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -14424,7 +14310,6 @@ components: anyOf: - $ref: '#/components/schemas/SafetyViolation' - type: 'null' - default: description: The violation from the shield call. required: - turn_id @@ -14493,7 +14378,6 @@ components: description: Response from a tool invocation. properties: call_id: - minLength: 1 title: Call Id type: string tool_name: @@ -14528,7 +14412,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: title: Metadata required: - call_id @@ -14553,13 +14436,11 @@ components: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: data: anyOf: - type: string - type: 'null' contentEncoding: base64 - default: title: Data title: _URLOrData type: object @@ -14578,7 +14459,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step started. title: Started At completed_at: @@ -14586,7 +14466,6 @@ components: - format: date-time type: string - type: 'null' - default: description: The time the step completed. title: Completed At step_type: @@ -14726,7 +14605,6 @@ components: type: string bnf: additionalProperties: true - minProperties: 1 title: Bnf type: object required: @@ -14767,7 +14645,6 @@ components: type: string json_schema: additionalProperties: true - minProperties: 1 title: Json Schema type: object required: @@ -14779,8 +14656,7 @@ components: properties: top_k: anyOf: - - minimum: 0 - type: integer + - type: integer - type: 'null' default: 0 title: Top K @@ -14803,15 +14679,12 @@ components: title: Strategy max_tokens: anyOf: - - minimum: 0 - type: integer + - type: integer - type: 'null' - default: title: Max Tokens repetition_penalty: anyOf: - - minimum: 0.0 - type: number + - type: number - type: 'null' default: 1.0 title: Repetition Penalty @@ -14819,10 +14692,8 @@ components: anyOf: - items: type: string - minItems: 1 type: array - type: 'null' - default: title: Stop title: SamplingParams type: object @@ -14930,7 +14801,6 @@ components: anyOf: - $ref: '#/components/schemas/ToolPromptFormat' - type: 'null' - default: system_message_behavior: anyOf: - $ref: '#/components/schemas/SystemMessageBehavior' @@ -14949,21 +14819,18 @@ components: anyOf: - type: string - type: 'null' - default: title: Description input_schema: anyOf: - additionalProperties: true type: object - type: 'null' - default: title: Input Schema output_schema: anyOf: - additionalProperties: true type: object - type: 'null' - default: title: Output Schema required: - tool_name @@ -15117,7 +14984,6 @@ components: - $ref: '#/components/schemas/TextContentItem' type: array - type: 'null' - default: title: Context required: - content @@ -15130,13 +14996,11 @@ components: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: data: anyOf: - type: string - type: 'null' contentEncoding: base64 - default: title: Data title: _URLOrData type: object @@ -15183,7 +15047,6 @@ components: - $ref: '#/components/schemas/JsonSchemaResponseFormat' - $ref: '#/components/schemas/GrammarResponseFormat' - type: 'null' - default: title: Response Format stream: anyOf: @@ -15195,7 +15058,6 @@ components: anyOf: - $ref: '#/components/schemas/LogProbConfig' - type: 'null' - default: required: - messages title: ChatCompletionRequest @@ -15283,7 +15145,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Unit required: - metric @@ -15318,7 +15179,6 @@ components: logprobs_by_token: additionalProperties: type: number - minProperties: 1 title: Logprobs By Token type: object required: @@ -15361,13 +15221,11 @@ components: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: data: anyOf: - type: string - type: 'null' contentEncoding: base64 - default: title: Data title: _URLOrData type: object @@ -15379,7 +15237,6 @@ components: $ref: '#/components/schemas/MetricInResponse' type: array - type: 'null' - default: title: Metrics completion_message: $ref: '#/components/schemas/CompletionMessage' @@ -15389,7 +15246,6 @@ components: $ref: '#/components/schemas/TokenLogProbs' type: array - type: 'null' - default: title: Logprobs required: - completion_message @@ -15457,7 +15313,6 @@ components: logprobs_by_token: additionalProperties: type: number - minProperties: 1 title: Logprobs By Token type: object required: @@ -15534,13 +15389,11 @@ components: $ref: '#/components/schemas/TokenLogProbs' type: array - type: 'null' - default: title: Logprobs stop_reason: anyOf: - $ref: '#/components/schemas/StopReason' - type: 'null' - default: required: - event_type - delta @@ -15579,13 +15432,11 @@ components: $ref: '#/components/schemas/TokenLogProbs' type: array - type: 'null' - default: title: Logprobs stop_reason: anyOf: - $ref: '#/components/schemas/StopReason' - type: 'null' - default: required: - event_type - delta @@ -15630,7 +15481,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Unit required: - metric @@ -15665,7 +15515,6 @@ components: logprobs_by_token: additionalProperties: type: number - minProperties: 1 title: Logprobs By Token type: object required: @@ -15728,7 +15577,6 @@ components: $ref: '#/components/schemas/MetricInResponse' type: array - type: 'null' - default: title: Metrics event: $ref: '#/components/schemas/ChatCompletionResponseEvent' @@ -15818,13 +15666,11 @@ components: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: data: anyOf: - type: string - type: 'null' contentEncoding: base64 - default: title: Data title: _URLOrData type: object @@ -15888,7 +15734,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Unit required: - metric @@ -15908,7 +15753,6 @@ components: logprobs_by_token: additionalProperties: type: number - minProperties: 1 title: Logprobs By Token type: object required: @@ -15923,7 +15767,6 @@ components: $ref: '#/components/schemas/MetricInResponse' type: array - type: 'null' - default: title: Metrics content: title: Content @@ -15936,7 +15779,6 @@ components: $ref: '#/components/schemas/TokenLogProbs' type: array - type: 'null' - default: title: Logprobs required: - content @@ -15960,7 +15802,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Unit required: - metric @@ -15980,7 +15821,6 @@ components: logprobs_by_token: additionalProperties: type: number - minProperties: 1 title: Logprobs By Token type: object required: @@ -15995,7 +15835,6 @@ components: $ref: '#/components/schemas/MetricInResponse' type: array - type: 'null' - default: title: Metrics delta: title: Delta @@ -16004,14 +15843,12 @@ components: anyOf: - $ref: '#/components/schemas/StopReason' - type: 'null' - default: logprobs: anyOf: - items: $ref: '#/components/schemas/TokenLogProbs' type: array - type: 'null' - default: title: Logprobs required: - delta @@ -16051,8 +15888,7 @@ components: type: string scheme: anyOf: - - minLength: 1 - type: string + - type: string - type: 'null' default: int4_weight_int8_dynamic_activation title: Scheme @@ -16082,13 +15918,11 @@ components: anyOf: - type: integer - type: 'null' - default: title: Index id: anyOf: - type: string - type: 'null' - default: title: Id type: const: function @@ -16099,7 +15933,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' - type: 'null' - default: title: OpenAIChatCompletionToolCall type: object OpenAIChatCompletionToolCallFunction: @@ -16109,13 +15942,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Name arguments: anyOf: - type: string - type: 'null' - default: title: Arguments title: OpenAIChatCompletionToolCallFunction type: object @@ -16133,13 +15964,11 @@ components: $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' type: array - type: 'null' - default: title: Content name: anyOf: - type: string - type: 'null' - default: title: Name tool_calls: anyOf: @@ -16147,7 +15976,6 @@ components: $ref: '#/components/schemas/OpenAIChatCompletionToolCall' type: array - type: 'null' - default: title: Tool Calls title: OpenAIAssistantMessageParam type: object @@ -16168,13 +15996,11 @@ components: $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' type: array - type: 'null' - default: title: Content name: anyOf: - type: string - type: 'null' - default: title: Name tool_calls: anyOf: @@ -16182,7 +16008,6 @@ components: $ref: '#/components/schemas/OpenAIChatCompletionToolCall' type: array - type: 'null' - default: title: Tool Calls title: OpenAIAssistantMessageParam type: object @@ -16222,13 +16047,11 @@ components: anyOf: - type: integer - type: 'null' - default: title: Index id: anyOf: - type: string - type: 'null' - default: title: Id type: const: function @@ -16239,7 +16062,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' - type: 'null' - default: title: OpenAIChatCompletionToolCall type: object OpenAIChatCompletionToolCallFunction: @@ -16249,13 +16071,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Name arguments: anyOf: - type: string - type: 'null' - default: title: Arguments title: OpenAIChatCompletionToolCallFunction type: object @@ -16275,12 +16095,10 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails' - type: 'null' - default: completion_tokens_details: anyOf: - $ref: '#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails' - type: 'null' - default: required: - prompt_tokens - completion_tokens @@ -16294,7 +16112,6 @@ components: anyOf: - type: integer - type: 'null' - default: title: Reasoning Tokens title: OpenAIChatCompletionUsageCompletionTokensDetails type: object @@ -16305,7 +16122,6 @@ components: anyOf: - type: integer - type: 'null' - default: title: Cached Tokens title: OpenAIChatCompletionUsagePromptTokensDetails type: object @@ -16338,7 +16154,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - type: 'null' - default: required: - message - finish_reason @@ -16354,7 +16169,6 @@ components: $ref: '#/components/schemas/OpenAITokenLogProb' type: array - type: 'null' - default: title: Content refusal: anyOf: @@ -16362,7 +16176,6 @@ components: $ref: '#/components/schemas/OpenAITokenLogProb' type: array - type: 'null' - default: title: Refusal title: OpenAIChoiceLogprobs type: object @@ -16385,7 +16198,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Name required: - content @@ -16410,13 +16222,11 @@ components: anyOf: - type: string - type: 'null' - default: title: File Id filename: anyOf: - type: string - type: 'null' - default: title: Filename title: OpenAIFileFile type: object @@ -16430,7 +16240,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Detail required: - url @@ -16455,7 +16264,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Name required: - content @@ -16473,7 +16281,6 @@ components: type: integer type: array - type: 'null' - default: title: Bytes logprob: title: Logprob @@ -16524,7 +16331,6 @@ components: type: integer type: array - type: 'null' - default: title: Bytes logprob: title: Logprob @@ -16562,7 +16368,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Name required: - content @@ -16593,7 +16398,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - type: 'null' - default: required: - id - choices @@ -16610,13 +16414,11 @@ components: anyOf: - type: integer - type: 'null' - default: title: Index id: anyOf: - type: string - type: 'null' - default: title: Id type: const: function @@ -16627,7 +16429,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' - type: 'null' - default: title: OpenAIChatCompletionToolCall type: object OpenAIChatCompletionToolCallFunction: @@ -16637,13 +16438,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Name arguments: anyOf: - type: string - type: 'null' - default: title: Arguments title: OpenAIChatCompletionToolCallFunction type: object @@ -16663,12 +16462,10 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIChatCompletionUsagePromptTokensDetails' - type: 'null' - default: completion_tokens_details: anyOf: - $ref: '#/components/schemas/OpenAIChatCompletionUsageCompletionTokensDetails' - type: 'null' - default: required: - prompt_tokens - completion_tokens @@ -16682,7 +16479,6 @@ components: anyOf: - type: integer - type: 'null' - default: title: Reasoning Tokens title: OpenAIChatCompletionUsageCompletionTokensDetails type: object @@ -16693,7 +16489,6 @@ components: anyOf: - type: integer - type: 'null' - default: title: Cached Tokens title: OpenAIChatCompletionUsagePromptTokensDetails type: object @@ -16704,19 +16499,16 @@ components: anyOf: - type: string - type: 'null' - default: title: Content refusal: anyOf: - type: string - type: 'null' - default: title: Refusal role: anyOf: - type: string - type: 'null' - default: title: Role tool_calls: anyOf: @@ -16724,13 +16516,11 @@ components: $ref: '#/components/schemas/OpenAIChatCompletionToolCall' type: array - type: 'null' - default: title: Tool Calls reasoning_content: anyOf: - type: string - type: 'null' - default: title: Reasoning Content title: OpenAIChoiceDelta type: object @@ -16743,7 +16533,6 @@ components: $ref: '#/components/schemas/OpenAITokenLogProb' type: array - type: 'null' - default: title: Content refusal: anyOf: @@ -16751,7 +16540,6 @@ components: $ref: '#/components/schemas/OpenAITokenLogProb' type: array - type: 'null' - default: title: Refusal title: OpenAIChoiceLogprobs type: object @@ -16770,7 +16558,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - type: 'null' - default: required: - delta - finish_reason @@ -16789,7 +16576,6 @@ components: type: integer type: array - type: 'null' - default: title: Bytes logprob: title: Logprob @@ -16817,7 +16603,6 @@ components: type: integer type: array - type: 'null' - default: title: Bytes logprob: title: Logprob @@ -16852,7 +16637,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' - type: 'null' - default: required: - id - choices @@ -16877,13 +16661,11 @@ components: $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' type: array - type: 'null' - default: title: Content name: anyOf: - type: string - type: 'null' - default: title: Name tool_calls: anyOf: @@ -16891,7 +16673,6 @@ components: $ref: '#/components/schemas/OpenAIChatCompletionToolCall' type: array - type: 'null' - default: title: Tool Calls title: OpenAIAssistantMessageParam type: object @@ -16931,13 +16712,11 @@ components: anyOf: - type: integer - type: 'null' - default: title: Index id: anyOf: - type: string - type: 'null' - default: title: Id type: const: function @@ -16948,7 +16727,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' - type: 'null' - default: title: OpenAIChatCompletionToolCall type: object OpenAIChatCompletionToolCallFunction: @@ -16958,13 +16736,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Name arguments: anyOf: - type: string - type: 'null' - default: title: Arguments title: OpenAIChatCompletionToolCallFunction type: object @@ -16977,7 +16753,6 @@ components: $ref: '#/components/schemas/OpenAITokenLogProb' type: array - type: 'null' - default: title: Content refusal: anyOf: @@ -16985,7 +16760,6 @@ components: $ref: '#/components/schemas/OpenAITokenLogProb' type: array - type: 'null' - default: title: Refusal title: OpenAIChoiceLogprobs type: object @@ -17008,7 +16782,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Name required: - content @@ -17033,13 +16806,11 @@ components: anyOf: - type: string - type: 'null' - default: title: File Id filename: anyOf: - type: string - type: 'null' - default: title: Filename title: OpenAIFileFile type: object @@ -17053,7 +16824,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Detail required: - url @@ -17078,7 +16848,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Name required: - content @@ -17096,7 +16865,6 @@ components: type: integer type: array - type: 'null' - default: title: Bytes logprob: title: Logprob @@ -17147,7 +16915,6 @@ components: type: integer type: array - type: 'null' - default: title: Bytes logprob: title: Logprob @@ -17185,7 +16952,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Name required: - content @@ -17219,7 +16985,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - type: 'null' - default: required: - message - finish_reason @@ -17235,13 +17000,11 @@ components: anyOf: - type: integer - type: 'null' - default: title: Index id: anyOf: - type: string - type: 'null' - default: title: Id type: const: function @@ -17252,7 +17015,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' - type: 'null' - default: title: OpenAIChatCompletionToolCall type: object OpenAIChatCompletionToolCallFunction: @@ -17262,13 +17024,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Name arguments: anyOf: - type: string - type: 'null' - default: title: Arguments title: OpenAIChatCompletionToolCallFunction type: object @@ -17278,19 +17038,16 @@ components: anyOf: - type: string - type: 'null' - default: title: Content refusal: anyOf: - type: string - type: 'null' - default: title: Refusal role: anyOf: - type: string - type: 'null' - default: title: Role tool_calls: anyOf: @@ -17298,13 +17055,11 @@ components: $ref: '#/components/schemas/OpenAIChatCompletionToolCall' type: array - type: 'null' - default: title: Tool Calls reasoning_content: anyOf: - type: string - type: 'null' - default: title: Reasoning Content title: OpenAIChoiceDelta type: object @@ -17322,7 +17077,6 @@ components: type: integer type: array - type: 'null' - default: title: Bytes logprob: title: Logprob @@ -17350,7 +17104,6 @@ components: type: integer type: array - type: 'null' - default: title: Bytes logprob: title: Logprob @@ -17368,7 +17121,6 @@ components: $ref: '#/components/schemas/OpenAITokenLogProb' type: array - type: 'null' - default: title: Content refusal: anyOf: @@ -17376,7 +17128,6 @@ components: $ref: '#/components/schemas/OpenAITokenLogProb' type: array - type: 'null' - default: title: Refusal title: OpenAIChoiceLogprobs type: object @@ -17389,13 +17140,11 @@ components: anyOf: - type: integer - type: 'null' - default: title: Index id: anyOf: - type: string - type: 'null' - default: title: Id type: const: function @@ -17406,7 +17155,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIChatCompletionToolCallFunction' - type: 'null' - default: title: OpenAIChatCompletionToolCall type: object OpenAIChatCompletionToolCallFunction: @@ -17416,13 +17164,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Name arguments: anyOf: - type: string - type: 'null' - default: title: Arguments title: OpenAIChatCompletionToolCallFunction type: object @@ -17433,19 +17179,16 @@ components: anyOf: - type: string - type: 'null' - default: title: Content refusal: anyOf: - type: string - type: 'null' - default: title: Refusal role: anyOf: - type: string - type: 'null' - default: title: Role tool_calls: anyOf: @@ -17453,13 +17196,11 @@ components: $ref: '#/components/schemas/OpenAIChatCompletionToolCall' type: array - type: 'null' - default: title: Tool Calls reasoning_content: anyOf: - type: string - type: 'null' - default: title: Reasoning Content title: OpenAIChoiceDelta type: object @@ -17472,7 +17213,6 @@ components: $ref: '#/components/schemas/OpenAITokenLogProb' type: array - type: 'null' - default: title: Content refusal: anyOf: @@ -17480,7 +17220,6 @@ components: $ref: '#/components/schemas/OpenAITokenLogProb' type: array - type: 'null' - default: title: Refusal title: OpenAIChoiceLogprobs type: object @@ -17496,7 +17235,6 @@ components: type: integer type: array - type: 'null' - default: title: Bytes logprob: title: Logprob @@ -17524,7 +17262,6 @@ components: type: integer type: array - type: 'null' - default: title: Bytes logprob: title: Logprob @@ -17548,7 +17285,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - type: 'null' - default: required: - delta - finish_reason @@ -17566,7 +17302,6 @@ components: $ref: '#/components/schemas/OpenAITokenLogProb' type: array - type: 'null' - default: title: Content refusal: anyOf: @@ -17574,7 +17309,6 @@ components: $ref: '#/components/schemas/OpenAITokenLogProb' type: array - type: 'null' - default: title: Refusal title: OpenAIChoiceLogprobs type: object @@ -17590,7 +17324,6 @@ components: type: integer type: array - type: 'null' - default: title: Bytes logprob: title: Logprob @@ -17618,7 +17351,6 @@ components: type: integer type: array - type: 'null' - default: title: Bytes logprob: title: Logprob @@ -17643,7 +17375,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - type: 'null' - default: required: - finish_reason - text @@ -17659,7 +17390,6 @@ components: type: integer type: array - type: 'null' - default: title: Text Offset token_logprobs: anyOf: @@ -17667,7 +17397,6 @@ components: type: number type: array - type: 'null' - default: title: Token Logprobs tokens: anyOf: @@ -17675,7 +17404,6 @@ components: type: string type: array - type: 'null' - default: title: Tokens top_logprobs: anyOf: @@ -17685,7 +17413,6 @@ components: type: object type: array - type: 'null' - default: title: Top Logprobs title: OpenAICompletionLogprobs type: object @@ -17739,13 +17466,11 @@ components: anyOf: - type: string - type: 'null' - default: title: File Id filename: anyOf: - type: string - type: 'null' - default: title: Filename title: OpenAIFileFile type: object @@ -17759,7 +17484,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Detail required: - url @@ -17792,7 +17516,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Name required: - content @@ -17804,7 +17527,6 @@ components: logprobs_by_token: additionalProperties: type: number - minProperties: 1 title: Logprobs By Token type: object required: @@ -17867,20 +17589,17 @@ components: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: data: anyOf: - type: string - type: 'null' contentEncoding: base64 - default: title: Data title: _URLOrData type: object description: Response from a tool invocation. properties: call_id: - minLength: 1 title: Call Id type: string tool_name: @@ -17915,7 +17634,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: title: Metadata required: - call_id @@ -17971,13 +17689,11 @@ components: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: data: anyOf: - type: string - type: 'null' contentEncoding: base64 - default: title: Data title: _URLOrData type: object @@ -18066,13 +17782,11 @@ components: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: data: anyOf: - type: string - type: 'null' contentEncoding: base64 - default: title: Data title: _URLOrData type: object @@ -18127,7 +17841,6 @@ components: - $ref: '#/components/schemas/TextContentItem' type: array - type: 'null' - default: title: Context required: - content @@ -18217,7 +17930,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Validation Dataset Id packed: anyOf: @@ -18333,17 +18045,14 @@ components: anyOf: - $ref: '#/components/schemas/DataConfig' - type: 'null' - default: optimizer_config: anyOf: - $ref: '#/components/schemas/OptimizerConfig' - type: 'null' - default: efficiency_config: anyOf: - $ref: '#/components/schemas/EfficiencyConfig' - type: 'null' - default: dtype: anyOf: - type: string @@ -18433,14 +18142,12 @@ components: - additionalProperties: true type: object - type: 'null' - default: description: Additional arguments to pass to the provider title: Args mcp_endpoint: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: description: Model Context Protocol endpoint for remote tools required: - toolgroup_id @@ -18456,67 +18163,56 @@ components: anyOf: - type: string - type: 'null' - default: title: Chunk Id document_id: anyOf: - type: string - type: 'null' - default: title: Document Id source: anyOf: - type: string - type: 'null' - default: title: Source created_timestamp: anyOf: - type: integer - type: 'null' - default: title: Created Timestamp updated_timestamp: anyOf: - type: integer - type: 'null' - default: title: Updated Timestamp chunk_window: anyOf: - type: string - type: 'null' - default: title: Chunk Window chunk_tokenizer: anyOf: - type: string - type: 'null' - default: title: Chunk Tokenizer chunk_embedding_model: anyOf: - type: string - type: 'null' - default: title: Chunk Embedding Model chunk_embedding_dimension: anyOf: - type: integer - type: 'null' - default: title: Chunk Embedding Dimension content_token_count: anyOf: - type: integer - type: 'null' - default: title: Content Token Count metadata_token_count: anyOf: - type: integer - type: 'null' - default: title: Metadata Token Count title: ChunkMetadata type: object @@ -18566,13 +18262,11 @@ components: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: data: anyOf: - type: string - type: 'null' contentEncoding: base64 - default: title: Data title: _URLOrData type: object @@ -18613,13 +18307,11 @@ components: type: number type: array - type: 'null' - default: title: Embedding chunk_metadata: anyOf: - $ref: '#/components/schemas/ChunkMetadata' - type: 'null' - default: required: - content - chunk_id @@ -18632,7 +18324,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Name file_ids: items: @@ -18644,14 +18335,12 @@ components: - additionalProperties: true type: object - type: 'null' - default: title: Expires After chunking_strategy: anyOf: - additionalProperties: true type: object - type: 'null' - default: title: Chunking Strategy metadata: additionalProperties: true @@ -18674,7 +18363,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: title: Filters max_num_results: default: 10 @@ -18685,7 +18373,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: title: Ranking Options rewrite_query: default: false @@ -18840,7 +18527,6 @@ components: type: object type: array - type: 'null' - default: description: Token log probability details title: Logprobs required: @@ -19020,28 +18706,24 @@ components: anyOf: - type: string - type: 'null' - default: description: The data of the file to be sent to the model. title: File Data file_id: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id file_url: anyOf: - type: string - type: 'null' - default: description: The URL of the file to be sent to the model. title: File Url filename: anyOf: - type: string - type: 'null' - default: description: The name of the file to be sent to the model. title: Filename title: OpenAIResponseInputMessageContentFile @@ -19070,14 +18752,12 @@ components: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id image_url: anyOf: - type: string - type: 'null' - default: description: URL of the image content title: Image Url title: OpenAIResponseInputMessageContentImage @@ -19177,13 +18857,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Id status: anyOf: - type: string - type: 'null' - default: title: Status required: - content @@ -19201,7 +18879,6 @@ components: type: string type: array - type: 'null' - default: description: List of specific tool names that are allowed title: Tool Names title: AllowedToolsFilter @@ -19222,7 +18899,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Description of what the tool does title: Description required: @@ -19383,28 +19059,24 @@ components: anyOf: - type: string - type: 'null' - default: description: The data of the file to be sent to the model. title: File Data file_id: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id file_url: anyOf: - type: string - type: 'null' - default: description: The URL of the file to be sent to the model. title: File Url filename: anyOf: - type: string - type: 'null' - default: description: The name of the file to be sent to the model. title: Filename title: OpenAIResponseInputMessageContentFile @@ -19433,14 +19105,12 @@ components: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id image_url: anyOf: - type: string - type: 'null' - default: description: URL of the image content title: Image Url title: OpenAIResponseInputMessageContentImage @@ -19482,7 +19152,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: description: Additional filters to apply to the search title: Filters max_num_results: @@ -19498,7 +19167,6 @@ components: anyOf: - $ref: '#/components/schemas/SearchRankingOptions' - type: 'null' - default: description: Options for ranking and scoring search results required: - vector_store_ids @@ -19521,7 +19189,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Description of what the function does title: Description parameters: @@ -19529,14 +19196,12 @@ components: - additionalProperties: true type: object - type: 'null' - default: description: JSON schema defining the function's parameters title: Parameters strict: anyOf: - type: boolean - type: 'null' - default: description: Whether to enforce strict parameter validation title: Strict required: @@ -19643,13 +19308,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Id status: anyOf: - type: string - type: 'null' - default: title: Status required: - content @@ -19667,7 +19330,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseError' - type: 'null' - default: description: Error details if the response generation failed id: description: Unique identifier for this response @@ -19715,14 +19377,12 @@ components: anyOf: - type: string - type: 'null' - default: description: ID of the previous response in a conversation title: Previous Response Id prompt: anyOf: - $ref: '#/components/schemas/OpenAIResponsePrompt' - type: 'null' - default: description: Reference to a prompt template and its variables. status: description: Current status of the response generation @@ -19732,7 +19392,6 @@ components: anyOf: - type: number - type: 'null' - default: description: Sampling temperature used for generation title: Temperature text: @@ -19742,7 +19401,6 @@ components: anyOf: - type: number - type: 'null' - default: description: Nucleus sampling parameter used for generation title: Top P tools: @@ -19764,27 +19422,23 @@ components: - $ref: '#/components/schemas/OpenAIResponseToolMCP' type: array - type: 'null' - default: description: An array of tools the model may call while generating a response. title: Tools truncation: anyOf: - type: string - type: 'null' - default: description: Truncation strategy applied to the response title: Truncation usage: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsage' - type: 'null' - default: description: Token usage information for the response instructions: anyOf: - type: string - type: 'null' - default: description: System message inserted into the model's context title: Instructions required: @@ -19854,7 +19508,6 @@ components: $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' type: array - type: 'null' - default: description: Search results returned by the file search operation title: Results required: @@ -19920,14 +19573,12 @@ components: anyOf: - type: string - type: 'null' - default: description: Additional identifier for the tool call title: Id status: anyOf: - type: string - type: 'null' - default: description: Current status of the function call execution title: Status required: @@ -19965,14 +19616,12 @@ components: anyOf: - type: string - type: 'null' - default: description: Error message if the MCP call failed title: Error output: anyOf: - type: string - type: 'null' - default: description: Output result from the successful MCP call title: Output required: @@ -20055,14 +19704,12 @@ components: - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' type: object - type: 'null' - default: description: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files. title: Variables version: anyOf: - type: string - type: 'null' - default: description: Version number of the prompt to use (defaults to latest if not specified) title: Version required: @@ -20076,7 +19723,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseTextFormat' - type: 'null' - default: description: Text format configuration specifying output format requirements title: OpenAIResponseText type: object @@ -20135,7 +19781,6 @@ components: type: array - $ref: '#/components/schemas/AllowedToolsFilter' - type: 'null' - default: description: Restriction on which tools can be used from this server title: Allowed Tools required: @@ -20161,13 +19806,11 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' - type: 'null' - default: description: Detailed breakdown of input token usage output_tokens_details: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' - type: 'null' - default: description: Detailed breakdown of output token usage required: - input_tokens @@ -20182,7 +19825,6 @@ components: anyOf: - type: integer - type: 'null' - default: description: Number of tokens retrieved from cache title: Cached Tokens title: OpenAIResponseUsageInputTokensDetails @@ -20194,7 +19836,6 @@ components: anyOf: - type: integer - type: 'null' - default: description: Number of tokens used for reasoning (o1/o3 models) title: Reasoning Tokens title: OpenAIResponseUsageOutputTokensDetails @@ -20206,7 +19847,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Ranker score_threshold: anyOf: @@ -20377,7 +20017,6 @@ components: type: object type: array - type: 'null' - default: description: Token log probability details title: Logprobs required: @@ -20614,7 +20253,6 @@ components: type: object type: array - type: 'null' - default: description: Token log probability details title: Logprobs required: @@ -20716,7 +20354,6 @@ components: type: string type: array - type: 'null' - default: description: List of specific tool names that are allowed title: Tool Names title: AllowedToolsFilter @@ -20737,7 +20374,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Description of what the tool does title: Description required: @@ -20898,28 +20534,24 @@ components: anyOf: - type: string - type: 'null' - default: description: The data of the file to be sent to the model. title: File Data file_id: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id file_url: anyOf: - type: string - type: 'null' - default: description: The URL of the file to be sent to the model. title: File Url filename: anyOf: - type: string - type: 'null' - default: description: The name of the file to be sent to the model. title: Filename title: OpenAIResponseInputMessageContentFile @@ -20948,14 +20580,12 @@ components: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id image_url: anyOf: - type: string - type: 'null' - default: description: URL of the image content title: Image Url title: OpenAIResponseInputMessageContentImage @@ -20997,7 +20627,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: description: Additional filters to apply to the search title: Filters max_num_results: @@ -21013,7 +20642,6 @@ components: anyOf: - $ref: '#/components/schemas/SearchRankingOptions' - type: 'null' - default: description: Options for ranking and scoring search results required: - vector_store_ids @@ -21036,7 +20664,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Description of what the function does title: Description parameters: @@ -21044,14 +20671,12 @@ components: - additionalProperties: true type: object - type: 'null' - default: description: JSON schema defining the function's parameters title: Parameters strict: anyOf: - type: boolean - type: 'null' - default: description: Whether to enforce strict parameter validation title: Strict required: @@ -21158,13 +20783,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Id status: anyOf: - type: string - type: 'null' - default: title: Status required: - content @@ -21182,7 +20805,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseError' - type: 'null' - default: description: Error details if the response generation failed id: description: Unique identifier for this response @@ -21230,14 +20852,12 @@ components: anyOf: - type: string - type: 'null' - default: description: ID of the previous response in a conversation title: Previous Response Id prompt: anyOf: - $ref: '#/components/schemas/OpenAIResponsePrompt' - type: 'null' - default: description: Reference to a prompt template and its variables. status: description: Current status of the response generation @@ -21247,7 +20867,6 @@ components: anyOf: - type: number - type: 'null' - default: description: Sampling temperature used for generation title: Temperature text: @@ -21257,7 +20876,6 @@ components: anyOf: - type: number - type: 'null' - default: description: Nucleus sampling parameter used for generation title: Top P tools: @@ -21279,27 +20897,23 @@ components: - $ref: '#/components/schemas/OpenAIResponseToolMCP' type: array - type: 'null' - default: description: An array of tools the model may call while generating a response. title: Tools truncation: anyOf: - type: string - type: 'null' - default: description: Truncation strategy applied to the response title: Truncation usage: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsage' - type: 'null' - default: description: Token usage information for the response instructions: anyOf: - type: string - type: 'null' - default: description: System message inserted into the model's context title: Instructions required: @@ -21369,7 +20983,6 @@ components: $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' type: array - type: 'null' - default: description: Search results returned by the file search operation title: Results required: @@ -21435,14 +21048,12 @@ components: anyOf: - type: string - type: 'null' - default: description: Additional identifier for the tool call title: Id status: anyOf: - type: string - type: 'null' - default: description: Current status of the function call execution title: Status required: @@ -21480,14 +21091,12 @@ components: anyOf: - type: string - type: 'null' - default: description: Error message if the MCP call failed title: Error output: anyOf: - type: string - type: 'null' - default: description: Output result from the successful MCP call title: Output required: @@ -21570,14 +21179,12 @@ components: - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' type: object - type: 'null' - default: description: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files. title: Variables version: anyOf: - type: string - type: 'null' - default: description: Version number of the prompt to use (defaults to latest if not specified) title: Version required: @@ -21591,7 +21198,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseTextFormat' - type: 'null' - default: description: Text format configuration specifying output format requirements title: OpenAIResponseText type: object @@ -21650,7 +21256,6 @@ components: type: array - $ref: '#/components/schemas/AllowedToolsFilter' - type: 'null' - default: description: Restriction on which tools can be used from this server title: Allowed Tools required: @@ -21676,13 +21281,11 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' - type: 'null' - default: description: Detailed breakdown of input token usage output_tokens_details: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' - type: 'null' - default: description: Detailed breakdown of output token usage required: - input_tokens @@ -21697,7 +21300,6 @@ components: anyOf: - type: integer - type: 'null' - default: description: Number of tokens retrieved from cache title: Cached Tokens title: OpenAIResponseUsageInputTokensDetails @@ -21709,7 +21311,6 @@ components: anyOf: - type: integer - type: 'null' - default: description: Number of tokens used for reasoning (o1/o3 models) title: Reasoning Tokens title: OpenAIResponseUsageOutputTokensDetails @@ -21721,7 +21322,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Ranker score_threshold: anyOf: @@ -21757,7 +21357,6 @@ components: type: string type: array - type: 'null' - default: description: List of specific tool names that are allowed title: Tool Names title: AllowedToolsFilter @@ -21778,7 +21377,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Description of what the tool does title: Description required: @@ -21939,28 +21537,24 @@ components: anyOf: - type: string - type: 'null' - default: description: The data of the file to be sent to the model. title: File Data file_id: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id file_url: anyOf: - type: string - type: 'null' - default: description: The URL of the file to be sent to the model. title: File Url filename: anyOf: - type: string - type: 'null' - default: description: The name of the file to be sent to the model. title: Filename title: OpenAIResponseInputMessageContentFile @@ -21989,14 +21583,12 @@ components: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id image_url: anyOf: - type: string - type: 'null' - default: description: URL of the image content title: Image Url title: OpenAIResponseInputMessageContentImage @@ -22038,7 +21630,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: description: Additional filters to apply to the search title: Filters max_num_results: @@ -22054,7 +21645,6 @@ components: anyOf: - $ref: '#/components/schemas/SearchRankingOptions' - type: 'null' - default: description: Options for ranking and scoring search results required: - vector_store_ids @@ -22077,7 +21667,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Description of what the function does title: Description parameters: @@ -22085,14 +21674,12 @@ components: - additionalProperties: true type: object - type: 'null' - default: description: JSON schema defining the function's parameters title: Parameters strict: anyOf: - type: boolean - type: 'null' - default: description: Whether to enforce strict parameter validation title: Strict required: @@ -22199,13 +21786,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Id status: anyOf: - type: string - type: 'null' - default: title: Status required: - content @@ -22223,7 +21808,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseError' - type: 'null' - default: description: Error details if the response generation failed id: description: Unique identifier for this response @@ -22271,14 +21855,12 @@ components: anyOf: - type: string - type: 'null' - default: description: ID of the previous response in a conversation title: Previous Response Id prompt: anyOf: - $ref: '#/components/schemas/OpenAIResponsePrompt' - type: 'null' - default: description: Reference to a prompt template and its variables. status: description: Current status of the response generation @@ -22288,7 +21870,6 @@ components: anyOf: - type: number - type: 'null' - default: description: Sampling temperature used for generation title: Temperature text: @@ -22298,7 +21879,6 @@ components: anyOf: - type: number - type: 'null' - default: description: Nucleus sampling parameter used for generation title: Top P tools: @@ -22320,27 +21900,23 @@ components: - $ref: '#/components/schemas/OpenAIResponseToolMCP' type: array - type: 'null' - default: description: An array of tools the model may call while generating a response. title: Tools truncation: anyOf: - type: string - type: 'null' - default: description: Truncation strategy applied to the response title: Truncation usage: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsage' - type: 'null' - default: description: Token usage information for the response instructions: anyOf: - type: string - type: 'null' - default: description: System message inserted into the model's context title: Instructions required: @@ -22410,7 +21986,6 @@ components: $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' type: array - type: 'null' - default: description: Search results returned by the file search operation title: Results required: @@ -22476,14 +22051,12 @@ components: anyOf: - type: string - type: 'null' - default: description: Additional identifier for the tool call title: Id status: anyOf: - type: string - type: 'null' - default: description: Current status of the function call execution title: Status required: @@ -22521,14 +22094,12 @@ components: anyOf: - type: string - type: 'null' - default: description: Error message if the MCP call failed title: Error output: anyOf: - type: string - type: 'null' - default: description: Output result from the successful MCP call title: Output required: @@ -22611,14 +22182,12 @@ components: - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' type: object - type: 'null' - default: description: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files. title: Variables version: anyOf: - type: string - type: 'null' - default: description: Version number of the prompt to use (defaults to latest if not specified) title: Version required: @@ -22632,7 +22201,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseTextFormat' - type: 'null' - default: description: Text format configuration specifying output format requirements title: OpenAIResponseText type: object @@ -22691,7 +22259,6 @@ components: type: array - $ref: '#/components/schemas/AllowedToolsFilter' - type: 'null' - default: description: Restriction on which tools can be used from this server title: Allowed Tools required: @@ -22717,13 +22284,11 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' - type: 'null' - default: description: Detailed breakdown of input token usage output_tokens_details: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' - type: 'null' - default: description: Detailed breakdown of output token usage required: - input_tokens @@ -22738,7 +22303,6 @@ components: anyOf: - type: integer - type: 'null' - default: description: Number of tokens retrieved from cache title: Cached Tokens title: OpenAIResponseUsageInputTokensDetails @@ -22750,7 +22314,6 @@ components: anyOf: - type: integer - type: 'null' - default: description: Number of tokens used for reasoning (o1/o3 models) title: Reasoning Tokens title: OpenAIResponseUsageOutputTokensDetails @@ -22762,7 +22325,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Ranker score_threshold: anyOf: @@ -22948,7 +22510,6 @@ components: type: string type: array - type: 'null' - default: description: List of specific tool names that are allowed title: Tool Names title: AllowedToolsFilter @@ -22969,7 +22530,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Description of what the tool does title: Description required: @@ -23130,28 +22690,24 @@ components: anyOf: - type: string - type: 'null' - default: description: The data of the file to be sent to the model. title: File Data file_id: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id file_url: anyOf: - type: string - type: 'null' - default: description: The URL of the file to be sent to the model. title: File Url filename: anyOf: - type: string - type: 'null' - default: description: The name of the file to be sent to the model. title: Filename title: OpenAIResponseInputMessageContentFile @@ -23180,14 +22736,12 @@ components: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id image_url: anyOf: - type: string - type: 'null' - default: description: URL of the image content title: Image Url title: OpenAIResponseInputMessageContentImage @@ -23229,7 +22783,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: description: Additional filters to apply to the search title: Filters max_num_results: @@ -23245,7 +22798,6 @@ components: anyOf: - $ref: '#/components/schemas/SearchRankingOptions' - type: 'null' - default: description: Options for ranking and scoring search results required: - vector_store_ids @@ -23268,7 +22820,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Description of what the function does title: Description parameters: @@ -23276,14 +22827,12 @@ components: - additionalProperties: true type: object - type: 'null' - default: description: JSON schema defining the function's parameters title: Parameters strict: anyOf: - type: boolean - type: 'null' - default: description: Whether to enforce strict parameter validation title: Strict required: @@ -23390,13 +22939,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Id status: anyOf: - type: string - type: 'null' - default: title: Status required: - content @@ -23414,7 +22961,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseError' - type: 'null' - default: description: Error details if the response generation failed id: description: Unique identifier for this response @@ -23462,14 +23008,12 @@ components: anyOf: - type: string - type: 'null' - default: description: ID of the previous response in a conversation title: Previous Response Id prompt: anyOf: - $ref: '#/components/schemas/OpenAIResponsePrompt' - type: 'null' - default: description: Reference to a prompt template and its variables. status: description: Current status of the response generation @@ -23479,7 +23023,6 @@ components: anyOf: - type: number - type: 'null' - default: description: Sampling temperature used for generation title: Temperature text: @@ -23489,7 +23032,6 @@ components: anyOf: - type: number - type: 'null' - default: description: Nucleus sampling parameter used for generation title: Top P tools: @@ -23511,27 +23053,23 @@ components: - $ref: '#/components/schemas/OpenAIResponseToolMCP' type: array - type: 'null' - default: description: An array of tools the model may call while generating a response. title: Tools truncation: anyOf: - type: string - type: 'null' - default: description: Truncation strategy applied to the response title: Truncation usage: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsage' - type: 'null' - default: description: Token usage information for the response instructions: anyOf: - type: string - type: 'null' - default: description: System message inserted into the model's context title: Instructions required: @@ -23601,7 +23139,6 @@ components: $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' type: array - type: 'null' - default: description: Search results returned by the file search operation title: Results required: @@ -23667,14 +23204,12 @@ components: anyOf: - type: string - type: 'null' - default: description: Additional identifier for the tool call title: Id status: anyOf: - type: string - type: 'null' - default: description: Current status of the function call execution title: Status required: @@ -23712,14 +23247,12 @@ components: anyOf: - type: string - type: 'null' - default: description: Error message if the MCP call failed title: Error output: anyOf: - type: string - type: 'null' - default: description: Output result from the successful MCP call title: Output required: @@ -23802,14 +23335,12 @@ components: - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' type: object - type: 'null' - default: description: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files. title: Variables version: anyOf: - type: string - type: 'null' - default: description: Version number of the prompt to use (defaults to latest if not specified) title: Version required: @@ -23823,7 +23354,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseTextFormat' - type: 'null' - default: description: Text format configuration specifying output format requirements title: OpenAIResponseText type: object @@ -23882,7 +23412,6 @@ components: type: array - $ref: '#/components/schemas/AllowedToolsFilter' - type: 'null' - default: description: Restriction on which tools can be used from this server title: Allowed Tools required: @@ -23908,13 +23437,11 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' - type: 'null' - default: description: Detailed breakdown of input token usage output_tokens_details: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' - type: 'null' - default: description: Detailed breakdown of output token usage required: - input_tokens @@ -23929,7 +23456,6 @@ components: anyOf: - type: integer - type: 'null' - default: description: Number of tokens retrieved from cache title: Cached Tokens title: OpenAIResponseUsageInputTokensDetails @@ -23941,7 +23467,6 @@ components: anyOf: - type: integer - type: 'null' - default: description: Number of tokens used for reasoning (o1/o3 models) title: Reasoning Tokens title: OpenAIResponseUsageOutputTokensDetails @@ -23953,7 +23478,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Ranker score_threshold: anyOf: @@ -23994,7 +23518,6 @@ components: type: string type: array - type: 'null' - default: description: List of specific tool names that are allowed title: Tool Names title: AllowedToolsFilter @@ -24015,7 +23538,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Description of what the tool does title: Description required: @@ -24176,28 +23698,24 @@ components: anyOf: - type: string - type: 'null' - default: description: The data of the file to be sent to the model. title: File Data file_id: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id file_url: anyOf: - type: string - type: 'null' - default: description: The URL of the file to be sent to the model. title: File Url filename: anyOf: - type: string - type: 'null' - default: description: The name of the file to be sent to the model. title: Filename title: OpenAIResponseInputMessageContentFile @@ -24226,14 +23744,12 @@ components: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id image_url: anyOf: - type: string - type: 'null' - default: description: URL of the image content title: Image Url title: OpenAIResponseInputMessageContentImage @@ -24275,7 +23791,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: description: Additional filters to apply to the search title: Filters max_num_results: @@ -24291,7 +23806,6 @@ components: anyOf: - $ref: '#/components/schemas/SearchRankingOptions' - type: 'null' - default: description: Options for ranking and scoring search results required: - vector_store_ids @@ -24314,7 +23828,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Description of what the function does title: Description parameters: @@ -24322,14 +23835,12 @@ components: - additionalProperties: true type: object - type: 'null' - default: description: JSON schema defining the function's parameters title: Parameters strict: anyOf: - type: boolean - type: 'null' - default: description: Whether to enforce strict parameter validation title: Strict required: @@ -24436,13 +23947,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Id status: anyOf: - type: string - type: 'null' - default: title: Status required: - content @@ -24460,7 +23969,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseError' - type: 'null' - default: description: Error details if the response generation failed id: description: Unique identifier for this response @@ -24508,14 +24016,12 @@ components: anyOf: - type: string - type: 'null' - default: description: ID of the previous response in a conversation title: Previous Response Id prompt: anyOf: - $ref: '#/components/schemas/OpenAIResponsePrompt' - type: 'null' - default: description: Reference to a prompt template and its variables. status: description: Current status of the response generation @@ -24525,7 +24031,6 @@ components: anyOf: - type: number - type: 'null' - default: description: Sampling temperature used for generation title: Temperature text: @@ -24535,7 +24040,6 @@ components: anyOf: - type: number - type: 'null' - default: description: Nucleus sampling parameter used for generation title: Top P tools: @@ -24557,27 +24061,23 @@ components: - $ref: '#/components/schemas/OpenAIResponseToolMCP' type: array - type: 'null' - default: description: An array of tools the model may call while generating a response. title: Tools truncation: anyOf: - type: string - type: 'null' - default: description: Truncation strategy applied to the response title: Truncation usage: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsage' - type: 'null' - default: description: Token usage information for the response instructions: anyOf: - type: string - type: 'null' - default: description: System message inserted into the model's context title: Instructions required: @@ -24647,7 +24147,6 @@ components: $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' type: array - type: 'null' - default: description: Search results returned by the file search operation title: Results required: @@ -24713,14 +24212,12 @@ components: anyOf: - type: string - type: 'null' - default: description: Additional identifier for the tool call title: Id status: anyOf: - type: string - type: 'null' - default: description: Current status of the function call execution title: Status required: @@ -24758,14 +24255,12 @@ components: anyOf: - type: string - type: 'null' - default: description: Error message if the MCP call failed title: Error output: anyOf: - type: string - type: 'null' - default: description: Output result from the successful MCP call title: Output required: @@ -24848,14 +24343,12 @@ components: - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' type: object - type: 'null' - default: description: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files. title: Variables version: anyOf: - type: string - type: 'null' - default: description: Version number of the prompt to use (defaults to latest if not specified) title: Version required: @@ -24869,7 +24362,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseTextFormat' - type: 'null' - default: description: Text format configuration specifying output format requirements title: OpenAIResponseText type: object @@ -24928,7 +24420,6 @@ components: type: array - $ref: '#/components/schemas/AllowedToolsFilter' - type: 'null' - default: description: Restriction on which tools can be used from this server title: Allowed Tools required: @@ -24954,13 +24445,11 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' - type: 'null' - default: description: Detailed breakdown of input token usage output_tokens_details: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' - type: 'null' - default: description: Detailed breakdown of output token usage required: - input_tokens @@ -24975,7 +24464,6 @@ components: anyOf: - type: integer - type: 'null' - default: description: Number of tokens retrieved from cache title: Cached Tokens title: OpenAIResponseUsageInputTokensDetails @@ -24987,7 +24475,6 @@ components: anyOf: - type: integer - type: 'null' - default: description: Number of tokens used for reasoning (o1/o3 models) title: Reasoning Tokens title: OpenAIResponseUsageOutputTokensDetails @@ -24999,7 +24486,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Ranker score_threshold: anyOf: @@ -25202,7 +24688,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Description of what the tool does title: Description required: @@ -25347,28 +24832,24 @@ components: anyOf: - type: string - type: 'null' - default: description: The data of the file to be sent to the model. title: File Data file_id: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id file_url: anyOf: - type: string - type: 'null' - default: description: The URL of the file to be sent to the model. title: File Url filename: anyOf: - type: string - type: 'null' - default: description: The name of the file to be sent to the model. title: Filename title: OpenAIResponseInputMessageContentFile @@ -25397,14 +24878,12 @@ components: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id image_url: anyOf: - type: string - type: 'null' - default: description: URL of the image content title: Image Url title: OpenAIResponseInputMessageContentImage @@ -25502,13 +24981,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Id status: anyOf: - type: string - type: 'null' - default: title: Status required: - content @@ -25574,7 +25051,6 @@ components: $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' type: array - type: 'null' - default: description: Search results returned by the file search operation title: Results required: @@ -25640,14 +25116,12 @@ components: anyOf: - type: string - type: 'null' - default: description: Additional identifier for the tool call title: Id status: anyOf: - type: string - type: 'null' - default: description: Current status of the function call execution title: Status required: @@ -25685,14 +25159,12 @@ components: anyOf: - type: string - type: 'null' - default: description: Error message if the MCP call failed title: Error output: anyOf: - type: string - type: 'null' - default: description: Output result from the successful MCP call title: Output required: @@ -25819,7 +25291,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Description of what the tool does title: Description required: @@ -25964,28 +25435,24 @@ components: anyOf: - type: string - type: 'null' - default: description: The data of the file to be sent to the model. title: File Data file_id: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id file_url: anyOf: - type: string - type: 'null' - default: description: The URL of the file to be sent to the model. title: File Url filename: anyOf: - type: string - type: 'null' - default: description: The name of the file to be sent to the model. title: Filename title: OpenAIResponseInputMessageContentFile @@ -26014,14 +25481,12 @@ components: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id image_url: anyOf: - type: string - type: 'null' - default: description: URL of the image content title: Image Url title: OpenAIResponseInputMessageContentImage @@ -26119,13 +25584,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Id status: anyOf: - type: string - type: 'null' - default: title: Status required: - content @@ -26191,7 +25654,6 @@ components: $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' type: array - type: 'null' - default: description: Search results returned by the file search operation title: Results required: @@ -26257,14 +25719,12 @@ components: anyOf: - type: string - type: 'null' - default: description: Additional identifier for the tool call title: Id status: anyOf: - type: string - type: 'null' - default: description: Current status of the function call execution title: Status required: @@ -26302,14 +25762,12 @@ components: anyOf: - type: string - type: 'null' - default: description: Error message if the MCP call failed title: Error output: anyOf: - type: string - type: 'null' - default: description: Output result from the successful MCP call title: Output required: @@ -27070,7 +26528,6 @@ components: type: string type: array - type: 'null' - default: description: List of specific tool names that are allowed title: Tool Names title: AllowedToolsFilter @@ -27091,7 +26548,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Description of what the tool does title: Description required: @@ -27257,13 +26713,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Id status: anyOf: - type: string - type: 'null' - default: title: Status required: - call_id @@ -27283,28 +26737,24 @@ components: anyOf: - type: string - type: 'null' - default: description: The data of the file to be sent to the model. title: File Data file_id: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id file_url: anyOf: - type: string - type: 'null' - default: description: The URL of the file to be sent to the model. title: File Url filename: anyOf: - type: string - type: 'null' - default: description: The name of the file to be sent to the model. title: Filename title: OpenAIResponseInputMessageContentFile @@ -27333,14 +26783,12 @@ components: anyOf: - type: string - type: 'null' - default: description: The ID of the file to be sent to the model. title: File Id image_url: anyOf: - type: string - type: 'null' - default: description: URL of the image content title: Image Url title: OpenAIResponseInputMessageContentImage @@ -27382,7 +26830,6 @@ components: - additionalProperties: true type: object - type: 'null' - default: description: Additional filters to apply to the search title: Filters max_num_results: @@ -27398,7 +26845,6 @@ components: anyOf: - $ref: '#/components/schemas/SearchRankingOptions' - type: 'null' - default: description: Options for ranking and scoring search results required: - vector_store_ids @@ -27421,7 +26867,6 @@ components: anyOf: - type: string - type: 'null' - default: description: Description of what the function does title: Description parameters: @@ -27429,14 +26874,12 @@ components: - additionalProperties: true type: object - type: 'null' - default: description: JSON schema defining the function's parameters title: Parameters strict: anyOf: - type: boolean - type: 'null' - default: description: Whether to enforce strict parameter validation title: Strict required: @@ -27512,13 +26955,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Id reason: anyOf: - type: string - type: 'null' - default: title: Reason required: - approval_request_id @@ -27574,13 +27015,11 @@ components: anyOf: - type: string - type: 'null' - default: title: Id status: anyOf: - type: string - type: 'null' - default: title: Status required: - content @@ -27646,7 +27085,6 @@ components: $ref: '#/components/schemas/OpenAIResponseOutputMessageFileSearchToolCallResults' type: array - type: 'null' - default: description: Search results returned by the file search operation title: Results required: @@ -27712,14 +27150,12 @@ components: anyOf: - type: string - type: 'null' - default: description: Additional identifier for the tool call title: Id status: anyOf: - type: string - type: 'null' - default: description: Current status of the function call execution title: Status required: @@ -27757,14 +27193,12 @@ components: anyOf: - type: string - type: 'null' - default: description: Error message if the MCP call failed title: Error output: anyOf: - type: string - type: 'null' - default: description: Output result from the successful MCP call title: Output required: @@ -27847,14 +27281,12 @@ components: - $ref: '#/components/schemas/OpenAIResponseInputMessageContentFile' type: object - type: 'null' - default: description: Dictionary of variable names to OpenAIResponseInputMessageContent structure for template substitution. The substitution values can either be strings, or other Response input types like images or files. title: Variables version: anyOf: - type: string - type: 'null' - default: description: Version number of the prompt to use (defaults to latest if not specified) title: Version required: @@ -27868,7 +27300,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseTextFormat' - type: 'null' - default: description: Text format configuration specifying output format requirements title: OpenAIResponseText type: object @@ -27927,7 +27358,6 @@ components: type: array - $ref: '#/components/schemas/AllowedToolsFilter' - type: 'null' - default: description: Restriction on which tools can be used from this server title: Allowed Tools required: @@ -27953,13 +27383,11 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' - type: 'null' - default: description: Detailed breakdown of input token usage output_tokens_details: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' - type: 'null' - default: description: Detailed breakdown of output token usage required: - input_tokens @@ -27974,7 +27402,6 @@ components: anyOf: - type: integer - type: 'null' - default: description: Number of tokens retrieved from cache title: Cached Tokens title: OpenAIResponseUsageInputTokensDetails @@ -27986,7 +27413,6 @@ components: anyOf: - type: integer - type: 'null' - default: description: Number of tokens used for reasoning (o1/o3 models) title: Reasoning Tokens title: OpenAIResponseUsageOutputTokensDetails @@ -27998,7 +27424,6 @@ components: anyOf: - type: string - type: 'null' - default: title: Ranker score_threshold: anyOf: @@ -28018,7 +27443,6 @@ components: anyOf: - $ref: '#/components/schemas/OpenAIResponseError' - type: 'null' - default: description: Error details if the response generation failed id: description: Unique identifier for this response @@ -28066,14 +27490,12 @@ components: anyOf: - type: string - type: 'null' - default: description: ID of the previous response in a conversation title: Previous Response Id prompt: anyOf: - $ref: '#/components/schemas/OpenAIResponsePrompt' - type: 'null' - default: description: Reference to a prompt template and its variables. status: description: Current status of the response generation @@ -28083,7 +27505,6 @@ components: anyOf: - type: number - type: 'null' - default: description: Sampling temperature used for generation title: Temperature text: @@ -28093,7 +27514,6 @@ components: anyOf: - type: number - type: 'null' - default: description: Nucleus sampling parameter used for generation title: Top P tools: @@ -28115,27 +27535,23 @@ components: - $ref: '#/components/schemas/OpenAIResponseToolMCP' type: array - type: 'null' - default: description: An array of tools the model may call while generating a response. title: Tools truncation: anyOf: - type: string - type: 'null' - default: description: Truncation strategy applied to the response title: Truncation usage: anyOf: - $ref: '#/components/schemas/OpenAIResponseUsage' - type: 'null' - default: description: Token usage information for the response instructions: anyOf: - type: string - type: 'null' - default: description: System message inserted into the model's context title: Instructions input: @@ -28193,13 +27609,11 @@ components: anyOf: - $ref: '#/components/schemas/URL' - type: 'null' - default: data: anyOf: - type: string - type: 'null' contentEncoding: base64 - default: title: Data title: _URLOrData type: object diff --git a/scripts/fastapi_generator.py b/scripts/fastapi_generator.py index c0fa9bc4ab..4a653b5cc0 100755 --- a/scripts/fastapi_generator.py +++ b/scripts/fastapi_generator.py @@ -10,7 +10,6 @@ """ import importlib -import json from pathlib import Path from typing import Any @@ -177,21 +176,23 @@ def fix_refs(obj: Any) -> None: def _fix_schema_issues(openapi_schema: dict[str, Any]) -> dict[str, Any]: """ Fix common schema issues that cause OpenAPI validation problems. - This includes converting exclusiveMinimum numbers to minimum values and fixing string fields with null defaults. + This includes converting exclusiveMinimum numbers to minimum values and fixing invalid None defaults. """ if "components" not in openapi_schema or "schemas" not in openapi_schema["components"]: return openapi_schema schemas = openapi_schema["components"]["schemas"] - # Fix exclusiveMinimum issues - for _, schema_def in schemas.items(): - _fix_exclusive_minimum_in_schema(schema_def) + # Fix exclusiveMinimum issues and invalid None defaults + for schema_name, schema_def in schemas.items(): + if isinstance(schema_def, dict): + _fix_exclusive_minimum_in_schema(schema_def) + _fix_none_defaults_in_schema(schema_def, schema_name) return openapi_schema -def validate_openapi_schema(schema: dict[str, Any], schema_name: str = "OpenAPI schema") -> bool: +def validate_openapi_schema(schema: dict[str, Any] | None, schema_name: str = "OpenAPI schema") -> bool: """ Validate an OpenAPI schema using openapi-spec-validator. @@ -205,6 +206,26 @@ def validate_openapi_schema(schema: dict[str, Any], schema_name: str = "OpenAPI Raises: OpenAPIValidationError: If validation fails """ + if schema is None: + print(f"❌ {schema_name} is None") + return False + + # Ensure required OpenAPI structure exists + if "paths" not in schema: + schema["paths"] = {} + if "components" not in schema: + schema["components"] = {} + if not isinstance(schema["components"], dict): + schema["components"] = {} + if "schemas" not in schema["components"]: + schema["components"]["schemas"] = {} + if not isinstance(schema["components"]["schemas"], dict): + schema["components"]["schemas"] = {} + + # Ensure info section exists + if "info" not in schema: + schema["info"] = {"title": "API", "version": "1.0.0"} + try: validate_spec(schema) print(f"✅ {schema_name} is valid") @@ -240,6 +261,41 @@ def _fix_exclusive_minimum_in_schema(obj: Any) -> None: _fix_exclusive_minimum_in_schema(item) +# TODO: handle this in the Classes +def _fix_none_defaults_in_schema(obj: Any, path: str = "") -> None: + """ + Recursively fix invalid None defaults in schema objects. + Removes default values that are None to prevent discriminator validation errors and empty defaults in YAML. + """ + if isinstance(obj, dict): + # Remove None defaults - they cause issues with discriminator validation and create empty defaults in YAML + # For optional fields (int | None), None defaults are redundant and create empty "default:" in YAML + if "default" in obj and obj["default"] is None: + del obj["default"] + + # Recursively check all nested schemas + for key, value in obj.items(): + if key in ("properties", "items", "additionalProperties", "allOf", "anyOf", "oneOf"): + if isinstance(value, dict): + for sub_key, sub_value in value.items(): + if isinstance(sub_value, dict): + new_path = f"{path}.{sub_key}" if path else sub_key + _fix_none_defaults_in_schema(sub_value, new_path) + elif isinstance(value, list): + for i, item in enumerate(value): + if isinstance(item, dict): + new_path = f"{path}[{i}]" if path else f"[{i}]" + _fix_none_defaults_in_schema(item, new_path) + elif isinstance(value, dict): + new_path = f"{path}.{key}" if path else key + _fix_none_defaults_in_schema(value, new_path) + elif isinstance(value, list): + for i, item in enumerate(value): + if isinstance(item, dict): + new_path = f"{path}.{key}[{i}]" if path else f"{key}[{i}]" + _fix_none_defaults_in_schema(item, new_path) + + def _get_path_version(path: str) -> str | None: """ Determine the API version of a path based on its prefix. @@ -409,19 +465,28 @@ def _filter_schema( filtered_schema["paths"] = filtered_paths + # Ensure components structure exists + if "components" not in filtered_schema: + filtered_schema["components"] = {} + # Filter schemas/components if requested - if filter_schemas and "components" in filtered_schema and "schemas" in filtered_schema["components"]: - referenced_schemas = _find_schemas_referenced_by_paths(filtered_paths, openapi_schema) - filtered_schema["components"]["schemas"] = { - name: schema - for name, schema in filtered_schema["components"]["schemas"].items() - if name in referenced_schemas - } + if filter_schemas and "schemas" in filtered_schema.get("components", {}): + try: + referenced_schemas = _find_schemas_referenced_by_paths(filtered_paths, openapi_schema) + filtered_schema["components"]["schemas"] = { + name: schema + for name, schema in filtered_schema["components"]["schemas"].items() + if name in referenced_schemas + } + except Exception: + # If schema reference finding fails, keep all schemas + pass + elif "schemas" not in filtered_schema["components"]: + # Ensure schemas section exists even if empty + filtered_schema["components"]["schemas"] = {} # Preserve $defs section if it exists - if "components" in openapi_schema and "$defs" in openapi_schema["components"]: - if "components" not in filtered_schema: - filtered_schema["components"] = {} + if "components" in openapi_schema and "$defs" in openapi_schema.get("components", {}): filtered_schema["components"]["$defs"] = openapi_schema["components"]["$defs"] return filtered_schema @@ -448,12 +513,17 @@ def _find_schemas_referenced_by_paths(filtered_paths: dict[str, Any], openapi_sc referenced_schemas.update(_find_schema_refs_in_object(operation)) # Also check the responses section for schema references - if "components" in openapi_schema and "responses" in openapi_schema["components"]: - referenced_schemas.update(_find_schema_refs_in_object(openapi_schema["components"]["responses"])) + components = openapi_schema.get("components") + if components and isinstance(components, dict) and "responses" in components: + referenced_schemas.update(_find_schema_refs_in_object(components["responses"])) # Also include schemas that are referenced by other schemas (transitive references) # This ensures we include all dependencies - all_schemas = openapi_schema.get("components", {}).get("schemas", {}) + all_schemas = {} + if components and isinstance(components, dict): + all_schemas = components.get("schemas", {}) + if not isinstance(all_schemas, dict): + all_schemas = {} additional_schemas = set() for schema_name in referenced_schemas: